Skip to content

Commit

Permalink
Fix compatibility for numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed May 20, 2024
1 parent bacbd39 commit 03e7dc4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pygridgen/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import sys
import ctypes
import warnings

import numpy
from matplotlib.path import Path
Expand Down Expand Up @@ -549,11 +550,14 @@ def abs_angle(du, dv):
angles = numpy.mean(_angles, axis=0) - (numpy.pi / 2)
return angles

@numpy.deprecate(new_name='orthogonality')
def calculate_orthogonality(self):
"""
Should deprecate in favor of property ``orthogonality``
"""
warnings.warn(
"Use orthogonality instead of calculate_orthogonality.",
DeprecationWarning,
)
return self.orthogonality

def mask_polygon(self, polyverts, mask_value=False):
Expand Down

0 comments on commit 03e7dc4

Please sign in to comment.