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

Throw error when wrong input #14

Closed benjibre closed 2 months ago

benjibre commented 2 months ago

I did not enter the log file name after the --log-file flag:

$ build_nep_traj zif8-md-03 zif8-md-06 zif8-md-09 --use-forces --use-virial -o zif8_out.traj --log-file --total-ratios 80:10:10 

***header ***

Traceback (most recent call last):
  File "/home/bre/.conda/envs/pq/bin/build_nep_traj", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/bre/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/cli/build_nep_traj.py", line 82, in main
    writer = NEPWriter(filename=args.output, mode=args.mode)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<@beartype(PQAnalysis.io.nep.NEPWriter.NEPWriter.__init__) at 0x7fa4223cc5e0>", line 59, in __init__
  File "/home/bre/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/io/nep/NEPWriter.py", line 55, in __init__
    self.logger = setup_logger(self.logger)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bre/.conda/envs/pq/lib/python3.12/site-packages/PQAnalysis/utils/custom_logging.py", line 47, in setup_logger
    print_header(stream=file)
TypeError: print_header() got an unexpected keyword argument 'stream'

Maybe provide a more detailed error description or check if string of log file is given.

97gamjak commented 2 months ago

Ok, probably I understand what you mean. Could you please provide the exact command line that you used?

97gamjak commented 2 months ago

So no need for further information - that was actually a bug and not a user error. Therefore, there will be no detailed error message on this exception.

The command line tool should now behave as expected.

benjibre commented 2 months ago

Thank you for the answer!