Skip to content

Ash12H/dymfile

Repository files navigation

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.

About

Manage DYM file format from SEAPODYM project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages