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.0.tar.gz (1.8 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.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pvclipping-0.1.0.tar.gz
  • Upload date:
  • Size: 1.8 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.0.tar.gz
Algorithm Hash digest
SHA256 5511ef8f395c387eaf42107c3a1900c57c40b8bed7d82fbaacc052bddd04f644
MD5 2cb830e2b401696abc86996949e91280
BLAKE2b-256 e5d8cae9d26b9277c54f302a1a91c615fc3d73fab0e6d2586abb253993e94bad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pvclipping-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34a2591f6fc052a20391597b2673124122a471fb817d12da00594a733474795e
MD5 8eedff8d2276a74884ac8be32cc96fd7
BLAKE2b-256 4daed0ced2feee833b7ea4179289fe4154a0124b874ca41278bbcaab050a3db0

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