A modular Python tool for running SMART-DS dataset using OpenDSS.
├── main.py # Main execution script
├── config.py # Configuration settings
├── dss_checks.py # OpenDSS system checking functions
├── data_processing.py # Data processing utilities
├── file_readers.py # File reading functions
├── plotting_utils.py # Plotting and visualization
├── output_utils.py # Output and file saving utilities
├── timeseries_analysis.py # Timeseries analysis for voltage estimation
├── requirements.txt # Python dependencies
└── README.md # This file
- Install required packages:
pip install -r requirements.txt- Ensure OpenDSS is installed and accessible via opendssdirect.py
This is based on the Smart-DS dataset developed by NREL, the formatting is expected as follows:
year/region/substation/scenarios/feeders/python main.py <dataset> <region> <year> <scenario> <run_all> <delete_folders>dataset: Dataset name/pathregion: Region to analyzeyear: Year or 'peak' for peak analysisscenario: Scenario name (e.g., 'base_timeseries', 'base_peak')run_all: 'timeseries' to run full timeseries analysis, or other value for peak onlydelete_folders: 'Delete' to clean up intermediate folders, or other value to keep
Peak analysis:
python main.py Region Substation year base_peak normal keepTimeseries analysis:
python main.py Region Substation year base_timeseries timeseries keep
python main.py SFO P4U 2018 base_timeseries timeseries DeleteEdit config.py to adjust:
- Voltage violation thresholds (upper/lower bounds)
- Loading thresholds for transformers and lines
- Plotting settings
- Output file names
- Progress reporting intervals
- Voltage Violations: Detects over/under voltage conditions
- Equipment Overloads: Identifies overloaded transformers and lines
- Blown Fuses: Checks for blown protective devices
- Collects voltage data across all buses for every timestep
- Saves load and PV generation data as features
- Creates datasets suitable for voltage estimation models
- Exports data in CSV format with metadata
- Voltage histograms and percentile plots
- Daily load curve plotting
- System summary statistics
The tool generates various output files including:
peak_under_voltages.csv- Undervoltage violationspeak_over_voltages.csv- Overvoltage violationspeak_transformer_overloads.csv- Transformer overloadspeak_line_overloads.csv- Line overloadsblown_fuses.csv- Blown fusesSummary_data.csv- System summary statisticsvoltage_estimation_data/- Complete timeseries dataset for ML
When running with timeseries mode, the tool creates a comprehensive dataset for voltage estimation including:
voltage_pu_all_buses.csv- Target voltage values (per-unit) for all busesload_kw_all_buses.csv- Active power loads as featuresload_kvar_all_buses.csv- Reactive power loads as featurespv_irradiance_all_systems.csv- PV system data (if applicable)system_summary.csv- System-level metricsdataset_metadata.json- Dataset description and structure
This dataset can be used to train machine learning models for voltage estimation and prediction.
- The tool processes data sequentially (multiprocessing has been disabled)
- Progress is reported every 1000 timesteps during timeseries analysis
- All intermediate calculations and violations are logged to console
- The tool is designed to handle missing or corrupted data in a graceful way (ask for forgiveness not permission)
See requirements.txt for the complete list of Python packages required.