- Timestamp:
- Dec 19, 2019 11:04:03 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIctrlGUI.py
r4201 r4213 168 168 VERY_LIGHT_GREY = wx.Colour(235,235,235) 169 169 WACV = wx.ALIGN_CENTER_VERTICAL 170 except: 171 # Don't depend on GUI172 pass170 wxaui_NB_TOPSCROLL = wx.aui.AUI_NB_TOP | wx.aui.AUI_NB_SCROLL_BUTTONS 171 except: # Don't depend on GUI 172 wxaui_NB_TOPSCROLL = None 173 173 174 174 try: … … 4134 4134 '''Notebook used in various locations; implemented with wx.aui extension 4135 4135 ''' 4136 def __init__(self, parent, name='',size = None,style=wx.aui.AUI_NB_TOP | 4137 wx.aui.AUI_NB_SCROLL_BUTTONS): 4136 def __init__(self, parent, name='',size = None,style=wxaui_NB_TOPSCROLL): 4138 4137 wx.aui.AuiNotebook.__init__(self, parent, style=style) 4139 4138 if size: self.SetSize(size) -
trunk/GSASIIdataGUI.py
r4201 r4213 4933 4933 where the functions to be called are defined. 4934 4934 4935 Use of the dataWindow scrolled panel 4936 ==================================== 4935 Use of the dataWindow scrolled panel: 4937 4936 4938 4937 dataWindow has a âmasterâ vertical BoxSizer: find it with … … 4972 4971 that are called repeatedly to update the entire contents of dataWindow 4973 4972 themselves, it is important to add calls to 4973 4974 4974 G2frame.dataWindow.ClearData() 4975 4975 4976 and 4977 4976 4978 G2frame.dataWindow.SetDataSize() 4979 4977 4980 at the beginning and end respectively to clear and refresh. This is not 4978 4981 needed for GSNoteBook repaints, which seem to be working mostly 4979 4982 automatically. If there is a problem, a call like 4983 4980 4984 wx.CallAfter(G2frame.phaseDisplay.SendSizeEvent) 4985 4981 4986 might be needed. There are some calls to G2frame.dataWindow.SendSizeEvent() 4982 4987 that may be doing the same thing. -
trunk/GSASIIindex.py
r4028 r4213 45 45 npatand = lambda x: 180.*np.arctan(x)/np.pi 46 46 npatan2d = lambda y,x: 180.*np.arctan2(y,x)/np.pi 47 rpd = np.pi/180. 47 try: # fails on doc build 48 rpd = np.pi/180. 49 except TypeError: 50 pass 48 51 49 52 def scaleAbyV(A,V): -
trunk/GSASIIlattice.py
r4195 r4213 51 51 acosd = lambda x: 180.*np.arccos(x)/np.pi 52 52 rdsq2d = lambda x,p: round(1.0/np.sqrt(x),p) 53 rpd = np.pi/180. 54 RSQ2PI = 1./np.sqrt(2.*np.pi) 55 SQ2 = np.sqrt(2.) 56 RSQPI = 1./np.sqrt(np.pi) 57 R2pisq = 1./(2.*np.pi**2) 53 try: # fails on doc build 54 rpd = np.pi/180. 55 RSQ2PI = 1./np.sqrt(2.*np.pi) 56 SQ2 = np.sqrt(2.) 57 RSQPI = 1./np.sqrt(np.pi) 58 R2pisq = 1./(2.*np.pi**2) 59 except TypeError: 60 pass 58 61 nxs = np.newaxis 59 62 -
trunk/GSASIImath.py
r4185 r4213 44 44 atand = lambda x: 180.*np.arctan(x)/np.pi 45 45 atan2d = lambda y,x: 180.*np.arctan2(y,x)/np.pi 46 twopi = 2.0*np.pi 47 twopisq = 2.0*np.pi**2 46 try: # fails on doc build 47 twopi = 2.0*np.pi 48 twopisq = 2.0*np.pi**2 49 _double_min = np.finfo(float).min 50 _double_max = np.finfo(float).max 51 except TypeError: 52 pass 48 53 nxs = np.newaxis 49 54 … … 4107 4112 #__all__ = ['anneal'] 4108 4113 4109 _double_min = numpy.finfo(float).min4110 _double_max = numpy.finfo(float).max4111 4114 class base_schedule(object): 4112 4115 def __init__(self): -
trunk/GSASIIpath.py
r4155 r4213 859 859 try: 860 860 inpver = intver(np.__version__) 861 except AttributeError: # happens on building docs861 except (AttributeError,TypeError): # happens on building docs 862 862 return 863 863 binpath = None -
trunk/GSASIIplot.py
r4196 r4213 145 145 import GSASIIctrlGUI as G2G 146 146 import GSASIIobj as G2obj 147 import pytexture as ptx 147 try: 148 import pytexture as ptx 149 except ImportError: 150 print('binary load error: pytexture not found') 148 151 #from OpenGL.GL import * 149 152 import OpenGL.GL as GL … … 182 185 npatand = lambda x: 180.*np.arctan(x)/np.pi 183 186 npatan2d = lambda x,y: 180.*np.arctan2(x,y)/np.pi 184 sq8ln2 = np.sqrt(8.0*np.log(2.0)) 187 try: # fails on doc build 188 sq8ln2 = np.sqrt(8.0*np.log(2.0)) 189 except TypeError: 190 pass 185 191 if '2' in platform.python_version_tuple()[0]: 186 192 GkDelta = unichr(0x0394) -
trunk/GSASIIspc.py
r4175 r4213 29 29 npcosd = lambda x: np.cos(x*np.pi/180.) 30 30 nxs = np.newaxis 31 twopi = 2.0*np.pi32 31 DEBUG = False 33 32 … … 2261 2260 Mag = np.array([nl.det(opm) for opm in OpM])*Spn 2262 2261 DHKL = np.reshape(np.inner(HKL,OpM),(-1,3)) 2263 PHKL = np.reshape(np.cos( twopi*np.inner(HKL,OpT))*Mag,(-1,))[:,nxs,nxs]*OpM #compute T(R,theta) eq(7)2262 PHKL = np.reshape(np.cos(2.0*np.pi*np.inner(HKL,OpT))*Mag,(-1,))[:,nxs,nxs]*OpM #compute T(R,theta) eq(7) 2264 2263 Ftest = np.random.rand(3) #random magnetic moment 2265 2264 Psum = np.zeros(3) -
trunk/GSASIIstrMath.py
r4185 r4213 38 38 atan2d = lambda y,x: 180.*np.arctan2(y,x)/np.pi 39 39 40 ateln2 = 8.0*np.log(2.0) 41 twopi = 2.0*np.pi 42 twopisq = 2.0*np.pi**2 40 try: # fails on doc build 41 ateln2 = 8.0*np.log(2.0) 42 twopi = 2.0*np.pi 43 twopisq = 2.0*np.pi**2 44 except TypeError: 45 pass 43 46 nxs = np.newaxis 44 47 -
trunk/docs/Makefile
r2027 r4213 1 # M akefile for Sphinx documentation1 # Minimal makefile for Sphinx documentation 2 2 # 3 3 4 # You can set these variables from the command line. 5 SPHINXOPTS = 6 SPHINXBUILD = sphinx-build 7 PAPER = 4 # You can set these variables from the command line, and also 5 # from the environment for the first two. 6 SPHINXOPTS ?= 7 SPHINXBUILD ?= sphinx-build 8 SOURCEDIR = source 8 9 BUILDDIR = build 9 10 10 # Internal variables. 11 PAPEROPT_a4 = -D latex_paper_size=a4 12 PAPEROPT_letter = -D latex_paper_size=letter 13 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 14 # the i18n builder cannot share the environment and doctrees with the others 15 I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 11 # Put it first so that "make" without argument is like "make help". 12 help: 13 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 16 14 17 .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext15 .PHONY: help Makefile 18 16 19 help: 20 @echo "Please use \`make <target>' where <target> is one of" 21 @echo " html to make standalone HTML files" 22 @echo " dirhtml to make HTML files named index.html in directories" 23 @echo " singlehtml to make a single large HTML file" 24 @echo " pickle to make pickle files" 25 @echo " json to make JSON files" 26 @echo " htmlhelp to make HTML files and a HTML help project" 27 @echo " qthelp to make HTML files and a qthelp project" 28 @echo " devhelp to make HTML files and a Devhelp project" 29 @echo " epub to make an epub" 30 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 31 @echo " latexpdf to make LaTeX files and run them through pdflatex" 32 @echo " text to make text files" 33 @echo " man to make manual pages" 34 @echo " texinfo to make Texinfo files" 35 @echo " info to make Texinfo files and run them through makeinfo" 36 @echo " gettext to make PO message catalogs" 37 @echo " changes to make an overview of all changed/added/deprecated items" 38 @echo " linkcheck to check all external links for integrity" 39 @echo " doctest to run all doctests embedded in the documentation (if enabled)" 40 41 clean: 42 #-rm -rf $(BUILDDIR)/* 43 rm $(BUILDDIR)/doctrees/* $(BUILDDIR)/html/*.html $(BUILDDIR)/html/*.js $(BUILDDIR)/html/*/*.html 44 45 html: 46 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 47 @echo 48 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 49 50 dirhtml: 51 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 52 @echo 53 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 54 55 singlehtml: 56 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 57 @echo 58 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 59 60 pickle: 61 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 62 @echo 63 @echo "Build finished; now you can process the pickle files." 64 65 json: 66 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 67 @echo 68 @echo "Build finished; now you can process the JSON files." 69 70 htmlhelp: 71 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 72 @echo 73 @echo "Build finished; now you can run HTML Help Workshop with the" \ 74 ".hhp project file in $(BUILDDIR)/htmlhelp." 75 76 qthelp: 77 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 78 @echo 79 @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 80 ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 81 @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/EPICSPythonSPECmotor.qhcp" 82 @echo "To view the help file:" 83 @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/EPICSPythonSPECmotor.qhc" 84 85 devhelp: 86 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 87 @echo 88 @echo "Build finished." 89 @echo "To view the help file:" 90 @echo "# mkdir -p $$HOME/.local/share/devhelp/EPICSPythonSPECmotor" 91 @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/EPICSPythonSPECmotor" 92 @echo "# devhelp" 93 94 epub: 95 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 96 @echo 97 @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 98 99 latex: 100 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 101 @echo 102 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 103 @echo "Run \`make' in that directory to run these through (pdf)latex" \ 104 "(use \`make latexpdf' here to do that automatically)." 105 106 latexpdf: 107 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 108 @echo "Running LaTeX files through pdflatex..." 109 $(MAKE) -C $(BUILDDIR)/latex all-pdf 110 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 111 112 text: 113 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 114 @echo 115 @echo "Build finished. The text files are in $(BUILDDIR)/text." 116 117 man: 118 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 119 @echo 120 @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 121 122 texinfo: 123 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 124 @echo 125 @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 126 @echo "Run \`make' in that directory to run these through makeinfo" \ 127 "(use \`make info' here to do that automatically)." 128 129 info: 130 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 131 @echo "Running Texinfo files through makeinfo..." 132 make -C $(BUILDDIR)/texinfo info 133 @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 134 135 gettext: 136 $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 137 @echo 138 @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 139 140 changes: 141 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 142 @echo 143 @echo "The overview file is in $(BUILDDIR)/changes." 144 145 linkcheck: 146 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 147 @echo 148 @echo "Link check complete; look for any errors in the above output " \ 149 "or in $(BUILDDIR)/linkcheck/output.txt." 150 151 doctest: 152 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 153 @echo "Testing of doctests in the sources finished, look at the " \ 154 "results in $(BUILDDIR)/doctest/output.txt." 17 # Catch-all target: route all unknown targets to Sphinx using the new 18 # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 %: Makefile 20 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -
trunk/docs/make.bat
r2027 r4213 1 1 @ECHO OFF 2 3 pushd %~dp0 2 4 3 5 REM Command file for Sphinx documentation … … 6 8 set SPHINXBUILD=sphinx-build 7 9 ) 10 set SOURCEDIR=source 8 11 set BUILDDIR=build 9 set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source10 if NOT "%PAPER%" == "" (11 set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%12 )13 12 14 13 if "%1" == "" goto help 15 14 16 if "%1" == "help" ( 17 :help 18 echo.Please use `make ^<target^>` where ^<target^> is one of 19 echo. html to make standalone HTML files 20 echo. dirhtml to make HTML files named index.html in directories 21 echo. singlehtml to make a single large HTML file 22 echo. pickle to make pickle files 23 echo. json to make JSON files 24 echo. htmlhelp to make HTML files and a HTML help project 25 echo. qthelp to make HTML files and a qthelp project 26 echo. devhelp to make HTML files and a Devhelp project 27 echo. epub to make an epub 28 echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 29 echo. text to make text files 30 echo. man to make manual pages 31 echo. changes to make an overview over all changed/added/deprecated items 32 echo. linkcheck to check all external links for integrity 33 echo. doctest to run all doctests embedded in the documentation if enabled 34 goto end 15 %SPHINXBUILD% >NUL 2>NUL 16 if errorlevel 9009 ( 17 echo. 18 echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 echo.installed, then set the SPHINXBUILD environment variable to point 20 echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 echo.may add the Sphinx directory to PATH. 22 echo. 23 echo.If you don't have Sphinx installed, grab it from 24 echo.http://sphinx-doc.org/ 25 exit /b 1 35 26 ) 36 27 37 if "%1" == "clean" ( 38 for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 39 del /q /s %BUILDDIR%\* 40 goto end 41 ) 28 %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 goto end 42 30 43 if "%1" == "html" ( 44 %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 45 echo. 46 echo.Build finished. The HTML pages are in %BUILDDIR%/html. 47 goto end 48 ) 49 50 if "%1" == "dirhtml" ( 51 %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 52 echo. 53 echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 54 goto end 55 ) 56 57 if "%1" == "singlehtml" ( 58 %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 59 echo. 60 echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 61 goto end 62 ) 63 64 if "%1" == "pickle" ( 65 %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 66 echo. 67 echo.Build finished; now you can process the pickle files. 68 goto end 69 ) 70 71 if "%1" == "json" ( 72 %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 73 echo. 74 echo.Build finished; now you can process the JSON files. 75 goto end 76 ) 77 78 if "%1" == "htmlhelp" ( 79 %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 80 echo. 81 echo.Build finished; now you can run HTML Help Workshop with the ^ 82 .hhp project file in %BUILDDIR%/htmlhelp. 83 goto end 84 ) 85 86 if "%1" == "qthelp" ( 87 %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 88 echo. 89 echo.Build finished; now you can run "qcollectiongenerator" with the ^ 90 .qhcp project file in %BUILDDIR%/qthelp, like this: 91 echo.^> qcollectiongenerator %BUILDDIR%\qthelp\GeneralStructureAnalysisSystem-II.qhcp 92 echo.To view the help file: 93 echo.^> assistant -collectionFile %BUILDDIR%\qthelp\GeneralStructureAnalysisSystem-II.ghc 94 goto end 95 ) 96 97 if "%1" == "devhelp" ( 98 %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 99 echo. 100 echo.Build finished. 101 goto end 102 ) 103 104 if "%1" == "epub" ( 105 %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 106 echo. 107 echo.Build finished. The epub file is in %BUILDDIR%/epub. 108 goto end 109 ) 110 111 if "%1" == "latex" ( 112 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 113 echo. 114 echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 115 goto end 116 ) 117 118 if "%1" == "text" ( 119 %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 120 echo. 121 echo.Build finished. The text files are in %BUILDDIR%/text. 122 goto end 123 ) 124 125 if "%1" == "man" ( 126 %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 127 echo. 128 echo.Build finished. The manual pages are in %BUILDDIR%/man. 129 goto end 130 ) 131 132 if "%1" == "changes" ( 133 %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 134 echo. 135 echo.The overview file is in %BUILDDIR%/changes. 136 goto end 137 ) 138 139 if "%1" == "linkcheck" ( 140 %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 141 echo. 142 echo.Link check complete; look for any errors in the above output ^ 143 or in %BUILDDIR%/linkcheck/output.txt. 144 goto end 145 ) 146 147 if "%1" == "doctest" ( 148 %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 149 echo. 150 echo.Testing of doctests in the sources finished, look at the ^ 151 results in %BUILDDIR%/doctest/output.txt. 152 goto end 153 ) 31 :help 32 %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 154 33 155 34 :end 35 popd -
trunk/docs/source/conf.py
r4205 r4213 12 12 13 13 import sys, os 14 # set up dummy packages for misc imports not on readthedocs15 from mock import Mock as MagicMock16 class wx(MagicMock):17 #@classmethod18 #def __getattr__(cls, name):19 # return wx()20 Frame = Menu = Panel = Dialog = CheckBox = Choice = ComboBox = object21 Button = PyValidator = TextCtrl = TreeCtrl = object22 DEFAULT_DIALOG_STYLE = RESIZE_BORDER = CENTRE = OK = CANCEL = True23 ID_ANY = -124 def __getitem__(self,*args):25 return '3.0.0'26 class grid(object):27 PyGridTableBase = PyGridCellEditor = Grid = object28 class html(object):29 HtmlWindow = object30 class aui(MagicMock):31 AuiNotebook = HtmlWindow = object32 class lib(MagicMock):33 class scrolledpanel(MagicMock):34 ScrolledPanel = object35 class gridmovers(MagicMock): pass36 class colourselect(MagicMock): pass37 class resizewidget(MagicMock): pass38 class mixins(MagicMock):39 class listctrl(MagicMock):40 ListCtrlAutoWidthMixin = object41 TextEditMixin = object42 43 sys.modules.update({'wx':wx(),44 'wx.aui':wx.aui(),45 'wx.html':wx.html(),46 'wx.grid':wx.grid(),47 'wx.lib':wx.lib(),48 'wx.wizard':wx.grid(),49 'wx.glcanvas':wx.lib(),50 'wx.lib.scrolledpanel':wx.lib.scrolledpanel(),51 'wx.lib.gridmovers':wx.lib.gridmovers(),52 'wx.lib.colourselect':wx.lib.gridmovers(),53 'wx.lib.resizewidget':wx.lib.resizewidget(),54 'wx.lib.mixins':wx.lib.mixins(),55 'wx.lib.mixins.listctrl':wx.lib.mixins.listctrl()})56 wx.aui.AUI_NB_TOP = 057 wx.aui.AUI_NB_SCROLL_BUTTONS = 058 59 class numpy(MagicMock):60 pi = 3.061 def log(self,*args): return 062 def sqrt(self,*args): return 163 class ma(MagicMock):pass64 class linalg(MagicMock):pass65 sys.modules.update({'numpy':numpy()})66 sys.modules.update({'numpy.ma':numpy.ma()})67 sys.modules.update({'numpy.linalg':numpy.linalg()})68 sys.modules.update({'numpy.fft':numpy.linalg()})69 70 class scipy(MagicMock):71 class optimize(MagicMock):pass72 sys.modules.update({'scipy':scipy()})73 sys.modules.update({'scipy.optimize':scipy.optimize()})74 sys.modules.update({'scipy.stats':scipy.optimize()})75 sys.modules.update({'scipy.interpolate':scipy.optimize()})76 sys.modules.update({'scipy.special':scipy.optimize()})77 sys.modules.update({'scipy.misc':scipy.optimize()})78 sys.modules.update({'scipy.signal':scipy.optimize()})79 sys.modules.update({'scipy.cluster':scipy.optimize()})80 sys.modules.update({'scipy.cluster.vq':scipy.optimize()})81 82 class OpenGL(MagicMock):83 class GL(MagicMock):pass84 class GLU(MagicMock):pass85 sys.modules.update({'OpenGL':OpenGL()})86 sys.modules.update({'OpenGL.GL':OpenGL.GL()})87 sys.modules.update({'OpenGL.GLU':OpenGL.GLU()})88 sys.modules.update({'OpenGL.GLE':OpenGL.GL()})89 90 class Mock(MagicMock):91 @classmethod92 def __getattr__(cls, name):93 return Mock()94 95 MOCK_MODULES = [96 'pypowder', 'pyspg', 'pytexture', 'polymask', 'fellipse',97 'matplotlib', 'matplotlib.backends', 'matplotlib.backends.backend_wx',98 'matplotlib.colors',99 'matplotlib.backends.backend_wxagg','pylab','matplotlib.collections',100 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.mplot3d.axes3d',101 'winreg','unpack_cbf','h5py'102 ]103 sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)104 14 105 15 # If extensions (or modules to document with autodoc) are in another directory, … … 111 21 sys.path.insert(1, os.path.abspath(os.path.join('..', '..','imports'))) 112 22 #print(sys.path) 113 # import all files to set version number23 # scan all files to get version number 114 24 import glob 115 for fil in glob.glob(os.path.abspath(os.path.join('..', '..','*.py'))): 116 pkg = os.path.splitext(os.path.split(fil)[1])[0] 25 version = 0 26 for fil in (glob.glob(os.path.abspath(os.path.join('..', '..','*.py')))+ 27 glob.glob(os.path.abspath(os.path.join('..', '..','exports','*.py')))+ 28 glob.glob(os.path.abspath(os.path.join('..', '..','imports','*.py')))): 29 fp = open(fil,'r') 30 c = fp.read() 31 fp.close() 32 s = c.find('SetVersionNumber') 33 if s<0: continue 34 if c.find('$Revision:',s,s+50)<0: continue 117 35 try: 118 exec('import '+pkg) 36 v = int(c[c.find('(',s,s+40):c.find(')',s,s+50)].split()[1]) 37 version = max(version,v) 119 38 except: 120 39 pass 121 import GSASIIpath122 version = GSASIIpath.GetVersionNumber()123 40 print('Found highest version as {}'.format(version)) 124 41 # -- General configuration ----------------------------------------------------- … … 351 268 # How to display URL addresses: 'footnote', 'no', or 'inline'. 352 269 #texinfo_show_urls = 'footnote' 270 271 # set up dummy packages for misc imports not on readthedocs 272 autodoc_mock_imports = "wx numpy scipy matplotlib pillow OpenGL h5py".split() -
trunk/imports/G2img_CBF.py
r3207 r4213 19 19 import struct as st 20 20 import numpy as np 21 import unpack_cbf as cbf22 21 GSASIIpath.SetVersionNumber("$Revision$") 23 22 class CBF_ReaderClass(G2obj.ImportImage): … … 50 49 'Read cif binarydetector data cbf file' 51 50 51 import unpack_cbf as cbf 52 52 if GSASIIpath.GetConfigValue('debug'): 53 53 print ('Read cif binary detector data cbf file: '+filename) -
trunk/imports/G2phase.py
r4076 r4213 32 32 import GSASIIpath 33 33 GSASIIpath.SetVersionNumber("$Revision$") 34 R2pisq = 1./(2.*np.pi**2) 34 try: # fails on doc build 35 R2pisq = 1./(2.*np.pi**2) 36 except TypeError: 37 pass 35 38 36 39 class PDB_ReaderClass(G2obj.ImportPhase): -
trunk/imports/G2rfd_xye.py
r3136 r4213 24 24 npasind = lambda x: 180.*np.arcsin(x)/np.pi 25 25 npsind = lambda x: np.sin(np.pi*x/180.) 26 fourpi = 4.0*np.pi 26 try: # fails on doc build 27 fourpi = 4.0*np.pi 28 _double_min = np.finfo(float).min 29 _double_max = np.finfo(float).max 30 except TypeError: 31 pass 27 32 28 33 class txt_XRayReaderClass(G2obj.ImportReflectometryData): -
trunk/makeBat.py
r3940 r4213 21 21 import datetime 22 22 import wx 23 try:24 import _winreg as winreg25 except ImportError:26 import winreg27 23 28 24 Script = '''@echo ======================================================================== … … 48 44 49 45 if __name__ == '__main__': 46 try: 47 import _winreg as winreg 48 except ImportError: 49 import winreg 50 50 app = wx.App() 51 51 app.MainLoop() -
trunk/testDeriv.py
r4081 r4213 38 38 import GSASIItestplot as plot 39 39 import GSASIImapvars as G2mv 40 import pytexture as ptx 41 ptx.pyqlmninit() #initialize fortran arrays for spherical harmonics 40 try: # fails on doc build 41 import pytexture as ptx 42 ptx.pyqlmninit() #initialize fortran arrays for spherical harmonics 43 except ImportError: 44 pass 42 45 43 46 try:
Note: See TracChangeset
for help on using the changeset viewer.