Skip to content
Merged

Dev #779

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
275e3fb
upgrade protobuf
jnsLs Jun 24, 2025
7c85fa5
logger is not configured in module anymore (#741)
jnsLs Jun 25, 2025
b2c6527
fix materials project dataset (#744)
stefaanhessmann Jul 16, 2025
139da98
Merge branch 'master' into dev
stefaanhessmann Jul 28, 2025
9b0e743
fix(datasets): existing_datasets is never used -> remove (#746)
Maltimore Jul 28, 2025
75c8ca1
fix(config): uuid creation does not need parameter (#745)
Maltimore Jul 28, 2025
e8fe4dc
Pytest for Atomistic Offsets (#732)
sundusaijaz Jul 29, 2025
e68f05b
bug-fix: actually use the smoothed loss in ReduceLROnPlateau
rush42 Sep 8, 2025
c581b4e
fix: use literal strings for strings containing invalid escape backsl…
Maltimore Sep 9, 2025
b7eb54d
Merge pull request #752 from Maltimore/literal_strings
jnsLs Sep 16, 2025
b8f810c
allow 0 length splits in datamodule
stefaanhessmann Sep 17, 2025
6a68b18
Merge pull request #751 from rush42/master
jnsLs Sep 18, 2025
2e10451
requires python gt 3.12
jnsLs Sep 18, 2025
c80aa4e
Merge pull request #753 from atomistic-machine-learning/python_unlimited
jnsLs Sep 18, 2025
75a36da
torch.load with weights_only=True/False as appropriate
Maltimore Sep 19, 2025
77f735e
Merge pull request #747 from Maltimore/fix_neighborlist_torch_load
jnsLs Sep 22, 2025
582e0b9
use caching in uuid resolver to enable calling the same uuid at diffe…
NiklasGebauer Nov 13, 2025
974c4b5
Add argument to uuid resolver to allow generating multiple uuid despi…
NiklasGebauer Nov 13, 2025
063943e
Update config and documentation to reflect the usage of the argument …
NiklasGebauer Nov 19, 2025
284b60e
Update interpolation syntax examples in configs.rst
NiklasGebauer Nov 19, 2025
1dc71d5
Merge pull request #759 from atomistic-machine-learning/nwag/uuid
jnsLs Nov 19, 2025
c62152d
added two new neighbor lists (#760)
jnsLs Dec 4, 2025
1c71d42
Pytest fix: initialize 'atoms_metadata' in ASEAtomsData if None.
sundusaijaz Dec 11, 2025
4f115e3
black
sundusaijaz Dec 11, 2025
281244c
updated requirements
jnsLs Dec 12, 2025
15853b7
Merge pull request #764 from atomistic-machine-learning/sa/pytest-fix
jnsLs Dec 12, 2025
69c444f
Remove 'pytest-benchmark' from dependencies
jnsLs Dec 12, 2025
ceef75e
Merge pull request #765 from atomistic-machine-learning/jl/dependencies
jnsLs Dec 12, 2025
83ba4ba
fix(triples): fix triples computation
Maltimore Dec 5, 2025
30ccdc9
Merge pull request #763 from Maltimore/fix_triples
jnsLs Dec 17, 2025
2ff2cbd
fixed triplet bug
jnsLs Dec 17, 2025
1bcb5b7
Merge pull request #767 from atomistic-machine-learning/jl/triplet_test
jnsLs Dec 17, 2025
c9f5b53
removed pymatgen nbh list because not compatible with gas phase
jnsLs Dec 18, 2025
ebcd487
removed dependency
jnsLs Dec 18, 2025
7864314
Merge pull request #768 from atomistic-machine-learning/jl/remove_pym…
jnsLs Dec 18, 2025
01ed7bf
Fixed atoms.py (#778)
sundusaijaz Jan 20, 2026
d634955
fix: previous url for qm9 is change to springnature.figshare from jus…
newbee1905 Jan 20, 2026
d63c6ed
Merge branch 'master' into dev
stefaanhessmann Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 28 additions & 27 deletions src/schnetpack/data/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,14 @@ def _get_properties(
return properties

# Metadata

@property
def metadata(self):
return self.conn.metadata
with connect(self.datapath, use_lock_file=False) as conn:
return conn.metadata

def _set_metadata(self, val: Dict[str, Any]):
self.conn.metadata = val
with connect(self.datapath, use_lock_file=False) as conn:
conn.metadata = val

def update_metadata(self, **kwargs):
assert all(
Expand Down Expand Up @@ -477,7 +478,7 @@ def add_system(
`available_properties` of the dataset.

"""
self._add_system(self.conn, atoms, atoms_metadata, **properties)
self._add_system(atoms, atoms_metadata, **properties)

def add_systems(
self,
Expand Down Expand Up @@ -511,15 +512,13 @@ def add_systems(
atoms_list, property_list, atoms_metadata_list
):
self._add_system(
self.conn,
atoms,
atoms_metadata,
**prop,
)

def _add_system(
self,
conn,
atoms: Optional[Atoms] = None,
atoms_metadata: Optional[Dict[str, Any]] = None,
**properties,
Expand All @@ -543,28 +542,30 @@ def _add_system(
if atoms_metadata is None:
atoms_metadata = {}

# add available properties to database
valid_props = set().union(
conn.metadata["_property_unit_dict"].keys(),
[structure.Z, structure.R, structure.cell, structure.pbc],
)
for pname in properties:
if pname not in valid_props:
logger.warning(
f"Property `{pname}` is not a defined property for this dataset and "
+ f"will be ignored. If it should be included, it has to be "
+ f"provided together with its unit when calling "
+ f"AseAtomsData.create()."
)

data = {}
for pname in conn.metadata["_property_unit_dict"].keys():
if pname in properties:
data[pname] = properties[pname]
else:
raise AtomsDataError("Required property missing:" + pname)
with connect(self.datapath, use_lock_file=False) as conn:
prop_keys = conn.metadata["_property_unit_dict"].keys()

conn.write(atoms, data=data, key_value_pairs=atoms_metadata)
valid_props = set().union(
prop_keys,
[structure.Z, structure.R, structure.cell, structure.pbc],
)
for pname in properties:
if pname not in valid_props:
logger.warning(
f"Property `{pname}` is not a defined property for this dataset and "
+ f"will be ignored. If it should be included, it has to be "
+ f"provided together with its unit when calling "
+ f"AseAtomsData.create()."
)

data = {}
for pname in prop_keys:
if pname in properties:
data[pname] = properties[pname]
else:
raise AtomsDataError("Required property missing:" + pname)

conn.write(atoms, data=data, key_value_pairs=atoms_metadata)


def create_dataset(
Expand Down
33 changes: 25 additions & 8 deletions src/schnetpack/datasets/qm9.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,18 @@ class QM9(AtomsDataModule):
References:

.. [#qm9_1] https://ndownloader.figshare.com/files/3195404

"""

base_urls = [
"https://ndownloader.figshare.com/files/",
"https://springernature.figshare.com/ndownloader/files/",
]
file_ids = {
"data": "3195389",
"atomrefs": "3195395",
"uncharacterized": "3195404",
}

# properties
A = "rotational_constant_A"
B = "rotational_constant_B"
Expand Down Expand Up @@ -127,6 +136,18 @@ def __init__(

self.remove_uncharacterized = remove_uncharacterized

def _download_file(self, file_id: str, destination: str):
for base_url in self.base_urls:
url = f"{base_url}{file_id}"
try:
request.urlretrieve(url, destination)
return
except Exception:
logging.warning(f"Could not download from {url}, trying next source...")
raise AtomsDataModuleError(
f"Could not download file with id {file_id} from any source."
)

def prepare_data(self):
if not os.path.exists(self.datapath):
property_unit_dict = {
Expand Down Expand Up @@ -179,9 +200,8 @@ def prepare_data(self):

def _download_uncharacterized(self, tmpdir):
logging.info("Downloading list of uncharacterized molecules...")
at_url = "https://ndownloader.figshare.com/files/3195404"
tmp_path = os.path.join(tmpdir, "uncharacterized.txt")
request.urlretrieve(at_url, tmp_path)
self._download_file(self.file_ids["uncharacterized"], tmp_path)
logging.info("Done.")

uncharacterized = []
Expand All @@ -193,9 +213,8 @@ def _download_uncharacterized(self, tmpdir):

def _download_atomrefs(self, tmpdir):
logging.info("Downloading GDB-9 atom references...")
at_url = "https://ndownloader.figshare.com/files/3195395"
tmp_path = os.path.join(tmpdir, "atomrefs.txt")
request.urlretrieve(at_url, tmp_path)
self._download_file(self.file_ids["atomrefs"], tmp_path)
logging.info("Done.")

props = [QM9.zpve, QM9.U0, QM9.U, QM9.H, QM9.G, QM9.Cv]
Expand All @@ -214,9 +233,7 @@ def _download_data(
logging.info("Downloading GDB-9 data...")
tar_path = os.path.join(tmpdir, "gdb9.tar.gz")
raw_path = os.path.join(tmpdir, "gdb9_xyz")
url = "https://ndownloader.figshare.com/files/3195389"

request.urlretrieve(url, tar_path)
self._download_file(self.file_ids["data"], tar_path)
logging.info("Done.")

logging.info("Extracting files...")
Expand Down