-
Notifications
You must be signed in to change notification settings - Fork 1
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
WIP dataclass
to BaseModel
migration
#72
Conversation
global_settings: | ||
- &LCA_DAC 'TS1_DAC01' | ||
- &LCB_DAC 'TS1_DAC02' | ||
- &MCL_DAC 'TS1_DAC06' | ||
- &AP_GALVO_DAC 'TS2_DAC03' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These needed to move to their own global_settings
or else they would appear as extra parameters.
# def test_example_settings(example_settings): | ||
# s = AcquisitionSettings(**example_settings) | ||
|
||
# # Check values match example file | ||
# assert s.ls_microscope_settings.z_sequencing_settings[0].device_name == "TS2_DAC03" | ||
# assert s.time_settings.num_timepoints == 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't easily get these tests to pass when I migrated to BaseModel
.
class AcquisitionSettings(NoExtrasModel): | ||
global_settings: Optional[List[str]] = None | ||
time_settings: TimeSettings | ||
lf_channel_settings: ChannelSettings | ||
lf_slice_settings: SliceSettings | ||
lf_microscope_settings: MicroscopeSettings | ||
ls_channel_settings: ChannelSettings | ||
ls_slice_settings: SliceSettings | ||
ls_microscope_settings: MicroscopeSettings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This top-level class was necessary to check for top-level extra parameters.
num_channels: int = 0 # | ||
acquisition_rate: Optional[float] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the type of logic I'm scared of in this migration. field
isn't supported by BaseModel, so I need to change it, but I'm not sure that I've replicated the correct behavior.
This was a failed attempt. I learned the hard way that I should treat |
No description provided.