Skip to content

Commit

Permalink
Fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Fries authored and aashish24 committed Jun 11, 2016
1 parent 64f378e commit 7f5498b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Packages/vcsaddons/Lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ def createusercontinents(name=None,source="default",x=None,template=None):


def createpolar(name=None, source="default", x=None, template=None):
if "polar_oned" not in gms:
init_polar()
return polar.Gpo(name, source=source, x=x, template=template)


def getpolar(name=None):
if "polar_oned" not in gms:
init_polar()
if name in gms["polar_oned"]:
return gms["polar_oned"][name]
raise KeyError("No Polar GM exists with name '%s'" % name)


if "polar_oned" not in gms:
def init_polar():
# Create nice polar template
try:
t = vcs.createtemplate("polar_oned")
Expand Down Expand Up @@ -58,14 +62,14 @@ def getpolar(name=None):
# Template already exists
pass
# Create some nice default polar GMs
degree_polar = createpolar("degrees", template="polar_oned")
degree_polar = polar.Gpo("degrees", template="polar_oned")
degree_polar.datawc_x1 = 0
degree_polar.datawc_x2 = 360
degree_polar.xticlabels1 = {
i: str(i) for i in range(0, 360, 45)
}

clock_24 = createpolar("diurnal", template="polar_oned")
clock_24 = polar.Gpo("diurnal", template="polar_oned")
clock_24.datawc_x1 = 0
clock_24.datawc_x2 = 24
clock_24.clockwise = True
Expand All @@ -75,8 +79,7 @@ def getpolar(name=None):
i: str(i) for i in range(0, 24, 3)
}


clock_24_meridiem = createpolar("diurnal_12_hour", source="diurnal", template="polar_oned")
clock_24_meridiem = polar.Gpo("diurnal_12_hour", source="diurnal", template="polar_oned")
clock_24_meridiem.xticlabels1 = {
0: "12 AM",
3: "3 AM",
Expand All @@ -88,15 +91,15 @@ def getpolar(name=None):
21: "9 PM"
}

clock_12 = createpolar("semidiurnal", source="diurnal", template="polar_oned")
clock_12 = polar.Gpo("semidiurnal", source="diurnal", template="polar_oned")
clock_12.datawc_x2 = 12
clock_12.xticlabels1 = {
i: str(i) for i in range(3, 13, 3)
}
# 3 on the right
clock_12.theta_offset = -3

annual_cycle = createpolar("annual_cycle", template="polar_oned")
annual_cycle = polar.Gpo("annual_cycle", template="polar_oned")
annual_cycle.datawc_x1 = 1
annual_cycle.datawc_x2 = 13
annual_cycle.clockwise = True
Expand All @@ -117,7 +120,7 @@ def getpolar(name=None):
# Put December on the top
annual_cycle.theta_offset = -2

seasonal = createpolar("seasonal", template="polar_oned")
seasonal = polar.Gpo("seasonal", template="polar_oned")
seasonal.datawc_x1 = 0
seasonal.datawc_x2 = 4
seasonal.xticlabels1 = {0: "DJF", 1: "MAM", 2: "JJA", 3: "SON"}
Expand Down

0 comments on commit 7f5498b

Please sign in to comment.