Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openpmd/openpmd-updater
:arrow_double_up: Update openPMD files to newer versions of the openPMD standard
https://github.com/openpmd/openpmd-updater
community fileformat modernizer openpmd openscience research updater
Last synced: about 2 months ago
JSON representation
:arrow_double_up: Update openPMD files to newer versions of the openPMD standard
- Host: GitHub
- URL: https://github.com/openpmd/openpmd-updater
- Owner: openPMD
- License: isc
- Created: 2018-02-09T13:12:27.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-04-17T19:59:16.000Z (9 months ago)
- Last Synced: 2024-04-17T21:07:25.109Z (9 months ago)
- Topics: community, fileformat, modernizer, openpmd, openscience, research, updater
- Language: Python
- Homepage:
- Size: 128 KB
- Stars: 2
- Watchers: 4
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# openPMD Updater
[![CI:ubuntu](https://github.com/openPMD/openPMD-updater/actions/workflows/ci.yml/badge.svg)](https://github.com/openPMD/openPMD-updater/actions/workflows/ci.yml)
![Supported Python Versions](https://img.shields.io/pypi/pyversions/openPMD-updater.svg)
[![License](https://img.shields.io/badge/license-ISC-blue.svg)](https://opensource.org/licenses/ISC)This repository contains scripts to update existing files to *newer versions of the openPMD standard*.
## Rationale
We want our community to be able to move fast without pulling up a long legacy code trail for old versions.
We therefore motivate developers to always implement the latest stable version of the [openPMD standard](https://github.com/openPMD/openPMD-standard).At the same time, we want that existing user data can always be read.
In order to achieve this, this repository provides a tool and modular library for lightweight meta-data updates.
Updates are only supported to go *forward* to newer releases.**Developer perspective:** You only want to implement the latest version(s) of openPMD in order to reduce your development effort.
You update timely to new openPMD versions and deprecate or remove support for previous openPMD versions.
Now a user provides an openPMD file but the openPMD-standard version in it is too old compared to the standard implementation you rely on.
In a Python application, just import the module and (after a confirmation) auto-update the user-given file.
If you are not in a python environment, just reject the file gracefully with a note the version in the file is too old and point the user *here* to update their existing files.**User perspective:** You are restoring "old" files from an archive and want to process it with a modern software that supports openPMD.
This software might only implement recent versions of openPMD, has no auto-update functionality and rejects your files.
Just run the updater command-line tool to update your files manually, then load it in aforementioned software.## Install
[![pypi version](https://img.shields.io/pypi/v/openPMD-updater.svg)](https://pypi.python.org/pypi/openPMD-updater)
[![Spack Package](https://img.shields.io/badge/spack-py--openpmd--updater-blue.svg)](https://spack.io)
[![Conda Package](https://anaconda.org/ax3l/openpmd_updater/badges/version.svg)](https://anaconda.org/ax3l/updater)Choose *one* of the install methods below to get started:
*TBD*
### From Source
```bash
git clone https://github.com/openPMD/openPMD-updater.git
cd openPMD-updater# install dependencies
pip install .# with optional dependencies for testing
pip install .[test]
```## Usage
### CLI
We provide the command-line tools for individual files:
```bash
# optional: append --backup
openPMD_updater_h5 -i example.h5
```### Module
Additionally, the updater tools can be used as *Python module* in your projects.
This allows you to offer a file update to users that try to use your tool with old versions of the openPMD standard (but you might only support newer versions).```python
from openpmd_updater.Updater import Updaterupdater = Updater("example.h5", verbose=False)
updater.update(target_version="2.0.0", in_place=True)```
## Development
### Testing
Additional packages need to be installed for the tests. To install them do:
```bash
pip install .[test]
```Then one can run the tests as follows:
```bash
# all
pytest# specific
pytest tests/test_backend_h5.py
```