Skip to main content

Read and write DYM file format from SEAPODYM project with xarray integration

Project description

dymfile

Python License

Read and write DYM file format with xarray integration

DYM is a binary format used by the SEAPODYM project for oceanographic data. This package provides a modern Python interface with native xarray support.

Features

  • ✅ Read DYM files as xarray Datasets
  • ✅ Write xarray Datasets to DYM format
  • ✅ Native xarray backend: xr.open_dataset("file.dym", engine="dym")
  • ✅ Command-line tools for format conversion
  • ✅ Fully typed with pyright
  • ✅ Tested with pytest

Installation

git clone https://github.com/Ash12H/dymfile.git
cd dymfile
uv sync

Or with pip:

pip install git+https://github.com/Ash12H/dymfile.git

Quick Start

Reading

import xarray as xr

# Via xarray backend (recommended)
ds = xr.open_dataset("data.dym", engine="dym")

# Or high-level API
from dymfile import dym_to_dataset
ds = dym_to_dataset("data.dym")

Writing

from dymfile.writer import dataset_to_dym

ds = xr.open_dataset("input.nc")
dataset_to_dym(ds, "output.dym")

CLI Tools

# Convert DYM to NetCDF
dym-to-dataset input.dym -o output.nc

# Convert NetCDF to DYM
dataset-to-dym input.nc -o output.dym --variable temperature

Documentation

Full documentation available at: https://ash12h.github.io/dymfile

Development

Setup

# Install with dev dependencies
uv sync --extra dev --extra docs

# Install pre-commit hooks
pre-commit install

Testing

pytest tests/

Documentation

mkdocs serve

Project Structure

dymfile/
├── src/dymfile/        # Source code
│   ├── reader.py       # Read DYM files
│   ├── writer.py       # Write DYM files
│   ├── backend.py      # Xarray backend
│   ├── cli.py          # Command-line tools
│   ├── _formats.py     # Data structures
│   └── _utils.py       # Utilities
├── tests/              # Test suite
├── docs/               # Documentation
└── data/               # Sample files

Technologies

  • Language: Python 3.10+
  • Package manager: uv
  • Linter/Formatter: ruff
  • Type checker: pyright
  • Testing: pytest
  • Documentation: MkDocs + Material theme

License

MIT License - see LICENSE file

Acknowledgments

DYM format developed by the SEAPODYM project for oceanographic modeling.

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

dymfile-0.2.0.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

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

dymfile-0.2.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file dymfile-0.2.0.tar.gz.

File metadata

  • Download URL: dymfile-0.2.0.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dymfile-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fb63c298cb73c29e336e032bc01bb0c5169b17379e6798a21b928ffadf91a622
MD5 20609f507fa50f387dc8f652d674fe87
BLAKE2b-256 0c0ae61af220025386118cfa2c34d6cbebf5eb2be8c7faf61b4d40e613fad806

See more details on using hashes here.

File details

Details for the file dymfile-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dymfile-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dymfile-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a4c23c2f0318797ad96500eb0ae4a14ab7a315e3b1a246059bcfc9f4fcc0040
MD5 eea046f897f60d608be9bb45be9a0590
BLAKE2b-256 fc48761e36a91491f4d59f8958596436424f22d32ac676429ffd0cf180514a6f

See more details on using hashes here.

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