paces 0.0.22__tar.gz → 0.0.23__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. {paces-0.0.22 → paces-0.0.23}/PKG-INFO +1 -1
  2. {paces-0.0.22 → paces-0.0.23}/paces/segmenters.py +2 -2
  3. {paces-0.0.22 → paces-0.0.23}/pyproject.toml +1 -1
  4. {paces-0.0.22 → paces-0.0.23}/tests/test_segment.py +30 -1
  5. {paces-0.0.22 → paces-0.0.23}/.gitignore +0 -0
  6. {paces-0.0.22 → paces-0.0.23}/LICENSE +0 -0
  7. {paces-0.0.22 → paces-0.0.23}/README.md +0 -0
  8. {paces-0.0.22 → paces-0.0.23}/docs/README.md +0 -0
  9. {paces-0.0.22 → paces-0.0.23}/docs/alignment/README.md +0 -0
  10. {paces-0.0.22 → paces-0.0.23}/docs/poc-reference/README.md +0 -0
  11. {paces-0.0.22 → paces-0.0.23}/docs/poc-reference/artifacts/clips.json +0 -0
  12. {paces-0.0.22 → paces-0.0.23}/paces/__init__.py +0 -0
  13. {paces-0.0.22 → paces-0.0.23}/paces/__main__.py +0 -0
  14. {paces-0.0.22 → paces-0.0.23}/paces/ask.py +0 -0
  15. {paces-0.0.22 → paces-0.0.23}/paces/bodies/__init__.py +0 -0
  16. {paces-0.0.22 → paces-0.0.23}/paces/bodies/_base.py +0 -0
  17. {paces-0.0.22 → paces-0.0.23}/paces/bodies/derivation.py +0 -0
  18. {paces-0.0.22 → paces-0.0.23}/paces/bodies/document.py +0 -0
  19. {paces-0.0.22 → paces-0.0.23}/paces/bodies/signal.py +0 -0
  20. {paces-0.0.22 → paces-0.0.23}/paces/bodies/step.py +0 -0
  21. {paces-0.0.22 → paces-0.0.23}/paces/corrections.py +0 -0
  22. {paces-0.0.22 → paces-0.0.23}/paces/cues.py +0 -0
  23. {paces-0.0.22 → paces-0.0.23}/paces/data/ask/ask.css +0 -0
  24. {paces-0.0.22 → paces-0.0.23}/paces/data/ask/ask.html +0 -0
  25. {paces-0.0.22 → paces-0.0.23}/paces/data/ask/ask.js +0 -0
  26. {paces-0.0.22 → paces-0.0.23}/paces/derivation.py +0 -0
  27. {paces-0.0.22 → paces-0.0.23}/paces/edits.py +0 -0
  28. {paces-0.0.22 → paces-0.0.23}/paces/evidence.py +0 -0
  29. {paces-0.0.22 → paces-0.0.23}/paces/excerpts.py +0 -0
  30. {paces-0.0.22 → paces-0.0.23}/paces/measure.py +0 -0
  31. {paces-0.0.22 → paces-0.0.23}/paces/model.py +0 -0
  32. {paces-0.0.22 → paces-0.0.23}/paces/pose.py +0 -0
  33. {paces-0.0.22 → paces-0.0.23}/paces/projection.py +0 -0
  34. {paces-0.0.22 → paces-0.0.23}/paces/render.py +0 -0
  35. {paces-0.0.22 → paces-0.0.23}/paces/segmentation.py +0 -0
  36. {paces-0.0.22 → paces-0.0.23}/paces/timed_text.py +0 -0
  37. {paces-0.0.22 → paces-0.0.23}/paces/tools.py +0 -0
  38. {paces-0.0.22 → paces-0.0.23}/tests/audio_synth.py +0 -0
  39. {paces-0.0.22 → paces-0.0.23}/tests/data/body_schemas.json +0 -0
  40. {paces-0.0.22 → paces-0.0.23}/tests/data/routine.json +0 -0
  41. {paces-0.0.22 → paces-0.0.23}/tests/poc_fixture.py +0 -0
  42. {paces-0.0.22 → paces-0.0.23}/tests/test_ask.py +0 -0
  43. {paces-0.0.22 → paces-0.0.23}/tests/test_chapters.py +0 -0
  44. {paces-0.0.22 → paces-0.0.23}/tests/test_cli_surface.py +0 -0
  45. {paces-0.0.22 → paces-0.0.23}/tests/test_corrections.py +0 -0
  46. {paces-0.0.22 → paces-0.0.23}/tests/test_cues.py +0 -0
  47. {paces-0.0.22 → paces-0.0.23}/tests/test_derivation.py +0 -0
  48. {paces-0.0.22 → paces-0.0.23}/tests/test_edit_protection_residuals.py +0 -0
  49. {paces-0.0.22 → paces-0.0.23}/tests/test_edits.py +0 -0
  50. {paces-0.0.22 → paces-0.0.23}/tests/test_evidence.py +0 -0
  51. {paces-0.0.22 → paces-0.0.23}/tests/test_evidence_schemas.py +0 -0
  52. {paces-0.0.22 → paces-0.0.23}/tests/test_excerpts.py +0 -0
  53. {paces-0.0.22 → paces-0.0.23}/tests/test_measure.py +0 -0
  54. {paces-0.0.22 → paces-0.0.23}/tests/test_pose.py +0 -0
  55. {paces-0.0.22 → paces-0.0.23}/tests/test_render_media.py +0 -0
  56. {paces-0.0.22 → paces-0.0.23}/tests/test_roundtrip_poc.py +0 -0
  57. {paces-0.0.22 → paces-0.0.23}/tests/test_smoke.py +0 -0
  58. {paces-0.0.22 → paces-0.0.23}/tests/test_vertical_slice.py +0 -0
  59. {paces-0.0.22 → paces-0.0.23}/tests/video_synth.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: paces
3
- Version: 0.0.22
3
+ Version: 0.0.23
4
4
  Summary: Turn instructional media into structured, interactive learning material
5
5
  Project-URL: Homepage, https://github.com/thorwhalen/paces
6
6
  Project-URL: Repository, https://github.com/thorwhalen/paces
@@ -386,8 +386,8 @@ def _facts(
386
386
  facts.add("steps")
387
387
  if not _undated_ids(steps):
388
388
  facts.add("steps.durations") # children too: placement needs them all
389
- if any(row["spans"] for row in steps):
390
- facts.add("steps.spans")
389
+ if any(row["spans"] for row in _walk_rows(steps)):
390
+ facts.add("steps.spans") # like steps.durations: the whole tree
391
391
  if boundaries:
392
392
  facts.add("boundaries")
393
393
  if grid is not None and grid.tempo_bpm is not None and grid.origin is not None:
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "paces"
9
- version = "0.0.22"
9
+ version = "0.0.23"
10
10
  description = "Turn instructional media into structured, interactive learning material"
11
11
  readme = "README.md"
12
12
  license = "MIT"
@@ -8,7 +8,13 @@ import pytest
8
8
 
9
9
  from paces.model import MetricGrid
10
10
  from paces.projection import to_document
11
- from paces.segmenters import Capability, capabilities, register, segment
11
+ from paces.segmenters import (
12
+ Capability,
13
+ Segmentation,
14
+ capabilities,
15
+ register,
16
+ segment,
17
+ )
12
18
 
13
19
  GRID = {"unit": "eight", "subdivisions": 8, "tempoBpm": "129.2", "origin": "51.2"}
14
20
  #: The POC routine as (name, eights) pairs — kickoff's "common real case".
@@ -337,3 +343,26 @@ def test_grid_measured_rejects_bad_durations_before_measuring(
337
343
  steps = [("a", 1), {"name": "p", "duration": 2, "children": [("c", bad)]}]
338
344
  with pytest.raises(ValueError, match=r"positive, finite durations: \['c'\]"):
339
345
  segment(str(media), steps=steps, segmenter="grid-measured")
346
+
347
+
348
+ def _spans_reader(inputs):
349
+ return Segmentation(boundaries=(0.0, 1.0))
350
+
351
+
352
+ def test_the_spans_fact_reads_the_whole_step_tree():
353
+ """A span on a child counts, as a duration on a child does (#51): a
354
+ segmenter that needs ``steps.spans`` is selectable from a nested span."""
355
+ needs_spans = Capability(
356
+ name="needs-spans",
357
+ gives="segmentation",
358
+ summary="test double",
359
+ target=f"{__name__}:_spans_reader",
360
+ needs=frozenset({"steps", "steps.spans"}),
361
+ )
362
+ catalog = {"needs-spans": needs_spans}
363
+ nested = [
364
+ {"name": "p", "duration": 2, "children": [{"name": "c", "spans": [(1, 2)]}]}
365
+ ]
366
+ assert segment(steps=nested, catalog=catalog).method == "needs-spans"
367
+ refused = segment(steps=[("p", 2)], catalog=catalog)
368
+ assert refused.method == "" and "no-signal" in refused.flags
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes