File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from loguru import logger
2+ from mdmodels .units .unit_definition import UnitDefinition
23
34import pyenzyme .tools as tools
45from pyenzyme .versions .v2 import (
78 MeasurementData ,
89 Parameter ,
910 ReactionElement ,
10- UnitDefinitionAnnot ,
1111)
1212
1313
@@ -118,6 +118,7 @@ def _check_units_exist(doc: EnzymeMLDocument) -> bool:
118118 mandatory_unit_objects = [
119119 * tools .extract (obj = doc , target = MeasurementData ),
120120 ]
121+ print (f"Found { len (mandatory_unit_objects )} mandatory unit objects." )
121122
122123 optional_unit_objects = [
123124 * tools .extract (obj = doc , target = Parameter ),
@@ -126,16 +127,16 @@ def _check_units_exist(doc: EnzymeMLDocument) -> bool:
126127 result = []
127128
128129 for unit_obj in mandatory_unit_objects :
129- units = tools .extract (obj = unit_obj , target = UnitDefinitionAnnot )
130+ units = tools .extract (obj = unit_obj , target = UnitDefinition )
130131
131132 if len (units ) == 0 :
132133 logger .error (
133- f"Object of type '{ type (unit_obj ).__name__ } ' with id '{ unit_obj .id } ' does not have a unit defined."
134+ f"Object of type '{ type (unit_obj ).__name__ } ' with id '{ unit_obj .species_id } ' does not have a unit defined."
134135 )
135136 result .append (False )
136137
137138 for unit_obj in optional_unit_objects :
138- units = tools .extract (obj = unit_obj , target = UnitDefinitionAnnot )
139+ units = tools .extract (obj = unit_obj , target = UnitDefinition )
139140
140141 if len (units ) == 0 :
141142 logger .warning (
You can’t perform that action at this time.
0 commit comments