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)