Skip to content

Commit 42f84ef

Browse files
committed
Clean documentation for release (#395)
1 parent bba52b9 commit 42f84ef

43 files changed

Lines changed: 194 additions & 123 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ maturin build --profile="release-lto"
153153
```
154154

155155
which will use the `wheel` feature collection specified in the `pyproject.toml` file.
156-
The `emscripten_wheel` collection provides the same models and AD support for Pyodide while omitting incompatible features (such as Rayon, SQLite, and the Rayon-dependent 3D DFT classes).
156+
The `emscripten_wheel` collection provides the same models and AD support for Pyodide while omitting incompatible features (such as Rayon and SQLite).
157157
Use the following command to build a wheel with specific features:
158158

159159
```

‎docs/api/dft.md‎

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ Implementations of Helmholtz energy functionals for DFT.
88
```{eval-rst}
99
.. currentmodule:: feos
1010
11-
.. autosummary::
12-
:toctree: generated/
13-
14-
HelmholtzEnergyFunctional
15-
```
16-
17-
```{eval-rst}
18-
.. currentmodule:: feos
19-
2011
.. autosummary::
2112
HelmholtzEnergyFunctional.pcsaft
2213
HelmholtzEnergyFunctional.gc_pcsaft
@@ -43,11 +34,11 @@ Implementations of Helmholtz energy functionals for DFT.
4334
4435
ExternalPotential
4536
Geometry
37+
Grid
4638
Pore1D
47-
Pore2D
48-
Pore3D
49-
Adsorption1D
50-
Adsorption3D
39+
PoreProfile
40+
PoreSpecification
41+
Adsorption
5142
```
5243

5344
## Solvation
@@ -68,4 +59,5 @@ Implementations of Helmholtz energy functionals for DFT.
6859
6960
FMTVersion
7061
DFTSolver
62+
DFTSolverLog
7163
```

‎docs/api/eos.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,5 @@ eos = feos.EquationOfState.pcsaft(pc_saft_parameters).joback(joback_parameters)
9090
StateVec
9191
PhaseEquilibrium
9292
PhaseDiagram
93+
PhaseDiagramHetero
9394
```

‎docs/conf.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import sys
33
import feos
4+
import sphinx.ext.autosummary
45

56
sys.path.append(os.path.abspath(os.path.join(__file__, "../..")))
67
sys.path.insert(0, os.path.abspath('.'))
@@ -38,6 +39,25 @@
3839
autodoc_typehints = "both"
3940
autosummary_generate = True
4041
templates_path = ['_templates']
42+
43+
44+
def hide_missing_constructor(app, what, name, obj, options, signature, return_annotation):
45+
# classes without a constructor (no `#[new]`) would otherwise be shown as `Class()`
46+
if what == "class" and getattr(obj, "__text_signature__", None) is None:
47+
return "", None
48+
49+
50+
# autosummary turns empty signatures into `()`, keep them empty instead
51+
_mangle_signature = sphinx.ext.autosummary.mangle_signature
52+
sphinx.ext.autosummary.mangle_signature = lambda sig, max_chars=30: (
53+
_mangle_signature(sig, max_chars) if sig else ""
54+
)
55+
56+
57+
def setup(app):
58+
app.connect("autodoc-process-signature", hide_missing_constructor)
59+
60+
4161
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints']
4262

4363
# -- Options for HTML output -------------------------------------------------

‎docs/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ let parameters = Parameters::from_json(
4848
let eos = &PcSaft::new(parameters);
4949
5050
// Define thermodynamic conditions
51-
let critical_point = State::critical_point(&eos, None, None, None, Default::default())?;
51+
let critical_point = State::critical_point(&eos, (), None, None, Default::default())?;
5252
5353
// Compute properties
5454
let p = critical_point.pressure(Contributions::Total);

‎docs/installation.md‎

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,27 @@ pip install git+https://github.com/feos-org/feos
1616
````
1717
1818
````{tab-item} Rust
19-
In Rust, the `feos-dft` crate and each equation of state or DFT functional is a separate, optional module behind a feature flag.
20-
To use {math}`\text{FeO}_\text{s}` with all models (including Python bindings), use the `all_models` feature:
19+
In Rust, DFT and each equation of state or Helmholtz energy functional is a separate, optional module behind a feature flag.
20+
To use {math}`\text{FeO}_\text{s}` with all models, use the `all_models` feature:
2121
22-
```toml
23-
[dependencies]
24-
feos-core = "0.4"
25-
feos = { version="0.4", features = ["all_models"] }
26-
quantity = "0.6"
22+
```
23+
cargo add feos --features all_models
24+
```
25+
26+
In the following example we use only the PC-SAFT equation of state and Helmholtz energy functionals:
27+
28+
```
29+
cargo add feos --features "dft pcsaft"
2730
```
2831
29-
To access the generic implementations for properties and phase equilibria, the `feos-core` crate is also included as dependency. Finally, {math}`\text{FeO}_\text{s}` makes extensive use of SI units provided by the `quantity` crate.
32+
The generic implementations for properties and phase equilibria (`feos-core`) and for DFT (`feos-dft`) are re-exported as `feos::core` and `feos::dft`, so no additional dependencies are required.
3033
31-
In the following example we use only the PC-SAFT equation of state and Helmholtz energy functionals (without Python bindings):
34+
{math}`\text{FeO}_\text{s}` makes extensive use of SI units provided by the `quantity` crate, which has to be added separately:
3235
33-
```toml
34-
[dependencies]
35-
feos-core = "0.4"
36-
feos-dft = "0.4"
37-
feos = { version="0.4", features = ["dft", "pcsaft"] }
38-
quantity = "0.6"
36+
```
37+
cargo add quantity
3938
```
4039
41-
To access generic DFT functionalities like interfaces and adsorption isotherms, the `feos-dft` crate is added to the dependencies.
40+
Make sure that the version of `quantity` matches the one used by `feos`. Otherwise, the units are not compatible.
4241
````
4342
`````

‎docs/recipes/recipes_contact_angle.ipynb‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"\n",
2626
"# set up surface\n",
2727
"ext_pot = feos.ExternalPotential.LJ93(sigma_ss=3.0, epsilon_k_ss=120.0, rho_s=0.08)\n",
28-
"pore = feos.Pore1D(feos.Geometry.Cartesian, 50*si.ANGSTROM, ext_pot)"
28+
"pore = feos.Pore1D(functional, feos.Geometry.Cartesian, 50*si.ANGSTROM, ext_pot)"
2929
]
3030
},
3131
{
@@ -37,10 +37,10 @@
3737
{
3838
"data": {
3939
"text/latex": [
40-
"$31.99°$"
40+
"$31.997°$"
4141
],
4242
"text/plain": [
43-
"31.990466526671963°"
43+
"31.99653644908266°"
4444
]
4545
},
4646
"execution_count": 2,
@@ -59,7 +59,7 @@
5959
"gamma_sv = vapor_profile.interfacial_tension / si.ANGSTROM**2\n",
6060
"\n",
6161
"# calculate the vapor/liquid interfacial tension\n",
62-
"vle_profile = feos.PlanarInterface.from_pdgt(vle, 2048).solve()\n",
62+
"vle_profile = feos.Interface.planar_from_pdgt(vle, 2048).solve()\n",
6363
"gamma_vl = vle_profile.surface_tension\n",
6464
"\n",
6565
"# calculate the contact angle from Young's equation\n",
@@ -69,7 +69,7 @@
6969
],
7070
"metadata": {
7171
"kernelspec": {
72-
"display_name": "feos",
72+
"display_name": "feos_devel",
7373
"language": "python",
7474
"name": "python3"
7575
},
@@ -83,7 +83,7 @@
8383
"name": "python",
8484
"nbconvert_exporter": "python",
8585
"pygments_lexer": "ipython3",
86-
"version": "3.14.0"
86+
"version": "3.14.7"
8787
}
8888
},
8989
"nbformat": 4,

‎docs/recipes/recipes_surface_tension_pure.ipynb‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@
6363
{
6464
"data": {
6565
"text/latex": [
66-
"$20.191\\,\\mathrm{\\frac{mN}{m}}$"
66+
"$20.198\\,\\mathrm{\\frac{mN}{m}}$"
6767
],
6868
"text/plain": [
69-
"20.190692939005643 mN/m"
69+
"20.19808975615558 mN/m"
7070
]
7171
},
7272
"execution_count": 3,
@@ -75,8 +75,8 @@
7575
}
7676
],
7777
"source": [
78-
"surface_tension_pdgt = (feos.PlanarInterface\n",
79-
" .from_pdgt(vle, 1024)\n",
78+
"surface_tension_pdgt = (feos.Interface\n",
79+
" .planar_from_pdgt(vle, 1024)\n",
8080
" .solve()\n",
8181
" .surface_tension)\n",
8282
"surface_tension_pdgt"
@@ -91,10 +91,10 @@
9191
{
9292
"data": {
9393
"text/latex": [
94-
"$20.191\\,\\mathrm{\\frac{mN}{m}}$"
94+
"$20.194\\,\\mathrm{\\frac{mN}{m}}$"
9595
],
9696
"text/plain": [
97-
"20.190693016626028 mN/m"
97+
"20.194223394324272 mN/m"
9898
]
9999
},
100100
"execution_count": 4,
@@ -103,8 +103,8 @@
103103
}
104104
],
105105
"source": [
106-
"surface_tension_tanh = (feos.PlanarInterface\n",
107-
" .from_tanh(vle, 1024, 100 * si.ANGSTROM, 500 * si.KELVIN)\n",
106+
"surface_tension_tanh = (feos.Interface\n",
107+
" .planar_from_tanh(vle, 1024, 100 * si.ANGSTROM, 500 * si.KELVIN)\n",
108108
" .solve()\n",
109109
" .surface_tension\n",
110110
")\n",
@@ -114,7 +114,7 @@
114114
],
115115
"metadata": {
116116
"kernelspec": {
117-
"display_name": "feos",
117+
"display_name": "feos_devel",
118118
"language": "python",
119119
"name": "python3"
120120
},
@@ -128,7 +128,7 @@
128128
"name": "python",
129129
"nbconvert_exporter": "python",
130130
"pygments_lexer": "ipython3",
131-
"version": "3.13.5"
131+
"version": "3.14.7"
132132
}
133133
},
134134
"nbformat": 4,

‎docs/tutorials/dft/pcsaft_surface_tension.ipynb‎

Lines changed: 29 additions & 29 deletions
Large diffs are not rendered by default.

‎docs/tutorials/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Tutorials
22

3-
You can find each of the tutorials below as jupyter notebook in the github repository in the [`examples` folder](https://github.com/feos-org/feos/tree/main/examples).
3+
You can find each of the tutorials below as jupyter notebook in the github repository in the [`docs/tutorials` folder](https://github.com/feos-org/feos/tree/main/docs/tutorials).
44

55
```{eval-rst}
66
.. toctree::

0 commit comments

Comments
 (0)