From d5fd37685f82348c5be80cef23933541b649441e Mon Sep 17 00:00:00 2001 From: Philipp Rehner Date: Wed, 8 Jan 2025 13:41:19 +0100 Subject: [PATCH 1/2] Remove lazystatic dependency --- Cargo.toml | 3 +-- src/uvtheory/parameters.rs | 11 +++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ce9df0015..0df22a04c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -76,7 +75,7 @@ association = [] pcsaft = ["association"] epcsaft = ["association"] gc_pcsaft = ["association"] -uvtheory = ["lazy_static"] +uvtheory = [] pets = [] saftvrqmie = [] saftvrmie = [] diff --git a/src/uvtheory/parameters.rs b/src/uvtheory/parameters.rs index d0509a9bf..5d0201c37 100644 --- a/src/uvtheory/parameters.rs +++ b/src/uvtheory/parameters.rs @@ -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; @@ -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; @@ -74,9 +74,8 @@ impl std::fmt::Display for UVTheoryBinaryRecord { } } -lazy_static! { -/// Constants for BH temperature dependent HS diameter. - static ref CD_BH: Array2 = arr2(&[ +static CD_BH: LazyLock> = LazyLock::new(|| { + arr2(&[ [0.0, 1.09360455168912E-02, 0.0], [-2.00897880971934E-01, -1.27074910870683E-02, 0.0], [ @@ -89,8 +88,8 @@ lazy_static! { 5.05384813757953E-03, 4.91003312452622E-02, ], - ]); -} + ]) +}); #[inline] pub fn mie_prefactor + Copy>(rep: D, att: D) -> D { From 0b9a41a5862250e1c32bf1897fd89b928acdb176 Mon Sep 17 00:00:00 2001 From: Philipp Rehner Date: Wed, 8 Jan 2025 13:42:10 +0100 Subject: [PATCH 2/2] readd docstring --- src/uvtheory/parameters.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/uvtheory/parameters.rs b/src/uvtheory/parameters.rs index 5d0201c37..7bdfc0ff5 100644 --- a/src/uvtheory/parameters.rs +++ b/src/uvtheory/parameters.rs @@ -74,6 +74,7 @@ impl std::fmt::Display for UVTheoryBinaryRecord { } } +/// Constants for BH temperature dependent HS diameter. static CD_BH: LazyLock> = LazyLock::new(|| { arr2(&[ [0.0, 1.09360455168912E-02, 0.0],