Skip to content

Commit f766d51

Browse files
authored
ENH: Add TimeViewer to docs (#248)
1 parent 6dd75bf commit f766d51

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

doc/_templates/class_noinherited.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{ fullname }}
2+
{{ underline }}
3+
4+
.. currentmodule:: {{ module }}
5+
6+
.. autoclass:: {{ objname }}
7+
:no-inherited-members:
8+
9+
{% block methods %}
10+
{% endblock %}

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@
295295
}
296296

297297
numpydoc_class_members_toctree = False
298+
numpydoc_show_inherited_class_members = False
298299

299300

300301
# -----------------------------------------------------------------------------

doc/python_reference.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ This is the reference for classes (``CamelCase`` names) and functions
2323

2424
Brain
2525

26+
.. autosummary::
27+
:toctree: generated/
28+
:template: class_noinherited.rst
29+
30+
TimeViewer
31+
2632
.. autosummary::
2733
:toctree: generated/
2834
:template: function.rst
@@ -56,4 +62,4 @@ This is the reference for classes (``CamelCase`` names) and functions
5662
:toctree: generated/
5763
:template: function.rst
5864

59-
coord_to_label
65+
coord_to_label

surfer/viz.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
Bool, Enum, on_trait_change, Instance)
2121
from tvtk.api import tvtk
2222
from pyface.api import GUI
23+
from traitsui.api import View, Item, Group, VGroup, HGroup, VSplit, HSplit
2324

2425
from . import utils, io
2526
from .utils import (Surface, verbose, create_color_lut, _get_subjects_dir,
@@ -249,7 +250,6 @@ def _make_viewer(figure, n_row, n_col, title, scene_size, offscreen,
249250

250251
class _MlabGenerator(HasTraits):
251252
"""TraitsUI mlab figure generator"""
252-
from traitsui.api import View
253253
view = Instance(View)
254254

255255
def __init__(self, n_row, n_col, width, height, title, **traits):
@@ -280,7 +280,6 @@ def _get_figs_view(self):
280280
return figures, self._v
281281

282282
def _get_gen_view(self):
283-
from traitsui.api import (View, Item, VGroup, HGroup)
284283
ind = 0
285284
va = []
286285
for ri in range(self.n_row):
@@ -3472,7 +3471,6 @@ class TimeViewer(HasTraits):
34723471
brain(s) to control
34733472
"""
34743473
# Nested import of traisui for setup.py without X server
3475-
from traitsui.api import (View, Item, VSplit, HSplit, Group)
34763474
min_time = Int(0)
34773475
max_time = Int(1E9)
34783476
current_time = Range(low="min_time", high="max_time", value=0)
@@ -3537,7 +3535,7 @@ def __init__(self, brain):
35373535
self.configure_traits()
35383536

35393537
@on_trait_change("smoothing_steps")
3540-
def set_smoothing_steps(self):
3538+
def _set_smoothing_steps(self):
35413539
""" Change number of smooting steps
35423540
"""
35433541
if self._disable_updates:
@@ -3551,7 +3549,7 @@ def set_smoothing_steps(self):
35513549
brain.set_data_smoothing_steps(self.smoothing_steps)
35523550

35533551
@on_trait_change("orientation")
3554-
def set_orientation(self):
3552+
def _set_orientation(self):
35553553
""" Set the orientation
35563554
"""
35573555
if self._disable_updates:
@@ -3561,7 +3559,7 @@ def set_orientation(self):
35613559
brain.show_view(view=self.orientation)
35623560

35633561
@on_trait_change("current_time")
3564-
def set_time_point(self):
3562+
def _set_time_point(self):
35653563
""" Set the time point shown
35663564
"""
35673565
if self._disable_updates:
@@ -3571,7 +3569,7 @@ def set_time_point(self):
35713569
brain.set_data_time_index(self.current_time)
35723570

35733571
@on_trait_change("fmin, fmid, fmax, transparent")
3574-
def scale_colormap(self):
3572+
def _scale_colormap(self):
35753573
""" Scale the colormap
35763574
"""
35773575
if self._disable_updates:

0 commit comments

Comments
 (0)