-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathmod.rs
More file actions
60 lines (54 loc) · 1.55 KB
/
mod.rs
File metadata and controls
60 lines (54 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Utilities for working with experimental data.
use feos_core::{DensityInitialization, EosError};
use quantity::QuantityError;
use std::num::ParseFloatError;
use thiserror::Error;
mod dataset;
pub use dataset::DataSet;
mod estimator;
pub use estimator::Estimator;
mod loss;
pub use loss::Loss;
// Properties
mod vapor_pressure;
pub use vapor_pressure::VaporPressure;
mod liquid_density;
pub use liquid_density::{EquilibriumLiquidDensity, LiquidDensity};
mod binary_vle;
pub use binary_vle::{BinaryPhaseDiagram, BinaryVleChemicalPotential, BinaryVlePressure};
mod viscosity;
pub use viscosity::Viscosity;
mod thermal_conductivity;
pub use thermal_conductivity::ThermalConductivity;
mod diffusion;
pub use diffusion::Diffusion;
#[cfg(feature = "python")]
pub mod python;
/// Different phases of experimental data points.
#[derive(Clone, Copy)]
#[cfg_attr(feature = "python", pyo3::pyclass)]
pub enum Phase {
Vapor,
Liquid,
}
impl From<Phase> for DensityInitialization {
fn from(value: Phase) -> Self {
match value {
Phase::Liquid => DensityInitialization::Liquid,
Phase::Vapor => DensityInitialization::Vapor,
}
}
}
#[derive(Debug, Error)]
pub enum EstimatorError {
#[error("Input has not the same amount of data as the target.")]
IncompatibleInput,
#[error(transparent)]
ShapeError(#[from] ndarray::ShapeError),
#[error(transparent)]
ParseError(#[from] ParseFloatError),
#[error(transparent)]
QuantityError(#[from] QuantityError),
#[error(transparent)]
EosError(#[from] EosError),
}