TREX-CoE / trexio_tools

Set of tools for trexio files
BSD 3-Clause "New" or "Revised" License
18 stars 6 forks source link

Convert backend not functioning #18

Closed scemama closed 11 months ago

scemama commented 1 year ago
$ trexio convert-backend -i gau-tight-water+-cart.h5 -o gau-tight-water+-cart.trexio -b text -j ~/Johannes/trexio/trex.json 
File gau-tight-water+-cart.trexio will be overwritten.
Traceback (most recent call last):
  File "/home/scemama/TREX/trexio_tools/src/trexio_tools/converters/convert_back_end.py", line 98, in run_converter
    from converters.converter_generated import data_handler
ModuleNotFoundError: No module named 'converters'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/scemama/TREX/trexio_tools/src/trexio_tools/converters/convert_back_end.py", line 102, in run_converter
    from converter_generated import data_handler
ModuleNotFoundError: No module named 'converter_generated'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/scemama/miniconda3/bin/trexio", line 8, in <module>
    sys.exit(main())
  File "/home/scemama/TREX/trexio_tools/src/trexio_tools/trexio_run.py", line 102, in main
    run(
  File "/home/scemama/TREX/trexio_tools/src/trexio_tools/converters/convert_back_end.py", line 127, in run
    run_converter(filename_from, filename_to, back_end_to, back_end_from, overwrite)
  File "/home/scemama/TREX/trexio_tools/src/trexio_tools/converters/convert_back_end.py", line 104, in run_converter
    raise ImportError('The generated (JSON-based) data_handler.py module cannot be imported.')
ImportError: The generated (JSON-based) data_handler.py module cannot be imported.
q-posev commented 11 months ago

@scemama I tried to reproduce this error, but I could not. Perhaps something was not right with your trexio_tools setup. Can you try to reproduce this error using the latest commit of this repo and trexio v.2.3.2 ?

For me it worked for GAMESS test file:

trexio convert-from -t gamess -i data/thiophene.gms.out gamess.h5
trexio convert-backend -i gamess.h5 -o gamess.txt -b text -j ~/trexio/trex.json

NB: 1) I had to manually fix a bug with coefficients.dtype in the trexio.py file which is still present in 2.3.2 but is fixed by you in the recent versions 2) the trex.json has to be the one from v.2.3.2, JSON files from different trexio versions might be incompatible.

scemama commented 11 months ago

Yes, it was a problem in my setup. Sorry.