Molara-Lab / Molara

Molara is a Python package for the visualization of chemical structures such as molecules or crystals. It provides a graphical user interface for importing structures from output files of popular computational chemistry software as well as for creating custom structures.
GNU General Public License v3.0
12 stars 0 forks source link

Errors if cclib isn't installed #178

Open adrianusler opened 8 months ago

adrianusler commented 8 months ago

I haven't installed cclib and get an error message from the importer module. I think that Molara shouldn't depend so strictly on this module. Maybe add try/except blocks for the import statements? @ab5424 @GereonFeldmann I am not sure if you added this import, so you can remove the assignment if you aren't responsible for this.

Side note: I think this issue is closely linked to #209.

ab5424 commented 8 months ago

That was written by @flrnslbch but the problem is that we currently decide the importer class by suffix so any file that has no suffix will use the fallback importer which then uses cclib. That is a problem for e.g. POSCAR files which usually have no suffix. We were talking about it few days ago and (I think) @Michel-Heinz suggested to try automatic determination via filename pattern and as the fallback a dialogue window should appear where you can select a file format manually.

Michel-Heinz commented 8 months ago

I d suggest to add cclib as a requirement until then?

adrianusler commented 8 months ago

I d suggest to add cclib as a requirement until then?

Maybe we should do that. Still, I think that the code should be designed such that certain features are just unavailable if cclib cannot be imported.

Michel-Heinz commented 8 months ago

Upon launching the code, it could be checked if CClib is installed and a flag should be set. By checking the flag during the runtime, features can be enabled or disabled.

adrianusler commented 8 months ago

By checking the flag during the runtime, features can be enabled or disabled.

Nice! I think we should do this as much as possible with the dependencies (like pymatgen @ab5424).

ab5424 commented 8 months ago

By checking the flag during the runtime, features can be enabled or disabled.

Nice! I think we should do this as much as possible with the dependencies (like pymatgen @ab5424).

I (partially) did this in #130 by catching ImportErrors and using an alternative code then. We could also implement warnings when packages are not installed.

adrianusler commented 6 months ago

Is this still an issue, @ab5424?

ab5424 commented 6 months ago

Have you tried using it without having cclib installed?