forked from feos-org/feos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoback.rs
More file actions
47 lines (43 loc) · 1.16 KB
/
Copy pathjoback.rs
File metadata and controls
47 lines (43 loc) · 1.16 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
use crate::impl_json_handling;
use crate::joback::JobackRecord;
use crate::parameter::ParameterError;
use pyo3::prelude::*;
/// Create a set of Joback ideal gas heat capacity parameters
/// for a segment or a pure component.
///
/// The fourth order coefficient `e` is not present in the
/// orginial publication by Joback and Reid but is required
/// for correlations for some pure components that are modeled
/// using the same polynomial approach.
///
/// Parameters
/// ----------
/// a : float
/// zeroth order coefficient
/// b : float
/// first order coefficient
/// c : float
/// second order coefficient
/// d : float
/// third order coefficient
/// e : float
/// fourth order coefficient
///
/// Returns
/// -------
/// JobackRecord
#[pyclass(name = "JobackRecord")]
#[derive(Clone)]
#[pyo3(text_signature = "(a, b, c, d, e)")]
pub struct PyJobackRecord(pub JobackRecord);
#[pymethods]
impl PyJobackRecord {
#[new]
fn new(a: f64, b: f64, c: f64, d: f64, e: f64) -> Self {
Self(JobackRecord::new(a, b, c, d, e))
}
fn __repr__(&self) -> PyResult<String> {
Ok(self.0.to_string())
}
}
impl_json_handling!(PyJobackRecord);