Skip to content

Commit 3e84c69

Browse files
authored
Minor code improvements (#326)
* Update to edition 2024. Fix no_mangle configuration flags to unsafe * Remove unnecessary nan-checking * Upgrade version number to 3.0 * Removed redundant screening length calls; wrapped into scattering integral calls. * Fixed tests. * add .gitignore * Remove HDF5 * Fix workflows.
1 parent 7b306cd commit 3e84c69

18 files changed

Lines changed: 159 additions & 307 deletions

‎.github/workflows/rustbca_compile_check.yml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ jobs:
3232
- name: Install Python libraries
3333
run: |
3434
python3 -m pip install numpy shapely scipy matplotlib toml tomlkit
35-
- name: Install HDF5 Libraries
36-
run: |
37-
sudo apt install libhdf5-dev
3835
- name: test Python Bindings and run testing scripts
3936
run: |
4037
python3 -m pip install setuptools_rust testresources setuptools wheel
@@ -59,7 +56,7 @@ jobs:
5956
./a.out
6057
- name: Test RustBCA
6158
run: |
62-
cargo test --features cpr_rootfinder,hdf5_input,distributions,parry3d
59+
cargo test --features cpr_rootfinder,distributions,parry3d
6360
- name: Run Examples
6461
run: |
6562
cargo run --release 0D examples/boron_nitride_0D.toml

‎.gitignore‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
target/
2+
debug/
3+
Cargo.lock
4+
*.output
5+
**/*.rs.bk
6+
*.pdb
7+
src/RustBCA.egg-info
8+
src/RustBCA.egg-info/*

‎Cargo.toml‎

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,48 @@
1-
[package]
2-
name = "RustBCA"
3-
version = "2.9.0"
4-
default-run = "RustBCA"
5-
authors = ["Jon Drobny <drobny2@illinois.edu>", "Jon Drobny <jdrobny@tae.com>"]
6-
edition = "2021"
7-
8-
[[bin]]
9-
name = "RustBCA"
10-
path = "src/main.rs"
11-
12-
[lib]
13-
name = "libRustBCA"
14-
path = "src/lib.rs"
15-
crate-type = ["cdylib", "lib"]
16-
17-
[dependencies]
18-
rand = {version = "0.10.2", features=["chacha"]}
19-
rand_distr = "0.6.0"
20-
toml = "1.1.4"
21-
anyhow = "1.0.71"
22-
itertools = "0.15.0"
23-
rayon = "1.10.0"
24-
geo = {version = "0.25", optional = false}
25-
indicatif = {version = "0.18.6", features=["rayon"]}
26-
serde = { version = "1.0.163", features = ["derive"] }
27-
hdf5 = {version = "0.7.1", optional = true}
28-
rcpr = { git = "https://github.com/drobnyjt/rcpr", optional = true}
29-
ndarray = {version = "0.17.2", features = ["serde"], optional = true}
30-
parry3d-f64 = {optional = true, version="0.2.0"}
31-
pyo3 = {version = "0.29.0", optional=true}
32-
pythonize = {version = "0.29.0", optional=true}
33-
34-
[dev-dependencies]
35-
float-cmp = "0.10.0"
36-
37-
[profile.release]
38-
lto = "fat"
39-
codegen-units = 1
40-
opt-level = 3
41-
debug = false
42-
43-
[features]
44-
hdf5_input = ["hdf5"]
45-
cpr_rootfinder = ["rcpr"]
46-
distributions = ["ndarray"]
47-
no_list_output = []
48-
parry3d = ["parry3d-f64"]
49-
python = ["pyo3", "pythonize"]
1+
[package]
2+
name = "RustBCA"
3+
version = "3.0.0"
4+
default-run = "RustBCA"
5+
authors = ["Jon Drobny <drobny2@illinois.edu>", "Jon Drobny <jdrobny@tae.com>"]
6+
edition = "2024"
7+
8+
[[bin]]
9+
name = "RustBCA"
10+
path = "src/main.rs"
11+
12+
[lib]
13+
name = "libRustBCA"
14+
path = "src/lib.rs"
15+
crate-type = ["cdylib", "lib"]
16+
17+
[dependencies]
18+
rand = {version = "0.10.2", features=["chacha"]}
19+
rand_distr = "0.6.0"
20+
toml = "1.1.4"
21+
anyhow = "1.0.71"
22+
itertools = "0.15.0"
23+
rayon = "1.10.0"
24+
geo = {version = "0.25", optional = false}
25+
indicatif = {version = "0.18.6", features=["rayon"]}
26+
serde = { version = "1.0.163", features = ["derive"] }
27+
rcpr = { git = "https://github.com/drobnyjt/rcpr", optional = true}
28+
ndarray = {version = "0.17.2", features = ["serde"], optional = true}
29+
parry3d-f64 = {optional = true, version="0.2.0"}
30+
pyo3 = {version = "0.29.0", optional=true}
31+
pythonize = {version = "0.29.0", optional=true}
32+
33+
[dev-dependencies]
34+
float-cmp = "0.10.0"
35+
36+
[profile.release]
37+
lto = "fat"
38+
codegen-units = 1
39+
opt-level = 3
40+
debug = false
41+
42+
[features]
43+
cpr_rootfinder = ["rcpr"]
44+
distributions = ["ndarray"]
45+
no_list_output = []
46+
parry3d = ["parry3d-f64"]
47+
python = ["pyo3", "pythonize"]
5048
extended_max_z = []

‎examples/layered_geometry.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ electronic_stopping_mode = "LOW_ENERGY_NONLOCAL"
1212
mean_free_path_model = "LIQUID"
1313
interaction_potential = [["KR_C"]]
1414
scattering_integral = [["MENDENHALL_WELLER"]]
15-
use_hdf5 = false
1615
root_finder = [[{"NEWTON"={max_iterations=100, tolerance=1E-6}}]]
1716
num_threads = 4
1817
num_chunks = 10

‎examples/layered_geometry_1D.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ electronic_stopping_mode = "LOW_ENERGY_NONLOCAL"
1212
mean_free_path_model = "LIQUID"
1313
interaction_potential = [["KR_C"]]
1414
scattering_integral = [["MENDENHALL_WELLER"]]
15-
use_hdf5 = false
1615
root_finder = [[{"NEWTON"={max_iterations=100, tolerance=1E-6}}]]
1716
num_threads = 4
1817
num_chunks = 10

‎examples/lithium_vapor_shield.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ electronic_stopping_mode = "LOW_ENERGY_LOCAL"
1212
mean_free_path_model = {"THRESHOLD"={density=1e28}}
1313
interaction_potential = [["KR_C"]]
1414
scattering_integral = [["MENDENHALL_WELLER"]]
15-
use_hdf5 = false
1615
root_finder = [[{"NEWTON"={max_iterations=100, tolerance=1E-6}}]]
1716
num_threads = 4
1817
num_chunks = 2

‎examples/multiple_interaction_potentials.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ root_finder = [
2222
[{"NEWTON"={max_iterations=100, tolerance=1E-6}}, {"POLYNOMIAL"={complex_threshold=1E-12}}],
2323
[{"POLYNOMIAL"={complex_threshold=1E-12}}, {"NEWTON"={max_iterations=100, tolerance=1E-6}}]
2424
]
25-
use_hdf5 = false
2625
num_threads = 4
2726
num_chunks = 10
2827
track_displacements = false

‎examples/titanium_dioxide_0D.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ electronic_stopping_mode = "LOW_ENERGY_NONLOCAL"
1212
mean_free_path_model = {"THRESHOLD"={density=1E28}}
1313
interaction_potential = [["KR_C"]]
1414
scattering_integral = [["MENDENHALL_WELLER"]]
15-
use_hdf5 = false
1615
root_finder = [[{"NEWTON"={max_iterations=100, tolerance=1E-6}}]]
1716
num_threads = 4
1817
num_chunks = 100

‎examples/tungsten_tiles_trimesh.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ suppress_deep_recoils = false
1010
high_energy_free_flight_paths = false
1111
num_threads = 4
1212
num_chunks = 5
13-
use_hdf5 = false
1413
electronic_stopping_mode = "LOW_ENERGY_NONLOCAL"
1514
mean_free_path_model = "LIQUID"
1615
interaction_potential = [["KR_C"]]

‎examples/tungsten_twist_trimesh.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ suppress_deep_recoils = false
1010
high_energy_free_flight_paths = false
1111
num_threads = 4
1212
num_chunks = 5
13-
use_hdf5 = false
1413
electronic_stopping_mode = "LOW_ENERGY_NONLOCAL"
1514
mean_free_path_model = "LIQUID"
1615
interaction_potential = [["KR_C"]]

0 commit comments

Comments
 (0)