Commit 12705b02 authored by Alex Nunes's avatar Alex Nunes

Merge branch 'dev' into 'master'

Fixes to manadtory column errors and test files

See merge request otndc/resonate!30
parents bb3de61b 105d5890
......@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [1.0.4]
### Fixed
- Fixed error raised when passing non-compatible data to `REI`
- Fixed test files
## [1.0.3]
### Fixed
......
......@@ -3,7 +3,7 @@ python setup.py sdist
twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*;
twine upload --skip-existing dist/*;
rm -f ~/anaconda3/conda-bld/osx-64/resonate*;
conda-build conda.recipe &&
conda-build conda.recipe -c conda-forge &&
rm -rf conda-dist &&
mkdir conda-dist;
mkdir conda-dist/osx-64;
......
package:
name: resonate
version: "1.0.3"
version: "1.0.4"
source:
git_rev: master
......
......@@ -76,9 +76,9 @@ copyright = u'2017 Ocean Tracking Network. All Rights Reserved.'
# built documents.
#
# The short X.Y version.
version = 'v1.0.3'
version = 'v1.0.4'
# The full version, including alpha/beta/rc tags.
release = 'v1.0.3'
release = 'v1.0.4'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -15,10 +15,16 @@ project-specific designs to large-scale, multispecies, cooperative
networks <https://doi.org/10.1016/j.fishres.2018.09.015>`__. Each
receiver’s index is calculated on the formula of:
.. container:: large-math
.. raw:: html
<div class="large-math">
REI =
:math:`\frac{T_r}{T_a} \times \frac{S_r}{S_a} \times \frac{DD_r}{DD_a} \times \frac{D_a}{D_r}`
.. raw:: html
REI =
:math:`\frac{T_r}{T_a} \times \frac{S_r}{S_a} \times \frac{DD_r}{DD_a} \times \frac{D_a}{D_r}`
</div>
.. raw:: html
......
......@@ -53,7 +53,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python [default]",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
......@@ -67,7 +67,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.7.2"
},
"varInspector": {
"cols": {
......
......@@ -123,7 +123,7 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [default]",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
......@@ -137,7 +137,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.7.2"
},
"varInspector": {
"cols": {
......
......@@ -80,7 +80,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.7.2"
},
"varInspector": {
"cols": {
......
__author__ = "Alex Nunes"
__credits__ = ["Alex Nunes", "Jon Pye", "Brian Jones", "Marta Mihoff"]
__license__ = "GPL"
__version__ = "1.0.3"
__version__ = "1.0.4"
__maintainer__ = "Alex Nunes"
__email__ = "anunes@dal.ca"
__status__ = "Production"
......@@ -33,9 +33,9 @@ def REI(detections, deployments):
detections = detections.copy(deep=True)
if deployments.recovery_date.dtype != np.dtype('<M8[ns]'):
deployments['recovery_notes'] = deployments.recovery_date.str.extract(
'([A-Za-z\//:]+)', expand=False)
r'([A-Za-z\//:]+)', expand=False)
deployments.recovery_date = deployments.recovery_date.str.extract(
'(\d+-\d+-\d+)', expand=False)
r'(\d+-\d+-\d+)', expand=False)
deployments = deployments.replace('-', np.nan)
deployments.loc[deployments.recovery_date.isnull(
), 'recovery_date'] = deployments.last_download
......@@ -63,7 +63,7 @@ def REI(detections, deployments):
array_unique_species = len(detections.scientificname.unique())
days_with_detections = len(pd.to_datetime(
detections.datecollected).dt.date.unique())
array_days_active = (max(deployments.last_download.max(
array_days_active = (max(deployments.last_download.fillna(deployments.deploy_date.min()).max(
), deployments.recovery_date.max()) - min(deployments.deploy_date)).days
station_reis = pd.DataFrame(columns=['station', 'rei'])
......@@ -98,11 +98,11 @@ def REI(detections, deployments):
print("No valid deployment record for " + name)
# Normalize REIs to value from 0 to 1
station_reis.rei = station_reis.rei / station_reis.rei.sum()
# station_reis.rei = station_reis.rei / station_reis.rei.sum()
# Cleanup and return the station REI's
del deployments
return station_reis
else:
raise GenericException("Missing required input columns: {}".format(
mandatory_columns - set(detections.columns)))
mandatory_detection_columns - set(detections.columns)))
......@@ -12,7 +12,7 @@ with open('LICENSE') as f:
setup(
name='resonATe',
version='1.0.3',
version='1.0.4',
description='resonate data analysis package',
long_description=readme,
author='Alex Nunes',
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment