Skip to content

Commit

Permalink
[DONE] fix for adding grid objects with quarters (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
martijn-siemerink authored Aug 29, 2024
1 parent 92af0e5 commit 7c42f1b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Changelog of threedigrid-builder
1.17.1 (unreleased)
-------------------

- Nothing changed yet.
- Fix for adding grid objects to include quarters attribute.


1.17.0 (2024-08-16)
Expand Down
1 change: 1 addition & 0 deletions threedigrid_builder/base/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def __add__(self, other: T) -> T:
name: np.concatenate((getattr(self, name), getattr(other, name)))
for name in typing.get_type_hints(self.data_class).keys()
}

for scalar_arg in self.scalars:
new_fields[scalar_arg] = getattr(self, scalar_arg)
return self.__class__(**new_fields)
Expand Down
2 changes: 0 additions & 2 deletions threedigrid_builder/base/quarters.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ class Quarter:

class Quarters(Array[Quarter]):
"""Calculation quarters."""

pass
2 changes: 1 addition & 1 deletion threedigrid_builder/grid/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def __add__(self, other):
"equal types."
)
new_attrs = {}
for name in ("nodes", "lines", "nodes_embedded", "surfaces"):
for name in ("nodes", "lines", "nodes_embedded", "surfaces", "quarters"):
new_attrs[name] = getattr(self, name) + getattr(other, name)
for name in (
"meta",
Expand Down

0 comments on commit 7c42f1b

Please sign in to comment.