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.
- If the channel epoch ends before the embargo: No changes are made.
- 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:
- The restriction policy before the embargo is forced to open.
- The restriction policy after the embargo remains closed.
- If the epoch starts before the embargo and the restriction policy is closed, the epoch is split at the embargo date:
- 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 thestationXMLfile 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 theDEBUGlevel, 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eida_embargo_roller-0.2.4.tar.gz.
File metadata
- Download URL: eida_embargo_roller-0.2.4.tar.gz
- Upload date:
- Size: 70.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbe2a852678777684e8fc05048b93e2b2dcdf67ada8f1bdc80e0dccb281762d2
|
|
| MD5 |
ad67bf6aeb38cda3c8f8fc0edef72fe7
|
|
| BLAKE2b-256 |
0e504ef6cbac7e1cb6f60db2d1fee8020ddf9c427c55878f4bc0c123ae12d469
|
Provenance
The following attestation bundles were made for eida_embargo_roller-0.2.4.tar.gz:
Publisher:
publish.yml on EIDA/embargo-roller
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eida_embargo_roller-0.2.4.tar.gz -
Subject digest:
dbe2a852678777684e8fc05048b93e2b2dcdf67ada8f1bdc80e0dccb281762d2 - Sigstore transparency entry: 171433022
- Sigstore integration time:
-
Permalink:
EIDA/embargo-roller@83f517448afeecf3585de9c43fc1429a083848b3 -
Branch / Tag:
refs/heads/pypi-release - Owner: https://github.com/EIDA
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@83f517448afeecf3585de9c43fc1429a083848b3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file eida_embargo_roller-0.2.4-py3-none-any.whl.
File metadata
- Download URL: eida_embargo_roller-0.2.4-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fadee3ef13b156d44e055ea5bcb6116fe45ea53785748ace6b082f1208743acc
|
|
| MD5 |
d5e8c2fa2bd361eb786c2c26b8b2c615
|
|
| BLAKE2b-256 |
aeb76dd45d17965617240a6fa1f99fffcd5b8565eda8d3004e22b9dcef4a81fa
|
Provenance
The following attestation bundles were made for eida_embargo_roller-0.2.4-py3-none-any.whl:
Publisher:
publish.yml on EIDA/embargo-roller
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
eida_embargo_roller-0.2.4-py3-none-any.whl -
Subject digest:
fadee3ef13b156d44e055ea5bcb6116fe45ea53785748ace6b082f1208743acc - Sigstore transparency entry: 171433023
- Sigstore integration time:
-
Permalink:
EIDA/embargo-roller@83f517448afeecf3585de9c43fc1429a083848b3 -
Branch / Tag:
refs/heads/pypi-release - Owner: https://github.com/EIDA
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@83f517448afeecf3585de9c43fc1429a083848b3 -
Trigger Event:
push
-
Statement type: