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
added rayon error as variant of EoSError, changed Cargo.toml feature …
…name and ran formatter
  • Loading branch information
g-bauer committed Oct 18, 2022
commit 752ab4532507ff21652676daf4f43ace6baebebe
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ serde = "1.0"
serde_json = "1.0"
lazy_static = { version = "1.4", optional = true }
indexmap = "1.8"
rayon_ = { version = "1.5", optional = true, package = "rayon" }
rayon = { version = "1.5", optional = true }

[dependencies.pyo3]
version = "0.16"
Expand All @@ -56,6 +56,6 @@ pcsaft = ["association"]
gc_pcsaft = ["association"]
uvtheory = ["lazy_static"]
pets = []
rayon = ["rayon_", "ndarray/rayon", "feos-core/rayon"]
rayon = ["dep:rayon", "ndarray/rayon", "feos-core/rayon"]
python = ["pyo3", "numpy", "feos-core/python", "feos-dft?/python", "rayon"]
all_models = ["dft", "estimator", "pcsaft", "gc_pcsaft", "uvtheory", "pets"]
4 changes: 2 additions & 2 deletions feos-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ indexmap = "1.8"
conv = "0.3"
numpy = { version = "0.16", optional = true }
pyo3 = { version = "0.16", optional = true }
rayon_ = { version = "1.5", optional = true, package = "rayon" }
rayon = { version = "1.5", optional = true }

[dev-dependencies]
approx = "0.4"

[features]
default = []
rayon = ["rayon_", "ndarray/rayon"]
rayon = ["dep:rayon", "ndarray/rayon"]
python = ["pyo3", "numpy", "quantity/python", "num-dual/python", "rayon"]
3 changes: 3 additions & 0 deletions feos-core/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ pub enum EosError {
ParameterError(#[from] ParameterError),
#[error(transparent)]
LinAlgError(#[from] LinAlgError),
#[cfg(feature = "rayon")]
#[error(transparent)]
RayonError(#[from] rayon::ThreadPoolBuildError),
}

/// Convenience type for `Result<T, EosError>`.
Expand Down
2 changes: 1 addition & 1 deletion feos-core/src/phase_equilibria/phase_diagram_pure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::EosUnit;
use ndarray::{Array1, ArrayView1, Axis};
use quantity::{QuantityArray1, QuantityScalar};
#[cfg(feature = "rayon")]
use rayon_::{prelude::*, ThreadPool};
use rayon::{prelude::*, ThreadPool};
use std::sync::Arc;

/// Pure component and binary mixture phase diagrams.
Expand Down
5 changes: 4 additions & 1 deletion feos-core/src/python/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,10 @@ macro_rules! impl_parameter {
"Could not parse binary input!"
)))
};
Ok(Self(Arc::new(<$parameter>::from_records(prs, brs.unwrap()))))
Ok(Self(Arc::new(<$parameter>::from_records(
prs,
brs.unwrap(),
))))
} else {
let n = prs.len();
Ok(Self(Arc::new(<$parameter>::from_records(
Expand Down
Loading