Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions .github/workflows/test_gridpath.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# It installs Python dependencies (including the HiGHS solver via highspy), runs
# the GridPath test suite with coverage, and sends coverage results to coveralls
# We run this on Linux, MacOS, and Windows with Python 3.11, 3.12, 3.13, and 3.14
# The suite runs via scripts/run_tests_parallel.py: a pytest-xdist lane for the
# tests that are safe to run concurrently, plus serial lanes for the tests that
# share on-disk state
# Pull requests run a reduced matrix (each OS once, the oldest and the
# coverage Python); pushes to main/develop and the nightly run cover the full
# OS x Python matrix

name: test-suite

Expand All @@ -18,9 +24,9 @@ jobs:

runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
# Reduced matrix on pull requests (each OS once, plus the oldest
# Python and the coverage cell); full OS x Python matrix otherwise
matrix: ${{ github.event_name == 'pull_request' && fromJSON('{"include":[{"os":"ubuntu-latest","python-version":"3.11"},{"os":"ubuntu-latest","python-version":"3.13"},{"os":"macos-latest","python-version":"3.13"},{"os":"windows-latest","python-version":"3.14"}]}') || fromJSON('{"os":["windows-latest","macos-latest","ubuntu-latest"],"python-version":["3.11","3.12","3.13","3.14"]}') }}

steps:
- uses: actions/checkout@v4
Expand All @@ -32,17 +38,22 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
# Key the pip cache on pyproject.toml, where the dependencies are
# pinned (the root requirements.txt is a freeze snapshot, not what
# the install step uses)
cache-dependency-path: pyproject.toml
- name: Install Python dependencies
run: |
python -m pip install .[coverage] --upgrade pip
python -m pip install .[coverage,parallel_tests] --upgrade pip
- name: Test GridPath w/o coverage on all but Linux with Python 3.13
if: ${{ runner.os == 'Windows' || runner.os == 'macOS' || matrix.python-version != '3.13' }}
run: |
python -m unittest discover tests
python scripts/run_tests_parallel.py
- name: Test GridPath with coverage
if: ${{ runner.os == 'Linux' && matrix.python-version == '3.13' }}
run: |
coverage run -m unittest discover tests
python scripts/run_tests_parallel.py --coverage
- name: Send coverage results to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ abstract: >-
GridPath is a versatile simulation and optimization platform for
power-system planning and operations, capable of production-cost,
capacity-expansion, asset-valuation, and reliability modeling.
version: "v2026.7.1"
date-released: 2026-07-20
version: "v2026.8.0"
date-released: 2026-08-03
license: Apache-2.0
doi: 10.5281/zenodo.5822994
repository-code: "https://github.com/sylvan-energy/gridpath"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ pip install .[all]
If you use GridPath, please cite it as follows (APA):

> Mileva, A., De Moor, G., Deshmukh, R., & The GridPath Contributors. (2026).
> *GridPath* (Version 2026.7.1) [Computer software]. https://doi.org/10.5281/zenodo.5822994
> *GridPath* (Version 2026.8.0) [Computer software]. https://doi.org/10.5281/zenodo.5822994
13 changes: 13 additions & 0 deletions db/common_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
import time
import traceback

# Python 3.12 deprecated sqlite3's implicit datetime/date adapters and the
# TIMESTAMP/DATE converters used with detect_types=PARSE_DECLTYPES;
# register equivalents that preserve the storage format the implicit ones
# used ("YYYY-MM-DD HH:MM:SS[.ffffff]", with a space separator)
sqlite3.register_adapter(datetime.date, lambda val: val.isoformat())
sqlite3.register_adapter(datetime.datetime, lambda val: val.isoformat(" "))
sqlite3.register_converter(
"date", lambda val: datetime.date.fromisoformat(val.decode())
)
sqlite3.register_converter(
"timestamp", lambda val: datetime.datetime.fromisoformat(val.decode())
)


def connect_to_database(db_path="../db/io.db", timeout=5, detect_types=0):
"""
Expand Down
2 changes: 1 addition & 1 deletion db/csvs_test_examples/csv_structure.csv
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ water/reservoirs,water,water_node_reservoir_scenario_id,system_water_node_reserv
water/flows,water,water_flow_scenario_id,system_water_flows,simple,,0,,,,,
water/flows/tmp_flow_bounds,water,water_flow_timepoint_bounds_scenario_id,system_water_flows_timepoint_bounds,simple,,1,water_link,,,inputs_system_water_flows,water_flow_scenario_id
water/flows/hrz_flow_bounds,water,water_flow_horizon_bounds_scenario_id,system_water_flows_horizon_bounds,simple,,1,water_link,,,inputs_system_water_flows,water_flow_scenario_id
water/flows/hrz_flow_bounds/upstream_node_map,water,water_flow_horizon_bounds_scenario_id,system_water_flows_horizon_bounds_upstream_node_map,simple,,1,water_link,,,inputs_system_water_flows,water_flow_scenario_id
water/flows/upstream_node_map,water,water_flow_upstream_node_map_scenario_id,system_water_flows_upstream_node_map,simple,,1,water_link,,,inputs_system_water_flows,water_flow_scenario_id
water/flows/ramp_limits,water,water_flow_ramp_limit_scenario_id,system_water_flow_ramp_limits,simple,,1,water_link,,,inputs_system_water_flows,water_flow_scenario_id
water/flows/ramp_limits/bt_hrz_values,water,water_flow_ramp_limit_scenario_id,system_water_flow_ramp_limit_bt_hrz_values,simple,,1,water_link,,,inputs_system_water_flows,water_flow_scenario_id
water/powerhouses,water,water_powerhouse_scenario_id,system_water_powerhouses,simple,,0,,,,,
Expand Down
Loading
Loading