From 3a4f734191fca3da5fe321736ce7576262bf933e Mon Sep 17 00:00:00 2001
From: Jeremy Fee <jmfee@usgs.gov>
Date: Tue, 26 Jan 2016 13:35:22 -0700
Subject: [PATCH] Add cls parameter to classmethods

---
 geomagio/algorithm/SqDistAlgorithm.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/geomagio/algorithm/SqDistAlgorithm.py b/geomagio/algorithm/SqDistAlgorithm.py
index 2905055b5..5180b78d9 100644
--- a/geomagio/algorithm/SqDistAlgorithm.py
+++ b/geomagio/algorithm/SqDistAlgorithm.py
@@ -41,7 +41,7 @@ class SqDistAlgorithm(Algorithm):
         pass
 
     @classmethod
-    def additive(yobs, m, alpha, beta, gamma, phi=1,
+    def additive(cls, yobs, m, alpha, beta, gamma, phi=1,
                  yhat0=None, s0=None, l0=None, b0=None, sigma0=None,
                  zthresh=6, fc=0, hstep=0):
         """Primary function for Holt-Winters smoothing/forecasting with
@@ -287,8 +287,8 @@ class SqDistAlgorithm(Algorithm):
                 gamma)
 
     @classmethod
-    def estimate_parameters(yobs, m, alpha=None, beta=None, gamma=None, phi=1,
-            yhat0=None, s0=None, l0=None, b0=None, sigma0=None,
+    def estimate_parameters(cls, yobs, m, alpha=None, beta=None, gamma=None,
+            phi=1, yhat0=None, s0=None, l0=None, b0=None, sigma0=None,
             zthresh=6, fc=0, hstep=0,
             alpha0=0.3, beta0=0.1, gamma0=0.1):
         """Estimate alpha, beta, and gamma parameters based on observed data.
@@ -378,7 +378,7 @@ class SqDistAlgorithm(Algorithm):
             # extract parameters to fit
             alpha, beta, gamma = params
             # call Holt-Winters with additive seasonality
-            yhat, _, _, _, _, _, _, _, _, _, _ = SqDistAlgorithm.additive(
+            yhat, _, _, _, _, _, _, _, _, _, _ = cls.additive(
                     yobs, m,
                     alpha=alpha, beta=beta, gamma=gamma, l0=l0, b0=b0, s0=s0,
                     zthresh=zthresh, hstep=hstep)
-- 
GitLab