Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow fitting procedure on a different cluster and make the fitting database accessible via the MongoDB #314

Merged
merged 148 commits into from
Jan 9, 2025

Conversation

JaGeo
Copy link
Collaborator

@JaGeo JaGeo commented Jan 3, 2025

This will enable fitting on different clusters by transferring the fit database via the MongoDB database.

  • fix all test breakages
  • add documentation
  • test on the cluster and make sure data is really in the datastore

Copy link
Collaborator

@QuantumChemist QuantumChemist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR can be merged

Comment on lines +447 to +486
# TODO: add a database to MongoDB besides just the path
if self.run_fits_on_different_cluster:
from pymatgen.io.ase import AseAtomsAdaptor

adapter = AseAtomsAdaptor()

# must always exist
required_paths = ["train.extxyz", "test.extxyz"]

optional_paths = [
"phonon/train.extxyz",
"phonon/test.extxyz",
"rattled/train.extxyz",
"rattled/test.extxyz",
"without_regularization/train.extxyz",
"without_regularization/test.extxyz",
]

database_dict = {
path: [
adapter.get_structure(atoms)
for atoms in ase.io.read(Path.cwd() / path, ":")
]
for path in required_paths
}

database_dict.update(
{
path: (
[
adapter.get_structure(atoms)
for atoms in ase.io.read(Path.cwd() / path, ":")
]
if (Path.cwd() / path).exists()
else None
)
for path in optional_paths
}
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I condensed this code part here a bit to reduce repetition

@JaGeo JaGeo merged commit f412c40 into main Jan 9, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request phonon affects the phonon workflow only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants