Skip to content

Commit

Permalink
Handle when data already is Concept
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaris authored and bgyori committed Jul 11, 2023
1 parent 1ce5a4a commit 4764cea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mira/metamodel/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ def refinement_of(
@classmethod
def from_json(cls, data) -> "Concept":
# Handle Units
if data.get('units'):
if isinstance(data, Concept):
return data
elif data.get('units'):
data['units'] = Unit.from_json(data['units'])

return cls(**data)
Expand Down

0 comments on commit 4764cea

Please sign in to comment.