Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ from pathlib import Path
# parse a GDTF file
fixture = pygdtf.FixtureType("BlenderDMX@LED_PAR_64_RGBW@v0.3.gdtf")

# create writer that reuses the parsed XML tree and embedded resources
# modify the fixture as needed, you must ensure GDTF correctness
# create writer
writer = pygdtf.FixtureTypeWriter(fixture)

# write a new GDTF archive (DataVersion can be overridden if desired)
# write a new GDTF archive
writer.write_gdtf(Path("BlenderDMX@LED_PAR_64_RGBW@v0.3_roundtrip.gdtf"))
```

Expand Down Expand Up @@ -162,20 +163,18 @@ uv run pytest --mypy -m mypy pygdtf/*py

## Updating Attribute Definitions

The canonical AttributeDefinitions XML lives at the repo root:
`AttributeDefinitions.xml`. When the GDTF spec updates that file, regenerate
the baked Python data module used for zero-IO startup:
The canonical AttributeDefinitions XML is from the [GDTF
Spec](https://github.com/mvrdevelopment/spec), and it is stored at the repo
root: `AttributeDefinitions.xml`. When the GDTF Spec updates that file, we need
to regenerate the baked Python data module by running the following:

```bash
python3 - <<'PY'
from pygdtf.utils import attr_loader
attr_loader.generate_attribute_definitions_module()
PY
uv run python -c "from pygdtf.utils import attr_loader; attr_loader.generate_attribute_definitions_module()"
```

This writes `pygdtf/utils/attribute_definitions_data.py`, which is imported at
runtime instead of reading the XML. Commit the regenerated module along with
the updated XML.
runtime instead of reading the XML. Format and commit the regenerated module
along with the updated XML.

## Citation

Expand Down
2 changes: 1 addition & 1 deletion pygdtf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from .utils import *
from .value import * # type: ignore

__version__ = "1.4.0-dev1"
__version__ = "1.4.0-dev2"

# Standard predefined colour spaces: R, G, B, W-P
COLOR_SPACE_SRGB = ColorSpaceDefinition(
Expand Down