diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 31a5e1da..a534b721 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 diff --git a/README.md b/README.md index b8647eb6..f9ca95d9 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/source/conf.py b/docs/source/conf.py index 1fee59ae..3ff3ab09 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,6 +12,8 @@ # import os import sys +from wfl import __version__ + sys.path.insert(0, os.path.abspath('../../wfl')) @@ -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 --------------------------------------------------- diff --git a/docs/source/index.rst b/docs/source/index.rst index 7839db96..03b53f6b 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -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 @@ -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 `. + + +*************************************** +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 *************************************** diff --git a/pyproject.toml b/pyproject.toml index 9d115787..65873722 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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]"] + diff --git a/tests/calculators/test_ase_fileio_caching.py b/tests/calculators/test_ase_fileio_caching.py index 00883e03..4f2e9bd6 100644 --- a/tests/calculators/test_ase_fileio_caching.py +++ b/tests/calculators/test_ase_fileio_caching.py @@ -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 @@ -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 diff --git a/tests/calculators/test_calc_generic.py b/tests/calculators/test_calc_generic.py index d08c12bb..d952582f 100644 --- a/tests/calculators/test_calc_generic.py +++ b/tests/calculators/test_calc_generic.py @@ -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 @@ -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)] diff --git a/tests/calculators/test_wrapped_calculator.py b/tests/calculators/test_wrapped_calculator.py index 4fe2b3e9..c273a026 100644 --- a/tests/calculators/test_wrapped_calculator.py +++ b/tests/calculators/test_wrapped_calculator.py @@ -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 @@ -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) \ No newline at end of file + pytest.warns(RuntimeWarning, generic.calculate, **kwargs_generic) diff --git a/wfl/__init__.py b/wfl/__init__.py index e69de29b..9226fe7e 100644 --- a/wfl/__init__.py +++ b/wfl/__init__.py @@ -0,0 +1 @@ +from .__version__ import __version__ diff --git a/wfl/__version__.py b/wfl/__version__.py new file mode 100644 index 00000000..260c070a --- /dev/null +++ b/wfl/__version__.py @@ -0,0 +1 @@ +__version__ = "0.3.1" diff --git a/wfl/calculators/utils.py b/wfl/calculators/utils.py index 30d22563..1ca8c6b6 100644 --- a/wfl/calculators/utils.py +++ b/wfl/calculators/utils.py @@ -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