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
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
name: Testing

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
- cron: "0 0 * * MON"

- cron: 0 0 * * MON
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.13"]
python-version: ['3.11', '3.13']
optional: [false]
include:
- python-version: "3.11"
- python-version: '3.11'
optional: true

steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -27,7 +24,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: true
run: |
sudo apt-get update && sudo apt-get install -y libglpk-dev glpk-utils coinor-cbc
python -m pip install --upgrade pip
Expand All @@ -48,7 +45,6 @@ jobs:
- 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
with:
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
name: pre-commit

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.13
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.13
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
32 changes: 15 additions & 17 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Upload to PyPi

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -14,18 +12,18 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.13
- name: Build package
run: |
python -m pip install --upgrade pip
pip install setuptools build wheel twine
python -m build
twine check --strict dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: True
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.13
- name: Build package
run: |
python -m pip install --upgrade pip
pip install setuptools build wheel twine
python -m build
twine check --strict dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
37 changes: 17 additions & 20 deletions .github/workflows/publish_to_test_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Upload to Test PyPi

on:
push:
tags:
- 'v*'

tags: [v*]
jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -15,19 +12,19 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.13
- name: Build package
run: |
python -m pip install --upgrade pip
pip install setuptools build wheel twine
python -m build
twine check --strict dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: True
repository-url: https://test.pypi.org/legacy/
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.13
- name: Build package
run: |
python -m pip install --upgrade pip
pip install setuptools build wheel twine
python -m build
twine check --strict dist/*
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
repository-url: https://test.pypi.org/legacy/
67 changes: 36 additions & 31 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
default_language_version:
python: python3
python: python3
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort
stages: [pre-commit]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-executables-have-shebangs
- id: check-json
- id: check-yaml
args: [--unsafe] # allow Python constructors
- id: check-merge-conflict
- id: check-symlinks
- id: mixed-line-ending
- id: pretty-format-json
args: [--autofix]

- repo: https://github.com/astral-sh/ruff-pre-commit
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort
stages: [pre-commit]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-executables-have-shebangs
- id: check-json
- id: check-yaml
args: [--unsafe] # allow Python constructors
- id: check-merge-conflict
- id: check-symlinks
- id: mixed-line-ending
- id: pretty-format-json
args: [--autofix]
- repo: https://github.com/lyz-code/yamlfix/
rev: 1.19.1
hooks:
- id: yamlfix
# Exclude YAML files that are used as inputs for testing or examples, or ones for desired schedule in HOPP as they
# expect misformatted YAML files.
exclude: ^(h2integrate/core/test/inputs/.*|examples/11_hybrid_energy_plant/tech_inputs/desired_schedules/.*)$
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.1
hooks:
- id: ruff-format
types_or: [ python, pyi, jupyter ]
- id: ruff
types_or: [ python, pyi, jupyter ]
args: [ --fix, --unsafe-fixes]
rev: v0.8.1
hooks:
- id: ruff-format
types_or: [python, pyi, jupyter]
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix, --unsafe-fixes]
11 changes: 3 additions & 8 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
version: 2

# https://docs.readthedocs.io/en/stable/config-file/v2.html
build:
os: ubuntu-24.04
tools:
python: "3.11"
python: '3.11'
jobs:
pre_build:
- "jupyter-book config sphinx docs/"

pre_build: [jupyter-book config sphinx docs/]
python:
install:
- method: pip
path: .
extra_requirements:
- develop

extra_requirements: [develop]
sphinx:
configuration: docs/conf.py
builder: html
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
all tests must be marked via `@pytest.mark.<test-type>`.
- Partial testing suite refactor to parameterize many of the common fixtures and test routines.
- `unittest` style tests are refactored to be `pytest` style tests for test consistency.
- Added a pre-commit hook for `yamlfix` to auto-format YAML files and `yamlfix`'d all YAML files for consistent formatting

## 0.6 [February 10, 2026]

Expand Down
21 changes: 7 additions & 14 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,43 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: H2Integrate
author: National Renewable Energy Laboratory
# logo: logo.png
copyright: "2025"
copyright: '2025'
only_build_toc_files: false
# exclude_patterns: [_build, Thumbs.db, .DS_Store, "**.ipynb_checkpoints", .github]

# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute:
execute: null
execute_notebooks: auto
timeout: -1 # better for longer running notebooks
merge_streams: true # keeps unsynchronized cell outputs in a single output cell
exclude_patterns:
- _build
- Thumbs.db
- DS_Store
- "**.ipynb_checkpoints"

- '**.ipynb_checkpoints'
# Define the name of the latex output file for PDF builds
latex:
latex_documents:
targetname: book.tex

# Information about where the book exists on the web
repository:
url: https://github.com/NREL/H2Integrate
path_to_book: docs
branch: main

# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
use_issues_button: true
use_repository_button: true
baseurl: https://nrel.github.io/H2Integrate/

sphinx:
extra_extensions:
- "sphinx.ext.autodoc"
- "sphinx.ext.autosummary"
- "sphinx.ext.napoleon"

- sphinx.ext.autodoc
- sphinx.ext.autosummary
- sphinx.ext.napoleon
config:
# html_theme: sphinx_book_theme
# html_theme_options:
Expand Down Expand Up @@ -73,7 +66,7 @@ sphinx:
# type: url,
# },
# ]
language: 'python'
language: python
autosummary_generate: true
autodoc_default_options:
members: true
Expand Down
Loading