Hi Deivi,
What you showed won’t really work, because to persist the changes to the database, you need to call .store()
on the node. Otherwise, when you close the shell, the changes are lost. However, a Node
instance cannot be stored. You could fix this by changing it to a Data
node, which is storable.
Stil, I am not sure if this is the best approach because, sure your data will be stored in AiiDA’s database, it will not be stored at all as a pw.x calculation would be stored if run through AiiDA directly.
This use-case is exactly why we came up with the importer system. As Marnik mentioned, I have already a working version in a branch on aiida-quantumespresso
. I have just updated the branch. Here is how you can install it:
git clone https://github.com/aiidateam/aiida-quantumespresso
cd aiida-quantumespresso
git checkout feature/809/calc-job-importer-pw
pip install -e .
Then you need to configure your local machine as a Computer
in AiiDA if you haven’t done already:
verdi computer setup -L localhost -H localhost -T core.local -S core.direct -n
verdi computer configure core.local localhost --safe-interval 0 -n
Then you can open a verdi shell
and do the following:
import pathlib
from aiida_quantumespresso.calculations.importers.pw import PwCalculationImporter
from aiida_quantumespresso.calculations.pw import PwCalculation
localhost = orm.load_computer('localhost')
filepath_remote = pathlib.Path('/home/max/Documents/MY_FOLDER')
remote_data = RemoteData(str(filepath_remote), computer=localhost)
input_file_name = 'aiida.in'
pseudo_folder_path = filepath_remote / 'pseudo'
inputs = PwCalculationImporter().parse_remote_data(
remote_data, input_file_name, pseudo_folder_path=str(pseudo_folder_path)
)
results, node = run.get_node(PwCalculation, **inputs)
You should now see the calculation in the output of verdi process list -a
.
Please give this a go and let us know if you run into trouble. If there are bugs, I am happy to update the PR and we can use your feedback to finalize it and release it with an official version of aiida-quantumespresso
.