Skip to content

Commit a15630f

Browse files
authored
Release v0.3.0 (feos-org#55)
* Release v0.3.0 * update to maturin 0.13 and add release workflow for feos * fix pyproject.toml and README * new attempt at pyproject.toml * try different workflow * fixed workflows? * readd release flag and fix documentation and release workflows * and readd it for macos universal aswell * Remove references to rust compiler version
1 parent 6f1ff50 commit a15630f

File tree

11 files changed

+48
-37
lines changed

11 files changed

+48
-37
lines changed

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
manylinux: auto
2828
command: build
29-
args: --release --out dist --no-sdist
29+
args: --release --out dist
3030
- name: Install module
3131
run: |
3232
pip install feos --no-index --find-links dist --force-reinstall

.github/workflows/release.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
manylinux: auto
1919
command: build
20-
args: --release --out dist --no-sdist
20+
args: --release --out dist
2121
- name: Upload wheels
2222
uses: actions/upload-artifact@v2
2323
with:
@@ -42,11 +42,11 @@ jobs:
4242
uses: messense/maturin-action@v1
4343
with:
4444
target: x86_64
45-
args: --release --out dist --no-sdist
45+
args: --release --out dist
4646
- name: Build wheels - universal2
4747
uses: messense/maturin-action@v1
4848
with:
49-
args: --release --universal2 --out dist --no-sdist
49+
args: --release --universal2 --out dist
5050
- name: Upload wheels
5151
uses: actions/upload-artifact@v2
5252
with:
@@ -74,7 +74,7 @@ jobs:
7474
uses: messense/maturin-action@v1
7575
with:
7676
target: ${{ matrix.target }}
77-
args: --release --out dist --no-sdist
77+
args: --release --out dist
7878
- name: Upload wheels
7979
uses: actions/upload-artifact@v2
8080
with:
@@ -119,7 +119,7 @@ jobs:
119119
with:
120120
manylinux: auto
121121
command: build
122-
args: --release --out dist --no-sdist
122+
args: --release --out dist
123123
- name: Install module
124124
run: |
125125
pip install feos --no-index --find-links dist --force-reinstall
@@ -145,3 +145,17 @@ jobs:
145145
with:
146146
github_token: ${{ secrets.GITHUB_TOKEN }}
147147
publish_dir: ./public
148+
149+
release-crates-io:
150+
name: Release crates.io
151+
runs-on: ubuntu-latest
152+
steps:
153+
- uses: actions/checkout@v2
154+
- uses: actions-rs/toolchain@v1
155+
with:
156+
profile: minimal
157+
toolchain: stable
158+
override: true
159+
- uses: katyo/publish-crates@v1
160+
with:
161+
registry-token: ${{ secrets.CRATES_IO_TOKEN }}

.github/workflows/wheels.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
with:
1414
python-version: 3.9
1515
- name: Build Wheels
16-
uses: messense/maturin-action@main
16+
uses: messense/maturin-action@v1
1717
with:
1818
manylinux: auto
1919
command: build
20-
args: --release --out dist --no-sdist --cargo-extra-args="--features python --features all_models"
20+
args: --release --out dist
2121
- name: Upload wheels
2222
uses: actions/upload-artifact@v2
2323
with:
@@ -38,10 +38,10 @@ jobs:
3838
profile: minimal
3939
default: true
4040
- name: Build wheels - x86_64
41-
uses: messense/maturin-action@main
41+
uses: messense/maturin-action@v1
4242
with:
4343
target: x86_64
44-
args: --release --out dist --no-sdist --cargo-extra-args="--features python --features all_models"
44+
args: --release --out dist
4545
- name: Upload wheels
4646
uses: actions/upload-artifact@v2
4747
with:
@@ -62,9 +62,9 @@ jobs:
6262
profile: minimal
6363
default: true
6464
- name: Build wheels - universal2
65-
uses: messense/maturin-action@main
65+
uses: messense/maturin-action@v1
6666
with:
67-
args: --release --universal2 --out dist --no-sdist --cargo-extra-args="--features python --features all_models"
67+
args: --release --universal2 --out dist
6868
- name: Upload wheels
6969
uses: actions/upload-artifact@v2
7070
with:
@@ -88,10 +88,10 @@ jobs:
8888
profile: minimal
8989
default: true
9090
- name: Build wheels
91-
uses: messense/maturin-action@main
91+
uses: messense/maturin-action@v1
9292
with:
9393
target: ${{ matrix.target }}
94-
args: --release --out dist --no-sdist --cargo-extra-args="--features python --features all_models"
94+
args: --release --out dist
9595
- name: Upload wheels
9696
uses: actions/upload-artifact@v2
9797
with:

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [0.3.0] - 2022-09-14
10+
- Major restructuring of the entire `feos` project. All individual models are reunited in the `feos` crate. `feos-core` and `feos-dft` still live as individual crates within the `feos` workspace.
11+
912
## [0.2.1] - 2022-05-13
1013
### Fixed
1114
- Fixed a bug due to which the default ideal gas contribution was used for every equation of state. [#17](https://github.com/feos-org/feos/pull/17)

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
[package]
22
name = "feos"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = ["Gernot Bauer <bauer@itt.uni-stuttgart.de>", "Philipp Rehner <prehner@ethz.ch>"]
55
edition = "2018"
6-
rust-version = "1.53"
76
readme = "README.md"
87
license = "MIT OR Apache-2.0"
98
description = "FeOs - A framework for equations of state and classical density functional theory."
@@ -27,7 +26,7 @@ quantity = "0.5"
2726
num-dual = "0.5"
2827
feos-core = { version = "0.3", path = "feos-core" }
2928
feos-dft = { version = "0.3", path = "feos-dft", optional = true }
30-
feos-derive = { path = "feos-derive" }
29+
feos-derive = { version = "0.1", path = "feos-derive" }
3130
numpy = { version = "0.16", optional = true }
3231
ndarray = { version = "0.15", features = ["approx"] }
3332
petgraph = { version = "0.6", optional = true }

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,29 +97,29 @@ pip install git+https://github.com/feos-org/feos
9797

9898
### Building from source
9999

100-
To compile the code you need the Rust compiler and `maturin` installed.
100+
To compile the code you need the Rust compiler and `maturin` (>=0.13,<0.14) installed.
101101
To install the package directly into the active environment, use
102102

103103
```
104-
maturin develop --release --cargo-extra-args="--features python"
104+
maturin develop --release --features python
105105
```
106106

107107
and specify the models that you want to include in the python package as additional features, e.g.
108108

109109
```
110-
maturin develop --release --cargo-extra-args="--features python --features pcsaft --features dft"
110+
maturin develop --release --features "python pcsaft dft"
111111
```
112112

113113
for the PC-SAFT equation of state and Helmholtz energy functional. If you want to include all available models, use
114114

115115
```
116-
maturin develop --release --cargo-extra-args="--features python --features all_models"
116+
maturin develop --release --features "python all_models"
117117
```
118118

119119
To build wheels, use
120120

121121
```
122-
maturin build --release --out dist --no-sdist --cargo-extra-args="--features python ..."
122+
maturin build --release --out dist --features "python ..."
123123
```
124124

125125
## Documentation

feos-derive/src/dft.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use syn::DeriveInput;
33

44
use crate::implement;
55

6-
const OPT_IMPLS: [&'static str; 4] = [
6+
const OPT_IMPLS: [&str; 4] = [
77
"bond_lengths",
88
"molar_weight",
99
"fluid_parameters",
@@ -34,7 +34,7 @@ pub(crate) fn expand_helmholtz_energy_functional(
3434

3535
// extract the variant name and the name of the functional,
3636
// i.e. PcSaft(PcSaftFunctional) will return (PcSaft, PcSaftFunctional)
37-
fn extract_names<'a>(variant: &'a syn::Variant) -> syn::Result<(&'a syn::Ident, &'a syn::Ident)> {
37+
fn extract_names(variant: &syn::Variant) -> syn::Result<(&syn::Ident, &syn::Ident)> {
3838
let name = &variant.ident;
3939
let field = if let syn::Fields::Unnamed(syn::FieldsUnnamed { ref unnamed, .. }) = variant.fields
4040
{
@@ -57,10 +57,7 @@ fn extract_names<'a>(variant: &'a syn::Variant) -> syn::Result<(&'a syn::Ident,
5757
} else {
5858
None
5959
}
60-
.ok_or(syn::Error::new_spanned(
61-
field,
62-
"expected HelmholtzFunctional",
63-
))?;
60+
.ok_or_else(|| syn::Error::new_spanned(field, "expected HelmholtzFunctional"))?;
6461
Ok((name, inner))
6562
}
6663

feos-derive/src/eos.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ use quote::quote;
33
use syn::DeriveInput;
44

55
// possible additional traits to implement
6-
const OPT_IMPLS: [&'static str; 2] = ["molar_weight", "entropy_scaling"];
6+
const OPT_IMPLS: [&str; 2] = ["molar_weight", "entropy_scaling"];
77

8-
pub(crate) fn expand_equation_of_state(input: DeriveInput) -> syn::Result<proc_macro2::TokenStream> {
8+
pub(crate) fn expand_equation_of_state(
9+
input: DeriveInput,
10+
) -> syn::Result<proc_macro2::TokenStream> {
911
let variants = match input.data {
1012
syn::Data::Enum(syn::DataEnum { ref variants, .. }) => variants,
1113
_ => panic!("this derive macro only works on enums"),

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[build-system]
2-
requires = ["maturin>=0.12,<0.13"]
2+
requires = ["maturin>=0.13,<0.14"]
33
build-backend = "maturin"
44

55
[tool.maturin]
66
bindings = "pyo3"
7-
cargo-extra-args = "--features python --features all_models"
7+
features = ["python", "all_models"]

src/association/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<D: DualNum<f64> + ScalarOperand, P: HardSphereProperties> HelmholtzEnergyDu
202202
self.tol,
203203
None,
204204
)
205-
.unwrap_or(D::from(std::f64::NAN))
205+
.unwrap_or_else(|_| D::from(std::f64::NAN))
206206
* state.volume
207207
} else {
208208
// association strength

0 commit comments

Comments
 (0)