Skip to content

Commit c726a1b

Browse files
committed
clean up docs
1 parent ed22425 commit c726a1b

33 files changed

+338
-195
lines changed

GSASII/GSASIIGUI.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# -*- coding: utf-8 -*-
33
#GSASIIGUI
44
'''
5-
This provides a short file that is used to start the GSAS-II GUI
6-
7-
A single class, :class:`G2App`, is defined here to create
8-
a wxPython application. This is only used on
9-
MacOS. For other platforms ``wx.App()`` is called directly.
5+
GSASIIGUI provides a short file that is used to start the GSAS-II GUI.
6+
It is usually called from `G2.py` but this routine can also be invoked
7+
directly when GSAS-II has been installed into Python.
8+
On MacOS, a class, :class:`G2App`, is defined inside :func:`main` that creates
9+
a wxPython application. For other platforms ``wx.App()`` is called directly.
1010
'''
1111

1212
import sys
@@ -22,6 +22,8 @@
2222
__version__ = gv.git_prevtags[0]
2323

2424
def main():
25+
'''This routine is called to start the GSAS-II GUI
26+
'''
2527
import scipy.optimize # loading here addresses problem with build for wx on Pi
2628
import wx
2729
# the next line removes the need for pythonw. Thanks to Matt Newville!

GSASII/GSASIIdataGUI.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6126,9 +6126,9 @@ class G2DataWindow(wx.ScrolledWindow): #wxscroll.ScrolledPanel):
61266126
61276127
this ensures that the window's scroll bars are placed properly.
61286128
Initial GUI creation for the contents of dataWindow is done in
6129-
:func:`SelectDataTreeItem`(), which is invoked when a selection
6129+
:func:`SelectDataTreeItem`, which is invoked when a selection
61306130
is made in the data tree selection. This may places items into
6131-
the dataWindow, but more commonly calls other routeins tht call
6131+
the dataWindow, but more commonly calls other routines tht call
61326132
that.
61336133
61346134
Routines that are called multiple times to redraw the contents

GSASII/GSASIImath.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,6 +2850,7 @@ def setupRBDistDerv(parmDict,varyList,sigList,rigidbodyDict,Phases):
28502850
and the values are reused in every distance and angle computation.
28512851
28522852
:returns: multiParmDict,changedParmDict where
2853+
28532854
* multiParmDict[k] (k in varyList, plus None) is the copy of
28542855
parmDict where parameter k has been changed;
28552856
* changedParmDict[k] (k in varyList) is a list of all the parameters that have been

GSASII/install/makeVarTbl.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,15 @@ def main():
127127

128128
if __name__ == '__main__':
129129
print('Running makeVarTbl.py')
130+
import importlib.util
131+
try:
132+
pkginfo = importlib.util.find_spec('GSASII.GSASIIobj')
133+
except ModuleNotFoundError:
134+
pkginfo = None
135+
if pkginfo is None: # hack path if GSASII not installed into Python
136+
import os
137+
import sys
138+
parent = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
139+
print(f'GSAS-II not installed; Hacking sys.path to {parent}')
140+
sys.path.insert(0,parent)
130141
main()

docs/source/G2tools.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ a minimal GUI and no visualization that runs independently from
2020
the main GSAS-II program . This is intended to implement
2121
significant levels of parallelization and require less of a memory footprint.
2222

23-
.. automodule:: GSASIIIntPDFtool
23+
.. automodule:: GSASII.GSASIIIntPDFtool
2424
:members:
2525

2626
.. _G2compare:
@@ -32,6 +32,6 @@ This is intended to read in multiple GSAS-II projects and provide
3232
graphics, tables of information and so on. Not much of this has been
3333
written at present.
3434

35-
.. automodule:: G2compare
35+
.. automodule:: GSASII.G2compare
3636
:members:
3737

docs/source/GSASII.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
*GSASII: GSAS-II GUI*
2-
===========================
2+
===========================
33

44
Script G2.py
55
----------------------------------------
@@ -30,6 +30,11 @@ the user is asked if they should be updated from the subversion site.
3030
The wxPython app is then passed to :func:`GSASIIdataGUI.GSASIImain`,
3131
which creates the GSAS-II GUI and finally the event loop is started.
3232

33+
.. automodule:: GSASII.GSASIIGUI
34+
:members:
35+
:private-members:
36+
:special-members:
37+
3338
Keyboard Menu Shortcuts
3439
----------------------------------------
3540

@@ -74,12 +79,3 @@ vary depending on the type of plot.
7479
M Minimize GSAS-II windows (MacOS Windows menu).
7580
This is system-assigned
7681
========== ====================================================
77-
78-
GSAS-II contents
79-
----------------------------------------
80-
81-
82-
.. automodule:: GSASIIGUI
83-
:members:
84-
:private-members:
85-
:special-members:

docs/source/GSASIIGUI.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ data editing panel.
1515
GSASIIdataGUI Classes & Routines
1616
---------------------------------------
1717

18-
.. automodule:: GSASIIdataGUI
18+
.. automodule:: GSASII.GSASIIdataGUI
1919
:members:
2020

2121
----------------------------------------
@@ -43,7 +43,7 @@ a project can hold one result of each type without a naming collision:
4343
GSASIIseqGUI Classes & Routines
4444
---------------------------------------
4545

46-
.. automodule:: GSASIIseqGUI
46+
.. automodule:: GSASII.GSASIIseqGUI
4747
:members:
4848

4949
---------------------------
@@ -61,7 +61,7 @@ that respond to some tabs in the phase GUI in other modules
6161
GSASIIphsGUI Classes & Routines
6262
---------------------------------------
6363

64-
.. automodule:: GSASIIphsGUI
64+
.. automodule:: GSASII.GSASIIphsGUI
6565
:members:
6666

6767
--------------------------------------------
@@ -76,7 +76,7 @@ data tree item (see SeparateHistPhaseTreeItem in config.py).
7676
GSASIIddataGUI Classes & Routines
7777
---------------------------------------
7878

79-
.. automodule:: GSASIIddataGUI
79+
.. automodule:: GSASII.GSASIIddataGUI
8080
:members:
8181

8282
-------------------------------------------------------
@@ -89,7 +89,7 @@ to delete an element from a list of selected elements.
8989
GSASIIElemGUI Classes & Routines
9090
---------------------------------------
9191

92-
.. automodule:: GSASIIElemGUI
92+
.. automodule:: GSASII.GSASIIElemGUI
9393
:members:
9494

9595
------------------------------------------
@@ -102,7 +102,7 @@ GUI routines to define constraints and rigid bodies.
102102
GSASIIconstrGUI Classes & Routines
103103
---------------------------------------
104104

105-
.. automodule:: GSASIIconstrGUI
105+
.. automodule:: GSASII.GSASIIconstrGUI
106106
:members:
107107

108108
----------------------------------------
@@ -115,7 +115,7 @@ GUI Routines used to define restraints.
115115
GSASIIrestrGUI Classes & Routines
116116
---------------------------------------
117117

118-
.. automodule:: GSASIIrestrGUI
118+
.. automodule:: GSASII.GSASIIrestrGUI
119119
:members:
120120

121121
-------------------------
@@ -128,7 +128,7 @@ GUI Routines used to control image display and processing
128128
GSASIIimgGUI Classes & Routines
129129
---------------------------------------
130130

131-
.. automodule:: GSASIIimgGUI
131+
.. automodule:: GSASII.GSASIIimgGUI
132132
:members:
133133

134134
-------------------------------------------
@@ -142,7 +142,7 @@ with the powder histogram (PWDR) data tree items.
142142
GSASIIpwdGUI Classes & Routines
143143
---------------------------------------
144144

145-
.. automodule:: GSASIIpwdGUI
145+
.. automodule:: GSASII.GSASIIpwdGUI
146146
:members:
147147

148148
-------------------------------------
@@ -164,7 +164,7 @@ Default expressions are read from file DefaultExpressions.txt using
164164
GSASIIexprGUI Classes & Routines
165165
---------------------------------------
166166

167-
.. automodule:: GSASIIexprGUI
167+
.. automodule:: GSASII.GSASIIexprGUI
168168
:members:
169169

170170
-------------------------------------------------
@@ -180,7 +180,7 @@ Also allows for plotting the convolutors generated by that code.
180180
GSASIIfpaGUI Classes & Routines
181181
---------------------------------------
182182

183-
.. automodule:: GSASIIfpaGUI
183+
.. automodule:: GSASII.GSASIIfpaGUI
184184
:members:
185185

186186
-------------------------------------------------
@@ -196,7 +196,7 @@ Liberman corrected for Kissel & Pratt energy term; Jensen term not included
196196
fprime Classes & Routines
197197
---------------------------------------
198198

199-
.. automodule:: fprime
199+
.. automodule:: GSASII.fprime
200200
:members:
201201

202202

@@ -213,5 +213,5 @@ as in :mod:`fprime`
213213
Absorb Classes & Routines
214214
---------------------------------------
215215

216-
.. automodule:: Absorb
216+
.. automodule:: GSASII.Absorb
217217
:members:

docs/source/GSASIIGUIr.rst

Lines changed: 51 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
The modules documented here provide GUI or graphics capabilities that
55
are used in multiple sections of the GSAS-II GUI or graphics.
66

7+
.. TODO: The tables below need work. The references such as :class:`EnumSelector`
8+
.. and :func:`G2RadioButtons` don't work. What is needed is
9+
.. :class:`~GSASII.GSASIIctrlGUI.EnumSelector` and
10+
.. :func:`~GSASII.GSASIIctrlGUI.G2RadioButtons`. That will require
11+
.. realigning the tables big-time.
12+
13+
714
---------------------------------------------
815
*GSASIIctrlGUI: Custom GUI controls*
916
---------------------------------------------
@@ -15,47 +22,48 @@ data window or dialogs:
1522

1623
.. tabularcolumns:: |l|p{4in}|
1724

18-
================================ =================================================================
19-
Class or function name Description
20-
================================ =================================================================
21-
:class:`EnumSelector` A combo box with a built-in call back routine that
22-
automatically sets a dict or list entry.
23-
:class:`G2ChoiceButton` A customized wx.Choice that automatically initializes to
24-
the initial value and saves the choice directly into a dict
25-
or list value. Optionally calls function when a
26-
choice is selected
27-
:class:`G2CheckBox` A customized wx.CheckBox that automatically initializes to
28-
the initial value and saves the choice directly into a dict
29-
or list value. Optionally calls function when a
30-
choice is selected
31-
:func:`G2CheckBoxFrontLbl` A version of :class:`G2CheckBox` that places the label
32-
for the check box in front. Otherwise works the same.
33-
:func:`G2RadioButtons` Creates a series of grouped radio buttons.
34-
:class:`G2SliderWidget` A customized combination of a wx.Slider and a validated
35-
wx.TextCtrl (see :class:`ValidatedTxtCtrl`).
36-
:class:`G2Slider` A wrapped version of wx.Slider that implements scaling
37-
:class:`G2SpinWidget` A customized combination of a wx.SpinButton and a validated
38-
wx.TextCtrl (see :class:`ValidatedTxtCtrl`).
39-
:class:`G2MultiChoiceWindow` Similar to :class:`G2MultiChoiceDialog` but provides
40-
a sizer that can be placed in a frame or panel.
41-
:class:`HelpButton` Creates a button labeled with a "?" that when pressed
42-
displays help text in a modal message window
43-
or web browser.
44-
:class:`OrderBox` Creates a wx.Panel with scrollbars where items can be
45-
ordered into columns.
46-
:class:`SortableLstCtrl` Creates a wx.Panel for a table of data that
47-
can be sorted by clicking on a column label.
48-
:class:`ValidatedTxtCtrl` A text control with a built-in call back routine to set dict
49-
or list elements. Optionally validates input as float, int or
50-
for strings non-blank. Value is set when focus changes
51-
:func:`HorizontalLine` Places a line in a Frame or Dialog to separate sections.
52-
:class:`ScrolledStaticText` A wx.StaticText widget that fits a large string into a
53-
small space by scrolling it
54-
:func:`ReadOnlyTextCtrl` A wx.TextCtrl widget to be used wx.StaticText
55-
(no edits allowed) text appears in a box.
56-
:func:`setColorButton` A button for color selection as a replacement
57-
for wx.ColourSelect
58-
================================ =================================================================
25+
=================================== =================================================================
26+
Class or function name Description
27+
=================================== =================================================================
28+
:class:`EnumSelector` A combo box with a built-in call back routine that
29+
automatically sets a dict or list entry.
30+
:class:`G2ChoiceButton` A customized wx.Choice that automatically initializes to
31+
the initial value and saves the choice directly into a dict
32+
or list value. Optionally calls function when a
33+
choice is selected
34+
:class:`G2CheckBox` A customized wx.CheckBox that automatically initializes to
35+
the initial value and saves the choice directly into a dict
36+
or list value. Optionally calls function when a
37+
choice is selected
38+
:func:`G2CheckBoxFrontLbl` A version of :class:`~GSASII.GSASIIctrlGUI.G2CheckBox` that
39+
places the label
40+
for the check box in front. Otherwise works the same.
41+
:func:`G2RadioButtons` Creates a series of grouped radio buttons.
42+
:class:`G2SliderWidget` A customized combination of a wx.Slider and a validated
43+
wx.TextCtrl (see :class:`ValidatedTxtCtrl`).
44+
:class:`G2Slider` A wrapped version of wx.Slider that implements scaling
45+
:class:`G2SpinWidget` A customized combination of a wx.SpinButton and a validated
46+
wx.TextCtrl (see :class:`ValidatedTxtCtrl`).
47+
:class:`G2MultiChoiceWindow` Similar to :class:`G2MultiChoiceDialog` but provides
48+
a sizer that can be placed in a frame or panel.
49+
:class:`HelpButton` Creates a button labeled with a "?" that when pressed
50+
displays help text in a modal message window
51+
or web browser.
52+
:class:`OrderBox` Creates a wx.Panel with scrollbars where items can be
53+
ordered into columns.
54+
:class:`SortableLstCtrl` Creates a wx.Panel for a table of data that
55+
can be sorted by clicking on a column label.
56+
:class:`ValidatedTxtCtrl` A text control with a built-in call back routine to set dict
57+
or list elements. Optionally validates input as float, int or
58+
for strings non-blank. Value is set when focus changes
59+
:func:`HorizontalLine` Places a line in a Frame or Dialog to separate sections.
60+
:class:`ScrolledStaticText` A wx.StaticText widget that fits a large string into a
61+
small space by scrolling it
62+
:func:`ReadOnlyTextCtrl` A wx.TextCtrl widget to be used wx.StaticText
63+
(no edits allowed) text appears in a box.
64+
:func:`setColorButton` A button for color selection as a replacement
65+
for wx.ColourSelect
66+
=================================== =================================================================
5967

6068
GSAS-II-provided Dialog (full window) routines:
6169

@@ -171,7 +179,7 @@ Function name Description
171179
GSASIIctrlGUI Classes & Routines
172180
---------------------------------------------
173181

174-
.. automodule:: GSASIIctrlGUI
182+
.. automodule:: GSASII.GSASIIctrlGUI
175183
:members:
176184

177185
---------------------------------------------
@@ -186,7 +194,7 @@ Includes support for image reading.
186194
GSASIImiscGUI Classes & Routines
187195
---------------------------------------------
188196

189-
.. automodule:: GSASIImiscGUI
197+
.. automodule:: GSASII.GSASIImiscGUI
190198
:members:
191199

192200
---------------------------------------------

docs/source/GSASIIdata.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,40 @@ used in various locations.
88
*GSASIIdata: Ramachandran Parameters*
99
-----------------------------------------
1010

11-
.. automodule:: GSASIIdata
11+
.. automodule:: GSASII.GSASIIdata
1212
:members:
1313

1414
-----------------------------------------
1515
*ElementTable: Periodic Table Data*
1616
-----------------------------------------
1717

18-
.. automodule:: ElementTable
18+
.. automodule:: GSASII.ElementTable
1919
:members:
2020

2121
-----------------------------------------
2222
*FormFactors: Scattering Data*
2323
-----------------------------------------
2424

25-
.. automodule:: FormFactors
25+
.. automodule:: GSASII.FormFactors
2626
:members:
2727

2828
-----------------------------------------
2929
*ImageCalibrants: Calibration Standards*
3030
-----------------------------------------
3131

32-
.. automodule:: ImageCalibrants
32+
.. automodule:: GSASII.ImageCalibrants
3333
:members:
3434

3535
-----------------------------------------
3636
*atmdata: Table of atomic data*
3737
-----------------------------------------
3838

39-
.. automodule:: atmdata
39+
.. automodule:: GSASII.atmdata
4040
:members:
4141

4242
-------------------------------------------------
4343
*defaultIparms: Table of instrument parameters*
4444
-------------------------------------------------
4545

46-
.. automodule:: defaultIparms
46+
.. automodule:: GSASII.defaultIparms
4747
:members:

0 commit comments

Comments
 (0)