Skip to content

Commit

Permalink
remove capitalized title in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
alchem0x2A committed Dec 1, 2024
1 parent 97f919c commit 78af0b8
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 78 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ jobs:
needs: test-linux

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.10"
python-version: "3.11"
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
Expand All @@ -140,8 +140,8 @@ jobs:
python -m sparc.download_data
- name: Download SPARC output files to SPARC-master
run: |
# TODO: merge to master
wget -O SPARC-socket.zip https://codeload.github.com/alchem0x2A/SPARC/zip/refs/heads/socket
# Use latest SPARC public code with socket support
wget -O SPARC-socket.zip https://codeload.github.com/SPARC-X/SPARC/zip/99e4b7e94ca6f7b4ca1dde9135bea4075b0678f4
unzip SPARC-socket.zip
- name: Compile SPARC with socket
run: |
Expand Down
22 changes: 13 additions & 9 deletions doc/advanced_socket.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ Fig. 1. SPARC electronic calculations with socket communication across hybrid co
```

**Requirements**: the SPARC binary must be manually compiled from the source
code with [socket
support](https://github.com/alchem0x2A/SPARC/tree/socket) and with the
code with socket
support and with the
`USE_SOCKET=1` flag enabled (see the [installation
instructions](https://github.com/alchem0x2A/SPARC/tree/socket).
instructions](https://github.com/SPARC-X/SPARC?tab=readme-ov-file#2-installation).

```{note}
You need SPARC C/C++ after version 2024.11.18 to enable socket support.
```

## Usage
The socket communication layer in SPARC and SPARC-X-API are designed for:
Expand All @@ -38,11 +42,11 @@ standard. Specifically, we implement the original i-PI protocol within
the SPARC C-source code, while the python SPARC-X-API uses a
backward-compatible protocol based on i-PI. The dual-mode design is
aimed for both low-level and high-level interfacing of the DFT codes,
providing the following features as shown in [Fig. 2](#SPARC-protocol-overview):
providing the following features as shown in [Fig. 2](#scheme-sparc-protocol):

(scheme-sparc-protocol)=
```{figure} img/scheme_sparc_protocol.png
:alt: scheme-sparc-protocol
:name: scheme-sparc-protocol
Fig. 2. Overview of the SPARC protocol as an extension to the standard i-PI protocol.
```
Expand All @@ -51,8 +55,8 @@ Based on the scenarios, the socket communication layer can be accessed
via the following approaches as shown in
[Fig. 3](#scheme-sparc-modes):

(scheme-sparc-modes)=
```{figure} img/scheme-SPARC-socket-modes.png
:name: scheme-sparc-modes
:alt: scheme-sparc-modes
Fig. 3. Different ways of using SPARC's socket mode.
Expand Down Expand Up @@ -81,7 +85,7 @@ Fig. 3. Different ways of using SPARC's socket mode.
to be run on a single computer system.


2. **Local-only Mode** ([Fig. 3](#scheme-sparc-modes) **b**)
2. **Local-only mode** ([Fig. 3](#scheme-sparc-modes) **b**)

Ideal for standalone calculations, this mode simulates a conventional calculator while benefiting from socket-based efficiency.

Expand All @@ -91,7 +95,7 @@ Fig. 3. Different ways of using SPARC's socket mode.
```
For most users we recommend using this mode when performing a calculation on a single HPC node.

3. **Client (Relay) Mode** ([Fig. 3](#scheme-sparc-modes) **c**)
3. **Client (Relay) mode** ([Fig. 3](#scheme-sparc-modes) **c**)

In this mode, the `sparc.SPARC` calculator servers as a passive
client which listens to a remote i-PI-compatible server. When
Expand Down Expand Up @@ -119,7 +123,7 @@ Fig. 3. Different ways of using SPARC's socket mode.
automatically determine if it is necessary to restart the SPARC
subprocess.

4. **Server Mode** ([Fig. 3](#scheme-sparc-modes) **d**)
4. **Server mode** ([Fig. 3](#scheme-sparc-modes) **d**)

Paired with the client mode in (3), SPARC-X-API can be run as a
socket server, isolated from the node that performs the
Expand Down
2 changes: 1 addition & 1 deletion doc/advanced_topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ old_atoms.get_potential_energy()
```



(rule-input-param)=
## Rules for input parameters in `sparc.SPARC` calculator

When constructing the `sparc.SPARC` calculator using the syntax
Expand Down
15 changes: 9 additions & 6 deletions doc/basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ If you want to extract more information about the MD simulation steps, take a lo

4. Geometric optimization using ASE's optimizers

The power of `SPARC-X-API` is to combine single point `SPARC` calculations with advanced ASE optimizers, such as BFGS, FIRE or GPMin. Example 2 can be re-written as:
The power of `SPARC-X-API` is to combine single point `SPARC` calculations with advanced ASE optimizers, such as `BFGS`, `FIRE` or `GPMin`. Example 2 can be re-written as:

```python
from sparc.calculator import SPARC
Expand All @@ -133,11 +133,14 @@ for the visualization of atomistic structures. Depending on the
bundle's contents, this could display individual atoms or multiple
images.

[Fig. 2](#fig-2-a-screenshot-of-the-sparc-ase-program) is a screenshot showing the usage of `sparc-ase gui` to visualize a
short [MD trajectory](tests/outputs/NH3_sort_lbfgs_opt.sparc).
[Fig. 1](#fig-screenshot-sparc-ase) is a screenshot showing the usage of `sparc-ase gui` to visualize a
short MD trajectory.

#### Fig 2. A screenshot of the `sparc-ase` program
<img width="1200" alt="image" src="https://github.com/alchem0x2A/SPARC-X-API/assets/6829706/e72329ff-7194-4819-94f8-486ef2218844">
(fig-screenshot-sparc-ase)=
```{figure} https://github.com/alchem0x2A/SPARC-X-API/assets/6829706/e72329ff-7194-4819-94f8-486ef2218844
Fig 1. A screenshot of the `sparc-ase` program
```

### Parameters and units used in `SPARC-X-API`

Expand All @@ -149,7 +152,7 @@ atoms.calc = SPARC(h=0.25, REFERENCE_CUTOFF=0.5, EXX_RANGE_PBE=0.16, **params)
```
inputs following ASE's convention (e.g., `h`) adopt eV/Angstrom units (thus the same setting can be applied to other DFT calculators),
On the other hand, all SPARC-specific parameters, which can often be recognized by their capitalized format (like `REFERENCE_CUTOFF`, `EXX_RANGE_PBE`), retain their original values consistent with their representation in the `.inpt` files.
The reasoning and details about unit conversion can be found in the [Rules for Input Parameters](https://github.com/alchem0x2A/SPARC-X-API/blob/master/doc/advanced_topics.md#rules-for-input-parameters-in-sparcsparc-calculator) in Advanced Topics.
The reasoning and details about unit conversion can be found in the [Rules for Input Parameters](#rule-input-param) in Advanced Topics.


In order for `SPARC-X-API` to be compatible with other ASE-based DFT calculators,
Expand Down
60 changes: 6 additions & 54 deletions doc/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ for pre-commit hooks used in this project, and change them if needed.
If you need to test running DFT using the API, compile or install the
`sparc` executables following the
[manual](https://github.com/SPARC-X/SPARC/blob/master/README.md). Check
[some examples](#install-the-sparc-binary-code) for our recommended
[some examples](#install-binary) for our recommended
approaches.


Expand Down Expand Up @@ -109,7 +109,7 @@ flavor](https://myst-parser.readthedocs.io/en/latest/) of
Markdown. The source `.md` files, together with the main `README.md`
are then rendered to html files using `sphinx`.

After [setting up the test environment](#setting-up-environment),
After [setting up the test environment](setup_environment.md),
additional packages for doc rendering can be installed via:
```bash
cd SPARC-X-API
Expand Down Expand Up @@ -145,55 +145,7 @@ computating power (e.g. a few minutes with 4 CPU cores).
Please check the [maintenance guide](maintainers.md) for roles
involving admin privileges.

<!-- ### Code structure -->

<!-- Below is a brief overview of the modules in `SPARC-X-API` with simple explanations -->
<!-- ``` -->
<!-- sparc -->
<!-- ├── __init__.py -->
<!-- ├── api.py # Includes SparcAPI class for parameter validation -->
<!-- ├── calculator.py # Interface to the SPARC DFT code -->
<!-- ├── cli.py # `sparc-ase` interface -->
<!-- ├── common.py # Definition of common directories -->
<!-- ├── docparser.py # Function and cli interface for parsing the SPARC DFT document -->
<!-- ├── download_data.py # Cli tool to download pseudopotential files -->
<!-- ├── io.py # Provides `SparcBundle` class, `read_sparc` and `write_sparc` functions -->
<!-- ├── quicktest.py # Cli tool for post-installation sanity check -->
<!-- ├── utils.py # Common utilities -->
<!-- ├── psp/ # Place-holder directory for pseudopotentials (used for `download_data.py`) -->
<!-- ├── sparc_json_api # Directory for maintaining the JSON API -->
<!-- │   └── parameters.json -->
<!-- ├── sparc_parsers # Parsers for individual SPARC in-/output formats -->
<!-- │   ├── __init__.py -->
<!-- │   ├── aimd.py -->
<!-- │   ├── atoms.py -->
<!-- │   ├── geopt.py -->
<!-- │   ├── inpt.py -->
<!-- │   ├── ion.py -->
<!-- │   ├── out.py -->
<!-- │   ├── pseudopotential.py -->
<!-- │   ├── static.py -->
<!-- │   └── utils.py -->
<!-- ``` -->

<!-- ### CI/CD by Github Actions -->

<!-- The repo contains a few CI/CD pipelines based on Github Actions. You -->
<!-- may need to take care of the settings if you're one of the -->
<!-- maintainers. For normal code contributors, this section may be -->
<!-- omitted. -->

<!-- - Unit test -->

<!-- The steps are described [here](.github/workflows/installation_test.yml). -->
<!-- Please make sure to exclude any computationally-heavy tests from the step "Test with pytest". -->

<!-- - Coverage -->

<!-- The CI workflow contains a coverage report step based on the unit test -->
<!-- and generates a [coverage -->
<!-- badge](https://github.com/SPARC-X/SPARC-X-API/blob/badges/badges/coverage.svg) -->
<!-- on the [`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**. -->
```{toctree}
:max_depth: 1
test_coverage.md
```
1 change: 0 additions & 1 deletion doc/introduction.md

This file was deleted.

4 changes: 2 additions & 2 deletions doc/setup_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ python -c "from sparc.common import psp_dir; print(psp_dir)"
```

(sparc-cmd-setting)=
### SPARC Command Configuration
### SPARC command configuration

The command to execute SPARC calculations is determined based on the
following priority:
Expand Down Expand Up @@ -291,7 +291,7 @@ sparc_socket_compatibility: False
--------------------------------------------------------------------------------
Please check additional information from:
1. SPARC&apos;s documentation: https://github.com/SPARC-X/SPARC/blob/master/doc/Manual.pdf
2. Python API documentation: https://github.com/alchem0x2A/SPARC-X-API/blob/master/README.md
2. Python API documentation: https://github.com/SPARC-X/SPARC-X-API/blob/master/README.md
</pre>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sparc/quicktest.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def main():
cprint(
"Please check additional information from:\n"
"1. SPARC's documentation: https://github.com/SPARC-X/SPARC/blob/master/doc/Manual.pdf \n"
"2. Python API documentation: https://github.com/alchem0x2A/SPARC-X-API/blob/master/README.md\n",
"2. Python API documentation: https://sparc-x.github.io/SPARC-X-API\n",
color=None,
)

Expand Down

0 comments on commit 78af0b8

Please sign in to comment.