Skip to main content

resif data reporter

Cet outil collecte sur un ou plusieurs espaces disques en structure SDS l'espace occupé par les réseaux sismo.

Mises à jour

Pour publier une nouvelle version :

  1. incrémenter le numéro de version dans setup.py
  2. Faire un commit et un push L'intégration continue se charge de construire le paquet python et de le publier.

Installation

python3 -m pip install resifdatareporter --extra-index-url https://gricad-gitlab.univ-grenoble-alpes.fr/api/v4/projects/13239/packages/pypi/simple

À propos

Collecte des volumes

Les données sont dans un ou plusieurs dossier(s) contenant un sous-dossier par année et pour chaque année, un dossier par réseau.

Dans le rapport final, on souhaite distinguer les réseaux permanents des expériences temporaires.

Les données collectées sont écrites en YAML dans un fichier cache.

Les données sont ensuite écrites dans une base postgres.

Configuration

Le script de collecte a besoin d'un fichier de configuration. Le fichier config.yml.example fournit toute la documentation nécessaire pour un paramétrage initial.

Par défaut, le script collecte les données (en faisant des du), les compile et les écrit dans le fichier data.yaml.

Si les données contenues dans data.yaml ne sont pas plus anciennes que ce que spécifie la configuration data_cache_ttl (en jour), alors le script scanne le fichier data.json pour le restituer et n'effectue pas le scan des volumes.

Postgres

Quelle config sur le serveur postgres ? Quelle base et quelles tables créer ?

CREATE TYPE sismo_data_type AS ENUM('bud', 'validated')
CREATE TABLE dataholdings (network varchar(2),
                          year varchar(4),
                          station varchar(5),
                          channel varchar(3),
                          quality varchar(1),
                          type sismo_data_type,
                          size bigint,
                          is_permanent boolean,
                          date date);

Tester

Lancer des tests unitaires

pip install -e .
pytest

Lancer un docker postgres

docker pull postgres
docker run --name pg -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres

Configuration

Un fichier de Configuration pour les tests :

    volumes:
      - path: /tmp/pytest-of-schaeffj/pytest-22/validated/
        type: validated
      - path: /tmp/pytest-of-schaeffj/pytest-22/bud
        type: bud
    postgres:
      host: localhost
      database: stats
      port: 5432
      user: postgres
      password: mysecretpassword

    metadata:    # Information about the gathered data. Used to tag the timeserie values
      permanent_networks: #  List all permanent networks here. Otherwise, they will be considered as temporary
        - CL
        - GL
        - MQ
        - ND
        - PF
        - RD
        - FR
        - G
        - RA
        - WI

Tester le programme complet :

python resif_data_reporter.py --config config.yml

Metadata

Release files for resifdatareporter 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for resifdatareporter 1.0.1
File Size Uploaded Provenance
resifdatareporter-1.0.1.tar.gz 18.6 kB Without provenance Details

Release files / resifdatareporter-1.0.1.tar.gz

Download URL resifdatareporter-1.0.1.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
54c683a44815007cf9e4413ea949c5e4f8c7e93fb8bba9d614157bd60093d205
BLAKE2b-256 checksum
How to use checksums
3405bc5359438ca61fa147bd0cd2225e96d951057e2b5b712f20d3fee50e5b12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/5.0.0 keyring/23.11.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.10.8

Security for resifdatareporter 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page