Skip to content

Commit 9a5c992

Browse files
authored
Merge pull request #9 from morand-g/main
geoenrich 0.6.4
2 parents 3eec153 + 598dc0d commit 9a5c992

File tree

7 files changed

+19
-7
lines changed

7 files changed

+19
-7
lines changed

.zenodo.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
"license": "GPL-3.0",
2020

21-
"title": "GeoEnrich v0.6.3: a new tool for scientists to painlessly enrich species occurrence data with environmental variables",
21+
"title": "GeoEnrich v0.6.4: a new tool for scientists to painlessly enrich species occurrence data with environmental variables",
2222

2323
"related_identifiers": [
2424
{

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## v0.6.4
2+
3+
#### Bug fixes:
4+
- Fixed bug that occurred when requesting data for surface points in 'nearest_lower' mode.
5+
16
## v0.6.3
27

38
#### New functions

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# **geoenrich 0.6.3**
1+
# **geoenrich 0.6.4**
22

33
[![Read the Docs](https://img.shields.io/readthedocs/geoenrich)](https://geoenrich.readthedocs.io/en/latest/)
44
[![License](https://img.shields.io/github/license/morand-g/geoenrich?color=green)](https://github.com/morand-g/geoenrich/blob/main/LICENSE)

docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
author = 'Gaétan Morand (UMR Marbec)'
2626

2727
# The full version, including alpha/beta/rc tags
28-
release = '0.6.3'
28+
release = '0.6.4'
2929

3030

3131
# -- General configuration ---------------------------------------------------

docs/source/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
geoenrich 0.6.3 documentation
1+
geoenrich 0.6.4 documentation
22
==============================
33

44
|Read the Docs| |License| |PyPI| |Python versions| |Last commit| |DOI|

geoenrich/enrichment.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,15 @@ def calculate_indices(row, dimdict, var, depth_request, downsample):
730730
if depth_request == 'nearest_lower' and pd.notna(row['bestz']):
731731
diffs = (row['bestz'] - dimdict['depth']['vals']).astype('float')
732732
diffs[diffs < 0] = np.nan
733-
d1 = np.nanargmin(diffs)
734-
ind['depth'] = {'min': d1, 'max': d1, 'best': d1, 'step': 1}
733+
734+
if np.isnan(diffs).all():
735+
# Requested depth is inferior to all available depths -> Return surface data
736+
d1 = np.argmin( np.abs( dimdict['depth']['vals'] ) )
737+
ind['depth'] = {'min': d1, 'max': d1, 'best': d1, 'step': 1}
738+
739+
else:
740+
d1 = np.nanargmin(diffs)
741+
ind['depth'] = {'min': d1, 'max': d1, 'best': d1, 'step': 1}
735742

736743
elif depth_request == 'nearest' and pd.notna(row['bestz']):
737744
d1 = np.argmin( np.abs(row['bestz'] - dimdict['depth']['vals'] ) )

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = geoenrich
3-
version = 0.6.3
3+
version = 0.6.4
44
author = Gaétan Morand (UMR Marbec)
55
author_email = gaetan.morand@ird.fr
66
description = A package to enrich your geo-referenced data (e.g. species occurrences) with environmental data.

0 commit comments

Comments
 (0)