Investigate using a singleton in place of None
to trigger _make_default
#310
Labels
api-refactor
part of major API changes
None
to trigger _make_default
#310
Currently setting a
DataModel
attribute toNone
(which is a common pattern for freeing up memory) results in creation of a default value for the attribute:stdatamodels/src/stdatamodels/properties.py
Lines 324 to 330 in ee4756f
For large arrays (which are likely candidates for removal to free up memory) this results in creation of a large new array with default values.
It may be helpful to use a singleton like
MAKE_DEFAULT
to signify that a default should be made.This could help to make it more explicit when a default is requested. However it would require changes to code like the following:
stdatamodels/src/stdatamodels/jwst/datamodels/slit.py
Lines 65 to 68 in ee4756f
The text was updated successfully, but these errors were encountered: