chore: improve resource discovery and reference handling for new sections - #1557
Merged
Merged
Conversation
tj098895
reviewed
May 15, 2026
tj098895
reviewed
May 15, 2026
tj098895
reviewed
May 15, 2026
tj098895
reviewed
May 15, 2026
jsolaas
approved these changes
May 18, 2026
|
|
||
| # Pick up FILE references nested in the new YAML sections (PROCESS_UNITS, PROCESS_SYSTEMS, ...). | ||
| for section in _NEW_SECTIONS_WITH_FILE_REFS: | ||
| resource_names.extend(_find_file_references(self._internal_datamodel.get(section))) |
Contributor
There was a problem hiding this comment.
Also replace facility and model 'search' above? Search everything except TIME_SERIES? Or do we need to separate TIME_SERIES and FACILITY when looking at resources?
Contributor
Author
There was a problem hiding this comment.
Good point.
I kept the new search to the new sections (PROCESS_UNITS, PROCESS_SYSTEMS) on purpose. I think replacing the existing facility/model search will be a refactor that may require some test coverage - better to keep in a separate PR? I think TIME_SERIES probably needs to stay separate, since they map to a different resource type.
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.
Summary
Small fixes and improvements to YAML resource discovery, reference handling, and mapper robustness. Discovered while running the migration tooling against existing models, but valuable independently.
Changes
yaml_reference_service.py: registerFLUID_MODELSentries so they are resolvable through the reference service.pyyaml_yaml_model.py:FILEreferences nested inside the new YAML sections (PROCESS_UNITS,PROCESS_SYSTEMS)is_single_speedfrom chart resource headersfluid_modelsas an abstract property onYamlValidatorprocess_simulation_mapper.py: defensiveNone-handling in_map_conditions.No behavioral change for existing models — these only enable correct handling of newer YAML constructs and improve type safety.
Type of Work
See here (internal): https://github.com/equinor/ecalc-internal/discussions/1044
Have you remembered and considered?
docs/drafts/next.draft.md)docs/docs/migration_guides/)BREAKING:in footer or!in headerWhat is this PR all about?
What else did you consider?
Between the lines?