zincware / ZnTrack

Create, visualize, run & benchmark DVC pipelines in Python & Jupyter notebooks.
https://zntrack.readthedocs.io
Apache License 2.0
48 stars 5 forks source link

Issue with `zntrack.deps` #735

Open PythonFZ opened 1 year ago

PythonFZ commented 1 year ago
import ipsuite as ips

project = ips.Project(automatic_node_names=True)

mapping = ips.geometry.BarycenterMapping(data=None)

# Define the CP2K calculations
cp2k = ips.calculators.CP2KSinglePoint(
    data=None,
    cp2k_params="config/cp2k.yaml",
    cp2k_files=["BASIS_MOLOPT", "GTH_POTENTIALS", "dftd3.dat"],
)

with project.group("GeoOpt") as geo_opt_grp:
    mol = ips.configuration_generation.SmilesToAtoms(smiles="CS(=O)C")

    # Create a box of atoms.
    packmol = ips.configuration_generation.Packmol(
        data=[mol.atoms], count=[38], density=1095.2
    )

    geo_opt = ips.calculators.ASEGeoOpt(
        model=cp2k,
        data=packmol.atoms,
        optimizer="BFGS",
        run_kwargs={"fmax": 0.5},
    )

    geo_opt_data = ips.configuration_selection.IndexSelection(data=geo_opt.atoms, indices=slice(20, None, 1))

    test_selection = ips.configuration_selection.RandomSelection(
        data=geo_opt_data.atoms, n_configurations=20
    )

    train_selection = ips.configuration_selection.RandomSelection(
        data=test_selection.excluded_atoms, n_configurations=20
    )

    train_data = train_selection.atoms
    test_data = test_selection.atoms

with project.group("bootstrap"):
    rotate = ips.bootstrap.RotateMolecules(
        data=geo_opt.atoms,
        data_id=-1,
        n_configurations=15,
        maximum=10 * 3.1415 / 180,  # deg max rotation
        include_original=False,
        seed=1,
        model=cp2k,
    )
    translate = ips.bootstrap.TranslateMolecules(
        data=geo_opt.atoms,
        data_id=-1,
        n_configurations=15,
        maximum=0.3,  # Ang max molecular displacement
        include_original=False,
        seed=1,
        model=cp2k,
    )

    volume_scan = ips.analysis.BoxScale(
        data=geo_opt.atoms,
        mapping=mapping,
        model=cp2k,
        start=0.9,
        stop=2.0,
        num=30,
        data_id=-1,
    )
project.build()

yields

FileNotFoundError: [Errno 2] No such file or directory: 
'nodes/bootstrap_RotateMolecules+model/cp2k'
ERROR: failed to reproduce 'bootstrap_RotateMolecules': failed to run: zntrack run ipsuite.nodes.RotateMolecules --name bootstrap_RotateMolecules, exited with 1
PythonFZ commented 1 year ago