Skip to content

Commit

Permalink
Remove array copy (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
brynpickering authored Aug 20, 2024
1 parent ca5a394 commit 4df903e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/calliope/backend/backend_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,13 +1071,14 @@ def _get_variable_bound(
name,
f"Applying bound according to the {bound} parameter values.",
)
bound_array = self.get_parameter(bound).copy()
bound_array = self.get_parameter(bound)
fill_na = bound_array.attrs.get("default", fill_na)
references.add(bound)
else:
bound_array = xr.DataArray(bound)
bound_array.attrs = {}
return bound_array.fillna(fill_na)
filled_bound_array = bound_array.fillna(fill_na)
filled_bound_array.attrs = {}
return filled_bound_array

@contextmanager
def _datetime_as_string(self, data: xr.DataArray | xr.Dataset) -> Iterator:
Expand Down

0 comments on commit 4df903e

Please sign in to comment.