From bb13d5995af21d6d768fc21c89a9ff8bf69dd033 Mon Sep 17 00:00:00 2001 From: mgrover1 Date: Fri, 11 Aug 2023 08:49:55 -0500 Subject: [PATCH 1/2] FIX: Add isinstance checks to improve linting --- pyart/graph/radardisplay.py | 2 +- tests/io/test_cfradial.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyart/graph/radardisplay.py b/pyart/graph/radardisplay.py index 04eba5c680..13a6d61213 100644 --- a/pyart/graph/radardisplay.py +++ b/pyart/graph/radardisplay.py @@ -1203,7 +1203,7 @@ def plot_labels(self, labels, locations, symbols="r+", text_color="k", ax=None): """ ax = common.parse_ax(ax) - if type(symbols) is str: + if isinstance(symbols, str): symbols = [symbols] * len(labels) if len(labels) != len(locations): raise ValueError("length of labels and locations must match") diff --git a/tests/io/test_cfradial.py b/tests/io/test_cfradial.py index c2cee97f47..68b0fa01bc 100644 --- a/tests/io/test_cfradial.py +++ b/tests/io/test_cfradial.py @@ -488,7 +488,7 @@ def attribute_equal(class1, class2, key, allow_str_case_diff=True): assert type(a1) == type(a2) - if type(a1) is str and allow_str_case_diff: + if isinstance(a1, str) and allow_str_case_diff: assert a1.upper() == a2.upper() else: assert a1 == a2 From 82bf1d435e1823ef555e248602726cf3339e3f75 Mon Sep 17 00:00:00 2001 From: mgrover1 Date: Thu, 17 Aug 2023 09:24:12 -0500 Subject: [PATCH 2/2] FIX: Fix the RSL interface for cython 3 --- pyart/io/_rsl_interface.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyart/io/_rsl_interface.pyx b/pyart/io/_rsl_interface.pyx index 12a88e5788..b6c5a5fb15 100644 --- a/pyart/io/_rsl_interface.pyx +++ b/pyart/io/_rsl_interface.pyx @@ -72,7 +72,7 @@ cpdef create_volume( """ # these variables can be moved to the module level if used elsewhere - cdef (float (*)(_rsl_h.Range)) * RSL_F_LIST = [ + cdef (float (*)(_rsl_h.Range) noexcept) * RSL_F_LIST = [ _rsl_h.DZ_F, _rsl_h.VR_F, _rsl_h.SW_F, _rsl_h.CZ_F, _rsl_h.ZT_F, _rsl_h.DR_F, _rsl_h.LR_F, _rsl_h.ZD_F, _rsl_h.DM_F, _rsl_h.RH_F, _rsl_h.PH_F, _rsl_h.XZ_F, _rsl_h.CD_F, _rsl_h.MZ_F, _rsl_h.MD_F, @@ -83,7 +83,7 @@ cpdef create_volume( _rsl_h.SW_F, _rsl_h.DZ_F, _rsl_h.CZ_F, _rsl_h.PH_F, _rsl_h.SD_F, _rsl_h.DZ_F, _rsl_h.DZ_F] - cdef (_rsl_h.Range (*)(float)) * RSL_INVF_LIST = [ + cdef (_rsl_h.Range (*)(float) noexcept) * RSL_INVF_LIST = [ _rsl_h.DZ_INVF, _rsl_h.VR_INVF, _rsl_h.SW_INVF, _rsl_h.CZ_INVF, _rsl_h.ZT_INVF, _rsl_h.DR_INVF, _rsl_h.LR_INVF, _rsl_h.ZD_INVF, _rsl_h.DM_INVF, _rsl_h.RH_INVF, _rsl_h.PH_INVF, _rsl_h.XZ_INVF,