Commit 5ded7c97 authored by Alex Nunes's avatar Alex Nunes

Minor fix to REI and support files/error message

 Changes to be committed:
	modified:   conda.recipe/meta.yaml
	modified:   docs/conf.py
	modified:   docs/notebooks/receiver_efficiency_index.ipynb.rst
	modified:   py_notebooks/detection_compression.ipynb
	modified:   py_notebooks/interval_data.ipynb
	modified:   py_notebooks/receiver_efficiency_index.ipynb
	modified:   resonate/__init__.py
	modified:   resonate/receiver_efficiency.py
	modified:   setup.py
	modified:   tests/assertion_files/hfx_rei.csv
	modified:   tests/assertion_files/nsbs_compressed.csv
	modified:   tests/assertion_files/nsbs_interval.csv
parent af5a1edc
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": {
......
......@@ -50,17 +50,34 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"from resonate.receiver_efficiency import REI\n",
"\n",
"detections = pd.read_csv('/path/to/detections.csv')\n",
"deployments = pd.read_csv('/path/to/deployments.csv')\n",
"detections = pd.read_csv('../tests/assertion_files/hfx_detections.csv')\n",
"deployments = pd.read_csv('../tests/assertion_files/hfx_deployments.csv')\n",
"\n",
"station_REIs = REI(detections = detections, deployments = deployments)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"station_REIs.to_csv('../tests/assertion_files/hfx_rei.csv', index=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
......@@ -80,7 +97,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"
......@@ -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