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

Update version #334

Merged
merged 7 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 2 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,9 @@ jobs:
cd docs
make html

# event type from https://stackoverflow.com/questions/61886993/in-github-actions-how-to-get-the-type-of-a-trigger-event-as-a-variable
# conditional control ("if:") from https://docs.github.com/en/actions/using-jobs/using-conditions-to-control-job-execution
# dependency from https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow

deploy-docs:
if: github.event.action == 'push'
name: Publish documentation
if: startsWith(github.ref, "refs/tags/")
needs: build-docs
runs-on: ubuntu-latest

Expand Down
35 changes: 10 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,23 @@ For examples and more information see [documentation](https://libatoms.github.io

`wfl` and its dependencies may be installed via `pip install wfl`.

NOTE: (as of 14 June 2024) `wfl` is only tested against the latest ASE pip release, currently v3.23.0.
For the time being, v3.22.1 is the minimum version listed as a (pip) prerequisite of `wfl`, because
it at least mostly works, but it may not be fully compatible and is not actively tested.

# Recent changes

v0.2.3:
v0.3.1:

- Add wfl.generate.neb, with required improved support for passing ConfigSet.groups() to
autoaparallelized functions
- additional updates to file-based calculators for ASE v3.23.
- fixes to parity plots

- Improved handling of old and new style ase.calculators.espresso.Espresso initialization
v0.3.0:

v0.2.2:
- Update the file-based calculators (Orca, FHI-Aims, Vasp, Quantum Espresso, Castep) to work
with with ASE v3.23. This update breaks backwards-compatibility. For compatibility with with
the ASE v3.22 see use wfl v0.2.7 or earlier.

- Improve checking of DFT calculator convergence
v0.2.7:

v0.2.1:
- Latest version compatible with ASE v3.22.x. To install, use `pip install wfl==0.2.7`.

- Fix group iterator
For older changes see [documentation](https://libatoms.github.io/workflow).

v0.2.0:

- Change all wfl operations to use explicit random number generator [pull 285](https://github.com/libAtoms/workflow/pull/285), to improve reproducibility of scripts and reduce the chances that on script rerun, cached jobs will not be recognized due to uncontrolled change in random seed (as in [issue 283](https://github.com/libAtoms/workflow/issues/283) and [issue 284](https://github.com/libAtoms/workflow/issues/284)). Note that this change breaks backward compatibility because many functions now _require_ an `rng` argument, for example
```python
rng = np.random.default_rng(1)
md_configs = md.md(..., rng=rng, ...)
```

v0.1.0:

- make it possible to fire off several remote autoparallelized ops without waiting for their jobs to finish
- multi-pass calculation in `Vasp`, to allow for things like GGA followed by HSE
- MACE fitting, including remote jobs
- various bug fixes
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#
import os
import sys
from wfl import __version__

sys.path.insert(0, os.path.abspath('../../wfl'))


Expand All @@ -21,6 +23,8 @@
#copyright = '2021, N. Bernstein, T. K. Stenczel, E. Gelzinyte'
author = 'N. Bernstein, T. K. Stenczel, E. Gelzinyte'

release = __version__


# -- General configuration ---------------------------------------------------

Expand Down
69 changes: 61 additions & 8 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ Quick start that installs all of the mandatory dependencies:

python3 -m pip install wfl

.. note::

(as of 14 June 2024) `wfl` is only tested against the latest
ASE pip release, currently v3.23.0. For the time being, v3.22.1 is
the mininum version listed as a (pip) prerequisite of `wfl`, because
it at least mostly works, but it may not be fully compatible and is
not actively tested.


***************************************
Repository
Expand All @@ -39,6 +31,67 @@ Repository
Please find the code, raise issues and cotribute at https://github.com/libAtoms/workflow.


***************************************
Development
***************************************

To install all dependencies needed for running unit tests:

.. code-block:: sh

python3 -m pip install /path/to/workflow[test]


Some of the `wfl` functions rely on the `quippy-ase` package, which currently (2 September 2024) supports no higher Python versions than v3.9.

The file-based calculator tests need ASE calculator configiguration file to be present; `see the ASE documentation <https://wiki.fysik.dtu.dk/ase/ase/calculators/calculators.html#calculator-configuration>`.


***************************************
Recent Changes
***************************************

v0.3.0:

- Update the file-based calculators (Orca, FHI-Aims, Vasp, Quantum Espresso, Castep) to work
with with ASE v3.23. This update breaks backwards-compatibility. For compatibility with with
the ASE v3.22 see use wfl v0.2.7 or earlier.

v0.2.7:

- Latest version compatible with ASE v3.22.x. To install, use `pip install wfl==0.2.7`.

v0.2.3:

- Add wfl.generate.neb, with required improved support for passing ConfigSet.groups() to
autoaparallelized functions

- Improved handling of old and new style ase.calculators.espresso.Espresso initialization

v0.2.2:

- Improve checking of DFT calculator convergence

v0.2.1:

- Fix group iterator

v0.2.0:

- Change all wfl operations to use explicit random number generator [pull 285](https://github.com/libAtoms/workflow/pull/285), to improve reproducibility of scripts and reduce the chances that on script rerun, cached jobs will not be recognized due to uncontrolled change in random seed (as in [issue 283](https://github.com/libAtoms/workflow/issues/283) and [issue 284](https://github.com/libAtoms/workflow/issues/284)). Note that this change breaks backward compatibility because many functions now _require_ an `rng` argument, for example
```python
rng = np.random.default_rng(1)
md_configs = md.md(..., rng=rng, ...)
```

v0.1.0:

- make it possible to fire off several remote autoparallelized ops without waiting for their jobs to finish
- multi-pass calculation in `Vasp`, to allow for things like GGA followed by HSE
- MACE fitting, including remote jobs
- various bug fixes


***************************************
Contents
***************************************
Expand Down
25 changes: 23 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[project]

name = "wfl"
version = "0.3.0"
requires-python = ">=3.9"
dependencies = [ "click>=7.0", "numpy<2", "ase>=3.22.1", "pyyaml", "spglib",
"docstring_parser", "expyre-wfl", "universalSOAP" ]
"docstring_parser", "expyre-wfl", "universalSOAP", "pandas" ]
readme = "README.md"
license = { file = "LICENSE" }
dynamic = ["version"]

[project.scripts]
wfl = "wfl.cli.cli:cli"
Expand All @@ -16,3 +16,24 @@ license = { file = "LICENSE" }

[tool.setuptools.packages.find]
exclude = [ "test*" ]

[tool.setuptools.dynamic]
version = {attr = "wfl.__version__"}

[project.optional-dependencies]
test = [
"pytest",
"mace-torch",
"quippy-ase",
"requests",
"rdkit==2024.3.3",
]
doc = [
"sphinx",
"sphinx_click",
"nbsphinx",
"myst_parser",
"sphinx_book_theme",
]
all = ["wfl[test,doc]"]

6 changes: 3 additions & 3 deletions tests/calculators/test_ase_fileio_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
########################
# test Vasp calculator

from tests.calculators.test_vasp import test_vasp_mark
@pytest.mark.skipif(test_vasp_mark, reason='Vasp testing env vars missing')
from tests.calculators.test_vasp import pytestmark as vasp_pytestmark
@vasp_pytestmark
def test_vasp_cache_timing(tmp_path, monkeypatch):
from ase.calculators.vasp import Vasp as Vasp_ase
from wfl.calculators.vasp import Vasp as Vasp_wrap
Expand All @@ -27,7 +27,7 @@ def test_vasp_cache_timing(tmp_path, monkeypatch):
########################
# test quantum espresso calculator
from tests.calculators.test_qe import espresso_avail, qe_pseudo
@pytest.mark.skipif(not espresso_avail, reason='qe testing env vars missing')
@espresso_avail
def test_qe_cache_timing(tmp_path, monkeypatch, qe_pseudo):
from ase.calculators.espresso import Espresso as Espresso_ASE
from wfl.calculators.espresso import Espresso as Espresso_wrap
Expand Down
3 changes: 3 additions & 0 deletions tests/calculators/test_calc_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
from wfl.calculators.espresso import Espresso
from wfl.autoparallelize import AutoparaInfo

from tests.calculators.test_qe import espresso_avail

ref_lj_energy = -4.52573996914352
ref_morse_energy = -3.4187397762024867

Expand Down Expand Up @@ -139,6 +141,7 @@ def test_generic_autopara_defaults():
sys.stderr = sys.__stderr__
assert "num_inputs_per_python_subprocess=3" in l_stderr.getvalue()

@espresso_avail
def test_generic_DFT_autopara_defaults(tmp_path, monkeypatch):
ats = [Atoms('Al2', positions=[[0,0,0], [1,1,1]], cell=[10]*3, pbc=[True]*3) for _ in range(50)]

Expand Down
4 changes: 2 additions & 2 deletions tests/calculators/test_wrapped_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
########################
# test a RuntimeWarning is raised when using the Espresso Calculator directly from ase
from tests.calculators.test_qe import espresso_avail, qe_pseudo
@pytest.mark.skipif(not espresso_avail, reason='qe testing env vars missing')
@espresso_avail
def test_wrapped_qe(tmp_path, qe_pseudo):
from ase.calculators.espresso import Espresso as Espresso_ASE
from wfl.calculators.espresso import Espresso as Espresso_wrap
Expand All @@ -27,4 +27,4 @@ def test_wrapped_qe(tmp_path, qe_pseudo):

direct_calc = (Espresso_ASE, [], kwargs)
kwargs_generic = dict(inputs=ConfigSet(config), outputs=OutputSpec(), calculator=direct_calc)
pytest.warns(RuntimeWarning, generic.calculate, **kwargs_generic)
pytest.warns(RuntimeWarning, generic.calculate, **kwargs_generic)
1 change: 1 addition & 0 deletions wfl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .__version__ import __version__
1 change: 1 addition & 0 deletions wfl/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.3.1"
27 changes: 0 additions & 27 deletions wfl/calculators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,4 @@ def clean_rundir(rundir, keep_files, default_keep_files, calculation_succeeded):
else:
clean_dir(rundir, keep_files, force=False)

def parse_genericfileio_profile_argv(argv):
"""Parse a command provided as a conventional argv into the separate
structures that generic file-io calculators use to construct their Profile

Parameters
----------
argv: list(str)
command to execute, split into separate arguments (e.g. using shlex.split?)

Returns
-------
binary: str binary to execute
parallel_info: dict with parallel info, in particular "binary" for mpirun/mpiexec/srun etc,
and additional fields to reconstruct rest of command line (all fake, depending
on details of how ASE constructs the final command line
"""
binary = argv[-1]
parallel_info = None
if len(argv) > 1:
# assume earlier arguments are parallel execution dependent, in particular
# mpirun/mpiexec/srun [other mpi argument] pw_executable
parallel_info = {"binary": argv[0]}
for arg in argv[1:-1]:
# add additional arguments, faked into a dict that ASE will convert into
# a proper command line
parallel_info[arg] = True

return binary, parallel_info
Loading