Skip to content

Commit 069f44f

Browse files
g-bauerprehner
andauthored
Restructure Project (#278)
* move core, dft, derive and src to crates directory. Disabled python for now * move benchmarks back into feos crate * replace allow with expect * fix tests * dependency cleanup * add missing dev-dependency * remove extra file * new wheel module, implementations for all needed structs and enum (even if directly usable as python class) * implement DFT bindings * Fix tests in feos-core * remove last occurrences of EosError * added phase_equilibrium module * added python module to build wheel and readme * readme fix * remove python files from rust crates (except estimator) * misc cleanups to make clippy happy * revive from_json_segments * added estimator * adjust wheel workflow * use debug for non-published wheels, adjust release workflow * fix profile * make all_models the default feature for py-feos * more clippy lints * move default Python features from Cargo.toml to pyproject.toml to not confuse rust analyzer --------- Co-authored-by: Philipp Rehner <prehner@ethz.ch>
1 parent 4bfa9f8 commit 069f44f

File tree

255 files changed

+8528
-6785
lines changed

Some content is hidden

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

255 files changed

+8528
-6785
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ jobs:
1717
with:
1818
manylinux: auto
1919
command: build
20-
args: --profile release-lto --out dist
20+
args: >
21+
--profile release-lto
22+
--manifest-path py-feos/Cargo.toml
23+
--out dist
2124
- name: Upload wheels
2225
uses: actions/upload-artifact@v4
2326
with:
@@ -36,7 +39,10 @@ jobs:
3639
uses: PyO3/maturin-action@v1
3740
with:
3841
target: x86_64
39-
args: --profile release-lto --out dist
42+
args: >
43+
--profile release-lto
44+
--manifest-path py-feos/Cargo.toml
45+
--out dist
4046
- name: Upload wheels
4147
uses: actions/upload-artifact@v4
4248
with:
@@ -75,7 +81,10 @@ jobs:
7581
uses: PyO3/maturin-action@v1
7682
with:
7783
target: ${{ matrix.target }}
78-
args: --profile release-lto --out dist
84+
args: >
85+
--profile release-lto
86+
--manifest-path py-feos/Cargo.toml
87+
--out dist
7988
- name: Upload wheels
8089
uses: actions/upload-artifact@v4
8190
with:

.github/workflows/wheels.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ jobs:
1717
with:
1818
manylinux: auto
1919
command: build
20-
args: --release --out dist
20+
args: >
21+
--manifest-path py-feos/Cargo.toml
22+
--out dist
2123
- name: Upload wheels
2224
uses: actions/upload-artifact@v4
2325
with:
@@ -35,7 +37,9 @@ jobs:
3537
uses: PyO3/maturin-action@v1
3638
with:
3739
target: x86_64
38-
args: --release --out dist
40+
args: >
41+
--manifest-path py-feos/Cargo.toml
42+
--out dist
3943
- name: Upload wheels
4044
uses: actions/upload-artifact@v4
4145
with:
@@ -53,7 +57,9 @@ jobs:
5357
uses: PyO3/maturin-action@v1
5458
with:
5559
target: aarch64
56-
args: --release --out dist
60+
args: >
61+
--manifest-path py-feos/Cargo.toml
62+
--out dist
5763
- name: Upload wheels
5864
uses: actions/upload-artifact@v4
5965
with:
@@ -71,7 +77,9 @@ jobs:
7177
uses: PyO3/maturin-action@v1
7278
with:
7379
target: x64
74-
args: --release --out dist
80+
args: >
81+
--manifest-path py-feos/Cargo.toml
82+
--out dist
7583
- name: Upload wheels
7684
uses: actions/upload-artifact@v4
7785
with:

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ Cargo.lock
22
target
33
docs/_build
44
docs/api/generated
5-
.ipynb_checkpoints
5+
.ipynb_checkpoints
6+
__pycache__
7+
*.so

Cargo.toml

Lines changed: 22 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
[package]
2-
name = "feos"
1+
[workspace]
2+
resolver = "2"
3+
members = ["crates/*", "py-feos"]
4+
default-members = ["crates/feos"]
5+
6+
[workspace.package]
37
version = "0.8.0"
8+
edition = "2024"
49
authors = [
510
"Gernot Bauer <bauer@itt.uni-stuttgart.de>",
611
"Philipp Rehner <prehner@ethz.ch>",
712
]
8-
edition = "2021"
9-
readme = "README.md"
1013
license = "MIT OR Apache-2.0"
11-
description = "FeOs - A framework for equations of state and classical density functional theory."
1214
homepage = "https://github.com/feos-org"
1315
repository = "https://github.com/feos-org/feos"
1416
keywords = [
@@ -19,42 +21,32 @@ keywords = [
1921
]
2022
categories = ["science"]
2123

22-
[package.metadata.docs.rs]
23-
features = ["all_models", "rayon"]
24-
rustdoc-args = ["--html-in-header", "./docs-header.html"]
25-
26-
[workspace]
27-
members = ["feos-core", "feos-dft", "feos-derive", "feos-benchmarks"]
28-
29-
[lib]
30-
crate-type = ["rlib", "cdylib"]
31-
32-
[dependencies]
24+
[workspace.dependencies]
3325
quantity = "0.10"
3426
num-dual = "0.11"
35-
feos-core = { version = "0.8", path = "feos-core" }
36-
feos-dft = { version = "0.8", path = "feos-dft", optional = true }
37-
feos-derive = { version = "0.6", path = "feos-derive" }
38-
numpy = { version = "0.23", optional = true }
39-
ndarray = { version = "0.16", features = ["approx"] }
40-
petgraph = { version = "0.7", optional = true }
27+
ndarray = "0.16"
28+
nalgebra = "0.33"
4129
thiserror = "2.0"
4230
conv = "0.3"
4331
num-traits = "0.2"
4432
serde = "1.0"
4533
serde_json = "1.0"
4634
indexmap = "2.0"
47-
rayon = { version = "1.7", optional = true }
4835
itertools = "0.14"
4936
typenum = "1.16"
50-
51-
[dependencies.pyo3]
52-
version = "0.23"
53-
features = ["extension-module", "abi3", "abi3-py39"]
54-
optional = true
55-
56-
[dev-dependencies]
37+
rayon = "1.5"
38+
petgraph = "0.8"
39+
rustdct = "0.7"
40+
rustfft = "6.0"
41+
libm = "0.2"
42+
gauss-quad = "0.2"
5743
approx = "0.5"
44+
criterion = "0.5"
45+
46+
feos-core = { version = "0.8", path = "crates/feos-core" }
47+
feos-dft = { version = "0.8", path = "crates/feos-dft" }
48+
feos-derive = { version = "0.6", path = "crates/feos-derive" }
49+
feos = { version = "0.8", path = "crates/feos" }
5850

5951
[profile.release-lto]
6052
inherits = "release"
@@ -65,37 +57,3 @@ codegen-units = 1
6557
inherits = "release"
6658
lto = "thin"
6759
codegen-units = 1
68-
69-
70-
[features]
71-
default = []
72-
dft = ["feos-dft", "petgraph"]
73-
estimator = []
74-
association = []
75-
pcsaft = ["association"]
76-
epcsaft = ["association"]
77-
gc_pcsaft = ["association"]
78-
uvtheory = []
79-
pets = []
80-
saftvrqmie = []
81-
saftvrmie = []
82-
rayon = ["dep:rayon", "ndarray/rayon", "feos-core/rayon", "feos-dft?/rayon"]
83-
python = [
84-
"pyo3",
85-
"numpy",
86-
"quantity/python_numpy",
87-
"feos-core/python",
88-
"feos-dft?/python",
89-
"rayon",
90-
]
91-
all_models = [
92-
"dft",
93-
"estimator",
94-
"pcsaft",
95-
"epcsaft",
96-
"gc_pcsaft",
97-
"uvtheory",
98-
"pets",
99-
"saftvrqmie",
100-
"saftvrmie",
101-
]
File renamed without changes.

crates/feos-core/Cargo.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[package]
2+
name = "feos-core"
3+
edition.workspace = true
4+
version.workspace = true
5+
authors.workspace = true
6+
homepage.workspace = true
7+
license.workspace = true
8+
repository.workspace = true
9+
keywords.workspace = true
10+
categories.workspace = true
11+
description = "Core traits and functionalities for the `feos` project."
12+
13+
[package.metadata.docs.rs]
14+
rustdoc-args = ["--html-in-header", "./docs-header.html"]
15+
features = ["rayon"]
16+
17+
[dependencies]
18+
quantity = { workspace = true, features = ["ndarray"] }
19+
num-dual = { workspace = true, features = ["linalg"] }
20+
ndarray = { workspace = true }
21+
nalgebra = { workspace = true }
22+
num-traits = { workspace = true }
23+
thiserror = { workspace = true }
24+
serde = { workspace = true, features = ["derive"] }
25+
serde_json = { workspace = true, features = ["preserve_order"] }
26+
indexmap = { workspace = true, features = ["serde"] }
27+
rayon = { workspace = true, optional = true }
28+
typenum = { workspace = true }
29+
30+
[dev-dependencies]
31+
approx = { workspace = true }
32+
quantity = { workspace = true, features = ["approx"] }
33+
34+
[features]
35+
default = []
36+
rayon = ["dep:rayon", "ndarray/rayon"]
File renamed without changes.

0 commit comments

Comments
 (0)