parse_cf
loads all data into memory when grid_mapping is missing since .metpy.units
checks .data
#1748
Labels
Milestone
In the process of troubleshooting #1705, I followed the code to discover that for all variables without a
grid_mapping
, MetPy will inadvertently load that variable's data into memory when performing the lat/lon fallback check (sincecheck_axis
looks for units, and units checks the type ofvar.data
to see if it is a Quantity, andvar.data
when a lazy-loaded array ends up loading the data).While the more direct fix may just be removing the
check_axis
conditional (which should no longer even be needed after #1651 ...I guess I should have cleared it out then), that wouldn't change the root problem that looking up.metpy.units
on a DataArray will load lazy data into memory just because of the type check. Unless there are other suggestions on how to handle this, I would propose.variable._data
instead of.data
so that loading isn't triggeredThe text was updated successfully, but these errors were encountered: