Dataset Reference
This page explains how to build simulator-compatible datasets, including CSV, Parquet, real power data in kW, EVs, absolute PV, normalized deferrable appliances and demand-response requests.
Supported File Formats
Format |
Extensions |
Loader |
When to use |
|---|---|---|---|
CSV |
|
|
Small/medium datasets and easy inspection. |
Parquet |
|
|
Large datasets, 15s data, many assets or full-year runs. |
CSV and Parquet are interchangeable when the schema path is updated and columns, units and types remain equivalent.
Public datasets and local data
Resolve available names with DataSet().get_dataset_names() or use the CLI after
installing its dependencies. Pass a dataset name to CityLearnEnv for automatic
download and caching, or pass your own local schema.json path. Use
offline=True with locally available files to disable network fallbacks.
Unit Contract
Data |
Expected unit |
|---|---|
Load and consumption series |
kWh/step |
PV with |
kWh/step |
PV with |
W/kW |
BESS and charger power limits |
kW |
EV required/estimated SOC in charger files |
percent in the raw file, converted to ratio internally |
Prices |
currency/kWh |
DR request target power |
kW |
DR request prices and penalties |
currency/kWh |
Carbon intensity |
kgCO2/kWh |
Weather temperature |
C |
Irradiance |
W/m2 |
Real power data must be converted before writing energy columns:
kWh_per_step = kW * seconds_per_time_step / 3600
kW = kWh_per_step * 3600 / seconds_per_time_step
For 15 seconds:
1 kW during 15s = 1 * 15 / 3600 = 0.0041666667 kWh
energy_simulation Columns
Column |
Required |
Unit |
Meaning |
|---|---|---|---|
|
yes |
1-12 |
Month. |
|
yes |
1-24 |
Hour. |
|
yes |
1-8 |
Day of week or special day. |
|
recommended sub-hour |
0-59 |
Minute. |
|
recommended sub-minute |
0-59 |
Second. |
|
yes |
C |
Indoor temperature. |
|
yes |
kWh/step |
Non-flexible load. |
|
yes |
kWh/step |
Domestic hot water demand. |
|
yes |
kWh/step |
Cooling demand. |
|
yes |
kWh/step |
Heating demand. |
|
yes |
depends on PV mode |
PV input. |
|
no |
0/1 |
DST. |
|
no |
C |
Cooling discomfort. |
|
no |
percent |
Indoor humidity. |
|
no |
people |
Occupancy. |
|
no |
C |
Cooling setpoint. |
|
no |
C |
Heating setpoint. |
|
no |
enum |
0 off, 1 cooling, 2 heating, 3 auto. |
|
no |
0/1 |
Outage flag. |
|
no |
C |
Comfort band. |
Cooling and heating demand cannot both be positive in the same timestep.
Weather, Pricing and Carbon Files
File |
Required columns |
Units |
|---|---|---|
|
|
C, percent, W/m2 |
|
|
currency/kWh |
|
|
kgCO2/kWh |
Charger Simulation Columns
Column |
Unit/format |
Meaning |
|---|---|---|
|
enum |
1 connected, 2 incoming, 3 away/commuting. |
|
string |
EV ID. |
|
steps |
Steps until departure. Internal default |
|
percent |
Required departure SOC. Converted to ratio. |
|
steps |
Steps until arrival. Internal default |
|
percent |
Estimated arrival SOC. Converted to ratio. |
|
percent or ratio |
Optional current-SOC telemetry. In the annual REC suite this is a neutral constant-rate boundary-initialization reference, used only when an episode starts inside an occupied session; it does not override SOC during an uninterrupted rollout. |
For sub-hourly datasets, countdown fields must be expressed in timesteps at the dataset resolution. Example: 1 hour at 15s is 240 steps.
Entity Observation Bundles in Packaged Datasets
The packaged 15-second entity datasets and citylearn_challenge_2022_phase_all_plus_evs opt in to all entity observation bundles:
Bundle |
Purpose |
|---|---|
|
Physical power, energy, SOC and asset capability descriptors. |
|
Community power, headroom and flexible capacity aggregates. |
|
Existing dataset |
|
Compact point forecasts; the annual REC suite uses causal daily persistence for load/PV and publication-aware OMIE prices. |
|
Robust calendar and short lag features. |
|
Requested, limited and applied action feedback with clipping reasons. |
|
Current district demand-response request, baseline and previous delivery/shortfall. |
|
Active robustness state and previous-step corruption counters. |
Other schemas keep the default-compatible behavior unless they declare observation_bundles.
Demand Response Request Files
Demand-response datasets set schema["demand_response"]["enabled"] = true, point requests_file to a CSV or Parquet file, use interface="entity" and normally enable observation_bundles.entity_demand_response.
Column |
Unit/domain |
Meaning |
|---|---|---|
|
string |
Unique request ID. |
|
|
Request issuer. |
|
|
Load perspective: |
|
global timestep |
Inclusive activation window. |
|
kW |
Positive community/district power target. |
|
currency/kWh |
Payment for credited delivered energy. |
|
currency/kWh |
Penalty for shortfall energy. |
|
kW |
Optional tolerance; defaults to |
The v1 simulator computes a frozen baseline at event start from the previous baseline_window_seconds, settles only active request steps, and keeps history sparse instead of writing dense per-timestep arrays.
Robustness Event Files
Robustness datasets set schema["robustness"]["enabled"] = true, point events_file to a CSV or Parquet file, and enable only the modules they want to study. Flat and entity interfaces are supported; entity datasets can add observation_bundles.entity_robustness for diagnostics.
Column |
Unit/domain |
Meaning |
|---|---|---|
|
string |
Unique event ID. |
|
enum |
|
|
entity type |
|
|
id or |
Entity id/name or all compatible targets. |
|
feature/action |
For assets use |
|
global timestep |
Inclusive event window. |
|
enum |
Mode supported by the selected module. |
|
optional |
Mode parameters. |
Deferrable Appliances
The official format is sparse: a cycle profile catalog plus a flexibility request schedule. Do not repeat the full load_profile at every timestep.
cycle_profiles_file
Column |
Unit |
Meaning |
|---|---|---|
|
string |
Profile ID. |
|
steps |
Cycle duration. |
|
kWh |
Sum of the profile. |
|
list of kWh/step |
Step energy profile. |
Validation:
Check |
Rule |
|---|---|
|
Non-empty and unique. |
|
Integer > 0. |
|
Non-empty, finite and non-negative. |
Sum |
|
flexibility_schedule_file
Column |
Unit |
Meaning |
|---|---|---|
|
string |
Unique request/cycle ID. |
|
string |
Reference to the profile catalog. |
|
global timestep |
First allowed start. |
|
global timestep |
Last allowed start. |
|
global timestep |
Completion deadline. |
|
ratio |
Priority 0-1, clipped. |
|
bool |
Mandatory request flag. |
Validation:
Check |
Rule |
|---|---|
|
Unique and non-empty. |
|
Must exist in the catalog. |
Windows |
|
Deadline |
|
Timesteps |
Global integer indices >= 0. |
PV Datasets
Case |
Schema |
|
|---|---|---|
Real/measured generation |
|
|
Normalized profile |
|
|
For real production datasets, absolute is the recommended mode.
15-Second Datasets
Topic |
Recommendation |
|---|---|
|
|
Real power data |
Convert kW to kWh/step before writing dataset energy columns. |
Real PV |
Write kWh/step and use |
EV countdowns |
Express |
Large files |
Prefer Parquet. |
Pre-training smoke test |
Run a short window and call |
Compact dynamic-assets example |
|
Demand-response example |
|
Robustness example |
|
Performance and Loader Behavior
Optimization |
Effect |
|---|---|
Windowed CSV |
Uses |
Windowed Parquet |
Reads batches and slices rows. |
Shared cache |
Reuses weather/pricing/carbon when several buildings point to the same file and |
Parquet |
Smaller files, typed reads and better large-dataset behavior. |
New Dataset Checklist
Define
seconds_per_time_step.Convert measured power to
kWh/stepwhere the simulator expects energy.Choose PV
absoluteorper_kw.Ensure EV schedules use countdowns in dataset timesteps.
Write deferrables as catalog plus schedule.
For demand response, write a sparse request file and enable entity mode plus
entity_demand_response.For robustness, write sparse event files and enable only the needed modules.
Prefer Parquet for annual or sub-minute datasets.
Run a smoke episode and
evaluate_v2().Run
audit_physics.pyfor new critical datasets.