Fix type errors in calc_rectilinear_lon_edge and calc_rectilinear_lat_edge in grid.py #347
+23
−34
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.
Name and Institution (Required)
Name: Bob Yantosca
Institution: Harvard + GCST
Describe the update
This PR fixes type errors in routines to compute the lon & lat edges of rectilinear grids (in
gcpy/grid.py
). Running this test program:currently results in these errors:
This is because the
num
arguments that are passed to NumPy routinenp.linspace
within these routines are of typefloat
rather than the expectedint
. The solution is to cast these toint
.Expected changes
After the fix, the program works as expected and prints
Sum of global surface area [m2]: 510065624779438.94
NOTE: These routines are not used in the benchmarking code but are user utilities.
Related Github Issue