Skip to content

Commit

Permalink
Merge branch 'main' into patch_prv
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuoying authored Nov 6, 2023
2 parents 5cbd8c4 + 253d24e commit 227721e
Show file tree
Hide file tree
Showing 72 changed files with 674 additions and 714 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:

- name: Write release info
run: |
awk 'BEGIN {p = 0} {a = 0 }; /^v\d*.\d*.\d*./ { p += 1; a = 1}; p + a == 1 { print } ' CHANGELOG.md | sed -e '1,1d' | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' > release_info.txt
awk 'BEGIN {p = 0} {a = 0 }; /^\#\#\ v\d*.\d*.\d*./ { p += 1; a = 1}; p + a == 1 { print } ' CHANGELOG.md | sed -e '1,1d' | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' > release_info.txt
echo "" >> release_info.txt
awk '/CONTRIBUTOR SECTION/{f=1; c=0} f' CHANGELOG.md >> release_info.txt
Expand Down
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.1
rev: v0.1.3
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand All @@ -14,10 +15,6 @@ repos:
args: [--remove]
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.10.0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
Expand Down
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
# Change log

## v0.0.12

* Breaking: default `Atomate2Settings.VASP_INHERIT_INCAR` to `False` by @janosh in https://github.com/materialsproject/atomate2/pull/594

### Bug Fixes 🐛
* Enforce magmom precedence in INCAR creation by @mattmcdermott in https://github.com/materialsproject/atomate2/pull/506
* Warn on empty config by @janosh in https://github.com/materialsproject/atomate2/pull/522
* CP2K use `calcs_reversed[0]` instead of `calcs_reversed[-1]` to not reverse again by @janosh in https://github.com/materialsproject/atomate2/pull/534
* Fix wrong INCAR values in MP workflows by @janosh in https://github.com/materialsproject/atomate2/pull/550
* Fix failing tests from Pydantic v2 migration by @hrushikesh-s in https://github.com/materialsproject/atomate2/pull/558
* fixing pydantic v2 test errors by @hrushikesh-s in https://github.com/materialsproject/atomate2/pull/565
* `parse_additional_json()` ignore `FW.json.gz` in output directories by @janosh in https://github.com/materialsproject/atomate2/pull/574
* Fix `bandgap_tol` and delete `bandgap_override` on `MPMetaGGARelaxSetGenerator` by @janosh in https://github.com/materialsproject/atomate2/pull/553
* Fix `VaspInputGenerator`'s `_set_kspacing` not respecting `auto_ismear = False` nor `auto_kspacing = False` by @janosh in https://github.com/materialsproject/atomate2/pull/576
* Clean up VASP powerups, correct params in MP flows, test for `_set_u_params`, test for `_set_kspacing`, fix `_get_incar` method of `VaspInputSet` by @esoteric-ephemera in https://github.com/materialsproject/atomate2/pull/561
* Fix Lobster workflow by @JaGeo in https://github.com/materialsproject/atomate2/pull/583
* Change `MatPesGGAPlusMetaGGAStaticMaker.output` to dict containing both statics by @janosh in https://github.com/materialsproject/atomate2/pull/586
* Test MP + MatPES set generators by @janosh in https://github.com/materialsproject/atomate2/pull/596
### Enhancements 🛠
* Add StructureMetadata as baseclass for output documents by @gpetretto in https://github.com/materialsproject/atomate2/pull/514
* Materials Project GGA and meta-GGA workflows by @janosh in https://github.com/materialsproject/atomate2/pull/504
* [WIP] MP-compatible r2SCAN workflow (and a few general INCAR improvements) by @Andrew-S-Rosen in https://github.com/materialsproject/atomate2/pull/362
* Update to Pydantic v2 by @hrushikesh-s in https://github.com/materialsproject/atomate2/pull/567
* Add MatPES GGA and r2SCAN static makers by @janosh in https://github.com/materialsproject/atomate2/pull/532
* Move elastic workflow to common and build force-field elastic workflow by @JaGeo in https://github.com/materialsproject/atomate2/pull/581
### Documentation 📖
* Update @arosen93 to @Andrew-S-Rosen by @Andrew-S-Rosen in https://github.com/materialsproject/atomate2/pull/516
* Add Aaron Kaplan and Matthew McDermott to `contributors.md` by @janosh in https://github.com/materialsproject/atomate2/pull/560
* Document architectural difference between atomate 1 and 2 by @janosh in https://github.com/materialsproject/atomate2/pull/381
* Add Thomas Purcell to `contributors.md` by @tpurcell90 in https://github.com/materialsproject/atomate2/pull/568
* Add Alex Bonkowski to contributors list by @JaGeo in https://github.com/materialsproject/atomate2/pull/573
* Add @matthewkuner to contributors by @matthewkuner in https://github.com/materialsproject/atomate2/pull/575
* Update contributors.md by @utf in https://github.com/materialsproject/atomate2/pull/579
### House-Keeping 🧹
* Remove `__all__` from all modules by @janosh in https://github.com/materialsproject/atomate2/pull/540
* removed py38 support, and add py 3.11 support by @naik-aakash in https://github.com/materialsproject/atomate2/pull/537
* Check full INCAR by default in `mock_vasp` fixture by @janosh in https://github.com/materialsproject/atomate2/pull/551
* skip validate charge test by @jmmshn in https://github.com/materialsproject/atomate2/pull/563
* Add some type annotations by @ab5424 in https://github.com/materialsproject/atomate2/pull/578
* Future type annotations by @janosh in https://github.com/materialsproject/atomate2/pull/580
* Use `numpy.testing.assert_allclose` over assert `np.(all|is)close` by @janosh in https://github.com/materialsproject/atomate2/pull/582

## New Contributors
* @mattmcdermott made their first contribution in https://github.com/materialsproject/atomate2/pull/506
* @tpurcell90 made their first contribution in https://github.com/materialsproject/atomate2/pull/568
* @esoteric-ephemera made their first contribution in https://github.com/materialsproject/atomate2/pull/561
* @ab5424 made their first contribution in https://github.com/materialsproject/atomate2/pull/578

**Full Changelog**: https://github.com/materialsproject/atomate2/compare/v0.0.11...v0.0.12

## v0.0.11

### Task Document Changes
Expand Down
Binary file added docs/_static/fonts/lato-bold-italic.woff
Binary file not shown.
Binary file added docs/_static/fonts/lato-bold-italic.woff2
Binary file not shown.
Binary file added docs/_static/fonts/lato-bold.woff
Binary file not shown.
Binary file added docs/_static/fonts/lato-bold.woff2
Binary file not shown.
Binary file added docs/_static/fonts/lato-normal-italic.woff
Binary file not shown.
Binary file added docs/_static/fonts/lato-normal-italic.woff2
Binary file not shown.
Binary file added docs/_static/fonts/lato-normal.woff
Binary file not shown.
Binary file added docs/_static/fonts/lato-normal.woff2
Binary file not shown.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ docs = [
"FireWorks==2.0.3",
"autodoc_pydantic==2.0.1",
"furo==2023.9.10",
"ipython==8.16.1",
"ipython==8.17.2",
"jsonschema[format]",
"myst_parser==2.0.0",
"numpydoc==1.6.0",
Expand All @@ -58,15 +58,15 @@ docs = [
"sphinx_design==0.5.0",
]
dev = ["pre-commit>=2.12.1"]
tests = ["FireWorks==2.0.3", "pytest-cov==4.1.0", "pytest==7.4.2"]
tests = ["FireWorks==2.0.3", "pytest-cov==4.1.0", "pytest==7.4.3"]
strict = [
"PyYAML==6.0.1",
"cclib==1.8",
"chgnet==0.2.2",
"chgnet==0.3.1",
"click==8.1.7",
"custodian==2023.10.9",
"dscribe==2.1.0",
"emmet-core==0.71.2",
"emmet-core==0.72.8",
"jobflow==0.1.14",
"lobsterpy==0.3.2",
"matgl==0.8.3",
Expand Down
16 changes: 7 additions & 9 deletions src/atomate2/amset/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class AmsetMaker(Maker):
def make(
self,
settings: dict,
prev_amset_dir: str | Path = None,
prev_dir: str | Path = None,
wavefunction_dir: str | Path = None,
deformation_dir: str | Path = None,
bandstructure_dir: str | Path = None,
Expand All @@ -54,7 +54,7 @@ def make(
----------
settings : dict
Amset settings.
prev_amset_dir : str or Path
prev_dir : str or Path
A previous AMSET calculation directory to copy output files from. The
previous directory is also used to check for transport convergence.
wavefunction_dir : str or Path
Expand All @@ -66,14 +66,12 @@ def make(
band_structure_data.json).
"""
# copy previous inputs
from_prev = prev_amset_dir is not None
if prev_amset_dir is not None:
copy_amset_files(prev_amset_dir)
from_prev = prev_dir is not None
if prev_dir is not None:
copy_amset_files(prev_dir)
else:
if bandstructure_dir is None:
raise ValueError(
"Either prev_amset_dir or bandstructure_dir must be set"
)
raise ValueError("Either prev_dir or bandstructure_dir must be set")

copy_amset_files(bandstructure_dir)

Expand Down Expand Up @@ -116,7 +114,7 @@ def make(
if self.resubmit and not converged:
replace = self.make(
{"interpolation_factor": settings.get("interpolation_factor", 10) + 5},
prev_amset_dir=task_doc.dir_name,
prev_dir=task_doc.dir_name,
)

return Response(output=task_doc, replace=replace)
4 changes: 2 additions & 2 deletions src/atomate2/common/flows/defect.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def make(
struct2,
distortions=self.distortions,
static_maker=self.static_maker,
prev_vasp_dir=dir1,
prev_dir=dir1,
add_name="q1",
add_info={"relaxed_uuid": relax1.uuid, "distorted_uuid": relax2.uuid},
)
Expand All @@ -122,7 +122,7 @@ def make(
struct1,
distortions=self.distortions,
static_maker=self.static_maker,
prev_vasp_dir=dir2,
prev_dir=dir2,
add_name="q2",
add_info={"relaxed_uuid": relax2.uuid, "distorted_uuid": relax1.uuid},
)
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/common/flows/elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def make(
----------
structure : .Structure
A pymatgen structure.
prev_vasp_dir : str or Path or None
prev_dir : str or Path or None
A previous vasp calculation directory to use for copying outputs.
equilibrium_stress : tuple of tuple of float
The equilibrium stress of the (relaxed) structure, if known.
Expand Down
4 changes: 2 additions & 2 deletions src/atomate2/common/jobs/defect.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def spawn_energy_curve_calcs(
distorted_structure: Structure,
distortions: Iterable[float],
static_maker: StaticMaker,
prev_vasp_dir: str | Path | None = None,
prev_dir: str | Path | None = None,
add_name: str = "",
add_info: dict | None = None,
) -> Response:
Expand Down Expand Up @@ -109,7 +109,7 @@ def spawn_energy_curve_calcs(
)
# add all the distorted structures
for i, d_struct in enumerate(distorted_structures):
static_job = static_maker.make(d_struct, prev_vasp_dir=prev_vasp_dir)
static_job = static_maker.make(d_struct, prev_dir=prev_dir)
suffix = f" {i}" if add_name == "" else f" {add_name} {i}"

# write some provenances data in info.json file
Expand Down
8 changes: 4 additions & 4 deletions src/atomate2/common/jobs/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def run_phonon_displacements(
structure: Structure,
supercell_matrix,
phonon_maker: BaseVaspMaker | ForceFieldStaticMaker = None,
prev_vasp_dir: str | Path = None,
prev_dir: str | Path = None,
) -> Flow:
"""
Run phonon displacements.
Expand All @@ -268,7 +268,7 @@ def run_phonon_displacements(
supercell matrix for meta data
phonon_maker : .BaseVaspMaker
A VaspMaker to use to generate the elastic relaxation jobs.
prev_vasp_dir : str or Path or None
prev_dir : str or Path or None
A previous vasp calculation directory to use for copying outputs.
"""
if phonon_maker is None:
Expand All @@ -282,8 +282,8 @@ def run_phonon_displacements(
}

for i, displacement in enumerate(displacements):
if prev_vasp_dir is not None:
phonon_job = phonon_maker.make(displacement, prev_vasp_dir=prev_vasp_dir)
if prev_dir is not None:
phonon_job = phonon_maker.make(displacement, prev_dir=prev_dir)
else:
phonon_job = phonon_maker.make(displacement)
phonon_job.append_name(f" {i + 1}/{len(displacements)}")
Expand Down
15 changes: 6 additions & 9 deletions src/atomate2/common/schemas/phonons.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,19 +410,16 @@ def from_forces_born(
kwargs.get("tmax_thermal_displacements", 500),
kwargs.get("tstep_thermal_displacements", 100),
)
for i, temp in enumerate(temperature_range_thermal_displacements):
for idx, temp in enumerate(temperature_range_thermal_displacements):
phonon.thermal_displacement_matrices.write_cif(
phonon.primitive,
i,
filename="tdispmat_" + str(temp) + "K.cif",
idx,
filename=f"tdispmat_{temp}K.cif",
)
tdisp_mat = (
phonon._thermal_displacement_matrices.thermal_displacement_matrices.tolist()
)
_disp_mat = phonon._thermal_displacement_matrices
tdisp_mat = _disp_mat.thermal_displacement_matrices.tolist()

tdisp_mat_cif = (
phonon._thermal_displacement_matrices.thermal_displacement_matrices_cif.tolist()
)
tdisp_mat_cif = _disp_mat.thermal_displacement_matrices_cif.tolist()

else:
tdisp_mat = None
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def parse_additional_json(dir_name: Path) -> dict[str, Any]:
additional_json = {}
for filename in dir_name.glob("*.json*"):
key = filename.name.split(".")[0]
# ignore FW.json(.gz) so jobflow doesn't try to parse prev_vasp_dir
# ignore FW.json(.gz) so jobflow doesn't try to parse prev_dir
# OutputReferences was causing atomate2 MP workflows to fail with ValueError:
# Could not resolve reference 7f5a7f14-464c-4a5b-85f9-8d11b595be3b not in store
# or cache contact @janosh in case of questions
Expand Down
Loading

0 comments on commit 227721e

Please sign in to comment.