Skip to main content

Measured data visualization and pipelines creation

Project description

CorrAI

PyPI Static Badge codecov Ruff License

Pipeline Development and Data Visualization for Time Series in Physical Measurements

Tide is a tool for developing data processing pipelines and visualizing time series data, particularly suited for physical measurements. Key features include:

  • Efficient Data Management

    • Organize and select data using a tagging system
  • Pipeline Construction

    • Store and retrieve pipelines easily with JSON-based dictionary structures
    • Build dynamic pipelines that adjust based on the selected data
  • Interactive Visualization

    • Create interactive plots to explore data (plotly)
    • Visualize pipeline or slices of pipelines effects on data
  • Custom Data Enrichment

    • Integrate external weather data sources
    • Implement autoregressive models for gaps filling
    • Develop and incorporate custom data processors

Uses pandas DataFrames and Series for robust data handling. bigtree for tags and data selection. Scikit-learn's API for pipeline construction.

Getting started

1- Install ⬇️

pip install python-tide

2- Load and format data 🌲

To begin, load your time series data into a pandas DataFrame, ensuring the index is a DateTimeIndex:

df = pd.read_csv(
    "https://raw.githubusercontent.com/BuildingEnergySimulationTools/tide/main/tutorials/getting_started_ts.csv",
    parse_dates=True,
    index_col=0
)

Rename columns using Tide's tagging system. The format is: name__unit__bloc__sub_bloc with tags separated by double underscores. The order of the tags matters. The order of tags is important, and you can use "OTHER" as a placeholder You can use one or several tags.

df.columns = ["Tin__°C__Building", "Text__°C__Outdoor", "Heat__W__Building"]

Plumber objects are used to help us with pipelines building and data visualization

from tide.plumbing import Plumber

plumber = Plumber(df)

Display the data organization as a tree:

plumber.show()

Select data using tags:

plumber.get_corrected_data("°C")
plumber.get_corrected_data("Building")
plumber.get_corrected_data("Tin")

3- Visualizing data 📈

Show data availability:

plumber.plot_gaps_heatmap(time_step='d')

Plot time series with missing data highlighted:

fig = plumber.plot(plot_gaps=True)
fig.show(None)

4- Building and testing Pipelines 🛠️

Create a pipeline dictionary:

pipe_dict = {
    "step_1": [["Common_proc_1"], ["Common_proc_2", ["arg1", "arg2"]]],
    "step_2": {
        "selection_1": [["Proc_selection_1", {"arg": "arg_value"}]]
    }
}

Pipeline Rules:

  • Use dictionaries for pipeline description
  • Keys represent pipeline steps ex. "step_1"
  • Step values can be lists (apply to all columns) or dicts (filter columns)
  • Processing objects are listed as [class_name, arguments]

Example Pipeline:

  • Resample data to 15-minute intervals
  • Interpolate temperature gaps ≤ 3 hours
  • Fill large Tin gaps using Autoregressive STLForecast
pipe_dict = {
    "resample_15min": [["Resample", ["15min"]]],
    "interpolate_temps": {
        "°C": [["Interpolate", {"gaps_lte": "3h"}]]
    },
    "ar_tin": {
        "Tin": [
            [
                "FillGapsAR",
                {
                    "model_name": "Prophet",
                    "resample_at_td": "1h",
                    "gaps_gte": "3h",
                    "gaps_lte": "3d"
                }
            ]
        ]
    }
}

plumber.pipe_dict = pipe_dict

Get pipeline using get_pipeline method.

plumber.get_pipeline(verbose=True)

Get pipelines for specific columns

plumber.get_pipeline(select="Building", verbose=True)

Visualize pipeline effects:

plumber.plot(
    steps=None,
    plot_gaps=True,
    steps_2=slice(None, "interpolate_temps"),
    plot_gaps_2=True,
    verbose=True
)

Step Arguments:

  • None: No operation (Identity)
  • str: Process until named step
  • list[str]: Perform specified steps
  • slice: Process a slice of the pipeline

Compare full pipeline to raw data:

plumber.plot(
    steps=None,
    plot_gaps=True,
    steps_2=slice(None),
    plot_gaps_2=True,
    verbose=True
)

Sponsors

eu_flag The development of this library has been supported by ENSNARE Project, which has received funding from the European Union’s Horizon 2020 Research and Innovation Programme under Grant Agreement No. 953193. The sole responsibility for the content of this library lies entirely with the author’s view. The European Commission is not responsible for any use that may be made of the information it contains.

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

python_tide-0.1.4.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

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

python_tide-0.1.4-py3-none-any.whl (47.7 kB view details)

Uploaded Python 3

File details

Details for the file python_tide-0.1.4.tar.gz.

File metadata

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

File hashes

Hashes for python_tide-0.1.4.tar.gz
Algorithm Hash digest
SHA256 08871a9e7a5857374d19f8bcd3e380f9e1f67ae93fd95d5a4dd327aadfc209fb
MD5 93ac5f9e52f565feefad3e0fa2d4e3b6
BLAKE2b-256 39c5c98c3e80d6d3fc6c8066953fe8c9125579f56fa33f6845dcb98ca730e505

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_tide-0.1.4.tar.gz:

Publisher: build.yaml on BuildingEnergySimulationTools/tide

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

File details

Details for the file python_tide-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: python_tide-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 47.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for python_tide-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b8a1c2198af641f5bd5bbdef95cf9923c36d2a8800022c57e024f3e58d60ffa3
MD5 c66abb79566fc01866889b96fcb14d7f
BLAKE2b-256 0f7beb1944c152eedfd8478822202202215ddce198c99d244aa71ff6e380fb40

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_tide-0.1.4-py3-none-any.whl:

Publisher: build.yaml on BuildingEnergySimulationTools/tide

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