From 79ed8e253d6e53e7f8b7e8cc948817097a17b45c Mon Sep 17 00:00:00 2001 From: Gernot Bauer Date: Fri, 20 Jan 2023 18:43:38 +0100 Subject: [PATCH 1/7] feos-core: updated function and method signatures for pyo3 0.18 --- feos-core/Cargo.toml | 8 +- .../phase_equilibria/phase_diagram_pure.rs | 5 +- feos-core/src/python/joback.rs | 1 - feos-core/src/python/parameter.rs | 37 ++--- feos-core/src/python/phase_equilibria.rs | 4 - feos-core/src/python/state.rs | 128 +++++------------- 6 files changed, 62 insertions(+), 121 deletions(-) diff --git a/feos-core/Cargo.toml b/feos-core/Cargo.toml index 732191172..63cd4f17c 100644 --- a/feos-core/Cargo.toml +++ b/feos-core/Cargo.toml @@ -18,8 +18,8 @@ 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 = { git = "https://github.com/itt-ustutt/num-dual", features = ["linalg"] } ndarray = { version = "0.15", features = ["serde"] } num-traits = "0.2" thiserror = "1.0" @@ -27,8 +27,8 @@ 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] diff --git a/feos-core/src/phase_equilibria/phase_diagram_pure.rs b/feos-core/src/phase_equilibria/phase_diagram_pure.rs index 08a986650..c7b823fed 100644 --- a/feos-core/src/phase_equilibria/phase_diagram_pure.rs +++ b/feos-core/src/phase_equilibria/phase_diagram_pure.rs @@ -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; diff --git a/feos-core/src/python/joback.rs b/feos-core/src/python/joback.rs index d2302b2da..d6e670ed8 100644 --- a/feos-core/src/python/joback.rs +++ b/feos-core/src/python/joback.rs @@ -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] diff --git a/feos-core/src/python/parameter.rs b/feos-core/src/python/parameter.rs index d6562c42b..adb90ce69 100644 --- a/feos-core/src/python/parameter.rs +++ b/feos-core/src/python/parameter.rs @@ -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); @@ -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); @@ -474,7 +472,6 @@ macro_rules! impl_segment_record { /// ------- /// SegmentRecord #[staticmethod] - #[pyo3(text_signature = "(path)")] fn from_json(path: &str) -> Result, ParameterError> { Ok(SegmentRecord::from_json(path)? .into_iter() @@ -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, binary_records: Option<&PyAny>, - search_option: Option, + search_option: IdentifierOption, ) -> PyResult { let prs = pure_records.into_iter().map(|pr| pr.0).collect(); if let Some(binary_records) = binary_records { @@ -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::(format!( @@ -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))) } @@ -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, binary_record: Option<&PyAny>, @@ -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, - search_option: Option, + search_option: IdentifierOption, ) -> Result { Ok(Self(Arc::new(<$parameter>::from_json( substances, pure_path, binary_path, - search_option.unwrap_or(IdentifierOption::Name), + search_option, )?))) } @@ -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')")] + #[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>, @@ -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, - search_option: Option, + search_option: IdentifierOption, ) -> Result { Ok(Self(Arc::new(<$parameter>::from_json_segments( &substances, pure_path, segments_path, binary_path, - search_option.unwrap_or(IdentifierOption::Name), + search_option, )?))) } } @@ -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 { Ok(Self(serde_json::from_str(json)?)) } diff --git a/feos-core/src/python/phase_equilibria.rs b/feos-core/src/python/phase_equilibria.rs index 2d18d4d37..72951802d 100644 --- a/feos-core/src/python/phase_equilibria.rs +++ b/feos-core/src/python/phase_equilibria.rs @@ -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, chemical_potential: &PySIArray1) -> PyResult<()> { slf.borrow_mut().0.update_chemical_potential(chemical_potential)?; Ok(()) @@ -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> { PhaseEquilibrium::vle_pure_comps(&eos.0, temperature_or_pressure.into()) .into_iter() @@ -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> { PhaseEquilibrium::vapor_pressure(&eos.0, temperature.into()) .into_iter() @@ -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> { PhaseEquilibrium::boiling_temperature(&eos.0, pressure.into()) .into_iter() diff --git a/feos-core/src/python/state.rs b/feos-core/src/python/state.rs index 1bb2eab71..0c468807a 100644 --- a/feos-core/src/python/state.rs +++ b/feos-core/src/python/state.rs @@ -328,8 +328,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn pressure(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.pressure(contributions)) } @@ -339,7 +338,6 @@ macro_rules! impl_state { /// Returns /// ------- /// List[Tuple[str, SINumber]] - #[pyo3(text_signature = "($self)")] fn pressure_contributions(&self) -> Vec<(String, PySINumber)> { self.0 .pressure_contributions() @@ -359,8 +357,7 @@ macro_rules! impl_state { /// Returns /// ------- /// float - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn compressibility(&self, contributions: Contributions) -> f64 { self.0.compressibility(contributions) } @@ -376,8 +373,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn dp_dv(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.dp_dv(contributions)) } @@ -393,8 +389,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn dp_drho(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.dp_drho(contributions)) } @@ -410,8 +405,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn dp_dt(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.dp_dt(contributions)) } @@ -427,8 +421,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SIArray1 - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn dp_dni(&self, contributions: Contributions) -> PySIArray1 { PySIArray1::from(self.0.dp_dni(contributions)) } @@ -444,8 +437,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn d2p_dv2(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.d2p_dv2(contributions)) } @@ -461,8 +453,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn d2p_drho2(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.d2p_drho2(contributions)) } @@ -478,8 +469,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SIArray1 - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn partial_molar_volume(&self, contributions: Contributions) -> PySIArray1 { PySIArray1::from(self.0.partial_molar_volume(contributions)) } @@ -495,8 +485,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SIArray1 - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn chemical_potential(&self, contributions: Contributions) -> PySIArray1 { PySIArray1::from(self.0.chemical_potential(contributions)) } @@ -512,7 +501,6 @@ macro_rules! impl_state { /// Returns /// ------- /// List[Tuple[str, SINumber]] - #[pyo3(text_signature = "($self, component)")] fn chemical_potential_contributions(&self, component: usize) -> Vec<(String, PySINumber)> { self.0 .chemical_potential_contributions(component) @@ -532,8 +520,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SIArray1 - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn dmu_dt(&self, contributions: Contributions) -> PySIArray1 { PySIArray1::from(self.0.dmu_dt(contributions)) } @@ -549,8 +536,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SIArray2 - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn dmu_dni(&self, contributions: Contributions) -> PySIArray2 { PySIArray2::from(self.0.dmu_dni(contributions)) } @@ -560,7 +546,6 @@ macro_rules! impl_state { /// Returns /// ------- /// numpy.ndarray - #[pyo3(text_signature = "($self)")] fn ln_phi<'py>(&self, py: Python<'py>) -> &'py PyArray1 { self.0.ln_phi().view().to_pyarray(py) } @@ -571,7 +556,6 @@ macro_rules! impl_state { /// Returns /// ------- /// numpy.ndarray - #[pyo3(text_signature = "($self)")] fn ln_phi_pure_liquid<'py>(&self, py: Python<'py>) -> PyResult<&'py PyArray1> { Ok(self.0.ln_phi_pure_liquid()?.view().to_pyarray(py)) } @@ -581,7 +565,6 @@ macro_rules! impl_state { /// Returns /// ------- /// numpy.ndarray - #[pyo3(text_signature = "($self)")] fn ln_symmetric_activity_coefficient<'py>(&self, py: Python<'py>) -> PyResult<&'py PyArray1> { Ok(self.0.ln_symmetric_activity_coefficient()?.view().to_pyarray(py)) } @@ -591,7 +574,6 @@ macro_rules! impl_state { /// Returns /// ------- /// SIArray1 - #[pyo3(text_signature = "($self)")] fn dln_phi_dt(&self) -> PySIArray1 { PySIArray1::from(self.0.dln_phi_dt()) } @@ -601,7 +583,6 @@ macro_rules! impl_state { /// Returns /// ------- /// SIArray1 - #[pyo3(text_signature = "($self)")] fn dln_phi_dp(&self) -> PySIArray1 { PySIArray1::from(self.0.dln_phi_dp()) } @@ -611,7 +592,6 @@ macro_rules! impl_state { /// Returns /// ------- /// SIArray2 - #[pyo3(text_signature = "($self)")] fn dln_phi_dnj(&self) -> PySIArray2 { PySIArray2::from(self.0.dln_phi_dnj()) } @@ -621,7 +601,6 @@ macro_rules! impl_state { /// Returns /// ------- /// numpy.ndarray - #[pyo3(text_signature = "($self)")] fn thermodynamic_factor<'py>(&self, py: Python<'py>) -> &'py PyArray2 { self.0.thermodynamic_factor().view().to_pyarray(py) } @@ -637,8 +616,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn c_v(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.c_v(contributions)) } @@ -654,8 +632,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn dc_v_dt(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.dc_v_dt(contributions)) } @@ -671,8 +648,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn c_p(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.c_p(contributions)) } @@ -688,8 +664,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn entropy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.entropy(contributions)) } @@ -705,8 +680,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn ds_dt(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.ds_dt(contributions)) } @@ -722,8 +696,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn molar_entropy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.molar_entropy(contributions)) } @@ -740,8 +713,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SIArray1 - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn partial_molar_entropy(&self, contributions: Contributions) -> PySIArray1 { PySIArray1::from(self.0.partial_molar_entropy(contributions)) } @@ -757,8 +729,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn enthalpy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.enthalpy(contributions)) } @@ -774,8 +745,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn molar_enthalpy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.molar_enthalpy(contributions)) } @@ -792,8 +762,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SIArray1 - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn partial_molar_enthalpy(&self, contributions: Contributions) -> PySIArray1 { PySIArray1::from(self.0.partial_molar_enthalpy(contributions)) } @@ -809,8 +778,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn helmholtz_energy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.helmholtz_energy(contributions)) } @@ -826,8 +794,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn molar_helmholtz_energy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.molar_helmholtz_energy(contributions)) } @@ -837,7 +804,6 @@ macro_rules! impl_state { /// Returns /// ------- /// List[Tuple[str, SINumber]] - #[pyo3(text_signature = "($self)")] fn helmholtz_energy_contributions(&self) -> Vec<(String, PySINumber)> { self.0 .helmholtz_energy_contributions() @@ -857,8 +823,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn gibbs_energy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.gibbs_energy(contributions)) } @@ -874,8 +839,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn molar_gibbs_energy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.molar_gibbs_energy(contributions)) } @@ -892,8 +856,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn internal_energy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.internal_energy(contributions)) } @@ -909,8 +872,7 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn molar_internal_energy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.molar_internal_energy(contributions)) } @@ -920,7 +882,6 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn joule_thomson(&self) -> PySINumber { PySINumber::from(self.0.joule_thomson()) } @@ -930,7 +891,6 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn isentropic_compressibility(&self) -> PySINumber { PySINumber::from(self.0.isentropic_compressibility()) } @@ -940,7 +900,6 @@ macro_rules! impl_state { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn isothermal_compressibility(&self) -> PySINumber { PySINumber::from(self.0.isothermal_compressibility()) } @@ -950,7 +909,6 @@ macro_rules! impl_state { /// Returns /// ------- /// float - #[pyo3(text_signature = "($self)")] fn structure_factor(&self) -> f64 { self.0.structure_factor() } @@ -1113,7 +1071,6 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn total_molar_weight(&self) -> PySINumber { PySINumber::from(self.0.total_molar_weight()) } @@ -1123,7 +1080,6 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn speed_of_sound(&self) -> PySINumber { PySINumber::from(self.0.speed_of_sound()) } @@ -1133,7 +1089,6 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// SIArray1 - #[pyo3(text_signature = "($self)")] fn mass(&self) -> PySIArray1 { PySIArray1::from(self.0.mass()) } @@ -1143,7 +1098,6 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn total_mass(&self) -> PySINumber { PySINumber::from(self.0.total_mass()) } @@ -1153,7 +1107,6 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn mass_density(&self) -> PySINumber { PySINumber::from(self.0.mass_density()) } @@ -1163,7 +1116,6 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// numpy.ndarray[Float64] - #[pyo3(text_signature = "($self)")] fn massfracs<'py>(&self, py: Python<'py>) -> &'py PyArray1 { self.0.massfracs().view().to_pyarray(py) } @@ -1179,8 +1131,7 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn specific_helmholtz_energy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.specific_helmholtz_energy(contributions)) } @@ -1196,8 +1147,7 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn specific_entropy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.specific_entropy(contributions)) } @@ -1213,8 +1163,7 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn specific_internal_energy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.specific_internal_energy(contributions)) } @@ -1230,8 +1179,7 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn specific_gibbs_energy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.specific_gibbs_energy(contributions)) } @@ -1247,8 +1195,7 @@ macro_rules! impl_state_molarweight { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn specific_enthalpy(&self, contributions: Contributions) -> PySINumber { PySINumber::from(self.0.specific_enthalpy(contributions)) } @@ -1289,7 +1236,6 @@ macro_rules! impl_state_entropy_scaling { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn viscosity(&self) -> PyResult { Ok(PySINumber::from(self.0.viscosity()?)) } @@ -1299,7 +1245,6 @@ macro_rules! impl_state_entropy_scaling { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn viscosity_reference(&self) -> PyResult { Ok(PySINumber::from(self.0.viscosity_reference()?)) } @@ -1312,7 +1257,6 @@ macro_rules! impl_state_entropy_scaling { /// Returns /// ------- /// float - #[pyo3(text_signature = "($self)")] fn ln_viscosity_reduced(&self) -> PyResult { Ok(self.0.ln_viscosity_reduced()?) } @@ -1322,7 +1266,6 @@ macro_rules! impl_state_entropy_scaling { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn diffusion(&self) -> PyResult { Ok(PySINumber::from(self.0.diffusion()?)) } @@ -1332,7 +1275,6 @@ macro_rules! impl_state_entropy_scaling { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn diffusion_reference(&self) -> PyResult { Ok(PySINumber::from(self.0.diffusion_reference()?)) } @@ -1345,7 +1287,6 @@ macro_rules! impl_state_entropy_scaling { /// Returns /// ------- /// float - #[pyo3(text_signature = "($self)")] fn ln_diffusion_reduced(&self) -> PyResult { Ok(self.0.ln_diffusion_reduced()?) } @@ -1355,7 +1296,6 @@ macro_rules! impl_state_entropy_scaling { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn thermal_conductivity(&self) -> PyResult { Ok(PySINumber::from(self.0.thermal_conductivity()?)) } @@ -1365,7 +1305,6 @@ macro_rules! impl_state_entropy_scaling { /// Returns /// ------- /// SINumber - #[pyo3(text_signature = "($self)")] fn thermal_conductivity_reference(&self) -> PyResult { Ok(PySINumber::from(self.0.thermal_conductivity_reference()?)) } @@ -1378,7 +1317,6 @@ macro_rules! impl_state_entropy_scaling { /// Returns /// ------- /// float - #[pyo3(text_signature = "($self)")] fn ln_thermal_conductivity_reduced(&self) -> PyResult { Ok(self.0.ln_thermal_conductivity_reduced()?) } From cdbeeaa46a2dafb7d8da5265e94f7510cda094c5 Mon Sep 17 00:00:00 2001 From: Gernot Bauer Date: Fri, 20 Jan 2023 19:11:59 +0100 Subject: [PATCH 2/7] feos-dft: updated function and method signatures for pyo3 0.18 --- feos-dft/Cargo.toml | 8 ++++---- .../src/python/adsorption/external_potential.rs | 5 ----- feos-dft/src/python/interface/mod.rs | 4 ---- feos-dft/src/python/profile.rs | 15 +++++---------- feos-dft/src/python/solvation.rs | 1 - feos-dft/src/python/solver.rs | 5 ++--- 6 files changed, 11 insertions(+), 27 deletions(-) diff --git a/feos-dft/Cargo.toml b/feos-dft/Cargo.toml index 96581316a..418e2cf2f 100644 --- a/feos-dft/Cargo.toml +++ b/feos-dft/Cargo.toml @@ -17,9 +17,9 @@ rustdoc-args = [ "--html-in-header", "./docs-header.html" ] features = [ "rayon" ] [dependencies] -quantity = { version = "0.5", features = ["linalg"] } +quantity = { version = "0.6", features = ["linalg"] } +num-dual = { git = "https://github.com/itt-ustutt/num-dual" } feos-core = { version = "0.3", path = "../feos-core" } -num-dual = "0.5" ndarray = "0.15" rustdct = "0.7" rustfft = "6.0" @@ -28,8 +28,8 @@ num-traits = "0.2" libm = "0.2" gauss-quad = { version = "0.1", optional = true } petgraph = "0.6" -numpy = { version = "0.16", optional = true } -pyo3 = { version = "0.16", optional = true } +numpy = { version = "0.18", optional = true } +pyo3 = { version = "0.18", optional = true } [features] default = [] diff --git a/feos-dft/src/python/adsorption/external_potential.rs b/feos-dft/src/python/adsorption/external_potential.rs index 0bc9fa760..cf575aa4d 100644 --- a/feos-dft/src/python/adsorption/external_potential.rs +++ b/feos-dft/src/python/adsorption/external_potential.rs @@ -26,7 +26,6 @@ impl PyExternalPotential { /// #[staticmethod] #[allow(non_snake_case)] - #[pyo3(text_signature = "(sigma_ss)")] pub fn HardWall(sigma_ss: f64) -> Self { Self(ExternalPotential::HardWall { sigma_ss }) } @@ -49,7 +48,6 @@ impl PyExternalPotential { /// ExternalPotential /// #[staticmethod] - #[pyo3(text_signature = "(sigma_ss, epsilon_k_ss, rho_s)")] pub fn LJ93(sigma_ss: f64, epsilon_k_ss: f64, rho_s: f64) -> Self { Self(ExternalPotential::LJ93 { sigma_ss, @@ -74,7 +72,6 @@ impl PyExternalPotential { /// ExternalPotential /// #[staticmethod] - #[pyo3(text_signature = "(sigma_ss, epsilon_k_ss)")] pub fn SimpleLJ93(sigma_ss: f64, epsilon_k_ss: f64) -> Self { Self(ExternalPotential::SimpleLJ93 { sigma_ss, @@ -98,7 +95,6 @@ impl PyExternalPotential { /// ExternalPotential /// #[staticmethod] - #[pyo3(text_signature = "(sigma_sf, epsilon_k_sf)")] pub fn CustomLJ93(sigma_sf: &PyArray1, epsilon_k_sf: &PyArray1) -> Self { Self(ExternalPotential::CustomLJ93 { sigma_sf: sigma_sf.to_owned_array(), @@ -191,7 +187,6 @@ impl PyExternalPotential { /// ExternalPotential /// #[staticmethod] - #[pyo3(text_signature = "(sigma_ss, epsilon1_k_ss, epsilon2_k_ss, rho_s)")] pub fn DoubleWell(sigma_ss: f64, epsilon1_k_ss: f64, epsilon2_k_ss: f64, rho_s: f64) -> Self { Self(ExternalPotential::DoubleWell { sigma_ss, diff --git a/feos-dft/src/python/interface/mod.rs b/feos-dft/src/python/interface/mod.rs index 435e635cf..62650c03b 100644 --- a/feos-dft/src/python/interface/mod.rs +++ b/feos-dft/src/python/interface/mod.rs @@ -94,7 +94,6 @@ macro_rules! impl_planar_interface { /// PlanarInterface /// #[staticmethod] - #[pyo3(text_signature = "(vle, n_grid, l_grid, density_profile)")] fn from_density_profile( vle: &PyPhaseEquilibrium, n_grid: usize, @@ -134,7 +133,6 @@ macro_rules! impl_planar_interface { /// ------- /// SIArray2 /// - #[pyo3(text_signature = "($self)")] fn relative_adsorption(&self) -> PyResult { Ok(self.0.relative_adsorption()?.into()) } @@ -145,7 +143,6 @@ macro_rules! impl_planar_interface { /// ------- /// numpy.ndarray /// - #[pyo3(text_signature = "($self)")] fn interfacial_enrichment<'py>(&self, py: Python<'py>) -> PyResult<&'py PyArray1> { Ok(self.0.interfacial_enrichment()?.to_pyarray(py)) } @@ -156,7 +153,6 @@ macro_rules! impl_planar_interface { /// ------- /// SINumber /// - #[pyo3(text_signature = "($self)")] fn interfacial_thickness(&self) -> PyResult { Ok(self.0.interfacial_thickness()?.into()) } diff --git a/feos-dft/src/python/profile.rs b/feos-dft/src/python/profile.rs index b0610788e..5b6febb8b 100644 --- a/feos-dft/src/python/profile.rs +++ b/feos-dft/src/python/profile.rs @@ -14,8 +14,7 @@ macro_rules! impl_profile { /// ------- /// (numpy.ndarray[float], numpy.ndarray[float]) /// - #[args(log = "false")] - #[pyo3(text_signature = "($self, log)")] + #[pyo3(signature = (log=false), text_signature = "($self, log=False)")] fn residual<'py>( &self, log: bool, @@ -39,8 +38,7 @@ macro_rules! impl_profile { /// ------- /// $struct /// - #[args(debug = "false")] - #[pyo3(text_signature = "($self, solver=None, debug=False)")] + #[pyo3(signature = (solver=None, debug=False), text_signature = "($self, solver=None, debug=False)")] fn solve(slf: &PyCell, solver: Option, debug: bool) -> PyResult<&PyCell> { slf.borrow_mut() .0 @@ -122,8 +120,7 @@ macro_rules! impl_profile { /// Returns /// ------- /// SIArray - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn entropy_density( &mut self, contributions: Contributions, @@ -144,8 +141,7 @@ macro_rules! impl_profile { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn entropy( &mut self, contributions: Contributions, @@ -166,8 +162,7 @@ macro_rules! impl_profile { /// Returns /// ------- /// SINumber - #[args(contributions = "Contributions::Total")] - #[pyo3(text_signature = "($self, contributions)")] + #[pyo3(signature = (contributions=Contributions::Total), text_signature = "($self, contributions=Contributions.Total)")] fn internal_energy( &mut self, contributions: Contributions, diff --git a/feos-dft/src/python/solvation.rs b/feos-dft/src/python/solvation.rs index 3885b947a..edec92a24 100644 --- a/feos-dft/src/python/solvation.rs +++ b/feos-dft/src/python/solvation.rs @@ -93,7 +93,6 @@ macro_rules! impl_pair_correlation { /// PairCorrelation /// #[pyclass(name = "PairCorrelation")] - #[pyo3(text_signature = "(bulk, test_particle, n_grid, width)")] pub struct PyPairCorrelation(PairCorrelation<$func>); impl_1d_profile!(PyPairCorrelation, [get_r]); diff --git a/feos-dft/src/python/solver.rs b/feos-dft/src/python/solver.rs index 11937703c..2d61d5b34 100644 --- a/feos-dft/src/python/solver.rs +++ b/feos-dft/src/python/solver.rs @@ -52,7 +52,7 @@ impl PyDFTSolver { /// Defaults to 1e-11. /// damping_coefficient: float, optional /// Constant damping coefficient. - /// If no damping coeffcient is provided, a line + /// If no damping coefficient is provided, a line /// search is used to determine the step size. /// /// Returns @@ -87,7 +87,7 @@ impl PyDFTSolver { /// The tolerance. /// Defaults to 1e-11. /// damping_coefficient: float, optional - /// The damping coeffcient. + /// The damping coefficient. /// Defaults to 0.15. /// mmax: int, optional /// The maximum number of old solutions that are used. @@ -156,7 +156,6 @@ impl PyDFTSolver { #[pyclass(name = "DFTSolverLog")] #[derive(Clone)] -#[pyo3(text_signature = "(verbosity=None)")] pub struct PyDFTSolverLog(pub DFTSolverLog); #[pymethods] From de867c37902c2fea5496dd076a33d73477f9d060 Mon Sep 17 00:00:00 2001 From: Gernot Bauer Date: Fri, 20 Jan 2023 19:40:09 +0100 Subject: [PATCH 3/7] started updates in feos --- Cargo.toml | 8 ++++---- src/association/python.rs | 1 + src/gc_pcsaft/python/micelles.rs | 7 ++++--- src/gc_pcsaft/python/mod.rs | 2 +- src/python/dft.rs | 35 ++++++++++---------------------- src/python/eos.rs | 33 +++++++++++------------------- 6 files changed, 33 insertions(+), 53 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index adf0f42b6..2af076f6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,12 +22,12 @@ members = ["feos-core", "feos-dft", "feos-derive"] crate-type = ["rlib", "cdylib"] [dependencies] -quantity = "0.5" -num-dual = "0.5" +quantity = { git = "https://github.com/itt-ustutt/quantity" } +num-dual = { git = "https://github.com/itt-ustutt/num-dual", features = ["linalg"] } 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" @@ -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 diff --git a/src/association/python.rs b/src/association/python.rs index fb9bb72b7..160072a89 100644 --- a/src/association/python.rs +++ b/src/association/python.rs @@ -11,6 +11,7 @@ pub struct PyAssociationRecord(pub AssociationRecord); #[pymethods] impl PyAssociationRecord { + #[pyo3(signature = (kappa_ab, epsilon_k_ab, na=None, nb=None))] #[new] fn new(kappa_ab: f64, epsilon_k_ab: f64, na: Option, nb: Option) -> Self { Self(AssociationRecord::new(kappa_ab, epsilon_k_ab, na, nb)) diff --git a/src/gc_pcsaft/python/micelles.rs b/src/gc_pcsaft/python/micelles.rs index 4bc658005..6756ccb11 100644 --- a/src/gc_pcsaft/python/micelles.rs +++ b/src/gc_pcsaft/python/micelles.rs @@ -98,7 +98,6 @@ macro_rules! impl_micelle_profile { /// pressure: SINumber /// Pressure. /// - #[pyo3(text_signature = "(delta_n_surfactant, pressure)")] fn update_specification(&self, delta_n_surfactant: f64, pressure: PySINumber) -> Self { Self(self.0.update_specification(MicelleSpecification::Size { delta_n_surfactant, @@ -124,8 +123,10 @@ macro_rules! impl_micelle_profile { /// ------- /// MicelleProfile /// - #[pyo3(text_signature = "(solver1=None, solver2=None, debug=False)")] - #[args(solver1 = "None", solver2 = "None", debug = "false")] + #[pyo3( + signature = (solver1=None, solver2=None, debug=false), + text_signature = "(solver1=None, solver2=None, debug=False)" + )] fn solve_micelle( slf: &PyCell, solver1: Option, diff --git a/src/gc_pcsaft/python/mod.rs b/src/gc_pcsaft/python/mod.rs index a92edd5b0..9732b30fd 100644 --- a/src/gc_pcsaft/python/mod.rs +++ b/src/gc_pcsaft/python/mod.rs @@ -106,7 +106,7 @@ impl PyGcPcSaftEosParameters { #[cfg(feature = "dft")] #[pyclass(name = "GcPcSaftFunctionalParameters")] #[pyo3( - text_signature = "(pure_records, segmentbinary_records=None, substances=None, search_option='Name')" + text_signature = "(pure_records, segmentbinary_records=None, substances=None, search_option=IdentifierOption.Name)" )] #[derive(Clone)] pub struct PyGcPcSaftFunctionalParameters(pub Arc); diff --git a/src/python/dft.rs b/src/python/dft.rs index af57a4292..8d4beb6ea 100644 --- a/src/python/dft.rs +++ b/src/python/dft.rs @@ -65,16 +65,10 @@ impl PyFunctionalVariant { /// ------- /// HelmholtzEnergyFunctional #[cfg(feature = "pcsaft")] - #[args( - fmt_version = "FMTVersion::WhiteBear", - max_eta = "0.5", - max_iter_cross_assoc = "50", - tol_cross_assoc = "1e-10", - dq_variant = "DQVariants::DQ35" - )] #[staticmethod] #[pyo3( - text_signature = "(parameters, fmt_version, max_eta, max_iter_cross_assoc, tol_cross_assoc, dq_variant)" + signature = (parameters, fmt_version=FMTVersion::WhiteBear, max_eta=0.5, max_iter_cross_assoc=50, tol_cross_assoc=1e-10, dq_variant=DQVariants::DQ35), + text_signature = "(parameters, fmt_version=FMTVersion.WhiteBear, max_eta=0.5, max_iter_cross_assoc=50, tol_cross_assoc=1e-10, dq_variant=DQVariants.DQ35)" )] fn pcsaft( parameters: PyPcSaftParameters, @@ -114,15 +108,10 @@ impl PyFunctionalVariant { /// ------- /// HelmholtzEnergyFunctional #[cfg(feature = "gc_pcsaft")] - #[args( - fmt_version = "FMTVersion::WhiteBear", - max_eta = "0.5", - max_iter_cross_assoc = "50", - tol_cross_assoc = "1e-10" - )] #[staticmethod] #[pyo3( - text_signature = "(parameters, fmt_version, max_eta, max_iter_cross_assoc, tol_cross_assoc)" + signature = (parameters, fmt_version=FMTVersion::WhiteBear, max_eta=0.5, max_iter_cross_assoc=50, tol_cross_assoc=1e-10), + text_signature = "(parameters, fmt_version=FMTVersion.WhiteBear, max_eta=0.5, max_iter_cross_assoc=50, tol_cross_assoc=1e-10)" )] fn gc_pcsaft( parameters: PyGcPcSaftFunctionalParameters, @@ -157,9 +146,11 @@ impl PyFunctionalVariant { /// ------- /// HelmholtzEnergyFunctional #[cfg(feature = "pets")] - #[args(fmt_version = "FMTVersion::WhiteBear", max_eta = "0.5")] #[staticmethod] - #[pyo3(text_signature = "(parameters, fmt_version, max_eta)")] + #[pyo3( + signature = (parameters, fmt_version=FMTVersion::WhiteBear, max_eta=0.5), + text_signature = "(parameters, fmt_version=FMTVersion.WhiteBear, max_eta=0.5)" + )] fn pets(parameters: PyPetsParameters, fmt_version: FMTVersion, max_eta: f64) -> Self { let options = PetsOptions { max_eta }; Self(Arc::new( @@ -180,7 +171,6 @@ impl PyFunctionalVariant { /// ------- /// HelmholtzEnergyFunctional #[staticmethod] - #[pyo3(text_signature = "(sigma, version)")] fn fmt(sigma: &PyArray1, fmt_version: FMTVersion) -> Self { Self(Arc::new( FMTFunctional::new(&sigma.to_owned_array(), fmt_version).into(), @@ -208,13 +198,10 @@ impl PyFunctionalVariant { /// HelmholtzEnergyFunctional #[cfg(feature = "saftvrqmie")] #[staticmethod] - #[args( - fmt_version = "FMTVersion::WhiteBear", - max_eta = "0.5", - fh_order = "FeynmanHibbsOrder::FH1", - inc_nonadd_term = "true" + #[pyo3( + signature = (parameters, fmt_version=FMTVersion::WhiteBear, max_eta=0.5, fh_order=FeynmanHibbsOrder::FH1, inc_nonadd_term=true), + text_signature = "(parameters, fmt_version=FMTVersion.WhiteBear, max_eta=0.5, fh_order=FeynmanHibbsOrder.FH1, inc_nonadd_term=True)" )] - #[pyo3(text_signature = "(parameters, fmt_version, max_eta, fh_order, inc_nonadd_term)")] fn saftvrqmie( parameters: PySaftVRQMieParameters, fmt_version: FMTVersion, diff --git a/src/python/eos.rs b/src/python/eos.rs index 7361e2ab6..da2c9f848 100644 --- a/src/python/eos.rs +++ b/src/python/eos.rs @@ -117,13 +117,11 @@ impl PyEosVariant { /// The gc-PC-SAFT equation of state that can be used to compute thermodynamic /// states. #[cfg(feature = "gc_pcsaft")] - #[args( - max_eta = "0.5", - max_iter_cross_assoc = "50", - tol_cross_assoc = "1e-10" - )] #[staticmethod] - #[pyo3(text_signature = "(parameters, max_eta, max_iter_cross_assoc, tol_cross_assoc)")] + #[pyo3( + signature = (parameters, max_eta=0.5, max_iter_cross_assoc=50, tol_cross_assoc=1e-10), + text_signature = "(parameters, max_eta=0.5, max_iter_cross_assoc=50, tol_cross_assoc=1e-10)" + )] pub fn gc_pcsaft( parameters: PyGcPcSaftEosParameters, max_eta: f64, @@ -154,7 +152,6 @@ impl PyEosVariant { /// The PR equation of state that can be used to compute thermodynamic /// states. #[staticmethod] - #[pyo3(text_signature = "(parameters)")] pub fn peng_robinson(parameters: PyPengRobinsonParameters) -> Self { Self(Arc::new(EosVariant::PengRobinson(PengRobinson::new( parameters.0, @@ -173,7 +170,6 @@ impl PyEosVariant { /// ------- /// EquationOfState #[staticmethod] - #[pyo3(text_signature = "(obj)")] fn python(obj: Py) -> PyResult { Ok(Self(Arc::new(EosVariant::Python(PyEoSObj::new(obj)?)))) } @@ -193,9 +189,8 @@ impl PyEosVariant { /// The PeTS equation of state that can be used to compute thermodynamic /// states. #[cfg(feature = "pets")] - #[args(max_eta = "0.5")] #[staticmethod] - #[pyo3(text_signature = "(parameters, max_eta)")] + #[pyo3(signature = (parameters, max_eta=0.5), text_signature = "(parameters, max_eta=0.5)")] fn pets(parameters: PyPetsParameters, max_eta: f64) -> Self { let options = PetsOptions { max_eta }; Self(Arc::new(EosVariant::Pets(Pets::with_options( @@ -224,13 +219,11 @@ impl PyEosVariant { /// The UV-Theory equation of state that can be used to compute thermodynamic /// states. #[cfg(feature = "uvtheory")] - #[args( - max_eta = "0.5", - perturbation = "Perturbation::WeeksChandlerAndersen", - virial_order = "VirialOrder::Second" - )] #[staticmethod] - #[pyo3(text_signature = "(parameters, max_eta, perturbation, virial_order)")] + #[pyo3( + signature = (parameters, max_eta=0.5, perturbation=Perturbation::WeeksChandlerAndersen, virial_order=VirialOrder::Second), + text_signature = "(parameters, max_eta=0.5, perturbation=Perturbation.WeeksChandlerAndersen, virial_order=VirialOrder.Second)" + )] fn uvtheory( parameters: PyUVParameters, max_eta: f64, @@ -268,12 +261,10 @@ impl PyEosVariant { /// states. #[cfg(feature = "saftvrqmie")] #[staticmethod] - #[args( - max_eta = "0.5", - fh_order = "FeynmanHibbsOrder::FH1", - inc_nonadd_term = "true" + #[pyo3( + signature = (parameters, max_eta=0.5, fh_order=FeynmanHibbsOrder::FH1, inc_nonadd_term=true), + text_signature = "(parameters, max_eta=0.5, fh_order=FeynmanHibbsOrder.FH1, inc_nonadd_term=True)" )] - #[pyo3(text_signature = "(parameters, max_eta, fh_order, inc_nonadd_term)")] fn saftvrqmie( parameters: PySaftVRQMieParameters, max_eta: f64, From 12b5a17e27792e8f2a47d95b7be7cb3903acf33e Mon Sep 17 00:00:00 2001 From: Gernot Bauer Date: Fri, 20 Jan 2023 20:26:58 +0100 Subject: [PATCH 4/7] fixed use statements, use num-dual and quantity from crates.io --- Cargo.toml | 4 ++-- feos-core/Cargo.toml | 2 +- feos-dft/Cargo.toml | 2 +- src/python/dft.rs | 2 +- src/python/eos.rs | 2 +- src/python/mod.rs | 36 ++++++++++++++++++------------------ 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2af076f6f..9fd054f41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,8 +22,8 @@ members = ["feos-core", "feos-dft", "feos-derive"] crate-type = ["rlib", "cdylib"] [dependencies] -quantity = { git = "https://github.com/itt-ustutt/quantity" } -num-dual = { git = "https://github.com/itt-ustutt/num-dual", features = ["linalg"] } +quantity = "0.6" +num-dual = { version = "0.6", features = ["linalg"] } 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" } diff --git a/feos-core/Cargo.toml b/feos-core/Cargo.toml index 63cd4f17c..fa1455108 100644 --- a/feos-core/Cargo.toml +++ b/feos-core/Cargo.toml @@ -19,7 +19,7 @@ features = [ "rayon" ] [dependencies] quantity = "0.6" -num-dual = { git = "https://github.com/itt-ustutt/num-dual", features = ["linalg"] } +num-dual = { version = "0.6", features = ["linalg"] } ndarray = { version = "0.15", features = ["serde"] } num-traits = "0.2" thiserror = "1.0" diff --git a/feos-dft/Cargo.toml b/feos-dft/Cargo.toml index 418e2cf2f..9b986e755 100644 --- a/feos-dft/Cargo.toml +++ b/feos-dft/Cargo.toml @@ -18,7 +18,7 @@ features = [ "rayon" ] [dependencies] quantity = { version = "0.6", features = ["linalg"] } -num-dual = { git = "https://github.com/itt-ustutt/num-dual" } +num-dual = "0.6" feos-core = { version = "0.3", path = "../feos-core" } ndarray = "0.15" rustdct = "0.7" diff --git a/src/python/dft.rs b/src/python/dft.rs index 8d4beb6ea..57524b28d 100644 --- a/src/python/dft.rs +++ b/src/python/dft.rs @@ -33,7 +33,7 @@ use pyo3::exceptions::{PyIndexError, PyValueError}; use pyo3::prelude::*; #[cfg(feature = "estimator")] use pyo3::wrap_pymodule; -use quantity::python::*; +use quantity::python::{PySINumber, PySIArray1, PySIArray2, PySIArray3}; use quantity::si::*; use std::collections::HashMap; use std::sync::Arc; diff --git a/src/python/eos.rs b/src/python/eos.rs index da2c9f848..21bab4f17 100644 --- a/src/python/eos.rs +++ b/src/python/eos.rs @@ -36,7 +36,7 @@ use pyo3::exceptions::{PyIndexError, PyValueError}; use pyo3::prelude::*; #[cfg(feature = "estimator")] use pyo3::wrap_pymodule; -use quantity::python::*; +use quantity::python::{PySINumber, PySIArray1, PySIArray2, PySIArray3}; use quantity::si::*; use std::collections::HashMap; use std::sync::Arc; diff --git a/src/python/mod.rs b/src/python/mod.rs index 2ab8abf5f..ec6e9adb0 100644 --- a/src/python/mod.rs +++ b/src/python/mod.rs @@ -1,47 +1,47 @@ #[cfg(feature = "gc_pcsaft")] -use crate::gc_pcsaft::python::__PYO3_PYMODULE_DEF_GC_PCSAFT; +use crate::gc_pcsaft::python::gc_pcsaft as gc_pcsaft_module; #[cfg(feature = "pcsaft")] -use crate::pcsaft::python::__PYO3_PYMODULE_DEF_PCSAFT; +use crate::pcsaft::python::pcsaft as pcsaft_module; #[cfg(feature = "pets")] -use crate::pets::python::__PYO3_PYMODULE_DEF_PETS; +use crate::pets::python::pets as pets_module; #[cfg(feature = "saftvrqmie")] -use crate::saftvrqmie::python::__PYO3_PYMODULE_DEF_SAFTVRQMIE; +use crate::saftvrqmie::python::saftvrqmie as saftvrqmie_module; #[cfg(feature = "uvtheory")] -use crate::uvtheory::python::__PYO3_PYMODULE_DEF_UVTHEORY; +use crate::uvtheory::python::uvtheory as uvtheory_module; use pyo3::prelude::*; use pyo3::wrap_pymodule; -use quantity::python::__PYO3_PYMODULE_DEF_QUANTITY; +use quantity::python::quantity as quantity_module; mod cubic; mod eos; -use cubic::__PYO3_PYMODULE_DEF_CUBIC; -use eos::__PYO3_PYMODULE_DEF_EOS; +use cubic::cubic as cubic_module; +use eos::eos as eos_module; #[cfg(feature = "dft")] mod dft; #[cfg(feature = "dft")] -use dft::__PYO3_PYMODULE_DEF_DFT; +use dft::dft as dft_module; #[pymodule] pub fn feos(py: Python<'_>, m: &PyModule) -> PyResult<()> { m.add("__version__", env!("CARGO_PKG_VERSION"))?; - m.add_wrapped(wrap_pymodule!(quantity))?; + m.add_wrapped(wrap_pymodule!(quantity_module))?; - m.add_wrapped(wrap_pymodule!(eos))?; + m.add_wrapped(wrap_pymodule!(eos_module))?; #[cfg(feature = "dft")] - m.add_wrapped(wrap_pymodule!(dft))?; - m.add_wrapped(wrap_pymodule!(cubic))?; + m.add_wrapped(wrap_pymodule!(dft_module))?; + m.add_wrapped(wrap_pymodule!(cubic_module))?; #[cfg(feature = "pcsaft")] - m.add_wrapped(wrap_pymodule!(pcsaft))?; + m.add_wrapped(wrap_pymodule!(pcsaft_module))?; #[cfg(feature = "gc_pcsaft")] - m.add_wrapped(wrap_pymodule!(gc_pcsaft))?; + m.add_wrapped(wrap_pymodule!(gc_pcsaft_module))?; #[cfg(feature = "pets")] - m.add_wrapped(wrap_pymodule!(pets))?; + m.add_wrapped(wrap_pymodule!(pets_module))?; #[cfg(feature = "uvtheory")] - m.add_wrapped(wrap_pymodule!(uvtheory))?; + m.add_wrapped(wrap_pymodule!(uvtheory_module))?; #[cfg(feature = "saftvrqmie")] - m.add_wrapped(wrap_pymodule!(saftvrqmie))?; + m.add_wrapped(wrap_pymodule!(saftvrqmie_module))?; set_path(py, m, "feos.si", "quantity")?; set_path(py, m, "feos.eos", "eos")?; From 0db15143442a3e50c87761e09c1aa263775ef933 Mon Sep 17 00:00:00 2001 From: Gernot Bauer Date: Mon, 23 Jan 2023 14:24:31 +0100 Subject: [PATCH 5/7] more updates to function signatures, added changelog entries, removed unused imports --- CHANGELOG.md | 4 ++++ feos-core/CHANGELOG.md | 3 +++ feos-core/src/python/state.rs | 1 - feos-dft/CHANGELOG.md | 3 +++ feos-dft/src/python/profile.rs | 2 +- src/python/dft.rs | 2 +- src/python/eos.rs | 11 +++-------- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54c8c745f..fa7e17cb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ 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) + + ## [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. diff --git a/feos-core/CHANGELOG.md b/feos-core/CHANGELOG.md index 9016ba9fb..9116a1086 100644 --- a/feos-core/CHANGELOG.md +++ b/feos-core/CHANGELOG.md @@ -23,6 +23,9 @@ 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) + ## [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) diff --git a/feos-core/src/python/state.rs b/feos-core/src/python/state.rs index 0c468807a..203364ad2 100644 --- a/feos-core/src/python/state.rs +++ b/feos-core/src/python/state.rs @@ -164,7 +164,6 @@ macro_rules! impl_state { /// ------- /// State : State at critical conditions. #[staticmethod] - #[args(initial_temperature = "None")] #[pyo3(text_signature = "(eos, moles=None, initial_temperature=None, max_iter=None, tol=None, verbosity=None)")] fn critical_point( eos: $py_eos, diff --git a/feos-dft/CHANGELOG.md b/feos-dft/CHANGELOG.md index 1fa46464d..caa584f61 100644 --- a/feos-dft/CHANGELOG.md +++ b/feos-dft/CHANGELOG.md @@ -20,6 +20,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed the sign of vector weighted densities in Cartesian and cylindrical geometries. The wrong sign had no effects on the Helmholtz energy and thus on density profiles. [#120](https://github.com/feos-org/feos/pull/120) +### Packaging +- Updated `pyo3` and `numpy` dependencies to 0.18. [#119](https://github.com/feos-org/feos/pull/119) + ## [0.3.2] - 2022-10-13 ### Changed - The 3D DFT functionalities (3D pores, solvation free energy, free-energy-averaged potentials) are hidden behind the new `3d_dft` feature. For the Python package, the feature is always enabled. [#51](https://github.com/feos-org/feos/pull/51) diff --git a/feos-dft/src/python/profile.rs b/feos-dft/src/python/profile.rs index 5b6febb8b..7417d7f4a 100644 --- a/feos-dft/src/python/profile.rs +++ b/feos-dft/src/python/profile.rs @@ -38,7 +38,7 @@ macro_rules! impl_profile { /// ------- /// $struct /// - #[pyo3(signature = (solver=None, debug=False), text_signature = "($self, solver=None, debug=False)")] + #[pyo3(signature = (solver=None, debug=false), text_signature = "($self, solver=None, debug=False)")] fn solve(slf: &PyCell, solver: Option, debug: bool) -> PyResult<&PyCell> { slf.borrow_mut() .0 diff --git a/src/python/dft.rs b/src/python/dft.rs index 57524b28d..52d3b6789 100644 --- a/src/python/dft.rs +++ b/src/python/dft.rs @@ -33,7 +33,7 @@ use pyo3::exceptions::{PyIndexError, PyValueError}; use pyo3::prelude::*; #[cfg(feature = "estimator")] use pyo3::wrap_pymodule; -use quantity::python::{PySINumber, PySIArray1, PySIArray2, PySIArray3}; +use quantity::python::{PySINumber, PySIArray1, PySIArray2, PySIArray3, PySIArray4}; use quantity::si::*; use std::collections::HashMap; use std::sync::Arc; diff --git a/src/python/eos.rs b/src/python/eos.rs index 21bab4f17..1a6dcc063 100644 --- a/src/python/eos.rs +++ b/src/python/eos.rs @@ -36,7 +36,7 @@ use pyo3::exceptions::{PyIndexError, PyValueError}; use pyo3::prelude::*; #[cfg(feature = "estimator")] use pyo3::wrap_pymodule; -use quantity::python::{PySINumber, PySIArray1, PySIArray2, PySIArray3}; +use quantity::python::{PySINumber, PySIArray1, PySIArray2}; use quantity::si::*; use std::collections::HashMap; use std::sync::Arc; @@ -69,15 +69,10 @@ impl PyEosVariant { /// The PC-SAFT equation of state that can be used to compute thermodynamic /// states. #[cfg(feature = "pcsaft")] - #[args( - max_eta = "0.5", - max_iter_cross_assoc = "50", - tol_cross_assoc = "1e-10", - dq_variant = "DQVariants::DQ35" - )] #[staticmethod] #[pyo3( - text_signature = "(parameters, max_eta, max_iter_cross_assoc, tol_cross_assoc, dq_variant)" + signature = (parameters, max_eta=0.5, max_iter_cross_assoc=50, tol_cross_assoc=1e-10, dq_variant=DQVariants::DQ35), + text_signature = "(parameters, max_eta=0.5, max_iter_cross_assoc=50, tol_cross_assoc=1e-10, dq_variant=DQVariants.DQ35)" )] pub fn pcsaft( parameters: PyPcSaftParameters, From 293a19a51306395fffcbecb98c58a532748fef3a Mon Sep 17 00:00:00 2001 From: Gernot Bauer Date: Mon, 23 Jan 2023 18:18:50 +0100 Subject: [PATCH 6/7] added quantity and num-dual to changelog, tested other version for signature, removed unused feature from Cargo.toml --- CHANGELOG.md | 2 +- Cargo.toml | 2 +- feos-core/CHANGELOG.md | 2 +- feos-dft/CHANGELOG.md | 2 +- src/association/python.rs | 6 ++++-- src/gc_pcsaft/python/mod.rs | 1 + 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa7e17cb4..85b39ed20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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) +- Updated `pyo3` and `numpy` dependencies to 0.18 and accordingly `num-dual` and `quantity`. [#119](https://github.com/feos-org/feos/pull/119) ## [0.3.0] - 2022-09-14 diff --git a/Cargo.toml b/Cargo.toml index 9fd054f41..fcd9b9d16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ crate-type = ["rlib", "cdylib"] [dependencies] quantity = "0.6" -num-dual = { version = "0.6", features = ["linalg"] } +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" } diff --git a/feos-core/CHANGELOG.md b/feos-core/CHANGELOG.md index 9116a1086..f2c775f0e 100644 --- a/feos-core/CHANGELOG.md +++ b/feos-core/CHANGELOG.md @@ -24,7 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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 `pyo3` and `numpy` dependencies to 0.18 and accordingly `num-dual` and `quantity`. [#119](https://github.com/feos-org/feos/pull/119) ## [0.3.1] - 2022-08-25 ### Added diff --git a/feos-dft/CHANGELOG.md b/feos-dft/CHANGELOG.md index caa584f61..02ee5a14f 100644 --- a/feos-dft/CHANGELOG.md +++ b/feos-dft/CHANGELOG.md @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed the sign of vector weighted densities in Cartesian and cylindrical geometries. The wrong sign had no effects on the Helmholtz energy and thus on density profiles. [#120](https://github.com/feos-org/feos/pull/120) ### Packaging -- Updated `pyo3` and `numpy` dependencies to 0.18. [#119](https://github.com/feos-org/feos/pull/119) +- Updated `pyo3` and `numpy` dependencies to 0.18 and accordingly `num-dual` and `quantity`. [#119](https://github.com/feos-org/feos/pull/119) ## [0.3.2] - 2022-10-13 ### Changed diff --git a/src/association/python.rs b/src/association/python.rs index 160072a89..cbc8ed680 100644 --- a/src/association/python.rs +++ b/src/association/python.rs @@ -4,8 +4,10 @@ use feos_core::parameter::ParameterError; use pyo3::prelude::*; /// Pure component association parameters -#[pyclass(name = "AssociationRecord")] -#[pyo3(text_signature = "(kappa_ab, epsilon_k_ab, na=None, nb=None)")] +#[pyclass( + name = "AssociationRecord", + text_signature = "(kappa_ab, epsilon_k_ab, na=None, nb=None)" +)] #[derive(Clone)] pub struct PyAssociationRecord(pub AssociationRecord); diff --git a/src/gc_pcsaft/python/mod.rs b/src/gc_pcsaft/python/mod.rs index 9732b30fd..03d30a8f7 100644 --- a/src/gc_pcsaft/python/mod.rs +++ b/src/gc_pcsaft/python/mod.rs @@ -25,6 +25,7 @@ pub struct PyGcPcSaftRecord(GcPcSaftRecord); #[pymethods] impl PyGcPcSaftRecord { + #[pyo3(signature = (m, sigma, epsilon_k, mu=None, association_record=None, psi_dft=None))] #[new] fn new( m: f64, From f446ecb6c4c9c2adcf6fe29a510a101e0afd6bf0 Mon Sep 17 00:00:00 2001 From: Philipp Rehner Date: Tue, 24 Jan 2023 10:36:58 +0100 Subject: [PATCH 7/7] more detailed changelog --- CHANGELOG.md | 4 +++- feos-core/CHANGELOG.md | 4 +++- feos-dft/CHANGELOG.md | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85b39ed20..22cfe19f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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 and accordingly `num-dual` and `quantity`. [#119](https://github.com/feos-org/feos/pull/119) +- 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.0] - 2022-09-14 diff --git a/feos-core/CHANGELOG.md b/feos-core/CHANGELOG.md index f2c775f0e..55d11ddd1 100644 --- a/feos-core/CHANGELOG.md +++ b/feos-core/CHANGELOG.md @@ -24,7 +24,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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 and accordingly `num-dual` and `quantity`. [#119](https://github.com/feos-org/feos/pull/119) +- 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 diff --git a/feos-dft/CHANGELOG.md b/feos-dft/CHANGELOG.md index 02ee5a14f..2fbfd67fb 100644 --- a/feos-dft/CHANGELOG.md +++ b/feos-dft/CHANGELOG.md @@ -21,7 +21,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed the sign of vector weighted densities in Cartesian and cylindrical geometries. The wrong sign had no effects on the Helmholtz energy and thus on density profiles. [#120](https://github.com/feos-org/feos/pull/120) ### Packaging -- Updated `pyo3` and `numpy` dependencies to 0.18 and accordingly `num-dual` and `quantity`. [#119](https://github.com/feos-org/feos/pull/119) +- 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.2] - 2022-10-13 ### Changed