Python package to manage plotting and reporting tools for the score suite. score-plotting leverages the score-db database which uses the PostgreSQL database system hosted by AWS on an RDS instance (currently administered by PSL).
- Clone the score-hv, score-db, and score-plotting repos. All of these repos are required. score-db is responsible for managing the backend database which stores diagnostics data. score-db has several APIs to help users insert and collect data from the score-db database. score-hv, on the other hand, is responsible for harvesting data from the diagnostic. score-plotting contains scripts for plotting statistics such as gsi stats and file counts.
$ git clone https://github.com/noaa-psl/score-hv.git
$ git clone https://github.com/noaa-psl/score-db.git
$ git clone https://github.com/noaa-psl/score-plotting.git
- For testing and development, we recommend creating a new python environment (e.g., using mamba as shown below or other options such as conda). To install the required dependencies into a new environment using the micromamba command-line interface, run the following after installing mamba/micromamba:
$ micromamba create -f environment.yml; micromamba activate score-plotting-default-env
- Install score-hv using pip. From the score-hv directory, run the following:
$ pip install . # default installation into active environment
- Configure the PostgreSQL credentials and settings for the score-db by
creating a
.env
file and by inserting the text shown below (note: this text is taken straight from the file.env_example
). You will need to acquire the database password from the administrator. Once you have created the.env
file, copy it tosrc/score_db/
.
Note: this MUST be done before installing score-db, or your database credentials will not work.
from the score-db repo top level, cat the example file
$ cat .env_example
SCORE_POSTGRESQL_DB_NAME = 'rnr_scores_db'
SCORE_POSTGRESQL_DB_PASSWORD = '[score_db_password]'
SCORE_POSTGRESQL_DB_USERNAME = 'ufsrnr_user'
SCORE_POSTGRESQL_DB_ENDPOINT = 'psl-score-db.cmpwyouptct1.us-east-2.rds.amazonaws.com'
SCORE_POSTGRESQL_DB_PORT = 5432
- Install score-db using pip. From the score-db directory, run the following:
$ pip install . # default installation into active environment
- Depending on your use case, you can install score-plotting using one of three methods using pip,
$ pip install . # default installation into active environment`
$ pip install -e . # editable installation into active enviroment, useful for development`
$ pip install -t [TARGET_DIR] --upgrade . # target installation into TARGET_DIR, useful for deploying for cylc workflows (see https://cylc.github.io/cylc-doc/stable/html/tutorial/runtime/introduction.html#id3)`
Please reference the score-db repository documentation for more information about how to use the APIs.