Supply source disaggregation, irrigation conveyance, temporal rebase, dynamic population, and feature enhancements #78
Merged
Merged
Conversation
…ut breaks earlier usage
… repeat applying total and individual sector region-scale constraints
temporal scaling methods
…mple_data() to work
…ctor tech for example resources subresources etc
… lines from easy_query
…example basin_water withdrawals
… in each grid cell
…pture transnational basins within the USA
…mreader dependencies and adding inputviwer and tests dependencies
…thods changing call signature and add checks in tdmethods
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
source_disaggregation(to optionally output source shares for withdrawals) andirrigation_conveyance_efficiency(to adjust irrigation withdrawals) in both the YAML config and theTethysmodel class. Updated the constructor and documentation to reflect these options. [1] [2] [3] [4]Tethysmodel and related data loading functions to support aboundsparameter 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:
setup.pyfor improved reproducibility and compatibility, including pinning versions and adding missing dependencies for testing and documentation.pip install tethys-downscaletopip install tethys-downscalingfor consistency. [1] [2]Documentation Improvements:
Code Quality and Functionality Fixes:
easy_queryfunction to allow replacing default filters, and enhanced region data extraction utilities. [1] [2] [3]Continuous Integration and Workflow Updates:
Other Notable Changes: