Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/lobsterpy-0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh authored Nov 14, 2024
2 parents 4fe7667 + 5f0bc75 commit 4ff1444
Show file tree
Hide file tree
Showing 303 changed files with 3,924 additions and 641 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
exclude: ^(.github/|tests/test_data/abinit/)
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.3
hooks:
- id: ruff
args: [--fix]
Expand All @@ -17,7 +17,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
rev: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies: [black]
Expand All @@ -30,7 +30,7 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2
rev: v1.13.0
hooks:
- id: mypy
files: ^src/
Expand All @@ -41,11 +41,11 @@ repos:
rev: v2.3.0
hooks:
- id: codespell
stages: [commit, commit-msg]
stages: [pre-commit, commit-msg]
args: [--ignore-words-list, 'titel,statics,ba,nd,te,atomate']
types_or: [python, rst, markdown]
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
rev: 0.8.0
hooks:
- id: nbstripout
args:
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Change log

## v0.0.18

### New Features 🎉
* Aims magnetic ordering by @tpurcell90 in https://github.com/materialsproject/atomate2/pull/922
* Ferroelectric Workflow 2 by @fraricci in https://github.com/materialsproject/atomate2/pull/1012
* Feat: GW workflow with VASP by @yanghan234 in https://github.com/materialsproject/atomate2/pull/808

### Enhancements 🛠
* Allow energy minimization maker to report energies by @orionarcher in https://github.com/materialsproject/atomate2/pull/1004
* Implementation to adjust get_supercell_size to also generate orthorhombic supercells by @QuantumChemist in https://github.com/materialsproject/atomate2/pull/923
* MPMorph Flows by @BryantLi-BLI in https://github.com/materialsproject/atomate2/pull/938

### House-Keeping 🧹
* Fix `ruff` PLC0206 by @janosh in https://github.com/materialsproject/atomate2/pull/1009
* Update MACE to 0.3.6 by @orionarcher in https://github.com/materialsproject/atomate2/pull/1032
* Allow custom mace model by specifying "model" in calculator kwargs" by @orionarcher in https://github.com/materialsproject/atomate2/pull/1017
* feat: add dedicated fireworks optional dependency (Fix #1033). by @hongyi-zhao in https://github.com/materialsproject/atomate2/pull/1035
* Make testing utils importable by @jmmshn in https://github.com/materialsproject/atomate2/pull/1037

### New Contributors
* @fraricci made their first contribution in https://github.com/materialsproject/atomate2/pull/1012
* @hongyi-zhao made their first contribution in https://github.com/materialsproject/atomate2/pull/1035
* @BryantLi-BLI made their first contribution in https://github.com/materialsproject/atomate2/pull/938
* @yanghan234 made their first contribution in https://github.com/materialsproject/atomate2/pull/808

**Full Changelog**: https://github.com/materialsproject/atomate2/compare/v0.0.17...v0.0.18

## v0.0.17

### Bug Fixes 🐛
Expand Down
16 changes: 5 additions & 11 deletions docs/user/codes/openmm.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,17 @@
>>> conda activate atomate2

# installing atomate2
>>> pip install git+https://github.com/orionarcher/atomate2

# installing classical_md dependencies
>>> conda install -c conda-forge --file .github/classical_md_requirements.txt
>>> pip install "atomate2[openmm]"
```

Alternatively, if you anticipate regularly updating
atomate2 from source (which at this point, you should),
you can clone the repository and install from source.
atomate2 from source, you can clone the repository and install from source.

``` bash
# installing atomate2
>>> git clone https://github.com/orionarcher/atomate2
>>> git clone https://github.com/materialsproject/atomate2
>>> cd atomate2
>>> git branch openff
>>> git checkout openff
>>> git pull origin openff
>>> pip install -e .
>>> pip install -e '.[openmm]'
```

To test the openmm installation, you can run the following command. If
Expand Down Expand Up @@ -458,6 +451,7 @@ run_locally(flows[rank], ensure_success=True)
For now, you'll need to make sure you have a particular emmet branch installed.
Later the builders will be integrated into `main`.

<!-- TODO get emmet@md_builders merged -->
```bash
pip install git+https://github.com/orionarcher/emmet@md_builders
```
Expand Down
42 changes: 21 additions & 21 deletions docs/user/codes/vasp-workflows.csv
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Name,Type,Maker
`Static`_,job,:obj:`.StaticMaker`
`Relax`_,job,:obj:`.RelaxMaker`
`Tight Relax`_,job,:obj:`.TightRelaxMaker`
`Dielectric`_,job,:obj:`.DielectricMaker`
`Transmuter`_,job,:obj:`.TransmuterMaker`
`HSE06 Static`_,job,:obj:`.HSEStaticMaker`
`HSE06 Relax`_,job,:obj:`.HSERelaxMaker`
`HSE06 Tight Relax`_,job,:obj:`.HSETightRelaxMaker`
`Double Relax`_,flow,:obj:`.DoubleRelaxMaker`
`Band Structure`_,flow,:obj:`.BandStructureMaker`
`Uniform Band Structure`_,flow,:obj:`.UniformBandStructureMaker`
`Line-Mode Band Structure`_,flow,:obj:`.LineModeBandStructureMaker`
`HSE06 Band Structure`_,flow,:obj:`.HSEBandStructureMaker`
`HSE06 Uniform Band Structure`_,flow,:obj:`.HSEUniformBandStructureMaker`
`HSE06 Line-Mode Band Structure`_,flow,:obj:`.HSELineModeBandStructureMaker`
`Relax and Band Structure`_,flow,:obj:`.RelaxBandStructureMaker`
`Elastic Constant`_,flow,:obj:`.ElasticMaker`
`Optics`_,flow,:obj:`.OpticsMaker`
`HSE06 Optics`_,flow,:obj:`.HSEOpticsMaker`
`Phonons`_,flow,:obj:`.PhononMaker`
`Lobster`_,flow,:obj:`.VaspLobsterMaker`
`Static`_,job,:obj:`~atomate2.vasp.jobs.core.StaticMaker`
`Relax`_,job,:obj:`~atomate2.vasp.jobs.core.RelaxMaker`
`Tight Relax`_,job,:obj:`~atomate2.vasp.jobs.core.TightRelaxMaker`
`Dielectric`_,job,:obj:`~atomate2.vasp.jobs.core.DielectricMaker`
`Transmuter`_,job,:obj:`~atomate2.vasp.jobs.core.TransmuterMaker`
`HSE06 Static`_,job,:obj:`~atomate2.vasp.jobs.core.HSEStaticMaker`
`HSE06 Relax`_,job,:obj:`~atomate2.vasp.jobs.core.HSERelaxMaker`
`HSE06 Tight Relax`_,job,:obj:`~atomate2.vasp.jobs.core.HSETightRelaxMaker`
`Double Relax`_,flow,:obj:`~atomate2.vasp.flows.core.DoubleRelaxMaker`
`Band Structure`_,flow,:obj:`~atomate2.vasp.flows.core.BandStructureMaker`
`Uniform Band Structure`_,flow,:obj:`~atomate2.vasp.flows.core.UniformBandStructureMaker`
`Line-Mode Band Structure`_,flow,:obj:`~atomate2.vasp.flows.core.LineModeBandStructureMaker`
`HSE06 Band Structure`_,flow,:obj:`~atomate2.vasp.flows.core.HSEBandStructureMaker`
`HSE06 Uniform Band Structure`_,flow,:obj:`~atomate2.vasp.flows.core.HSEUniformBandStructureMaker`
`HSE06 Line-Mode Band Structure`_,flow,:obj:`~atomate2.vasp.flows.core.HSELineModeBandStructureMaker`
`Relax and Band Structure`_,flow,:obj:`~atomate2.vasp.flows.core.RelaxBandStructureMaker`
`Elastic Constant`_,flow,:obj:`~atomate2.vasp.flows.elastic.ElasticMaker`
`Optics`_,flow,:obj:`~atomate2.vasp.flows.core.OpticsMaker`
`HSE06 Optics`_,flow,:obj:`~atomate2.vasp.flows.core.HSEOpticsMaker`
`Phonons`_,flow,:obj:`~atomate2.vasp.flows.phonons.PhononMaker`
`Lobster`_,flow,:obj:`~atomate2.vasp.flows.lobster.VaspLobsterMaker`
5 changes: 3 additions & 2 deletions docs/user/codes/vasp.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ run_locally(lobster, create_folders=True, store=SETTINGS.JOB_STORE)
```

It is, however, computationally very beneficial to define two different types of job scripts for the VASP and Lobster runs, as VASP and Lobster runs are parallelized differently (MPI vs. OpenMP).
[FireWorks](https://github.com/materialsproject/fireworks) allows to run the VASP and Lobster jobs with different job scripts. Please check out the [jobflow documentation on FireWorks](https://materialsproject.github.io/jobflow/tutorials/8-fireworks.html#setting-the-manager-configs) for more information.
[FireWorks](https://github.com/materialsproject/fireworks) allows one to run the VASP and Lobster jobs with different job scripts. Please check out the [jobflow documentation on FireWorks](https://materialsproject.github.io/jobflow/tutorials/8-fireworks.html#setting-the-manager-configs) for more information.

Specifically, you might want to change the `_fworker` for the LOBSTER runs and define a separate `lobster` worker within FireWorks:

Expand Down Expand Up @@ -468,7 +468,8 @@ Finally, sometimes you have a workflow containing many VASP jobs. In this case i
tedious to update the input sets for each job individually. Atomate2 provides helper
functions called "powerups" that can apply settings updates to all VASP jobs in a flow.
These powerups also contain filters for the name of the job and the maker used to
generate them.
generate them. These functions will apply updates *only* to VASP jobs, including those
created dynamically - all other jobs in a flow will not be modified.

```py
from atomate2.vasp.powerups import update_user_incar_settings
Expand Down
30 changes: 16 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools >= 42", "versioningit ~= 1.0", "wheel"]
requires = ["setuptools >= 42", "versioningit >= 1,< 4", "wheel"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -28,33 +28,34 @@ dependencies = [
"PyYAML",
"click",
"custodian>=2024.4.18",
"emmet-core>=0.82.2",
"emmet-core>=0.84.3rc3",
"jobflow>=0.1.11",
"monty>=2024.7.30",
"numpy",
"pydantic-settings>=2.0.3",
"pydantic>=2.0.1",
"pymatgen>=2024.10.3",
"pymatgen>=2024.11.13",
]

[project.optional-dependencies]
abinit = ["abipy>=0.9.3"]
amset = ["amset>=0.4.15", "pydash"]
cclib = ["cclib"]
mp = ["mp-api>=0.37.5"]
phonons = ["phonopy>=1.10.8", "seekpath"]
phonons = ["phonopy>=1.10.8", "seekpath>=2.0.0"]
lobster = ["ijson>=3.2.2", "lobsterpy>=0.4.0"]
defects = [
"dscribe>=1.2.0",
"pymatgen-analysis-defects>=2024.5.11",
"python-ulid",
"python-ulid>=2.7",
]
forcefields = [
"ase>=3.23.0",
"calorine<=2.2.1",
"chgnet>=0.2.2",
"mace-torch>=0.3.3",
"matgl>=1.1.3",
"torchdata<=0.7.1",
# quippy-ase support for py3.12 tracked in https://github.com/libAtoms/QUIP/issues/645
"quippy-ase>=0.9.14; python_version < '3.12'",
"sevenn>=0.9.3",
Expand All @@ -68,6 +69,7 @@ openmm = [
"openmm-mdanalysis-reporter>=0.1.0",
"openmm>=8.1.0",
]
fireworks = ["FireWorks==2.0.3"]
docs = [
"FireWorks==2.0.3",
"autodoc_pydantic==2.2.0",
Expand All @@ -84,7 +86,7 @@ dev = ["pre-commit>=2.12.1"]
tests = [
"FireWorks==2.0.3",
"nbmake==1.5.4",
"pytest-cov==5.0.0",
"pytest-cov==6.0.0",
"pytest-mock==3.14.0",
"pytest-split==0.10.0",
"pytest==8.3.3",
Expand All @@ -96,21 +98,21 @@ strict = [
"click==8.1.7",
"custodian==2024.10.16",
"dscribe==2.1.1",
"emmet-core==0.84.2",
"emmet-core==0.84.3rc3",
"ijson==3.3.0",
"jobflow==0.1.18",
"lobsterpy==0.5.0",
"mdanalysis==2.7.0",
"monty==2024.7.30",
"monty==2024.10.21",
"mp-api==0.42.2",
"numpy",
"openmm-mdanalysis-reporter==0.1.0",
"openmm==8.1.1",
"phonopy==2.27.0",
"pydantic-settings==2.6.0",
"pydantic-settings==2.6.1",
"pydantic==2.9.2",
"pymatgen-analysis-defects==2024.7.19",
"pymatgen==2024.10.3",
"pymatgen-analysis-defects==2024.10.22",
"pymatgen==2024.11.13",
"python-ulid==3.0.0",
"seekpath==2.1.0",
"tblite==0.3.0; python_version < '3.12'",
Expand All @@ -119,11 +121,11 @@ strict = [
strict-forcefields = [
"calorine==3.0",
"chgnet==0.4.0",
"mace-torch>=0.3.3",
"mace-torch>=0.3.6",
"matgl==1.1.3",
"quippy-ase==0.9.14; python_version < '3.12'",
"sevenn==0.10.0",
"torch==2.5.0",
"sevenn==0.10.1",
"torch==2.5.1",
"torchdata==0.7.1", # TODO: remove when issue fixed
]

Expand Down
7 changes: 4 additions & 3 deletions src/atomate2/ase/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import logging
from abc import ABCMeta, abstractmethod
from dataclasses import dataclass, field
from typing import TYPE_CHECKING

Expand All @@ -28,7 +29,7 @@


@dataclass
class AseMaker(Maker):
class AseMaker(Maker, metaclass=ABCMeta):
"""
Define basic template of ASE-based jobs.
Expand All @@ -44,8 +45,6 @@ class AseMaker(Maker):
The name of the job
calculator_kwargs : dict
Keyword arguments that will get passed to the ASE calculator.
calculator_kwargs : dict
Keyword arguments that will get passed to the ASE calculator.
ionic_step_data : tuple[str,...] or None
Quantities to store in the TaskDocument ionic_steps.
Possible options are "struct_or_mol", "energy",
Expand All @@ -70,6 +69,7 @@ class AseMaker(Maker):
store_trajectory: StoreTrajectoryOption = StoreTrajectoryOption.NO
tags: list[str] | None = None

@abstractmethod
def run_ase(
self,
mol_or_struct: Structure | Molecule,
Expand All @@ -92,6 +92,7 @@ def run_ase(
raise NotImplementedError

@property
@abstractmethod
def calculator(self) -> Calculator:
"""ASE calculator, method to be implemented in subclasses."""
raise NotImplementedError
Expand Down
4 changes: 3 additions & 1 deletion src/atomate2/ase/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import sys
import time
from abc import ABCMeta, abstractmethod
from collections.abc import Sequence
from dataclasses import dataclass, field
from enum import Enum
Expand Down Expand Up @@ -78,7 +79,7 @@ class DynamicsPresets(Enum):


@dataclass
class AseMDMaker(AseMaker):
class AseMDMaker(AseMaker, metaclass=ABCMeta):
"""
Perform MD with the Atomic Simulation Environment (ASE).
Expand Down Expand Up @@ -393,6 +394,7 @@ def _callback(dyn: MolecularDynamics = md_runner) -> None:
)

@property
@abstractmethod
def calculator(self) -> Calculator:
"""ASE calculator, to be overwritten by user."""
raise NotImplementedError
Expand Down
Loading

0 comments on commit 4ff1444

Please sign in to comment.