-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Currently (cfdm v1.12.3.0), when you change the data type, any cached values are removed:
>>> import cfdm
>>> d = cfdm.example_field(0).data
>>> d
<Data(5, 8): [[0.007, ..., 0.013]] 1>
>>> d._get_cached_elements()
{0: array(0.007), -1: array(0.013)}
>>> d.dtype = 'float32'
>>> d._get_cached_elements()
{}This is always safe, but there's no reason not to keep and cached elements, after having cast them to the new data type.
What we'd like to see is:
>>> d.dtype = 'float32'
>>> d._get_cached_elements()
{0: array(0.007, dtype=float32), -1: array(0.013, dtype=float32)}PR to follow.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request