softcpsrecsimulator 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- softcpsrecsimulator-0.1.0/LICENSE +21 -0
- softcpsrecsimulator-0.1.0/MANIFEST.in +3 -0
- softcpsrecsimulator-0.1.0/PKG-INFO +174 -0
- softcpsrecsimulator-0.1.0/README.md +134 -0
- softcpsrecsimulator-0.1.0/citylearn/__init__.py +1 -0
- softcpsrecsimulator-0.1.0/citylearn/__main__.py +506 -0
- softcpsrecsimulator-0.1.0/citylearn/agents/__init__.py +0 -0
- softcpsrecsimulator-0.1.0/citylearn/agents/base.py +285 -0
- softcpsrecsimulator-0.1.0/citylearn/agents/marlisa.py +495 -0
- softcpsrecsimulator-0.1.0/citylearn/agents/q_learning.py +169 -0
- softcpsrecsimulator-0.1.0/citylearn/agents/rbc.py +515 -0
- softcpsrecsimulator-0.1.0/citylearn/agents/rlc.py +240 -0
- softcpsrecsimulator-0.1.0/citylearn/agents/sac.py +318 -0
- softcpsrecsimulator-0.1.0/citylearn/assets/building-0-charge-0.png +0 -0
- softcpsrecsimulator-0.1.0/citylearn/assets/building-0-charge-1.png +0 -0
- softcpsrecsimulator-0.1.0/citylearn/assets/building-0-charge-2.png +0 -0
- softcpsrecsimulator-0.1.0/citylearn/assets/building-0-charge-3.png +0 -0
- softcpsrecsimulator-0.1.0/citylearn/assets/building-1-charge-0.png +0 -0
- softcpsrecsimulator-0.1.0/citylearn/assets/building-1-charge-1.png +0 -0
- softcpsrecsimulator-0.1.0/citylearn/assets/building-1-charge-2.png +0 -0
- softcpsrecsimulator-0.1.0/citylearn/assets/building-1-charge-3.png +0 -0
- softcpsrecsimulator-0.1.0/citylearn/assets/glow.png +0 -0
- softcpsrecsimulator-0.1.0/citylearn/assets/grid.png +0 -0
- softcpsrecsimulator-0.1.0/citylearn/base.py +285 -0
- softcpsrecsimulator-0.1.0/citylearn/building.py +3139 -0
- softcpsrecsimulator-0.1.0/citylearn/citylearn.py +1429 -0
- softcpsrecsimulator-0.1.0/citylearn/cost_function.py +388 -0
- softcpsrecsimulator-0.1.0/citylearn/data.py +827 -0
- softcpsrecsimulator-0.1.0/citylearn/dynamics.py +143 -0
- softcpsrecsimulator-0.1.0/citylearn/electric_vehicle.py +162 -0
- softcpsrecsimulator-0.1.0/citylearn/electric_vehicle_charger.py +486 -0
- softcpsrecsimulator-0.1.0/citylearn/end_use_load_profiles/__init__.py +0 -0
- softcpsrecsimulator-0.1.0/citylearn/end_use_load_profiles/clustering.py +191 -0
- softcpsrecsimulator-0.1.0/citylearn/end_use_load_profiles/lstm_model/__init__.py +0 -0
- softcpsrecsimulator-0.1.0/citylearn/end_use_load_profiles/lstm_model/model.py +44 -0
- softcpsrecsimulator-0.1.0/citylearn/end_use_load_profiles/lstm_model/model_generation.py +214 -0
- softcpsrecsimulator-0.1.0/citylearn/end_use_load_profiles/lstm_model/model_generation_wrapper.py +40 -0
- softcpsrecsimulator-0.1.0/citylearn/end_use_load_profiles/lstm_model/preprocessing.py +142 -0
- softcpsrecsimulator-0.1.0/citylearn/end_use_load_profiles/neighborhood.py +830 -0
- softcpsrecsimulator-0.1.0/citylearn/end_use_load_profiles/simulate.py +231 -0
- softcpsrecsimulator-0.1.0/citylearn/energy_model.py +1399 -0
- softcpsrecsimulator-0.1.0/citylearn/exporter.py +424 -0
- softcpsrecsimulator-0.1.0/citylearn/internal/__init__.py +1 -0
- softcpsrecsimulator-0.1.0/citylearn/internal/building_ops.py +943 -0
- softcpsrecsimulator-0.1.0/citylearn/internal/kpi.py +862 -0
- softcpsrecsimulator-0.1.0/citylearn/internal/loading.py +653 -0
- softcpsrecsimulator-0.1.0/citylearn/internal/runtime.py +474 -0
- softcpsrecsimulator-0.1.0/citylearn/misc/queries/create_zone_metadata.sql +26 -0
- softcpsrecsimulator-0.1.0/citylearn/misc/queries/select_citylearn_energy_simulation.sql +107 -0
- softcpsrecsimulator-0.1.0/citylearn/misc/queries/select_citylearn_weather.sql +12 -0
- softcpsrecsimulator-0.1.0/citylearn/misc/queries/select_ideal_loads.sql +24 -0
- softcpsrecsimulator-0.1.0/citylearn/misc/queries/select_lstm_training_data.sql +96 -0
- softcpsrecsimulator-0.1.0/citylearn/misc/queries/select_zone_conditioning_metadata.sql +47 -0
- softcpsrecsimulator-0.1.0/citylearn/misc/settings.yaml +354 -0
- softcpsrecsimulator-0.1.0/citylearn/occupant.py +99 -0
- softcpsrecsimulator-0.1.0/citylearn/power_outage.py +170 -0
- softcpsrecsimulator-0.1.0/citylearn/preprocessing.py +173 -0
- softcpsrecsimulator-0.1.0/citylearn/reward_function.py +523 -0
- softcpsrecsimulator-0.1.0/citylearn/rl.py +133 -0
- softcpsrecsimulator-0.1.0/citylearn/utilities.py +175 -0
- softcpsrecsimulator-0.1.0/citylearn/wrappers.py +857 -0
- softcpsrecsimulator-0.1.0/requirements.txt +11 -0
- softcpsrecsimulator-0.1.0/setup.cfg +4 -0
- softcpsrecsimulator-0.1.0/setup.py +47 -0
- softcpsrecsimulator-0.1.0/softcpsrecsimulator.egg-info/PKG-INFO +174 -0
- softcpsrecsimulator-0.1.0/softcpsrecsimulator.egg-info/SOURCES.txt +81 -0
- softcpsrecsimulator-0.1.0/softcpsrecsimulator.egg-info/dependency_links.txt +1 -0
- softcpsrecsimulator-0.1.0/softcpsrecsimulator.egg-info/entry_points.txt +2 -0
- softcpsrecsimulator-0.1.0/softcpsrecsimulator.egg-info/requires.txt +11 -0
- softcpsrecsimulator-0.1.0/softcpsrecsimulator.egg-info/top_level.txt +1 -0
- softcpsrecsimulator-0.1.0/tests/test_charging_constraints_dataset.py +49 -0
- softcpsrecsimulator-0.1.0/tests/test_charging_constraints_e2e.py +56 -0
- softcpsrecsimulator-0.1.0/tests/test_electrical_service_and_market.py +352 -0
- softcpsrecsimulator-0.1.0/tests/test_ev_arrivals.py +132 -0
- softcpsrecsimulator-0.1.0/tests/test_ev_charger_unit.py +114 -0
- softcpsrecsimulator-0.1.0/tests/test_ev_soc_behavior.py +151 -0
- softcpsrecsimulator-0.1.0/tests/test_evs.py +87 -0
- softcpsrecsimulator-0.1.0/tests/test_internal_refactor_parity.py +86 -0
- softcpsrecsimulator-0.1.0/tests/test_kpi_v2.py +414 -0
- softcpsrecsimulator-0.1.0/tests/test_kpis.py +196 -0
- softcpsrecsimulator-0.1.0/tests/test_rl_temporal_semantics.py +101 -0
- softcpsrecsimulator-0.1.0/tests/test_scenario_smoke.py +127 -0
- softcpsrecsimulator-0.1.0/tests/test_series_integrity.py +54 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Jose Ramon Vazquez-Canteli, Intelligent Environments Laboratory
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: softcpsrecsimulator
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: An open source Farama Foundation Gymnasium environment for benchmarking distributed energy resource control algorithms to provide energy flexibility in a district of buildings.
|
|
5
|
+
Home-page: https://github.com/Soft-CPS-Research-Group/Simulator
|
|
6
|
+
Author: Soft-CPS Research Group, Jose Ramon Vazquez-Canteli, Kingsley Nweye, Zoltan Nagy
|
|
7
|
+
Author-email: jose@isep.ipp.pt
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Source, https://github.com/Soft-CPS-Research-Group/Simulator
|
|
10
|
+
Project-URL: Original Project, https://github.com/intelligent-environments-lab/CityLearn
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: doe_xstock>=1.1.0
|
|
18
|
+
Requires-Dist: gymnasium<=0.28.1
|
|
19
|
+
Requires-Dist: nrel-pysam
|
|
20
|
+
Requires-Dist: numpy<2.0.0
|
|
21
|
+
Requires-Dist: pandas
|
|
22
|
+
Requires-Dist: pyyaml
|
|
23
|
+
Requires-Dist: scikit-learn<=1.2.2
|
|
24
|
+
Requires-Dist: simplejson
|
|
25
|
+
Requires-Dist: torch
|
|
26
|
+
Requires-Dist: torchvision
|
|
27
|
+
Requires-Dist: openstudio<=3.3.0
|
|
28
|
+
Dynamic: author
|
|
29
|
+
Dynamic: author-email
|
|
30
|
+
Dynamic: classifier
|
|
31
|
+
Dynamic: description
|
|
32
|
+
Dynamic: description-content-type
|
|
33
|
+
Dynamic: home-page
|
|
34
|
+
Dynamic: license
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
Dynamic: project-url
|
|
37
|
+
Dynamic: requires-dist
|
|
38
|
+
Dynamic: requires-python
|
|
39
|
+
Dynamic: summary
|
|
40
|
+
|
|
41
|
+
# CityLearn
|
|
42
|
+
CityLearn is an open source Farama Foundation Gymnasium environment for the implementation of Multi-Agent Reinforcement Learning (RL) for building energy coordination and demand response in cities. A major challenge for RL in demand response is the ability to compare algorithm performance. Thus, CityLearn facilitates and standardizes the evaluation of RL agents such that different algorithms can be easily compared with each other.
|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+
## Environment Overview
|
|
47
|
+
|
|
48
|
+
CityLearn includes energy models of buildings and distributed energy resources (DER) including air-to-water heat pumps, electric heaters and batteries. A collection of building energy models makes up a virtual district (a.k.a neighborhood or community). In each building, space cooling, space heating and domestic hot water end-use loads may be independently satisfied through air-to-water heat pumps. Alternatively, space heating and domestic hot water loads can be satisfied through electric heaters.
|
|
49
|
+
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
Install latest release in PyPi with `pip`:
|
|
54
|
+
```console
|
|
55
|
+
pip install softcpsrecsimulator
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Python import path remains:
|
|
59
|
+
```python
|
|
60
|
+
from citylearn.citylearn import CityLearnEnv
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Developer Commands
|
|
64
|
+
Use the repository virtual environment when available:
|
|
65
|
+
|
|
66
|
+
```console
|
|
67
|
+
.venv/bin/pytest -q
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Critical lint checks used in CI:
|
|
71
|
+
|
|
72
|
+
```console
|
|
73
|
+
.venv/bin/python -m ruff check citylearn tests scripts/manual scripts/ci --select E9,F821
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Manual utility scripts live in `scripts/manual` and are excluded from default pytest collection:
|
|
77
|
+
|
|
78
|
+
```console
|
|
79
|
+
python scripts/manual/demo_ev_rbc.py
|
|
80
|
+
python scripts/manual/demo_ev_rbc_export_end.py
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Runtime benchmark (main training resolutions 5s/60s):
|
|
84
|
+
|
|
85
|
+
```console
|
|
86
|
+
python scripts/manual/bench_runtime.py --seconds 5 60 --render-modes none end --episode-steps 1200
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
CI performance smoke check command:
|
|
90
|
+
|
|
91
|
+
```console
|
|
92
|
+
python scripts/ci/perf_smoke.py --episode-steps 600 --seconds 60 --baseline-file scripts/ci/perf_baseline.json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Publish This Fork to PyPI
|
|
96
|
+
This fork is configured to publish the distribution name `softcpsrecsimulator`.
|
|
97
|
+
|
|
98
|
+
1. Create the package on PyPI (project name: `softcpsrecsimulator`).
|
|
99
|
+
2. In GitHub repo settings, add secret `PYPI_API_TOKEN` with a PyPI token that can publish this project.
|
|
100
|
+
3. Bump `citylearn/__init__.py` version.
|
|
101
|
+
4. Push commit and create a GitHub Release (or run `Publish Python Package` workflow manually).
|
|
102
|
+
5. Workflow `.github/workflows/pypi_deploy.yml` builds `dist/*` and uploads to PyPI.
|
|
103
|
+
|
|
104
|
+
Optional local build check:
|
|
105
|
+
```console
|
|
106
|
+
python -m pip install --upgrade pip build twine
|
|
107
|
+
python -m build
|
|
108
|
+
python -m twine check dist/*
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Internal Architecture
|
|
112
|
+
Public APIs remain in `CityLearnEnv` and `Building`, while internal orchestration is split into service modules under `citylearn/internal`:
|
|
113
|
+
|
|
114
|
+
- `loading.py`: schema-driven loading/build assembly (`_load*`, metadata processing).
|
|
115
|
+
- `runtime.py`: episode runtime orchestration (`step`, action parsing, time progression, EV/charger association).
|
|
116
|
+
- `building_ops.py`: building observation/action orchestration.
|
|
117
|
+
- `kpi.py`: KPI/evaluation pipeline.
|
|
118
|
+
|
|
119
|
+
## Export and Render Modes
|
|
120
|
+
`CityLearnEnv` keeps export off by default:
|
|
121
|
+
|
|
122
|
+
- `render_mode='none'`: no CSV export and minimal runtime overhead.
|
|
123
|
+
- `render_mode='during'`: writes CSV rows at each environment step.
|
|
124
|
+
- `render_mode='end'`: keeps the rollout fast and writes full episode CSVs when the episode ends.
|
|
125
|
+
|
|
126
|
+
Optional location controls:
|
|
127
|
+
|
|
128
|
+
- `render_directory`: base folder for exports.
|
|
129
|
+
- `render_session_name`: session subfolder name under `render_directory` (or `render_directory_name`).
|
|
130
|
+
- `render_directory_name`: legacy fallback folder under project root when `render_directory` is not set.
|
|
131
|
+
- `render`: legacy boolean flag; still supported for compatibility.
|
|
132
|
+
|
|
133
|
+
Examples:
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
from citylearn.citylearn import CityLearnEnv
|
|
137
|
+
|
|
138
|
+
# Fast training/no export
|
|
139
|
+
env = CityLearnEnv(schema, render_mode='none')
|
|
140
|
+
|
|
141
|
+
# Stream CSVs every step
|
|
142
|
+
env = CityLearnEnv(
|
|
143
|
+
schema,
|
|
144
|
+
render_mode='during',
|
|
145
|
+
render_directory='outputs',
|
|
146
|
+
render_session_name='run_during'
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
# Export once at episode end
|
|
150
|
+
env = CityLearnEnv(
|
|
151
|
+
schema,
|
|
152
|
+
render_mode='end',
|
|
153
|
+
render_directory='outputs',
|
|
154
|
+
render_session_name='run_end'
|
|
155
|
+
)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Documentation
|
|
159
|
+
Refer to the [docs](https://intelligent-environments-lab.github.io/CityLearn/).
|
|
160
|
+
|
|
161
|
+
## CityLearn UI
|
|
162
|
+
|
|
163
|
+
CityLearn UI is a visual dashboard for exploring simulation data generated by the CityLearn framework. It was developed to simplify the analysis of results from smart energy communities, district energy coordination, demand response (among other applications), allowing users to visually inspect building-level components, compare simulation KPIs, and create simulation schemas with ease.
|
|
164
|
+
|
|
165
|
+
The interface is available in two options:
|
|
166
|
+
|
|
167
|
+
* Web app: https://citylearnui.netlify.app/ (free hosted version — not recommended for sensitive/personal data)
|
|
168
|
+
* Open-source code: https://github.com/Soft-CPS-Research-Group/citylearn-ui
|
|
169
|
+
|
|
170
|
+
You can check a tutorial at the official CityLearn [website](https://intelligent-environments-lab.github.io/CityLearn/ui.html), in the CityLearn UI repository [README](https://github.com/Soft-CPS-Research-Group/citylearn-ui), or at the help [tooltip of the oficial webapp](https://citylearn-ui.netlify.app/admin/help).
|
|
171
|
+
|
|
172
|
+
**Compatibility:** This version of the UI currently supports CityLearn v2.5.0 simulation data.
|
|
173
|
+
|
|
174
|
+
**Developed by:** José, a member of the [SoftCPS](https://www2.isep.ipp.pt/softcps/), Software for Cyber-Physical Systems research group (ISEP, Portugal) in collaboration with the Intelligent Environments Lab, University of Texas at Austin.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# CityLearn
|
|
2
|
+
CityLearn is an open source Farama Foundation Gymnasium environment for the implementation of Multi-Agent Reinforcement Learning (RL) for building energy coordination and demand response in cities. A major challenge for RL in demand response is the ability to compare algorithm performance. Thus, CityLearn facilitates and standardizes the evaluation of RL agents such that different algorithms can be easily compared with each other.
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
## Environment Overview
|
|
7
|
+
|
|
8
|
+
CityLearn includes energy models of buildings and distributed energy resources (DER) including air-to-water heat pumps, electric heaters and batteries. A collection of building energy models makes up a virtual district (a.k.a neighborhood or community). In each building, space cooling, space heating and domestic hot water end-use loads may be independently satisfied through air-to-water heat pumps. Alternatively, space heating and domestic hot water loads can be satisfied through electric heaters.
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
Install latest release in PyPi with `pip`:
|
|
14
|
+
```console
|
|
15
|
+
pip install softcpsrecsimulator
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Python import path remains:
|
|
19
|
+
```python
|
|
20
|
+
from citylearn.citylearn import CityLearnEnv
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Developer Commands
|
|
24
|
+
Use the repository virtual environment when available:
|
|
25
|
+
|
|
26
|
+
```console
|
|
27
|
+
.venv/bin/pytest -q
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Critical lint checks used in CI:
|
|
31
|
+
|
|
32
|
+
```console
|
|
33
|
+
.venv/bin/python -m ruff check citylearn tests scripts/manual scripts/ci --select E9,F821
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Manual utility scripts live in `scripts/manual` and are excluded from default pytest collection:
|
|
37
|
+
|
|
38
|
+
```console
|
|
39
|
+
python scripts/manual/demo_ev_rbc.py
|
|
40
|
+
python scripts/manual/demo_ev_rbc_export_end.py
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Runtime benchmark (main training resolutions 5s/60s):
|
|
44
|
+
|
|
45
|
+
```console
|
|
46
|
+
python scripts/manual/bench_runtime.py --seconds 5 60 --render-modes none end --episode-steps 1200
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
CI performance smoke check command:
|
|
50
|
+
|
|
51
|
+
```console
|
|
52
|
+
python scripts/ci/perf_smoke.py --episode-steps 600 --seconds 60 --baseline-file scripts/ci/perf_baseline.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Publish This Fork to PyPI
|
|
56
|
+
This fork is configured to publish the distribution name `softcpsrecsimulator`.
|
|
57
|
+
|
|
58
|
+
1. Create the package on PyPI (project name: `softcpsrecsimulator`).
|
|
59
|
+
2. In GitHub repo settings, add secret `PYPI_API_TOKEN` with a PyPI token that can publish this project.
|
|
60
|
+
3. Bump `citylearn/__init__.py` version.
|
|
61
|
+
4. Push commit and create a GitHub Release (or run `Publish Python Package` workflow manually).
|
|
62
|
+
5. Workflow `.github/workflows/pypi_deploy.yml` builds `dist/*` and uploads to PyPI.
|
|
63
|
+
|
|
64
|
+
Optional local build check:
|
|
65
|
+
```console
|
|
66
|
+
python -m pip install --upgrade pip build twine
|
|
67
|
+
python -m build
|
|
68
|
+
python -m twine check dist/*
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Internal Architecture
|
|
72
|
+
Public APIs remain in `CityLearnEnv` and `Building`, while internal orchestration is split into service modules under `citylearn/internal`:
|
|
73
|
+
|
|
74
|
+
- `loading.py`: schema-driven loading/build assembly (`_load*`, metadata processing).
|
|
75
|
+
- `runtime.py`: episode runtime orchestration (`step`, action parsing, time progression, EV/charger association).
|
|
76
|
+
- `building_ops.py`: building observation/action orchestration.
|
|
77
|
+
- `kpi.py`: KPI/evaluation pipeline.
|
|
78
|
+
|
|
79
|
+
## Export and Render Modes
|
|
80
|
+
`CityLearnEnv` keeps export off by default:
|
|
81
|
+
|
|
82
|
+
- `render_mode='none'`: no CSV export and minimal runtime overhead.
|
|
83
|
+
- `render_mode='during'`: writes CSV rows at each environment step.
|
|
84
|
+
- `render_mode='end'`: keeps the rollout fast and writes full episode CSVs when the episode ends.
|
|
85
|
+
|
|
86
|
+
Optional location controls:
|
|
87
|
+
|
|
88
|
+
- `render_directory`: base folder for exports.
|
|
89
|
+
- `render_session_name`: session subfolder name under `render_directory` (or `render_directory_name`).
|
|
90
|
+
- `render_directory_name`: legacy fallback folder under project root when `render_directory` is not set.
|
|
91
|
+
- `render`: legacy boolean flag; still supported for compatibility.
|
|
92
|
+
|
|
93
|
+
Examples:
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
from citylearn.citylearn import CityLearnEnv
|
|
97
|
+
|
|
98
|
+
# Fast training/no export
|
|
99
|
+
env = CityLearnEnv(schema, render_mode='none')
|
|
100
|
+
|
|
101
|
+
# Stream CSVs every step
|
|
102
|
+
env = CityLearnEnv(
|
|
103
|
+
schema,
|
|
104
|
+
render_mode='during',
|
|
105
|
+
render_directory='outputs',
|
|
106
|
+
render_session_name='run_during'
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
# Export once at episode end
|
|
110
|
+
env = CityLearnEnv(
|
|
111
|
+
schema,
|
|
112
|
+
render_mode='end',
|
|
113
|
+
render_directory='outputs',
|
|
114
|
+
render_session_name='run_end'
|
|
115
|
+
)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Documentation
|
|
119
|
+
Refer to the [docs](https://intelligent-environments-lab.github.io/CityLearn/).
|
|
120
|
+
|
|
121
|
+
## CityLearn UI
|
|
122
|
+
|
|
123
|
+
CityLearn UI is a visual dashboard for exploring simulation data generated by the CityLearn framework. It was developed to simplify the analysis of results from smart energy communities, district energy coordination, demand response (among other applications), allowing users to visually inspect building-level components, compare simulation KPIs, and create simulation schemas with ease.
|
|
124
|
+
|
|
125
|
+
The interface is available in two options:
|
|
126
|
+
|
|
127
|
+
* Web app: https://citylearnui.netlify.app/ (free hosted version — not recommended for sensitive/personal data)
|
|
128
|
+
* Open-source code: https://github.com/Soft-CPS-Research-Group/citylearn-ui
|
|
129
|
+
|
|
130
|
+
You can check a tutorial at the official CityLearn [website](https://intelligent-environments-lab.github.io/CityLearn/ui.html), in the CityLearn UI repository [README](https://github.com/Soft-CPS-Research-Group/citylearn-ui), or at the help [tooltip of the oficial webapp](https://citylearn-ui.netlify.app/admin/help).
|
|
131
|
+
|
|
132
|
+
**Compatibility:** This version of the UI currently supports CityLearn v2.5.0 simulation data.
|
|
133
|
+
|
|
134
|
+
**Developed by:** José, a member of the [SoftCPS](https://www2.isep.ipp.pt/softcps/), Software for Cyber-Physical Systems research group (ISEP, Portugal) in collaboration with the Intelligent Environments Lab, University of Texas at Austin.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.1.0'
|