Minor bug that is not triggered by any code at this point, but the attrs argument is overwritten by either default_attrs or variable.attrs. Is this intended?
def set_spatial_mask(self, variable, attrs=None):
"""
Set the spatial mask variable for the dimension map.
:param variable: The spatial mask variable.
:param dict attrs: Attribute associated with the spatial mask variable.
:type variable: :class:`~ocgis.Variable` | :class:`str`
"""
default_attrs = DIMENSION_MAP_TEMPLATE[DMK.SPATIAL_MASK][DMK.ATTRS]
if attrs is None:
attrs = default_attrs
else:
try:
attrs = deepcopy(variable.attrs)
except AttributeError:
attrs = default_attrs
else:
attrs.update(default_attrs)
variable = get_variable_names(variable)[0]
entry = self._get_entry_(DMK.SPATIAL_MASK)
entry[DMK.VARIABLE] = variable
entry[DMK.ATTRS] = attrs
Minor bug that is not triggered by any code at this point, but the attrs argument is overwritten by either default_attrs or variable.attrs. Is this intended?