kernpy 1.0.1__tar.gz → 1.0.2__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.
- {kernpy-1.0.1 → kernpy-1.0.2}/PKG-INFO +11 -11
- {kernpy-1.0.1 → kernpy-1.0.2}/README.md +10 -10
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/get-started/tutorial.md +8 -8
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/exporter.py +2 -2
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/tokenizers.py +1 -1
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/io/public.py +17 -15
- {kernpy-1.0.1 → kernpy-1.0.2}/pyproject.toml +1 -1
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_exporter.py +1 -1
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_humdrum_importer.py +4 -4
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_tokenizer.py +14 -14
- {kernpy-1.0.1 → kernpy-1.0.2}/.github/workflows/publish-pypi.yml +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/.github/workflows/run-tests.yml +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/.github/workflows/update-docs.yml +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/.gitignore +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/CONTRIBUTING.md +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/License +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/antlr-4.13.1-complete.jar +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/antlr4.sh +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/about.md +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/assets/001.svg +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/assets/book.svg +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/assets/learn.svg +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/assets/meeting.svg +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/assets/running.svg +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/css/extra.css +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/docs_requirements.txt +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/get-started.md +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/how-to-guides.md +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/index.md +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/overrides/partials/footer.html +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/reference.md +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/docs/requirements.txt +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/gen/kernLexer.interp +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/gen/kernLexer.java +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/gen/kernLexer.tokens +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kern/kernSpineLexer.g4 +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kern/kernSpineLexer.tokens +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kern/kernSpineParser.g4 +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kern/kernSpineParser.tokens +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/__init__.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/__main__.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/__init__.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/_io.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/base_antlr_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/base_antlr_spine_parser_listener.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/basic_spine_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/document.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/dyn_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/dynam_spine_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/error_listener.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/fing_spine_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/generated/kernSpineLexer.interp +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/generated/kernSpineLexer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/generated/kernSpineLexer.tokens +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/generated/kernSpineParser.interp +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/generated/kernSpineParser.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/generated/kernSpineParser.tokens +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/generated/kernSpineParserListener.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/generated/kernSpineParserVisitor.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/generic.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/gkern.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/graphviz_exporter.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/harm_spine_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/import_humdrum_old.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/importer_factory.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/kern_spine_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/mens_spine_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/mhxm_spine_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/pitch_models.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/root_spine_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/spine_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/text_spine_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/tokens.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/core/transposer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/io/__init__.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/polish_scores/__init__.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/polish_scores/download_polish_dataset.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/polish_scores/iiif.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/test_grammar.sh +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/util/__init__.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/util/helpers.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/util/store_cache.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/kernpy/visualize_analysis.sh +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/legacy-parsers-not-used/kernLexer.g4 +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/legacy-parsers-not-used/kernParser.g4 +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/mkdocs.yml +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/requirements.txt +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/__init__.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/pytest.ini +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/all.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/all_less_decorators.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/all_less_durations.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/all_less_note_rest.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/all_less_pitches.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/concerto-piano-12-allegro_with_all.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/concerto-piano-12-allegro_without_barlines.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/concerto-piano-12-allegro_without_harmony.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/concerto-piano-12-allegro_without_only_signatures.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/empty.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/only_barlines.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/only_decorators.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/only_durations.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/categories/only_pitches.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_0.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_0_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_1.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_10.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_10_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_11.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_11_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_1_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_2.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_2_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_3.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_3_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_4.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_4_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_5.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_5_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_6.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_7.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_7_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_8.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_8_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_9.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/concat/0_9_merged.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/input/sub/chor001.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/input/sub/chor002.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-1-to-3.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-10-to-12.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-11-to-13.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-12-to-14.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-13-to-15.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-14-to-16.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-15-to-17.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-16-to-18.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-17-to-19.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-18-to-20.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-19-to-21.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-2-to-4.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-20-to-22.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-21-to-23.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-22-to-24.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-3-to-5.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-4-to-6.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-5-to-7.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-6-to-8.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-7-to-9.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-8-to-10.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-9-to-11.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor002/from-1-to-5.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor002/from-2-to-6.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor002/from-3-to-7.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor002/from-4-to-8.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor002/from-5-to-9.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/grandstaff/5901766-m24-to-m28.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/grandstaff/5901766.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/hierarchy/tree.txt +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/kern-scores/beethoven_sonata_12_4.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet_longer.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet_longer_m2-m4.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet_longer_m2-m4.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet_longer_m3-m3.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet_longer_plus_octave.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-all_tokens.txt +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-m1-to-m3.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-metadata-generic.txt +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-unique_tokens.txt +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-unique_tokens_with_category.txt +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-unique_tokens_without_measure_numbers.txt +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/chor001.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/chor001.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/chor009.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/chor048.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-1.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-1.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-2.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-3.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-3.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-4.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-4.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide06-example6-1.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide06-example6-1.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide06-example6-2.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/guide06-example6-2.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/kern2ekern.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/kern2ekern.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/spines_lexer.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/spines_lexer.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/spline_split.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/spline_split_piston070.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/legacy/spline_split_piston070.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/metadata/frequency.json +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/mozart/concerto-piano-12-allegro-left-hand.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/mozart/concerto-piano-12-allegro-right-hand-and-dyn.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/mozart/concerto-piano-12-allegro-right-hand.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/mozart/concerto-piano-12-allegro.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/mozart/divertimento-quartet.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/10.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/10.jpg +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/11.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/11.jpg +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/9.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/9.jpg +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante-m1-to-m16.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante-m1-to-m2.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante-m1-to-m3.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test2/pl-wn--mus-iii-123-982--001-004_wieniawski-henryk--l-ecole-moderne-etudes-caprices-pour-violon-seul-op-10-4-le-staccato-m0-to-m1.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test2/pl-wn--mus-iii-123-982--001-004_wieniawski-henryk--l-ecole-moderne-etudes-caprices-pour-violon-seul-op-10-4-le-staccato-m1-to-m2.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test2/pl-wn--mus-iii-123-982--001-004_wieniawski-henryk--l-ecole-moderne-etudes-caprices-pour-violon-seul-op-10-4-le-staccato.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/polish/test3/pl-wn--sd-xvi-qu-273--001-020_gomolka-mikolaj--melodiae-na-psalterz-polski-xx-wsiadaj-z-dobrym-sercem-o-krolu-cnotliwy.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/any_header.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/bach-brandenburg-bwv1050a.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/bach-chorale-chor205.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/corelli-op01n12d.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/harmonized-song-erk052.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/haydn-quartet-op54n2-01.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/haydn-sonate-15_1-original.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/haydn-sonate-15_1-output.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/jazzmus_with_mxhm.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/permutations_of_2.bb-_ .krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/piano-beethoven-sonata21-3.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/piano-chopin-prelude28-17.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/piano-hummel-prelude67-15.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/piano-joplin-bethena.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/piano-mozart-sonata07-3.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/piano-scarlatti-L523K205.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/quartet-beethoven-quartet13-6.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/quartet-mozart-k590-04.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/score_with_dividing_one_spine.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/score_with_dividing_one_spine_m9-m13.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/score_with_dividing_two_spines.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/score_with_dividing_two_spines_m49-m56.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/unaccompanied-songs-nova073.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/unexpected_header.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/wrong_header.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/wrong_number_of_columns.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/samples/wrong_number_of_columns_fixed.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/1.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/2-m2-to-m2.ekrn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/2.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/3.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/4.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/5.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/concerto-piano-12-allegro_only_kern_and_harm.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/non_stacked_ends.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/non_stacked_ends_2.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/spines-from-piano-joplin-bethena-start.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/spines/spines-piano-hummel-prelude67-15.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/accidentals.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/accidentals_alteration_display.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/articulations.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/auto_beaming.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/bars.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/beaming.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/chords.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/clefs.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/headers.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/key.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/key_designation.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/mensurations.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/minimal.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/minimal_incorrect.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/modal.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/octaves.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/ornaments.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/rests.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/rhythm.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/slurs.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/ties.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/resource_dir/unit/time.krn +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_deprecated.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_document.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_download_polish_scores.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_export_options.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_generic.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_gkern.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_importer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_main_cli_api.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_root_spine_root.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_spine_imoprter_dynam.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_spine_importer_basic.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_spine_importer_dyn.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_spine_importer_fing.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_spine_importer_harm.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_spine_importer_kern.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_spine_importer_mxhm.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_spine_importer_text.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_token.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_transposer.py +0 -0
- {kernpy-1.0.1 → kernpy-1.0.2}/test/test_util_store_cache.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: kernpy
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.2
|
4
4
|
Summary: Python Humdrum **kern and **mens utilities
|
5
5
|
Project-URL: Homepage, https://github.com/OMR-PRAIG-UA-ES/kernpy
|
6
6
|
Project-URL: Documentation, https://github.com/OMR-PRAIG-UA-ES/kernpy#readme
|
@@ -174,32 +174,32 @@ kp.dump(document, "newfile_custom.krn",
|
|
174
174
|
print(kp.BEKERN_CATEGORIES)
|
175
175
|
```
|
176
176
|
|
177
|
-
- Use `
|
177
|
+
- Use `encoding` to select how the categories are split. By default, the `normalizedKern` encoding is used.
|
178
178
|
|
179
179
|
```python
|
180
180
|
import kernpy as kp
|
181
181
|
|
182
182
|
kp.dump(document, "newfile_normalized.krn",
|
183
|
-
|
183
|
+
encoding=kp.Encoding.normalizedKern) # Default encoding
|
184
184
|
```
|
185
|
-
Select the proper Humdrum **kern
|
185
|
+
Select the proper Humdrum **kern encoding:
|
186
186
|
|
187
|
-
`kernpy` provides different
|
187
|
+
`kernpy` provides different encodings to export the content each symbol in different formats.
|
188
188
|
|
189
|
-
| Encoding |
|
189
|
+
| Encoding | Output | Description |
|
190
190
|
|----------|--------------|----------------------------------------|
|
191
191
|
| kern | 2.bb-_L | Traditional Humdrum **kern encoding |
|
192
192
|
| ekern | 2@.@bb@-·_·L | Extended Humdrum **kern encoding |
|
193
193
|
|
194
|
-
Use the `Encoding` enum class to select the
|
194
|
+
Use the `Encoding` enum class to select the encoding:
|
195
195
|
|
196
196
|
```python
|
197
197
|
import kernpy as kp
|
198
198
|
|
199
199
|
doc, _ = kp.load('resource_dir/legacy/chor048.krn')
|
200
200
|
|
201
|
-
kern_content = kp.dumps(doc,
|
202
|
-
ekern_content = kp.dumps(doc,
|
201
|
+
kern_content = kp.dumps(doc, encoding=kp.Encoding.normalizedKern)
|
202
|
+
ekern_content = kp.dumps(doc, encoding=kp.Encoding.eKern)
|
203
203
|
```
|
204
204
|
|
205
205
|
- Use `from_measure` and `to_measure` to select the measures to export. By default, all the measures are exported.
|
@@ -236,7 +236,7 @@ kp.dump(document, "newfile.krn",
|
|
236
236
|
spine_types=['**kern'], # Export only the **kern spines
|
237
237
|
include=kp.BEKERN_CATEGORIES, # Token categories to include
|
238
238
|
exclude={kp.TokenCategory.PITCH}, # Token categories to exclude
|
239
|
-
|
239
|
+
encoding=kp.Encoding.eKern, # Kern encoding
|
240
240
|
from_measure=1, # First from measure 1
|
241
241
|
to_measure=10, # Last measure exported
|
242
242
|
spine_ids=[0, 1], # Export only the first and the second spine
|
@@ -339,7 +339,7 @@ for page_label, bounding_box_measure in doc.page_bounding_boxes.items():
|
|
339
339
|
kp.dump(doc, f"foo_{page_label}.ekrn",
|
340
340
|
spine_types=['**kern'],
|
341
341
|
token_categories=kp.BEKERN_CATEGORIES,
|
342
|
-
|
342
|
+
encoding=kp.Encoding.eKern,
|
343
343
|
from_measure=bounding_box_measure.from_measure,
|
344
344
|
to_measure=bounding_box_measure.to_measure - 1 # TODO: Check bounds
|
345
345
|
)
|
@@ -155,32 +155,32 @@ kp.dump(document, "newfile_custom.krn",
|
|
155
155
|
print(kp.BEKERN_CATEGORIES)
|
156
156
|
```
|
157
157
|
|
158
|
-
- Use `
|
158
|
+
- Use `encoding` to select how the categories are split. By default, the `normalizedKern` encoding is used.
|
159
159
|
|
160
160
|
```python
|
161
161
|
import kernpy as kp
|
162
162
|
|
163
163
|
kp.dump(document, "newfile_normalized.krn",
|
164
|
-
|
164
|
+
encoding=kp.Encoding.normalizedKern) # Default encoding
|
165
165
|
```
|
166
|
-
Select the proper Humdrum **kern
|
166
|
+
Select the proper Humdrum **kern encoding:
|
167
167
|
|
168
|
-
`kernpy` provides different
|
168
|
+
`kernpy` provides different encodings to export the content each symbol in different formats.
|
169
169
|
|
170
|
-
| Encoding |
|
170
|
+
| Encoding | Output | Description |
|
171
171
|
|----------|--------------|----------------------------------------|
|
172
172
|
| kern | 2.bb-_L | Traditional Humdrum **kern encoding |
|
173
173
|
| ekern | 2@.@bb@-·_·L | Extended Humdrum **kern encoding |
|
174
174
|
|
175
|
-
Use the `Encoding` enum class to select the
|
175
|
+
Use the `Encoding` enum class to select the encoding:
|
176
176
|
|
177
177
|
```python
|
178
178
|
import kernpy as kp
|
179
179
|
|
180
180
|
doc, _ = kp.load('resource_dir/legacy/chor048.krn')
|
181
181
|
|
182
|
-
kern_content = kp.dumps(doc,
|
183
|
-
ekern_content = kp.dumps(doc,
|
182
|
+
kern_content = kp.dumps(doc, encoding=kp.Encoding.normalizedKern)
|
183
|
+
ekern_content = kp.dumps(doc, encoding=kp.Encoding.eKern)
|
184
184
|
```
|
185
185
|
|
186
186
|
- Use `from_measure` and `to_measure` to select the measures to export. By default, all the measures are exported.
|
@@ -217,7 +217,7 @@ kp.dump(document, "newfile.krn",
|
|
217
217
|
spine_types=['**kern'], # Export only the **kern spines
|
218
218
|
include=kp.BEKERN_CATEGORIES, # Token categories to include
|
219
219
|
exclude={kp.TokenCategory.PITCH}, # Token categories to exclude
|
220
|
-
|
220
|
+
encoding=kp.Encoding.eKern, # Kern encoding
|
221
221
|
from_measure=1, # First from measure 1
|
222
222
|
to_measure=10, # Last measure exported
|
223
223
|
spine_ids=[0, 1], # Export only the first and the second spine
|
@@ -320,7 +320,7 @@ for page_label, bounding_box_measure in doc.page_bounding_boxes.items():
|
|
320
320
|
kp.dump(doc, f"foo_{page_label}.ekrn",
|
321
321
|
spine_types=['**kern'],
|
322
322
|
token_categories=kp.BEKERN_CATEGORIES,
|
323
|
-
|
323
|
+
encoding=kp.Encoding.eKern,
|
324
324
|
from_measure=bounding_box_measure.from_measure,
|
325
325
|
to_measure=bounding_box_measure.to_measure - 1 # TODO: Check bounds
|
326
326
|
)
|
@@ -117,15 +117,15 @@ kp.dump(document, "newfile_custom.krn",
|
|
117
117
|
exclude={kp.TokenCategory.PITCH})
|
118
118
|
```
|
119
119
|
|
120
|
-
- Use `
|
120
|
+
- Use `encoding` to select how the categories are split. By default, the `normalizedKern` encoding is used.
|
121
121
|
|
122
122
|
```python
|
123
123
|
import kernpy as kp
|
124
124
|
|
125
125
|
kp.dump(document, "newfile_normalized.krn",
|
126
|
-
|
126
|
+
encoding=kp.Encoding.normalizedKern) # Default encoding
|
127
127
|
```
|
128
|
-
Select the proper Humdrum **kern
|
128
|
+
Select the proper Humdrum **kern encoding:
|
129
129
|
|
130
130
|
`kernpy` provides different tokenizers to export the content each symbol in different formats.
|
131
131
|
|
@@ -134,15 +134,15 @@ Select the proper Humdrum **kern tokenizer:
|
|
134
134
|
| kern | 2.bb-_L | Traditional Humdrum **kern encoding |
|
135
135
|
| ekern | 2@.@bb@-·_·L | Extended Humdrum **kern encoding |
|
136
136
|
|
137
|
-
Use the `Encoding` enum class to select the
|
137
|
+
Use the `Encoding` enum class to select the encoding:
|
138
138
|
|
139
139
|
```python
|
140
140
|
import kernpy as kp
|
141
141
|
|
142
142
|
doc, _ = kp.load('resource_dir/legacy/chor048.krn')
|
143
143
|
|
144
|
-
kern_content = kp.dumps(doc,
|
145
|
-
ekern_content = kp.dumps(doc,
|
144
|
+
kern_content = kp.dumps(doc, encoding=kp.Encoding.normalizedKern)
|
145
|
+
ekern_content = kp.dumps(doc, encoding=kp.Encoding.eKern)
|
146
146
|
```
|
147
147
|
|
148
148
|
- Use `from_measure` and `to_measure` to select the measures to export. By default, all the measures are exported.
|
@@ -179,7 +179,7 @@ kp.dump(document, "newfile.krn",
|
|
179
179
|
spine_types=['**kern'], # Export only the **kern spines
|
180
180
|
include=kp.BEKERN_CATEGORIES, # Token categories to include
|
181
181
|
exclude={kp.TokenCategory.PITCH}, # Token categories to exclude
|
182
|
-
|
182
|
+
encoding=kp.Encoding.eKern, # Kern encoding
|
183
183
|
from_measure=1, # First from measure 1
|
184
184
|
to_measure=10, # Last measure exported
|
185
185
|
spine_ids=[0, 1], # Export only the first and the second spine
|
@@ -282,7 +282,7 @@ for page_label, bounding_box_measure in doc.page_bounding_boxes.items():
|
|
282
282
|
kp.dump(doc, f"foo_{page_label}.ekrn",
|
283
283
|
spine_types=['**kern'],
|
284
284
|
token_categories=kp.BEKERN_CATEGORIES,
|
285
|
-
|
285
|
+
encoding=kp.Encoding.eKern,
|
286
286
|
from_measure=bounding_box_measure.from_measure,
|
287
287
|
to_measure=bounding_box_measure.to_measure - 1 # TODO: Check bounds
|
288
288
|
)
|
@@ -153,7 +153,7 @@ class HeaderTokenGenerator:
|
|
153
153
|
"""
|
154
154
|
HeaderTokenGenerator class.
|
155
155
|
|
156
|
-
This class is used to translate the HeaderTokens to the specific
|
156
|
+
This class is used to translate the HeaderTokens to the specific encoding format.
|
157
157
|
"""
|
158
158
|
@classmethod
|
159
159
|
def new(cls, *, token: HeaderToken, type: Encoding):
|
@@ -162,7 +162,7 @@ class HeaderTokenGenerator:
|
|
162
162
|
|
163
163
|
Args:
|
164
164
|
token (HeaderToken): The HeaderToken to be translated.
|
165
|
-
type (Encoding): The
|
165
|
+
type (Encoding): The encoding to be used.
|
166
166
|
|
167
167
|
Examples:
|
168
168
|
>>> header = HeaderToken('**kern', 0)
|
@@ -18,7 +18,7 @@ class Encoding(Enum): # TODO: Eventually, polymorphism will be used to export d
|
|
18
18
|
>>> doc, _ = kp.load('path/to/file.krn')
|
19
19
|
>>>
|
20
20
|
>>> # Save the file using the specified encoding
|
21
|
-
>>> exported_content = kp.dumps(
|
21
|
+
>>> exported_content = kp.dumps(encoding=kp.Encoding.normalizedKern)
|
22
22
|
"""
|
23
23
|
eKern = 'ekern'
|
24
24
|
normalizedKern = 'kern'
|
@@ -12,7 +12,9 @@ from kernpy import Encoding
|
|
12
12
|
from kernpy.core import (
|
13
13
|
Document, Importer, Exporter, ExportOptions, GraphvizExporter,
|
14
14
|
generic,
|
15
|
-
TokenCategoryHierarchyMapper
|
15
|
+
TokenCategoryHierarchyMapper,
|
16
|
+
TokenCategory,
|
17
|
+
)
|
16
18
|
|
17
19
|
|
18
20
|
def load(fp: Union[str, Path], *, raise_on_errors: Optional[bool] = False, **kwargs) -> (Document, List[str]):
|
@@ -84,13 +86,13 @@ def loads(s, *, raise_on_errors: Optional[bool] = False, **kwargs) -> (Document,
|
|
84
86
|
|
85
87
|
|
86
88
|
def dump(document: Document, fp: Union[str, Path], *,
|
87
|
-
spine_types: [] = None,
|
88
|
-
include: [] = None,
|
89
|
-
exclude: [] = None,
|
89
|
+
spine_types: [str] = None,
|
90
|
+
include: [TokenCategory] = None,
|
91
|
+
exclude: [TokenCategory] = None,
|
90
92
|
from_measure: int = None,
|
91
93
|
to_measure: int = None,
|
92
|
-
|
93
|
-
instruments: [] = None,
|
94
|
+
encoding: Encoding = None,
|
95
|
+
instruments: [str] = None,
|
94
96
|
show_measure_numbers: bool = None,
|
95
97
|
spine_ids: [int] = None
|
96
98
|
) -> None:
|
@@ -104,7 +106,7 @@ def dump(document: Document, fp: Union[str, Path], *,
|
|
104
106
|
exclude (Iterable): The token categories to exclude from the exported file. When None, no token categories will be excluded.
|
105
107
|
from_measure (int): The measure to start exporting. When None, the exporter will start from the beginning of the file. The first measure is 1
|
106
108
|
to_measure (int): The measure to end exporting. When None, the exporter will end at the end of the file.
|
107
|
-
|
109
|
+
encoding (Encoding): The type of the **kern file to export.
|
108
110
|
instruments (Iterable): The instruments to export. If None, all the instruments will be exported.
|
109
111
|
show_measure_numbers (Bool): Show the measure numbers in the exported file.
|
110
112
|
spine_ids (Iterable): The ids of the spines to export. When None, all the spines will be exported. \
|
@@ -130,7 +132,7 @@ def dump(document: Document, fp: Union[str, Path], *,
|
|
130
132
|
exclude=exclude,
|
131
133
|
from_measure=from_measure,
|
132
134
|
to_measure=to_measure,
|
133
|
-
kern_type=
|
135
|
+
kern_type=encoding,
|
134
136
|
instruments=instruments,
|
135
137
|
show_measure_numbers=show_measure_numbers,
|
136
138
|
spine_ids=spine_ids
|
@@ -144,13 +146,13 @@ def dump(document: Document, fp: Union[str, Path], *,
|
|
144
146
|
|
145
147
|
|
146
148
|
def dumps(document: Document, *,
|
147
|
-
spine_types: [] = None,
|
148
|
-
include: [] = None,
|
149
|
-
exclude: [] = None,
|
149
|
+
spine_types: [str] = None,
|
150
|
+
include: [TokenCategory] = None,
|
151
|
+
exclude: [TokenCategory] = None,
|
150
152
|
from_measure: int = None,
|
151
153
|
to_measure: int = None,
|
152
|
-
|
153
|
-
instruments: [] = None,
|
154
|
+
encoding: Encoding = None,
|
155
|
+
instruments: [str] = None,
|
154
156
|
show_measure_numbers: bool = None,
|
155
157
|
spine_ids: [int] = None
|
156
158
|
) -> str:
|
@@ -164,7 +166,7 @@ def dumps(document: Document, *,
|
|
164
166
|
exclude (Iterable): The token categories to exclude from the exported file. When None, no token categories will be excluded.
|
165
167
|
from_measure (int): The measure to start exporting. When None, the exporter will start from the beginning of the file. The first measure is 1
|
166
168
|
to_measure (int): The measure to end exporting. When None, the exporter will end at the end of the file.
|
167
|
-
|
169
|
+
encoding (Encoding): The type of the **kern file to export.
|
168
170
|
instruments (Iterable): The instruments to export. If None, all the instruments will be exported.
|
169
171
|
show_measure_numbers (Bool): Show the measure numbers in the exported file.
|
170
172
|
spine_ids (Iterable): The ids of the spines to export. When None, all the spines will be exported. \
|
@@ -189,7 +191,7 @@ def dumps(document: Document, *,
|
|
189
191
|
exclude=exclude,
|
190
192
|
from_measure=from_measure,
|
191
193
|
to_measure=to_measure,
|
192
|
-
kern_type=
|
194
|
+
kern_type=encoding,
|
193
195
|
instruments=instruments,
|
194
196
|
show_measure_numbers=show_measure_numbers,
|
195
197
|
spine_ids=spine_ids
|
@@ -87,7 +87,7 @@ class ExporterTestCase(unittest.TestCase):
|
|
87
87
|
expected_content = f.read()
|
88
88
|
|
89
89
|
doc, _ = kp.read(input_path)
|
90
|
-
real_content = kp.dumps(doc,
|
90
|
+
real_content = kp.dumps(doc, encoding=kp.Encoding.eKern, include=kp.BEKERN_CATEGORIES)
|
91
91
|
|
92
92
|
self.assertEqual(expected_content, real_content,
|
93
93
|
f"File content mismatch: \nExpected:\n{expected_content}\n{40 * '='}\nReal\n{real_content}")
|
@@ -44,7 +44,7 @@ class ImporterTestCase(unittest.TestCase):
|
|
44
44
|
from_measure=from_measure,
|
45
45
|
to_measure=to_measure,
|
46
46
|
include=kp.BEKERN_CATEGORIES,
|
47
|
-
|
47
|
+
encoding=kp.Encoding.eKern)
|
48
48
|
|
49
49
|
if exported_ekern != expected_content:
|
50
50
|
logging.info('---- Expected content ----')
|
@@ -346,7 +346,7 @@ class ImporterTestCase(unittest.TestCase):
|
|
346
346
|
kp.store_graph(doc, '/tmp/x.dot')
|
347
347
|
exported_real = kp.dumps(doc,
|
348
348
|
spine_types=['**kern'],
|
349
|
-
|
349
|
+
encoding=kp.Encoding.normalizedKern,
|
350
350
|
from_measure=9,
|
351
351
|
to_measure=13)
|
352
352
|
|
@@ -381,7 +381,7 @@ class ImporterTestCase(unittest.TestCase):
|
|
381
381
|
output_kern = kp.dumps(document,
|
382
382
|
spine_types=['**kern'],
|
383
383
|
include=kp.BEKERN_CATEGORIES,
|
384
|
-
|
384
|
+
encoding=kp.Encoding.eKern, )
|
385
385
|
expected_ekern = "**ekern\n4@c\n4@d\n4@e\n4@f\n*-\n"
|
386
386
|
self.assertEqual(expected_ekern, output_kern)
|
387
387
|
|
@@ -710,7 +710,7 @@ class ImporterTestCase(unittest.TestCase):
|
|
710
710
|
doc, err = kp.load('resource_dir/legacy/chor048.krn')
|
711
711
|
|
712
712
|
content = kp.dumps(doc, spine_types=['**kern', '**root', '**harm'],
|
713
|
-
|
713
|
+
encoding=kp.Encoding.eKern)
|
714
714
|
|
715
715
|
doc_2, _ = kp.loads(content) # raise error if the content is not valid
|
716
716
|
|
@@ -20,40 +20,40 @@ class TestTokenizer(unittest.TestCase):
|
|
20
20
|
|
21
21
|
|
22
22
|
def test_ekern_tokenizer_1(self):
|
23
|
-
|
24
|
-
token_str =
|
23
|
+
encoding = kp.EkernTokenizer(token_categories=self.default_categories)
|
24
|
+
token_str = encoding.tokenize(self.token_1)
|
25
25
|
self.assertEqual('2@.@bb@-·_·L', token_str)
|
26
26
|
self.token_1.export.assert_called()
|
27
27
|
|
28
28
|
def test_kern_tokenizer_1(self):
|
29
|
-
|
30
|
-
token_str =
|
29
|
+
encoding = kp.KernTokenizer(token_categories=self.default_categories)
|
30
|
+
token_str = encoding.tokenize(self.token_1)
|
31
31
|
self.assertEqual('2.bb-_L', token_str)
|
32
32
|
self.token_1.export.assert_called()
|
33
33
|
|
34
34
|
def test_bkern_tokenizer_1(self):
|
35
|
-
|
36
|
-
token_str =
|
35
|
+
encoding = kp.BkernTokenizer(token_categories=self.default_categories)
|
36
|
+
token_str = encoding.tokenize(self.token_1)
|
37
37
|
self.assertEqual('2.bb-', token_str)
|
38
38
|
self.token_1.export.assert_called()
|
39
39
|
|
40
40
|
def test_bekern_tokenizer_1(self):
|
41
|
-
|
42
|
-
token_str =
|
41
|
+
encoding = kp.BekernTokenizer(token_categories=self.default_categories)
|
42
|
+
token_str = encoding.tokenize(self.token_1)
|
43
43
|
self.assertEqual('2@.@bb@-', token_str)
|
44
44
|
self.token_1.export.assert_called()
|
45
45
|
|
46
46
|
def test_tokenizer_factory_kern(self):
|
47
|
-
|
48
|
-
self.assertIsInstance(
|
47
|
+
encoding = kp.TokenizerFactory.create(kp.Encoding.normalizedKern.value, token_categories=self.default_categories)
|
48
|
+
self.assertIsInstance(encoding, kp.KernTokenizer)
|
49
49
|
|
50
50
|
def test_tokenizer_factory_ekern(self):
|
51
|
-
|
52
|
-
self.assertIsInstance(
|
51
|
+
encoding = kp.TokenizerFactory.create(kp.Encoding.eKern.value, token_categories=self.default_categories)
|
52
|
+
self.assertIsInstance(encoding, kp.EkernTokenizer)
|
53
53
|
|
54
54
|
def test_tokenizer_factory_bkern(self):
|
55
|
-
|
56
|
-
self.assertIsInstance(
|
55
|
+
encoding = kp.TokenizerFactory.create(kp.Encoding.bKern.value, token_categories=self.default_categories)
|
56
|
+
self.assertIsInstance(encoding, kp.BekernTokenizer)
|
57
57
|
|
58
58
|
def test_tokenizer_factory_raise_error_if_none(self):
|
59
59
|
with self.assertRaises(ValueError):
|
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
|
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
|