-
Notifications
You must be signed in to change notification settings - Fork 2
Added update_imas_path to the PathTool functionality #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+946
−49
Conversation
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
… functionality; add tests for path updates and include imas-python dependency in project configuration.
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…variable overrides
…gration map
Replace the runtime @persistent_cache decorator with build-time resource
generation for path migrations. This aligns with the existing hatch build
hook pattern used for schemas and other resources.
Changes:
- Add imas-python>=2.0.1 to build dependencies for dd_version_map_from_factories
- Create scripts/build_migrations.py for CLI and build-time generation
- Create imas_mcp/migrations/ module with PathMigrationMap, MigrationEntry,
RenameHistoryEntry classes and get_migration_map() singleton
- Integrate migration map generation into hatch_build_hooks.py
- Add migrations_dir property to ResourcePathAccessor
- Enhance check_imas_paths to return migration suggestions for deprecated
paths and renamed_from history for current paths
- Remove @persistent_cache decorator and runtime migration map building
- Remove update_imas_path and ensure_current_path methods (functionality
merged into enhanced check_imas_paths)
- Update tests with MockPathMigrationMap for isolated testing
The migration map JSON includes:
- old_to_new: deprecated path → {new_path, deprecated_in, last_valid_version}
- new_to_old: current path → list of {old_path, deprecated_in}
- metadata: target_version, source_versions, generated_at, total_migrations
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.
This pull request adds a new feature to update IMAS data dictionary (DD) paths to the currently served version, along with corresponding tests and dependency updates. The most important changes are grouped below:
New Feature: IMAS Path Update
update_imas_pathmethod toPathToolthat converts one or more IMAS paths from an older DD version to the current version, supporting both string and list input formats. This includes logic to map paths using IDS names and handles version compatibility and errors. (imas_mcp/tools/path_tool.py)update_imas_pathmethod via the main tools interface for delegation. (imas_mcp/tools/__init__.py)Testing
update_imas_pathfeature, covering single path updates, list updates, and space-separated string input. Also added fixtures for test data. (tests/test_path_tool.py)Dependency Management
imas-python>=2.0.1as a required dependency to support the new path update functionality. (pyproject.toml)Imports and Setup
path_tool.pyto include necessary IMAS modules and exceptions for the new functionality. (imas_mcp/tools/path_tool.py)