Skip to content

Commit

Permalink
Merge pull request #114 from changliao1025/development
Browse files Browse the repository at this point in the history
typo replace
  • Loading branch information
changliao1025 authored Jan 24, 2023
2 parents a079205 + f8e7017 commit bdf5740
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions pyflowline/classes/basin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
16 changes: 8 additions & 8 deletions pyflowline/classes/mpas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bdf5740

Please sign in to comment.