Closed m-philipps closed 3 months ago
I would not see a specific reason to keep it in the try except clause. pypesto.petab has to be imported separately and at this stage I think we can expect people to have installed petab. What do you think @dweindl, @Doresic?
Yeah, think it can be moved outside. A thought: I remember I had to do this for my ordinal/semiquantitative stuff even though they should only ever be used with those two included. If I didn't do it, some tests that do not install petab/amici would fail. However, I was always surprised by how and why these tests would import those modules then. Back then I didn't understand it much / think twice. But there might be something weird there.
closed in #1355
petab
is a necessary import for using thepetab.PetabImporter
, yet it is imported within a try/except clause, and after the import of amici. That means that whenamici
is not available,petab
can not be imported.https://github.com/ICB-DCM/pyPESTO/blob/34e89b3bc88d2052ca808da43c11c57da75bec04/pypesto/petab/importer.py#L54-L69
Is there a reason to use try/except around the
petab
import for thepetab.importer
?