BaseIdent TypeError when saving obo files with property chains
cmungall opened this issue · 1 comments
cmungall commented
File with a property chain:
format-version: 1.4
ontology: test
[Typedef]
id: p
name: p
holds_over_chain: p p
(yes, this is just an odd way of writing transitive, but the same phenotype is observed with more realistic property chains)
Test code:
>>> from pronto import Ontology
>>> ont = Ontology("tests/input/pronto-test.obo")
>>> with open("out.obo", 'wb') as file:
... ont.dump(file, format='obo')
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
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 208, in _to_typedef_frame
frame.append(fastobo.typedef.HoldsOverChainClause(*chain))
TypeError: argument 'first': expected BaseIdent instance, str found