From 51d60ec37c870e3bb5cf11c5aa9ea9e71e01334e Mon Sep 17 00:00:00 2001
From: Marcus Herrmann <marcus.herrmann@sed.ethz.ch>
Date: Thu, 10 Nov 2016 18:40:37 +0100
Subject: [PATCH] Update to v0.2.0 (+ a fix)

---
 TM/eventops.py | 9 ++++-----
 version        | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/TM/eventops.py b/TM/eventops.py
index 61e5d1b..6136332 100644
--- a/TM/eventops.py
+++ b/TM/eventops.py
@@ -501,17 +501,16 @@ def assocMagnitude(foundEvents, catalog, catalogType='SED', position=-1, onlyMis
         [x.insert(position, float('NaN')) for x in foundEvents]
         numCols += 1
 
-        prevInd = 0  # To speed up operations on a long list
+        eventInd = 0  # To speed up operations on a long list
         # Associate each catalog event with a corresponding detection
         for catalogEvent in catalog:
             # Get the event index + amplitude of an event that is within the time tolerance
-            eventSel = [(x, y[1]) for (x, y) in enumerate(foundEvents[prevInd:])
+            eventSel = [(x, y[1]) for (x, y) in enumerate(foundEvents[eventInd:])
                         if abs(y[0] - catalogEvent[1]) <= timeTol]
             if eventSel and onlyMissing is False:
                 # Associate to the one with highest amplitude
-                eventInd = max(eventSel, key=itemgetter(1))[0]
-                foundEvents[eventInd+prevInd][position] = catalogEvent[2]
-                prevInd = eventInd
+                eventInd += max(eventSel, key=itemgetter(1))[0]
+                foundEvents[eventInd][position] = catalogEvent[2]
             elif not eventSel:
                 # If it's not in the list, take it in!
                 #    Create an "empty" event ('-2': disregard time, Amp, and CC)
diff --git a/version b/version
index d917d3e..0ea3a94 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-0.1.2
+0.2.0
-- 
GitLab