Skip to content

Static data iosource#49

Merged
toqduj merged 26 commits intomainfrom
static_data_iosource
Oct 22, 2025
Merged

Static data iosource#49
toqduj merged 26 commits intomainfrom
static_data_iosource

Conversation

@toqduj
Copy link
Collaborator

@toqduj toqduj commented Jun 5, 2025

Added an IoSource for static data loaded in from a yaml file. Has a path-like interface, see associated tests. Also had to fix MessageHandler to get it to work (or I misunderstood).

Can be used like this:

filepath = Path("../src/modacor/tests/io/static_data/static_data_example.yaml")
sm_iosource = StaticData(source_reference='defaults')
sm_iosource._load_from_yaml(filepath)  # you can add multiple if you want, will update (!) internal dict. 
sm_iosource.get_data('probe_properties/wavelength/value')  # always an np.ndarray, uses additional internal cache for speed in future access of the same data. 
sm_iosource.get_static_metadata('probe_properties/wavelength/unit')  # any type, here 'nm'

@toqduj toqduj requested a review from timsnow June 5, 2025 14:29
@toqduj toqduj marked this pull request as ready for review October 22, 2025 12:28
@toqduj
Copy link
Collaborator Author

toqduj commented Oct 22, 2025

YAMLLoader can be used to load values from YAML files. These can be metadata such as wavelengths and other machine information.

@toqduj toqduj merged commit 0680786 into main Oct 22, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant