Skip to content
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

Make machine configuration extendable #392

Merged
merged 3 commits into from
Oct 31, 2024
Merged

Make machine configuration extendable #392

merged 3 commits into from
Oct 31, 2024

Conversation

d-j-hatton
Copy link
Contributor

Allow extra configuration options to be extracted from the Murfey machine configuration and validated against a pydantic model specified as an entry point. This allows external packages to add their configuration to the Murfey config for convenience

…e murfey.config entry point and validate against the provided model

Also provide a convenience function for extracting the relevant part of the extended configuration from other packages if Murfey is installed
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 28.70%. Comparing base (bcf52af) to head (785b2f2).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #392      +/-   ##
==========================================
+ Coverage   28.37%   28.70%   +0.33%     
==========================================
  Files          71       71              
  Lines        9608    10061     +453     
  Branches     1284     1477     +193     
==========================================
+ Hits         2726     2888     +162     
- Misses       6788     7061     +273     
- Partials       94      112      +18     


def get_extended_machine_config(
extension_name: str, instrument_name: str = ""
) -> Optional[BaseModel]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type of this isn't directly a BaseModel

@d-j-hatton d-j-hatton merged commit 2592b6b into main Oct 31, 2024
17 checks passed
@d-j-hatton d-j-hatton deleted the extendable-config branch October 31, 2024 10:29
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.

2 participants