Skip to content

Commit

Permalink
Handle dimensionless
Browse files Browse the repository at this point in the history
  • Loading branch information
bgyori committed Jun 28, 2023
1 parent 89695dd commit cdfbd81
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mira/sources/sbml/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ def _lookup_concepts_filtered(species_ids) -> List[Concept]:
for species in self.sbml_model.species
}

species_units = {
species.id: self.units[species.units] for species in self.sbml_model.species
}

all_locals = {k: v for k, v in (list(parameter_symbols.items()) +
list(compartment_symbols.items()) +
list(function_lambdas.items()) +
Expand Down Expand Up @@ -341,7 +337,10 @@ def _extract_concepts(self) -> Mapping[str, Concept]:

def get_object_units(self, object):
if object.units:
return Unit(expression=self.units[object.units])
if object.units == 'dimensionless':
return Unit(expression=sympy.Integer(1))
else:
return Unit(expression=self.units[object.units])
else:
return None

Expand Down

0 comments on commit cdfbd81

Please sign in to comment.