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.2.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.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pvclipping-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 7e19ccff11676eaf83a98582a055fbd9d1957b1afb10636d2b30fc6e8bd72753
MD5 4df363a2c1babf50e302de1432e1ce59
BLAKE2b-256 1a0e45468ada48df92f30121172a53f8c5ccf0f790d367bd7129985a5329c2d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pvclipping-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3af3989e4a38c99ec943fb0ec7801db79d17c93b7c7660a3765dc1341da0335a
MD5 1b832e4e97918ed4c570b14eb74aabb7
BLAKE2b-256 99774aab39e3fcdd50872b7a0607d8ecbc5c303e474cfb9a15524fac6f6b7f5f

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