Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove lazy_static dependency #268

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading