Skip to content

Commit

Permalink
Correct conversion logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Huite committed Aug 3, 2023
1 parent 62e0a9e commit 98ca32b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xugrid/regrid/structured.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,9 @@ def area(self) -> FloatArray:
return np.multiply.outer(self.ybounds.length, self.xbounds.length)

def convert_to(self, matched_type: Any) -> Any:
if isinstance(self, matched_type):
if matched_type == StructuredGrid2d:
return self
elif isinstance(self, UnstructuredGrid2d):
elif matched_type == UnstructuredGrid2d:
return Ugrid2d.from_structured(self.xbounds, self.ybounds)
else:
raise TypeError(
Expand Down

0 comments on commit 98ca32b

Please sign in to comment.