Skip to content

Commit

Permalink
Resolved copying issue with units
Browse files Browse the repository at this point in the history
  • Loading branch information
dwest77a committed Aug 13, 2024
1 parent a3d141d commit 358a0ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CFAPyX/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def copy(self, newextent=None):
kwargs['extent'] = self._combine_slices(newextent)

new_instance = SuperLazyArrayLike(
self.shape,
**kwargs
)
return new_instance
Expand Down
10 changes: 6 additions & 4 deletions CFAPyX/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,6 @@ def __init__(self,
:param aggregated_calendar: None
"""
if 'units' in kwargs:
if not aggregated_units:
aggregated_units = kwargs['units']
kwargs.pop('units')

super().__init__(filename, address, units=aggregated_units, **kwargs)
self.aggregated_units = aggregated_units
Expand All @@ -520,6 +516,12 @@ def copy(self, extent=None):
"""

kwargs = self.get_kwargs()

if 'units' in kwargs:
if not kwargs['aggregated_units']:
kwargs['aggregated_units'] = kwargs['units']
kwargs.pop('units')

if extent:
kwargs['extent'] = self._combine_slices(extent)

Expand Down

0 comments on commit 358a0ce

Please sign in to comment.