You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While parsing isaTab to isaJson, ontologies loaded into the OntologyAnnotation Class have the same @id value
This is because the id method parameter is only evaluated once in python, so it creates a single uuid.uuid4() that is set to all ontologies as the @id param, unless a new id param is passed in. passing in _id = none and then setting the variable to uuid4() if the method param is None fixes this issue. However if then something were passed in in the id value, all future id fields would have that same passed in value, as the optional variable reference would no longer point to None.
def __init__(self, term='', term_source=None, term_accession='',
comments=None, id_ = None) :
super().__init__(comments)
self.__term = term
self.__term_source = term_source
self.__term_accession = term_accession
self.id = str(uuid.uuid4()) if not id_ else id_
Ideally because of the way python evaluates these optional params, maybe the _id param should be required, and evaluates to something every time, or should be removed from init() and can be set after the fact, to ensure there are no inadvertent duplicate values.
The text was updated successfully, but these errors were encountered:
While parsing isaTab to isaJson, ontologies loaded into the OntologyAnnotation Class have the same @id value
This is because the id method parameter is only evaluated once in python, so it creates a single uuid.uuid4() that is set to all ontologies as the @id param, unless a new id param is passed in. passing in _id = none and then setting the variable to uuid4() if the method param is None fixes this issue. However if then something were passed in in the id value, all future id fields would have that same passed in value, as the optional variable reference would no longer point to None.
Currently:
This fixes then issue
Ideally because of the way python evaluates these optional params, maybe the _id param should be required, and evaluates to something every time, or should be removed from init() and can be set after the fact, to ensure there are no inadvertent duplicate values.
The text was updated successfully, but these errors were encountered: