Private
Public Access
1
0

a wrapper around the task queue

This commit is contained in:
Sander Roosendaal
2017-10-31 11:12:00 +01:00
parent 092d24d9b2
commit 8c31f5b778
3 changed files with 85 additions and 133 deletions

View File

@@ -2,6 +2,8 @@ import math
import numpy as np
import pandas as pd
import colorsys
from django.conf import settings
lbstoN = 4.44822
@@ -100,7 +102,7 @@ def range_to_color_hex(groupcols,palette='monochrome_blue'):
try:
plt = palettes[palette]
except KeyErro:
except KeyError:
plt = palettes['monochrome_blue']
rgb = [colorsys.hsv_to_rgb((plt[0]+plt[1]*x)/360.,
@@ -214,3 +216,12 @@ def isbreakthrough(delta,cpvalues,p0,p1,p2,p3,ratio):
return res>1,btdf,res2>1
def myqueue(queue,function,*args,**kwargs):
if settings.DEBUG:
job = function.delay(*args,**kwargs)
else:
job = queue.enqueue(function,*args,**kwargs)
return job