Skip to content

Commit

Permalink
Remove nightly requirement (#147)
Browse files Browse the repository at this point in the history
* bump tensor

* move benchmarks to benches to avoid nightly requirement

* fix imports

* remove toolchain

* lint

* bench needs nightly

* remove allow(dead_code)
  • Loading branch information
ntBre authored Nov 30, 2024
1 parent 8c4cd26 commit 6294c67
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test:
cargo test --workspace ${TESTFLAGS} ${ARGS}

bench:
cargo bench ${TESTFLAGS} ${ARGS}
cargo +nightly bench ${TESTFLAGS} ${ARGS}

clippy:
cargo clippy --workspace --tests
Expand Down
9 changes: 8 additions & 1 deletion spectro/src/tests/bench.rs → spectro/benches/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
use super::*;
#![feature(test)]

use spectro::{
consts::FACT2,
load_fc2, load_fc3, load_fc4,
utils::{self, force3, force4, load_vec, to_wavenumbers},
Spectro,
};

extern crate test;

Expand Down
2 changes: 0 additions & 2 deletions spectro/rust-toolchain.toml

This file was deleted.

3 changes: 1 addition & 2 deletions spectro/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub(crate) const _A0: f64 = 0.52917706;
/// says, the base energy unit is mdyne·Å, which is equal to an attojoule. A
/// first derivative would be in units mdyne·Å/Å or mdyne, so a second
/// derivative is mdyne/Å, and so on.
pub(crate) const FACT2: f64 = 4.359813653 / (0.52917706 * 0.52917706);
pub const FACT2: f64 = 4.359813653 / (0.52917706 * 0.52917706);

pub(crate) const FUNIT3: f64 =
4.359813653 / (0.52917706 * 0.52917706 * 0.52917706);
Expand All @@ -31,7 +31,6 @@ pub(crate) const ALAM: f64 = 4.0e-2 * (PI * PI * CL) / (PH * AVN);
pub(crate) const CONST: f64 = 1.0e+02 * (PH * AVN) / (8.0e+00 * PI * PI * CL);

/// planck's constant in atomic units?
pub(crate) const PH: f64 = 6.626176;

/// pre-computed sqrt of ALAM
Expand Down
1 change: 0 additions & 1 deletion spectro/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![cfg_attr(test, feature(test))]
#![allow(clippy::too_many_arguments, clippy::needless_range_loop)]

use std::{
Expand Down
1 change: 0 additions & 1 deletion spectro/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::ops::Sub;

mod alphaa;
mod alphas;
mod bench;
mod enrgy;
mod force3;
mod force4;
Expand Down
7 changes: 5 additions & 2 deletions spectro/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ pub fn to_wavenumbers(freqs: &Dvec) -> Dvec {
)
}

pub(crate) fn load_vec<P>(infile: P) -> Vec<f64>
/// Load a whitespace-separated vector from `infile`.
///
/// Panics if there is an error reading the file or parsing any of the entries
/// as `f64`.
pub fn load_vec<P>(infile: P) -> Vec<f64>
where
P: AsRef<Path> + std::fmt::Debug,
{
Expand Down Expand Up @@ -337,7 +341,6 @@ pub fn make_funds(freq: &Dvec, nvib: usize, xcnst: &Dmat) -> Vec<f64> {
}

/// take a vec of energy: state pairs and print them in SPECTRO's format
#[allow(dead_code)]
pub(crate) fn print_vib_states(reng: &[f64], i1sts: &Vec<State>) {
println!(
"{:^10}{:^20}{:^20}{:>21}",
Expand Down

0 comments on commit 6294c67

Please sign in to comment.