From 5bd848c9fcb884a7340c2f4e7ea8333b9a396d37 Mon Sep 17 00:00:00 2001 From: "T.Tian" Date: Thu, 28 Sep 2023 20:19:29 +0800 Subject: [PATCH 1/3] update sparc-dft-api --> SPARC-X-API for readme / doc --- .conda/meta.yaml | 8 ++++---- README.md | 6 +++--- doc/advanced_topics.md | 4 ++-- doc/changes_v0.1.md | 4 ++-- doc/contribution_guideline.md | 12 ++++++------ 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.conda/meta.yaml b/.conda/meta.yaml index aee7f867..54ed9191 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -1,4 +1,4 @@ -{% set name = "sparc-dft-api" %} +{% set name = "SPARC-X-API" %} {% set version = "1.0.0" %} {% set file_ext = "tar.gz" %} {% set readme = load_file_regex(load_file="README.md", regex_pattern=".*")[0] %} @@ -33,14 +33,14 @@ requirements: - "ase>=3.22" about: - home: https://github.com/SPARC-X/sparc-dft-api + home: https://github.com/SPARC-X/{{ name }} license: GNU General Public License v3.0 license_family: GPL3 license_file: LICENSE summary: A Python API for the SPARC DFT Code description: {{ readme }} - doc_url: https://github.com/SPARC-X/sparc-dft-api/blob/v0.2-alpha/README.md - dev_url: https://github.com/SPARC-X/sparc-dft-api + doc_url: https://github.com/SPARC-X/{{ name }}/blob/master/README.md + dev_url: https://github.com/SPARC-X/{{ name }} extra: recipe-maintainers: Tian Tian (alchem0x2a@gmail.com) diff --git a/README.md b/README.md index 2f8acb06..8aed478d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # `SPARC-X-API`: A Python API for the SPARC-X DFT Code -[![Package](https://raw.githubusercontent.com/alchem0x2A/sparc-dft-api/badges/badges/package.svg)](https://raw.githubusercontent.com/alchem0x2A/sparc-dft-api/badges/badges/package.svg) -[![Coverage](https://raw.githubusercontent.com/alchem0x2A/sparc-dft-api/badges/badges/coverage.svg)](https://raw.githubusercontent.com/alchem0x2A/sparc-dft-api/badges/badges/coverage.svg) -[![Unit tests](https://github.com/alchem0x2A/sparc-dft-api/actions/workflows/installation_test.yml/badge.svg)](https://github.com/alchem0x2A/sparc-dft-api/actions/workflows/installation_test.yml) +[![Package](https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/badges/badges/package.svg)](https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/badges/badges/package.svg) +[![Coverage](https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/badges/badges/coverage.svg)](https://raw.githubusercontent.com/SPARC-X/SPARC-X-API/badges/badges/coverage.svg) +[![Unit tests](https://github.com/SPARC-X/SPARC-X-API/actions/workflows/installation_test.yml/badge.svg)](https://github.com/SPARC-X/SPARC-X-API/actions/workflows/installation_test.yml) `SPARC-X-API` is an [ASE](https://wiki.fysik.dtu.dk/ase/)-compatible Python API for the density functional theory (DFT) code [SPARC](https://github.com/SPARC-X/SPARC). It offers: diff --git a/doc/advanced_topics.md b/doc/advanced_topics.md index 347bf04b..469235fb 100644 --- a/doc/advanced_topics.md +++ b/doc/advanced_topics.md @@ -1,5 +1,5 @@ ## Advanced Topics -The design of`sparc-dft-api` is schematically shown in the following figure +The design of `SPARC-X-API` is schematically shown in the following figure image ### Behind the bundle file format @@ -37,7 +37,7 @@ using only relevant data. ### Behind the JSON API The JSON API are directly parsed from the `SPARC` documentation [LaTeX files](https://github.com/SPARC-X/SPARC/tree/master/doc/.LaTeX). -The JSON API file (`sparc/sparc_json_api/parameters.json`) distributed by `sparc-dft-api` is generated by: +The JSON API file (`sparc/sparc_json_api/parameters.json`) distributed by `SPARC-X-API` is generated by: ```bash git clone https://github.com/SPARC-X/SPARC.git diff --git a/doc/changes_v0.1.md b/doc/changes_v0.1.md index 07ca9741..d6ccaa41 100644 --- a/doc/changes_v0.1.md +++ b/doc/changes_v0.1.md @@ -1,6 +1,6 @@ -## Major changes from `sparc-dft-api` [v0.1](https://github.com/SPARC-X/sparc-dft-api/tree/eac557f214b402122a506f88f38c7a8767283503) +## Major changes from `SPARC-X-API` [v0.1](https://github.com/SPARC-X/SPARC-X-API/tree/eac557f214b402122a506f88f38c7a8767283503) -`sparc-dft-api` has been heavily refactored in v1.0. If you're using legacy Python codes +`SPARC-X-API` has been heavily refactored in v1.0. If you're using legacy Python codes that are written under v0.1 API, there are a few major changes that require your attention: 1. Support for single `.ion` file format is deprecated. Instead, `v0.2` API treats the whole SPARC directory as a bundle format. Please use `read_sparc` and `write_sparc` methods for basic file I/O instead. diff --git a/doc/contribution_guideline.md b/doc/contribution_guideline.md index 37fd5bca..1a6c3a6f 100644 --- a/doc/contribution_guideline.md +++ b/doc/contribution_guideline.md @@ -2,8 +2,8 @@ We welcome users of SPARC and its python-API to submit issues and pull requests via github. When reporting a bug, please make sure to include the following information: -- SPARC version (if available. Should look like "Month Day, Year" in the `.out` file) -- `sparc-python-api` version or commit hash +- `SPARC` version (if available. Should look like "Month Day, Year" in the `.out` file) +- `SPARC-X-API` version or commit hash - Minimal example for reproducing the error - Error trace message @@ -17,7 +17,7 @@ Pip installation from github's master branch (or your own fork), and download a copy of the latest pseudopotential files. ```python -git clone https://github.com/SPARC-X/sparc-dft-api.git +git clone https://github.com/SPARC-X/SPARC-X-API.git pip install -e "sparc-dft-api[test]" python -m sparc.download_data ``` @@ -50,7 +50,7 @@ The examples can have the name in the format `ex[Number]-[purpose].py`. ### Code structure -Below is a brief overview of the modules in `sparc-dft-api` with simple explanations +Below is a brief overview of the modules in `SPARC-X-API` with simple explanations ``` sparc ├── __init__.py @@ -95,8 +95,8 @@ Please make sure to exclude any computationally-heavy tests from the step "Test The CI workflow contains a coverage report step based on the unit test and generates a [coverage -badge](https://github.com/SPARC-X/sparc-dft-api/blob/badges/badges/coverage.svg) +badge](https://github.com/SPARC-X/SPARC-X-API/blob/badges/badges/coverage.svg) on the [`badges` -branch](https://github.com/SPARC-X/sparc-dft-api/tree/badges). +branch](https://github.com/SPARC-X/SPARC-X-API/tree/badges). For repo maintainers, please make sure the `badges` branch is present and **do not merge to this branch**. From 2e0e0ec53068363e6247f654a6d52d8627af46d7 Mon Sep 17 00:00:00 2001 From: "T.Tian" Date: Thu, 28 Sep 2023 20:28:58 +0800 Subject: [PATCH 2/3] further renaming from sparc-dft-api --> SPARC-X-API --- .conda/meta.yaml | 2 +- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- README.md | 2 +- doc/contribution_guideline.md | 6 +++--- doc/troubleshooting.md | 4 ++-- examples/ex0-eos.py | 2 +- sparc/calculator.py | 2 +- sparc/download_data.py | 2 +- sparc/io.py | 2 +- sparc/psp/README.md | 2 +- sparc/quicktest.py | 2 +- sparc/sparc_parsers/aimd.py | 2 +- sparc/sparc_parsers/geopt.py | 2 +- sparc/sparc_parsers/out.py | 2 +- sparc/sparc_parsers/static.py | 2 +- sparc/utils.py | 2 +- 16 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.conda/meta.yaml b/.conda/meta.yaml index 54ed9191..4667cbba 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -12,7 +12,7 @@ source: build: noarch: python - # Install sparc-dft-api and include the psp files + # Install and include the psp files script: "{{ PYTHON }} -m pip install . --no-deps -vv && cd .. && {{ PYTHON }} -m sparc.download_data" entry_points: - "sparc-ase = sparc.cli:main" diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e7656245..221bd841 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -13,7 +13,7 @@ A concise description of the problem. **To Reproduce** Provide a minimal list of settings / codes to help us debug, such as - Python version -- Version (git commit hash) of `sparc-dft-api` +- Version (git commit hash) of `SPARC-X-API` - `SPARC` C-code version (see the SPARC .out file header) - Your platform and architecture diff --git a/README.md b/README.md index 8aed478d..fb7e4860 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ short [MD trajectory](tests/outputs/NH3_sort_lbfgs_opt.sparc). image -### 5. Units used in `SPARC-X-API` +### 5. Parameters and units used in `SPARC-X-API` In the SPARC DFT code, all input parameters conventionally employ atomic units, such as Hartree and Bohr. Conversely, ASE objects (like `Atoms.positions`, `Atoms.cell`, `Atoms.get_potential_energy()`) utilize eV/Angstrom units. diff --git a/doc/contribution_guideline.md b/doc/contribution_guideline.md index 1a6c3a6f..13a62d7e 100644 --- a/doc/contribution_guideline.md +++ b/doc/contribution_guideline.md @@ -1,5 +1,5 @@ ## Submitting issues and pull requests -We welcome users of SPARC and its python-API to submit issues and pull requests via github. +We welcome users of SPARC-X and SPARC-X-API to submit issues and pull requests via github. When reporting a bug, please make sure to include the following information: - `SPARC` version (if available. Should look like "Month Day, Year" in the `.out` file) @@ -18,7 +18,7 @@ a copy of the latest pseudopotential files. ```python git clone https://github.com/SPARC-X/SPARC-X-API.git -pip install -e "sparc-dft-api[test]" +pip install -e "sparc-x-api[test]" python -m sparc.download_data ``` @@ -43,7 +43,7 @@ python -m pytest -svv tests/test_all_dft.py ### Adding examples All examples are listed in `examples/` directory. Please add examples that are important -for demonstrating the functionalities of `sparc-dft-api` while the calculations can be +for demonstrating the functionalities of `SPARC-X-API` while the calculations can be finished using moderate computating power (e.g. a few minutes with 4 CPU cores). The examples can have the name in the format `ex[Number]-[purpose].py`. diff --git a/doc/troubleshooting.md b/doc/troubleshooting.md index f52f7c85..da0db72e 100644 --- a/doc/troubleshooting.md +++ b/doc/troubleshooting.md @@ -1,5 +1,5 @@ ### Known issues -*This is a list of known bugs with the current sparc-dft-api, remove them when PRs are contributed* +*This is a list of known bugs with the current SPARC-X-API, remove them when PRs are contributed* - [ ] `sparc-ase` command currently does not support multi-image yet - [ ] `SPARC` calculator may occasionally require more DFT steps than needed during optimization -- [ ] Raw result parsing from SPARC files may need to be re-factored in a generator form \ No newline at end of file +- [ ] Raw result parsing from SPARC files may need to be re-factored in a generator form diff --git a/examples/ex0-eos.py b/examples/ex0-eos.py index 4ecf0989..dd06c104 100644 --- a/examples/ex0-eos.py +++ b/examples/ex0-eos.py @@ -1,4 +1,4 @@ -"""A simple example using sparc-dft-api to calculate the equation of state of bulk Al. +"""A simple example using SPARC-X-API to calculate the equation of state of bulk Al. Example taken from GPAW's tutorial: https://wiki.fysik.dtu.dk/gpaw/tutorialsexercises/structureoptimization/lattice_constants/lattice_constants.html diff --git a/sparc/calculator.py b/sparc/calculator.py index aee2a609..58a3ad33 100644 --- a/sparc/calculator.py +++ b/sparc/calculator.py @@ -590,7 +590,7 @@ def print_sysinfo(self, command=None): command = self.command msg = ( "\n" + "*" * 80 + "\n" - f"SPARC program started by sparc-python-api at {now}\n" + f"SPARC program started by SPARC-X-API at {now}\n" f"command: {command}\n" ) if self.log is None: diff --git a/sparc/download_data.py b/sparc/download_data.py index 7ccd4025..949af220 100644 --- a/sparc/download_data.py +++ b/sparc/download_data.py @@ -1,4 +1,4 @@ -"""Download the pseudopotential and other related files after sparc-python-api is installed +"""Download the pseudopotential and other related files after sparc-x-api is installed Run: diff --git a/sparc/io.py b/sparc/io.py index d630812d..d0e872c3 100644 --- a/sparc/io.py +++ b/sparc/io.py @@ -151,7 +151,7 @@ def __find_psp_dir(self, psp_dir=None): else: warn( ( - "PSP directory bundled with sparc-dft-api is broken! " + "PSP directory bundled with SPARC-X-API is broken! " "Please use `sparc.download_data` to re-download them!" ) ) diff --git a/sparc/psp/README.md b/sparc/psp/README.md index ba653c0e..afc06fd4 100644 --- a/sparc/psp/README.md +++ b/sparc/psp/README.md @@ -1,4 +1,4 @@ -This is the folder for storing the pseudo potential files with sparc-dft-api. +This is the folder for storing the pseudo potential files with SPARC-X-API. During installation, this folder will be intentially kept empty. User `python -m sparc.download_data` to download the default pseudo potential files after installation. diff --git a/sparc/quicktest.py b/sparc/quicktest.py index e23fdc7d..c685ce98 100644 --- a/sparc/quicktest.py +++ b/sparc/quicktest.py @@ -140,7 +140,7 @@ def main(): cprint( "\nSome of the tests failed! Please refer to the following resources: \n" "1. SPARC's documentation: https://github.com/SPARC-X/SPARC/blob/master/doc/Manual.pdf \n" - "2. Python API documentation: https://github.com/SPARC-X/sparc-dft-api/wiki\n", + "2. Python API documentation: https://github.com/alchem0x2A/SPARC-X-API/blob/master/README.md\n", color="FAIL", ) diff --git a/sparc/sparc_parsers/aimd.py b/sparc/sparc_parsers/aimd.py index 5dd98a7a..77035ec9 100644 --- a/sparc/sparc_parsers/aimd.py +++ b/sparc/sparc_parsers/aimd.py @@ -168,4 +168,4 @@ def _write_aimd( fileobj, data_dict, ): - raise NotImplementedError("Writing aimd file from python-api " "not supported!") + raise NotImplementedError("Writing aimd file from SPARC-X-API " "not supported!") diff --git a/sparc/sparc_parsers/geopt.py b/sparc/sparc_parsers/geopt.py index 10c9fb38..3dd0fabd 100644 --- a/sparc/sparc_parsers/geopt.py +++ b/sparc/sparc_parsers/geopt.py @@ -134,4 +134,4 @@ def _write_geopt( fileobj, data_dict, ): - raise NotImplementedError("Writing geopt file from python-api not supported!") + raise NotImplementedError("Writing geopt file from SPARC-X-API not supported!") diff --git a/sparc/sparc_parsers/out.py b/sparc/sparc_parsers/out.py index 232ac6f1..28ea8f8c 100644 --- a/sparc/sparc_parsers/out.py +++ b/sparc/sparc_parsers/out.py @@ -246,4 +246,4 @@ def _write_out( fileobj, data_dict, ): - raise NotImplementedError("Writing output file from python-api not supported!") + raise NotImplementedError("Writing output file from SPARC-X-API not supported!") diff --git a/sparc/sparc_parsers/static.py b/sparc/sparc_parsers/static.py index 1e2c227f..0168f2e7 100644 --- a/sparc/sparc_parsers/static.py +++ b/sparc/sparc_parsers/static.py @@ -190,4 +190,4 @@ def _write_static( fileobj, data_dict, ): - raise NotImplementedError("Writing static file from python-api not supported!") + raise NotImplementedError("Writing static file from SPARC-X-API not supported!") diff --git a/sparc/utils.py b/sparc/utils.py index 71aa2905..31ff2572 100644 --- a/sparc/utils.py +++ b/sparc/utils.py @@ -11,7 +11,7 @@ def deprecated(message): def decorator(func): def new_func(*args, **kwargs): warn( - "Function {} is deprecated sparc-dft-api >= v0.2! {}".format( + "Function {} is deprecated! {}".format( func.__name__, message ), category=DeprecationWarning, From b7d0445649d057a7ba8aaf424f56bdeaa9c02e69 Mon Sep 17 00:00:00 2001 From: "T.Tian" Date: Thu, 28 Sep 2023 20:31:08 +0800 Subject: [PATCH 3/3] make sure current conda-forge is still working --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fb7e4860..a09e0777 100644 --- a/README.md +++ b/README.md @@ -23,14 +23,14 @@ which includes the pseudopotential files: # Change 'sparc-env' to your desired name if needed conda create -n sparc-env conda activate sparc-env -conda install -c alchem0x2a sparc-x-api +conda install -c alchem0x2a sparc-dft-api ``` On Linux platforms (x86_64, aarch64), you can also install the precompiled `sparc` DFT binaries alongside the API: ```bash -conda install -c alchem0x2a sparc +conda install -c conda-forge sparc-x conda activate sparc-env # Re-activate to have the env variables effective ```