From f8e70179c0557b49b0f85587f0fc13747c5d6d34 Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Tue, 24 Jan 2023 12:45:56 -0800 Subject: [PATCH] typo replace --- pyflowline/classes/basin.py | 16 ++++++++-------- pyflowline/classes/mpas.py | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pyflowline/classes/basin.py b/pyflowline/classes/basin.py index 715ab56..ad9498d 100644 --- a/pyflowline/classes/basin.py +++ b/pyflowline/classes/basin.py @@ -53,21 +53,21 @@ class BasinClassEncoder(JSONEncoder): JSONEncoder (_type_): _description_ """ def default(self, obj): - if isobject(obj, np.integer): + if isinstance(obj, np.integer): return int(obj) - if isobject(obj, np.float32): + if isinstance(obj, np.float32): return float(obj) - if isobject(obj, np.ndarray): + if isinstance(obj, np.ndarray): return obj.tolist() - if isobject(obj, list): + if isinstance(obj, list): pass - if isobject(obj, pyvertex): + if isinstance(obj, pyvertex): return json.loads(obj.tojson()) #lVertexID - if isobject(obj, pyedge): + if isinstance(obj, pyedge): return obj.lEdgeID - if isobject(obj, pyflowline): + if isinstance(obj, pyflowline): return obj.lFlowlineID - if isobject(obj, pyconfluence): + if isinstance(obj, pyconfluence): return obj.dAngle_upstream diff --git a/pyflowline/classes/mpas.py b/pyflowline/classes/mpas.py index b2da2f3..da21736 100644 --- a/pyflowline/classes/mpas.py +++ b/pyflowline/classes/mpas.py @@ -12,22 +12,22 @@ class MpasClassEncoder(JSONEncoder): def default(self, obj): - if isobject(obj, np.integer): + if isinstance(obj, np.integer): return int(obj) - if isobject(obj, np.float32): + if isinstance(obj, np.float32): return float(obj) - if isobject(obj, np.ndarray): + if isinstance(obj, np.ndarray): return obj.tolist() - if isobject(obj, list): + if isinstance(obj, list): pass - if isobject(obj, pyvertex): + if isinstance(obj, pyvertex): return json.loads(obj.tojson()) #lVertexID - if isobject(obj, pyedge): + if isinstance(obj, pyedge): return obj.lEdgeID - if isobject(obj, pyflowline): + if isinstance(obj, pyflowline): return obj.lFlowlineID - if isobject(obj, pympas): + if isinstance(obj, pympas): return obj.lCellID return JSONEncoder.default(self, obj)