tlubitz / SBtab

SBtab - Table format for Systems Biology:
www.sbtab.net
MIT License
6 stars 8 forks source link

change_attribute() is not working for SBtabDocuments #62

Closed eladnoor closed 6 years ago

eladnoor commented 6 years ago

self.doc_row is initialized as False but is assumed later to be a string: if attribute not in self.doc_row:

https://github.com/tlubitz/SBtab/blob/fc7c92bd64909f1ee3bb1e48d444f7b536e6f0e3/python/SBtab.py#L938

This raises an Exception and there is no other obvious way to add attributes to the SBtabDocument header for the first time.

tlubitz commented 6 years ago

Hi Elad, I assume this happens in the scenario when you build an empty SBtabDocument and try to add doc row attributes without having added any SBtabs (via add_sbtab or add_sbtab_string) yet? Tbh I didn't have this specific scenario on my list, sorry. I added this to the SBtabDocument init: if the object is initialised without SBtabs, it is given a default doc_row over the appropriate function. Please close if resolved.

eladnoor commented 6 years ago

Yes, it is indeed working now. Thanks.