Skip to content

Supply source disaggregation, irrigation conveyance, temporal rebase, dynamic population, and feature enhancements #78

Merged
hassaniazi merged 42 commits into
mainfrom
dev
Jun 4, 2026
Merged

Supply source disaggregation, irrigation conveyance, temporal rebase, dynamic population, and feature enhancements #78
hassaniazi merged 42 commits into
mainfrom
dev

Conversation

@hassaniazi

@hassaniazi hassaniazi commented Jun 4, 2026

Copy link
Copy Markdown
Member

This pull request introduces several enhancements and fixes across the codebase, focusing on improving configuration flexibility, dependency management, spatial data handling, and documentation accuracy. Major changes include adding new configuration options for source disaggregation and irrigation conveyance efficiency, updating the installation and dependency requirements, extending spatial cropping capabilities, and improving CI workflows.

Configuration and Model Enhancements:

  • Added new configuration options source_disaggregation (to optionally output source shares for withdrawals) and irrigation_conveyance_efficiency (to adjust irrigation withdrawals) in both the YAML config and the Tethys model class. Updated the constructor and documentation to reflect these options. [1] [2] [3] [4]
  • Extended the Tethys model and related data loading functions to support a bounds parameter for spatial cropping, enabling users to specify geographic subsetting for input data and region maps. [1] [2] [3] [4] [5] [6] [7] [8]

Dependency and Installation Updates:

  • Updated core and development dependencies in setup.py for improved reproducibility and compatibility, including pinning versions and adding missing dependencies for testing and documentation.
  • Corrected the package installation command in documentation from pip install tethys-downscale to pip install tethys-downscaling for consistency. [1] [2]

Documentation Improvements:

  • Expanded and clarified the user guide and configuration file documentation, especially regarding new options and YAML structure. [1] [2] [3]
  • Updated project authorship in documentation and metadata. [1] [2]

Code Quality and Functionality Fixes:

  • Improved the easy_query function to allow replacing default filters, and enhanced region data extraction utilities. [1] [2] [3]
  • Fixed and streamlined spatial data loading, chunking, and regridding logic for better performance and flexibility. [1] [2] [3] [4] [5] [6]

Continuous Integration and Workflow Updates:

  • Improved GitHub Actions workflows to test across multiple Python versions, update action versions, and refine triggers for the paper build workflow. [1] [2] [3]

Other Notable Changes:

  • Bumped the project version to 2.2.0.
  • Minor fixes and cleanups in data extraction and region mapping logic. [1] [2] [3]

ifthompson and others added 30 commits May 22, 2024 14:06
… repeat applying total and individual sector region-scale constraints
…ctor tech for example resources subresources etc
…mreader dependencies and adding inputviwer and tests dependencies
…thods changing call signature and add checks in tdmethods
hassaniazi and others added 12 commits June 3, 2026 22:00
…but something like upper_colorado could break

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…/basin/subresource

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
disaggregate_source() currently returns a plain dict of DataArrays, but run_model() initializes self.griddedshares as an xr.Dataset() and then overwrites it with that dict. Converting to an xr.Dataset here keeps the attribute’s type consistent and makes downstream usage (including I/O) less error-prone.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
When temporal_distribution() is called with a Tethys model object, the function rebuilds the call using only a subset of config (tasfile/rfile) and drops other supported kwargs (e.g., tasvar, rvar). Passing through **cfg preserves configurability and keeps behavior consistent between the “model object” and “direct args” call paths.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
When called with a Tethys model object, this wrapper only forwards regionfile and irrfile, silently ignoring other supported kwargs like irrvar. This makes it impossible to configure those options via temporal_config when using the model-object call style (which is used by the test suite).

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
In the model-object call path, the wrapper forwards only a fixed subset of config and drops other supported kwargs (e.g., hddvar, cddvar). Passing through **cfg keeps the function configurable and avoids the model-object path behaving differently from the direct-args path.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
In the model-object call path, this wrapper forwards only weightfile and drops other supported kwargs (e.g., weightvar, regrid_method, prenormalized). This makes temporal_config['Weights']['kwargs'] ineffective for anything beyond weightfile.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Supply source disaggregation, irrigation conveyance, and feature enhancements 

This pull request introduces several new features, dependency updates, and improvements to documentation and CI workflows for the Tethys project. The most significant changes are the addition of source disaggregation and irrigation conveyance efficiency options to the model, enhancements to temporal downscaling configuration, and updates to dependencies and installation instructions.
@hassaniazi hassaniazi merged commit e406fc6 into main Jun 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants