Skip to main content

No project description provided

Project description

EIDA Embargo Roller

Description

This program processes a stationXML file in input and updates channels epochs to reflect the embargo start date specified.

  1. If the channel epoch ends before the embargo: No changes are made.
  2. If the channel epoch ends after the embargo:
    • If the epoch starts before the embargo and the restriction policy is closed, the epoch is split at the embargo date:
      1. The restriction policy before the embargo is forced to open.
      2. The restriction policy after the embargo remains closed.
  3. After processing, the program merges channels that are contiguous in time and have the same content.

Usage

eida_embargo_roller [-i] [-e YYYY-MM-DD] station.xml

Options:

  • -i: Transform the stationXML file provided in place.
  • -e: Embargo start date. All channels before this date will get unrestricted policy.

Examples

Writing a New XML File

Writing a new XML file for an embargo starting 2 years from now, on the 1 of january:

uv run eida_embargo_roller Z3.A190A.xml > result.xml

Changing an existing XML file:

Transform the file in place:

uv run eida_embargo_roller -e 2025-01-01 -i Z3.A190A.xml

Using Standard Input

Process an XML file from a remote source:

wget -qO- "ws.resif.fr/fdsnws/station/1/query?net=Z3&level=channel&sta=A190A" | uv run eida_embargo_roller - > result.xml

Installation

Using UV (Recommended)

1. Install uv

If uv is not already installed, you can add it by following this guide.

2. Sync Dependencies

Navigate to the project directory and run:

uv sync

This command will install all dependencies listed in pyproject.toml.

3. Run the Script

After syncing, use:

uv run eida_embargo_roller -e YYYY-MM-DD station.xml

Rust and Cargo Requirement

Certain dependencies (e.g., pendulum) require Rust and Cargo to build. If you encounter errors such as maturin failing due to missing Cargo, install Rust and Cargo by following the official Rust installation guide.

As a Python Package

To install using pip:

python -m pip install --user eida_embargo_roller

From Source

To install from source:

git clone https://github.com/your-repo/embargo-roller.git
cd embargo-roller

# Install dependencies using UV
uv sync

Tests and Debugging

Running Tests

To run the entire test suite using pytest, execute:

uv run pytest

Debugging Specific Tests

To debug a specific test file (e.g., test_processor.py) and enable detailed logs:

uv run pytest -s tests/test_processor.py --log-cli-level=DEBUG
  • --log-cli-level=DEBUG: Enables logging at the DEBUG level, showing detailed log messages.

Example Output

When debugging, you will see:

2024-06-17 12:00:00 - __main__ - DEBUG - Processing Channel: {'code': 'CH1', 'startDate': '2020-01-01T00:00:00'}
2024-06-17 12:00:00 - __main__ - DEBUG - Comparing with Previous Channel: {'code': 'CH1', 'endDate': '2020-06-01T00:00:00'}
2024-06-17 12:00:00 - __main__ - DEBUG - Channels merged successfully.

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

eida_embargo_roller-0.2.0.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

eida_embargo_roller-0.2.0-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eida_embargo_roller-0.2.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for eida_embargo_roller-0.2.0.tar.gz
Algorithm Hash digest
SHA256 41151ad86029192bcadd4f515175ad850405d85560771334e44b3f99593afaad
MD5 c95e2c67fca8688465c8c4a92592c8c3
BLAKE2b-256 3f282505b62cb587424a8d3cfb96b5e46332d9ee25aeefb2d623ed32d608a24a

See more details on using hashes here.

Provenance

The following attestation bundles were made for eida_embargo_roller-0.2.0.tar.gz:

Publisher: publish.yml on EIDA/embargo-roller

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

File details

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

File metadata

File hashes

Hashes for eida_embargo_roller-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f30716fa42883a7ef24290ad6ce9ec4852acbb8110f964ffecd12f94dfdcf0a
MD5 432a3dd085ca9c378b9faeace20bc33a
BLAKE2b-256 c066bf4a7bba11319e33e91c9328c4e3826e964a63cbfdb5efe4286b58217270

See more details on using hashes here.

Provenance

The following attestation bundles were made for eida_embargo_roller-0.2.0-py3-none-any.whl:

Publisher: publish.yml on EIDA/embargo-roller

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