Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4e2f9de
update installation instructions
RHammond2 Mar 9, 2026
56a36a3
add windows to CI and use conda consistently for Python across OS
RHammond2 Mar 9, 2026
da8c1da
Merge branch 'develop' of https://github.com/NREL/H2Integrate into en…
RHammond2 Mar 10, 2026
0713eec
merge develop and update changelog
RHammond2 Mar 10, 2026
43fc8d9
adopt 'extras' flag for analysis extras to correctly use optional CI
RHammond2 Mar 10, 2026
abbdd25
update changelog
RHammond2 Mar 10, 2026
96bcdf0
Merge branch 'develop' into enhancement/windows-ci
RHammond2 Mar 10, 2026
50b1189
reorder ci setup
RHammond2 Mar 11, 2026
881561e
update order
RHammond2 Mar 11, 2026
7346e4d
attempt python version restructure
RHammond2 Mar 11, 2026
9a2f9ac
Merge branch 'develop' into enhancement/windows-ci
johnjasa Mar 11, 2026
d4f67c6
Merge branch 'develop' into enhancement/windows-ci
RHammond2 Mar 11, 2026
90438e3
reinstate old python version
RHammond2 Mar 11, 2026
839d946
Merge branch 'enhancement/windows-ci' of https://github.com/RHammond2…
RHammond2 Mar 11, 2026
c69ed90
update URL
kbrunik Mar 11, 2026
8af8151
move runs-on back to below strategy
RHammond2 Mar 11, 2026
b1fe274
Merge branch 'enhancement/windows-ci' of https://github.com/RHammond2…
RHammond2 Mar 11, 2026
d9147aa
merge develop and fix conflicts
RHammond2 Mar 11, 2026
6f77c9b
add os to optional matrix
RHammond2 Mar 12, 2026
080dc0b
merge develop and update changelog
RHammond2 Mar 12, 2026
f30da12
reorganize the conditional for extras
RHammond2 Mar 12, 2026
626246e
convert lists to yaml bullet lists
RHammond2 Mar 12, 2026
db78033
skip gis-dependent tests when not installed
RHammond2 Mar 12, 2026
e2e31c7
update changelog
RHammond2 Mar 12, 2026
fb7054b
use optional deps for all tests and add single runner for validating …
RHammond2 Mar 12, 2026
9422c54
reformatting
RHammond2 Mar 12, 2026
0ae9573
reduce sql file access scope to functions to avoid windows errors
RHammond2 Mar 12, 2026
6231306
downgrade temp_dir to a function scope to avoid windows access errors
RHammond2 Mar 12, 2026
f7a74b0
move temp examples fixture to be in main conftest, and enable repo-wi…
RHammond2 Mar 12, 2026
bdd3f14
add module scoped example directory copy
RHammond2 Mar 12, 2026
1d6f449
apply module scoped example copy fixture to recorder tests and update
RHammond2 Mar 12, 2026
68d1133
update changelog
RHammond2 Mar 12, 2026
2a5c68c
Merge branch 'develop' into enhancement/windows-ci
RHammond2 Mar 12, 2026
19e8d08
update miniconda action usage
RHammond2 Mar 13, 2026
be5a97c
use the example copy fixture to isolate sql access in tests for poten…
RHammond2 Mar 13, 2026
58f4cd8
merge develop and fix conflicts
RHammond2 Mar 13, 2026
679a38d
reorganize changelog
RHammond2 Mar 13, 2026
0347b89
fix typo in parameter name
RHammond2 Mar 13, 2026
b840f99
update workflow
RHammond2 Mar 13, 2026
eb63ee2
remove max-parallel
RHammond2 Mar 13, 2026
74a38e5
Revert "reorganize changelog"
RHammond2 Mar 13, 2026
bd15914
add shell to all tests
RHammond2 Mar 13, 2026
7082cc3
merge develop and update changelog
RHammond2 Mar 13, 2026
dc10c2b
don't allow coverage upload to fail ci
RHammond2 Mar 13, 2026
372c5f9
uncomment windows
RHammond2 Mar 13, 2026
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
70 changes: 45 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,73 @@
name: Testing
on:
push:
branches: [main, develop]
branches:
- main
- develop
pull_request:
branches: [main, develop]
branches:
- main
- develop
schedule:
- cron: 0 0 * * MON
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11', '3.13']
optional: [false]
os:
- ubuntu-latest
- windows-latest
python-version:
- '3.11'
- '3.13'
optional:
- true
include:
- python-version: '3.11'
optional: true
optional: false
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: latest
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
auto-activate: true
activate-environment: h2integrate
- name: Install base dependencies
shell: bash -el {0}
env:
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: true
run: |
sudo apt-get update && sudo apt-get install -y libglpk-dev glpk-utils coinor-cbc
conda install -y -c conda-forge glpk coin-or-cbc>=2.10.12
python -m pip install --upgrade pip
if [ "${{ matrix.optional }}" = "true" ]; then
pip install ".[develop]"
else
pip install ".[develop]"
fi
pip install ".[develop]"
- if: ${{ matrix.optional }}
name: Install optional dependencies
shell: bash -el {0}
run: |
conda install -y -c conda-forge wisdem
pip install ".[extras]"
- name: Create env file
run: |
touch .env
- name: Run unit tests
run: |
pytest . -m unit --cov=h2integrate --cov-report=xml:unit-coverage.xml
shell: bash -el {0}
run: pytest . -m unit --cov=h2integrate --cov-report=lcov:./unit-coverage.lcov
- name: Run regression tests
run: |
pytest . -m regression --cov=h2integrate --cov-report=xml:regression-coverage.xml
shell: bash -el {0}
run: pytest . -m regression --cov=h2integrate --cov-report=lcov:./regression-coverage.lcov
- name: Run integration tests
run: |
pytest . -m integration --cov=h2integrate --cov-report=xml:integration-coverage.xml
- name: Upload unit coverage to
uses: codecov/codecov-action@v5
shell: bash -el {0}
run: pytest . -m integration --cov=h2integrate --cov-report=lcov:./integration-coverage.lcov
- name: Upload test coverage
uses: coverallsapp/github-action@v2
if: contains( matrix.os, 'ubuntu') && contains( matrix.python-version, '3.13')
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: unit-coverage.xml, regression-coverage.xml, integration-coverage.xml
flags: unit,regression,integration
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
files: ./unit-coverage.lcov, ./regression-coverage.lcov, ./integration-coverage.lcov
flag-name: unit,regression,integration
fail-on-error: false
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Unreleased

- Bumps the `coin-or-cbc` dependency to at least 2.10.12 to enable easy Windows compatibility. [PR 590](https://github.com/NatLabRockies/H2Integrate/pull/590)
- Uses the optional installation parameter `extras` to combine all analysis extras, and remove them
from the `develop` options. [PR 590](https://github.com/NatLabRockies/H2Integrate/pull/590)
- Tests reliant on the `gis` optional dependencies are no longer run when the extra dependencies are not installed
similar to the ard tests. [PR 590](https://github.com/NatLabRockies/H2Integrate/pull/590)
- Updates the testing infrastructure to use function-scoped fixtures unless there is a specific need for sharing
data between functions in a module. [PR 590](https://github.com/NatLabRockies/H2Integrate/pull/590)

## 0.7.1 [March 13, 2026]

### Updates
Expand All @@ -26,6 +36,7 @@
- Fixed a bug in the discrete variable instantiation within the iron processing stack that caused a failure with OpenMDAO v3.43 [PR 595](https://github.com/NatLabRockies/H2Integrate/pull/595)
- Fixed a bug in model setup where transporters were added to the system at the end of the system instead after their source [PR 591](https://github.com/NatLabRockies/H2Integrate/pull/591)
- Fixed a bug in example 1 (steel) where a cable was included between the combiner to steel, but steel uses an internal grid connection [PR 591](https://github.com/NatLabRockies/H2Integrate/pull/591)
- Introduced a keyword arg to `post_process` to allow users to choose if results are printed to the console. [PR 597](https://github.com/NatLabRockies/H2Integrate/pull/597)

## 0.7 [March 3, 2026]

Expand Down
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pip install h2integrate
1. Using Git, navigate to a local target directory and clone repository:

```bash
git clone https://github.com/NREL/H2Integrate.git
git clone https://github.com/NatLabRockies/H2Integrate.git
```

2. Navigate to `H2Integrate`
Expand Down Expand Up @@ -141,7 +141,8 @@ environment for development work.
- Use one of the extra flags as needed:
- `gis`: adds the iron mapping tools.
- `ard`: adds the Ard-based wind models.
- `develop`: adds developer and documentation tools, plus optional analysis modifiers `gis` and `ard`.
- `extras`: installs all extra analysis tool dependencies, e.g., `ard` or `gis`.
- `develop`: adds developer and documentation tools.
- `examples`: allows you to use the Jupyter Notebooks and all examples (includes `ard` and `gis`).
- `all` simplifies adding all the dependencies.

Expand Down Expand Up @@ -176,17 +177,9 @@ pip install -e ".[all]"
4. Install H2Integrate and its dependencies:

```bash
conda install -y -c conda-forge glpk
```

Note: Unix users should install Cbc via:

```bash
conda install -y -c conda-forge coin-or-cbc=2.10.8
conda install -y -c conda-forge glpk coin-or-cbc>=2.10.12
```

Windows users will have to manually install Cbc: https://github.com/coin-or/Cbc.

- If you want to just use H2Integrate:

```bash
Expand Down
15 changes: 3 additions & 12 deletions docs/getting_started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ environment for development work.
- Use one of the extra flags as needed:
- `gis`: adds the iron mapping tools.
- `ard`: adds the Ard-based wind models.
- `develop`: adds developer and documentation tools, plus optional analysis modifiers `gis` and `ard`.
- `extras`: installs all extra analysis tool dependencies, e.g., `ard` or `gis`.
- `develop`: adds developer and documentation tools.
- `examples`: allows you to use the Jupyter Notebooks and all examples (includes `ard` and `gis`).
- `all` simplifies adding all the dependencies.

Expand Down Expand Up @@ -110,19 +111,9 @@ pip install -e ".[all]"
4. Install H2Integrate and its dependencies:

```bash
conda install -y -c conda-forge glpk
conda install -y -c conda-forge glpk coin-or-cbc>=2.10.12
```

````{note}
Unix users should install Cbc via:

```bash
conda install -y -c conda-forge coin-or-cbc=2.10.8
```

Windows users should install Cbc manually according to https://github.com/coin-or/Cbc.
````

- If you want to just use H2Integrate:

```bash
Expand Down
Binary file removed docs/user_guide/figures/example_26_iron_map.png
Binary file not shown.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels: [conda-forge, defaults]
dependencies:
- python=3.11
- glpk
# - coin-or-cbc=2.10.8 # NOTE: uncomment if on Unix
- coin-or-cbc>=2.10.12
# - wisdem # NOTE: uncomment if installing with Ard
- pip
- pip: [.]
6 changes: 5 additions & 1 deletion examples/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)
16 changes: 2 additions & 14 deletions examples/test/test_all_examples.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import shutil
import importlib
from pathlib import Path

Expand All @@ -8,26 +7,14 @@
import pytest
import openmdao.api as om

from h2integrate import ROOT_DIR, EXAMPLE_DIR
from h2integrate import ROOT_DIR
from h2integrate.core.file_utils import load_yaml
from h2integrate.core.h2integrate_model import H2IntegrateModel


ROOT = Path(__file__).parents[1]


@pytest.fixture(scope="function")
def temp_copy_of_example(temp_dir, example_folder, resource_example_folder):
original = EXAMPLE_DIR / example_folder
shutil.copytree(original, temp_dir / example_folder, dirs_exist_ok=True)
if resource_example_folder is not None:
secondary = EXAMPLE_DIR / resource_example_folder
shutil.copytree(secondary, temp_dir / resource_example_folder, dirs_exist_ok=True)
os.chdir(temp_dir / example_folder)
yield temp_dir / example_folder
os.chdir(Path(__file__).parent)


# docs fencepost start: DO NOT REMOVE
@pytest.mark.integration
@pytest.mark.parametrize("example_folder,resource_example_folder", [("01_onshore_steel_mn", None)])
Expand Down Expand Up @@ -1937,6 +1924,7 @@ def test_24_solar_battery_grid_example(subtests, temp_copy_of_example):

@pytest.mark.integration
@pytest.mark.parametrize("example_folder,resource_example_folder", [("28_iron_map", None)])
@pytest.mark.skipif(importlib.util.find_spec("geopandas") is None, reason="`gis` not installed")
def test_28_iron_map_example(subtests, temp_copy_of_example):
import geopandas as gpd
import matplotlib
Expand Down
6 changes: 5 additions & 1 deletion h2integrate/control/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)
6 changes: 5 additions & 1 deletion h2integrate/converters/ammonia/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)
8 changes: 6 additions & 2 deletions h2integrate/converters/co2/marine/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import pytest

from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)


has_mcm = importlib.util.find_spec("mcm") is not None
Expand All @@ -23,7 +27,7 @@ def plant_config():


# docs fencepost start: DO NOT REMOVE
@pytest.fixture(scope="module")
@pytest.fixture(scope="function")
def driver_config(temp_dir): # noqa: F811
driver_config = {
"general": {
Expand Down
6 changes: 5 additions & 1 deletion h2integrate/converters/grid/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)
6 changes: 5 additions & 1 deletion h2integrate/converters/hopp/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)
6 changes: 5 additions & 1 deletion h2integrate/converters/hydrogen/geologic/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)
6 changes: 5 additions & 1 deletion h2integrate/converters/hydrogen/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)
6 changes: 5 additions & 1 deletion h2integrate/converters/iron/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
from h2integrate import EXAMPLE_DIR
from h2integrate.core.inputs.validation import load_driver_yaml

from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)


@fixture
Expand Down
6 changes: 5 additions & 1 deletion h2integrate/converters/methanol/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)
6 changes: 5 additions & 1 deletion h2integrate/converters/natural_gas/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)
6 changes: 5 additions & 1 deletion h2integrate/converters/nitrogen/test/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)
6 changes: 5 additions & 1 deletion h2integrate/converters/solar/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

from h2integrate import EXAMPLE_DIR

from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)


@pytest.fixture
Expand Down
6 changes: 5 additions & 1 deletion h2integrate/converters/steel/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
from h2integrate import EXAMPLE_DIR
from h2integrate.core.inputs.validation import load_driver_yaml

from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)


@pytest.fixture
Expand Down
6 changes: 5 additions & 1 deletion h2integrate/converters/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

import os

from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)


def pytest_sessionstart(session):
Expand Down
6 changes: 5 additions & 1 deletion h2integrate/converters/water/desal/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

import os

from test.conftest import temp_dir, pytest_collection_modifyitems # noqa: F401
from test.conftest import ( # noqa: F401
temp_dir,
temp_copy_of_example,
pytest_collection_modifyitems,
)


def pytest_sessionstart(session):
Expand Down
Loading
Loading