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
fix wheels
  • Loading branch information
prehner committed Oct 24, 2024
commit 56a68bda1963e5cf65063b4481eaa33e4194bc6c
1 change: 0 additions & 1 deletion feos-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ rayon = { version = "1.5", optional = true }
typenum = "1.16"
approx = "0.5"
regex = "1.9"
ang = "0.6"

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion feos-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub mod python;

/// Level of detail in the iteration output.
#[derive(Copy, Clone, PartialOrd, PartialEq, Eq)]
#[cfg_attr(feature = "python", pyo3::pyclass)]
#[cfg_attr(feature = "python", pyo3::pyclass(eq))]
pub enum Verbosity {
/// Do not print output.
None,
Expand Down
4 changes: 2 additions & 2 deletions feos-core/src/parameter/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use serde::{Deserialize, Serialize};
use std::hash::{Hash, Hasher};

/// Possible variants to identify a substance.
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
#[cfg_attr(feature = "python", pyo3::pyclass)]
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq)]
#[cfg_attr(feature = "python", pyo3::pyclass(eq))]
pub enum IdentifierOption {
Cas,
Name,
Expand Down
10 changes: 5 additions & 5 deletions feos-core/src/python/equation_of_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ macro_rules! impl_equation_of_state {
/// Returns
/// -------
/// SINumber
#[pyo3(text_signature = "(moles=None)")]
#[pyo3(text_signature = "(moles=None)", signature = (moles=None))]
fn max_density(&self, moles: Option<Moles<Array1<f64>>>) -> PyResult<Density> {
let m = moles.map(|m| m.try_into()).transpose()?;
Ok(self.0.max_density(m.as_ref())?.into())
Expand All @@ -39,7 +39,7 @@ macro_rules! impl_virial_coefficients {
/// Returns
/// -------
/// SINumber
#[pyo3(text_signature = "(temperature, moles=None)")]
#[pyo3(text_signature = "(temperature, moles=None)", signature = (temperature, moles=None))]
fn second_virial_coefficient(
&self,
temperature: Temperature,
Expand All @@ -64,7 +64,7 @@ macro_rules! impl_virial_coefficients {
/// Returns
/// -------
/// SINumber
#[pyo3(text_signature = "(temperature, moles=None)")]
#[pyo3(text_signature = "(temperature, moles=None)", signature = (temperature, moles=None))]
fn third_virial_coefficient(
&self,
temperature: Temperature,
Expand All @@ -90,7 +90,7 @@ macro_rules! impl_virial_coefficients {
/// Returns
/// -------
/// SINumber
#[pyo3(text_signature = "(temperature, moles=None)")]
#[pyo3(text_signature = "(temperature, moles=None)", signature = (temperature, moles=None))]
fn second_virial_coefficient_temperature_derivative(
&self,
temperature: Temperature,
Expand Down Expand Up @@ -119,7 +119,7 @@ macro_rules! impl_virial_coefficients {
/// Returns
/// -------
/// SINumber
#[pyo3(text_signature = "(temperature, moles=None)")]
#[pyo3(text_signature = "(temperature, moles=None)", signature = (temperature, moles=None))]
fn third_virial_coefficient_temperature_derivative(
&self,
temperature: Temperature,
Expand Down
6 changes: 3 additions & 3 deletions feos-core/src/python/parameter/fragmentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct PySmartsRecord(pub SmartsRecord);
#[pymethods]
impl PySmartsRecord {
#[new]
#[pyo3(text_signature = "(group, smarts, max=None)")]
#[pyo3(text_signature = "(group, smarts, max=None)", signature = (group, smarts, max=None))]
fn new(group: String, smarts: String, max: Option<usize>) -> Self {
Self(SmartsRecord::new(group, smarts, max))
}
Expand Down Expand Up @@ -124,7 +124,7 @@ fn fragment_molecule(
let m = chem.call_method1("MolFromSmarts", (s.0.smarts,))?;
let matches = mol
.call_method1("GetSubstructMatches", (m,))?
.extract::<Vec<&PyAny>>()?;
.extract::<Vec<Bound<'_, PyAny>>>()?;
let mut matches: Vec<_> = matches
.into_iter()
.map(|m| m.extract::<Vec<usize>>())
Expand Down Expand Up @@ -158,7 +158,7 @@ fn fragment_molecule(
let builtins = py.import_bound("builtins")?;
let bonds = builtins
.call_method1("list", (bonds,))?
.extract::<Vec<&PyAny>>()?;
.extract::<Vec<Bound<'_, PyAny>>>()?;
let bonds: Vec<_> = bonds
.into_iter()
.map(|b| {
Expand Down
12 changes: 8 additions & 4 deletions feos-core/src/python/parameter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ pub struct PyIdentifier(pub Identifier);
impl PyIdentifier {
#[new]
#[pyo3(
text_signature = "(cas=None, name=None, iupac_name=None, smiles=None, inchi=None, formula=None)"
text_signature = "(cas=None, name=None, iupac_name=None, smiles=None, inchi=None, formula=None)",
signature = (cas=None, name=None, iupac_name=None, smiles=None, inchi=None, formula=None)
)]
fn new(
cas: Option<&str>,
Expand Down Expand Up @@ -145,7 +146,7 @@ pub struct PyChemicalRecord(pub ChemicalRecord);
#[pymethods]
impl PyChemicalRecord {
#[new]
#[pyo3(text_signature = "(identifier, segments, bonds=None)")]
#[pyo3(text_signature = "(identifier, segments, bonds=None)", signature = (identifier, segments, bonds=None))]
fn new(
identifier: PyIdentifier,
segments: Vec<String>,
Expand Down Expand Up @@ -268,6 +269,7 @@ macro_rules! impl_binary_record {
}

#[getter]
#[expect(irrefutable_let_patterns)]
fn get_model_record<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
Ok(if let Ok(mr) = f64::try_from(self.0.model_record.clone()) {
pyo3::types::PyFloat::new_bound(py, mr).into_any()
Expand Down Expand Up @@ -631,7 +633,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=None)")]
#[pyo3(text_signature = "(pure_records, binary_record=None)", signature = (pure_records, binary_record=None))]
fn new_binary(
pure_records: Vec<PyPureRecord>,
binary_record: Option<&Bound<'_, PyAny>>,
Expand Down Expand Up @@ -767,7 +769,8 @@ macro_rules! impl_parameter_from_segments {
/// binary_segment_records : [BinarySegmentRecord], optional
/// A list of binary segment-segment parameters.
#[staticmethod]
#[pyo3(text_signature = "(chemical_records, segment_records, binary_segment_records=None)")]
#[pyo3(text_signature = "(chemical_records, segment_records, binary_segment_records=None)",
signature = (chemical_records, segment_records, binary_segment_records=None))]
fn from_segments(
chemical_records: Vec<PyChemicalRecord>,
segment_records: Vec<PySegmentRecord>,
Expand Down Expand Up @@ -834,6 +837,7 @@ macro_rules! impl_parameter_from_segments {
/// A list of binary segment-segment parameters.
#[staticmethod]
#[pyo3(text_signature = "(identifier, smarts_records, segment_records, binary_segment_records=None)")]
#[pyo3(signature = (identifier, smarts_records, segment_records, binary_segment_records=None))]
fn from_smiles(
identifier: Vec<Bound<'_,PyAny>>,
smarts_records: Vec<PySmartsRecord>,
Expand Down
Loading