Skip to content

Commit

Permalink
Fix unit refs : Units are immutable, have no copy()
Browse files Browse the repository at this point in the history
  • Loading branch information
pp-mo committed Apr 26, 2018
1 parent 0f7aa9a commit 5f9faa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/iris/coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,8 @@ def convert_units(self, unit):
'The "coord.units" attribute may be set directly.')
if self.has_lazy_points() or self.has_lazy_bounds():
# Make fixed copies of old + new units for a delayed conversion.
old_unit = self.units.copy()
new_unit = unit.copy()
old_unit = self.units
new_unit = unit

# Define a delayed conversion operation (i.e. a callback).
def pointwise_convert(values):
Expand Down
4 changes: 2 additions & 2 deletions lib/iris/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,8 @@ def convert_units(self, unit):
'The "cube.units" attribute may be set directly.')
if self.has_lazy_data():
# Make fixed copies of old + new units for a delayed conversion.
old_unit = self.units.copy()
new_unit = unit.copy()
old_unit = self.units
new_unit = unit

# Define a delayed conversion operation (i.e. a callback).
def pointwise_convert(values):
Expand Down

0 comments on commit 5f9faa7

Please sign in to comment.