Spaces:
Sleeping
Sleeping
File size: 3,956 Bytes
fd0bd3b 2f1129f fd0bd3b 0d542b0 fd0bd3b e6a4103 2f1129f 0d542b0 2f1129f fd0bd3b 2f1129f fd0bd3b 2f1129f fd0bd3b 2f1129f e6a4103 2f1129f fd0bd3b 2f1129f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | import os
from datetime import date
# ββ FPPDAILY (4-second SCADA) ββββββββββββββββββββββββββββββββββββββββββββββββ
AEMO_CURRENT_URL = "https://www.nemweb.com.au/REPORTS/Current/FPPDAILY/"
AEMO_ARCHIVE_URL = "https://nemweb.com.au/Reports/Archive/FPPDAILY/"
# Data availability: AEMO has rolled off the early Era 1 archive bundles.
# The oldest archive bundle currently on NEMWEB is PUBLIC_NEXT_DAY_FPP_20250430.zip
# whose first inner file is publication 30 Apr 2025 = settlement 29 Apr 2025
# (the first day of Era 2 in our era model). FPPMW Format-1 bundles start the
# same day. So 29 Apr 2025 is the earliest settlement date for which any
# FPPDAILY data can still be fetched.
#
# The FPP scheme itself commenced on 28 Feb 2025, but the Era 1 monthly
# bundles (Dec 2024 β 28 Apr 2025) have all been rolled off the archive.
DATA_START_DATE = date(2025, 4, 29)
# From this date onward, data is served as individual daily ZIPs from the
# Current directory (faster). Before this date, large archive bundles are
# used (slower). This cutover is also sent to the frontend so both sides
# classify requests consistently.
FPPMW_CUTOVER_DATE = date(2026, 1, 11)
# ββ Next_Day_Dispatch (5-minute energy storage) ββββββββββββββββββββββββββββββ
DISPATCH_CURRENT_URL = "https://nemweb.com.au/Reports/Current/Next_Day_Dispatch/"
DISPATCH_ARCHIVE_URL = "https://www.nemweb.com.au/REPORTS/ARCHIVE/Next_Day_Dispatch/"
# Dispatch data: the oldest archive bundle on NEMWEB is
# PUBLIC_NEXT_DAY_DISPATCH_20250401.zip (covering settlement dates
# 1 Apr 2025 β 30 Apr 2025). The INITIAL_ENERGY_STORAGE column has existed
# since 11 Feb 2025, but earlier monthly bundles have been rolled off.
DISPATCH_START_DATE = date(2025, 4, 1)
# ββ Request limits ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
MAX_DAYS_PER_REQUEST = 1
# ββ HTTP timeouts (seconds) βββββββββββββββββββββββββββββββββββββββββββββββββββ
AEMO_CONNECT_TIMEOUT = 15
AEMO_READ_TIMEOUT = 60
# ββ Analytics βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ANALYTICS_TOKEN = os.environ.get("ANALYTICS_TOKEN", "changeme")
ANALYTICS_DB_PATH = "/tmp/analytics.db"
# ββ Timing estimates ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Minimum successful samples before the learned p75 estimate replaces the default.
TIMING_MIN_SAMPLES = 5
# SCADA (FPPDAILY) defaults
TIMING_DEFAULT_CURRENT_SEC = 120 # ~2 min β daily file from Current dir
TIMING_DEFAULT_ARCHIVE_SEC = 480 # ~8 min β archive bundle (remotezip)
# Dispatch (Next_Day_Dispatch) defaults
TIMING_DEFAULT_DISPATCH_CURRENT_SEC = 60 # ~1 min β daily file from Current dir
TIMING_DEFAULT_DISPATCH_ARCHIVE_SEC = 300 # ~5 min β monthly archive (remotezip)
# ββ Column lists ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Columns to keep from the SCADA CSV (unit identifier used only for filtering)
REQUIRED_COLUMNS = [
"INTERVAL_DATETIME",
"MEASUREMENT_DATETIME",
"MEASURED_MW",
"MW_QUALITY_FLAG",
]
# Columns to keep from the dispatch UNIT_SOLUTION CSV
DISPATCH_COLUMNS = [
"SETTLEMENTDATE",
"INITIALMW",
"INITIAL_ENERGY_STORAGE",
"ENERGY_STORAGE",
]
|