This is a Python-based tool for analyzing and comparing city configurations to support climate policy research. It generates summary statistics for cities, which includes GDP, emissions, traffic volume, and transit share and is designed to help urban planners and researchers evaluate city-level data and make informed, data-driven decisions.
- City Summary Statistics: Generate detailed summaries of city configurations, including derived metrics like emissions per capita and traffic volume-to-capacity ratios.
- Metric Comparison: Compare specific metrics (e.g., EV share, transit share) across multiple cities using a simple dot-notation path.
- Customizable Configurations: Easily extend or modify city configurations to suit your analysis needs.
- HPC-Ready: Designed to run on high-performance computing clusters via SLURM job scheduling.
- Python 3.8 or higher
pip(Python package manager)-
- Access to UMD's Nexus HPC cluster with SLURM scheduler
-
Clone the repository:
git clone https://github.com/saanvi-kataria77/climate-policy-optimization.git cd climate-policy-optimization -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # macOS/Linux venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
(Optional) HPC/SLURM setup — If running on UMD's Nexus cluster, ensure you have access to the SLURM scheduler and configure your environment module accordingly (see Running on SLURM below).
Run the main script to print a summary of all cities:
python city_configs.pyUse the compare_cities function to compare a specific metric across cities. For example, to compare EV share:
compare_cities('traffic_params.base_ev_share')You can pass any dot-notation path corresponding to a nested field in the city config dictionaries.
This project is compatible with UMD's Nexus HPC cluster. A basic SLURM job script might look like:
#!/bin/bash
#SBATCH --job-name=climate-policy
#SBATCH --output=output_%j.log
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem=8G
#SBATCH --time=01:00:00
module load python/3.9
source venv/bin/activate
python city_configs.pySubmit with:
sbatch job.slurmThe commit history for this repository is relatively small. Development was done locally and connected to UMD's Nexus HPC cluster via a remote tunnel using SLURM for job execution. This workflow, where the code is edited locally, was synced to the cluster, and run compute nodes, so my team and I's development steps happened outside of standard Git commit cycles and were integrated in larger batches rather than committed in real time.
Contributions are welcome! To get started:
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature/your-feature-name
- Commit your changes with a descriptive message:
git commit -m "Add: description of your feature" - Push to your fork and open a pull request against
main.
Please make sure your code follows existing style conventions and includes comments where appropriate.
This project is licensed under the MIT License.
Questions, suggestions, or feedback? Feel free to open an issue or reach out directly via GitHub, thanks so much! :)