Skip to content

Commit fbd8f2a

Browse files
authored
[WIP] Python library improvements (#319)
* Updated pyo3 API to latest version. * Fixes and improvements to Python library using newest version of pyo3. * Cargo.toml updates. * Update non-physics packages. * Updates to non-physics packages required some minor code changes * Add inlining type hints
1 parent 20b3269 commit fbd8f2a

5 files changed

Lines changed: 148 additions & 95 deletions

File tree

‎Cargo.toml‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,21 @@ crate-type = ["cdylib", "lib"]
1717
[dependencies]
1818
rand = {version = "0.10.2", features=["chacha"]}
1919
rand_distr = "0.6.0"
20-
toml = "0.7.4"
20+
toml = "1.1.4"
2121
anyhow = "1.0.71"
22-
itertools = "0.10.5"
22+
itertools = "0.15.0"
2323
rayon = "1.10.0"
2424
geo = {version = "0.25", optional = false}
25-
indicatif = {version = "0.15.0", features=["rayon"]}
25+
indicatif = {version = "0.18.6", features=["rayon"]}
2626
serde = { version = "1.0.163", features = ["derive"] }
2727
hdf5 = {version = "0.7.1", optional = true}
2828
rcpr = { git = "https://github.com/drobnyjt/rcpr", optional = true}
29-
ndarray = {version = "0.14.0", features = ["serde"], optional = true}
29+
ndarray = {version = "0.17.2", features = ["serde"], optional = true}
3030
parry3d-f64 = {optional = true, version="0.2.0"}
31-
cached = {features=["proc_macro"], version="2.0.2"}
32-
33-
[dependencies.pyo3]
34-
version = "0.19.0"
35-
features = ["extension-module"]
36-
optional = true
31+
pyo3 = {version = "0.29.0", optional=true}
3732

3833
[dev-dependencies]
39-
float-cmp = "0.8.0"
34+
float-cmp = "0.10.0"
4035

4136
[profile.release]
4237
lto = "fat"
@@ -50,5 +45,4 @@ cpr_rootfinder = ["rcpr"]
5045
distributions = ["ndarray"]
5146
no_list_output = []
5247
parry3d = ["parry3d-f64"]
53-
accelerated_ions = []
5448
python = ["pyo3"]

‎src/interactions.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ static LINDHARD_SCREENING_LENGTH_TABLE: LazyLock<[f64; Z_MAX*Z_MAX]> = LazyLock:
317317
}
318318
)
319319
);
320+
320321
static ZBL_SCREENING_LENGTH_TABLE: LazyLock<[f64; Z_MAX*Z_MAX]> = LazyLock::new(
321322
||
322323
std::array::from_fn(
@@ -336,10 +337,12 @@ pub fn lindhard_screening_length(Za: f64, Zb: f64) -> f64 {
336337
0.8853*A0*(Za.sqrt() + Zb.sqrt()).powf(-2./3.)
337338
}
338339

340+
#[inline]
339341
pub fn lindhard_screening_length_lookup(Za: u64, Zb: u64) -> f64 {
340342
LINDHARD_SCREENING_LENGTH_TABLE[Za as usize * Z_MAX + Zb as usize]
341343
}
342344

345+
#[inline]
343346
pub fn zbl_screening_length_lookup(Za: u64, Zb: u64) -> f64{
344347
ZBL_SCREENING_LENGTH_TABLE[Za as usize * Z_MAX + Zb as usize]
345348
}

0 commit comments

Comments
 (0)