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

chore: limit ndl output to 99 #26

Merged
merged 2 commits into from
Aug 23, 2024
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ All decompression stages calculated to clear deco obligations and resurface in a

The NDL is a theoretical time obtained by calculating inert gas uptake and release in the body that determines a time interval a diver may theoretically spend at given depth without aquiring any decompression obligations (given constant depth and gas mix).

- `ndl()` - no-decompression limit for current model state in minutes, assuming constant depth and gas mix
- `ndl()` - no-decompression limit for current model state in minutes, assuming constant depth and gas mix. This method has a cut-off at 99 minutes

```rust
use dive_deco::{DecoModel, BuehlmannModel, BuehlmannConfig, Gas};
Expand Down
2 changes: 1 addition & 1 deletion src/buehlmann/buehlmann_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl DecoModel for BuehlmannModel {
}

fn ndl(&self) -> Minutes {
let mut ndl: Minutes = Minutes::MAX;
let mut ndl: Minutes = NDL_CUT_OFF_MINS;

// create a simulation model based on current model's state
let mut sim_model = self.fork();
Expand Down
4 changes: 2 additions & 2 deletions tests/buehlmann_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ fn test_ndl_cut_off() {
let air = Gas::new(0.21, 0.);

model.record(0., 0, &air);
assert_eq!(model.ndl(), Minutes::MAX);
assert_eq!(model.ndl(), 99);

model.record(10., 10*60, &air);
assert_eq!(model.ndl(), Minutes::MAX);
assert_eq!(model.ndl(), 99);
}

#[test]
Expand Down