This documentation is built from the development branch, master. It includes the changes listed under Unreleased, which the latest release, CityLearn 3.6.0, does not have. To read the documentation of the version you installed (pip show citylearn), open the docs folder at its tag on GitHub, for example v3.6.0.

Python API

The supported API is the set of modules below. Their documented classes, functions and arguments follow the release notes and the migration guide when they change.

Module

Use it for

citylearn.citylearn

CityLearnEnv, the environment: reset, step, evaluate_v2, scorecard and the exports. EvaluationCondition selects the series evaluate_v2 reads.

citylearn.multi_community

MultiCommunityEnv, several communities run in step, with portfolio KPIs.

citylearn.agents

Controllers: BusinessAsUsualAgent and the reference rule-based policies in citylearn.agents.baseline, the Agent base class for your own controller, and the reinforcement-learning agents.

citylearn.reward_function

Built-in rewards and the RewardFunction base class.

citylearn.wrappers

Gymnasium wrappers: normalised and discrete spaces, Stable-Baselines3 and RLlib adapters.

citylearn.data

DataSet: list, download and cache the public datasets.

citylearn.building, citylearn.energy_model, citylearn.electric_vehicle, citylearn.electric_vehicle_charger

The simulated buildings and devices, for reading their state and series during and after an episode.

citylearn.cost_function

The legacy cost functions behind evaluate().

citylearn.random_streams

The random stream versions selected by random_stream_version.

Other modules are documented for reference but are not a stable interface: citylearn.utilities and citylearn.utils hold helpers the package uses itself, and the remaining modules support the classes above. citylearn.internal holds the environment’s private services. It is not published here, and it can change in any release without notice.