Skip to content

Commit fc0bc29

Browse files
committedNov 1, 2018
Make PEP8 compliant
1 parent 588fe9f commit fc0bc29

File tree

5 files changed

+114
-85
lines changed

5 files changed

+114
-85
lines changed
 

‎setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 110

‎setup.py

+50-50
Original file line numberDiff line numberDiff line change
@@ -50,58 +50,58 @@
5050
'winmap.c', 'xml.c', 'zoommap.c')
5151

5252
# List the erfa source files required by AST.
53-
erfa_c = ( 'a2af.c', 'a2tf.c', 'ab.c', 'af2a.c', 'anp.c', 'anpm.c',
54-
'apcg.c', 'apcg13.c', 'apci.c', 'apci13.c', 'apco.c',
55-
'apco13.c', 'apcs.c', 'apcs13.c', 'aper.c', 'aper13.c',
56-
'apio.c', 'apio13.c', 'atci13.c', 'atciq.c', 'atciqn.c',
57-
'atciqz.c', 'atco13.c', 'atic13.c', 'aticq.c', 'aticqn.c',
58-
'atio13.c', 'atioq.c', 'atoc13.c', 'atoi13.c', 'atoiq.c',
59-
'bi00.c', 'bp00.c', 'bp06.c', 'bpn2xy.c', 'c2i00a.c',
60-
'c2i00b.c', 'c2i06a.c', 'c2ibpn.c', 'c2ixy.c', 'c2ixys.c',
61-
'c2s.c', 'c2t00a.c', 'c2t00b.c', 'c2t06a.c', 'c2tcio.c',
62-
'c2teqx.c', 'c2tpe.c', 'c2txy.c', 'cal2jd.c', 'cp.c', 'cpv.c',
63-
'cr.c', 'd2dtf.c', 'd2tf.c', 'dat.c', 'dtdb.c', 'dtf2d.c',
64-
'eceq06.c', 'ecm06.c', 'ee00.c', 'ee00a.c', 'ee00b.c',
65-
'ee06a.c', 'eect00.c', 'eform.c', 'eo06a.c', 'eors.c', 'epb.c',
66-
'epb2jd.c', 'epj.c', 'epj2jd.c', 'epv00.c', 'eqec06.c',
67-
'eqeq94.c', 'era00.c', 'fad03.c', 'fae03.c', 'faf03.c',
68-
'faju03.c', 'fal03.c', 'falp03.c', 'fama03.c', 'fame03.c',
69-
'fane03.c', 'faom03.c', 'fapa03.c', 'fasa03.c', 'faur03.c',
70-
'fave03.c', 'fk52h.c', 'fk5hip.c', 'fk5hz.c', 'fw2m.c',
71-
'fw2xy.c', 'g2icrs.c', 'gc2gd.c', 'gc2gde.c', 'gd2gc.c',
72-
'gd2gce.c', 'gmst00.c', 'gmst06.c', 'gmst82.c', 'gst00a.c',
73-
'gst00b.c', 'gst06.c', 'gst06a.c', 'gst94.c', 'h2fk5.c',
74-
'hfk5z.c', 'icrs2g.c', 'ir.c', 'jd2cal.c', 'jdcalf.c', 'ld.c',
75-
'ldn.c', 'ldsun.c', 'lteceq.c', 'ltecm.c', 'lteqec.c', 'ltp.c',
76-
'ltpb.c', 'ltpecl.c', 'ltpequ.c', 'num00a.c', 'num00b.c',
77-
'num06a.c', 'numat.c', 'nut00a.c', 'nut00b.c', 'nut06a.c',
78-
'nut80.c', 'nutm80.c', 'obl06.c', 'obl80.c', 'p06e.c', 'p2pv.c',
79-
'p2s.c', 'pap.c', 'pas.c', 'pb06.c', 'pdp.c', 'pfw06.c',
80-
'plan94.c', 'pm.c', 'pmat00.c', 'pmat06.c', 'pmat76.c', 'pmp.c',
81-
'pmpx.c', 'pmsafe.c', 'pn.c', 'pn00.c', 'pn00a.c', 'pn00b.c',
82-
'pn06.c', 'pn06a.c', 'pnm00a.c', 'pnm00b.c', 'pnm06a.c',
83-
'pnm80.c', 'pom00.c', 'ppp.c', 'ppsp.c', 'pr00.c', 'prec76.c',
84-
'pv2p.c', 'pv2s.c', 'pvdpv.c', 'pvm.c', 'pvmpv.c', 'pvppv.c',
85-
'pvstar.c', 'pvtob.c', 'pvu.c', 'pvup.c', 'pvxpv.c', 'pxp.c',
86-
'refco.c', 'rm2v.c', 'rv2m.c', 'rx.c', 'rxp.c', 'rxpv.c',
87-
'rxr.c', 'ry.c', 'rz.c', 's00.c', 's00a.c', 's00b.c', 's06.c',
88-
's06a.c', 's2c.c', 's2p.c', 's2pv.c', 's2xpv.c', 'sepp.c',
89-
'seps.c', 'sp00.c', 'starpm.c', 'starpv.c', 'sxp.c', 'sxpv.c',
90-
't_erfa_c.c', 'taitt.c', 'taiut1.c', 'taiutc.c', 'tcbtdb.c',
91-
'tcgtt.c', 'tdbtcb.c', 'tdbtt.c', 'tf2a.c', 'tf2d.c', 'tr.c',
92-
'trxp.c', 'trxpv.c', 'tttai.c', 'tttcg.c', 'tttdb.c', 'ttut1.c',
93-
'ut1tai.c', 'ut1tt.c', 'ut1utc.c', 'utctai.c', 'utcut1.c',
94-
'xy06.c', 'xys00a.c', 'xys00b.c', 'xys06a.c', 'zp.c', 'zpv.c',
95-
'zr.c')
53+
erfa_c = ('a2af.c', 'a2tf.c', 'ab.c', 'af2a.c', 'anp.c', 'anpm.c',
54+
'apcg.c', 'apcg13.c', 'apci.c', 'apci13.c', 'apco.c',
55+
'apco13.c', 'apcs.c', 'apcs13.c', 'aper.c', 'aper13.c',
56+
'apio.c', 'apio13.c', 'atci13.c', 'atciq.c', 'atciqn.c',
57+
'atciqz.c', 'atco13.c', 'atic13.c', 'aticq.c', 'aticqn.c',
58+
'atio13.c', 'atioq.c', 'atoc13.c', 'atoi13.c', 'atoiq.c',
59+
'bi00.c', 'bp00.c', 'bp06.c', 'bpn2xy.c', 'c2i00a.c',
60+
'c2i00b.c', 'c2i06a.c', 'c2ibpn.c', 'c2ixy.c', 'c2ixys.c',
61+
'c2s.c', 'c2t00a.c', 'c2t00b.c', 'c2t06a.c', 'c2tcio.c',
62+
'c2teqx.c', 'c2tpe.c', 'c2txy.c', 'cal2jd.c', 'cp.c', 'cpv.c',
63+
'cr.c', 'd2dtf.c', 'd2tf.c', 'dat.c', 'dtdb.c', 'dtf2d.c',
64+
'eceq06.c', 'ecm06.c', 'ee00.c', 'ee00a.c', 'ee00b.c',
65+
'ee06a.c', 'eect00.c', 'eform.c', 'eo06a.c', 'eors.c', 'epb.c',
66+
'epb2jd.c', 'epj.c', 'epj2jd.c', 'epv00.c', 'eqec06.c',
67+
'eqeq94.c', 'era00.c', 'fad03.c', 'fae03.c', 'faf03.c',
68+
'faju03.c', 'fal03.c', 'falp03.c', 'fama03.c', 'fame03.c',
69+
'fane03.c', 'faom03.c', 'fapa03.c', 'fasa03.c', 'faur03.c',
70+
'fave03.c', 'fk52h.c', 'fk5hip.c', 'fk5hz.c', 'fw2m.c',
71+
'fw2xy.c', 'g2icrs.c', 'gc2gd.c', 'gc2gde.c', 'gd2gc.c',
72+
'gd2gce.c', 'gmst00.c', 'gmst06.c', 'gmst82.c', 'gst00a.c',
73+
'gst00b.c', 'gst06.c', 'gst06a.c', 'gst94.c', 'h2fk5.c',
74+
'hfk5z.c', 'icrs2g.c', 'ir.c', 'jd2cal.c', 'jdcalf.c', 'ld.c',
75+
'ldn.c', 'ldsun.c', 'lteceq.c', 'ltecm.c', 'lteqec.c', 'ltp.c',
76+
'ltpb.c', 'ltpecl.c', 'ltpequ.c', 'num00a.c', 'num00b.c',
77+
'num06a.c', 'numat.c', 'nut00a.c', 'nut00b.c', 'nut06a.c',
78+
'nut80.c', 'nutm80.c', 'obl06.c', 'obl80.c', 'p06e.c', 'p2pv.c',
79+
'p2s.c', 'pap.c', 'pas.c', 'pb06.c', 'pdp.c', 'pfw06.c',
80+
'plan94.c', 'pm.c', 'pmat00.c', 'pmat06.c', 'pmat76.c', 'pmp.c',
81+
'pmpx.c', 'pmsafe.c', 'pn.c', 'pn00.c', 'pn00a.c', 'pn00b.c',
82+
'pn06.c', 'pn06a.c', 'pnm00a.c', 'pnm00b.c', 'pnm06a.c',
83+
'pnm80.c', 'pom00.c', 'ppp.c', 'ppsp.c', 'pr00.c', 'prec76.c',
84+
'pv2p.c', 'pv2s.c', 'pvdpv.c', 'pvm.c', 'pvmpv.c', 'pvppv.c',
85+
'pvstar.c', 'pvtob.c', 'pvu.c', 'pvup.c', 'pvxpv.c', 'pxp.c',
86+
'refco.c', 'rm2v.c', 'rv2m.c', 'rx.c', 'rxp.c', 'rxpv.c',
87+
'rxr.c', 'ry.c', 'rz.c', 's00.c', 's00a.c', 's00b.c', 's06.c',
88+
's06a.c', 's2c.c', 's2p.c', 's2pv.c', 's2xpv.c', 'sepp.c',
89+
'seps.c', 'sp00.c', 'starpm.c', 'starpv.c', 'sxp.c', 'sxpv.c',
90+
't_erfa_c.c', 'taitt.c', 'taiut1.c', 'taiutc.c', 'tcbtdb.c',
91+
'tcgtt.c', 'tdbtcb.c', 'tdbtt.c', 'tf2a.c', 'tf2d.c', 'tr.c',
92+
'trxp.c', 'trxpv.c', 'tttai.c', 'tttcg.c', 'tttdb.c', 'ttut1.c',
93+
'ut1tai.c', 'ut1tt.c', 'ut1utc.c', 'utctai.c', 'utcut1.c',
94+
'xy06.c', 'xys00a.c', 'xys00b.c', 'xys06a.c', 'zp.c', 'zpv.c',
95+
'zr.c')
9696

9797
# List the C source files for unimplemeneted AST classes:
98-
ast_c_extra = ( 'chebymap.c', 'fchebymap.c', 'fitstable.c',
99-
'funitnormmap.c', 'intramap.c', 'plot3d.c',
100-
'selectormap.c', 'slamap.c', 'specmap.c', 'stc.c',
101-
'stccatalogentrylocation.c', 'stcobsdatalocation.c',
102-
'stcresourceprofile.c', 'stcsearchlocation.c',
103-
'switchmap.c', 'table.c', 'unitnormmap.c',
104-
'xmlchan.c')
98+
ast_c_extra = ('chebymap.c', 'fchebymap.c', 'fitstable.c',
99+
'funitnormmap.c', 'intramap.c', 'plot3d.c',
100+
'selectormap.c', 'slamap.c', 'specmap.c', 'stc.c',
101+
'stccatalogentrylocation.c', 'stcobsdatalocation.c',
102+
'stcresourceprofile.c', 'stcsearchlocation.c',
103+
'switchmap.c', 'table.c', 'unitnormmap.c',
104+
'xmlchan.c')
105105

106106
# Initialise the list of sources files needed to build the starlink.Ast
107107
# module.

‎starlink/Grf.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def find_renderer(self, fig):
149149
import io
150150
fig.canvas.print_pdf(io.BytesIO())
151151
self.renderer = fig._cachedRenderer
152-
except:
152+
except Exception:
153153
pass
154154

155155
if not self.renderer:
@@ -374,7 +374,6 @@ def TxExt(self, text, x, y, just, upx, upy):
374374
return (wcs_verts[0][0], wcs_verts[1][0], wcs_verts[2][0], wcs_verts[3][0],
375375
wcs_verts[0][1], wcs_verts[1][1], wcs_verts[2][1], wcs_verts[3][1])
376376

377-
378377
# ------------------------------------------------------------------------
379378
def ColToInt(self, colour):
380379
result = -1
@@ -413,7 +412,6 @@ def ColToInt(self, colour):
413412

414413
return result
415414

416-
417415
# ------------------------------------------------------------------------
418416
def IntToCol(self, colour):
419417
result = None

‎starlink/ast/test/test.py

+57-30
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import numpy
55
import math
66
import filecmp
7-
import string
87
import sys
98
import os.path
109
import os
@@ -165,7 +164,7 @@ def test_Static(self):
165164

166165
def test_Object(self):
167166
with self.assertRaises(TypeError):
168-
obj = starlink.Ast.Object()
167+
starlink.Ast.Object()
169168

170169
def test_ZoomMap(self):
171170
zoommap = starlink.Ast.ZoomMap(1, 1.2)
@@ -323,7 +322,7 @@ def test_FrameConvert(self):
323322
self.assertIsInstance(fset, starlink.Ast.FrameSet)
324323
self.assertEqual(fset.Nframe, 2)
325324
fset2 = fset.findframe(nframe)
326-
self.assertIsInstance(fset, starlink.Ast.FrameSet)
325+
self.assertIsInstance(fset2, starlink.Ast.FrameSet)
327326

328327
def test_FrameResolve(self):
329328
frame = starlink.Ast.Frame(2)
@@ -356,20 +355,20 @@ def test_FrameSet(self):
356355
self.assertTrue(frame2.same(frame))
357356
mapping = frameset.getmapping(1, 2)
358357
self.assertIsInstance(mapping, starlink.Ast.UnitMap)
359-
( ok, nnode, iframen, mapn, parent ) = frameset.getnode( 1 )
360-
framen = frameset.getframe( iframen )
358+
ok, nnode, iframen, mapn, parent = frameset.getnode(1)
359+
framen = frameset.getframe(iframen)
361360
self.assertTrue(ok)
362-
self.assertEqual(nnode,2)
363-
self.assertEqual(str(framen),str(frame2a))
364-
self.assertEqual(str(mapn),str(map2a))
365-
self.assertEqual(parent,0)
361+
self.assertEqual(nnode, 2)
362+
self.assertEqual(str(framen), str(frame2a))
363+
self.assertEqual(str(mapn), str(map2a))
364+
self.assertEqual(parent, 0)
366365
frameset.remapframe(1, starlink.Ast.UnitMap(2))
367366
frameset.removeframe(1)
368367
self.assertEqual(frameset.Nframe, 1)
369368

370369
def test_Mapping(self):
371370
with self.assertRaises(TypeError):
372-
mapping = starlink.Ast.Mapping()
371+
starlink.Ast.Mapping()
373372
zoommap = starlink.Ast.ZoomMap(1, 1.2)
374373
map1, map2, series, invert1, invert2 = zoommap.decompose()
375374
self.assertIsInstance(map1, starlink.Ast.ZoomMap)
@@ -693,7 +692,7 @@ def test_Circle(self):
693692
[0, 0], 5)
694693
overlap = circle.overlap(testcircle)
695694
self.assertEqual(overlap, 5)
696-
(centre,radius,p1) = circle.circlepars()
695+
centre, radius, p1 = circle.circlepars()
697696
self.assertEqual(centre[0], 0)
698697
self.assertEqual(centre[1], 0)
699698
self.assertEqual(radius, 5)
@@ -706,16 +705,16 @@ def test_Ellipse(self):
706705
self.assertIsInstance(ell, starlink.Ast.Ellipse)
707706
self.assertIsInstance(ell, starlink.Ast.Region)
708707
self.assertIsInstance(ell, starlink.Ast.Frame)
709-
(centre,a,b,angle,p1,p2) = ell.ellipsepars()
708+
centre, a, b, angle, p1, p2 = ell.ellipsepars()
710709
self.assertEqual(centre[0], 0)
711710
self.assertEqual(centre[1], 0)
712-
self.assertEqual(a, 5 )
713-
self.assertAlmostEqual(b, 0.28819520885211775 )
714-
self.assertAlmostEqual(angle, 0.6435011087932844 )
711+
self.assertEqual(a, 5)
712+
self.assertAlmostEqual(b, 0.28819520885211775)
713+
self.assertAlmostEqual(angle, 0.6435011087932844)
715714
self.assertEqual(p1[0], 3)
716715
self.assertEqual(p1[1], 4)
717-
self.assertAlmostEqual(p2[0], 0.23055617 )
718-
self.assertAlmostEqual(p2[1], -0.17291713 )
716+
self.assertAlmostEqual(p2[0], 0.23055617)
717+
self.assertAlmostEqual(p2[1], -0.17291713)
719718

720719
def test_NullRegion(self):
721720
null = starlink.Ast.NullRegion(starlink.Ast.Frame(2))
@@ -838,7 +837,8 @@ def test_FitsChan(self):
838837
fc.emptyfits()
839838
self.assertEqual(fc.Ncard, 0)
840839

841-
cards = "CRVAL1 = 0 CRVAL2 = 0 "
840+
cards = "CRVAL1 = 0 " \
841+
"CRVAL2 = 0 "
842842
fc.putcards(cards)
843843
self.assertEqual(fc.Card, 1)
844844
fc.set("Card=10")
@@ -854,19 +854,22 @@ def test_FitsChan(self):
854854
self.assertEqual(fc.Encoding, "FITS-WCS")
855855
there, card = fc.findfits("%f", False)
856856
self.assertTrue(there)
857-
self.assertEqual(card, "CRVAL1 = 0 ")
857+
self.assertEqual(card,
858+
"CRVAL1 = 0 ")
858859
fc.delfits()
859860
self.assertEqual(fc.Ncard, 9)
860861
self.assertEqual(fc.Card, 9)
861862
there, card = fc.findfits("%f", False)
862863
self.assertTrue(there)
863-
self.assertEqual(card, "CRVAL2 = 0 ")
864+
self.assertEqual(card,
865+
"CRVAL2 = 0 ")
864866
fc.putfits("CRVAL1 = 0", False)
865867
self.assertEqual(fc.Ncard, 10)
866868
self.assertEqual(fc.Card, 10)
867869
there, card = fc.findfits("%f", False)
868870
self.assertTrue(there)
869-
self.assertEqual(card, "CRVAL2 = 0 ")
871+
self.assertEqual(card,
872+
"CRVAL2 = 0 ")
870873

871874
for cards in zip(fc, mycards):
872875
self.assertEqual(cards[0], cards[1])
@@ -966,12 +969,14 @@ def test_FitsChan_AsMapping(self):
966969
self.assertTrue("NAXIS1" in fc)
967970

968971
self.assertEqual(len(fc), 10)
969-
self.assertEqual(fc[2], "CTYPE1 = 'RA--TAN ' ")
972+
self.assertEqual(fc[2],
973+
"CTYPE1 = 'RA--TAN ' ")
970974
obj = fc.read()
975+
self.assertIsInstance(obj, starlink.Ast.FrameSet)
971976
self.assertEqual(len(fc), 2)
972977

973978
with self.assertRaises(KeyError):
974-
a = fc["CRVAL1"]
979+
fc["CRVAL1"]
975980

976981
self.assertEqual(fc["NAXIS1"], 200)
977982
fc["NAXIS2"] = None
@@ -992,13 +997,15 @@ def test_FitsChan_AsMapping(self):
992997
self.assertEqual(len(fc), 2)
993998

994999
fc[100] = "CTYPE1 = 'RA--TAN ' "
995-
self.assertEqual(fc[2], "CTYPE1 = 'RA--TAN ' ")
1000+
self.assertEqual(fc[2],
1001+
"CTYPE1 = 'RA--TAN ' ")
9961002
self.assertEqual(fc.Ncard, 3)
9971003
self.assertEqual(fc.Nkey, 3)
9981004
self.assertEqual(len(fc), 3)
9991005

10001006
fc[0] = "NEWKEY = 123.456"
1001-
self.assertEqual(fc[0], "NEWKEY = 123.456 ")
1007+
self.assertEqual(fc[0],
1008+
"NEWKEY = 123.456 ")
10021009
self.assertEqual(fc.Ncard, 3)
10031010
self.assertEqual(fc.Nkey, 3)
10041011
self.assertEqual(len(fc), 3)
@@ -1103,18 +1110,38 @@ def test_Plot(self):
11031110

11041111
plot.border()
11051112

1106-
self.assertAlmostEqual(mygrf.linex, [0.0, 0.071428574621677399, 0.1428571492433548, 0.2142857164144516, 0.28571429848670959, 0.3571428656578064, 0.4285714328289032, 0.5, 0.57142859697341919, 0.6428571343421936, 0.71428573131561279, 0.78571426868438721, 0.8571428656578064, 0.92857140302658081, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1107-
1.0, 1.0, 1.0, 1.0, 0.92857140302658081, 0.8571428656578064, 0.78571426868438721, 0.71428573131561279, 0.6428571343421936, 0.57142859697341919, 0.5, 0.4285714328289032, 0.3571428656578064, 0.28571429848670959, 0.2142857164144516, 0.1428571492433548, 0.071428574621677399, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0])
1108-
self.assertAlmostEqual(mygrf.liney, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.071428574621677399, 0.1428571492433548, 0.2142857164144516, 0.28571429848670959, 0.3571428656578064, 0.4285714328289032, 0.5, 0.57142859697341919, 0.6428571343421936, 0.71428573131561279, 0.78571426868438721, 0.8571428656578064,
1109-
0.92857140302658081, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.92857140302658081, 0.8571428656578064, 0.78571426868438721, 0.71428573131561279, 0.6428571343421936, 0.57142859697341919, 0.5, 0.4285714328289032, 0.3571428656578064, 0.28571429848670959, 0.2142857164144516, 0.1428571492433548, 0.071428574621677399, 0.0])
1113+
self.assertAlmostEqual(mygrf.linex,
1114+
[0.0, 0.071428574621677399, 0.1428571492433548, 0.2142857164144516,
1115+
0.28571429848670959, 0.3571428656578064, 0.4285714328289032, 0.5,
1116+
0.57142859697341919, 0.6428571343421936, 0.71428573131561279,
1117+
0.78571426868438721, 0.8571428656578064, 0.92857140302658081,
1118+
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1119+
1.0, 1.0, 1.0, 1.0, 0.92857140302658081, 0.8571428656578064,
1120+
0.78571426868438721, 0.71428573131561279, 0.6428571343421936,
1121+
0.57142859697341919, 0.5, 0.4285714328289032, 0.3571428656578064,
1122+
0.28571429848670959, 0.2142857164144516, 0.1428571492433548,
1123+
0.071428574621677399, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
1124+
0.0, 0.0, 0.0, 0.0])
1125+
self.assertAlmostEqual(mygrf.liney,
1126+
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
1127+
0.071428574621677399, 0.1428571492433548, 0.2142857164144516,
1128+
0.28571429848670959, 0.3571428656578064, 0.4285714328289032, 0.5,
1129+
0.57142859697341919, 0.6428571343421936, 0.71428573131561279,
1130+
0.78571426868438721, 0.8571428656578064, 0.92857140302658081, 1.0, 1.0, 1.0,
1131+
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
1132+
0.92857140302658081, 0.8571428656578064, 0.78571426868438721,
1133+
0.71428573131561279, 0.6428571343421936, 0.57142859697341919, 0.5,
1134+
0.4285714328289032, 0.3571428656578064, 0.28571429848670959,
1135+
0.2142857164144516, 0.1428571492433548, 0.071428574621677399, 0.0])
11101136
self.assertEqual(mygrf.nline, 57)
11111137
self.assertEqual(mygrf.attr, [4, 4])
11121138
self.assertAlmostEqual(mygrf.value, [2.0, 1.0])
11131139
self.assertEqual(mygrf.prim, [1, 1])
11141140

11151141
mygrf.Reset()
11161142
plot.grid()
1117-
self.assertEqual(mygrf.textt, ['0', '0.3', '0.6', '0.9', '0.4', '0.7', '1', 'Axis 1', 'Axis 2', '2-d coordinate system'])
1143+
self.assertEqual(mygrf.textt, ['0', '0.3', '0.6', '0.9', '0.4', '0.7', '1', 'Axis 1', 'Axis 2',
1144+
'2-d coordinate system'])
11181145
self.assertEqual(mygrf.textj, ['TC', 'TC', 'TC', 'TC', 'CR', 'CR', 'CR', 'TC', 'BC', 'BC'])
11191146
self.assertEqual(mygrf.ntext, 10)
11201147

‎tools/make_exceptions.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ def make_exceptions(dirname=None):
101101
/* Now create an instance of each derived AST exception class. */""", file=cfile)
102102

103103
for code in errcodes:
104-
print(" if( !({0}_err = PyErr_NewException(\"Ast.{0}\", AstError_err, NULL))) return 0;".format(code), file=cfile)
105-
print(" PyDict_SetItemString( dict, \"{0}\", {0}_err );".format(code), file=cfile)
104+
print(' if( !({0}_err = PyErr_NewException("Ast.{0}", AstError_err, NULL))) return 0;'.format(code),
105+
file=cfile)
106+
print(' PyDict_SetItemString( dict, "{0}", {0}_err );'.format(code), file=cfile)
106107
print(" ", file=cfile)
107108

108109
print(r""" return 1;
@@ -182,5 +183,6 @@ def make_exceptions(dirname=None):
182183
""", file=cfile)
183184
cfile.close()
184185

186+
185187
if __name__ == "__main__":
186188
make_exceptions()

0 commit comments

Comments
 (0)
Please sign in to comment.