Extract aces-transforms into standalone package#8
Closed
c-clark wants to merge 2 commits into
Closed
Conversation
* initial commit of aces-amf-lib Signed-off-by: Chris Clark <[email protected]> * accept string paths in addition to Path objects Signed-off-by: Chris Clark <[email protected]> * restructure as monorepo and migrate to xsdata-pydantic - Move aces-amf-lib into packages/ directory - Add root pyproject.toml with uv workspace config - Create skeleton packages for aces-amf-transforms and aces-amf-utils - Regenerate schema bindings with xsdata-pydantic (BaseModel instead of dataclasses) - Update uri_codec.py, amf_utilities.py, aces_amf.py for Pydantic model API - Add amf_xml_date_time() helper for XmlDateTime construction - Fix test fixtures for Pydantic required-fields-at-construction semantics * implement validation plugin system with registry and core validators - Add protocols.py with AMFValidator and TransformRegistry protocols - Create validation/ package with plugin registry supporting entry points and explicit registration - Extract monolithic semantic_validation.py into 9 focused validators: temporal, uuid, cdl, metadata, applied_order, file_paths, working_space, transform_ids, file_hashes - Add validate_schema(), validate_semantic(), validate_all() convenience functions - Core validators auto-register on import via get_default_registry() - Unified ValidationMessage/ValidationType/ValidationLevel types - Backward compat: validate_amf alias, SemanticValidationType alias - Remove old validation.py and semantic_validation.py modules - Update all tests and examples for new API (45 tests passing) * add test fixtures as package data - Copy AMF example files into fixtures/amf-examples/ as package data - Add fixtures module with get_amf_examples_path() and list_amf_examples() - Update conftest.py and tests to use package fixtures instead of symlink - Remove old tests/data/aces-examples symlink - Update pyproject.toml to include fixture files in package data * build aces-amf-transforms package with bundled registry - Implement ACESTransformRegistry with bundled ACES transforms snapshot (164 v2.0.0 transforms + 993 v1.3.1 + 7 more version sets) - Support lookup by ID, previous equivalent IDs, category, and inverse - Create TransformIdValidator that validates IDs against the registry - Register validator via aces_amf.validators entry point - Strip transformUrl from snapshot to reduce size (~1.8MB) - 15 tests covering registry lookup, listing, and validator integration * add root .gitignore and remove cached build artifacts * rewrite public API with auto-validation and remove legacy modules - Replace aces_amf.py wrapper with functional API in amf_utilities.py (load_amf, save_amf, render_amf, minimal_amf, prepare_for_write) - Add validate=True kwarg to load/save/render for automatic semantic validation on all AMF I/O operations - Add AMFValidationError exception for structured error reporting - Remove uri_codec.py and backward-compat aliases (validate_amf, SemanticValidationType, SemanticValidationMessage) - Overhaul all 9 semantic validators for improved coverage - Add nested sub-transform validation (_nested.py) - Add v1 test fixture and v1→v2 upgrade tests - Expand test suite to 70 tests * update transform validator and registry for new validation API - Adapt validator to work with updated validation types and registry - Use validate=False in tests for intentionally invalid AMF data - Remove empty tests/__init__.py - 16 tests passing * build out aces-amf-utils with CLI, builder, diff, and templates - AMFBuilder: fluent builder pattern for AMF construction - diff.py: structural comparison between AMF objects - template_registry.py: pre-built AMF templates for common workflows - bulk_generator.py: generate AMF files from templates for multiple assets - Click CLI with commands: validate, info, create, convert, diff, edit, transforms (entry point: amf) - 55 tests covering builder, CLI, diff, and template registry * add xsdata binding generation script Shell script to regenerate xsdata-pydantic bindings from XSD schemas. Supports generating v1, v2, or both: ./generate_bindings.sh [v1|v2] * support compound workingLocation/lookTransform field with ordering preservation Merge the separate working_location and look_transform fields on PipelineType into a single compound working_location_or_look_transform list that preserves element interleaving. The working location is a positional delimiter in the AMF pipeline — looks before vs after it have different semantic meaning. - Post-generation patch in generate_bindings.sh merges the two fields into a compound field with proper xsdata Elements metadata (v2 only, v1 unaffected) - Add look_transforms read-only property for filtered access - Add WorkingLocationType alias for EmptyType (removed EmptyType from public API) - Add MULTIPLE_WORKING_LOCATIONS validation (ERROR if >1 per pipeline) - Update v1-to-v2 upgrade to rename lookTransform key for compound field - Add AMFBuilder.working_location() method for inserting the delimiter - Update all field references across 3 packages - Add 11 new tests including interleaved ordering, roundtrip, and validation * add URI encoding/decoding for xs:anyURI file paths xsdata passes percent-encoded values through unchanged, creating an interop risk with other AMF implementations. Add a generic Pydantic tree walker that auto-decodes file paths on load (unquote) and re-encodes on save (quote with safe='/'), using a deep copy to avoid mutating the user's model. Covers all 10 types with file fields across both pipeline and archived pipeline structures. * close v1→v2 migration gaps for systemVersion and ColorCorrectionRef Legacy v1 files that omit systemVersion now parse successfully instead of failing with a confusing error. The v1 model patches system_version to optional via generate_bindings.sh, and the upgrade function injects a default of 1.3.0. Also adds semantic validation that ColorCorrectionRef must be accompanied by a file element in v2, emitting a warning when missing. * Ensure the lock file points external * regenerate uv.lock with standard PyPI index Add regenerate_lock.sh script and rebuild uv.lock pointing to pypi.org/simple instead of internal mirror. --------- Signed-off-by: Chris Clark <[email protected]> Co-authored-by: Chris Clark <[email protected]>
Signed-off-by: Chris Clark <[email protected]>
|
Contributor
Author
|
Please ignore. This was meant to go to my personal fork. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
aces-amf-transformsinto a standaloneaces-transformspackagewith zero dependencies, making it usable by any ACES implementer, future ACES version releases, etc
aces-amf-liboptionally depends onaces-transforms(via [registry] extra for validation), not the other way aroundTransformIdValidatorintoaces-amf-libwhere it conditionallyactivates when
aces-transformsis installedStructure
aces-transformsaces-amf-libaces-transformsvia[registry]extraaces-amf-utilsaces-amf-lib,aces-transformsAdditions
version= kwarg) with fuzzy resolution —v1.3 resolves to latest patch (v1.3.1), v2.0.0 resolves to latest
build (v2.0.0+2025.04.04)
get_current_id(),get_previous_ids())for resolving transform URNs across ACES versions, e.g. finding the v2.0
equivalent of a v1.3 URN or vice versa
list_versions()to enumerate available ACES system versions