Skip to content
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

Updated parallelization approach now working for SPI and PET #212

Merged
merged 2 commits into from
Nov 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions climate_indices/indices.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,12 @@ def pet(temperature_celsius, latitude_degrees, data_start_year):
# we started with all NaNs for the temperature, so just return the same
return temperature_celsius

# if we've been passed an array of latitude values then just use
# the first one (useful when applying this function with xarray.GroupBy)
# If we've been passed an array of latitude values then just use
# the first one -- useful when applying this function with xarray.GroupBy
# or numpy.apply_along_axis() where we've had to duplicate values in a 3-D
# array of latitudes in order to correspond with a 3-D array of temperatures.
if isinstance(latitude_degrees, np.ndarray) and (latitude_degrees.size > 1):
latitude_degrees = latitude_degrees[0]
latitude_degrees = latitude_degrees.flat[0]

# make sure we're not dealing with a NaN or out-of-range latitude value
if (
Expand Down
Loading