Skip to main content

🧙🔧 Utils that can be reused and shared across and beyond the ESO Nowcast project

Project description

Nowcast Library

🧙‍♂️🔧 Utils that can be reused and shared across and beyond the ESO Nowcast project

This is a public repository hosted on GitHub via a push mirror setup in the internal ESO GitLab repository

Installation

Simply run

pip install nowcastlib

Usage and Documentation

At the moment, Nowcast Library is simply a collection of functions dealing with raw time series data surrounding the ESO Nowcast project. These functions are in the module rawdata.py, and can be imported as such

"""Example showing how to access compute_trig_fields function"""
import nowcastlib as ncl
import pandas as pd
import numpy as np

data_df = pd.DataFrame(
    [[0, 3, 4, np.NaN], [32, 4, np.NaN, 4], [56, 8, 0, np.NaN]],
    columns=["A", "B", "C"],
    index=pd.date_range(start="1/1/2018", periods=4, freq="2min"),
)

result = ncl.rawdata.compute_trig_fields(data_df, ["A", "C"])

Further documentation here.

Development Setup

This repository relies on Poetry for tracking dependencies, building and publishing. It is therefore recommended that developers install poetry and make use of it throughout their development of the project.

Dependencies

Make sure you are in the right Python environment and run

poetry install

This reads pyproject.toml, resolves the dependencies, and installs them.

Deployment

The repository is published to PyPi, so to make it accessible via a pip install command as mentioned earlier.

To publish changes follow these steps:

  1. Changes should be merged into the master branch. Ideally this process is automated via a CI tool.

  2. Optionally run poetry version with the appropriate argument based on semver guidelines.

  3. Prepare the package by running

    poetry build
    
  4. Ensure you have TestPyPi and PyPi configured as your poetry repositories:

    poetry config repositories.testpypi https://test.pypi.org/legacy/
    poetry config repositories.pypi https://pypi.org/
    
  5. Publish the repository to TestPyPi, to see that everything works as expected:

    poetry publish -r testpypi
    
  6. Publish the repository to PyPi:

    poetry publish -r pypi
    

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

nowcastlib-1.1.5.tar.gz (17.6 kB view hashes)

Uploaded Source

Built Distribution

nowcastlib-1.1.5-py3-none-any.whl (29.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page