Skip to content

Commit 38d1048

Browse files
chaosphere2112aashish24
authored andcommitted
Doctest cleanup (#131)
* Fixes #2, Gfb.rename(). Re-wrote to change ._name and pop old name from elements if not 'default'. Preserves original objects. * Working on vcs documentation again. * Trying to fix doctest strings * Trying to get testing to work * Fixing errors for tests * Working on a script to parse doctest output for error warnings * Running individual modules through doctest and processing output * Working on doctest_vcs.py * Working on doctest scripts * Working on improving doctest reporting * Added README.md with links to doctest logs * Fixed README to be markdown friendly * Fixed errors in manageElements. Added doctests. General formatting improvements. * Adding doctests where they are missing. Fixing doctest errors where applicable. General documentation formatting fixes. * Adding doctests/documentation where necessary. Ran doctests and updated logs. * Fixing/adding doctests * Added more examples/doctests to utils.py . Removed some modules from run_all_doctests.sh . Fixed xmldocs so it doesn't try to plot projections/templates. Started dv3d descriptions. * Tweaked doctest cleanup. Fixed manageElements doctests. * Organized doctest_info directory. Minor fixes in Canvas, colormap, and xmldocs. * Fixed reference to old branch in README.md * Docstring formatting. Doctest corrections. Changed Not Yet Implemented warning. * doctest_vcs.py now filters out private functions from the missing section of the log. * Fixed more docstring formatting issues. Make html now reports (almost) no errors. Re-ran doctests/logging. * Fixing up template. Deleted old file in scripts/ * Undocumented some internal functions to template. Added more template documentation. Working on documentation in various stages for other files. * Updating logs. * Fixed taylordiagram examples * Added example to mtics doc * Adding doctests to xmldocs: * Fixed doctests for ticlabels, exts * Refactored doctest_vcs.py and re-ran tests. * Working on extracting repetetive params to xmldocs. * Re-factored xmldocs formatting. Re-ran doctests and re-reported. * Added functionality to ignore certain regular expressions when parsing report output with doctest.py. Regular expressions can be added via commandline or ignore file. This will allow us to ignore 'missing' doctests for functions that don't need documentation, or for aspects of a module/class which are not functions that errantly get picked up by doctest.testmod. * Added an Index of VCS functions for the pdf output. Added docs/API/build_func_index.py to automatically check a list of modules/classes, get their non-private functions, and write the RST for linking to those functions in the documentation out to API/functions/$MODULE_NAME to create the functions index. Not all functions written out to the /rst files have been documented. * Added README.md to doctest_info directories briefly explaining what's in them and how to use it. Added an ignore directory to store files for using doctest_vcs.py's --ifile option. * Formatted :Example: sections to <=80 lines so they look better in pdf. Re-ran doctest_vcs.py to check functionality after some minor edits. * Removed Makefile call to old function * Adds doctest_info/ to .gitignore. Fixes some links. Adds documentation for dv3d (from documentation site). changes some xmldocs strings to use .format(). * Added '.. pragma: skip-doctest' statements in some places they are needed for vcs's test suite. Updated output for 3d graphics methods to match VCS's output. These will need to be changed after CDAT/dv3d#14 is resolved. * Added lots of '.. pragma: skip-doctest' and fixed some broken tests. * Added skip-doctest to some docstrings. * Standardized print statements for .list() * Added things to stop tests from breaking * Removed some unused files, fixed one context-dependent doctest
1 parent 05ed57b commit 38d1048

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+4225
-2478
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.egg-info
33
build/
44
docs/_build
5+
docs/doctest_info/
56
dist/
67
.idea/
78
dist/
File renamed without changes.

docs/API/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Note:
2+
-----
3+
4+
Run `build_func_index.py` every once in a while to make sure the VCS function index is being updated

docs/API/build_func_index.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import vcs, inspect
2+
3+
# VCS objects to generate function references for. Some are modules, some are classes.
4+
# Probably will need to add to this later when there's more documentation
5+
objects = [vcs.boxfill.Gfb, vcs.Canvas.Canvas, vcs.colormap.Cp, vcs.fillarea.Tf, vcs.isofill.Gfi, vcs.isoline.Gi,
6+
vcs.line.Tl, vcs.marker.Tm, vcs.meshfill.Gfm, vcs.projection.Proj, vcs.taylor.Gtd, vcs.template.P,
7+
vcs.textcombined.Tc,vcs.textorientation.To, vcs.texttable.Tt, vcs.unified1D.G1d, vcs.vector.Gv,
8+
vcs.manageElements, vcs.queries, vcs.utils, vcs.animate_helper, vcs.dv3d, vcs.colors, vcs.displayplot.Dp,
9+
vcs.vcshelp, ]
10+
11+
# iterate through objects to find the functions of each, and write RST links for those out to
12+
# API/functions/$MODULE_NAME.rst
13+
for obj in objects:
14+
if inspect.isclass(obj):
15+
key = obj.__module__ + '.' + obj.__name__
16+
pred = inspect.ismethod
17+
else:
18+
key = obj.__name__
19+
pred = inspect.isfunction
20+
funcs = []
21+
tup_l = inspect.getmembers(obj, predicate=pred)
22+
for tup in tup_l:
23+
if not tup[0][0] == '_':
24+
funcs.append(':func:`' + key + '.' + tup[0] + '`\n\n')
25+
fname = key.split('.')[1]
26+
with open('functions/' + fname + ".rst", "w+") as f:
27+
f.write(fname + "\n")
28+
map(lambda x: f.write('-'), range(len(fname)))
29+
f.write("\n\n")
30+
f.writelines(funcs)

docs/API/functions/Canvas.rst

Lines changed: 307 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
Canvas
2+
------
3+
4+
:func:`vcs.Canvas.Canvas.addfont`
5+
6+
:func:`vcs.Canvas.Canvas.boxfill`
7+
8+
:func:`vcs.Canvas.Canvas.canvasid`
9+
10+
:func:`vcs.Canvas.Canvas.canvasinfo`
11+
12+
:func:`vcs.Canvas.Canvas.cgm`
13+
14+
:func:`vcs.Canvas.Canvas.change_display_graphic_method`
15+
16+
:func:`vcs.Canvas.Canvas.check_name_source`
17+
18+
:func:`vcs.Canvas.Canvas.clean_auto_generated_objects`
19+
20+
:func:`vcs.Canvas.Canvas.clear`
21+
22+
:func:`vcs.Canvas.Canvas.close`
23+
24+
:func:`vcs.Canvas.Canvas.configure`
25+
26+
:func:`vcs.Canvas.Canvas.copyfontto`
27+
28+
:func:`vcs.Canvas.Canvas.create1d`
29+
30+
:func:`vcs.Canvas.Canvas.create3d_dual_scalar`
31+
32+
:func:`vcs.Canvas.Canvas.create3d_scalar`
33+
34+
:func:`vcs.Canvas.Canvas.create3d_vector`
35+
36+
:func:`vcs.Canvas.Canvas.createboxfill`
37+
38+
:func:`vcs.Canvas.Canvas.createcolormap`
39+
40+
:func:`vcs.Canvas.Canvas.createfillarea`
41+
42+
:func:`vcs.Canvas.Canvas.createisofill`
43+
44+
:func:`vcs.Canvas.Canvas.createisoline`
45+
46+
:func:`vcs.Canvas.Canvas.createline`
47+
48+
:func:`vcs.Canvas.Canvas.createmarker`
49+
50+
:func:`vcs.Canvas.Canvas.createmeshfill`
51+
52+
:func:`vcs.Canvas.Canvas.createprojection`
53+
54+
:func:`vcs.Canvas.Canvas.createscatter`
55+
56+
:func:`vcs.Canvas.Canvas.createtaylordiagram`
57+
58+
:func:`vcs.Canvas.Canvas.createtemplate`
59+
60+
:func:`vcs.Canvas.Canvas.createtext`
61+
62+
:func:`vcs.Canvas.Canvas.createtextcombined`
63+
64+
:func:`vcs.Canvas.Canvas.createtextorientation`
65+
66+
:func:`vcs.Canvas.Canvas.createtexttable`
67+
68+
:func:`vcs.Canvas.Canvas.createvector`
69+
70+
:func:`vcs.Canvas.Canvas.createxvsy`
71+
72+
:func:`vcs.Canvas.Canvas.createxyvsy`
73+
74+
:func:`vcs.Canvas.Canvas.createyxvsx`
75+
76+
:func:`vcs.Canvas.Canvas.destroy`
77+
78+
:func:`vcs.Canvas.Canvas.drawfillarea`
79+
80+
:func:`vcs.Canvas.Canvas.drawline`
81+
82+
:func:`vcs.Canvas.Canvas.drawlogooff`
83+
84+
:func:`vcs.Canvas.Canvas.drawlogoon`
85+
86+
:func:`vcs.Canvas.Canvas.drawmarker`
87+
88+
:func:`vcs.Canvas.Canvas.drawtext`
89+
90+
:func:`vcs.Canvas.Canvas.drawtextcombined`
91+
92+
:func:`vcs.Canvas.Canvas.dual_scalar3d`
93+
94+
:func:`vcs.Canvas.Canvas.dummy_user_action`
95+
96+
:func:`vcs.Canvas.Canvas.endconfigure`
97+
98+
:func:`vcs.Canvas.Canvas.eps`
99+
100+
:func:`vcs.Canvas.Canvas.ffmpeg`
101+
102+
:func:`vcs.Canvas.Canvas.fillarea`
103+
104+
:func:`vcs.Canvas.Canvas.flush`
105+
106+
:func:`vcs.Canvas.Canvas.geometry`
107+
108+
:func:`vcs.Canvas.Canvas.get1d`
109+
110+
:func:`vcs.Canvas.Canvas.get3d_dual_scalar`
111+
112+
:func:`vcs.Canvas.Canvas.get3d_scalar`
113+
114+
:func:`vcs.Canvas.Canvas.get3d_vector`
115+
116+
:func:`vcs.Canvas.Canvas.get_selected_display`
117+
118+
:func:`vcs.Canvas.Canvas.getantialiasing`
119+
120+
:func:`vcs.Canvas.Canvas.getboxfill`
121+
122+
:func:`vcs.Canvas.Canvas.getcolorcell`
123+
124+
:func:`vcs.Canvas.Canvas.getcolormap`
125+
126+
:func:`vcs.Canvas.Canvas.getcolormapname`
127+
128+
:func:`vcs.Canvas.Canvas.getcontinentsline`
129+
130+
:func:`vcs.Canvas.Canvas.getcontinentstype`
131+
132+
:func:`vcs.Canvas.Canvas.getdrawlogo`
133+
134+
:func:`vcs.Canvas.Canvas.getfillarea`
135+
136+
:func:`vcs.Canvas.Canvas.getfont`
137+
138+
:func:`vcs.Canvas.Canvas.getfontname`
139+
140+
:func:`vcs.Canvas.Canvas.getfontnumber`
141+
142+
:func:`vcs.Canvas.Canvas.getisofill`
143+
144+
:func:`vcs.Canvas.Canvas.getisoline`
145+
146+
:func:`vcs.Canvas.Canvas.getline`
147+
148+
:func:`vcs.Canvas.Canvas.getmarker`
149+
150+
:func:`vcs.Canvas.Canvas.getmeshfill`
151+
152+
:func:`vcs.Canvas.Canvas.getplot`
153+
154+
:func:`vcs.Canvas.Canvas.getprojection`
155+
156+
:func:`vcs.Canvas.Canvas.getscatter`
157+
158+
:func:`vcs.Canvas.Canvas.gettaylordiagram`
159+
160+
:func:`vcs.Canvas.Canvas.gettemplate`
161+
162+
:func:`vcs.Canvas.Canvas.gettext`
163+
164+
:func:`vcs.Canvas.Canvas.gettextcombined`
165+
166+
:func:`vcs.Canvas.Canvas.gettextextent`
167+
168+
:func:`vcs.Canvas.Canvas.gettextorientation`
169+
170+
:func:`vcs.Canvas.Canvas.gettexttable`
171+
172+
:func:`vcs.Canvas.Canvas.getvector`
173+
174+
:func:`vcs.Canvas.Canvas.getxvsy`
175+
176+
:func:`vcs.Canvas.Canvas.getxyvsy`
177+
178+
:func:`vcs.Canvas.Canvas.getyxvsx`
179+
180+
:func:`vcs.Canvas.Canvas.gif`
181+
182+
:func:`vcs.Canvas.Canvas.grid`
183+
184+
:func:`vcs.Canvas.Canvas.gs`
185+
186+
:func:`vcs.Canvas.Canvas.initLogoDrawing`
187+
188+
:func:`vcs.Canvas.Canvas.interact`
189+
190+
:func:`vcs.Canvas.Canvas.isinfile`
191+
192+
:func:`vcs.Canvas.Canvas.islandscape`
193+
194+
:func:`vcs.Canvas.Canvas.isofill`
195+
196+
:func:`vcs.Canvas.Canvas.isoline`
197+
198+
:func:`vcs.Canvas.Canvas.isopened`
199+
200+
:func:`vcs.Canvas.Canvas.isportrait`
201+
202+
:func:`vcs.Canvas.Canvas.landscape`
203+
204+
:func:`vcs.Canvas.Canvas.line`
205+
206+
:func:`vcs.Canvas.Canvas.listelements`
207+
208+
:func:`vcs.Canvas.Canvas.marker`
209+
210+
:func:`vcs.Canvas.Canvas.match_color`
211+
212+
:func:`vcs.Canvas.Canvas.meshfill`
213+
214+
:func:`vcs.Canvas.Canvas.objecthelp`
215+
216+
:func:`vcs.Canvas.Canvas.onClosing`
217+
218+
:func:`vcs.Canvas.Canvas.open`
219+
220+
:func:`vcs.Canvas.Canvas.orientation`
221+
222+
:func:`vcs.Canvas.Canvas.pdf`
223+
224+
:func:`vcs.Canvas.Canvas.plot`
225+
226+
:func:`vcs.Canvas.Canvas.plot_annotation`
227+
228+
:func:`vcs.Canvas.Canvas.plot_filledcontinents`
229+
230+
:func:`vcs.Canvas.Canvas.png`
231+
232+
:func:`vcs.Canvas.Canvas.portrait`
233+
234+
:func:`vcs.Canvas.Canvas.postscript`
235+
236+
:func:`vcs.Canvas.Canvas.processParameterChange`
237+
238+
:func:`vcs.Canvas.Canvas.pstogif`
239+
240+
:func:`vcs.Canvas.Canvas.put_png_on_canvas`
241+
242+
:func:`vcs.Canvas.Canvas.raisecanvas`
243+
244+
:func:`vcs.Canvas.Canvas.removeP`
245+
246+
:func:`vcs.Canvas.Canvas.remove_display_name`
247+
248+
:func:`vcs.Canvas.Canvas.removeobject`
249+
250+
:func:`vcs.Canvas.Canvas.return_display_names`
251+
252+
:func:`vcs.Canvas.Canvas.savecontinentstype`
253+
254+
:func:`vcs.Canvas.Canvas.saveinitialfile`
255+
256+
:func:`vcs.Canvas.Canvas.scalar3d`
257+
258+
:func:`vcs.Canvas.Canvas.scatter`
259+
260+
:func:`vcs.Canvas.Canvas.scriptobject`
261+
262+
:func:`vcs.Canvas.Canvas.scriptrun`
263+
264+
:func:`vcs.Canvas.Canvas.setAnimationStepper`
265+
266+
:func:`vcs.Canvas.Canvas.setantialiasing`
267+
268+
:func:`vcs.Canvas.Canvas.setbgoutputdimensions`
269+
270+
:func:`vcs.Canvas.Canvas.setcolorcell`
271+
272+
:func:`vcs.Canvas.Canvas.setcolormap`
273+
274+
:func:`vcs.Canvas.Canvas.setcontinentsline`
275+
276+
:func:`vcs.Canvas.Canvas.setcontinentstype`
277+
278+
:func:`vcs.Canvas.Canvas.setdefaultfont`
279+
280+
:func:`vcs.Canvas.Canvas.show`
281+
282+
:func:`vcs.Canvas.Canvas.start`
283+
284+
:func:`vcs.Canvas.Canvas.svg`
285+
286+
:func:`vcs.Canvas.Canvas.switchfonts`
287+
288+
:func:`vcs.Canvas.Canvas.taylordiagram`
289+
290+
:func:`vcs.Canvas.Canvas.text`
291+
292+
:func:`vcs.Canvas.Canvas.textcombined`
293+
294+
:func:`vcs.Canvas.Canvas.update`
295+
296+
:func:`vcs.Canvas.Canvas.updateorientation`
297+
298+
:func:`vcs.Canvas.Canvas.vector`
299+
300+
:func:`vcs.Canvas.Canvas.vector3d`
301+
302+
:func:`vcs.Canvas.Canvas.xvsy`
303+
304+
:func:`vcs.Canvas.Canvas.xyvsy`
305+
306+
:func:`vcs.Canvas.Canvas.yxvsx`
307+

docs/API/functions/animate_helper.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
animate_helper
2+
--------------
3+
4+
:func:`vcs.animate_helper.showerror`
5+

docs/API/functions/boxfill.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
boxfill
2+
-------
3+
4+
:func:`vcs.boxfill.Gfb.colors`
5+
6+
:func:`vcs.boxfill.Gfb.datawc`
7+
8+
:func:`vcs.boxfill.Gfb.exts`
9+
10+
:func:`vcs.boxfill.Gfb.getlegendlabels`
11+
12+
:func:`vcs.boxfill.Gfb.getlevels`
13+
14+
:func:`vcs.boxfill.Gfb.list`
15+
16+
:func:`vcs.boxfill.Gfb.rename`
17+
18+
:func:`vcs.boxfill.Gfb.script`
19+
20+
:func:`vcs.boxfill.Gfb.xmtics`
21+
22+
:func:`vcs.boxfill.Gfb.xticlabels`
23+
24+
:func:`vcs.boxfill.Gfb.xyscale`
25+
26+
:func:`vcs.boxfill.Gfb.ymtics`
27+
28+
:func:`vcs.boxfill.Gfb.yticlabels`
29+

0 commit comments

Comments
 (0)