Skip to content

Resource resampling - #893

Open
jaredthomas68 wants to merge 11 commits into
NatLabRockies:developfrom
jaredthomas68:nonannual-resource
Open

jaredthomas68 wants to merge 11 commits into
NatLabRockies:developfrom
jaredthomas68:nonannual-resource

Conversation

@jaredthomas68

@jaredthomas68 jaredthomas68 commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Resource-resampling compatible with non-annual resource handling

The work in this PR is also included in #887. This PR splits out the resource-specific changes in #887 that are not already addressed in #897.

This PR should come in after #897

This PR contains changes up-sampling and down-sampling data to desired time step (using pandas methods)

Section 1: Type of Contribution

  • Feature Enhancement
    • Framework
    • New Model
    • Updated Model
    • Tools/Utilities
    • Other (please describe):
  • Bug Fix
  • Documentation Update
  • CI Changes
  • Other (please describe):

Section 2: Draft PR Checklist

  • Open draft PR
  • Describe the feature that will be added
  • Fill out TODO list steps
  • Describe requested feedback from reviewers on draft PR
  • [-] Complete Section 8: New Model Checklist (if applicable)

TODO:

  • Work with @elenya-grant to merge related work
  • Make resource resampling non-automatic and warn the user

Type of Reviewer Feedback Requested (on Draft PR)

Structural feedback:

Implementation feedback:

  • Thoughts on how resampling is being handled

Other feedback:

Section 3: General PR Checklist

  • PR description thoroughly describes the new feature, bug fix, etc.
  • Added tests for new functionality or bug fixes
  • Tests pass (If not, and this is expected, please elaborate in the Section 6: Test Results)
  • Documentation
    • Docstrings are up-to-date
    • Related docs/ files are up-to-date, or added when necessary
    • Documentation has been rebuilt successfully
    • [-] Examples have been updated (if applicable)
      • Examples will be updated in a later PR demonstrating non-annual and non-hourly timestep along with resampling.
  • CHANGELOG.md
    • At least one complete sentence has been provided to describe the changes made in this PR
    • After the above, a hyperlink has been provided to the PR using the following format:
      "A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
      XYZ should be replaced with the actual number.

Section 4: Related Issues

Resolves #651

Section 5: Impacted Areas of the Software

Section 5.1: New Files

  • None.

Section 5.2: Modified Files

  • resource_index.md
    • Documents explicit resource resampling settings and warnings.
  • validation.py
    • Retains the one-year simulation-duration restriction while formatting the seconds-per-year constant.
  • resource_baseclass.py
    • Adds opt-in up/downsampling configuration and resamples resource data before timestep clipping.
  • conftest.py
    • Explicitly selects interpolation and aggregation methods in resource integration-test configurations.
  • test_resource_api_baseclass.py
    • Updates test sampling settings and fixes synthetic timestamps to match the intended intervals.
  • test_time_tools.py
    • Covers resampling behavior, leap-day timestamp handling, opt-in errors, and user warnings.
  • time_tools.py
    • Adds timestep resampling with leap-aware timestamp regeneration, explicit method requirements, and warnings.
  • nlr_developer_wtk_api_models.py
    • Accepts filename lists for multi-year wind resource inputs.

Section 6: Additional Supporting Information

Section 7: Test Results, if applicable

Section 8 (Optional): New Model Checklist

  • Model Structure:
    • Follows established naming conventions outlined in docs/developer_guide/coding_guidelines.md
    • Used attrs class to define the Config to load in attributes for the model
      • If applicable: inherit from BaseConfig or CostModelBaseConfig
    • Added: initialize() method, setup() method, compute() method
      • If applicable: inherit from CostModelBaseClass
  • Integration: Model has been properly integrated into H2Integrate
    • Add the new model to the appropriate __init__.py file to ensure it is properly imported and used in supported_models.py
    • Added to supported_models.py
    • If a new commodity_type is added, update create_financial_model in h2integrate_model.py
  • Tests: Unit tests have been added for the new model
    • Pytest-style unit tests
    • Unit tests are in a "test" folder within the folder a new model was added to
    • If applicable add integration tests
  • Example: If applicable, a working example demonstrating the new model has been created
    • Input file comments
    • Run file comments
    • Example has been tested and runs successfully in test_all_examples.py
  • Documentation:
    • Write docstrings using the Google style
    • Model added to the main models list in docs/user_guide/model_overview.md
      • Model documentation page added to the appropriate docs/ section
      • <model_name>.md is added to the _toc.yml
    • Run generate_class_hierarchy.py to update the class hierarchy diagram in docs/developer_guide/class_structure.md

@johnjasa johnjasa changed the title Non-annual resource handling WIP: Non-annual resource handling Sep 24, 2026

@jaredthomas68 jaredthomas68 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of what I'm seeing looks very similar to what I have, but with an improved interface and excluding the sampling

@jaredthomas68 jaredthomas68 added the ready for review This PR is ready for input from folks label Oct 5, 2026
@jaredthomas68 jaredthomas68 changed the title WIP: Non-annual resource handling Resource resampling Oct 6, 2026
@jaredthomas68
jaredthomas68 marked this pull request as ready for review October 8, 2026 19:06

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review This PR is ready for input from folks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants