MolarVerse / PQAnalysis

PQAnalysis is a API/CLI python package for the analysis of MD simulations
https://molarverse.github.io/PQAnalysis/
MIT License
4 stars 2 forks source link

add_molecules cli tool of pqanalysis throws an error with basic input #78

Closed Lucky-Armin closed 1 month ago

Lucky-Armin commented 1 month ago

$ add_molecules mil68ga-md-01.rst perylene-md-05.xyz

With the command above I get a strange error:



During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/home/ape/.conda/envs/pq/bin/add_molecules", line 8, in <module>
   sys.exit(main())
            ^^^^^^
 File "/home/ape/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/cli/add_molecules.py", line 26
3, in main
   AddMoleculesCLI.run(args)
 File "/home/ape/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/cli/add_molecules.py", line 22
9, in run
   add_molecule(
 File "/home/ape/.conda/envs/pq/lib/python3.12/site-packages/decorator.py", line 232, in fun
   return caller(func, *(extras + args), **kw)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/ape/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/type_checking.py", line 113, i
n runtime_type_checking
   return func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
 File "/home/ape/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/tools/add_molecule.py", line 1
18, in add_molecule
   _add_molecule = AddMolecule(
                   ^^^^^^^^^^^^
 File "/home/ape/.conda/envs/pq/lib/python3.12/site-packages/decorator.py", line 232, in fun
   return caller(func, *(extras + args), **kw)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/ape/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/type_checking.py", line 113, i
n runtime_type_checking
   return func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
 File "/home/ape/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/tools/add_molecule.py", line 3
11, in __init__
   self.molecule_file_type = OutputFileFormat(
                             ^^^^^^^^^^^^^^^^^
 File "/home/ape/.conda/envs/pq/lib/python3.12/enum.py", line 757, in __call__
   return cls.__new__(cls, value)
          ^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/ape/.conda/envs/pq/lib/python3.12/enum.py", line 1179, in __new__
   raise exc
 File "/home/ape/.conda/envs/pq/lib/python3.12/enum.py", line 1156, in __new__
   result = cls._missing_(value)
            ^^^^^^^^^^^^^^^^^^^^
 File "/home/ape/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/io/formats.py", line 97, in _m
issing_
   return cls.infer_format_from_extension(filename)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/ape/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/io/formats.py", line 147, in i
nfer_format_from_extension
   if file_extension in cls.file_extensions()[cls.XYZ]:
                        ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
TypeError: unhashable type: 'OutputFileFormat'```

[Slack Message](https://molarverse.slack.com/archives/C075KJ71LN4/p1717157860803259)
Lucky-Armin commented 1 month ago

now i get the desired output, but a lot of lines above, that shouldn't be there constructed.rst.txt

Lucky-Armin commented 1 month ago

Remark: I didn't use the -o flag to write the output directly to a file; i redirected the output to a file manually using '>'; nonetheless, when I use the -o flag to create the file I still get the same dubious lines written to my stdout

97gamjak commented 1 month ago

Remark: I didn't use the -o flag to write the output directly to a file; i redirected the output to a file manually using '>'; nonetheless, when I use the -o flag to create the file I still get the same dubious lines written to my stdout

Ok you should use the -o flag but still the test print and so on shouldn't be there