Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Apr 18, 2024
1 parent 8e8d36a commit c146a78
Show file tree
Hide file tree
Showing 17 changed files with 2,037 additions and 1,316 deletions.
2 changes: 1 addition & 1 deletion atomrdf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from atomrdf.graph import KnowledgeGraph
from atomrdf.structure import System
from atomrdf.workflow.workflow import Workflow
from atomrdf.workflow.workflow import Workflow
4 changes: 3 additions & 1 deletion atomrdf/encoder.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import numpy as np
from json import JSONEncoder


class NumpyArrayEncoder(JSONEncoder):
"""
Encode numpy to dump in json
"""

def default(self, obj):
if isinstance(obj, np.integer):
return int(obj)
Expand All @@ -13,4 +15,4 @@ def default(self, obj):
elif isinstance(obj, np.ndarray):
return obj.tolist()
else:
return super(NumpyArrayEncoder, self).default(obj)
return super(NumpyArrayEncoder, self).default(obj)
Loading

0 comments on commit c146a78

Please sign in to comment.