Skip to main content

DecoDaiTengu - dive decompression library (fork of DecoTengu)

Project description

DecoDaiTengu

A modern Python dive decompression library implementing the Bühlmann ZH-L16B/C decompression model with Erik Baker's gradient factors.

This is a modernised fork of the original DecoTengu library (v0.14.1, 2018) by Artur Wroblewski.

Features

  • ZH-L16B-GF and ZH-L16C-GF models with full helium compartment support (trimix)
  • Gradient factor configuration (GF low/high)
  • CNS and OTU oxygen toxicity tracking
  • High-level plan_dive() API for common dive planning
  • Type-annotated, Python 3.10+ codebase
  • Gas mix support: air, nitrox, trimix

Quick Start

pip install decodaitengu
from decodaitengu import plan_dive, Gas

# Simple air dive
result = plan_dive(depth=35, bottom_time=40, gf=(30, 85))
print(f"Runtime: {result.runtime} min")
print(f"Deco stops: {[(s.depth, s.time) for s in result.stops]}")
print(f"CNS: {result.cns_percent}%")

# Trimix dive with deco gas
result = plan_dive(
    depth=60,
    bottom_time=20,
    back_gas=Gas(21, 35),
    deco_gases=[Gas(50, 0, switch_depth=21), Gas(100, 0, switch_depth=6)],
    gf=(30, 85),
)
print(f"Runtime: {result.runtime} min")

Models

from decodaitengu import plan_dive
from decodaitengu.models import ZHL16C, ZHL16B

# ZHL-16C is the default (recommended for dive computers)
result = plan_dive(depth=40, bottom_time=25, model=ZHL16C)

# ZHL-16B available for backward compatibility
result = plan_dive(depth=40, bottom_time=25, model=ZHL16B)

Legacy API

The original DecoTengu API is still available for backward compatibility:

import decodaitengu

engine = decodaitengu.create()
engine.add_gas(0, 21)
profile = list(engine.calculate(35, 40))
print(engine.deco_table.total)  # 44.0

Development

pip install -e ".[dev]"
pytest
ruff check .

License

GPL-3.0-or-later. See COPYING for details.

WARNING: This software is provided as-is with no warranty. Any diving using data provided by this library is at the diver's own risk.

Cheers, gully

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

decodaitengu-1.0.0.tar.gz (541.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

decodaitengu-1.0.0-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file decodaitengu-1.0.0.tar.gz.

File metadata

  • Download URL: decodaitengu-1.0.0.tar.gz
  • Upload date:
  • Size: 541.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for decodaitengu-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1ec80889f87bd574a104c86b009f4adbe15199d0dfbed31f9a8f60988bb5e622
MD5 0458472f09c9234d2a5fd5a0d7cebaf0
BLAKE2b-256 5b2046e64f9818a5720f3312a2d93ea171d754f544d7809c8c819a593820e9d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for decodaitengu-1.0.0.tar.gz:

Publisher: publish.yml on notionparallax/decodaitengu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file decodaitengu-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: decodaitengu-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for decodaitengu-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a407106574508ce51fa8c1e488007d2db349408f7a7c3c1c90cd7f9b782d9a7
MD5 e85bacbac94677ed413d214a4db1c0ec
BLAKE2b-256 2548e29c214ae8c5cb722a13e4ea0f576c03830c3a1b54dd3d4e8fbdcae314b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for decodaitengu-1.0.0-py3-none-any.whl:

Publisher: publish.yml on notionparallax/decodaitengu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page