cctbx / dxtbx

Diffraction Experiment Toolbox
BSD 3-Clause "New" or "Revised" License
2 stars 18 forks source link

Revisit the question of lazy loading #576

Open graeme-winter opened 1 year ago

graeme-winter commented 1 year ago

And - ideally - find a better solution perhaps derived from the load before heat death fixes perhaps with a neat way of having per-experiment wavelengths.

graeme-winter commented 1 year ago

https://github.com/cctbx/dxtbx/pull/118 for reference

jbeilstenedmands commented 1 year ago

I was thinking about Graeme's suggestion of using the format_kwargs as a solution to the blocker encountered in https://github.com/dials/dials/pull/2273.

I think this is how such a solution might look: https://github.com/cctbx/dxtbx/compare/main...jbeilstenedmands:dxtbx:lazy_restructure Basically the formats that are currently lazy should check for a lazy= kwarg, (with a default of True), removing the need to inherit from FormatMultiImageLazy.

The benefit here over the current approach is that it allows one to switch on/off the lazy behaviour for a given format class by supplying format_kwargs (for example in a call to the make_imageset, make_sequence methods of ImageSetFactory. Currently lazy is forced to be True for classes that inherit from FormatMultiImageLazy, which then puts restrictions on the underlying imageset datastructures.