Skip to content

Commit 5dcea96

Browse files
committed
Prepare upstream publish metadata for CityLearn 2.6.0b1
1 parent 5e1a4c1 commit 5dcea96

File tree

8 files changed

+30
-257
lines changed

8 files changed

+30
-257
lines changed

.github/workflows/pypi_deploy.yml

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,33 @@
1-
name: Publish Python Package
1+
name: Upload Python Package
22

33
on:
44
workflow_dispatch:
55
release:
66
types: [published]
77

88
jobs:
9-
build:
9+
deploy:
10+
11+
environment: pypi
1012
runs-on: ubuntu-24.04
13+
strategy:
14+
matrix:
15+
python-version: [3.11]
1116

1217
steps:
13-
- name: Checkout repository
14-
uses: actions/checkout@v4
15-
16-
- name: Set up Python
17-
uses: actions/setup-python@v5
18+
- uses: actions/checkout@v2
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v2
1821
with:
19-
python-version: "3.11"
20-
22+
python-version: ${{ matrix.python-version }}
2123
- name: Install dependencies
2224
run: |
2325
python -m pip install --upgrade pip
24-
pip install build twine
25-
26-
- name: Build distributions
26+
pip install setuptools wheel twine
27+
- name: Build and publish
28+
env:
29+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
30+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2731
run: |
28-
python -m build
29-
python -m twine check dist/*
30-
31-
- name: Upload package artifacts
32-
uses: actions/upload-artifact@v4
33-
with:
34-
name: python-dist
35-
path: dist/
36-
37-
publish:
38-
needs: build
39-
runs-on: ubuntu-24.04
40-
environment:
41-
name: pypi
42-
url: https://pypi.org/project/softcpsrecsimulator/
43-
44-
steps:
45-
- name: Download package artifacts
46-
uses: actions/download-artifact@v4
47-
with:
48-
name: python-dist
49-
path: dist/
50-
51-
- name: Publish to PyPI
52-
uses: pypa/gh-action-pypi-publish@release/v1
53-
with:
54-
password: ${{ secrets.PYPI_API_TOKEN }}
32+
python setup.py sdist bdist_wheel
33+
twine upload --verbose dist/*

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
include citylearn/assets/*
22
recursive-include citylearn/misc *
33
include requirements.txt
4-
include README_PYPI.md

PYPI_RELEASE.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -12,107 +12,7 @@ CityLearn includes energy models of buildings and distributed energy resources (
1212
## Installation
1313
Install latest release in PyPi with `pip`:
1414
```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-
)
15+
pip install CityLearn
11616
```
11717

11818
## Documentation

README_PYPI.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

citylearn/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.2.1'
1+
__version__ = '2.6.0b1'

citylearn/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def get_settings():
3434
class DataSet:
3535
"""CityLearn input data set and schema class."""
3636

37-
GITHUB_ACCOUNT = os.getenv('CITYLEARN_DATASET_GITHUB_ACCOUNT', 'Soft-CPS-Research-Group')
38-
REPOSITORY_NAME = os.getenv('CITYLEARN_DATASET_REPOSITORY', 'Simulator')
37+
GITHUB_ACCOUNT = os.getenv('CITYLEARN_DATASET_GITHUB_ACCOUNT', 'intelligent-environments-lab')
38+
REPOSITORY_NAME = os.getenv('CITYLEARN_DATASET_REPOSITORY', 'CityLearn')
3939
REPOSITORY_TAG = os.getenv('CITYLEARN_DATASET_TAG', f'v{__version__}')
4040
REPOSITORY_DATA_PATH = FileHandler.join_url('data')
4141
REPOSITORY_DATA_DATASETS_PATH = FileHandler.join_url(REPOSITORY_DATA_PATH, 'datasets')

setup.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44

55
ROOT = os.path.dirname(__file__)
66
VERSION_RE = re.compile(r"__version__\s*=\s*['\"]([\w\.-]+)['\"]")
7-
DIST_NAME = os.getenv('CITYLEARN_PYPI_NAME', 'softcpsrecsimulator')
8-
PYPI_README = os.path.join(ROOT, 'README_PYPI.md')
97

10-
readme_path = PYPI_README if os.path.exists(PYPI_README) else os.path.join(ROOT, 'README.md')
11-
12-
with open(readme_path, 'r', encoding='utf-8') as fh:
8+
with open('README.md', 'r') as fh:
139
long_description = fh.read()
1410

15-
with open('requirements.txt', 'r', encoding='utf-8') as fh:
11+
with open('requirements.txt', 'r') as fh:
1612
requirements = fh.readlines()
1713
requirements = [requirement.strip().replace('\n','').replace('\r','') for requirement in requirements]
1814
requirements = [requirement for requirement in requirements if len(requirement) != 0 and requirement[0] != '#']
@@ -22,25 +18,20 @@ def get_version():
2218
return VERSION_RE.search(init).group(1)
2319

2420
setuptools.setup(
25-
name=DIST_NAME,
21+
name='citylearn',
2622
version=get_version(),
27-
author='Soft-CPS Research Group, Jose Ramon Vazquez-Canteli, Kingsley Nweye, Zoltan Nagy',
28-
author_email='jose@isep.ipp.pt',
23+
author='Jose Ramon Vazquez-Canteli, Kingsley Nweye, Zoltan Nagy',
24+
author_email='nweye@utexas.edu',
2925
description=(
30-
'SoftCPS REC Simulator: an energy-community RL simulator fork focused on EV/BESS/PV, '
31-
'electrical-service constraints, and community-market experimentation.'),
26+
'An open source Farama Foundation Gymnasium environment for benchmarking distributed '
27+
'energy resource control algorithms to provide energy flexibility in a district of buildings.'),
3228
long_description=long_description,
3329
long_description_content_type='text/markdown',
34-
url='https://github.com/Soft-CPS-Research-Group/Simulator',
35-
license='MIT',
30+
url='https://github.com/intelligent-environments-lab/CityLearn',
3631
packages=setuptools.find_packages(),
3732
include_package_data=True,
3833
install_requires=requirements,
3934
entry_points={'console_scripts': ['citylearn = citylearn.__main__:main']},
40-
project_urls={
41-
'Source': 'https://github.com/Soft-CPS-Research-Group/Simulator',
42-
'Original Project': 'https://github.com/intelligent-environments-lab/CityLearn',
43-
},
4435
classifiers=[
4536
'Programming Language :: Python :: 3',
4637
'License :: OSI Approved :: MIT License',

0 commit comments

Comments
 (0)