Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Corrected pyhton interface
  • Loading branch information
morteham authored and g-bauer committed Jul 3, 2023
commit 3f40debab68c7017a3ab5f9e1dc3cbb35149b2a2
11 changes: 3 additions & 8 deletions src/python/dft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::pets::{PetsFunctional, PetsOptions};
#[cfg(feature = "saftvrqmie")]
use crate::saftvrqmie::python::PySaftVRQMieParameters;
#[cfg(feature = "saftvrqmie")]
use crate::saftvrqmie::{FeynmanHibbsOrder, SaftVRQMieFunctional, SaftVRQMieOptions};
use crate::saftvrqmie::{SaftVRQMieFunctional, SaftVRQMieOptions};

use feos_core::*;
use feos_dft::adsorption::*;
Expand Down Expand Up @@ -187,9 +187,6 @@ impl PyFunctionalVariant {
/// The specific variant of the FMT term. Defaults to FMTVersion.WhiteBear
/// max_eta : float, optional
/// Maximum packing fraction. Defaults to 0.5.
/// fh_order : FeynmanHibbsOrder, optional
/// Which Feyman-Hibbs correction order to use. Defaults to FeynmanHibbsOrder.FH1.
/// Currently, only the first order is implemented.
/// inc_nonadd_term : bool, optional
/// Include non-additive correction to the hard-sphere reference. Defaults to True.
///
Expand All @@ -199,19 +196,17 @@ impl PyFunctionalVariant {
#[cfg(feature = "saftvrqmie")]
#[staticmethod]
#[pyo3(
signature = (parameters, fmt_version=FMTVersion::WhiteBear, max_eta=0.5, fh_order=FeynmanHibbsOrder::FH1, inc_nonadd_term=true),
text_signature = "(parameters, fmt_version, max_eta=0.5, fh_order, inc_nonadd_term=True)"
signature = (parameters, fmt_version=FMTVersion::WhiteBear, max_eta=0.5, inc_nonadd_term=true),
text_signature = "(parameters, fmt_version, max_eta=0.5, inc_nonadd_term=True)"
)]
fn saftvrqmie(
parameters: PySaftVRQMieParameters,
fmt_version: FMTVersion,
max_eta: f64,
fh_order: FeynmanHibbsOrder,
inc_nonadd_term: bool,
) -> Self {
let options = SaftVRQMieOptions {
max_eta,
fh_order,
inc_nonadd_term,
};
Self(Arc::new(
Expand Down
11 changes: 3 additions & 8 deletions src/python/eos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::pets::{Pets, PetsOptions};
#[cfg(feature = "saftvrqmie")]
use crate::saftvrqmie::python::PySaftVRQMieParameters;
#[cfg(feature = "saftvrqmie")]
use crate::saftvrqmie::{FeynmanHibbsOrder, SaftVRQMie, SaftVRQMieOptions};
use crate::saftvrqmie::{SaftVRQMie, SaftVRQMieOptions};
#[cfg(feature = "uvtheory")]
use crate::uvtheory::python::PyUVParameters;
#[cfg(feature = "uvtheory")]
Expand Down Expand Up @@ -243,9 +243,6 @@ impl PyEosVariant {
/// The parameters of the SAFT-VRQ Mie equation of state to use.
/// max_eta : float, optional
/// Maximum packing fraction. Defaults to 0.5.
/// fh_order : FeynmanHibbsOrder, optional
/// Which Feyman-Hibbs correction order to use. Defaults to FeynmanHibbsOrder.FH1.
/// Currently, only the first order is implemented.
/// inc_nonadd_term : bool, optional
/// Include non-additive correction to the hard-sphere reference. Defaults to True.
///
Expand All @@ -257,18 +254,16 @@ impl PyEosVariant {
#[cfg(feature = "saftvrqmie")]
#[staticmethod]
#[pyo3(
signature = (parameters, max_eta=0.5, fh_order=FeynmanHibbsOrder::FH1, inc_nonadd_term=true),
text_signature = "(parameters, max_eta=0.5, fh_order, inc_nonadd_term=True)"
signature = (parameters, max_eta=0.5, inc_nonadd_term=true),
text_signature = "(parameters, max_eta=0.5, inc_nonadd_term=True)"
)]
fn saftvrqmie(
parameters: PySaftVRQMieParameters,
max_eta: f64,
fh_order: FeynmanHibbsOrder,
inc_nonadd_term: bool,
) -> Self {
let options = SaftVRQMieOptions {
max_eta,
fh_order,
inc_nonadd_term,
};
Self(Arc::new(EosVariant::SaftVRQMie(SaftVRQMie::with_options(
Expand Down
3 changes: 2 additions & 1 deletion src/saftvrqmie/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ impl PySaftVRQMieRecord {
epsilon_k: f64,
lr: f64,
la: f64,
fh: i32,
viscosity: Option<[f64; 4]>,
) -> Self {
Self(SaftVRQMieRecord::new(
m, sigma, epsilon_k, lr, la, viscosity, None, None,
m, sigma, epsilon_k, lr, la, fh, viscosity, None, None,
))
}

Expand Down