Commit df5cfcaa authored by Alex Nunes's avatar Alex Nunes

Merge branch 'dev' into 'master'

Minor change to filter to avoid copy warning

See merge request otndc/resonate!32
parents 312ebb62 05f80637
package:
name: resonate
version: "1.0.6"
version: "1.0.7"
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.6'
version = 'v1.0.7'
# The full version, including alpha/beta/rc tags.
release = 'v1.0.6'
release = 'v1.0.7'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -29,3 +29,4 @@ Or use the standard plotting function to save as HTML:
.. code:: python
abacus_plot(df, ipython_display=False, filename='example.html')
......@@ -59,3 +59,4 @@ you’d like to create a subset from.
# Output the subset data to a new CSV in the indicated directory
data_column_subset.to_csv(directory+column+"_"+value.replace(" ", "_")+"_"+filename, index=False)
......@@ -68,3 +68,4 @@ file to a desired location.
.. code:: python
interval.to_csv('/path/to/output.csv', index=False)
__author__ = "Alex Nunes"
__credits__ = ["Alex Nunes", "Jon Pye", "Brian Jones", "Marta Mihoff"]
__license__ = "GPL"
__version__ = "1.0.6"
__version__ = "1.0.7"
__maintainer__ = "Alex Nunes"
__email__ = "anunes@dal.ca"
__status__ = "Production"
......@@ -3,6 +3,7 @@ from datetime import datetime, timedelta
import numpy as np
import pandas as pd
from geopy.distance import geodesic
from resonate.library.exceptions import GenericException
......@@ -82,16 +83,17 @@ def filter_detections(detections, suspect_file=None,
# If the space before + after > min_time_buffer
# Remove that detection row from the detections and add it to suspect detections.
# SQL that does this is in load_to_postgresql under createSuspect
detections = detections.copy(deep=True)
ind = detections['catalognumber'].unique()
detections['datecollected'] = pd.to_datetime(
detections.loc[:, 'datecollected'] = pd.to_datetime(
detections['datecollected'])
user_int = timedelta(seconds=min_time_buffer)
good_dets = pd.DataFrame()
susp_dets = pd.DataFrame()
grouped = detections.groupby('catalognumber')
for anm in ind:
anm_dets = grouped.get_group(anm)
anm_dets = grouped.get_group(anm).sort_values(
'datecollected', ascending=True)
intervals = anm_dets['datecollected'] - \
anm_dets['datecollected'].shift(1)
post_intervals = anm_dets['datecollected'].shift(
......
......@@ -12,7 +12,7 @@ with open('LICENSE') as f:
setup(
name='resonATe',
version='1.0.6',
version='1.0.7',
description='resonate data analysis package',
long_description=readme,
author='Alex Nunes',
......
This diff is collapsed.
......@@ -4,8 +4,9 @@ import unittest
import pandas as pd
import pandas.testing as pt
from colorama import Fore as c
from resonate.filters import (distance_filter, filter_detections,
velocity_filter)
velocity_filter)
class FilterTest(unittest.TestCase):
......
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