You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The detector_params property accessors in GridCommon and RotationScan create the storage_directory implicitly.
This violates the principle of least surprise. Also it means a filesystem access every time the property is accessed to check if the directory exists and create it if necessary.
The existence of the directory is asserted by DetectorParams.directory field validator (which is reasonable).
The directories should be created by the experiment plans that create the files. However many unit tests will also need to be updated as well.
See also #524 which was raised due to the code that cleans up after the unit tests having issues.
The text was updated successfully, but these errors were encountered:
I think checking/creating on validate is definitely still better than on property access. However we may want to have a separate explicit runtime validation method.
I ran the load_centre_collect_full_plan system test and the property accessor was called 22 times, the model_validate method was called 4 times (excluding the test setup)
The
detector_params
property accessors inGridCommon
andRotationScan
create thestorage_directory
implicitly.This violates the principle of least surprise. Also it means a filesystem access every time the property is accessed to check if the directory exists and create it if necessary.
The existence of the directory is asserted by
DetectorParams.directory
field validator (which is reasonable).The directories should be created by the experiment plans that create the files. However many unit tests will also need to be updated as well.
See also #524 which was raised due to the code that cleans up after the unit tests having issues.
The text was updated successfully, but these errors were encountered: