Hi everyone, I was updating the component mmic_optim_gmx and I encountered a bug about the hash value in Molecule object. This bug is from from_file() function, which is an inherent function of Molecule. After energy minimization with Gromacs (implemented by mmic_cmd), the written .gro file should be read into mmic schema. However, if mmic_parmed is used as a translator for this step, the following error is raised:
Traceback (most recent call last):
File "/home/******/Project/MMIC/lab/01_Issue/to_file_error_01.py", line 17, in <module> error_repeat_compute.compute(inp)
File "/home/******/miniconda3/envs/mmic/lib/python3.9/site-packages/mmic/components/base/base_component.py", line 74, in compute
cls.output(**exec_output.dict())
File "pydantic/main.py", line 406, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for error_output
molecule
Model data inconsistent with stored hash code! (type=assertion_error)
Right now, my forked mmic_optim_gmx can pass all the tests because I specified the translator as mmic_mda in this step. The reason that this issue is opened here instead of mmic_parmed is it relates to the specified execute() function. Writing a .gro file from mmic schema, running some Gromacs commands and reading the produced .gro to mmic schema will not generate this error. This is proved by running the script simple.py (this script uses GromacsWrapper). However, if the .gro file is converted in a specified execute() function, the error appears. This can be repeated by running the script to_file_error_01.py (please make sure to_file_error_02.py is put in the same dir). To prove that this issue has nothing to do with Gromacs, the related code in to_file_error_02.py has been commented. Therefore its function is only to convert a .gro file to mmic schema using Molecule.from_file(). The error can be still repeated.
tofile_error_scripts.zip
To run the scripts here, please make sure you have installed the related mmic components. Please run 'python to_file_error_01.py' in a terminal to repeat the error. This does not require GromacsWrapper.
The code in simple.py, to_file_error_01.py, and to_file_error_02.py is posted here in case it's inconvenient for you to download the zip file.
simple.py
Hi everyone, I was updating the component
mmic_optim_gmx
and I encountered a bug about the hash value inMolecule
object. This bug is fromfrom_file()
function, which is an inherent function of Molecule. After energy minimization with Gromacs (implemented bymmic_cmd
), the written.gro
file should be read intommic
schema. However, ifmmic_parmed
is used as a translator for this step, the following error is raised:Right now, my forked
mmic_optim_gmx
can pass all the tests because I specified the translator asmmic_mda
in this step. The reason that this issue is opened here instead ofmmic_parmed
is it relates to the specifiedexecute()
function. Writing a.gro
file frommmic
schema, running some Gromacs commands and reading the produced.gro
tommic
schema will not generate this error. This is proved by running the scriptsimple.py
(this script usesGromacsWrapper
). However, if the.gro
file is converted in a specifiedexecute()
function, the error appears. This can be repeated by running the scriptto_file_error_01.py
(please make sureto_file_error_02.py
is put in the same dir). To prove that this issue has nothing to do with Gromacs, the related code into_file_error_02.py
has been commented. Therefore its function is only to convert a.gro
file tommic
schema usingMolecule.from_file()
. The error can be still repeated.tofile_error_scripts.zip To run the scripts here, please make sure you have installed the related mmic components. Please run 'python to_file_error_01.py' in a terminal to repeat the error. This does not require GromacsWrapper.
The code in
simple.py
,to_file_error_01.py
, andto_file_error_02.py
is posted here in case it's inconvenient for you to download the zip file. simple.pyto_file_error_01.py
to_file_error_02.py