-
Notifications
You must be signed in to change notification settings - Fork 9
Regrid updates and output fixes #447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sol1105
wants to merge
6
commits into
master
Choose a base branch
from
regrid_updates_and_output_fixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
- utils/common.py:
- Updated require_module to accept an interval of unsupported versions
- utils/dataset_utils.py:
- Added option to get_coord_by_type to suppress warning about a main variable
not being identifiable
- utils/output_utils.py
- Added functions 'fix_netcdf_attrs_encoding' and '_fix_str_encoding' to
fix utf-8 encoding issues for global and variable attributes
- ops/base_operation.py:
- Applying above fix to correct utf-8 encoding issues
- core/regrid.py:
- xarray version warning correctly triggered for versions
outside of compatible version interval
- Grid.detect_extent:
+ determins now also extent in latitude
+ using now average resolution in x and y direction, respectively,
rather than the average resolution, to determine the extent in lon/lat
direction
+ now returning (lon_extent, lat_extent) instead of just lon_extent
- Grid._grid_from_ds_adaptive:
+ Added fix for regional grids that include either meridian or antimeridian
- Grid.to_netcdf:
+ Added fix for ds.encoding['unlimited_dims'] not being updated by xarray
when dropping all time-dependent variables to write out solely the horizontal grid
+ Applying above fix for utf-8 encoding issues
- Grid.extent_lat: added new attribute
- Weights:
+ Will now use "post_mask_source='domain_edge'" setting when remapping a regional grid
via nearest neighbour method, to avoid extrapolation beyond the original source domain
- Tests:
- Added / modified tests for code changes
- Reverted skipping or xfailing tests that used to fail with engine h5netcdf
Pull Request Test Coverage Report for Build 18339990372Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
- Consistent distinction between extent, extent_lon, extent_lat - Adaptive grids with global extent in lon/lat will not exceed -180,180 or 0,360 in lon / -90,90 in lat - Modified tests accordingly - Added tests for yet untested parts of the regrid code to boost coverage
Contributor
Author
|
ToDo: Replace all |
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.
Pull Request Checklist:
What kind of change does this PR introduce?:
regrid.ipynbpsymaps/psyplotdependencyutils/common.py:require_moduleto accept an interval of unsupported versionsutils/dataset_utils.py:get_coord_by_typeto suppress warning about a main variable not being identifiableutils/output_utils.py:fix_netcdf_attrs_encodingand '_fix_str_encodingto fix utf-8 encoding issues for global and variable attributesops/base_operation.py:core/regrid.py:xarrayversion warning correctly triggered for versions outside of compatible version intervalGrid.detect_extent:(lon_extent, lat_extent)instead of justlon_extentGrid._grid_from_ds_adaptive:Grid.to_netcdf:ds.encoding['unlimited_dims']not being updated byxarraywhen dropping all time-dependent variables to write out solely the horizontal gridGrid.extent_lat, Grid.extent_lon: added new attributesWeights:post_mask_source='domain_edge'setting when remapping a regional grid via nearest neighbour method, to avoid extrapolation beyond the original source domain (xESMF PR yet to be approved and merged)engine="h5netcdf"Does this PR introduce a breaking change?:
clisops.core.regrid.Grid.detect_extentnow returns the tuple(lon_extent, lat_extent)rather than justlon_extentGrid.extentnow carries the combined extent in lon and lat direction and no longer just the extent in lon direction. If the grid is consideredglobalin extent of both, lon and lat coordinates,Grid.extentis set to"global"else, it is set to"regional".Grid.extent_lonandGrid.extent_latallow accessing the extent in only lon and lat direction, respectively.Other information:
I can update
HISTORY.rstonce all changes made by the PR are approved and potential feedback worked in.There are currently two
xesmfPRs open (#444 #445) that should be merged and axesmfrelease triggered before merging this in.