Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The limitations of the homo gc method for PC-SAFT are enforced more strictly. [#88](https://github.com/feos-org/feos/pull/88)
- Removed generics for units in all structs and traits in favor of static SI units. [#115](https://github.com/feos-org/feos/pull/115)

### Packaging
- Updated `pyo3` and `numpy` dependencies to 0.18. [#119](https://github.com/feos-org/feos/pull/119)
Comment thread
prehner marked this conversation as resolved.
- Updated `quantity` dependency to 0.6. [#119](https://github.com/feos-org/feos/pull/119)
- Updated `num-dual` dependency to 0.6. [#119](https://github.com/feos-org/feos/pull/119)


## [0.3.0] - 2022-09-14
- 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.

Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ members = ["feos-core", "feos-dft", "feos-derive"]
crate-type = ["rlib", "cdylib"]

[dependencies]
quantity = "0.5"
num-dual = "0.5"
quantity = "0.6"
num-dual = "0.6"
feos-core = { version = "0.3", path = "feos-core" }
feos-dft = { version = "0.3", path = "feos-dft", optional = true }
feos-derive = { version = "0.1", path = "feos-derive" }
numpy = { version = "0.16", optional = true }
numpy = { version = "0.18", optional = true }
ndarray = { version = "0.15", features = ["approx"] }
petgraph = { version = "0.6", optional = true }
thiserror = "1.0"
Expand All @@ -40,7 +40,7 @@ indexmap = "1.8"
rayon = { version = "1.5", optional = true }

[dependencies.pyo3]
version = "0.16"
version = "0.18"
features = ["extension-module", "abi3", "abi3-py37"]
optional = true

Expand Down
5 changes: 5 additions & 0 deletions feos-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Renamed `State::molar_volume` to `State::partial_molar_volume` and `State::ln_phi_pure` to `State::ln_phi_pure_liquid`. [#107](https://github.com/feos-org/feos/pull/107)
- Added a const generic parameter to `PhaseDiagram` that accounts for the number of phases analogously to `PhaseEquilibrium`. [#113](https://github.com/feos-org/feos/pull/113)

### Packaging
- Updated `pyo3` and `numpy` dependencies to 0.18. [#119](https://github.com/feos-org/feos/pull/119)
- Updated `quantity` dependency to 0.6. [#119](https://github.com/feos-org/feos/pull/119)
- Updated `num-dual` dependency to 0.6. [#119](https://github.com/feos-org/feos/pull/119)

## [0.3.1] - 2022-08-25
### Added
- Added `State::spinodal` that calculates both spinodal points for a given temperature and composition using the same objective function that is also used in the critical point calculation. [#23](https://github.com/feos-org/feos/pull/23)
Expand Down
8 changes: 4 additions & 4 deletions feos-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ rustdoc-args = [ "--html-in-header", "./docs-header.html" ]
features = [ "rayon" ]

[dependencies]
quantity = "0.5"
num-dual = { version = "0.5", features = ["linalg"] }
quantity = "0.6"
num-dual = { version = "0.6", features = ["linalg"] }
ndarray = { version = "0.15", features = ["serde"] }
num-traits = "0.2"
thiserror = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
indexmap = "1.8"
conv = "0.3"
numpy = { version = "0.16", optional = true }
pyo3 = { version = "0.16", optional = true }
numpy = { version = "0.18", optional = true }
pyo3 = { version = "0.18", optional = true }
rayon = { version = "1.5", optional = true }

[dev-dependencies]
Expand Down
5 changes: 4 additions & 1 deletion feos-core/src/phase_equilibria/phase_diagram_pure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ use super::{PhaseEquilibrium, SolverOptions};
use crate::equation_of_state::EquationOfState;
use crate::errors::EosResult;
use crate::state::{State, StateVec};
#[cfg(feature = "rayon")]
use crate::EosUnit;
#[cfg(feature = "rayon")]
use ndarray::{Array1, ArrayView1, Axis};
use quantity::si::{SIArray1, SINumber, SIUnit};
#[cfg(feature = "rayon")]
use quantity::si::SIUnit;
use quantity::si::{SIArray1, SINumber};
#[cfg(feature = "rayon")]
use rayon::{prelude::*, ThreadPool};
use std::sync::Arc;
Expand Down
1 change: 0 additions & 1 deletion feos-core/src/python/joback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use pyo3::prelude::*;
/// JobackRecord
#[pyclass(name = "JobackRecord")]
#[derive(Clone)]
#[pyo3(text_signature = "(a, b, c, d, e)")]
pub struct PyJobackRecord(pub JobackRecord);

#[pymethods]
Expand Down
37 changes: 21 additions & 16 deletions feos-core/src/python/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ macro_rules! impl_binary_record {
/// -------
/// BinaryRecord
#[pyclass(name = "BinaryRecord")]
#[pyo3(text_signature = "(id1, id2, model_record)")]
#[derive(Clone)]
pub struct PyBinaryRecord(pub BinaryRecord<Identifier, $model_record>);

Expand Down Expand Up @@ -284,7 +283,6 @@ macro_rules! impl_binary_record {
/// -------
/// BinarySegmentRecord
#[pyclass(name = "BinarySegmentRecord")]
#[pyo3(text_signature = "(id1, id2, model_record)")]
#[derive(Clone)]
pub struct PyBinarySegmentRecord(pub BinaryRecord<String, f64>);

Expand Down Expand Up @@ -474,7 +472,6 @@ macro_rules! impl_segment_record {
/// -------
/// SegmentRecord
#[staticmethod]
#[pyo3(text_signature = "(path)")]
fn from_json(path: &str) -> Result<Vec<Self>, ParameterError> {
Ok(SegmentRecord::from_json(path)?
.into_iter()
Expand Down Expand Up @@ -548,11 +545,14 @@ macro_rules! impl_parameter {
/// search_option : IdentifierOption, optional, defaults to IdentifierOption.Name
/// Identifier that is used to search binary records.
#[staticmethod]
#[pyo3(text_signature = "(pure_records, binary_records, search_option)")]
#[pyo3(
signature = (pure_records, binary_records=None, search_option=IdentifierOption::Name),
text_signature = "(pure_records, binary_records=None, search_option=None)"
)]
fn from_records(
pure_records: Vec<PyPureRecord>,
binary_records: Option<&PyAny>,
search_option: Option<IdentifierOption>,
search_option: IdentifierOption,
) -> PyResult<Self> {
let prs = pure_records.into_iter().map(|pr| pr.0).collect();
if let Some(binary_records) = binary_records {
Expand All @@ -563,7 +563,7 @@ macro_rules! impl_parameter {
Ok(<$parameter>::binary_matrix_from_records(
&prs,
&brs,
search_option.unwrap_or(IdentifierOption::Name),
search_option,
))
} else {
Err(PyErr::new::<PyTypeError, _>(format!(
Expand All @@ -590,7 +590,6 @@ macro_rules! impl_parameter {
/// pure_record : PureRecord
/// The pure component parameters.
#[staticmethod]
#[pyo3(text_signature = "(pure_record)")]
fn new_pure(pure_record: PyPureRecord) -> Self {
Self(Arc::new(<$parameter>::new_pure(pure_record.0)))
}
Expand All @@ -605,7 +604,7 @@ macro_rules! impl_parameter {
/// binary_record : float or BinaryRecord, optional
/// The binary interaction parameter or binary interaction record.
#[staticmethod]
#[pyo3(text_signature = "(pure_records, binary_record)")]
#[pyo3(text_signature = "(pure_records, binary_record=None)")]
fn new_binary(
pure_records: Vec<PyPureRecord>,
binary_record: Option<&PyAny>,
Expand Down Expand Up @@ -640,18 +639,21 @@ macro_rules! impl_parameter {
/// search_option : IdentifierOption, optional, defaults to IdentifierOption.Name
/// Identifier that is used to search substance.
#[staticmethod]
#[pyo3(text_signature = "(substances, pure_path, binary_path, search_option)")]
#[pyo3(
signature = (substances, pure_path, binary_path=None, search_option=IdentifierOption::Name),
text_signature = "(substances, pure_path, binary_path=None, search_option=IdentifierOption.Name)"
)]
fn from_json(
substances: Vec<&str>,
pure_path: String,
binary_path: Option<String>,
search_option: Option<IdentifierOption>,
search_option: IdentifierOption,
) -> Result<Self, ParameterError> {
Ok(Self(Arc::new(<$parameter>::from_json(
substances,
pure_path,
binary_path,
search_option.unwrap_or(IdentifierOption::Name),
search_option,
)?)))
}

Expand All @@ -667,7 +669,10 @@ macro_rules! impl_parameter {
/// search_option : IdentifierOption, optional, defaults to IdentifierOption.Name
/// Identifier that is used to search substance.
#[staticmethod]
#[pyo3(text_signature = "(input, binary_path=None, search_option='Name')")]
Comment thread
prehner marked this conversation as resolved.
#[pyo3(
signature = (input, binary_path=None, search_option=IdentifierOption::Name),
text_signature = "(input, binary_path=None, search_option=IdentifierOption.Name)"
)]
fn from_multiple_json(
input: Vec<(Vec<&str>, &str)>,
binary_path: Option<&str>,
Expand Down Expand Up @@ -739,21 +744,22 @@ macro_rules! impl_parameter_from_segments {
/// Identifier that is used to search substance.
#[staticmethod]
#[pyo3(
text_signature = "(substances, pure_path, segments_path, binary_path, search_option)"
signature = (substances, pure_path, segments_path, binary_path=None, search_option=IdentifierOption::Name),
text_signature = "(substances, pure_path, segments_path, binary_path=None, search_option=IdentifierOption.Name)"
)]
fn from_json_segments(
substances: Vec<&str>,
pure_path: String,
segments_path: String,
binary_path: Option<String>,
search_option: Option<IdentifierOption>,
search_option: IdentifierOption,
) -> Result<Self, ParameterError> {
Ok(Self(Arc::new(<$parameter>::from_json_segments(
&substances,
pure_path,
segments_path,
binary_path,
search_option.unwrap_or(IdentifierOption::Name),
search_option,
)?)))
}
}
Expand All @@ -767,7 +773,6 @@ macro_rules! impl_json_handling {
impl $py_parameter {
/// Creates record from json string.
#[staticmethod]
#[pyo3(text_signature = "(json)")]
fn from_json_str(json: &str) -> Result<Self, ParameterError> {
Ok(Self(serde_json::from_str(json)?))
}
Expand Down
4 changes: 0 additions & 4 deletions feos-core/src/python/phase_equilibria.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ macro_rules! impl_phase_equilibrium {
/// chemical_potential: SIArray1
/// The new chemical potential
///
#[pyo3(text_signature = "(chemical_potential)")]
fn update_chemical_potential(slf: &PyCell<Self>, chemical_potential: &PySIArray1) -> PyResult<()> {
slf.borrow_mut().0.update_chemical_potential(chemical_potential)?;
Ok(())
Expand All @@ -266,7 +265,6 @@ macro_rules! impl_phase_equilibrium {
/// -------
/// list[PhaseEquilibrium]
#[staticmethod]
#[pyo3(text_signature = "(eos, temperature_or_pressure)")]
fn vle_pure_comps(eos: $py_eos, temperature_or_pressure: PySINumber) -> Vec<Option<Self>> {
PhaseEquilibrium::vle_pure_comps(&eos.0, temperature_or_pressure.into())
.into_iter()
Expand All @@ -288,7 +286,6 @@ macro_rules! impl_phase_equilibrium {
/// -------
/// list[SINumber]
#[staticmethod]
#[pyo3(text_signature = "(eos, temperature)")]
fn vapor_pressure(eos: $py_eos, temperature: PySINumber) -> Vec<Option<PySINumber>> {
PhaseEquilibrium::vapor_pressure(&eos.0, temperature.into())
.into_iter()
Expand All @@ -310,7 +307,6 @@ macro_rules! impl_phase_equilibrium {
/// -------
/// list[SINumber]
#[staticmethod]
#[pyo3(text_signature = "(eos, pressure)")]
fn boiling_temperature(eos: $py_eos, pressure: PySINumber) -> Vec<Option<PySINumber>> {
PhaseEquilibrium::boiling_temperature(&eos.0, pressure.into())
.into_iter()
Expand Down
Loading