althonos / pronto

A Python frontend to (Open Biomedical) Ontologies.
https://pronto.readthedocs.io
MIT License
229 stars 48 forks source link

AttributeError: module 'fastobo.typedef' has no attribute 'IsClassLevel' when saving obo file #178

Closed cmungall closed 2 years ago

cmungall commented 2 years ago

See #175 for code that will reproduce

this ontology:

format-version: 1.4
ontology: test

[Typedef]
id: q
name: q
is_class_level: true

results in:

  File "/Users/cjm/Library/Caches/pypoetry/virtualenvs/oaklib-OeQZizwE-py3.9/lib/python3.9/site-packages/pronto/ontology.py", line 405, in dump
    cls(self).dump(file)  # type: ignore
  File "/Users/cjm/Library/Caches/pypoetry/virtualenvs/oaklib-OeQZizwE-py3.9/lib/python3.9/site-packages/pronto/serializers/obo.py", line 37, in dump
    frame = self._to_typedef_frame(Relationship(self.ont, data))
  File "/Users/cjm/Library/Caches/pypoetry/virtualenvs/oaklib-OeQZizwE-py3.9/lib/python3.9/site-packages/pronto/serializers/_fastobo.py", line 282, in _to_typedef_frame
    frame.append(fastobo.typedef.IsClassLevel(True))
AttributeError: module 'fastobo.typedef' has no attribute 'IsClassLevel'
althonos commented 2 years ago

Fixed in v2.4.7, thanks for the report!