molmod / psiflow

scalable molecular simulation
https://molmod.github.io/psiflow/
MIT License
115 stars 8 forks source link

type error on cp2k_input #25

Closed b-mazur closed 1 month ago

b-mazur commented 4 months ago

Hi! I was trying to simply run mof_phase_transition.py example, however I get an error:

Traceback (most recent call last):
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/dataflow/dflow.py", line 884, in _unwrap_futures
    new_inputs.extend([dep.result()])
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/dataflow/dflow.py", line 301, in handle_exec_update
    res = self._unwrap_remote_exception_wrapper(future)
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/dataflow/dflow.py", line 573, in _unwrap_remote_exception_wrapper
    result.reraise()
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/app/errors.py", line 122, in reraise
    reraise(t, v, v.__traceback__)
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/six.py", line 719, in reraise
    raise value
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/app/errors.py", line 145, in wrapper
    return func(*args, **kwargs)
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/app/bash.py", line 47, in remote_side_bash_executor
    raise e
  File "/home/bamaz/software/micromamba/envs/psiflow_env/lib/python3.10/site-packages/parsl/app/bash.py", line 33, in remote_side_bash_executor
    executable = func(*args, **kwargs)
  File "/opt/conda/lib/python3.10/site-packages/psiflow/reference/_cp2k.py", line 201, in cp2k_singlepoint_pre
  File "/opt/conda/lib/python3.10/site-packages/typeguard/__init__.py", line 1032, in wrapper
  File "/opt/conda/lib/python3.10/site-packages/typeguard/__init__.py", line 875, in check_argument_types
TypeError: type of argument "cp2k_input" must be str; got dict instead

I've tried to get to where the source of this problem is, but despite the beautiful documentation, I've failed... ☹️ Is the fault on the psiflow side or is it a cp2k issue? Any idea how to fix it?

svandenhaute commented 4 months ago

Hi Bartosz, which version of psiflow did you install in your local micromamba environment, and which container are you using? We had to update the CP2K interface at some point because Pymatgen's parser couldn't deal with fluorine atoms (F -> FALSE), and I'm thinking that there was a small fix for an error like this right after we released 3.0.4. Can you try installing psiflow directly from the main branch ( pip install git+https://github.com/molmod/psiflow) while using the 3.0.4 container (at oras://ghcr.io/molmod/psiflow:3.0.4_python3.10_cuda)?

That being said, we are planning a major overhaul of psiflow in the next few weeks, which will introduce a large number of new features but more importantly streamline the API and reduce possibility of errors like this one. We're currently finalizing this on the ipi branch. While the API will be very similar, it should support many more use cases (path integral MD, replica exchange, thermodynamic integration, ... ). See here for some examples.

b-mazur commented 4 months ago

Hi Sander, thanks for the quick response! I was using the latest version of psiflow, while I had to copy the link to the old version of the container (3.0.0). I have corrected this and it appears that everything is now working correctly!

Happy to hear that psiflow is developing so fast, it looks like a very promising tool. I will update if I encounter any problems.