Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0042166
feat(core): add TiLiA's rules for creating each kind the importers cr…
azfoo Oct 12, 2026
ede5914
refactor(core): move the component rules to tilia_core.rules
azfoo Oct 13, 2026
34fc212
feat(core): one set of rules for the components the importers create
azfoo Oct 13, 2026
9f46077
feat(core): one form for the reason a value isn't one
azfoo Oct 13, 2026
12d7587
feat(core): an outcome is true when no rule is broken
azfoo Oct 14, 2026
b0ada53
feat(core): take the colour names from webcolors
azfoo Oct 14, 2026
9e42e37
refactor(core): make the row id's format public
azfoo Oct 19, 2026
fa353af
fix(core): an outcome and CantCheck copy and pickle whole
azfoo Oct 19, 2026
53060fa
fix(core): an integer too large for a float isn't a valid time
azfoo Oct 19, 2026
4919e4e
fix(core): a hierarchy crosses another whose level is written as a float
azfoo Oct 19, 2026
5ce4aab
fix(core): round a time to tenths before counting its minutes
azfoo Oct 19, 2026
d971e5d
fix(core): check a color last, so it can't hide another broken rule
azfoo Oct 19, 2026
ecf05aa
test(core): drop assertions TiLiA's creation rules can't fail
azfoo Oct 19, 2026
5709172
refactor(core): make range row ids with the rules' format
azfoo Oct 14, 2026
d65191f
fix(core): a music21 that won't import can't check, rather than crash
azfoo Oct 14, 2026
dda9526
feat(core): declare the harmony extra
azfoo Oct 14, 2026
74ec1ce
fix(core): an outcome's truth is a bool
azfoo Oct 19, 2026
4049095
fix(core): a hierarchy whose level is a huge integer can be crossed
azfoo Oct 19, 2026
62f546a
fix(core): a bad color can't hide that a harmony couldn't be checked
azfoo Oct 19, 2026
fa7a715
fix(core): a music21 that fails to import in any way can't check
azfoo Oct 19, 2026
1a35270
fix(core): CantCheck says when music21 is installed but won't import
azfoo Oct 19, 2026
735d494
perf(core): don't import a broken music21 again for every harmony
azfoo Oct 19, 2026
f1f3de0
revert(core): don't keep a failed music21 import for the session
azfoo Oct 19, 2026
627c66a
fix(core): CantCheck gives the reason and the install command
azfoo Oct 19, 2026
28ba92f
fix(core): a CantCheck copies and pickles whatever its error
azfoo Oct 19, 2026
cc59c09
fix(core): an outcome's ok is a bool however it's read
azfoo Oct 19, 2026
fe558e8
fix(core): compare a hierarchy's start and end of any integer size
azfoo Oct 19, 2026
086b657
refactor(core): give _kept a ready CantCheck
azfoo Oct 19, 2026
60abddd
docs(core): say that CantCheck comes before the color
azfoo Oct 19, 2026
52ed2fd
test(core): drop the test of _kept's guard
azfoo Oct 19, 2026
494518c
fix(core): give a reason for an integer too long to show
azfoo Oct 19, 2026
3cd8e4f
fix(core): hierarchy boundaries a few ulps apart meet, as on dev
azfoo Oct 19, 2026
01eb2c7
feat(core): accept TiLiA's added-tone qualities, as on dev
azfoo Oct 19, 2026
5c67ed8
fix(core): a hierarchy accepts a media length too large for a float
azfoo Oct 26, 2026
9928285
test(core): test both parts of the hierarchy boundaries' tolerance
azfoo Oct 26, 2026
0313ecb
fix(core): an outcome's others can't be changed
azfoo Oct 26, 2026
08463e8
fix(core): name a value that can't be shown by its type
azfoo Oct 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/tilia-core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version = "0.0.2"
description = "TiLiA's file format and corpus tools, without a user interface"
readme = "README.md"
requires-python = ">=3.10"
dependencies = ["pypdf>=6.0.0"]
dependencies = ["pypdf>=6.0.0", "webcolors>=24.8.0"]
license = "GPL-3.0-or-later"
license-files = ["LICENSE"]
authors = [
Expand All @@ -17,6 +17,10 @@ authors = [
{name = "Anne Foo"}
]

[project.optional-dependencies]
# Checking harmonies and keys, and later importing them, reads music21.
harmony = ["music21>=9.1"]

[project.scripts]
tilia = "tilia_core.commands:main"

Expand Down
7 changes: 2 additions & 5 deletions packages/tilia-core/src/tilia_core/importers/_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
from __future__ import annotations

import random
import string
from collections.abc import Collection, Iterable
from typing import Any

from tilia_core import tla

_ROW_ID_CHARACTERS = string.ascii_letters + string.digits
from tilia_core import rules, tla


def commit(
Expand Down Expand Up @@ -42,7 +39,7 @@ def commit(
def new_row_id(taken: Collection[str]) -> str:
"""A range row's id: six letters and digits, none of `taken`, as TiLiA makes them."""
while True:
row_id = "".join(random.choices(_ROW_ID_CHARACTERS, k=6))
row_id = "".join(random.choices(rules.ROW_ID_CHARACTERS, k=rules.ROW_ID_LENGTH))
if row_id not in taken:
return row_id

Expand Down
Loading
Loading