Skip to content

Commit

Permalink
Remove lazy_static dependency (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
prehner authored Jan 8, 2025
1 parent d9682df commit 6c9946f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ conv = "0.3"
num-traits = "0.2"
serde = "1.0"
serde_json = "1.0"
lazy_static = { version = "1.4", optional = true }
indexmap = "2.0"
rayon = { version = "1.7", optional = true }
itertools = "0.14"
Expand Down Expand Up @@ -76,7 +75,7 @@ association = []
pcsaft = ["association"]
epcsaft = ["association"]
gc_pcsaft = ["association"]
uvtheory = ["lazy_static"]
uvtheory = []
pets = []
saftvrqmie = []
saftvrmie = []
Expand Down
10 changes: 5 additions & 5 deletions src/uvtheory/parameters.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use feos_core::parameter::{Identifier, ParameterError};
use feos_core::parameter::{Parameter, PureRecord};
use lazy_static::lazy_static;
use ndarray::concatenate;
use ndarray::prelude::*;
use ndarray::Array2;
Expand All @@ -9,6 +8,7 @@ use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::fmt;
use std::fmt::Write;
use std::sync::LazyLock;

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct NoRecord;
Expand Down Expand Up @@ -74,9 +74,9 @@ impl std::fmt::Display for UVTheoryBinaryRecord {
}
}

lazy_static! {
/// Constants for BH temperature dependent HS diameter.
static ref CD_BH: Array2<f64> = arr2(&[
static CD_BH: LazyLock<Array2<f64>> = LazyLock::new(|| {
arr2(&[
[0.0, 1.09360455168912E-02, 0.0],
[-2.00897880971934E-01, -1.27074910870683E-02, 0.0],
[
Expand All @@ -89,8 +89,8 @@ lazy_static! {
5.05384813757953E-03,
4.91003312452622E-02,
],
]);
}
])
});

#[inline]
pub fn mie_prefactor<D: DualNum<f64> + Copy>(rep: D, att: D) -> D {
Expand Down

0 comments on commit 6c9946f

Please sign in to comment.