Skip to content

Commit fb306a3

Browse files
Sam Friesaashish24
authored andcommitted
Fixed failing tests
1 parent 64f378e commit fb306a3

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

Packages/vcs/vcs/Canvas.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2450,13 +2450,13 @@ def __new_elts(self, original, new):
24502450
def __plot(self, arglist, keyargs):
24512451
import vcsaddons
24522452

2453-
# This routine has five arguments in arglist from _determine_arg_list
2454-
# It adds one for bg and passes those on to Canvas.plot as its sixth
2455-
# arguments.
2453+
# This routine has five arguments in arglist from _determine_arg_list
2454+
# It adds one for bg and passes those on to Canvas.plot as its sixth
2455+
# arguments.
24562456

2457-
# First of all let's remember which elets we have before comin in here
2458-
# so that anything added (temp objects) can be removed at clear
2459-
# time
2457+
# First of all let's remember which elets we have before comin in here
2458+
# so that anything added (temp objects) can be removed at clear
2459+
# time
24602460
original_elts = {}
24612461
new_elts = {}
24622462
for k in vcs.elements.keys():

Packages/vcsaddons/Lib/__init__.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,20 @@ def createusercontinents(name=None,source="default",x=None,template=None):
2020

2121

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

2527

2628
def getpolar(name=None):
29+
if "polar_oned" not in gms:
30+
init_polar()
2731
if name in gms["polar_oned"]:
2832
return gms["polar_oned"][name]
2933
raise KeyError("No Polar GM exists with name '%s'" % name)
3034

3135

32-
if "polar_oned" not in gms:
36+
def init_polar():
3337
# Create nice polar template
3438
try:
3539
t = vcs.createtemplate("polar_oned")
@@ -58,14 +62,14 @@ def getpolar(name=None):
5862
# Template already exists
5963
pass
6064
# Create some nice default polar GMs
61-
degree_polar = createpolar("degrees", template="polar_oned")
65+
degree_polar = polar.Gpo("degrees", template="polar_oned")
6266
degree_polar.datawc_x1 = 0
6367
degree_polar.datawc_x2 = 360
6468
degree_polar.xticlabels1 = {
6569
i: str(i) for i in range(0, 360, 45)
6670
}
6771

68-
clock_24 = createpolar("diurnal", template="polar_oned")
72+
clock_24 = polar.Gpo("diurnal", template="polar_oned")
6973
clock_24.datawc_x1 = 0
7074
clock_24.datawc_x2 = 24
7175
clock_24.clockwise = True
@@ -75,8 +79,7 @@ def getpolar(name=None):
7579
i: str(i) for i in range(0, 24, 3)
7680
}
7781

78-
79-
clock_24_meridiem = createpolar("diurnal_12_hour", source="diurnal", template="polar_oned")
82+
clock_24_meridiem = polar.Gpo("diurnal_12_hour", source="diurnal", template="polar_oned")
8083
clock_24_meridiem.xticlabels1 = {
8184
0: "12 AM",
8285
3: "3 AM",
@@ -88,15 +91,15 @@ def getpolar(name=None):
8891
21: "9 PM"
8992
}
9093

91-
clock_12 = createpolar("semidiurnal", source="diurnal", template="polar_oned")
94+
clock_12 = polar.Gpo("semidiurnal", source="diurnal", template="polar_oned")
9295
clock_12.datawc_x2 = 12
9396
clock_12.xticlabels1 = {
9497
i: str(i) for i in range(3, 13, 3)
9598
}
9699
# 3 on the right
97100
clock_12.theta_offset = -3
98101

99-
annual_cycle = createpolar("annual_cycle", template="polar_oned")
102+
annual_cycle = polar.Gpo("annual_cycle", template="polar_oned")
100103
annual_cycle.datawc_x1 = 1
101104
annual_cycle.datawc_x2 = 13
102105
annual_cycle.clockwise = True
@@ -117,7 +120,7 @@ def getpolar(name=None):
117120
# Put December on the top
118121
annual_cycle.theta_offset = -2
119122

120-
seasonal = createpolar("seasonal", template="polar_oned")
123+
seasonal = polar.Gpo("seasonal", template="polar_oned")
121124
seasonal.datawc_x1 = 0
122125
seasonal.datawc_x2 = 4
123126
seasonal.xticlabels1 = {0: "DJF", 1: "MAM", 2: "JJA", 3: "SON"}

0 commit comments

Comments
 (0)