Skip to main content

Clipping detection helpers for the solar plant rule engine

Project description

pvclipping

Inverter clipping detection helper for the solar plant rule engine.

Install

pip install pvclipping

Usage with RuleParser

from pvclipping import get_custom_funcs

parser = RuleParser(
    plant_id=...,
    meter_dim=meter_dim,
    postgres_engine=engine,
    influx_engine=clickhouse,
    reading_dim=reading_dim,
    custom_func=get_custom_funcs(),
)

Rule JSON

{
  "steps": [
    {
      "name": "irr_filter#GLOBAL",
      "type": "filter",
      "value": "$$Tilt_Irr#GLOBAL$$ > 400"
    },
    {
      "name": "Power_Active#INV",
      "value": "$$Power_Active#INV$$.round(0)",
      "filter": "irr_filter#GLOBAL",
      "all_ticks": true
    },
    {
      "name": "AC_Capacity#INV",
      "value": "$$AC_Capacity#INV$$",
      "all_ticks": true,
      "fill_missing": true
    },
    {
      "name": "Clipping_status#INV",
      "value": "detect_clipping(df['Power_Active#INV'], df['AC_Capacity#INV'])",
      "eval_meter": true
    },
    {
      "name": "Clipping_status_F#INV",
      "type": "filter",
      "value": "$$Clipping_status#INV$$ > 0"
    }
  ],
  "output": ["Clipping_status_F#INV"]
}

Function signature

detect_clipping(
    power,               # pd.Series — active power, pre-filtered to evaluation window
    capacity,            # pd.Series — AC capacity, forward-filled
    window=5,            # rolling window size in ticks
    std_threshold=1.0,   # max rolling std (kW) to qualify as a flat plateau
    min_power_fraction=0.2,  # min power fraction of capacity to exclude standby
)

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

pvclipping-0.1.1.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

pvclipping-0.1.1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file pvclipping-0.1.1.tar.gz.

File metadata

  • Download URL: pvclipping-0.1.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.12

File hashes

Hashes for pvclipping-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f40403b79fa234bc4c2e1f4102bf653f170421fb4e13c89bd7697577cdb00ada
MD5 9acc95ca9280b1489e70e6c4313ebd0d
BLAKE2b-256 30a003334e37fd11a8ac470882d7ef5679b1ab4c4f141ac94aeb59da586e50d8

See more details on using hashes here.

File details

Details for the file pvclipping-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pvclipping-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.12

File hashes

Hashes for pvclipping-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d88c5f55441f77d3dc100cf38104538ef7e222c7fe6a4e45a766abe410ea49e
MD5 7126f927ac64d2d6adefe84df42a6bff
BLAKE2b-256 a5e397ca5da16fb79ce26cf61e0326ce91148a224575803c9df6bfe7a6e67dba

See more details on using hashes here.

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