@@ -110,10 +110,11 @@ from pathlib import Path
110110# parse a GDTF file
111111fixture = pygdtf.FixtureType(" BlenderDMX@LED_PAR_64_RGBW@v0.3.gdtf" )
112112
113- # create writer that reuses the parsed XML tree and embedded resources
113+ # modify the fixture as needed, you must ensure GDTF correctness
114+ # create writer
114115writer = pygdtf.FixtureTypeWriter(fixture)
115116
116- # write a new GDTF archive (DataVersion can be overridden if desired)
117+ # write a new GDTF archive
117118writer.write_gdtf(Path(" BlenderDMX@LED_PAR_64_RGBW@v0.3_roundtrip.gdtf" ))
118119```
119120
@@ -162,20 +163,18 @@ uv run pytest --mypy -m mypy pygdtf/*py
162163
163164# # Updating Attribute Definitions
164165
165- The canonical AttributeDefinitions XML lives at the repo root:
166- `AttributeDefinitions.xml` . When the GDTF spec updates that file , regenerate
167- the baked Python data module used for zero- IO startup:
166+ The canonical AttributeDefinitions XML is from the [GDTF
167+ Spec](https:// github.com/ mvrdevelopment/ spec), and it is stored at the repo
168+ root: `AttributeDefinitions.xml` . When the GDTF Spec updates that file , we need
169+ to regenerate the baked Python data module by running the following:
168170
169171```bash
170- python3 - << ' PY'
171- from pygdtf.utils import attr_loader
172- attr_loader.generate_attribute_definitions_module()
173- PY
172+ uv run python - c " from pygdtf.utils import attr_loader; attr_loader.generate_attribute_definitions_module()"
174173```
175174
176175This writes `pygdtf/ utils/ attribute_definitions_data.py` , which is imported at
177- runtime instead of reading the XML . Commit the regenerated module along with
178- the updated XML .
176+ runtime instead of reading the XML . Format and commit the regenerated module
177+ along with the updated XML .
179178
180179# # Citation
181180
0 commit comments