From abaf8d5d29a14fc4b7c7f9088c13c26295b7193c Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 2 Oct 2024 13:32:20 -0400 Subject: [PATCH 01/20] Remove conda-recipe folder (#221) * Remove conda-recipe * Add news for conda-recipe removal --- conda-recipe/bld.bat | 17 ------- conda-recipe/build.sh | 8 --- conda-recipe/conda_build_config.yaml | 7 --- conda-recipe/dont_run.py | 5 -- conda-recipe/expandpdfguibase.py | 16 ------ conda-recipe/menu-windows.json | 25 ---------- conda-recipe/meta.suppress_yaml | 71 --------------------------- conda-recipe/pdfgui.ico | Bin 22382 -> 0 bytes conda-recipe/pdfgui_64x64.png | Bin 8944 -> 0 bytes news/conda-recipe.rst | 23 +++++++++ 10 files changed, 23 insertions(+), 149 deletions(-) delete mode 100644 conda-recipe/bld.bat delete mode 100644 conda-recipe/build.sh delete mode 100644 conda-recipe/conda_build_config.yaml delete mode 100644 conda-recipe/dont_run.py delete mode 100644 conda-recipe/expandpdfguibase.py delete mode 100644 conda-recipe/menu-windows.json delete mode 100644 conda-recipe/meta.suppress_yaml delete mode 100644 conda-recipe/pdfgui.ico delete mode 100644 conda-recipe/pdfgui_64x64.png create mode 100644 news/conda-recipe.rst diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat deleted file mode 100644 index 65bb32b3..00000000 --- a/conda-recipe/bld.bat +++ /dev/null @@ -1,17 +0,0 @@ -%PYTHON% -m easy_install --no-deps . -if errorlevel 1 exit 1 - -:: Add more build steps here, if they are necessary. - -set MENU_DIR=%PREFIX%\Menu -if not exist (%MENU_DIR%) mkdir %MENU_DIR% - -cd %RECIPE_DIR% -%PYTHON% expandpdfguibase.py menu-windows.json > %MENU_DIR%\menu-windows.json -if errorlevel 1 exit 1 - -copy pdfgui.ico %MENU_DIR%\ -if errorlevel 1 exit 1 - -:: See http://docs.continuum.io/conda/build.html -:: for a list of environment variables that are set during the build process. diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh deleted file mode 100644 index 1f9526d3..00000000 --- a/conda-recipe/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -$PYTHON -m easy_install --no-deps . - -# Add more build steps here, if they are necessary. - -# See http://docs.continuum.io/conda/build.html -# for a list of environment variables that are set during the build process. diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml deleted file mode 100644 index c933d898..00000000 --- a/conda-recipe/conda_build_config.yaml +++ /dev/null @@ -1,7 +0,0 @@ -python: - - 3.11 - - 3.10 - - 3.9 - - 3.8 - - 3.7 - - 2.7 diff --git a/conda-recipe/dont_run.py b/conda-recipe/dont_run.py deleted file mode 100644 index a2a69494..00000000 --- a/conda-recipe/dont_run.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python - -import diffpy.pdfgui.tests - -assert diffpy.pdfgui.tests.testdeps().wasSuccessful() diff --git a/conda-recipe/expandpdfguibase.py b/conda-recipe/expandpdfguibase.py deleted file mode 100644 index 84381557..00000000 --- a/conda-recipe/expandpdfguibase.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python - -import sys - -from pkg_resources import Requirement, resource_filename - -pkg = Requirement.parse("diffpy.pdfgui") -PDFGUIPATH = resource_filename(pkg, "") -assert PDFGUIPATH.lower().startswith(sys.prefix.lower()) -PDFGUIBASE = PDFGUIPATH[len(sys.prefix) :].replace("\\", "/").strip("/") - -if __name__ == "__main__": - with open(sys.argv[1]) as fp: - content = fp.read() - output = content.replace("@PDFGUIBASE@", PDFGUIBASE) - sys.stdout.write(output) diff --git a/conda-recipe/menu-windows.json b/conda-recipe/menu-windows.json deleted file mode 100644 index d2cea178..00000000 --- a/conda-recipe/menu-windows.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "menu_name" : "DiffPy", - "menu_items" : - [ - { - "name" : "PDFgui", - "pywscript" : "${PYTHON_SCRIPTS}/pdfgui-script.pyw", - "workdir" : "${PERSONALDIR}", - "icon" : "${MENU_DIR}/pdfgui.ico", - "desktop" : true - }, - { - "name" : "PDFgui Manual", - "webbrowser" : "${PREFIX}/@PDFGUIBASE@/doc/manual/pdfgui.html" - }, - { - "name" : "PDFgui Tutorial Files", - "webbrowser" : "${PREFIX}/@PDFGUIBASE@/doc/tutorial" - }, - { - "name" : "PDFgui Reference Paper", - "webbrowser" : "${PREFIX}/@PDFGUIBASE@/doc/Farrow-jpcm-2007.pdf" - } - ] -} diff --git a/conda-recipe/meta.suppress_yaml b/conda-recipe/meta.suppress_yaml deleted file mode 100644 index 568d0c7d..00000000 --- a/conda-recipe/meta.suppress_yaml +++ /dev/null @@ -1,71 +0,0 @@ -{% set setupdata = load_setup_py_data() %} - -package: - name: diffpy.pdfgui - version: {{ setupdata['version'] }} - -source: - # git_url: https://github.com/diffpy/diffpy.pdfgui.git - git_url: .. - -build: - preserve_egg_dir: True - - # If this is a new build for the same version, increment the build - # number. If you do not include this key, it defaults to 0. - number: 0 - - entry_points: - - pdfgui = diffpy.pdfgui.applications.pdfgui:main - - osx_is_app: True - -app: - entry: pdfgui [not win] - entry: pythonw -m diffpy.pdfgui.applications.pdfgui [win] - icon: pdfgui_64x64.png - summary: materials structure analysis from Pair Distribution Function - -requirements: - host: - - python {{ python }} - - pip - - setuptools - - run: - - python - - setuptools - - six - - matplotlib - - wxpython 4.* - - menuinst [win] - - diffpy.pdffit2 - - diffpy.structure >=3 - - diffpy.utils - -test: - # Python imports - imports: - - diffpy.pdfgui.tui - - diffpy.pdfgui.tests - - # commands: - # You can put test commands to be run here. Use this to test that the - # entry points work. - - - # You can also put a file called dont_run.py in the recipe that will be run - # at test time. - - # requires: - # Put any additional test requirements here. For example - # - nose - -about: - home: https://github.com/diffpy/diffpy.pdfgui - summary: GUI for PDF simulation and structure refinement - license: Modified BSD License - license_file: LICENSE.txt - -# See http://docs.continuum.io/conda/build.html -# for more information about meta.yaml. diff --git a/conda-recipe/pdfgui.ico b/conda-recipe/pdfgui.ico deleted file mode 100644 index 7c26d10ca3fa43b399a7eb312c1d102dec299c7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22382 zcmeI4d2m(NwdOA-9XsVzoR{bK>Lpca^13^(TG_x_yg*6*#nzx*)n zfdj2OT3++Ew!c+J+uXRtl^NCif6v&*76sL@T`j(}bKU#dyoeGHMUS-1(1<4s z1H)ELsao@wnPCw>W`5_6ckFJrhm5j^BPZJCM$Ij?cBrvl%c|SJHb=E^_beGb*{=2) z){znr`d_)v(Imeh+ti?$o$lPruJs$@#@*JWr7=(2#yvJMx1BB8 z+8MsT(l>gA@A`xqwa4ag-NyP&Ot!e#bAYqgz2W06t4@7OXWUIu&8@KaAiKnO%?eQMgl*cQ#QA^v6ueWlZ)~c8Mcl66HTsPK^wd-Q1I`%wY(7oTUbUiliw3&J9 z+B-u=+hyja`LC!GY3u7ZX6})8smB24cdoHJ+#@Zh&ezHQL5V4WVejw?+lP&@r4{ub z>ioyLY#rBXof`YtmtF1ti1BtG44moK#}2mcIQYG$W8^)UI|H>aK4>uRro?s)Owk(%dmtzmP+X7A=UY7vQVw#z1xV`sYd2B)L#CgT-!>zl3XeLvX$W8%-NxyV+UKi5q--L=oJv2(?Z z^_$KSuI>#RYn*e9HUG|ct?xaje$&2S<91R1Vdt6mXt4ZDJnw1M{tt)ScMUk)uB+(5 zV-r1|?QeTLLo0eb(G_@cEQeQt-ubLobeZp>pMF=|%;R}rr9AT+j#c3$e)?Pgi<4ly{FSJqP?GHK@*c=3wh0n-CjK;F0zw9=Zb_F81iJc|2TRw?Sxm*ZYn!#y>Lu z<%zWdiRaQ7%?OFG-EgmXVtTb&hvwD_`e)zydOz5v<6HCng8oFDz=`3GPtSG(M*FOI{JoObXxU99^7&OAgsp9ntado~&KknVdmWM@T>N=a6P+`g! zHTx&~1z%3B9pYUSRM%F($0vwO&E-_5o@QfW9M7KU(8F#F7$)9-%y<9z{J6f)@J;UW z@CJ^P#Z@coH8gO*{NZQTmIJ?TY|!LuZ2dnNdp^0zz?zX~Y&~44H4{UQk8FILJtAM& zl-YKB&~Wokm}=Ongk1MC-*{!;$tk~rD<3gO@>yTUr;2flpJzAv4|9AWo>I=5?;o^T z`AeJ)2XJl+%L2n;9*~Dq)9W&WV#>UzL|6ofA3bPf=k+^z9j&0?eLsnSCufTfoQF4GdQ1=rLmW+#a z^Ed;hE`a0JtSPQ)ErZ)_E;!X1HNJeFO@7i`b=@(r0!AEe?vv->S=RQYiv`)@O5ee@ zmOPLWSSP|a2ktpl@mAP(h{1s_Ux=^ovS!^&ypQi)-pb%S`CqZlT3nn9JKWD6jhbYa z!K_W1ZZ>hM%lrFUb+Fa-8j9khYQAk z;u~M@XtZB%YS?Vjel(YItMpPKYmw#=))W(`JN0sSlvdGr`R%)syZX2>lmmA(ZH2Ex zY+>y%G+iqf$HI%WkMxr8DSX@kqXk`hpD8=O@AvHRhW`uB=#^4CqzKLEY%ZS)7l+$+ zc6vvg@-=x~`8|jGDkn<|CDsfyu5OlKcXlkLABd*zaV=p3aue#}lTR;$1vT{&C|9D{uu^Z(zcTH0)jU z!%qCNk(hZhdXnf9ZX%xh>Kdklr zNtLUvR{ora-qk(UMm8q48(I!JGXwwKg42`}jE$MU)jtr+f8ts-47K9c{ym^-Fe(D)}i^(exZ@0K0^Os8J&60bL@m7H%i-m&)G zeLBzGKLK0|x8gwMMdH-qO?VgoYaHoo`QZY%S3RV<=1`kXYsw7xVns`i#C^r(7z{q`FT0SVGj)_7kA=Ki%WFa#i#e-_;p}wB>Lv3W#@rkOB8Ra0d}B2RL3ZP zYrTq9;YqcGYSpYd4W8n%k&889MYuT6ScDt%Di|SbN(M9~{^bj#KO7~Xo7S9U}g)g<+@%zk&e(hl$WK| z$ah&jA7GP@!PQme3!6UI%|YC1;7}Z9if1VqIk8Z^zd>i2Hv>3ytHN!*KkyqtvIW-Ngr)#P}8P!8Hy8$_1+R zkHQl+Gs)!_={@rEX|TLmSQ8$keN}Ht_vjkcvBH>YSL)emzV$!8D940&|=P3q>KiBUl zd!2rVQ{Q7A>AF_>NO7nb!AB*Rdh}n4U*CKFn({tV2To9*M_lv(jZbgD@%e4WF6i2O z5t{19{agf{5fU?W|lL!cyM&(f=bbqa(?Eil=BWRkLPV(6?s+Q<@yfAynA^eS}Qy# zeO2Vx+XbcPz8CHB==C#dXSw@*A?HONyHStz)h2C1Zb5w%p*I0r zBsOkQTNf;8+wpHbwIAgE>Fv8#o=~gyo|*JR=A%a!qHB+$W%QmvpCSW&l!-lLhmn=5 zddF6&W?7!(^2+;^g1V8d~r*GP`>4<0?K zc1S&)Fx|i0vj3%Xn;F?CV&F%gT1r@icL}xW6l$SNhqF+GSWH3Pg08Z_Oe0W5vhOUHSW6Gr-lcqaP={cdutfczM6nS^haQ4b`cd$Suh z^CnRLM1Ne_ruqe5_uao}B%2Jc__MCxkV@0=`Rv-E-UZZZv(cujsAD$K*TWvRv3VQY zM(w$r7$_VYW7nzM@~J&e(6?9-)f{YuSwg*ri(hfLS3WJjdtZ0%gOp{zm`)F3+!r;x zG58~%xh4{SN$Bv2^oSQS$5b#nxw@Y>u4dqaX@OxWx^Vr|>t8nDxEg)~iD_F&eKrxF zYn=zs-e=JFYp8op(bFtq%?GJN_o9=pp_fmizqeBtE~aiur`}o?(a5s9_Nn}`v0nH4 zm>K~K6^}CmLcG(dZ#AD?Xzm318B3V+QpQ(o9-%hc-nNrXs^(|ozo==$D_70cSj6s2 zhn!F=XukY>5G_54p4=j8VEt~%OKc4`SxwJH$CgGkG~&y}zs43m*74mOYPMX)9`R|F z$PK*)ymY)*Js~c*PL~N)Yr-|vSU){l#yrGc-dSv)PK@qBGoPYv)BACbeN8>Nj$Y7O zUNNj=dO+~r7mYQ!R_*YZT7lbQ0)lhniR~=v;|chF0hrnV-gi;k%C9r9{p!XoY=5U7 z4)2P6%|rZnfEc(+-M0}tOswYTol~#jp%;z!Cdc8PJn@dk%4z;3ywlxIQ#YSx&tM6) zeiprnOyVz#`JDoj$HC?mYQGy`bpvzC1jk8H&3|8Z>}dg^{=+`|oIF-T9Oj+Jy^})f z+I0Gg#J^?JlRDa?zvcJr@Ayr&+(Dgnjb8ba_<7F8vPC|%(n>hO7A<#nSOgb}k1~1> z{D-pRz3K0}#!UPN%}MuNLBDJpbJ&aT^QrY#Qe)47^E9_@)UO-qE5yTD(>Pyqm-7KdWB(zw0^Kw+TC}Y^qH#J0c#e;n@C(gv z2lf3#Vn7;X6|p#r{{JkFOOMD0h1A?d^a>P*;-I;#U;YzMq|~YJ)o0CNbk&;KW60O& z8n4bx<$kjQLL7fif;}Wjgy{%c8RDT~M!K*^jUFd#r!(!ZhZ;lsq>VUvFbhiuHw|5takC#eo;8(>0g7 z3CXq(4md$>-a^mrB3Qjb4=EN7SjApYZ0(RitFUu!t9G`I2LUfg?3&ijH=qH|}UzLtc)5#mk84qJ;nqop&*rK&z zgH^@MHkXDsC#w4lZEl18C+u%(QRKDBA+GBbNCss4AiMttu6 z&bxSNH1VofRgSqIKi4j@KZXvl{lwe>^79e&$N^$-KfO53EuZ;|!xbk*^yIG5-=4y{ z#!<5I$u^gKPe=07PkyCQP!BPCWirjKnd#$M%P7C?C;1bx{ z4DagvvtV*ZhpzBWxZ`T!Q#>UO7M7GFCRO$G4zE(}{InXif0+~!^_{hrcVMc2(25+e zByA^~UlyYSt3>?vG|lOM9iyI@eUUNSq`9@AG>y|#s1aTOd$ulM=zV~20)W@)?O zU{X0=^Ggn|Z|mWe?P%K+u#wF18Q534<_`N%x8|nWE^MtiDE@42inGNE^6eFDV0>>Y zHrOfFxq3-3SRnL0=`7@rBe6^ohfnjGR!6VA^;<~MHfb^IAt@)np zKLi{%vXyY~3FdJ}xhf^Ywv#gl{OQj&kKDJGIY}c6_p${s>3&ZKmx@>EWyS8$KUcOq z;z>ABJSZQWCZ?2M^1<3g_MB`%y4_*lrAXr}Sn4ppj^_f`fS1|eNwySM?PNbi7**WO zWlu*OC5@g6FVatWlkw< zHWzO$;(m&e9Iz2joKSDtITF94u46mV=4Zg^Lpbps$G(OaA19^RWw5FBs&})N*iQt{ zsuSc3`9&Cf2wy0V?PWcO@wbjk!yJbTl>>Eu)wVarPqFjU6KyvCS`HDmTE|<9TV0kEK;?UYd7p^R{bz>v@y+17jz>KeAe_Fm&DE z<;~i39nCXi;&ZKC7|j9C7tp3x&FMlu{g{Mz|wy7hB#K5Tyt22u2gPRe{eq-QY^T> z5yviriDQg6FD&xkR`(wGCQEnMEO^?_m>L*1h+gd3%*e)G=}pDG>ZD|HS}HzN?Ieu}%E0 zoTB`)2YwWGG_HIfPmLy>W~rHWj@+S|^Z`0s*nQ)Lm$`6qjexyr#F=<(EBRKnuQ09H zSB_i$6yvJpRS#+Hm(a00z^ioAO>*faJ$tuo75tgN_fzcAv^lmLydNDk!FIA1tzY?U zQ_C;GMSWQKB_HO;`4oQpKziWxtEmYrC)Zs z%rf5S*P)+%F?dXs>dwy6*5Y7cFDW$KVO24`416z#E0yaU=dmxp3H_oRq`KV}udqU% z`^cegQ_U-VPw&@_MVz^j6D`9&NJ*D$#n*!<{^%S>*>$A*XoIkNzO_#4S z7~`u?KF8k?RtT?nS*!GjYncmE}mCzy90)$1!P7J6p>=p3o7mBMM^&!o^pk1@VgOK zgdP*)`y&0SxZ9`>s)x7_o{uSIa0S6V)g7?rOzrskZ* zINGZa*Q=(#L2WdS7~To))w?@4bhPVNmCz$loqTg_tlglFz8F2iEG^4%mHM4=Xku}? z)+!yif>>a$$JI;X7IC|J?~1wg#QHAof42Wn$1C!`ctAFGHiH9~HE!`{4UjSx&|WLL z{AbaBuI&1;s$u4`_EF4BJva45)gKVXrA5Sl!h!bcRC~$4(#z_JUg!BO_3yu-zLQRS z1eR6bB*We6|59@~UKeNUdU3ygmo`+NSs3zR!PS)H7}cPbyx2~XXKeX8ryZ3~rBjD| zQu(7YOL?PT)7o_WV_faf?ZSRM`CIsxE>ZlePov(2`UOeUSDK^dyb0fkr&ptG_9~`{ z)t!7d2YtJY-sa7*G4^Cms^cZ?>x$R4$KuO%d2ofey|fqJ#c7>9YvM+ zm)30R?X6|q+t7uZhy&Tm)o|=%DAyIi&xd;Sb9w4C+T=3vdlYVuC2q9G8HXKJ6H7ab zQ^YUQ0$Nu(Hc#T5RP^N%j;pR$oggjcYHaE)*Ewv_Ls+tiQS!E;!O%RKsf^4|*lA)TjsMSGd5;l#y?&D-jTZ4!7== zo@&&x>Z`1?ymJyFqWY>wGmZ5~Uv7r0bMUD!?bEYs$h-8)=>rUP=V}$HIlKRShdVZoqEq(Q(27Jt&)uW>Wk}AItBX`A)V| zzf;(jkA*M!SoM^2o$#XlKxOZQ(y=gG$hu!;2NLUNb(r}Bu)xm=@l zOV>^zw<&H_t4T|$Ueq3%Y6kI|#*@Ah=4Dg$g|E@e()wMkot9~r>8(m*2}2rNJ=#>T ziLLJ^hd2Dy$`;>w6udl`mwSwR?wHM*gmuMj?w6fxC39KCoMjW?Uv=AA{(ecZsvNJ^ zLi~P$SX3WK`bJz)2nG(I?S|2_P%lY(Mm4+g82vSPpTBXX_SL%7TUAXfji-GlX&LQ> zNi$39iBDuJ<$TptswJ|qfqGJ@^a*%IVTTqp;`8e6Z`oe8*ZaH?$Ys~WF;l^+)+^pg zr3OhRzbRG^;1A_*@4PgpTMO~~H~2#}_fcUGeVa=jm;kmPa*q5h-|P7m@uf85Ue=~Q zk>YzN^OvSkE|b20$o2cMpW@sIlq_N6L>Zr7Lyy`)!2B~8&hu5IGQt@Qv{yg z*V-_u@U-)@;L{ymSOVzFF{Ypz}&pVSC*D>|^l#}kOjzPysw|ja1SNjnMsdvQX zIq-tCoqEuNsAGg9#f^G2(k1E(smH1Lj^%v4yPgQKFC1yV=N!F7)p2{l-vM62lVai7 zcvx)b(2UjHv$Acc7p}SN7o)2AHCEqJb?bQi zp*8a?i`$P?9BS|N3430`sB*IM{4qFNdmzGv`ZvN$4l#U=T15Q|`F$Za@YPGIQI%6v z+a|L{@rksqG~+p*!7d>$=HYMgpyE$sdeKVK%+dvl2Vp-8j<^q2v=<}YC|#ueW7$)^ zZs`;DU-him9<7nR#>#@qPM%)M zG4Q@}pY~ORuc9$Lho7*(=^OPm){=|7d=@t3clCNyPsoUN@O75%tI4iW?;OEy`-skwBIxFV$e;vd%!r5)|t>!C@rTF)8-#Kjk zHG1n7bI~4|dTx*Bq?niWZAU9C!RPARN)M?IC>)5lACkMZU%ia))eF;piQ+-HDFI(v z%R2rZ=nl^|JY@Zsw5iTjk3=&715&9*&?|L%QU ztR5jww5O$hv^2~DY8&-Qq~RVbmr)O^4==n+BWh0|uV1v&4C*Va#$PV>nR6j|MfbnX zH6^p>+dg!?uz!FtGT>x!t++?}F6KA?xH{nkfGi=2j5PenC>^t!JHs=9*xADbCm_oaWYziG%wPimWv|0X>nY)W@z z@wYlx&?wrcxW+uiEvmZ|k0tY|?-pgbXB#xvE$F3ntWjJx101eLr><<;3j2q+m=y=8 zA0)p?JKSRblxGcHuDLvvy=|`7o`QP0@^2z|maf*GsGb*D21lq~*p7d%(_8g|kE6^( z&kss7sK4Z$m+G);X_;ulG2mx{+kek$+_HCh{x0vB-F*B`Tu@jxSmb%7`fh!SZSDJ> zC-0vizwL+T9>UKj;q(o}hj>iSbV<{w2E*P?=dNIGzGoaB(huB&Z_o4_TFU3dvU-K$ zQSE!nmR{y` z&pad7wY;^Kcg)p7XDbY#8_kI(u)Bca+A#8h{aWtPoa%2uZ%ZLB9hp*?m zl;@QL)C-nIR~}N1{{~(=1va#As%JTF#msQec|0M$U0*0^F+JOU#QjRQcf+&qSH)#9 z_*^wZHuqS|OV0o)Hy$ST6-%l~lwZ%`3)PXz-_py{2YFy^U$;KqxnU7Q%UkPmoDUqJ9=IWm5qDP`Vwe7r)69-3F7d*N=E~IW7^+Kc>l`o_jwEv*k zzYhOw!_L}E((_lsk(V5#I#^gxjV3)U9!w^GrbagY?=M>G>mKKMwj$YAdjMNnQwzfh zs(s~m^}3~rEMtuwAtu*g8$C;<=bvuE>FS9d<@c>{v+8I)OQ2rHA=a!~Li_u>JNLY1 zX72CUsEtmkKd3z(Jy&>=^(;r5%Pxwe$MMw1^A|ZD)bldM*jT)xyl@R%ohK%Eo@vYL zuJQZMPY9`dnEKbNI!U<8WzBk4TYkTbhSR>dp3gcdeFQh}BA%u9^=#lb)U%gj;!S-% z@606Ew>%3kf_X1}!t3mlcC^d4-=bc0Q-}`?%hj{)^1t%PWB5UK(;k@ouDoy$8z|qa z#(IFy)pNUyo%6_}r?J{Y-py|6iszZu#wW)^_jXiSZBm zNc~4@3$Hlx0N7EDsoF~WW>?8gx3RhQe$K+GJ#{`RJSrC<0P zodv|TSI?&w#?N)n#OwL6BWQQ&9ra;PgY5@!zA&n|5MQ5XZdc*HRrJtCRjC?H&+yyl zQkFGsUGD5Mnzj0$#K05!9A5FL;$Qmyf^effGS39ij9ZF(>~^+X9&)L1F+`*D))ZVbH-Kk>!sR8 z8dcBeETzuV-h=iw6qBm^^-P?41=8&$)Uwn%UhQ?SY0yG<)Ti!eToj{y?zpqArz?dUzs+QpBD!CWES2N(C=F>`LY|6A#G$9&oOasI(q$z$HsdJUWgyGrbmF?yYX8#i#Q5Z}jzhW|hP4O?pCmH|9FKV)GYw8%yir`GU~TGXt~ zZ(la&zt;B)TetVbRjc_g?0prf&R@VY8mdtWcRt>~SbXaJr&@zN_=yR}`HZL@>xM6K=8>y7rL{xhue zWpkibaHp*4(Cvd>|L3DWjrjD7k7qsAFfY6I@8AF30{=fOfX05|&y%-HzbdX+`d*;j zG4Ei@@eJl)8&tArPi3>{x81wf!@nNjv)5CBe`8R|o_H$oFAUs!LFv2x6+tC?;Ql2+ zMZNP=;pw|)aOr1H<)`nJxQTwgeb@g-;O9LjX7nEY^mD<}_tFzIpnfWu{;9%W-YZ*y z`|NvX{`y?uFYnP$KkJR-rMId0?R)9G-hO)9_ny0b#iyS=zW2eU!+R<}_g=}jKHs}< zolnD%=cFpX$uK>fo9x30JK&WZ2kI752|7swI(?Q5|d6OA$DsOXC3oydF6Q?C_Q J;=>Dn{x5`<(oFyW diff --git a/conda-recipe/pdfgui_64x64.png b/conda-recipe/pdfgui_64x64.png deleted file mode 100644 index 34312b4c34e113f255df4ef48e3f765b5751550e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8944 zcmV2WAN@8 zuYJJFn#BZb!5EgPfQ`+GUjCo&d7tO` zpZCe{h2P*ec-3&zo9+bQBOmf1hj{nwk#>Kn#K_p)Vjnqo1_>iYRd{JvgSJTZU!*y!Nn|Mjz1#{b9*Oq<1m6@Ffp@8$-)@w&gu z%6|&YMsLpmrE(Sl@OlH}3!97#P4o2g|G4kF_q_kuE0y{C z@3{N=YE9WENtUKv^1e3^==CR4D_<{_^2Z1I!_R%`Yj0h8Dd(7fUE{C4>Tf<84358X zaA2HFW|LaIK&NBS9~+}D+RJlCe}-hU6AVV!yJv)+&>+tpdzz8KowshAdSmg}3*UPF z<;XkwjABp5gP#*{es*kh`qI5K2d?tCqkfB}Eu}NrgWI?5f78gwwh#I|`#XR9;oDxg z_x^uSe${!VS8DjD|1t%DXp#Op6o^nP<}sNCWVwmQ?FRuQNnqR50bX;(VJ61=IX{=B z*61=mI*#A($855F;ZvXZdFZ9eyz%v4zV3^kf1qWt*#E=K?#mb%8sw439wwb#V{JXo z?wv=NoERsaPBPFx`l)O-+I;74{ouNP6$1X`KlSnYYrlBM(BK}XwoEfQ8KBc?F*>>f zT~}G(NOJc4CS9dNF5jiyHb^8ln43S3-EPI{G|}nEJo@<4A9&yIJ$S=EpL^@OzW*=E z`-9*8!S=S?x=&FRdcq?}Hi@4;{xH+q4svk+9$tUl)i@k3yk0BYrna-Ra+cY>gG71; z9{{-RLqB@;V!$nL`wo)Lm`$c~M~4Qsqo`fnP7hsGXXp04jE}ikT+H$O@n;E#`WYG= zMi2y^eELU}N}I&`wi571SXw#G(7-gBp<(DM!C=q&$&*Jfibg}JfB5E&0Q~7~KjHk` z+#y33pALrx*|+yHviW5S#X99umS|*%Xk-AF%R#MZ;#bVzoLM8;y}jo?~(8 zG=l@XncaISJv}yb-NU}wLmZeLq24faVBc0>y`jCc*=)3b_M}B}Vx%WLf~IwmZsJ;77YEYob%c=q|TjE+o&UVq&iKL1yrKAye%o|^@LX0sMm zwJxP{3f<7yjISfhO#*>_%w`Miwu-}UXKHc}mtQuE(rvT6T&GrVvUA5UCX+}um)i9& z*qe)7}ftgfA- zUJqcG9HASoz5V{Tyz%z?9roB*v9w9R--p#|<=6|)a$w(8xLq12PhH4%ny%t>xR7N7 zuh+v<&pb_|Sz)mMYIMDWWRniRa`;YqT&O>`Y}&EVYJ)3}^HSS%JaO`}{c z5RGo3+pW`X8yq=wB~F)}Mngf@EjXP%wv3OkzM166q3slk-N{lZyWi~!JDbfC4!fUx zA&JfE#N~A3_l0S9nj{kIRI5c01X?YHT)xQC%5mJT0CKxct5v}th)^gdYv<;^|JX}% zflvVHgMW1U4-`chlq3(qU@wt~mxKGKP!*Lk=ayMrO>*69-$uPr!y;;|t}S4(*opKE z;B?thH5pNqa5?>yN=br&C^oB=YOP8*6vgF|7#eibXf{|_TtPrUvcvS$4vxNX4y)CQ zrdNC7$+K8QJGFX_TD^qaZjj5TnO|I_UT+gmoTXGwBFjxgQ6mzO2m~Sw4{hb({v8~- zXqH?qg(w=O7j=P8{lycc(%H#(-g@`K@ZetN7oVp$Jc`TdW@9sr$s|&)5fEU%toWN0Un6vge52nAylODSwNiG2P7nX$eeMu!8qT@I3|HN4&+ zeqR)?*G4#4WXJXa78bLZ%@#CW#cm5(Uo;Cm`uNuw=)3$;pLZbQ^Loh_vP_QeVSH?e zN;OV0m8DY4(GwnGd~}RVwm_lKL{&R%pYEeAi>$1jMbiYbxizAZ5lZDeduJ|3QR?LL zd78}%imHNOCKijZbxQ<6@Gv+36i!DEiPQo+rY~Xd%pL~&NAY<2I50cS#P~F4&K_sW z#0>3j8^5;~O&3vAgV{aP%+1fEC>o`5jdCf=_}CEHY?;NS)6^S9Bh!%-xZ|_Yx5}wbfO&Pw!`TW*5&LdxB7)pQ)*x_`FU|pIxWfYO%0*mfoHrrndAmI?~JfMi!^j z&GO1|EEWgNW{Y~GLB6n#qI58stQ1RG^2H5yY`chDA^!Dm-+jv+FB${t&8Ej@)sQ4N zwR#m%6zK_vX*NsL>J>KQn-mHT3Z*Q90bZ}4-Mc2ROZ`0i`~tgnZoy=-(rwH1ghyyJ z3gq%Dm@QU%dtx{oBJH-y?962}TX`P(@wXWo*v0bdY33IdB%2ezFO0<^V$ep_y5#c- z>WvC5xsSO86_?A2Ac(y7>KVFSne~l1Y&Itri-}7wz8+atsMQL@lPd)MQL42XlFhRI zqLtt`{{Bqh{M_0X4NPcC7fsWNMh8i!mx%RkW&gezBE1r;Yn!aCpGG$feBKaXqtg-C zh_BP>m`Nm7@cM#OYeo8^lZc{-t{aG=M7`0WT*+av*l;*J#1ktF4{axxPcXCdVzx|< zvKddJC|%ap(`?&1&A!=jBwLihfj-8^eXOq+C|5Fsf}^zC8tKe3vA#)0ho;FD@{}t@ zblsp>${+|PGP$Lb_df96n_rZGZhQD`0srV5`=VoH^Q#1dg9HOTY-}#$aQd)VBy3g} zAX2N9aJu}sTuyTN0>x61WNMj8wS?dApf^0i!qW4Y%@V3A(`;4|1PkqUn@Tkc2CS}~ zLKGdeS~c9x0B*ORa5zG_l4oUY4!=K)-R{C{veJ^f)EhENSEOEVlFuiJMu*5|Q{?iS zAXq3@^28JK$a0-*ZXJ`!WGG7W#2C}tdfC{_v9flGNbeA%!@Edl5^Tm#<93DV zc3U`|K5Dfbg;Ij9(xTa_Qm+>f1T(s!V>VeX#04x!(uGv#@dT(=>ogi|a=8rkMwL>j zNF?H8X4h^?r8Lvilg!P{Q7pw#)DB)xh(c)-K>(9UKat2Jj=cGXKUKf_i{|QA_5$C! z>)rQsy5&N<-9XoMN|iL(>?Z9_n^GxBGQCQ>Bh!*qDwPYZWFnbkb+w713tV-@>)5k< zilvovoIU?DKKQ=>NV%G!*{UL7W^iCTyS87>^weQgrA;U_%-F~-OakNzYXAfT0Ti{& z=;$u?&dhMhk*zcuWmeWtk;!ZzidLMC008ksfn2VG)n-SM+;qEbYV{I!$x}9&Y(4ir z@ZPCJRWxs6JvYvcs#h>ZtQj&wOXD=qe?QFU}15Cd?8Id zvChKMc{UU0Xvt_||v^vH*V zmYnPT!4KaP@OmA2fY052&C45!&F*>25luDi?kX}CixtV{CK%|WwGV1tw}nFo4lp;LK-0RYszS3_LQ&g*fX5Xkm07^$ z3{og;(C)~H770bss8$Pfl`h?`@{23)<>HGj$87enZ*~Gzl{q(emU!|ks@7re%;l8I zrT$9}zwcvallco59r}a%*S_^;UiM5dy<+gL_w0S}+uwZR)<(19QdJdQ*YSFTzetHL z`XWPEtrpBCfmq)#s%8+4jMHc|+1xx&wN@scILB))dplrbZDSFK-Gk2;rrE5Z>jtHA zf@Z6XVQ7Ry!=y8-OpMJ^ZxpFiaK9k!%W8<&3V+c$pY_1Auh#pMTHlz{)s1)^gDf*>e9pZ9Zq-vGL< z(C)M-ma@pQOs!s^R;ywd7CK#(U?9fm@D?`X=UH4jO1YAv)hgrlgh{3|oH%uiWNML2 zW&^)3%Atd=!|n3oba>G<6;0D=wkqg`PP^S=Y-AT(CT18I7{@9a7=})>S!ZMO!j;cv zldNy7Grzb*KA+^uD-I%xCKAc>_ zBN7>7VtfmIQHfgB#A`0Uo?ScllT2+=C?rtT4ra56EVnR#BZm&Lv5}_TZP4v@Xvt0T zg%qW7npUepGPT6+orhRkPh&Pql*?Hh&K?v+L$ce^bz^+%_*GB6aQeHeuZV!J-u?og z`poOUa?4x)@Tp=+eut(i$ejkF#YRuhAnEiXAkb{p$mUit3=LJ)iS$HqI6OEcKTWyH z_Nj|FbYKr#CnF?MRaV#INHzyurGZsc5UoMd*$o2zD2+w|!+@YaieXquq}Lc9-Hl|I zsMd3IIv1)^41C770>;_$>h12e1d~BF4lOZ+IY;556J-?tAdd z0Q~IfJ65m0@?Ae{G#fi>wS2$L=Ef@8F$@DiFr%n4Ccy+~n9U-=z#xk&C-M2h=&DY; z)1X+YQ>k{yWD~5co}t-lFgP$pAmC?pZJAc9jLBp})w-x^2a{PuZnr5{GU&R2$z;JQ zItloD85y1;SIE+AHi#$AQmJK$M*O__#@`~5Ok)*oq|!CIT@3_gFFSJ6|9twn?^J)S zvH0*{>}aQ>U2`GT7*wihL{X&C$RkNECdctT&uH5a){%B-^U@#1raXbB#%IRM$M9K^g?PbsI1DMS%Ha5>-0F`Q$!U>r`AWBcz zPdIF1VX?x>Y8hE>aoHvNF^v7(^Zg%CC?>JnJv8Mq;m|OWva(R(zt-{(y7g@fr2wLAb$HeIF*b`5_3ahc-dfPWpRN-r_R_Twu zo(SD;8$mD=i;giix{dz6F_u?O<8=5)XEr(Z!c!dBcP&<{K(SaMn@j$pCAQFRn<*3v zY{plxSVTn8jj9S{vMFpf7Y@6PVljo=6{g*3VKLhPgQi@jR8A5O_AoNMo$0Arwomu5 zz7c1AW06i*MwYv5Y%a26`!=Sw93YcTzHRr;8y`P$`X4ubSz0u|v^~K0SzNlmwRQ4! zpD+v)Hmj3rHH%@GsMRaP6ANVXtC-DJ><%ZA%|j$I$hN6bJZ?Lu&K$$z4iF9pv04ol zm*>gm)^R%h7=}QlT4QPDBm@0}^n}OA=i}6yMNB4vKp;dqvqI1xlu9L3 z%|O>A?2?;IcAbE)hk)OK%k3qRNYZY1>2~Y%$F{s{X4fqTzj4Q#zVmA@Mh5#Y78Ip> zS-V}M({0gc6lpdqXu683ss#KoRJ8+wfW>U1+3eEo3K(d(+ySDID3KmJy5U4o6?%IH znA+OU;GmaOrp7>QD~rpgNu}rMkL_e)YzD74NVQhQ=?I`G3bk5|Vkt|z)1g+Yun}M8 z(u-#iEdgvcH%eEh)+n&Jbd=wJ_wTU0l0;S2@v)I3PwwCQJ8LISefO0Uu(t8o<5QEb ze}l&piH3uN^z@AU@ATDZ7O>mBh@y>ZwScCn$ZeTuG)5@oB9+Qv7y^xkPN&=9(jz-C z5Pwnkn<$kkc)bd$Y9?PuBATrTf`w#ih5o(?>h%KkMu}RjM6r~h(`iwzUKqu@oDs6Q zG^uo)jrbfEvyJI(JILlbD2l2wNzz7apY zUau8#IQ-P=IV8!AuB)`=7K+*?omoOvRf>fI7;b8fBFWS`3rpuP2_}jq1GCA(=H@!{ z3k&4(Ym~|c4u=l`foeTVHn&EzS*G5s5{qpm9E#EDwwT(ol}4k4-`7L4*3QGQ)II17=Ws3)aq5_R*h_a4YS#TAXsQLW%Bs~8=L3JViFA6?G~L*i$=4;&g}dSVN&T8>Wwn_{5lT11Fx@#W~0K? z*8Mb_0;$v{X0t&k;KORQ6A2%<^Tr$ATm0Em-+uW7y!8!V`9QsHd2GwXzMERD#$|qg z>>5ooglO+Ds-{w{<*?g*G#fPplZ9+Pj>qN4WESWuP3)3{Xt7YMmFRTZRBI&?$whoV z2Lb;ux*@Q>c@C4g%izEc0=@wCdV@&sBu0`j^|xMD9q`s0zxF1-H~L{k)sBQi zF;-U3vv2k_jF0(Arzfb@J6v|@#XR%evm8DC2!4MIpRX5H?P9lk>FJ5#ad~KW+5`d? z=I7%C0zs@+GiI}d$TOgjEzD*YhGE9(^q?wmc4diTDLL@63ZdV=>8m$c zt4APY-rGMOydY=UC3!RW{k6XQELaq4I2 zx`D&)C6imG-Y8-+nK79xG#gFY?FN-fj#4#4rIJAu9c(7%Xtqi?9Rcd~B8$tX+1$(l z0)k+nCp>_r8AvuKqr*F>R`Vd37#W(uWHMtF?X=`3cDo0qYo;Y@tgg?IOfBPa2dLNE zWOM7dT)yt9Gk5>hOCn&~mKz>bHPs)DOfojIm3F&=VO$7coAE5FsWvcZwt}uJtZgKT^hR+y zda;TkqSem$=oqrBA&O=?-6p!OaK$B8;qmm-+Z!bu9w3w5pj2M@!;Sb;tzSvNlh1sU z8(#N69vp~GO{uEF_HFy|`$Wp+IxA}@2n7dl*xd+%ovxx$uQd=wCuWm{<0qa%lAO3) zQ8ZO&dF2^&U8CJ@&}vtabCOvID(4D@ej$MjxeF^Rdk zIW`lk#3EyCnH;AlRV@Gbu|NCsmlOjgMz8)(uCPJ0cbrf#N-*F@w3*E@yx<=bu2=4MM>I zMA3rH>O#|1PMkc$^zBsW&oli`lhj|Ljfm)93DeaRMeMuKR?;;m2&Y(P&hu)Ea<>rdt>r z*~*^X!`K}XXU?9&Y_>4i-_O3;Aw)|L?M@TFFO1#cB9Tl|D#uY21yQsyJhTN>ZK5a! zjb@d0yH2B7Lf3T$`nM8^^pnXZNF*2O?H$JN3*vHFQB<9DHczF}A`}R)Z*~lDF)`-H z+jsrWOREGY#;*TRZ+O`L z&zsgr?+B93O0k&7B1*J7X4-9y9owgAHd{z`H->Jds~ULRD&|)WOHMe+&CS6n$0rRS^>%CLemVIEtPt`K|Ha7 zswg;}9?WJ5u&}VWiq+<#*=nNeI(?C?m`o-L#ZAhU1mR%lE#JHEJ->V6Xw>+}dw=hx z&jYq?xpoG`?M{cAPPdKKYR4)%NTpXVG(PnjR+~gm*oWWmVqsy0dZR@mxrWCb1Vo;B z{sDTzLui`(y?VWJnZ+WJ&nIxX{8X!XOeT@}#iKZ#Av#@|$%z@JwhrNR*qL8E&E)tV zrl%+I`9#j0KSw+{hsPbhkX5R6QmG`le3DYRjKyLg2xcvpUomyMO*BnD=k)}x(2d3u z=jVUK!qNjTeIWAbzf3VUI{4Vq^880*eG{b8ix`H0+-^~?7ilz#7=TrD&{aT|H4>>+ z3WX%)N(P4`%w~KMlgUI&uJOJ5ZoPbb^vZ*kYHnOrI(Xb6G+m)w$xv^WXtx`Lfvd5hSTB3>9he3oK7D;Z`?W z5(xBRw>eRiF6rD7x~5{Yy3q{{!%*0_=W6bM`0uX|1;hvMd+5)3-|ydd>C*DK$DNKK zPG^8-tBj^zcn#7M8o_3>qw5B{b{^)1lTYCHMF{xASgkg~p&-LU5+_b2kt8=BmxHC1 z6=Jaf^}0r<)8Wk7pL6)ou=|fbdU50BG+?gk5F)gfq|`zjZV{UcgbWo35VUEx$Ao$N&_5w;m(a++uwSu zR?pwk?lcGohX5|r`K=0_u8duBV>VmydVHkPYsj)pr`y49ccAMR)@Jee2IWeHbasP- z`*yLgw8rY{X*6BMwS;FA~ zdP4mOf)$fV#N!FFuyC4OK1CvVo~|OFyz8Id{fYnc%=yI!mew|Y`WM@_UNX9u7zo6uRFVjSh+%+%iB7jcshq%Kk4>6)rW>3;zm8xs=!=Zv z_XWu16WF9-yzUtFW}R|5M=oE$;qXu{6*w@vEB$hfe@V~f-+1j`qvM#?4dc7IX4>X- z`jI3TvRudG4pOORD3;=QJw1i{9(rFG;Ip49^5KsKUy=g<<w|T5TkfOH?Wu><;0c@7(>nZ{`)?CH*gO z%iHeYj_=;WN8bNv&%*Ml_lXv3S2xtnc3Zv9F4+<$vwrN}`~UE}H@xmk-1o!xzHBAl zar0MhTHA=<)fd@@D2h}nX*5j*0W4-4g2_arXOw7UgnFYwv6Mnpx>RZz!olFPU%%t# zLl56;@Y)-Ne;oq;U*N+Z`2MBK%d4L?n>;h3Rl;nxFh07A<<*mPJ2EbJ5CnlrB}J=M zK@iNi-R{Qj9sOgG-f-^L4;^?#a!vnM2-rF?@WlNOe`JrMW>2=7WhBW>Jh6lzSnznm zRI3>>nZ;iOz#fJMLpR)W-+SHpV&@eb|8MFB0DR_?&vDzw5Ae=gzH(Ek+ + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* remove conda-recipe folder - feedstock repo has the latest version + +**Security:** + +* From 094900cd1b2e1dc74c3ca4659561da1398f36dde Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:46:28 -0400 Subject: [PATCH 02/20] pip, pipx not compatible with matplotlib-base (#222) --- pyproject.toml | 2 +- requirements/pip.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8f24911f..7304a8db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ exclude = [] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) [tool.setuptools.dynamic] -dependencies = {file = ["requirements/run.txt"]} +dependencies = {file = ["requirements/pip.txt"]} [tool.black] line-length = 115 diff --git a/requirements/pip.txt b/requirements/pip.txt index e69de29b..d398d156 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -0,0 +1,6 @@ +numpy +wxpython +diffpy.pdffit2 +diffpy.structure +diffpy.utils +matplotlib From 33194a0dae4824709a3ad9356d4956c49c3908ad Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 2 Oct 2024 22:06:22 -0400 Subject: [PATCH 03/20] Remove importable package warnings during `python -m build`, use conda.txt instead of pip.txt (#223) * Add __init__.py for static files, use conda.txt * Add news for warning fix and conda.txt * Fix typo in news --- news/build-warning.rst | 24 ++++++++++++++++++++++++ requirements/{run.txt => conda.txt} | 0 src/diffpy/pdfgui/gui/design/__init__.py | 0 src/diffpy/pdfgui/icons/__init__.py | 0 4 files changed, 24 insertions(+) create mode 100644 news/build-warning.rst rename requirements/{run.txt => conda.txt} (100%) create mode 100644 src/diffpy/pdfgui/gui/design/__init__.py create mode 100644 src/diffpy/pdfgui/icons/__init__.py diff --git a/news/build-warning.rst b/news/build-warning.rst new file mode 100644 index 00000000..ef0033fd --- /dev/null +++ b/news/build-warning.rst @@ -0,0 +1,24 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* fix "absent from setuptools' packages configuration" warnings during python -m build +* use conda.txt instead of run.txt for conda package dependencies + +**Security:** + +* diff --git a/requirements/run.txt b/requirements/conda.txt similarity index 100% rename from requirements/run.txt rename to requirements/conda.txt diff --git a/src/diffpy/pdfgui/gui/design/__init__.py b/src/diffpy/pdfgui/gui/design/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/diffpy/pdfgui/icons/__init__.py b/src/diffpy/pdfgui/icons/__init__.py new file mode 100644 index 00000000..e69de29b From ed56f4652a7671c57ed23faa69a86d5a61bc2277 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Thu, 24 Oct 2024 07:34:39 -0400 Subject: [PATCH 04/20] Recut - update README for installation, issue templates, getting started (#227) * Add workflow files and issues * Add py312 to pyproject * Update getting started, installation in readme * Add cookiecutter src init * Use existing version.py file * Fix preposition in readme * Add news * Reference online doc for manual instead * Use pdfgui instead of srmise in readme --- .github/ISSUE_TEMPLATE/bug_feature.md | 16 +++++++++++++ .github/ISSUE_TEMPLATE/release_checklist.md | 22 ++++++++++++++++++ .../workflows/build-wheel-release-upload.yml | 16 +++++++++++++ README.rst | 15 ++++++++---- news/recut.rst | 23 +++++++++++++++++++ pyproject.toml | 1 + src/diffpy/__init__.py | 20 +++++++--------- src/diffpy/pdfgui/version.py | 22 ++++++++++-------- 8 files changed, 109 insertions(+), 26 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_feature.md create mode 100644 .github/ISSUE_TEMPLATE/release_checklist.md create mode 100644 .github/workflows/build-wheel-release-upload.yml create mode 100644 news/recut.rst diff --git a/.github/ISSUE_TEMPLATE/bug_feature.md b/.github/ISSUE_TEMPLATE/bug_feature.md new file mode 100644 index 00000000..b3454deb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_feature.md @@ -0,0 +1,16 @@ +--- +name: Bug Report or Feature Request +about: Report a bug or suggest a new feature! +title: "" +labels: "" +assignees: "" +--- + +### Problem + + + +### Proposed solution diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md new file mode 100644 index 00000000..a87a44a8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -0,0 +1,22 @@ +--- +name: Release +about: Checklist and communication channel for PyPI and GitHub release +title: "Ready for PyPI/GitHub release" +labels: "release" +assignees: "" +--- + +### Release checklist for GitHub contributors + +- [ ] All PRs/issues attached to the release are merged. +- [ ] All the badges on the README are passing. +- [ ] License information is verified as correct. If you are unsure, please comment below. +- [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are + missing), tutorials, and other human written text is up-to-date with any changes in the code. +- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated and + tested +- [ ] Successfully run any tutorial examples or do functional testing in some other way. +- [ ] Grammar and writing quality have been checked (no typos). + +Please mention @sbillinge when you are ready for release. Include any additional comments necessary, such as +version information and details about the pre-release. diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml new file mode 100644 index 00000000..86fd9ddb --- /dev/null +++ b/.github/workflows/build-wheel-release-upload.yml @@ -0,0 +1,16 @@ +name: Release (GitHub/PyPI) + +on: + workflow_dispatch: + push: + tags: + - '*' # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml + +jobs: + release: + uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 + with: + project: diffpy.pdfgui + secrets: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + PAT_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/README.rst b/README.rst index 74ca65ab..694fa749 100644 --- a/README.rst +++ b/README.rst @@ -78,14 +78,16 @@ To add "conda-forge" to the conda channels, run the following in a terminal. :: We want to install our packages in a suitable conda environment. The following creates and activates a new environment named ``diffpy.pdfgui_env`` :: - conda create -n diffpy.pdfgui_env python=3 + conda create -n diffpy.pdfgui_env diffpy.pdfgui conda activate diffpy.pdfgui_env -Then, to fully install ``diffpy.pdfgui`` in our active environment, run :: +To confirm that the installation was successful, type :: - conda install diffpy.pdfgui + python -c "import diffpy.pdfgui; print(diffpy.pdfgui.__version__)" -Another option is to use ``pip`` to download and install the latest release from +The output should print the latest version displayed on the badges above. + +If the above does not work, you can use ``pip`` to download and install the latest release from `Python Package Index `_. To install using ``pip`` into your ``diffpy.pdfgui_env`` environment, type :: @@ -97,6 +99,11 @@ and run the following :: pip install . +Getting Started +--------------- + +You may consult our `online documentation `_ for tutorials and API references. + Support and Contribute ---------------------- diff --git a/news/recut.rst b/news/recut.rst new file mode 100644 index 00000000..ce91ede6 --- /dev/null +++ b/news/recut.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Re-cookiecut to include GH issues templates, getting started, and install updates + +**Security:** + +* diff --git a/pyproject.toml b/pyproject.toml index 7304a8db..2f5dc4e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,7 @@ classifiers = [ 'Operating System :: Unix', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Topic :: Scientific/Engineering :: Physics', 'Topic :: Scientific/Engineering :: Chemistry', ] diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 50128bcc..db812766 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -1,27 +1,23 @@ #!/usr/bin/env python ############################################################################## # -# diffpy by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2008 trustees of the Michigan State University. -# All rights reserved. +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. # -# File coded by: Pavol Juhas +# File coded by: Billinge Group members and community contributors. # -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdfgui/graphs/contributors +# +# See LICENSE.rst for license information. # ############################################################################## -"""diffpy - tools for structure analysis by diffraction. - -Blank namespace package. -""" +"""Blank namespace package for module diffpy.""" from pkgutil import extend_path __path__ = extend_path(__path__, __name__) - # End of file diff --git a/src/diffpy/pdfgui/version.py b/src/diffpy/pdfgui/version.py index faf07aea..b1181880 100644 --- a/src/diffpy/pdfgui/version.py +++ b/src/diffpy/pdfgui/version.py @@ -1,25 +1,27 @@ #!/usr/bin/env python ############################################################################## # -# PDFgui by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2008 trustees of the Michigan State University. -# All rights reserved. +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. # -# File coded by: Pavol Juhas +# File coded by: Billinge Group members and community contributors. # -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdfgui/graphs/contributors +# +# See LICENSE.rst for license information. # ############################################################################## -"""Definition of __version__ and __date__.""" +"""Definition of __version__.""" + +# We do not use the other three variables, but can be added back if needed. +# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] import os import time from importlib.metadata import distribution, version +# obtain version information __date__ = time.ctime(os.path.getctime(distribution("diffpy.pdfgui")._path)) __version__ = version("diffpy.pdfgui") - -# End of file From dd9f98989405f1ff6d0fc27b4c67fa59d37b316e Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sat, 7 Dec 2024 14:27:44 -0500 Subject: [PATCH 05/20] Re-cookiecut: implement codecov, install pdffit2 rc, limit to py3.12 (#235) * Add codespell, github workflows * Reset codecov.yml, fix github CI with non-reusable * Add pre-commit - codespell * Manually install pdffit2 and wxpython diffpy.utils matplotlib * apply precomit * Conda install wxpython * Add news * Set latest python version in matrix CI to 3.12 * Fix spelling suggested by codespell --- .codecov.yml | 42 ++++-------- .codespell/ignore_lines.txt | 2 + .codespell/ignore_words.txt | 20 ++++++ .coveragerc | 13 ---- .github/ISSUE_TEMPLATE/release_checklist.md | 42 +++++++++--- .../workflows/build-wheel-release-upload.yml | 2 +- .github/workflows/check-news-item.yml | 2 +- .../matrix-and-codecov-on-merge-to-main.yml | 65 +++++++++++++++++-- .github/workflows/publish-docs-on-release.yml | 7 +- .github/workflows/tests-on-pr.yml | 54 +++++++++++++-- .pre-commit-config.yaml | 6 ++ README.rst | 2 +- doc/manual/html/readme.txt | 2 +- doc/manual/pdfgui.texinfo | 2 +- news/codecov.rst | 24 +++++++ pyproject.toml | 8 ++- src/diffpy/pdfgui/control/calculation.py | 2 +- src/diffpy/pdfgui/control/fitstructure.py | 2 +- src/diffpy/pdfgui/control/fitting.py | 12 ++-- src/diffpy/pdfgui/control/organizer.py | 4 +- src/diffpy/pdfgui/control/parameter.py | 2 +- src/diffpy/pdfgui/control/pdfdataset.py | 4 +- src/diffpy/pdfgui/control/plotter.py | 4 +- src/diffpy/pdfgui/gui/DesignNotes.txt | 4 +- src/diffpy/pdfgui/gui/aboutdialog.py | 2 +- src/diffpy/pdfgui/gui/calculationpanel.py | 2 +- src/diffpy/pdfgui/gui/errorwrapper.py | 2 +- src/diffpy/pdfgui/gui/fittree.py | 6 +- src/diffpy/pdfgui/gui/gui_organization.txt | 4 +- src/diffpy/pdfgui/gui/mainframe.py | 22 +++---- src/diffpy/pdfgui/gui/phaseconfigurepanel.py | 4 +- src/diffpy/pdfgui/gui/phasepanelutils.py | 2 +- src/diffpy/pdfgui/gui/plotpanel.py | 2 +- src/diffpy/pdfgui/gui/sgconstraindialog.py | 2 +- src/diffpy/pdfgui/gui/sgstructuredialog.py | 2 +- .../pdfgui/gui/temperatureseriespanel.py | 2 +- .../gui/wxextensions/autowidthlabelsgrid.py | 2 +- .../pdfgui/gui/wxextensions/listctrls.py | 2 +- 38 files changed, 263 insertions(+), 120 deletions(-) create mode 100644 .codespell/ignore_lines.txt create mode 100644 .codespell/ignore_words.txt delete mode 100644 .coveragerc create mode 100644 news/codecov.rst diff --git a/.codecov.yml b/.codecov.yml index 04dd6510..5a94096e 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,34 +1,14 @@ -# codecov can find this file anywhere in the repo, so we don't need to clutter -# the root folder. -#comment: false - -codecov: - notify: - require_ci_to_pass: no - coverage: status: - patch: + project: # more options at https://docs.codecov.com/docs/commit-status default: - target: '70' - if_no_uploads: error - if_not_found: success - if_ci_failed: failure - project: - default: false - library: - target: auto - if_no_uploads: error - if_not_found: success - if_ci_failed: error - paths: '!*/tests/.*' - - tests: - target: 97.9% - paths: '*/tests/.*' - if_not_found: success - -flags: - tests: - paths: - - tests/ + target: auto # use the coverage from the base commit, fail if coverage is lower + threshold: 0% # allow the coverage to drop by + +comment: + layout: " diff, flags, files" + behavior: default + require_changes: false + require_base: false # [true :: must have a base report to post] + require_head: false # [true :: must have a head report to post] + hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage] diff --git a/.codespell/ignore_lines.txt b/.codespell/ignore_lines.txt new file mode 100644 index 00000000..07fa7c8c --- /dev/null +++ b/.codespell/ignore_lines.txt @@ -0,0 +1,2 @@ +;; Please include filenames and explanations for each ignored line. +;; See https://docs.openverse.org/meta/codespell.html for docs. diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt new file mode 100644 index 00000000..bf5b7379 --- /dev/null +++ b/.codespell/ignore_words.txt @@ -0,0 +1,20 @@ +;; Please include explanations for each ignored word (lowercase). +;; See https://docs.openverse.org/meta/codespell.html for docs. + +;; abbreviation for "materials" often used in a journal title +mater + +;; alternative use of socioeconomic +socio-economic + +;; Frobenius norm used in np.linalg.norm +fro + +;; abbreviation for "structure" +struc + +;; method name within JournalPanel class +onText + +;; a method name within JournalPanel class +delt diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 77556cdf..00000000 --- a/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -source = - diffpy.pdfgui -[report] -omit = - */python?.?/* - */site-packages/nose/* - # ignore _version.py and versioneer.py - .*version.* - *_version.py - -exclude_lines = - if __name__ == '__main__': diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index a87a44a8..11df804d 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -6,17 +6,41 @@ labels: "release" assignees: "" --- -### Release checklist for GitHub contributors +### PyPI/GitHub rc-release preparation checklist: - [ ] All PRs/issues attached to the release are merged. - [ ] All the badges on the README are passing. - [ ] License information is verified as correct. If you are unsure, please comment below. - [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are - missing), tutorials, and other human written text is up-to-date with any changes in the code. -- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated and - tested -- [ ] Successfully run any tutorial examples or do functional testing in some other way. -- [ ] Grammar and writing quality have been checked (no typos). - -Please mention @sbillinge when you are ready for release. Include any additional comments necessary, such as -version information and details about the pre-release. + missing), tutorials, and other human-written text is up-to-date with any changes in the code. +- [ ] Installation instructions in the README, documentation, and the website (e.g., diffpy.org) are updated. +- [ ] Successfully run any tutorial examples or do functional testing with the latest Python version. +- [ ] Grammar and writing quality are checked (no typos). +- [ ] Install `pip install build twine`, run `python -m build` and `twine check dist/*` to ensure that the package can be built and is correctly formatted for PyPI release. + +Please mention @sbillinge here when you are ready for PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here: + +### PyPI/GitHub full-release preparation checklist: + +- [ ] Create a new conda environment and install the rc from PyPI (`pip install ==??`) +- [ ] License information on PyPI is correct. +- [ ] Docs are deployed successfully to `https://www.diffpy.org/`. +- [ ] Successfully run all tests, tutorial examples or do functional testing. + +Please let @sbillinge know that all checks are done and the package is ready for full release. + +### conda-forge release preparation checklist: + + + +- [ ] Ensure that the full release has appeared on PyPI successfully. +- [ ] New package dependencies listed in `conda.txt` and `test.txt` are added to `meta.yaml` in the feedstock. +- [ ] Close any open issues on the feedstock. Reach out to @bobleesj if you have questions. +- [ ] Tag @sbillinge and @bobleesj for conda-forge release. + +### Post-release checklist + + + +- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. +- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 86fd9ddb..41507c5b 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -1,4 +1,4 @@ -name: Release (GitHub/PyPI) +name: Release (GitHub/PyPI) and Deploy Docs on: workflow_dispatch: diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index 3982a783..03bb7d1d 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -6,7 +6,7 @@ on: - main jobs: - build: + check-news-item: uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0 with: project: diffpy.pdfgui diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml index 23dd9d8f..3034fdf7 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -12,10 +12,61 @@ on: jobs: coverage: - uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 - with: - project: diffpy.pdfgui - c_extension: false - headless: true - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + defaults: + run: + shell: bash -l {0} + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + python-version: ["3.11", "3.12"] + env: + LATEST_PYTHON_VERSION: "3.12" + steps: + - name: Check out diffpy.pdfgui + uses: actions/checkout@v4 + + - name: Initialize miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: test + auto-update-conda: true + environment-file: environment.yml + auto-activate-base: false + python-version: ${{ matrix.python-version }} + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install diffpy.pdfgui and requirements + run: | + conda install --file requirements/test.txt + conda install wxpython diffpy.utils matplotlib-base + pip install diffpy.pdffit2==1.4.4rc6 + python -m pip install . --no-deps + + - name: Start Xvfb for ubuntu-latest only + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get install -y xvfb + export DISPLAY=:99 + Xvfb :99 -screen 0 1024x768x16 & + + - name: Validate diffpy.pdfgui + run: | + if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + export DISPLAY=:99 + fi + pytest --cov + coverage report -m + codecov + + - name: Upload coverage to Codecov + if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index 51215241..e56e7010 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -1,9 +1,8 @@ -name: Build and Deploy Docs +name: Deploy Documentation on Release on: release: - types: - - published + types: [published] workflow_dispatch: jobs: @@ -12,3 +11,5 @@ jobs: with: project: diffpy.pdfgui c_extension: false + headless: true + python_version: 3.12 diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index a5fb414f..218ec327 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -9,8 +9,52 @@ on: jobs: validate: - uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0 - with: - project: diffpy.pdfgui - c_extension: false - headless: true + defaults: + run: + shell: bash -l {0} + + runs-on: ubuntu-latest + steps: + - name: Check out diffpy.pdfgui + uses: actions/checkout@v4 + + - name: Initialize miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: test + auto-update-conda: true + environment-file: environment.yml + auto-activate-base: false + python-version: 3.12 + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install diffpy.pdfgui and requirements + run: | + conda install --file requirements/test.txt + conda install wxpython diffpy.utils matplotlib-base + pip install diffpy.pdffit2==1.4.4rc6 + python -m pip install . --no-deps + + - name: Start Xvfb + run: | + sudo apt-get install -y xvfb + export DISPLAY=:99 + Xvfb :99 -screen 0 1024x768x16 & + + - name: Validate diffpy.pdfgui + run: | + export DISPLAY=:99 + pytest --cov + coverage report -m + codecov + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + verbose: true + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3070e199..9cf0556f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,3 +44,9 @@ repos: name: Prevent Commit to Main Branch args: ["--branch", "main"] stages: [pre-commit] + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + additional_dependencies: + - tomli diff --git a/README.rst b/README.rst index 694fa749..8ad9c35d 100644 --- a/README.rst +++ b/README.rst @@ -132,7 +132,7 @@ trying to commit again. Improvements and fixes are always appreciated. -Before contribuing, please read our `Code of Conduct `_. +Before contributing, please read our `Code of Conduct `_. Contact ------- diff --git a/doc/manual/html/readme.txt b/doc/manual/html/readme.txt index e1100ec8..cf60cf43 100644 --- a/doc/manual/html/readme.txt +++ b/doc/manual/html/readme.txt @@ -1,2 +1,2 @@ -This directory need to be relativly the same as doc/build/html/manual from +This directory need to be relatively the same as doc/build/html/manual from doc/source/_static/images diff --git a/doc/manual/pdfgui.texinfo b/doc/manual/pdfgui.texinfo index 587a214e..8c79bbe7 100644 --- a/doc/manual/pdfgui.texinfo +++ b/doc/manual/pdfgui.texinfo @@ -243,7 +243,7 @@ requirements. This can be done either for all atoms in the structure or for an arbitrary subset - for example when it is known that only a certain species show a local distortion. The code for space group definitions was provided by the Python Macromolecular Library (mmLib, -@url{http://pymmlib.sourceforge.net}). This was extened to include +@url{http://pymmlib.sourceforge.net}). This was extended to include non-standard space groups using the Computational Crystallography Toolbox (cctbx, @uref{https://cctbx.github.io}). PDFgui also supports supercell expansion of a normal unit cell. diff --git a/news/codecov.rst b/news/codecov.rst new file mode 100644 index 00000000..2329edfc --- /dev/null +++ b/news/codecov.rst @@ -0,0 +1,24 @@ +**Added:** + +* Codecov coverage report in PRs +* Spelling check with Codespell in pre-commit + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/pyproject.toml b/pyproject.toml index 2f5dc4e6..796a10af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ description = "GUI for PDF simulation and structure refinement." keywords = ['PDF structure refinement GUI'] readme = "README.rst" -requires-python = ">=3.10" +requires-python = ">=3.11, <3.13" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -25,7 +25,6 @@ classifiers = [ 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Operating System :: Unix', - 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Topic :: Scientific/Engineering :: Physics', @@ -54,6 +53,11 @@ namespaces = false # to disable scanning PEP 420 namespaces (true by default) [tool.setuptools.dynamic] dependencies = {file = ["requirements/pip.txt"]} +[tool.codespell] +exclude-file = ".codespell/ignore_lines.txt" +ignore-words = ".codespell/ignore_words.txt" +skip = "*.cif,*.dat,*.html,*.m,*.textinfo" + [tool.black] line-length = 115 include = '\.pyi?$' diff --git a/src/diffpy/pdfgui/control/calculation.py b/src/diffpy/pdfgui/control/calculation.py index ec6928f9..27f98dc2 100644 --- a/src/diffpy/pdfgui/control/calculation.py +++ b/src/diffpy/pdfgui/control/calculation.py @@ -252,7 +252,7 @@ def load(self, z, subpath): z -- zipped project file subpath -- path to its own storage within project file - returns a tree of internal hierachy + returns a tree of internal hierarchy """ config = pickle.loads(z.read(subpath + "config"), encoding="latin1") self.rmin = config["rmin"] diff --git a/src/diffpy/pdfgui/control/fitstructure.py b/src/diffpy/pdfgui/control/fitstructure.py index 515fdec5..6d12c840 100644 --- a/src/diffpy/pdfgui/control/fitstructure.py +++ b/src/diffpy/pdfgui/control/fitstructure.py @@ -35,7 +35,7 @@ class FitStructure(PDFStructure): Class data members: symposeps -- tolerance for recognizing site as symmetry position - Data members (in adition to those in PDFStructure): + Data members (in addition to those in PDFStructure): owner -- instance of parent Fitting (set in Organizer.add()) initial -- initial structure, same as self refined -- refined structure when available or None diff --git a/src/diffpy/pdfgui/control/fitting.py b/src/diffpy/pdfgui/control/fitting.py index 0c534c8f..e89e0fcb 100644 --- a/src/diffpy/pdfgui/control/fitting.py +++ b/src/diffpy/pdfgui/control/fitting.py @@ -73,7 +73,7 @@ class Fitting(Organizer): Fitting will start a new thread to interact with the PdfFit server. rw: fitness parameter - tolerancy: accurancy requirement + tolerancy: accuracy requirement step: current refinement step res: fitting result string parameters: parameter dictionary @@ -200,7 +200,7 @@ def load(self, z, subpath): z -- zipped project file subpath -- path to its own storage within project file - returns a tree of internal hierachy + returns a tree of internal hierarchy """ # subpath = projName/fitName/ subs = subpath.split("/") @@ -349,7 +349,7 @@ def configure(self): for key, var in struc.constraints.items(): self.server.constrain(key, var.formula) - # phase paramters configured + # phase parameters configured for dataset in self.datasets: dataset.clearRefined() @@ -493,7 +493,7 @@ def outputBondLengthAtoms(self, struc, i, j): return def outputBondLengthTypes(self, struc, a1, a2, lb, ub): - """Output all a1-a2 bond lenghts within specified range. + """Output all a1-a2 bond lengths within specified range. struc -- instance of PDFStructure a1 -- symbol of the first element in pair or "ALL" @@ -589,7 +589,7 @@ def buildNameDict(self): """build up a data name dictionary, which will map data name to a unique index - The private dataNameDict has such strcture: + The private dataNameDict has such structure: { 'd_data1':{'Gobs':12, 'Gcalc':11, ....}, 'd_data2':{'Gobs':10, 'Gcalc':9, ....}, ... @@ -660,7 +660,7 @@ def appendStep(self, source): snapshot[nameDict["crw"]] = dataset.crw seq += 1 - # udpate strucs + # update strucs seq = 1 for struc in self.strucs: id = struc._getStrId() diff --git a/src/diffpy/pdfgui/control/organizer.py b/src/diffpy/pdfgui/control/organizer.py index d44dfb41..51898fb7 100644 --- a/src/diffpy/pdfgui/control/organizer.py +++ b/src/diffpy/pdfgui/control/organizer.py @@ -157,7 +157,7 @@ def load(self, z, subpath): z -- zipped project file subpath -- path to its own storage within project file - returns a tree of internal hierachy + returns a tree of internal hierarchy """ # subpath = projName/myName/ from urllib.parse import unquote_plus @@ -223,7 +223,7 @@ def copy(self, other=None): def organization(self): """get internal organization - returns a tree of internal hierachy + returns a tree of internal hierarchy """ org = [None] * 4 org[0] = self diff --git a/src/diffpy/pdfgui/control/parameter.py b/src/diffpy/pdfgui/control/parameter.py index 06e89b02..a162b96c 100644 --- a/src/diffpy/pdfgui/control/parameter.py +++ b/src/diffpy/pdfgui/control/parameter.py @@ -137,7 +137,7 @@ def __getLinkedValue(self): srcfit = self.__findLinkedFitting() if srcfit is None: raise ControlKeyError("Fitting '%s' does not exist" % fitname) - # Check to see if srcfit has paramter srcidx + # Check to see if srcfit has parameter srcidx try: srcpar = srcfit.parameters[srcidx] except KeyError: diff --git a/src/diffpy/pdfgui/control/pdfdataset.py b/src/diffpy/pdfgui/control/pdfdataset.py index 6caa978a..d7d76725 100644 --- a/src/diffpy/pdfgui/control/pdfdataset.py +++ b/src/diffpy/pdfgui/control/pdfdataset.py @@ -229,7 +229,7 @@ def readStr(self, datastring): if res: self.metadata["doping"] = float(res.groups()[0]) - # parsing gerneral metadata + # parsing general metadata if metadata: regexp = r"\b(\w+)\ *=\ *(%(f)s)\b" % rx while True: @@ -374,7 +374,7 @@ def copy(self, other=None): class PDFDataFormatError(Exception): - """Exception class marking failure to proccess PDF data string.""" + """Exception class marking failure to process PDF data string.""" pass diff --git a/src/diffpy/pdfgui/control/plotter.py b/src/diffpy/pdfgui/control/plotter.py index 39359cbd..6fa5594c 100644 --- a/src/diffpy/pdfgui/control/plotter.py +++ b/src/diffpy/pdfgui/control/plotter.py @@ -90,7 +90,7 @@ def _buildStyle(plotter, name, group, yNames): name -- what is to be plotted (y name) group -- which group the curve is in (group = -1 means it is the only group) yNames -- all y to be plotted - return: style dictionay + return: style dictionary """ if name in ("Gcalc", "Gdiff", "crw"): style = plotter.buildLineStyle() @@ -639,7 +639,7 @@ def export(self, filename): def _exportCompactData(fp, xylist, xynames=None): """Write the xylist data in a text format to the file object fp. - The curves with the same x are groupped in the same datasets. + The curves with the same x are grouped in the same datasets. The datasets are marked with "#S 1", "#S 2", etc. labels according to the spec format http://www.certif.com/cplot_manual/ch0c_C_11_3.html diff --git a/src/diffpy/pdfgui/gui/DesignNotes.txt b/src/diffpy/pdfgui/gui/DesignNotes.txt index 13862e76..1f24a270 100644 --- a/src/diffpy/pdfgui/gui/DesignNotes.txt +++ b/src/diffpy/pdfgui/gui/DesignNotes.txt @@ -3,7 +3,7 @@ Copying and Pasting: The project is going to allow copying and pasting on all levels of the fit tree. By default, when changing the metadata or constraints of a copied -data set or structure, the change will be local. The same is true of chaning a +data set or structure, the change will be local. The same is true of changing a structure. If, however, many identical copies are selected simultaneously, changes will take place to all of them. If many items are highlighted, but are not identical, the display only shows information for the first item. If the @@ -26,6 +26,6 @@ the tree. Future Options: * Highlight many items, copy from one to all others from right click. * Remember history of constraints. -* Hava a "Link to results" copy option in the right click menu. +* Have a "Link to results" copy option in the right click menu. * Be able to describe a parameter. Hovering over the parameter in the windows where it appears will show user's description as a tool tip diff --git a/src/diffpy/pdfgui/gui/aboutdialog.py b/src/diffpy/pdfgui/gui/aboutdialog.py index f0700cbb..a15c0d7f 100644 --- a/src/diffpy/pdfgui/gui/aboutdialog.py +++ b/src/diffpy/pdfgui/gui/aboutdialog.py @@ -120,7 +120,7 @@ def __init__(self, *args, **kwds): # setup acknowledgement and copyright text labels self.label_acknowledgement.SetLabel(_acknowledgement) self.label_copyright.SetLabel(_copyright) - # display version and svn revison numbers + # display version and svn revision numbers verwords = __version__.split(".post", 1) version = verwords[0] revision = "0" if len(verwords) == 1 else verwords[1] diff --git a/src/diffpy/pdfgui/gui/calculationpanel.py b/src/diffpy/pdfgui/gui/calculationpanel.py index 4c8b0041..70b3ae1a 100644 --- a/src/diffpy/pdfgui/gui/calculationpanel.py +++ b/src/diffpy/pdfgui/gui/calculationpanel.py @@ -156,7 +156,7 @@ def __init__(self, *args, **kwds): # USER CONFIGURATION CODE ################################################# def __customProperties(self): - """Set up the custom properites.""" + """Set up the custom properties.""" self._focusedText = None self.calculation = None self.stypeMap = {0: "N", 1: "X"} diff --git a/src/diffpy/pdfgui/gui/errorwrapper.py b/src/diffpy/pdfgui/gui/errorwrapper.py index de99d93b..1757bcdb 100644 --- a/src/diffpy/pdfgui/gui/errorwrapper.py +++ b/src/diffpy/pdfgui/gui/errorwrapper.py @@ -110,7 +110,7 @@ def catchObjectErrors(obj, exclude=None): instance, which contains information about how and when to display errors. exclude -- An iterable of additional function names to exclude. These are - excluded in addtion to names in _EXCLUDED_METHODS defined above. + excluded in addition to names in _EXCLUDED_METHODS defined above. All functions starting with '_' are excluded. """ diff --git a/src/diffpy/pdfgui/gui/fittree.py b/src/diffpy/pdfgui/gui/fittree.py index afd0fcc8..03abeb01 100644 --- a/src/diffpy/pdfgui/gui/fittree.py +++ b/src/diffpy/pdfgui/gui/fittree.py @@ -44,7 +44,7 @@ class FitTree(wx12.TreeCtrl): _ fit (*) | |____ phase (5) - |____ datset (*) + |____ dataset (*) |____ calculation (*) Fits are at the top level. Under fits there are phases, datasets, and @@ -760,7 +760,7 @@ def __copyLabel(self, oldlabel, entrypoint): return label def __InsertBranch(self, cdata, entrypoint, label, insertafter=None, prepend=False): - """Instert control data into the tree. + """Insert control data into the tree. cdata -- The control data that goes with the branch entrypoint -- The subbranch (fit root) to paste into @@ -859,7 +859,7 @@ def ExtendProjectTree(self, treelist, clear=True, paste=False): Note that node[1] should be empty if the node is a calculation. - Returns the last insterted fit or calculation node + Returns the last inserted fit or calculation node """ # Clean slate if clear: diff --git a/src/diffpy/pdfgui/gui/gui_organization.txt b/src/diffpy/pdfgui/gui/gui_organization.txt index e79140e6..8bc18cdb 100644 --- a/src/diffpy/pdfgui/gui/gui_organization.txt +++ b/src/diffpy/pdfgui/gui/gui_organization.txt @@ -12,7 +12,7 @@ pdfpanel.py). PDFPanel is a 'mix-in' class that contains variables and methods needed by dynamic panels. The most important of these is the refresh() method. The dynamic panel's refresh() method is called by MainPanel whenever a given dynamic panel is made visible (it becomes the rightPanel). refresh() must be -redefined in a sublass of PDFPanel otherwise a NotImplementedError will be +redefined in a subclass of PDFPanel otherwise a NotImplementedError will be thrown whenever refresh() is called. MainPanel only calls refresh() for the rightPanel, not any of its children. It is up to a dynamic panel to take care of its children. @@ -48,7 +48,7 @@ selected phase in the FitTree. The information must be shared with the children by rightPanel (perhaps as part of the refresh() method.) Objects given to the rightPanel in these cases is as follows. -_configuration - The configuation data for the panel. This is either a +_configuration - The configuration data for the panel. This is either a dictionary or other object that tells how to set up the configuration window. _constraints - The constraints data for the panel. diff --git a/src/diffpy/pdfgui/gui/mainframe.py b/src/diffpy/pdfgui/gui/mainframe.py index 1e96261a..efd2de05 100644 --- a/src/diffpy/pdfgui/gui/mainframe.py +++ b/src/diffpy/pdfgui/gui/mainframe.py @@ -227,7 +227,7 @@ def __cmdLineLoad(self): def __defineLocalIds(self): """Several user functions are duplicated many times throughout the gui. - This occurrs mostly between the main menu, the right-click menu, and the + This occurs mostly between the main menu, the right-click menu, and the many buttons in the gui. This method defines local Ids that can be used for all of these. """ @@ -1217,7 +1217,7 @@ def onTreeSelChanging(self, event): # wxGlade: MainPanel. "dseries" mode: * can only select fit items """ - # THIS DOESNT WORK ON WINDOWS! + # THIS DOESN'T WORK ON WINDOWS! node = event.GetItem() if not node: return @@ -1918,7 +1918,7 @@ def onRun(self, event): This also runs calculations that are children of a running fit. """ - # Make sure that the tree is focued. This will trigger the KILL_FOCUS + # Make sure that the tree is focused. This will trigger the KILL_FOCUS # events of the other panels. self.treeCtrlMain.SetFocus() @@ -2164,7 +2164,7 @@ def onRequest(self, event): return def onCommunity(self, event): - """Open the brower and go to the diffpy-users Google Group.""" + """Open the browser and go to the diffpy-users Google Group.""" import webbrowser try: @@ -2223,7 +2223,7 @@ def onOpen(self, event): def onSave(self, event): """Save the project to a predetermined location.""" - # Make sure that the tree is focued. This will trigger the KILL_FOCUS + # Make sure that the tree is focused. This will trigger the KILL_FOCUS # events of the other panels. self.treeCtrlMain.SetFocus() @@ -2239,7 +2239,7 @@ def onSave(self, event): def onSaveAs(self, event): """Open a save dialog so the current project can be saved.""" - # Make sure that the tree is focued. This will trigger the KILL_FOCUS + # Make sure that the tree is focused. This will trigger the KILL_FOCUS # events of the other panels. self.treeCtrlMain.SetFocus() @@ -2334,7 +2334,7 @@ def onExportRes(self, event): if d.ShowModal() == wx.ID_OK: path = d.GetPath() self.workpath, savename = os.path.split(path) - # Add the right extention if it doesn't already have it. + # Add the right extension if it doesn't already have it. if len(savename) < 3 or savename[-3:] != "res": savename += ".res" path = os.path.join(self.workpath, savename) @@ -2397,7 +2397,7 @@ def onExportNewStruct(self, event): i = d.GetFilterIndex() path = d.GetPath() self.workpath, savename = os.path.split(path) - # Add the right extention if the file needs it. + # Add the right extension if the file needs it. if len(savename) < 3 or (extlist[i] and savename[-3:] != extlist[i][-3:]): savename += ".%s" % extlist[i] path = os.path.join(self.workpath, savename) @@ -2443,7 +2443,7 @@ def onExportStruct(self, event): i = d.GetFilterIndex() path = d.GetPath() self.workpath, savename = os.path.split(path) - # Add the right extention if the file needs it. + # Add the right extension if the file needs it. if len(savename) < 3 or (extlist[i] and savename[-3:] != extlist[i][-3:]): savename += ".%s" % extlist[i] path = os.path.join(self.workpath, savename) @@ -2479,7 +2479,7 @@ def onExportPDF(self, event): if d.ShowModal() == wx.ID_OK: path = d.GetPath() self.workpath, savename = os.path.split(path) - # Add the right extention if it doesn't already have it. + # Add the right extension if it doesn't already have it. if len(savename) < 3 or savename[-3:] != "fgr": savename += ".fgr" path = os.path.join(self.workpath, savename) @@ -2511,7 +2511,7 @@ def onSaveCalc(self, event): if d.ShowModal() == wx.ID_OK: path = d.GetPath() self.workpath, savename = os.path.split(path) - # Add the right extention if it doesn't already have it. + # Add the right extension if it doesn't already have it. if len(savename) < 3 or savename[-3:] != "cgr": savename += ".cgr" path = os.path.join(self.workpath, savename) diff --git a/src/diffpy/pdfgui/gui/phaseconfigurepanel.py b/src/diffpy/pdfgui/gui/phaseconfigurepanel.py index d5d44ed4..1050ef42 100644 --- a/src/diffpy/pdfgui/gui/phaseconfigurepanel.py +++ b/src/diffpy/pdfgui/gui/phaseconfigurepanel.py @@ -39,8 +39,8 @@ class PhaseConfigurePanel(wx.Panel, PDFPanel): structure -- reference to PDFStructure _focusedText -- value of a cell or textctrl before it changes lConstraintsMap -- map of TextCtrl name to parameter name - _row -- row, where rightclick occured - _col -- column, where rightclick occured + _row -- row, where rightclick occurred + _col -- column, where rightclick occurred """ def __init__(self, *args, **kwds): diff --git a/src/diffpy/pdfgui/gui/phasepanelutils.py b/src/diffpy/pdfgui/gui/phasepanelutils.py index 8459294e..50f348b2 100644 --- a/src/diffpy/pdfgui/gui/phasepanelutils.py +++ b/src/diffpy/pdfgui/gui/phasepanelutils.py @@ -161,7 +161,7 @@ def showSelectAtomsDialog(panel): No return value. """ - # do nothing for non-existant or empty structure + # do nothing for non-existent or empty structure if not panel.structure: return msg = "\n".join( diff --git a/src/diffpy/pdfgui/gui/plotpanel.py b/src/diffpy/pdfgui/gui/plotpanel.py index 8aaaec39..f6a6d918 100644 --- a/src/diffpy/pdfgui/gui/plotpanel.py +++ b/src/diffpy/pdfgui/gui/plotpanel.py @@ -140,7 +140,7 @@ def updateWidgets(self): xdata.append("step") break - # index is added if mutiple selections are chosen from different fits + # index is added if multiple selections are chosen from different fits if len(fits) > 1: xdata.append("index") diff --git a/src/diffpy/pdfgui/gui/sgconstraindialog.py b/src/diffpy/pdfgui/gui/sgconstraindialog.py index 5c8ecbc3..d676dc4f 100644 --- a/src/diffpy/pdfgui/gui/sgconstraindialog.py +++ b/src/diffpy/pdfgui/gui/sgconstraindialog.py @@ -233,7 +233,7 @@ def onSGSelect(self, event): # wxGlade: SGConstrainDialog. return def onOk(self, event): # wxGlade: SGConstrainDialog. - # check to see if the space group is consistant + # check to see if the space group is consistent if not self.structure.isSpaceGroupPossible(self.spacegroup): message = "The chosen space group is not consistent\n" message += "with the lattice parameters.\n" diff --git a/src/diffpy/pdfgui/gui/sgstructuredialog.py b/src/diffpy/pdfgui/gui/sgstructuredialog.py index 7819579a..1e2daffa 100644 --- a/src/diffpy/pdfgui/gui/sgstructuredialog.py +++ b/src/diffpy/pdfgui/gui/sgstructuredialog.py @@ -227,7 +227,7 @@ def onOZTextEnter(self, event): # wxGlade: SGStructureDialog. return def onOk(self, event): # wxGlade: SGStructureDialog. - # check to see if the space group is consistant + # check to see if the space group is consistent if not self.structure.isSpaceGroupPossible(self.spacegroup): message = "The chosen space group is not consistent\n" message += "with the lattice parameters.\n" diff --git a/src/diffpy/pdfgui/gui/temperatureseriespanel.py b/src/diffpy/pdfgui/gui/temperatureseriespanel.py index 66956fc2..14d9ce31 100644 --- a/src/diffpy/pdfgui/gui/temperatureseriespanel.py +++ b/src/diffpy/pdfgui/gui/temperatureseriespanel.py @@ -225,7 +225,7 @@ def onAdd(self, event): # wxGlade: TemperatureSeriesPanel. rx = {"f": r"(?:\d+(?:\.\d*)?|\d*\.\d+)"} # Search for T123, t123, Temp123, temp123, 123k, 123K. # Some filenames fool this, e.g. "test1.dat" will match '1' since it - # is preceeded by a 't'. + # is preceded by a 't'. # Is there a better regexp? Probably... regexp = ( r"""(?:[Tt](?:emp(?:erature)?)?(%(f)s))| diff --git a/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py b/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py index 77d3f891..154f1fae 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py +++ b/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py @@ -23,7 +23,7 @@ class AutoWidthLabelsGrid(wx.grid.Grid): - """wx grid which allows lables auto sizing""" + """wx grid which allows labels auto sizing""" # def __init__(self, parent, state, size): # wx.grid.Grid.__init__(self, parent, state, size) diff --git a/src/diffpy/pdfgui/gui/wxextensions/listctrls.py b/src/diffpy/pdfgui/gui/wxextensions/listctrls.py index c6cfc588..0d7ef8a3 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/listctrls.py +++ b/src/diffpy/pdfgui/gui/wxextensions/listctrls.py @@ -68,7 +68,7 @@ class ColumnSortListCtrl(AutoWidthListCtrl, listmix.ColumnSorterMixin): is pressed. This ListCtrl requires an itemDataMap member dictionary to be initialized - before the sorting capabilites can be realized. This dictionary simply references + before the sorting capabilities can be realized. This dictionary simply references the ListCtrl's entries by a unique number. This number must be stored as the ItemData (with SetItemData) of the entry. The member data must be in the form of a tuple, where the tuple has a number of entries as the ListCtrl has From 0e230e0e04d0dec32c0e09e67f99be50c75e973b Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:52:13 -0500 Subject: [PATCH 06/20] replace danse links (without documentations) (#239) * replace danse links (without documentations) * add news --- AUTHORS.rst | 7 ++++--- news/danselink.rst | 23 +++++++++++++++++++++++ src/diffpy/pdfgui/gui/aboutdialog.py | 2 +- tests/test_aboutdialog.py | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 news/danselink.rst diff --git a/AUTHORS.rst b/AUTHORS.rst index 739f2f4b..8d20fa4f 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -4,9 +4,10 @@ Authors DiffPy was initiated as part of the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) project, funded by the National Science Foundation under grant DMR-0520547. More information on DANSE can be -found at http://danse.us. Any opinions, findings, and conclusions or -recommendations expressed in this material are those of the author(s) -and do not necessarily reflect the views of the NSF. +found at `DANSE Project Legacy Page `_. +Any opinions, findings, and conclusions or recommendations expressed +in this material are those of the author(s) and do not necessarily reflect +the views of the NSF. Main Contributors ----------------- diff --git a/news/danselink.rst b/news/danselink.rst new file mode 100644 index 00000000..1657f426 --- /dev/null +++ b/news/danselink.rst @@ -0,0 +1,23 @@ +**Added:** + +* no news: small changes to links + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/diffpy/pdfgui/gui/aboutdialog.py b/src/diffpy/pdfgui/gui/aboutdialog.py index a15c0d7f..589e6569 100644 --- a/src/diffpy/pdfgui/gui/aboutdialog.py +++ b/src/diffpy/pdfgui/gui/aboutdialog.py @@ -221,7 +221,7 @@ def onNsfLogo(self, event): # wxGlade: DialogAbout. event.Skip() def onDanseLogo(self, event): # wxGlade: DialogAbout. - launchBrowser("http://danse.us") + launchBrowser("https://www.its.caltech.edu/~matsci/btf/DANSE_web_page.html") event.Skip() def onMsuLogo(self, event): # wxGlade: DialogAbout. diff --git a/tests/test_aboutdialog.py b/tests/test_aboutdialog.py index 532bd2e8..547821a3 100644 --- a/tests/test_aboutdialog.py +++ b/tests/test_aboutdialog.py @@ -53,7 +53,7 @@ def test_LogoClicks(self): self._clickbutton(d.bitmap_button_nsf) self.assertTrue(self.url.endswith("www.nsf.gov")) self._clickbutton(d.bitmap_button_danse) - self.assertTrue(self.url.endswith("danse.us")) + self.assertTrue(self.url.endswith("www.its.caltech.edu/~matsci/btf/DANSE_web_page.html")) self._clickbutton(d.bitmap_button_msu) self.assertTrue(self.url.endswith("www.msu.edu")) self._clickbutton(d.bitmap_button_columbia) From 5e5cc7f348d9f17ddbce3a020ef5f6a379868acb Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Sat, 4 Jan 2025 06:17:13 -0500 Subject: [PATCH 07/20] fix failing CI tests (#240) * fix failing CI tests * install gsl * add news --- .github/workflows/tests-on-pr.yml | 4 ++-- news/ci.rst | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 news/ci.rst diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 218ec327..09e0c18e 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -35,8 +35,8 @@ jobs: - name: Install diffpy.pdfgui and requirements run: | conda install --file requirements/test.txt - conda install wxpython diffpy.utils matplotlib-base - pip install diffpy.pdffit2==1.4.4rc6 + conda install wxpython diffpy.utils matplotlib-base gsl + pip install diffpy.pdffit2==1.4.4rc4 python -m pip install . --no-deps - name: Start Xvfb diff --git a/news/ci.rst b/news/ci.rst new file mode 100644 index 00000000..622844e0 --- /dev/null +++ b/news/ci.rst @@ -0,0 +1,23 @@ +**Added:** + +* no news: modification on CI workflow + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 8f7183415fbbfab0b9907773f849d4b116895f0c Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Tue, 14 Jan 2025 08:21:20 -0500 Subject: [PATCH 08/20] feat: add support for py3.13 (#244) * feat: add support for py3.13 * tab align --- .../matrix-and-codecov-on-merge-to-main.yml | 6 ++--- .github/workflows/tests-on-pr.yml | 6 ++--- news/3.13.rst | 23 +++++++++++++++++++ pyproject.toml | 3 ++- 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 news/3.13.rst diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml index 3034fdf7..316ae780 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -21,9 +21,9 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-13, macos-14] - python-version: ["3.11", "3.12"] + python-version: ["3.11", "3.12", "3.13"] env: - LATEST_PYTHON_VERSION: "3.12" + LATEST_PYTHON_VERSION: "3.13" steps: - name: Check out diffpy.pdfgui uses: actions/checkout@v4 @@ -46,7 +46,7 @@ jobs: run: | conda install --file requirements/test.txt conda install wxpython diffpy.utils matplotlib-base - pip install diffpy.pdffit2==1.4.4rc6 + pip install diffpy.pdffit2==1.5.0rc1 python -m pip install . --no-deps - name: Start Xvfb for ubuntu-latest only diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 09e0c18e..69180175 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -25,7 +25,7 @@ jobs: auto-update-conda: true environment-file: environment.yml auto-activate-base: false - python-version: 3.12 + python-version: 3.13 - name: Conda config run: >- @@ -35,8 +35,8 @@ jobs: - name: Install diffpy.pdfgui and requirements run: | conda install --file requirements/test.txt - conda install wxpython diffpy.utils matplotlib-base gsl - pip install diffpy.pdffit2==1.4.4rc4 + conda install wxpython diffpy.utils matplotlib-base + pip install diffpy.pdffit2==1.5.0rc1 python -m pip install . --no-deps - name: Start Xvfb diff --git a/news/3.13.rst b/news/3.13.rst new file mode 100644 index 00000000..482e7164 --- /dev/null +++ b/news/3.13.rst @@ -0,0 +1,23 @@ +**Added:** + +* Added support for python 3.13 + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/pyproject.toml b/pyproject.toml index 796a10af..852f9dec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ description = "GUI for PDF simulation and structure refinement." keywords = ['PDF structure refinement GUI'] readme = "README.rst" -requires-python = ">=3.11, <3.13" +requires-python = ">=3.11, <3.14" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -27,6 +27,7 @@ classifiers = [ 'Operating System :: Unix', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Topic :: Scientific/Engineering :: Physics', 'Topic :: Scientific/Engineering :: Chemistry', ] From 0542b8660f1dabbd8c4bcf71a5ee3d53de151f4e Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Tue, 14 Jan 2025 08:22:23 -0500 Subject: [PATCH 09/20] ci: update workflows align with scikit-package (#245) * ci: update workflows align with scikit-package * add news --- .github/ISSUE_TEMPLATE/release_checklist.md | 8 +++---- .../workflows/build-wheel-release-upload.yml | 4 +++- .github/workflows/check-news-item.yml | 2 +- .github/workflows/publish-docs-on-release.yml | 1 - news/updatewf.rst | 23 +++++++++++++++++++ 5 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 news/updatewf.rst diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 11df804d..fa94779e 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -12,11 +12,11 @@ assignees: "" - [ ] All the badges on the README are passing. - [ ] License information is verified as correct. If you are unsure, please comment below. - [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are - missing), tutorials, and other human-written text is up-to-date with any changes in the code. + missing), tutorials, and other human-written text is up-to-date with any changes in the code. - [ ] Installation instructions in the README, documentation, and the website (e.g., diffpy.org) are updated. - [ ] Successfully run any tutorial examples or do functional testing with the latest Python version. - [ ] Grammar and writing quality are checked (no typos). -- [ ] Install `pip install build twine`, run `python -m build` and `twine check dist/*` to ensure that the package can be built and is correctly formatted for PyPI release. +- [ ] Install `pip install build twine`, run `python -m build` and `twine check dist/*` to ensure that the package can be built and is correctly formatted for PyPI release. Please mention @sbillinge here when you are ready for PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here: @@ -42,5 +42,5 @@ Please let @sbillinge know that all checks are done and the package is ready for -- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. -- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. +- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. +- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 41507c5b..1ed2e6b3 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -4,13 +4,15 @@ on: workflow_dispatch: push: tags: - - '*' # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml + - "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml jobs: release: uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: diffpy.pdfgui + c_extension: false + github_admin_username: sbillinge secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} PAT_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index 03bb7d1d..33a188fd 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -3,7 +3,7 @@ name: Check for News on: pull_request_target: branches: - - main + - main jobs: check-news-item: diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index e56e7010..b4593308 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -12,4 +12,3 @@ jobs: project: diffpy.pdfgui c_extension: false headless: true - python_version: 3.12 diff --git a/news/updatewf.rst b/news/updatewf.rst new file mode 100644 index 00000000..622844e0 --- /dev/null +++ b/news/updatewf.rst @@ -0,0 +1,23 @@ +**Added:** + +* no news: modification on CI workflow + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From c7ac08434d96fd988ece7bf2a67aaca6a6cdf6f1 Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Tue, 14 Jan 2025 09:06:08 -0500 Subject: [PATCH 10/20] style: update pre-commit and auto fix (#246) * update pre-commit with autofix * add news * conflicts to be reverted --------- Co-authored-by: Simon Billinge --- .codecov.yml | 8 +- .pre-commit-config.yaml | 38 +- doc/manual/extractEquations.py | 3 + doc/manual/fixHTMLCode.py | 3 +- doc/manual/html/pdfgui.html | 8486 +++++++++++------ .../manual_resources/tui_mno_bond_lengths.py | 9 +- news/updatepcmt.rst | 23 + src/diffpy/__init__.py | 1 - src/diffpy/pdfgui/__init__.py | 1 - src/diffpy/pdfgui/applications/pdfgui.py | 7 +- src/diffpy/pdfgui/control/calculation.py | 34 +- src/diffpy/pdfgui/control/constraint.py | 20 +- src/diffpy/pdfgui/control/controlerrors.py | 26 +- src/diffpy/pdfgui/control/fitdataset.py | 45 +- src/diffpy/pdfgui/control/fitstructure.py | 95 +- src/diffpy/pdfgui/control/fitting.py | 76 +- src/diffpy/pdfgui/control/organizer.py | 32 +- src/diffpy/pdfgui/control/parameter.py | 18 +- src/diffpy/pdfgui/control/pdfcomponent.py | 4 +- src/diffpy/pdfgui/control/pdfdataset.py | 20 +- src/diffpy/pdfgui/control/pdfguicontrol.py | 82 +- src/diffpy/pdfgui/control/pdfguimacros.py | 1 - src/diffpy/pdfgui/control/pdflist.py | 17 +- src/diffpy/pdfgui/control/pdfstructure.py | 16 +- src/diffpy/pdfgui/control/plotter.py | 46 +- src/diffpy/pdfgui/control/structureviewer.py | 23 +- src/diffpy/pdfgui/gui/aboutdialog.py | 8 +- src/diffpy/pdfgui/gui/adddatapanel.py | 5 +- src/diffpy/pdfgui/gui/addphasepanel.py | 11 +- src/diffpy/pdfgui/gui/blankpanel.py | 1 - src/diffpy/pdfgui/gui/bondangledialog.py | 4 +- src/diffpy/pdfgui/gui/bondlengthdialog.py | 4 +- .../pdfgui/gui/datasetconfigurepanel.py | 8 +- .../pdfgui/gui/datasetconstraintpanel.py | 6 +- src/diffpy/pdfgui/gui/debugoptions.py | 16 +- src/diffpy/pdfgui/gui/errorreportdialog.py | 6 +- .../gui/errorreportdialog_control_fix.py | 3 +- src/diffpy/pdfgui/gui/errorwrapper.py | 6 +- src/diffpy/pdfgui/gui/extendedplotframe.py | 37 +- src/diffpy/pdfgui/gui/fitnotebookpanel.py | 3 +- src/diffpy/pdfgui/gui/fittree.py | 52 +- src/diffpy/pdfgui/gui/main.py | 9 +- src/diffpy/pdfgui/gui/mainframe.py | 68 +- src/diffpy/pdfgui/gui/parameterspanel.py | 17 +- src/diffpy/pdfgui/gui/pdfguiglobals.py | 6 +- src/diffpy/pdfgui/gui/pdfpanel.py | 11 +- src/diffpy/pdfgui/gui/phaseconfigurepanel.py | 5 +- .../pdfgui/gui/phaseconstraintspanel.py | 5 +- src/diffpy/pdfgui/gui/phasepanelutils.py | 46 +- src/diffpy/pdfgui/gui/phaseresultspanel.py | 3 +- src/diffpy/pdfgui/gui/plotpanel.py | 5 +- src/diffpy/pdfgui/gui/preferencespanel.py | 5 +- src/diffpy/pdfgui/gui/sgconstraindialog.py | 1 + src/diffpy/pdfgui/gui/sgstructuredialog.py | 1 + src/diffpy/pdfgui/gui/tooltips.py | 4 +- src/diffpy/pdfgui/gui/windowperspective.py | 1 - .../pdfgui/gui/wxextensions/__init__.py | 4 +- .../gui/wxextensions/autowidthlabelsgrid.py | 6 +- .../pdfgui/gui/wxextensions/listctrls.py | 27 +- .../pdfgui/gui/wxextensions/paneldialog.py | 21 +- .../pdfgui/gui/wxextensions/textctrlutils.py | 1 - .../pdfgui/gui/wxextensions/validators.py | 9 +- src/diffpy/pdfgui/gui/wxextensions/wx12.py | 4 +- src/diffpy/pdfgui/tui.py | 1 - src/diffpy/pdfgui/utils.py | 7 +- src/diffpy/pdfgui/version.py | 1 - tests/test_aboutdialog.py | 5 +- tests/test_calculation.py | 6 +- tests/test_constraint.py | 14 +- tests/test_datasetpanels.py | 5 +- tests/test_dopingseriespanel.py | 5 +- tests/test_extendedplotframe.py | 5 +- tests/test_fitdataset.py | 8 +- tests/test_fitstructure.py | 23 +- tests/test_insertrowsdialog.py | 5 +- tests/test_loadproject.py | 16 +- tests/test_mainframe.py | 5 +- tests/test_parameter.py | 5 +- tests/test_parameterspanel.py | 5 +- tests/test_pdfdataset.py | 8 +- tests/test_pdfguicontrol.py | 6 +- tests/test_pdfstructure.py | 13 +- tests/test_phaseconfigurepanel.py | 5 +- tests/test_showphasenotebookpanel.py | 6 +- tests/test_structureviewer.py | 15 +- tests/test_temperatureseriespanel.py | 5 +- tests/test_version.py | 6 +- tests/testutils.py | 6 +- 88 files changed, 6125 insertions(+), 3624 deletions(-) create mode 100644 news/updatepcmt.rst diff --git a/.codecov.yml b/.codecov.yml index 5a94096e..4af5eb24 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,14 +1,14 @@ coverage: status: - project: # more options at https://docs.codecov.com/docs/commit-status + project: # more options at https://docs.codecov.com/docs/commit-status default: target: auto # use the coverage from the base commit, fail if coverage is lower - threshold: 0% # allow the coverage to drop by + threshold: 0% # allow the coverage to drop by comment: layout: " diff, flags, files" behavior: default require_changes: false - require_base: false # [true :: must have a base report to post] - require_head: false # [true :: must have a head report to post] + require_base: false # [true :: must have a base report to post] + require_head: false # [true :: must have a head report to post] hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9cf0556f..0e4a84d1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,14 @@ default_language_version: - python: python3 + python: python3 ci: - autofix_commit_msg: | - [pre-commit.ci] auto fixes from pre-commit hooks - autofix_prs: true - autoupdate_branch: 'pre-commit-autoupdate' - autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' - autoupdate_schedule: monthly - skip: [no-commit-to-branch] - submodules: false + autofix_commit_msg: | + [pre-commit.ci] auto fixes from pre-commit hooks + autofix_prs: true + autoupdate_branch: "pre-commit-autoupdate" + autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate" + autoupdate_schedule: monthly + skip: [no-commit-to-branch] + submodules: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 @@ -47,6 +47,20 @@ repos: - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: - - id: codespell - additional_dependencies: - - tomli + - id: codespell + additional_dependencies: + - tomli + # prettier - multi formatter for .json, .yml, and .md files + - repo: https://github.com/pre-commit/mirrors-prettier + rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8 + hooks: + - id: prettier + additional_dependencies: + - "prettier@^3.2.4" + # docformatter - PEP 257 compliant docstring formatter + - repo: https://github.com/s-weigand/docformatter + rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c + hooks: + - id: docformatter + additional_dependencies: [tomli] + args: [--in-place, --config, ./pyproject.toml] diff --git a/doc/manual/extractEquations.py b/doc/manual/extractEquations.py index 8a5923c0..6be47249 100644 --- a/doc/manual/extractEquations.py +++ b/doc/manual/extractEquations.py @@ -37,6 +37,7 @@ def loadEquations(): """Search for equation codes preceded by @EquationMark macro. + Store equation codes in rc['eqns']. """ lines = [] @@ -116,6 +117,7 @@ def convertToPNG(texfile): def getBoundingBox(psfilename): """Run ghostscript to obtain effective bounding box of psfilename. + Return a list of bounding box coordinates. """ cmd = "gs -dNOPAUSE -dBATCH -q -sDEVICE=bbox %r" % psfilename @@ -132,6 +134,7 @@ def getBoundingBox(psfilename): def getPageBoundingBox(psfilename): """Obtain bounding box value defined in psfilename. + Return a list of bounding box coordinates. """ import re diff --git a/doc/manual/fixHTMLCode.py b/doc/manual/fixHTMLCode.py index 0495fa40..3929573a 100644 --- a/doc/manual/fixHTMLCode.py +++ b/doc/manual/fixHTMLCode.py @@ -25,7 +25,7 @@ def eqreplace(mx): - """helper function to replace equation marks. + """Helper function to replace equation marks. mx -- regular expression match object @@ -41,6 +41,7 @@ def eqreplace(mx): def replaceEquationMarks(s): """Replace equation marks in given string. + Return modified string. """ s1 = re.sub(eqmark, eqreplace, s) diff --git a/doc/manual/html/pdfgui.html b/doc/manual/html/pdfgui.html index 5c4a963f..8d7eaacd 100644 --- a/doc/manual/html/pdfgui.html +++ b/doc/manual/html/pdfgui.html @@ -1,6 +1,6 @@ - - - -PDFgui user guide, release 2.0, May 2023 - - - - - - - - - - - - - - - -

PDFgui user guide

-

2.0 release

-

May 2023

-C. L. Farrow, P. Juhás, J. W. Liu, D. Bryndin, E. S. Božin,
-J. Bloch, Th. Proffen, and S. J. L. Billinge
- - - -
- - - - - - - - -
[ < ][ > ]   [Contents][Index][ ? ]
- -

Acknowledgments

- -

This software was originally developed by the Billinge group as part -of the Distributed Data Analysis of Neutron Scattering Experiments -(DANSE) project funded by the US National Science Foundation under -grant DMR-0520547. Developments of PDFfit2 were funded by NSF grant -DMR-0304391 in the Billinge group, and with support from Michigan State -University and Columbia University. Any opinions, findings, and conclusions -or recommendations expressed in this material are those of the author(s) -and do not necessarily reflect the views of the respective funding bodies. -Subsequent development was done in the Billinge group at Columbia University -and then in collaboration between the Billinge group at Columbia and Pavol -Juhas at Brookhaven National Laboratory. Moving forward, PDFgui will be -maintained as a community project with contributions welcomed from many people. -

-

Several of the examples in the tutorial part were made possible and benefited from samples -synthesized by J. F. Mitchell, and from data collected and processed by M. -Schmidt, P. G. Radaelli, and X. Qiu. -

-

If you use this program to do productive scientific research that leads -to publication, we ask that you acknowledge use of the program by citing -the following paper in your publication: -

-
-

C. L. Farrow, P. Juhás, J. W. Liu, D. Bryndin, E. S. Božin, -J. Bloch, Th. Proffen and S. J. L. Billinge, -PDFfit2 and PDFgui: computer programs for studying nanostructure in crystals, -J. Phys.: Condens. Matter, 19, 335219 (2007) -

- -

Up to the release 1.1.2 (February 2017) the copyright was held by -the institutions that hosted the work as follows: -Copyright 2006-2007, Board of Trustees of Michigan State University, -Copyright 2008-2012, Board of Trustees of Columbia University in the -city of New York. -Copyright 2013, Brookhaven National Laboratory (Copyright holder -indicated in each source file). -

-

As of February 2017, and the 1.1.2 release, PDFgui has moved to a shared copyright model. -PDFgui uses a shared copyright model. Each contributor maintains copyright over their -contributions to PDFgui. But, it is important to note that these contributions are -typically only changes to the repositories. Thus, the PDFgui source code, in its entirety, -is not the copyright of any single person or institution. Instead, it is the collective -copyright of the entire PDFgui Development Team. If individual contributors want to -maintain a record of what changes/contributions they have specific copyright on, they -should indicate their copyright in the commit message of the change, when they commit -the change to one of the PDFgui repositories. -The PDFgui Development Team is the set of all contributors to the PDFgui project. -A full list can be obtained from the git version control logs. -For more information please visit https://www.diffpy.org -or contact Prof. Simon Billinge at sb2896@columbia.edu. -

- - - -

Preface

- -

Using PDFgui and PDFfit2

-

Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -

- -

Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. -

- -

Redistributions in binary form must reproduce the above copyright notice, this -list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. -

- -

Neither the names of COLUMBIA UNIVERSITY, MICHIGAN STATE UNIVERSITY nor the -names of their contributors may be used to endorse or promote products derived -from this software without specific prior written permission. -

- - -

Disclaimer

- -

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -

- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

1 Introduction

- - -

PDFgui is a graphical interface built on the PDFfit2 engine, which is a program -and programming library for real-space refinement of crystal structures based -on the atomic pair distribution function (PDF) method. PDFgui organizes fits -and simplifies many data analysis tasks, such as configuring and plotting -multiple fits. PDFfit2 is capable of fitting a theoretical three dimensional -structure to atomic pair distribution function data and is ideal for nanoscale -investigations. The fit system accounts for lattice constants, atomic positions -and anisotropic atomic displacement parameters, correlated atomic motion, and -experimental factors that may affect the data. The atomic positions and thermal -coefficients can be constrained to follow symmetry requirements of an arbitrary -space group. The PDFfit2 engine is written in C++ and accessible via Python, -allowing it to inter-operate with other Python programs. -

- - - - - - - - - - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

1.1 PDFfit2

- - -

PDFfit2 is a major upgrade to PDFfit, and inherits many of its -features. PDFfit is capable of fitting a theoretical three-dimensional -structure to an experimentally determined PDF. It can simultaneously -fit multiple structures, accounting for different structural phases -in a material. PDFfit has a constraint system that allows expressing -structure variables as simple functions of fitted parameters. PDFfit -structure variables include lattice constants, data and phase scale -factors, atomic site occupation, anisotropic atomic displacement -parameters (ADPs), and atomic vibrational correlations. PDFfit has a built-in -FORTRAN-style command language that understands simple FOR loops and -some built in arithmetic functions. -

-

The original PDFfit was written in FORTRAN-77, which imposes some -limitations on the program. For example, it uses fixed-size arrays -for internal storage. This precludes the analysis of structures with -large cells without modifying the code. Though the constraint system -is powerful, it requires that a constraint equation be accompanied -by its first derivative. This places the burden of determining the -derivatives on the user, which can introduce errors that lead to -instability in the convergence. Furthermore, the code is monolithic, -not easily extensible and hard to integrate with external programs. -

-

The primary focus of PDFfit2 development was to remedy the limitations of -PDFfit while extending its functionality. The old PDFfit engine has been -completely rewritten in C++, and many bugs have been fixed. The new engine -uses dynamic memory allocation so that the size of the structure or extent -of the fit-range of the PDF is limited only by the physical memory available. -The constraint system has also been upgraded. The program automatically -computes the analytical derivatives of the constraints that are required by -the minimization routine. This simplifies user input and reduces the -possibility of errors. In addition, new fitting parameters for handling -dynamic atomic correlations and experimental resolution have been introduced -as well. -

-

Instead of rewriting the PDFfit command interpreter, which is used -to define the fitting problem and to control and run the refinement, -its functions are carried out using the Python language -(https://www.python.org). Python is a powerful, cross-platform, -open-source interpreted programming language (i.e., it does not need -to be compiled to run, similar to scripting) that emphasizes -object-oriented and modular design. PDFfit2 scripts written in -Python syntax take the place of PDFfit macros and the Python -interpreter can handle everything that the old interpreter could, -and more. Using Python as an interpreter allows PDFfit2 to be -combined with and enhanced by other Python libraries. We make use -of this capability with PDFgui as described below. -

- -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

1.2 PDFgui

- - -

The PDFfit2 engine can be used either directly from the Python command line, or -as part of larger and more complex software applications. The first application -built on PDFfit2 is PDFgui, a graphical environment for PDF fitting. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
-

1.2.1 Design principles

- -

PDFgui has been designed to provide users with an easy-to-use yet powerful -interface for fitting structure models to PDF data. It makes use of an -object-oriented architecture, which makes it highly extensible and -maintainable. This allows for powerful usability features such as real-time -plotting. PDFgui has been designed with multitasking in mind. It is -multi-threaded so that the work being done by the PDFfit2 engine does not -interfere with the tasks of the user interface. -

-

PDFgui is written in the Python programming language. Python features a relaxed -and friendly syntax, supports “write once, run anywhere” portability, and has -extensive libraries and modules for virtually every task. Software codes -written in a variety of programming languages can be bound into Python, which -allows them to be used together. Python is becoming a popular choice in the -scientific computation community. -

-

PDFgui’s interface is built using wxPython (https://www.wxpython.org), the -Python package for wxWidgets, a mature cross-platform GUI library. Graphical -applications written in wxPython provide a look and feel native to the platform -on which they are run. PDFgui is designed to run on Windows, Mac OS, Linux, -and all major Unix systems. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
-

1.2.2 Capabilities

- -

PDFgui contains all of the functionality of PDFfit2 along with additional -enhancements for usability. Mundane tasks are handled by the program and -difficult tasks are made simple. PDFgui can manage multiple fits at once. Each -fit can have multiple experimental data sets and structure models. Fits in a -sequence can call upon other fits for their starting parameters, and configured -fits can be queued to run while the user is away. All the initial, final, and -intermediate data are stored in a platform independent project file that can be -loaded on any computer. All management tasks, such as fit creation, -configuration, modification, and visualization, can be done through the -graphical interface. -

-

PDFgui supports space group operations. Users can define an asymmetric unit -and let PDFgui expand it to a full cell with all symmetry related positions. -PDFgui can also generate symmetry constraints for atom positions and atomic -ADPs. Users just need to specify the space group, and the program will identify -equivalent sites and generate constraint equations for their coordinates and -temperature factors to keep the structure consistent with the symmetry -requirements. This can be done either for all atoms in the structure or for an -arbitrary subset - for example when it is known that only a certain species -show a local distortion. The code for space group definitions was provided by -the Python Macromolecular Library (mmLib, -http://pymmlib.sourceforge.net). This was extened to include -non-standard space groups using the Computational Crystallography Toolbox -(cctbx, https://cctbx.github.io). PDFgui also supports supercell -expansion of a normal unit cell. -

-

PDFgui uses the matplotlib (https://matplotlib.org) Python -package for 2D plotting of data and results. Matplotlib has a friendly -interface so the user can quickly and easily view the results of a fitting. -PDFgui lets users plot data from a series of fits and plot it against selected -meta-data (temperature, doping, etc.), plot the results of several fits in the -same window, plot the PDF in real time as the fitting is running, plot the -parameters or variables in real time as the refinement evolves, and save plots -in common image formats or export the data to a text file. PDFgui can be -configured to use one of many structure visualization packages, such as AtomEye -(http://li.mit.edu/A/Graphics/A/) or PyMOL -(https://www.pymol.org). -

-

PDFgui supports built-in macros for advanced fits. For a set of experimental -data from one system at different temperatures or doping levels, PDFgui can -expand a template fit to a series of related fits. Another PDFgui macro makes -it easy to set up boxcar fits, where the same model is fit over different -r-ranges of the PDF data. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

1.3 Availability

- - -

PDFfit2 and PDFgui are open source and distributed under a BSD license. They -run on Windows, Mac OS, Linux, and all major Unix systems. The source code is -freely available. For more information please contact Professor Simon Billinge -(sb2896@columbia.edu) or consult the web-page -https://www.diffpy.org. News of updates and releases will be posted at -this website and on the diffpy-users group at -https://groups.google.com/d/forum/diffpy-users. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

1.4 Installation

- - -

PDFgui is included as a part of DiffPy, a suite of Python and C++ -libraries for structure analysis from diffraction data. For more -information about DiffPy products visit the project homepage at -https://www.diffpy.org. -

- - - - - - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

1.4.1 Installation for Anaconda Python

- -

As of version 1.1 PDFgui is distributed as a pre-built package for -Anaconda Python. This method makes it -easier to distribute software updates and also results in the same -installation procedure on all supported platforms. -

-

To install PDFgui, download and install Anaconda for Python 2.7 from -https://www.anaconda.com/download. When ready open a terminal -application (or Anaconda Command Prompt on Windows) and use the -conda package manager to install PDFgui from the “diffpy” -channel of Anaconda packages -

-
-
conda config --add channels diffpy
+  
+    PDFgui user guide, release 2.0, May 2023
+
+    
+    
+    
+    
+    
+    
+    
+  
+
+  
+    

PDFgui user guide

+

2.0 release

+

May 2023

+ C. L. Farrow, P. Juhás, J. W. Liu, D. Bryndin, E. S. Božin,
+ J. Bloch, Th. Proffen, and S. J. L. Billinge
+ +
+ + + + + + + + + + +
[ < ] + [ + > ] +   + [Contents] + + [Index] + + [ ? ] +
+ +

Acknowledgments

+ +

+ This software was originally developed by the Billinge group as part of + the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) + project funded by the US National Science Foundation under grant + DMR-0520547. Developments of PDFfit2 were funded by NSF grant DMR-0304391 + in the Billinge group, and with support from Michigan State University and + Columbia University. Any opinions, findings, and conclusions or + recommendations expressed in this material are those of the author(s) and + do not necessarily reflect the views of the respective funding bodies. + Subsequent development was done in the Billinge group at Columbia + University and then in collaboration between the Billinge group at + Columbia and Pavol Juhas at Brookhaven National Laboratory. Moving + forward, PDFgui will be maintained as a community project with + contributions welcomed from many people. +

+

+ Several of the examples in the tutorial part were made possible and + benefited from samples synthesized by J. F. Mitchell, and from data + collected and processed by M. Schmidt, P. G. Radaelli, and X. Qiu. +

+

+ If you use this program to do productive scientific research that leads to + publication, we ask that you acknowledge use of the program by citing the + following paper in your publication: +

+
+

+ C. L. Farrow, P. Juhás, J. W. Liu, D. Bryndin, E. S. Božin, J. Bloch, + Th. Proffen and S. J. L. Billinge, + PDFfit2 and PDFgui: computer programs for studying nanostructure in + crystals, J. Phys.: Condens. Matter, 19, 335219 (2007) +

+
+ +

+ Up to the release 1.1.2 (February 2017) the copyright was held by the + institutions that hosted the work as follows: Copyright 2006-2007, Board + of Trustees of Michigan State University, Copyright 2008-2012, Board of + Trustees of Columbia University in the city of New York. Copyright 2013, + Brookhaven National Laboratory (Copyright holder indicated in each source + file). +

+ +

+ As of February 2017, and the 1.1.2 release, PDFgui has moved to a shared + copyright model. PDFgui uses a shared copyright model. Each contributor + maintains copyright over their contributions to PDFgui. But, it is + important to note that these contributions are typically only changes to + the repositories. Thus, the PDFgui source code, in its entirety, is not + the copyright of any single person or institution. Instead, it is the + collective copyright of the entire PDFgui Development Team. If individual + contributors want to maintain a record of what changes/contributions they + have specific copyright on, they should indicate their copyright in the + commit message of the change, when they commit the change to one of the + PDFgui repositories. The PDFgui Development Team is the set of all + contributors to the PDFgui project. A full list can be obtained from the + git version control logs. For more information please visit + https://www.diffpy.org or contact + Prof. Simon Billinge at + sb2896@columbia.edu. +

+ + +

Preface

+ +

Using PDFgui and PDFfit2

+

+ Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: +

+ +

+ Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +

+ +

+ Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +

+ +

+ Neither the names of COLUMBIA UNIVERSITY, MICHIGAN STATE UNIVERSITY nor + the names of their contributors may be used to endorse or promote products + derived from this software without specific prior written permission. +

+ + +

Disclaimer

+ +

+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT + NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ < ] + + [ Up ] + + [ > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1 Introduction

+ + +

+ PDFgui is a graphical interface built on the PDFfit2 engine, which is a + program and programming library for real-space refinement of crystal + structures based on the atomic pair distribution function (PDF) method. + PDFgui organizes fits and simplifies many data analysis tasks, such as + configuring and plotting multiple fits. PDFfit2 is capable of fitting a + theoretical three dimensional structure to atomic pair distribution + function data and is ideal for nanoscale investigations. The fit system + accounts for lattice constants, atomic positions and anisotropic atomic + displacement parameters, correlated atomic motion, and experimental + factors that may affect the data. The atomic positions and thermal + coefficients can be constrained to follow symmetry requirements of an + arbitrary space group. The PDFfit2 engine is written in C++ and accessible + via Python, allowing it to inter-operate with other Python programs. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1.1 PDFfit2

+ + +

+ PDFfit2 is a major upgrade to PDFfit, and inherits many of its features. + PDFfit is capable of fitting a theoretical three-dimensional structure to + an experimentally determined PDF. It can simultaneously fit multiple + structures, accounting for different structural phases in a material. + PDFfit has a constraint system that allows expressing structure variables + as simple functions of fitted parameters. PDFfit structure variables + include lattice constants, data and phase scale factors, atomic site + occupation, anisotropic atomic displacement parameters (ADPs), and atomic + vibrational correlations. PDFfit has a built-in FORTRAN-style command + language that understands simple FOR loops and some built in arithmetic + functions. +

+

+ The original PDFfit was written in FORTRAN-77, which imposes some + limitations on the program. For example, it uses fixed-size arrays for + internal storage. This precludes the analysis of structures with large + cells without modifying the code. Though the constraint system is + powerful, it requires that a constraint equation be accompanied by its + first derivative. This places the burden of determining the derivatives on + the user, which can introduce errors that lead to instability in the + convergence. Furthermore, the code is monolithic, not easily extensible + and hard to integrate with external programs. +

+

+ The primary focus of PDFfit2 development was to remedy the limitations of + PDFfit while extending its functionality. The old PDFfit engine has been + completely rewritten in C++, and many bugs have been fixed. The new engine + uses dynamic memory allocation so that the size of the structure or extent + of the fit-range of the PDF is limited only by the physical memory + available. The constraint system has also been upgraded. The program + automatically + computes the analytical derivatives of the constraints that are required + by the minimization routine. This simplifies user input and reduces the + possibility of errors. In addition, new fitting parameters for handling + dynamic atomic correlations and experimental resolution have been + introduced as well. +

+

+ Instead of rewriting the PDFfit command interpreter, which is used to + define the fitting problem and to control and run the refinement, its + functions are carried out using the Python language (https://www.python.org). Python is a powerful, cross-platform, open-source interpreted + programming language (i.e., it does not need to be compiled to run, + similar to scripting) that emphasizes object-oriented and modular design. + PDFfit2 scripts written in Python syntax take the place of PDFfit macros + and the Python interpreter can handle everything that the old interpreter + could, and more. Using Python as an interpreter allows PDFfit2 to be + combined with and enhanced by other Python libraries. We make use of this + capability with PDFgui as described below. +

+ +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1.2 PDFgui

+ + +

+ The PDFfit2 engine can be used either directly from the Python command + line, or as part of larger and more complex software applications. The + first application built on PDFfit2 is PDFgui, a graphical environment for + PDF fitting. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.2.1 Design principles

+ +

+ PDFgui has been designed to provide users with an easy-to-use yet powerful + interface for fitting structure models to PDF data. It makes use of an + object-oriented architecture, which makes it highly extensible and + maintainable. This allows for powerful usability features such as + real-time plotting. PDFgui has been designed with multitasking in mind. It + is multi-threaded so that the work being done by the PDFfit2 engine does + not interfere with the tasks of the user interface. +

+

+ PDFgui is written in the Python programming language. Python features a + relaxed and friendly syntax, supports “write once, run + anywhere” portability, and has extensive libraries and modules for + virtually every task. Software codes written in a variety of programming + languages can be bound into Python, which allows them to be used together. + Python is becoming a popular choice in the scientific computation + community. +

+

+ PDFgui’s interface is built using wxPython (https://www.wxpython.org), the Python package for wxWidgets, a mature cross-platform GUI library. + Graphical applications written in wxPython provide a look and feel native + to the platform on which they are run. PDFgui is designed to run on + Windows, Mac OS, Linux, and all major Unix systems. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+

1.2.2 Capabilities

+ +

+ PDFgui contains all of the functionality of PDFfit2 along with additional + enhancements for usability. Mundane tasks are handled by the program and + difficult tasks are made simple. PDFgui can manage multiple fits at once. + Each fit can have multiple experimental data sets and structure models. + Fits in a sequence can call upon other fits for their starting parameters, + and configured fits can be queued to run while the user is away. All the + initial, final, and intermediate data are stored in a platform independent + project file that can be loaded on any computer. All management tasks, + such as fit creation, configuration, modification, and visualization, can + be done through the graphical interface. +

+

+ PDFgui supports space group operations. Users can define an asymmetric + unit and let PDFgui expand it to a full cell with all symmetry related + positions. PDFgui can also generate symmetry constraints for atom + positions and atomic ADPs. Users just need to specify the space group, and + the program will identify equivalent sites and generate constraint + equations for their coordinates and temperature factors to keep the + structure consistent with the symmetry requirements. This can be done + either for all atoms in the structure or for an arbitrary subset - for + example when it is known that only a certain species show a local + distortion. The code for space group definitions was provided by the + Python Macromolecular Library (mmLib, + http://pymmlib.sourceforge.net). This was extened to include non-standard space groups using the + Computational Crystallography Toolbox (cctbx, + https://cctbx.github.io). PDFgui + also supports supercell expansion of a normal unit cell. +

+

+ PDFgui uses the matplotlib (https://matplotlib.org) Python package for 2D plotting of data and results. Matplotlib has a + friendly interface so the user can quickly and easily view the results of + a fitting. PDFgui lets users plot data from a series of fits and plot it + against selected meta-data (temperature, doping, etc.), plot the results + of several fits in the same window, plot the PDF in real time as the + fitting is running, plot the parameters or variables in real time as the + refinement evolves, and save plots in common image formats or export the + data to a text file. PDFgui can be configured to use one of many structure + visualization packages, such as AtomEye (http://li.mit.edu/A/Graphics/A/) or PyMOL (https://www.pymol.org). +

+

+ PDFgui supports built-in macros for advanced fits. For a set of + experimental data from one system at different temperatures or doping + levels, PDFgui can expand a template fit to a series of related fits. + Another PDFgui macro makes it easy to set up boxcar fits, where the same + model is fit over different r-ranges of the PDF data. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1.3 Availability

+ + +

+ PDFfit2 and PDFgui are open source and distributed under a BSD license. + They run on Windows, Mac OS, Linux, and all major Unix systems. The source + code is freely available. For more information please contact Professor + Simon Billinge (sb2896@columbia.edu) or consult the web-page + https://www.diffpy.org. News of + updates and releases will be posted at this website and on the + diffpy-users group at + https://groups.google.com/d/forum/diffpy-users. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1.4 Installation

+ + +

+ PDFgui is included as a part of DiffPy, a suite of Python and C++ + libraries for structure analysis from diffraction data. For more + information about DiffPy products visit the project homepage at + https://www.diffpy.org. +

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1.4.1 Installation for Anaconda Python

+ +

+ As of version 1.1 PDFgui is distributed as a pre-built package for + Anaconda Python. This method makes + it easier to distribute software updates and also results in the same + installation procedure on all supported platforms. +

+

+ To install PDFgui, download and install Anaconda for Python 2.7 from + https://www.anaconda.com/download. When ready open a terminal application (or + Anaconda Command Prompt on Windows) and use the + conda package manager to install PDFgui from the + “diffpy” channel of Anaconda packages +

+
+
+conda config --add channels diffpy
 conda install diffpy.pdfgui
-
- -

The first command instructs Anaconda system to always check the -“diffpy” channel for any new software. Such configuration -allows to obtain PDFgui updates using -

-
-
conda update diffpy.pdfgui
-
- -

It is however not strictly necessary to make the “diffpy” -channel permanent. The same effect can be accomplished by adding the -‘--channel=diffpy’ option to either of -conda install or conda update commands. -

-

After installation is complete PDFgui can be started from a terminal by -entering pdfgui command or on Windows by using the DiffPy -start menu. PDFgui can be also started from the “Launcher” program -that is included with Anaconda. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

1.4.2 Configuration of structure viewer

- - -

PDFgui can visualize 3D structures by displaying them with an external -visualization program. The visualization program needs to -be specified together with a suitable structure format in the -“Edit â†’ Preferences” menu in PDFgui. The structure plotting -feature has been tested with the following programs: -

-
-
AtomEye
-

AtomEye structure viewer, XCFG format
-http://li.mit.edu/A/Graphics/A/ -

-
-
PyMOL
-

PyMOL structure viewer, PDB format
-https://www.pymol.org -

-
- -

A note for AtomEye users: - -

-

AtomEye requires its standard output is connected to a terminal. -On Unix this happens when pdfgui is started from a terminal. -However if you prefer to start PDFgui using a desktop shortcut or via -“Run Application” dialog of the window manager, you need to put the -following information to the “Edit → Preferences” menu of PDFgui. -

-
Structure viewer executable: xterm
+
+
+ +

+ The first command instructs Anaconda system to always check the + “diffpy” channel for any new software. Such configuration + allows to obtain PDFgui updates using +

+
+
+conda update diffpy.pdfgui
+
+
+ +

+ It is however not strictly necessary to make the “diffpy” + channel permanent. The same effect can be accomplished by adding the + ‘--channel=diffpy’ option to either of conda install or + conda update commands. +

+

+ After installation is complete PDFgui can be started from a terminal by + entering pdfgui command or on Windows by using the DiffPy + start menu. PDFgui can be also started from the “Launcher” + program that is included with Anaconda. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1.4.2 Configuration of structure viewer

+ + +

+ PDFgui can visualize 3D structures by displaying them with an external + visualization program. The visualization program needs to be specified + together with a suitable structure format in the “Edit â†’ + Preferences” menu in PDFgui. The structure plotting feature has been + tested with the following programs: +

+
+
AtomEye
+
+

+ AtomEye structure viewer, XCFG format
+ http://li.mit.edu/A/Graphics/A/ +

+
+
PyMOL
+
+

+ PyMOL structure viewer, PDB format
+ https://www.pymol.org +

+
+
+ +

+ A note for AtomEye users: + +

+

+ AtomEye requires its standard output is connected to a terminal. On Unix + this happens when pdfgui is started from a terminal. However + if you prefer to start PDFgui using a desktop shortcut or via “Run + Application” dialog of the window manager, you need to put the + following information to the “Edit → Preferences” menu of + PDFgui. +

+
+
+Structure viewer executable: xterm
 Argument string: -iconic -e ATOMEYE %s
 Structure format: xcfg
-
-

In the above, ATOMEYE is the path to the ATOMEYE executable. -

-

For Cygwin users, -the workaround is to launch the executable from a batch file. -Batch files can only run in a command window on Windows and so -AtomEye’s requirements would be for sure satisfied. -In addition the batch file can be used to adjust environment -variables: -

-
atomeye.bat
+
+
+

In the above, ATOMEYE is the path to the ATOMEYE executable.

+

+ For Cygwin users, the workaround is to launch the executable from a batch + file. Batch files can only run in a command window on Windows and so + AtomEye’s requirements would be for sure satisfied. In addition the + batch file can be used to adjust environment variables: +

+
+
+atomeye.bat
 ------------------------------------------------------------------------
 set DISPLAY=localhost:0
 set PATH=C:\cygwin\bin;C:\cygwin\usr\X11R6\bin;C:\ATOMEYE_DIR;%PATH%
 start A.exe %*
 ------------------------------------------------------------------------
-
- -

Here ATOMEYE_DIR needs to be replaced with a proper path. Make sure -that the X-server application included with Cygwin is started. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

1.4.3 Installation from sources

- - - - -

PDFgui sources are available in a public -Git repository at -https://github.com/diffpy/diffpy.pdfgui. -Feel free to fork this project on GitHub and contribute. To -use the latest development version clone the Git repository -to your computer and install it in a development mode so that sources -are used directly rather than copied to a system location. It is also -recommended to uninstall the Anaconda package for PDFgui, so that -there is no confusion as to what version is the active one. -Here are the shell commands that would do it: -

-
-
# Install PDFgui together with software dependencies.
+
+
+ +

+ Here ATOMEYE_DIR needs to be replaced with a proper path. Make + sure that the X-server application included with Cygwin is started. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1.4.3 Installation from sources

+ + + + +

+ PDFgui sources are available in a public + Git repository at + https://github.com/diffpy/diffpy.pdfgui. Feel free to fork this project on GitHub and contribute. To use the + latest development version clone the Git repository to your computer and + install it in a development mode so that sources are used directly rather + than copied to a system location. It is also recommended to uninstall the + Anaconda package for PDFgui, so that there is no confusion as to what + version is the active one. Here are the shell commands that would do it: +

+
+
+# Install PDFgui together with software dependencies.
 conda install --channel=diffpy diffpy.pdfgui
 
 # Make room for the version from sources.  Keep dependencies installed.
@@ -673,1262 +1142,2031 @@ 

1.4.3 Installation from sources

# Install PDFgui sources in a development mode. cd diffpy.pdfgui python setup.py develop -
- -

To verify that PDFgui is indeed loaded from the local source -repository run -

-
-
python -m pydoc diffpy.pdfgui
-
- -

and check the path displayed in the FILE section. The application -integrity can be verified by executing all builtin tests using -

-
-
python -m diffpy.pdfgui.tests.rundeps
-
- -

Use git pull to bring your source directory into sync -with the latest updates in the main repository. It is recommend -to afterwards do `setup.py develop again to refresh -the version metadata associated with the program: -

-
-
git pull
+
+
+ +

+ To verify that PDFgui is indeed loaded from the local source repository + run +

+
+
+python -m pydoc diffpy.pdfgui
+
+
+ +

+ and check the path displayed in the FILE section. The application + integrity can be verified by executing all builtin tests using +

+
+
+python -m diffpy.pdfgui.tests.rundeps
+
+
+ +

+ Use git pull to bring your source directory into sync with + the latest updates in the main repository. It is recommend to afterwards + do `setup.py develop again to refresh the version metadata + associated with the program: +

+
+
+git pull
 python setup.py develop
-
- -

To revert PDFgui installation from the source-code installation -back to the pre-built Anaconda package do -

-
-
pip uninstall diffpy.pdfgui
+
+
+ +

+ To revert PDFgui installation from the source-code installation back to + the pre-built Anaconda package do +

+
+
+pip uninstall diffpy.pdfgui
 conda install --channel=diffpy diffpy.pdfgui
-
- - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

1.5 What is new

- - - - -

Version 1.1, released March 2016

- -

Improvements and modifications since the last major release -1.0-r3067 from April 2009. -

-
-
Anaconda installer
-
-

PDFgui is now distributed as a pre-built package for Anaconda Python. -The program is available for all platforms supported by Anaconda, i.e., -for 32 and 64-bit Linux, Mac OS X, and for 32 and 64-bit Windows. -

-
-
upgrade for recent GUI libraries
-
-

Source codes were updated to work with WX GUI toolkit 2.9 or later. -Fixed blacked-out text fields on Mac OS X. Fixed missing toolbar -in plot-windows on Mac OS X. -

-
-
select atoms menu
-
-

Added “Select Atoms” context menu to the Phase Configuration and Phase -Constraints panels. This selects atom rows by a range of indices -or by atom type. Added keyboard shortcut / for activating the -atom-selection dialog. -

-
-
small enhancements
-
-

Fixed problems with r-grid interpolation near data boundaries. Allow -use of CIF-defined space groups for symmetry constraints. Use consistent -numbering for parameters created by symmetry constraints. Improved -export data tool in plot windows to group y-arrays that are on -the same x grid. Enhanced supercell expansion to also adjust -the coordinate constraints. -

-
-
project moved to GitHub
-
-

PDFgui source repository was converted from subversion to a Git repository at -https://github.com/diffpy/diffpy.pdfgui. Project now uses Git tags -to define software release and version data. -

-
-
Unicode support
-
-

Allow accented characters in project filenames and in folder paths -where located. Allow accented characters for naming the fit tree -items. Note that such projects are unlikely to work with older -versions of PDFgui. Fix failure to exit when there is some -uncaught error in the at-exit cleanup functions. -

-
-
PDFgui tests
-
-

PDFgui installation now includes built-in tests. Added facility to -test PDFgui and all its DiffPy components. Implemented automated -testing and generation of test coverage reports when sources on -GitHub change. -

-
-
bug fixes
-

Quite a few. Consult the code history at -https://github.com/diffpy/diffpy.pdfgui/commits. -

-
-
- - -

Version 1.0, released April 2009

- -

This section describes improvements and modifications since the -last beta-release 1.0b.1792 from December 2007. -

-
-
updates and installation
-

PDFgui can be installed or updated -with a simple run of the easy_install script. easy_install -checks our online code repository for any newer versions and takes -care of their download and installation. It can be also used to -add future DiffPy components as they become available. This should -work for Linux, Mac and Windows. -

-
-
Windows installer
-

The updated Windows package includes full installation of -Python 2.5 and script for code updates. PDFgui -can be installed under normal Python2.5 tree if it has the -easy_install script. -

-
-
particle shape correction stored with phase
-

The previous release of PDFgui had -spherical shape correction factors stored with PDF dataset. The -new layout is more logical and allows multi-phase refinements with -separate shape corrections. -

-
-
step shape factor
-

Defined new shape factor that cuts off the -simulated PDF at user defined r-limit. -

-
-
cumulative Rw
-

Implemented calculation of cumulative Rw -and option to show it in PDFgui plot window. -

-
-
project post-processing
-

Implemented new module -‘tui’ (text user interface) for simple access to the data -in PDFgui project files. The ‘tui’ module can be used -in easy-to-understand Python scripts for arbitrary data extraction -or conversion. It should be useful for project files with large -temperature or compositional series of PDF refinements. -

-
-
structure visualization
-

PDFgui can now show structures with any external structure viewer, -that accepts structure file as a command-line argument. -

-
-
space group representations
-

Added 249 space group -representations in non-standard settings. The new representations -were generated using the -cctbx library and helpful -hints from Ralf W. Grosse-Kunstleve. -

-
-
symmetry constraints
-

Fixed issues with generation of -symmetry requirements for the ADP tensors. -

-
-
default ADP tensors
-

PDF contributions are not counted for atoms that have -ADP tensors Uij equal zero. Atoms are now inserted with -a non-zero Uij matrix. Added warning when a phase -loaded from file has atoms with zero ADPs. -

-
-
temperature series macro
-

The temperature series macro was broken for datasets at equal temperature -or when temperature contained decimal point. Improved file -and temperature sorting in the temperature series dialog. -

-
-
journal panel
-

Fixed shortcut key handling and font size issues. -

-
-
startup option ‘--db-pdb
-

The new command-line option starts Python debugger on -PDFgui crash instead of displaying error report dialog. -

-
-
grid interpolation
-

Fixed problems with r-grid interpolation appearing due to round-off errors. -

-
-
data load on Windows
-

Windows version could not read PDF datasets with NaN (not-a-number) -values in the dGr column, because NaN is not supported by the Windows -C-library. Added check for NaN-s before converting to float. -

-
-
- -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

1.6 Community

- - - - -

There are two Google groups for support and development of PDFgui and other -DiffPy software. Visit the links below for message archives or instructions on -subscription and posting. -

-
-
diffpy-users https://groups.google.com/d/forum/diffpy-users
-

Help on usage of PDFgui, PDFfit2 and other DiffPy packages. This group should -become a knowledge base of PDFgui user tips, tricks and troubleshooting. Feel -free to ask your question here. -

-
-
diffpy-dev https://groups.google.com/d/forum/diffpy-dev
-

For discussions about development and changes of PDFgui, PDFfit2 and DiffPy -library in general. -

-
- - - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

2 Quick start

- - -

In this chapter the PDFgui layout is briefly described, followed by a simple -tutorial example, spanning the GUI functionality and aimed at novice users. -Users familiar with the basics can proceed to Examples and tutorials, or -use PDFgui reference sheets. All the files used in examples are -available in the source distribution or can be downloaded from the DiffPy -website. -

- - - - - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

2.1 PDFgui layout

- - -

Once PDFgui is invoked, a PDFgui window comes up. Its layout consists of a -“Menu Bar”, a “Tool Bar”, and a set of four panes. The menu bar contains -drop-down menus that provide various aspects of PDFgui functionality. The tool -bar features icons for commonly used operations: creating a new project, -opening an existing project, saving a project, executing a refinement or -calculation, stopping a refinement or calculation, and making a quick plot. The -four panes consist of the “Fit Tree”, “Plot Control”, the“Current Action” -pane, and the “PDFfit2 Output” panel. These are all shown in Figure 2.1. -

-

The fit tree is used in setting up a fit protocol. The plot control serves the -user’s needs for graphically displaying the fits, as well as various -fit-related parameters. The content of the current action panel changes as the -refinement is being set up. It is a functional panel through which the user -configures the fit attributes, sets the fit constraints, reviews the fit -settings, displays fitting results, and also carries out other setup steps. The -progress of the PDFfit2 refinement engine is displayed in the PDFfit2 output -panel. All panels except the current action panel are dockable windows that can -be dragged across the screen, resized and arranged to accommodate the -individual visual needs of the user. The window layout can also be controlled -via the “View” drop-down menu on the menu bar. An important part of the PDFgui -operativity is also conveniently available through mouse operations such as -select and right-click. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

2.2 Creating a simple fit using a preexisting structure file

- - - -

The purpose of this example is to familiarize the novice user with the PDFgui -basics. The goal is to create a simple fit of Ni PDF from a preexisting -structure file, associate a dataset with the refinement, configure and execute -a refinement, and display the result. Files to be used in this exercise are -Ni.stru and Ni-xray.gr (found in the tutorial directory). To start, -invoke PDFgui by clicking on the icon on your desktop, selecting the program -from your system’s program menu, or by typing pdfgui in a terminal window. -

-

First a new fit needs to be established. In the fit tree right-click the mouse -button, and select New Fit. This will generate a new fit called “Fit 1” -in the fit tree. The name of the fit is highlighted and editable, so you need -only to start typing to give the fit a new name. The current action panel will -display the pages that will hold the fit and the results output. Note that the -same action could be achieved by selecting the New Fit option from the -“Fits” drop-down menu on the menu bar. -

-

The next step in populating the fit tree is to load a structural model. First, -select the fit icon in the fit tree pane. Then, right-click the mouse, invoking a -drop-down menu. Select Insert Phase, which will modify the current action -panel. The same action could be performed from the “Phases” drop-down menu on -the menu bar by selecting New Phase. In the current action panel options are -offered to load a structure from a file or to generate it from scratch. In this -exercise a preexisting structure file Ni.stru is to be loaded. -

-
-images/fig2-01 - -

Figure 2.1: PDFgui window with fit tree and Plot Control panels to the left and -current action panel to the right. The fit tree panel features the current fit -and the loaded Ni structure which is selected. The current action panel displays -phase configuration within the “Configure” tab. - -

-

Figure 2.1 shows the PDFgui appearance at this stage of the exercise. The -current action panel has three tabs, “Configure”, “Constraints”, and -“Results” that could be selected using mouse. These will be returned to -later. The “Configure” panel displays configuration information from the -structure file. The top portion contains lattice parameters, phase scale factor, -and a set of parameters intended to be used to account for correlated atomic -motion effects that typically sharpen the nearest neighbor PDF peak. These are -delta1, delta2, sratio, and rcut. The spdiameter and -stepcut parameters include scatterer size effects in the PDF. These -parameters will be described later. The bottom part of the panel contains -standard unit cell content related information such as atomic species, their -fractional coordinates, anisotropic ADPs, and site occupancies. -

-

The next step is to load an experimental data set to be fit. Selected the fit -and right-click to bring up the context menu. From the menu choose Insert -Data Set. The same action could be performed through the “Data” menu on the -menu bar. The current action panel changes accordingly, giving an option for a -data set to be loaded from a file. In this exercise Ni PDF data obtained using -synchrotron x-ray radiation collected at 6-ID-D at the Advanced Photon Source -is used. This is contained in a file Ni-xray.gr, which is to be loaded. -Note that among the exercise files there is also a file Ni-neutron.gr, -obtained using neutron radiation at the GPPD diffractometer at the IPNS -facility at the Argonne National Laboratory. Both x-ray and neutron datasets -were collected at 300 K. -

-
-images/fig2-02 - -

Figure 2.2: Appearance of a PDFgui window after a PDF dataset is loaded. The Fit -Tree panel features the current fit, loaded Ni structure, and loaded Ni PDF -dataset, G(r), which is selected. The current action panel displays data set -configuration within the “Configure” tab. - -

-

Figure 2.2 shows the PDFgui appearance at this stage of the exercise. The -“Configure” panel displays configuration information from the data file. It -should be noted that depending on the software used to prepare the experimental -PDF from the raw data, the file may (or may not) contain meta-data reflecting -the experimental conditions and configuration. For example, software PDFgetX2 -and PDFgetN, which can be used to prepare PDFs from x-ray and neutron total -scattering experiments respectively, supply meta-data in the header of the data -file. PDFgui reads this information and fills the appropriate fields in the -data set configuration panel. Caution should be exercised by the user to -verify that these data indeed correspond to the experimental conditions. In the -present example, x-ray radiation is used, and so the x-ray selection is turned -on for the scatterer type. The data range, fit range, data scale factor, -maximum Q value used in Fourier transform to obtain the experimental PDF and -the experiment specific parameters are displayed. Parameters describing -experimental resolution effects, Qdamp and Qbroad, and experimental conditions, -such as temperature and doping (used for bookkeeping and for parametric plots) -are also shown. If no meta-data are present in a data file, this information -should be supplied by the user. Note also that the changes occurred at this -stage in the plot control panel, allowing user to plot the data. This is -achieved by selecting r in the X-choice box and Gobs (the observed -G(r)) in the Y-list box and then pressing the “Plot” button. Since no -fitting has occurred so far, an attempt to plot calculated PDF profile or a -difference yields a blank plot. The data can also be displayed by clicking the -rightmost “quick-plot” button in the tool bar. -

-
-images/fig2-03 - -

Figure 2.3: Adjusting data set related configuration. - -

-

Having specified the initial structure to be refined, and the data set to be -fit, we proceed to the refinement setup. First we adjust the initial parameters -and variables, and set up the constraints. The adjustments and constraint setup -are done on both the experimental data and the refined structure levels, -toggling between the corresponding “Configure” and “Constraints” tabs. In -the present example the data related setup will be done first. -

-

Click on the data set node (Ni-xray.gr) in the fit tree. In Figure 2.3 -the “Data Set Configuration” panel is shown. We will adjust the fitting -range, as well as other parameters that reflect the experimental conditions. -Since there is no physical information in the region of r below the nearest -neighbor PDF peak position (as seen in the plot), and since this region is -often affected by noise and experimental artifacts, it is wise to exclude it -from fitting. We therefore set the value of the lower boundary of the fitting -range to 1.7. (Note that the units are Angstroms). In addition, we set -Qdamp parameter to a more realistic starting value of 0.08. This is an -instrument-dependent parameter is typically obtained through a conventional -calibration process at each PDF experiment using a standard sample such as Ni -or Si. Next, we select the “Constraints” tab, and type @1 into the -“Scale Factor” edit box. This will assign refinement parameter 1 to the data -scale factor. Note that this is the syntax used for assigning the refinement -parameters in PDFfit2 engine. Similarly, assign parameter 2 to Qdamp by -inserting @2 into the appropriate edit box. This is illustrated in Figure -Figure 2.4. -

-
-images/fig2-04 - -

Figure 2.4: Setting up the refinement parameters and constraints. - -

-

Further, we set constraints related to the structural model, by selecting the -phase node (Ni.stru) on the fit tree, adjusting the initial parameter -values if necessary (not done here), and proceeding to the “Constraints” tab. -We note that the phase configuration was performed automatically when the -structure file was loaded. We assign the refinement parameter 3 to all three -lattice constants, a, b, and c, reflecting the fact that the structure is -cubic. Isotropic ADPs are assigned to all Ni atoms in the refined cell as -refinement parameter 4. This can conveniently be done by highlighting the -“u11”, “u22” and “u33” cells for all four atoms, and typing @4 and -then pressing “Enter” on your keyboard. The outcome is shown in Figure -Figure 2.5. -

- -
-images/fig2-05 - -

Figure 2.5: Setting up the refinement parameters and constraints. - -

-

Note that constrained parameters cannot be adjusted on the “Configuration” -panel since they are no longer independent. It should also be noted that as a -part of the PDFfit2 syntax a refinement parameter can also be defined as a math -expression f(@n1,@n2,@n3,...) where @n1 stands for fitted -parameter, and n1, n2,... are arbitrary positive integers enumerating -the parameters. This allows simple linking of related variables. For example, -since cell lengths a, b, and c are all expressed as @3, the refined -structure will remain cubic. Also note that the enumeration of the parameters -can be arbitrary, enumeration does not have to follow any particular order. The -quantities within a fit that are enumerated with the same number will be -assigned the same parameter, hence caution should be exercised to avoid -unintentional assignment of the same parameter to physically different -quantities. Automatic parameter assignment (see further below) is done in such -a way as to disallow for such situations to happen. If assignment is done in -part manually, in particular for complex setups, it is recommended to verify -that the parameter assignment is done correctly. -

-
-images/fig2-06 - -

Figure 2.6: Reviewing the fit parameters and conditions. - -

-

The setup for the present example is now completed. By selecting the fit node -on the fit tree the current action window shows “Parameters” tab, which -displays the used refinement parameters for review, Figure 2.6. It shows -the initial values, and allows for updates and for refinement parameters to be -released or fixed depending on whether the corresponding “Fixed” box is -unchecked or checked, respectively. The “Refined” column, which is currently -empty, will be populated with the refined values of the parameters with the fit -completes. If the initial parameter values are to be changed, using “Apply -parameters” button will update the values of the parameters on all relevant -“Configuration” panels. The refinement is executed by clicking the “gear” -icon on the tool bar. The refinement can be stopped prematurely by clicking on -the “stop” icon on the tool bar. During the refinement the refinement -progress will be directly reported in the PDFfit2 Output panel. This is -illustrated in Figure 2.7. -

-
-images/fig2-07 - -

Figure 2.7: While the refinement is running, the refinement progress is -displayed in the PDFfit2 Output panel. - -

-

After the fitting is completed, the fit summary is provided in the “Results” -tab of the current action panel associated with the fit node. Similarly, if -the “Results” tab is displayed when Ni.stru or Ni-xray.gr are -selected, values of all corresponding refined parameters for the converged -model are displayed. -

-

If the fit results are acceptable, one or more refined values could be copied -to become new initial parameters for possible further refinement, where -appropriate. This is be done in the “Parameters” tab of the fit by -highlighting refined parameters to be copied, right-clicking, and and selecting -Copy Refined To Initial. This is illustrated in Figure 2.8. Note that -you loose the original starting values when copying values in this way, which -may make it difficult to reproduce the fit. -

-
-images/fig2-08 - -

Figure 2.8: Updating the set of initial values of refined parameters. - -

-

The fit can be displayed graphically by clicking at the “quick plot” icon on -the tool bar. Alternatively, desired items to be displayed can be selected from -the plot control and plotted on the screen. Depending on whether the structure -or the data are selected on the fit tree, either refined structural parameters -or the experiment related parameters and fit could be plotted. An example of -the fit display is shown in Figure 2.9, and a selected parameter plot vs -iteration step in Figure 2.10. If the plotting window remains open while the -fitting is in progress, the content will be updated after each fit iteration. -

-
-images/fig2-09 - -

Figure 2.9: An example of PDFgui plotting capabilities: displaying a fit. - -

-
-images/fig2-10 - -

Figure 2.10: An example of PDFgui plotting capabilities: displaying a parameter. - -

-

PDFgui is furnished with “Journal” capability, which can be found under the -“View” menu, and represents a convenient way to archive project-related -notes, as illustrated in Figure 2.11. These notes can be exported as a text -file, or saved along with the entire project for future reference. -

-
-images/fig2-11 - -

Figure 2.11: Using “Journal” feature can be a convenient way for taking notes. - -

-

The project can be saved at any stage in its present configuration through -choice of Save Project as or Save Project as appropriate from the -“File” drop-down menu. The PDFgui project file has “ddp” extension. In -addition to saving a project, various parts of the project, both structure -related and data related, can be exported to external files by making an -appropriate selection from the “Phases” and “Data” drop-down menus. The -phases (starting or converged) can be saved in one of many formats. The model -PDF profile can be exported through “Data” menu and will be saved as a -five-column “.fgr” file. The first four columns are r, G(r), dr, -and dG(r), and the fifth column is the difference curve between the data -and the model. Note that the model PDF and the difference are only calculated -within the user-specified fitting range. -

- -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

3 Examples and tutorials

- - - -

In this chapter we present series of examples and tutorials aimed at users -already comfortable with the GUI, to provide training in advanced GUI features -designed for most common modeling situations, such as building the structure -from scratch, calculating the PDF based on a given structure, linking fits, and -creating and executing a series of fits on a sequence of data sets. -

- - - - - - - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

3.1 Building structure model using crystal symmetry

- - - - -

The purpose of this example is to demonstrate to the user the symmetry -expansion capabilities of PDFgui. The goal is again to create a simple fit of -Ni PDF, but this time from scratch rather than from a preexisting structure -file. The focus will be on the symmetry expansion of the structure, and the -steps that are described earlier in Creating a simple fit using a preexisting structure file are left for the user to -recreate. File to be used in this exercise is Ni-xray.gr. To start, invoke -PDFgui. -

-

To begin, a new fit again needs to be established by right-clicking the mouse -button on the fit tree pane, and selecting New Fit. This will generate a -new fit called Fit 1 as in the previous example. The next step in populating -the fitting tree is to introduce a structural model. This time a new phase will -be added and the model built up from scratch. Select the fit icon in the Fit -Tree pane. Then right-click the mouse and select Insert Phase, which will -modify the current action panel. In the current action panel options are -offered to load a structure from a file or to generate it from scratch. Select -“New” to build up structure from scratch. The Fit Tree will be populated -with a new item “New Phase”. Rename this phase to “Ni fcc”. The current -action panel now displays default phase configuration with “dummy” values and -no atoms. Edit the lattice parameters and set them to reflect the symmetry, in -this case set the lengths to 3.52 Angstroms and all the angles to 90 degrees. -Pressing “Tab” on the keyboard will take you from one form-field to the next. -To introduce new atoms right-click with your mouse onto elem tab in the -Phase Constraints grid, and select desired number of atoms in the asymmetric -unit via the dialog box that pops up. For the Ni case, select one row only. A -new row will then show up in the table and the name of the element will be -highlighted. Type in Ni for the element name. It is important that the -element name is typed in correctly, as this is further used to search a -database for the scattering characteristics of that site(1). -Further, highlight cells in the -u11, u22, and u33 columns and type in the initial value 0.0025. -

- -

Now right-click with the mouse on the element name, and select “Expand space -group...” option. A dialog box will appear, as shown in Figure 3.1, -requesting space group information and the choice of origin. Choose “Fm-3m” -in the choice box and hit enter. You can also type in the choice box “Fm-3m” -or “225”, the space group number. This will expand the unit cell to four Ni -sites with the proper symmetry. -

-
-images/fig3-01 - -

Figure 3.1: Expanding the unit cell using space group information. - -

-

In order to set the symmetry constraints for the refinement, select -“Constraints” tab, highlight all the atoms, and right-click to invoke a menu. -Note that hitting “Control” and “A” simultaneously will select all the -atoms if the grid is active. (If the fit tree is active, it will select all -tree items). Click on “Symmetry constraints...”, and a dialog box will appear -asking for the space group to be used and whether you want the positions and/or -the thermal parameters to be constrained, as shown in Figure 3.2. The -default is to use the space group used for expansion, and to constrain -everything according to the symmetry. Since all the positions are special, -these will not be refinable by symmetry, and the thermal parameters will be -isotropic. The program will assign parameters according to symmetry using -default names that can be renamed and/or reassigned by the user. To be -consistent with the naming from the first example, one could assign the lattice -parameters as @3 and the isotropic ADPs as @4. Note that parameters -can be quickly renamed or consolidated in the “Parameters” panel of the fit -node using the right-click menu. It is important to note that the table -reflecting constraints is the only place that program refers to for the -symmetry. What is written there will be used, and if the table is tampered -with, then the original symmetry obtained using symmetry expansion feature will -not be preserved. Therefore, the expansion tool represents a convenience -tool and nothing more than that. The remaining steps of this example are -identical to these described in Creating a simple fit using a preexisting structure file. -

-
-images/fig3-02 - -

Figure 3.2: Setting up symmetry constraints to be used in a refinement. - -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

3.2 Calculating PDF from a structure

- - -

There is often a need for obtaining a calculated PDF profile for a given -structure instead of performing a fit. In order to carry out a calculation, an -underlying structure needs to be specified. This can either be loaded from a -file or generated from scratch. Suppose that we have a Ni structure populating -a fit tree using steps described in either Creating a simple fit using a preexisting structure file or in Building structure model using crystal symmetry, and that we would like to calculate Ni PDF using neutron radiation. -Highlight the Ni structure on fit tree. Either right-click and select Insert -Calculation or select New Calculation from “Calculation” menu. The -current action panel will display information very similar to that when a data -set is loaded, as shown in Figure 3.3. -

-
-images/fig3-03 - -

Figure 3.3: An example of the calculation configuration panel. - -

-

Now specify conditions to be used for the calculation, such as radiation type, -calculation range and corresponding r-grid size, as well as instrument -resolution and maximum momentum transfer parameters. For the later two, the -default values of parameters could be used, or values could be specified that -closely mimic the experimental conditions on some particular instrument of -interest. After the conditions are set, the gear icon on the tool bar can be -used to execute the calculation (or alternatively select Run Selected -Calculation from the “Calculations” menu). For our exercise, select -Neutron scatterer type. To mimic the experimental data used earlier in the -tutorial, select for example 0.01 for the r-grid size, and use 0.08 and -25.0 for resolution and maximum momentum transfer parameters respectively. -Execute the calculation and observe the result by clicking on the quick plot -icon on the tool bar. To export the calculated PDF, use the Export Selected -Calculation choice on the “Calculations” menu. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

3.3 Sequential fitting

- - -

In many practical situations there is a need to set a series of refinements -that are linked in a sequence. In what follows we will describe multi-stage -fitting capabilities of PDFgui, followed by description of three pre-made -macros that implement sequential fitting: fitting of r-series on a single -data set, temperature series on a set of data corresponding to various -temperatures, and a doping series on a set of data corresponding to samples -whose chemical content changes in some systematic way. These macros can be -accessed from the menu bar, “Fits” menu, Macros selection on the -drop-down menu. -

- - - - - - - - - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

3.3.1 Multistage fitting

- - -

Here we describe how to string together several fits. To begin, create a fit as -explained earlier. We assume this fit is named “Fit 1”. The next step is to -copy the fit. This is achieved by right-clicking on the fit node in the the fit -tree, and selecting “Copy” option from the pop-up menu. Once this is done, -the fit can be pasted by selecting either “Paste Fit” or “Paste Linked Fit” -from the pop-up menu. We will link the fits manually for the sake of -instruction, so select “Paste Fit”. (“Paste Linked Fit” will do all of what -follows automatically.) Selecting “Paste Fit” will create “Fit 1_copy”, a -copy of “Fit 1” in the fit, which has the. The next step is to link the fits. -Select the new fit node on the fit tree. All aspects of the fit are duplicated -in the new fit, but so far are not associated with the original fit. -

-

In the “Parameters” panel, select the entire “Initial” column. Type “=Fit -1” and then press “Enter”. The “Initial” values of the parameters should -now read “=Fit 1:n”, where n is the index of the parameter. This brings -us to the linking syntax. A parameter in this fit can be linked to any other -parameter in any other fit with “=name:index” syntax. Here, “name” is the -name of another fit to which the link is made, and “index” is the index of a -parameter in that fit. If “:index” is omitted, it will default to the index -of the parameter one is linking from. A linked parameter uses the refined value -of the link as its initial value, or the initial value if the linked -parameter is not yet refined. An example of this is shown in Figure 3.4. -

-
-images/fig3-04 - -

Figure 3.4: An example of linked fits. The output of a converged fit will -be fed into the succeeding fit in the sequence as an input. - -

-

Now that we have a linked fit, we can change it in some aspect. We could delete -and replace the data set or phase, or we could or we can add parameter to see -if we can improve the fit, without modifying the configuration of the original -fit. Here we will add additional parameters to improve the fit. If our Ni -example was used and copied in this exercise, one can select Ni.stru phase -of “Fit 1_copy” and introduce parameter delta2 by inserting “@5” in -the appropriate box of the “Constraints” tab of that phase. This is a -quadratic atomic correlation factor, a parameter related to the correlated -motion of atoms, and as such should help in sharpening up the nearest neighbor -PDF peak in the model PDF profile. Highlight the fits on the fit tree by -holding down “Ctrl” on the keyboard while selecting each in sequence. -Alternately, select a single fit and hit “Ctrl”+“Shift”+“A” -simultaneously on the keyboard. Once the fits are selected, run them by -pressing the “gear” icon in the tool bar. Only the highlighted fits will be -executed. The fitting will proceed in stages, so the first fit is executed -first, and, after it is converged, the second one. After the fitting of the -sequence is over, you may plot the results in the same window by selecting both -data set nodes. Change the offset in the plotting window to 0 and plot -Gcalc versus r. Notable is a sharper nearest neighbor PDF peak in the -second fit, improving the fit to the Ni data compared to the “Fit 1” -achievement. -

-

We note here that there is also a linear atomic correlation factor delta1. -This one is appropriate to use in cases of high temperature, while delta2 -is more appropriate for the case of low temperatures. An alternative way to -include the correlated motion effects on PDF is to introduce sratio -parameter that defines low-r to high-r PDF peak ratio, and rcut -limit needs to be specified that defines a cutoff distance. The two approaches -of accounting for correlated motion should not be used simultaneously. See -the PDFgui publication and references therein for a more thorough description -of these parameters. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

3.3.2 Sequential fitting of incremental r-series

- - - -

In certain modeling situations the user could benefit from fitting a data set -through a series of refinements that differ one from another by the -corresponding fitting ranges. This could either be a case when upper -r-limit is to be changed incrementally, or when a fixed width r-window -is to be defined for a box-car fitting approach. An example of this when one -wants to study the details of the local- to average-structure crossover in a -complex material. PDFgui has a pre-written macro that automates the setup of -this type of refinement. We will illustrate these capabilities through a -simple Ni example. -

-

Generate a complete fit, including a phase and a dataset, as explained in -Creating a simple fit using a preexisting structure file. Select the fit from the fit tree. From the “Fits” menu, -select Macros, and choose “r-Series” option. The Current Action panel -will display simple setting requirements, arranged in two rows of three dialog -boxes each, that need to be filled with values to be specified by the user. An -example of this is shown in Figure Figure 3.5. -

-

The first row deals with the increment setup of the upper r of the -refinements. User should specify the first and the last fit maximum -r-value, and corresponding step (increment), all in units of Angstroms. In -the second row information is needed to specify the lower r refinement -limit. Again, the user sets the first and the last value, and step. This allows -for a box car of either fixed or variable width to be defined. If the second -row is left blank, the corresponding refinement series will be with -incremental maximum r only, and fixed lower limit. For the purpose of this -exercise lets perform incremental fitting of Ni-data with 4 steps total, and -fixed lower limit. To achieve this, type 5 for the first upper limit, 20 for -the last upper limit, and the step of 5 Angstroms. Leave the second row blank. -Once this is done, make sure that the Ni fit, which in this situation serves as -a template, is highlighted in the fit tree, and then click “OK” in the -current action panel. This will generate 4 new fits below the original fit, -and these four fits will constitute your series, with desired incremental -limits. Select all four of them and execute the refinement. Once the sequence -is done, you can review the results using the plot control. -

-
-images/fig3-05 - -

Figure 3.5: Appearance of the setup panel for specifying an incremental r-series -fit conditions. - -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

3.3.3 Sequential fitting of temperature series

- - - -

Frequently, one must handle a large number of data sets originating from a -single sample collected at various temperatures. One of the common modeling -schemes in such cases is to perform sequential fitting of such data series, -which is known to yield well behaved modeling parameters. PDFgui has a -pre-written macro that allows for this modeling situation to be accommodated. -

-

We will describe the procedure using an example of a temperature series of data -collected on LaMnO3 at various temperatures from 300 K to 1150 K at NPDF -instrument at LANSCE at Los Alamos National Laboratory. This material exhibits -Jahn-Teller (JT) order-disorder phase transition just above 700 K, where the -long range orbital order is lost at high temperature, but the local JT -distortion survives. The formal space group does not change at this transition. -

-

To begin, from the “File” menu use Open Project selection to open -lmo-template.dpp project from the tutorial directory. This project -consists of a fit called lmo-pbnm , which will serve as a template and -which contains Pbnm phase of LaMnO3 and a 300 K data set. The fit -refinement is set up to cover 1.7-19.5 Angstroms range, and all the parameter -values are set to their converged values for this temperature. The fit setup -uses isotropic ADPs for all atomic sites. In the same directory data -corresponding to various temperatures exist, in particular 300K.gr, -550K.gr, 650K.gr, 700K.gr, 720K.gr, 730K.gr, 740K.gr, -750K.gr, 800K.gr, 880K.gr, 980K.gr, 1050K.gr, 1100K.gr, -and 1150K.gr. We will establish a T-series fit sequence. Select Macros -from the “Fit” menu on the menu bar, and choose “Temperature Series”. The -current action panel will reflect the selection. A tool is provided that -allows for data sets to be added. Click on “Add” button. Using “Shift” and -mouse-select operation you should select all the data sets mentioned in the -above list, except the 300 K one, as this is already in the template fit, and -then press “Open”. All the data sets will be loaded. Since the files contain -meta-data, as mentioned earlier, the GUI is going to pick up temperature -information from the files. User should verify that the information is correct. -The data can be ordered by temperature by clicking the “Temperature” header. -

-
-images/fig3-06 - -

Figure 3.6: Setting up a T-series sequential refinement for LaMnO3. Ordering -by temperature will ensure that the fits are linked correctly. - -

-

Order the data by temperature (Figure 3.6), as otherwise the series of fits -that is to be automatically generated in the next step will be linked in an -arbitrary way in which the data were loaded, rather than to reflect the -scientific logic. There should be 13 data sets. Next, ensure that the template -fit is selected on the fit tree. If this is the case, the “OK” button becomes -clickable. Clicking on the “OK” button will generate a sequence of linked -fits in the fit tree in the order of the temperature increase. Each fit is -linked to the previous, except for the template fit for the 300 K data. -Highlight all the fits in the fit tree to start the sequential refinement of -the T-series. The results can then be displayed in Fit Control such that -various converged fit parameters are plotted versus temperature. -

-

In terms of the science behind the LaMnO3 example, it is interesting to plot -isotropic ADP of the oxygen at general position. Select all the phases on the -fit tree by selecting one and then hitting the “Control”, “Shift” and “A” -keys on your keyboard simultaneously. This will select all the phases at once. -On the plot control choose the temperature for x axis, and select the Uiso -of O2 (for example atom 20) for the y axis. Clicking “Plot” will display -the plot of Uiso(20) vs T. -

-
-images/fig3-07 - -

Figure 3.7: Displaying the refinement results as a function of external -parameter: T-series refinement of LaMnO3, example of isotropic ADP of -oxygen atom on general position in Pbnm setting. Notable are the offsets -just above 700 K (Jahn-Teller transition), and at around 1000 K when sample -converts from orthorhombic to rhombohedral symmetry. - -

-

Despite quite high temperatures, an onset of the static offset above the -transition temperature is clearly marked by this parameter, as apparent in -Figure 3.7. Curious user could repeat the same T-series refinement -restricting the refinement range upper limit to say 5-6 Angstroms and observe -the outcome. The refinement sequence execution should be very quick in this -case. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

3.3.4 Sequential fitting of doping series

- - - -

Fitting a series of PDF data that correspond to a set of samples with related -chemistry, such as various doping series, represents another important -sequential modeling aspect that is supported in PDFgui. -

-

We will describe the procedure using an example of a series of data collected -on LaMnO3 and series of Ca-doped LaMnO3 samples with various Ca content from 0 -to 0.28 at GEM instrument at ISIS, UK. To begin, from the “File” menu use -Open Project selection to open lcmo-template.dpp project from the -tutorial directory, which has an initial setup for this exercise. Note the -letter c in the file name, in contrast to the name used in the previous -example. This project consists of a fit called lcmo-pbnm, which will serve -as a template and which contains Pbnm phase of LaMnO3 and a 10 K data set, -x000t010q35.gr. The difference here with respect to the template used in -the previous example is that Ca sites are introduced in the structure, but are -assigned zero occupancy. However, existence of the Ca dopant species in the -structure of the template is essential for the macro to operate. Also, upper -limit used in Fourier transform for obtaining this set of data is 35 inverse -Angstroms, in contrast to 32 inverse Angstroms in previous example. Since -different instrument was used, the value of Qdamp is different than in -previous example. -

-
-images/fig3-08 - -

Figure 3.8: After loading of the Ca-doping data series of LaMnO3 system, proper -doping assignment needs to be carried out, as the doping levels introspected -from the file names in this example incorrectly reflect the scientific -situation. Note that dopant atom has to be present in the template seed used -to generate the linked sequence of fits. - -

-

In the same directory data corresponding to various Ca contents exist, -collected at 10 K temperature, in particular x004t010q35.gr, -x012t010q35.gr, x016t010q35.gr, x020t010q35.gr, x024t010q35.gr, -and x028t010q35.gr. It should be noted at this point that the data files do -not contain any relevant meta-data in the file headers. However, the doping -level is somehow encrypted into the file names. We will establish a doping -series fit sequence. Select Macros from the “Fit” menu on the menu bar, -and choose “Doping Series”. The current action panel will reflect the -selection. The base element and dopant need to be specified. A tool is provided -that allows for data sets to be added. Click on “Add” button. Using -“Shift” and mouse-select operation you should select all the data sets -mentioned in the above list, and then press “Open” button. All the data sets -will be loaded. The GUI will introspect both the file names and files -themselves in attempt to obtain the doping (or in previous example temperature) -information. Since the files do not contain meta-data, as mentioned earlier, -the GUI is going to pick up doping information from the file names. The user -should verify that the information is correct. In this particular case the -doping information will not be correctly picked up, as for example 004 from the -name is meant to be 0.04 doping, and the GUI would try to interpret it as 4.0 -doping. Similarly 028 would be interpreted as 28.0, while it was intended to -mean 0.28 doping. These values should be edited and fixed manually by clicking -on the corresponding values and simply typing in the correct values (Figure -Figure 3.8). The data can be ordered by doping by clicking the header. -After you are done with editing, order the data by doping, as otherwise the -series of fits that is to be automatically generated in the next step will be -linked in an arbitrary way in which the data were loaded, rather than to -reflect the scientific logic. There should be 6 data sets (with the initial -x=0.0 data set there will be 7 chained fits total after this setup is done). -Next, ensure that the template fit is selected on the fit tree. If this is the -case, the “OK” button becomes clickable. Clicking on the “OK” button will -generate a sequence of linked fits in the fit tree in the order of the Ca -content increase. Highlight all the fits in the fit tree to start the -sequential refinement of the doping series. -

-
-images/fig3-09 - -

Figure 3.9: Sequence of refined parameters, such as lattice constants, can be -plotted vs doping using PDFgui plotting facilities. Figure features lattice -parameter b in Pbnm space group setting for series of Ca-doped LaMnO3 -samples for doping concentrations between 0 and 0.28 at 10 K temperature. - -

-

After the convergence is achieved for all the fits in the fit tree, the results -can be displayed graphically such that various converged fit parameters are -plotted versus Ca content. An example is provided in Figure Figure 3.9 -featuring one of the lattice parameters. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

3.3.5 Advanced post-processing of sequential refinement

- - - - -

While PDFgui allows to collate data from a series of sequential -refinements, there are many data query options that are not -possible or very tedious with a GUI. A particularly tedious task would -be to extract bond lengths for every temperature refined in -a large series. The GUI could supply menus for these tasks, -but there are just too many options to serve them all. In fact, -the GUI just does not seem to be suitable interface and things -are much easier and more flexible to accomplish with Python scripts. -

-

The idea is to setup and run sequential refinement with PDFgui, but to -do complicated data extractions with simple Python scripts. -The PDFgui installation includes a ‘tui’ (Text User Interface) -module that allows simple access to the data in a PDFgui project. -

-

As a first example, let us assume that a converged sequential refinement -from Sequential fitting of temperature series has been saved under the same name as -lmo-template.ddp. -The following Python script extracts temperatures and refined -values of the lattice parameter c -

-
# python script
+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1.5 What is new

+ + + + +

Version 1.1, released March 2016

+ +

+ Improvements and modifications since the last major release 1.0-r3067 from + April 2009. +

+
+
Anaconda installer
+
+

+ PDFgui is now distributed as a pre-built package for Anaconda Python. + The program is available for all platforms supported by Anaconda, + i.e., for 32 and 64-bit Linux, Mac OS X, and for 32 and 64-bit + Windows. +

+
+
upgrade for recent GUI libraries
+
+

+ Source codes were updated to work with WX GUI toolkit 2.9 or later. + Fixed blacked-out text fields on Mac OS X. Fixed missing toolbar in + plot-windows on Mac OS X. +

+
+
select atoms menu
+
+

+ Added “Select Atoms” context menu to the Phase + Configuration and Phase Constraints panels. This selects atom rows by + a range of indices or by atom type. Added keyboard shortcut + / for activating the atom-selection dialog. +

+
+
small enhancements
+
+

+ Fixed problems with r-grid interpolation near data boundaries. + Allow use of CIF-defined space groups for symmetry constraints. Use + consistent numbering for parameters created by symmetry constraints. + Improved export data tool in plot windows to group y-arrays + that are on the same x grid. Enhanced supercell expansion to + also adjust the coordinate constraints. +

+
+
project moved to GitHub
+
+

+ PDFgui source repository was converted from subversion to a Git + repository at + https://github.com/diffpy/diffpy.pdfgui. Project now uses Git tags to define software release and version + data. +

+
+
Unicode support
+
+

+ Allow accented characters in project filenames and in folder paths + where located. Allow accented characters for naming the fit tree + items. Note that such projects are unlikely to work with older + versions of PDFgui. Fix failure to exit when there is some uncaught + error in the at-exit cleanup functions. +

+
+
PDFgui tests
+
+

+ PDFgui installation now includes built-in tests. Added facility to + test PDFgui and all its DiffPy components. Implemented automated + testing and generation of test coverage reports when sources on GitHub + change. +

+
+
bug fixes
+
+

+ Quite a few. Consult the code history at + https://github.com/diffpy/diffpy.pdfgui/commits. +

+
+
+ + +

Version 1.0, released April 2009

+ +

+ This section describes improvements and modifications since the last + beta-release 1.0b.1792 from December 2007. +

+
+
updates and installation
+
+

+ PDFgui can be installed or updated with a simple run of the + easy_install script. easy_install checks our online code repository + for any newer versions and takes care of their download and + installation. It can be also used to add future DiffPy components as + they become available. This should work for Linux, Mac and Windows. +

+
+
Windows installer
+
+

+ The updated Windows package includes full installation of Python 2.5 + and script for code updates. PDFgui can be installed under normal + Python2.5 tree if it has the easy_install script. +

+
+
particle shape correction stored with phase
+
+

+ The previous release of PDFgui had spherical shape correction factors + stored with PDF dataset. The new layout is more logical and allows + multi-phase refinements with separate shape corrections. +

+
+
step shape factor
+
+

+ Defined new shape factor that cuts off the simulated PDF at user + defined r-limit. +

+
+
cumulative Rw
+
+

+ Implemented calculation of cumulative Rw and option to show it in + PDFgui plot window. +

+
+
project post-processing
+
+

+ Implemented new module ‘tui’ (text user + interface) for simple access to the data in PDFgui project files. The + ‘tui’ module can be used in + easy-to-understand Python scripts for arbitrary data extraction or + conversion. It should be useful for project files with large + temperature or compositional series of PDF refinements. +

+
+
structure visualization
+
+

+ PDFgui can now show structures with any external structure viewer, + that accepts structure file as a command-line argument. +

+
+
space group representations
+
+

+ Added 249 space group representations in non-standard settings. The + new representations were generated using the + cctbx library and helpful hints + from Ralf W. Grosse-Kunstleve. +

+
+
symmetry constraints
+
+

+ Fixed issues with generation of symmetry requirements for the ADP + tensors. +

+
+
default ADP tensors
+
+

+ PDF contributions are not counted for atoms that have ADP tensors + Uij equal zero. Atoms are now inserted with a non-zero + Uij matrix. Added warning when a phase loaded from file has + atoms with zero ADPs. +

+
+
temperature series macro
+
+

+ The temperature series macro was broken for datasets at equal + temperature or when temperature contained decimal point. Improved file + and temperature sorting in the temperature series dialog. +

+
+
journal panel
+

Fixed shortcut key handling and font size issues.

+
startup option ‘--db-pdb
+
+

+ The new command-line option starts Python debugger on PDFgui crash + instead of displaying error report dialog. +

+
+
grid interpolation
+
+

+ Fixed problems with r-grid interpolation appearing due to round-off + errors. +

+
+
data load on Windows
+
+

+ Windows version could not read PDF datasets with NaN (not-a-number) + values in the dGr column, because NaN is not supported by the Windows + C-library. Added check for NaN-s before converting to float. +

+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

1.6 Community

+ + + + +

+ There are two Google groups for support and development of PDFgui and + other DiffPy software. Visit the links below for message archives or + instructions on subscription and posting. +

+
+
+ diffpy-users + https://groups.google.com/d/forum/diffpy-users +
+
+

+ Help on usage of PDFgui, PDFfit2 and other DiffPy packages. This group + should become a knowledge base of PDFgui user tips, tricks and + troubleshooting. Feel free to ask your question here. +

+
+
+ diffpy-dev + https://groups.google.com/d/forum/diffpy-dev +
+
+

+ For discussions about development and changes of PDFgui, PDFfit2 and + DiffPy library in general. +

+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

2 Quick start

+ + +

+ In this chapter the PDFgui layout is briefly described, followed by a + simple tutorial example, spanning the GUI functionality and aimed at + novice users. Users familiar with the basics can proceed to + Examples and tutorials, or use + PDFgui reference sheets. All the + files used in examples are available in the source distribution or can be + downloaded from the DiffPy website. +

+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

2.1 PDFgui layout

+ + +

+ Once PDFgui is invoked, a PDFgui window comes up. Its layout consists of a + “Menu Bar”, a “Tool Bar”, and a set of four panes. + The menu bar contains drop-down menus that provide various aspects of + PDFgui functionality. The tool bar features icons for commonly used + operations: creating a new project, opening an existing project, saving a + project, executing a refinement or calculation, stopping a refinement or + calculation, and making a quick plot. The four panes consist of the + “Fit Tree”, “Plot Control”, the“Current + Action” pane, and the “PDFfit2 Output” panel. These are + all shown in Figure 2.1. +

+

+ The fit tree is used in setting up a fit protocol. The plot control serves + the user’s needs for graphically displaying the fits, as well as + various fit-related parameters. The content of the current action panel + changes as the refinement is being set up. It is a functional panel + through which the user configures the fit attributes, sets the fit + constraints, reviews the fit settings, displays fitting results, and also + carries out other setup steps. The progress of the PDFfit2 refinement + engine is displayed in the PDFfit2 output panel. All panels except the + current action panel are dockable windows that can be dragged across the + screen, resized and arranged to accommodate the individual visual needs of + the user. The window layout can also be controlled via the + “View” drop-down menu on the menu bar. An important part of + the PDFgui operativity is also conveniently available through mouse + operations such as select and right-click. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

+ 2.2 Creating a simple fit using a preexisting structure file +

+ + + +

+ The purpose of this example is to familiarize the novice user with the + PDFgui basics. The goal is to create a simple fit of Ni PDF from a + preexisting structure file, associate a dataset with the refinement, + configure and execute a refinement, and display the result. Files to be + used in this exercise are Ni.stru and Ni-xray.gr (found in + the tutorial directory). To start, invoke PDFgui by clicking on the icon + on your desktop, selecting the program from your system’s program + menu, or by typing pdfgui in a terminal window. +

+

+ First a new fit needs to be established. In the fit tree right-click the + mouse button, and select New Fit. This will generate a new fit + called “Fit 1” in the fit tree. The name of the fit is + highlighted and editable, so you need only to start typing to give the fit + a new name. The current action panel will display the pages that will hold + the fit and the results output. Note that the same action could be + achieved by selecting the New Fit option from the + “Fits” drop-down menu on the menu bar. +

+

+ The next step in populating the fit tree is to load a structural model. + First, select the fit icon in the fit tree pane. Then, right-click the + mouse, invoking a drop-down menu. Select Insert Phase, which will + modify the current action panel. The same action could be performed from + the “Phases” drop-down menu on the menu bar by selecting + New Phase. In the current action panel options are offered to load + a structure from a file or to generate it from scratch. In this exercise a + preexisting structure file Ni.stru is to be loaded. +

+
+ + images/fig2-01 +
+

+ Figure 2.1: PDFgui window with fit tree and Plot Control panels to the + left and current action panel to the right. The fit tree panel features + the current fit and the loaded Ni structure which is selected. The + current action panel displays phase configuration within the + “Configure” tab. + +

+

+ Figure 2.1 shows the PDFgui appearance at this + stage of the exercise. The current action panel has three tabs, + “Configure”, “Constraints”, and + “Results” that could be selected using mouse. These will be + returned to later. The “Configure” panel displays + configuration information from the structure file. The top portion + contains lattice parameters, phase scale factor, and a set of parameters + intended to be used to account for correlated atomic motion effects that + typically sharpen the nearest neighbor PDF peak. These are delta1, + delta2, sratio, and rcut. The spdiameter and + stepcut parameters include scatterer size effects in the PDF. These + parameters will be described later. The bottom part of the panel contains + standard unit cell content related information such as atomic species, + their fractional coordinates, anisotropic ADPs, and site occupancies. +

+

+ The next step is to load an experimental data set to be fit. Selected the + fit and right-click to bring up the context menu. From the menu choose + Insert Data Set. The same action could be performed through the + “Data” menu on the menu bar. The current action panel changes + accordingly, giving an option for a data set to be loaded from a file. In + this exercise Ni PDF data obtained using synchrotron x-ray radiation + collected at 6-ID-D at the Advanced Photon Source is used. This is + contained in a file Ni-xray.gr, which is to be loaded. Note that + among the exercise files there is also a file Ni-neutron.gr, + obtained using neutron radiation at the GPPD diffractometer at the IPNS + facility at the Argonne National Laboratory. Both x-ray and neutron + datasets were collected at 300 K. +

+
+ + images/fig2-02 +
+

+ Figure 2.2: Appearance of a PDFgui window after a PDF dataset is + loaded. The Fit Tree panel features the current fit, loaded Ni + structure, and loaded Ni PDF dataset, G(r), which is selected. The + current action panel displays data set configuration within the + “Configure” tab. + +

+

+ Figure 2.2 shows the PDFgui appearance at this + stage of the exercise. The “Configure” panel displays + configuration information from the data file. It should be noted that + depending on the software used to prepare the experimental PDF from the + raw data, the file may (or may not) contain meta-data reflecting the + experimental conditions and configuration. For example, software PDFgetX2 + and PDFgetN, which can be used to prepare PDFs from x-ray and neutron + total scattering experiments respectively, supply meta-data in the header + of the data file. PDFgui reads this information and fills the appropriate + fields in the data set configuration panel. Caution should be exercised by + the user to verify that these data indeed correspond to the experimental + conditions. In the present example, x-ray radiation is used, and so the + x-ray selection is turned on for the scatterer type. The data range, fit + range, data scale factor, maximum Q value used in Fourier transform to + obtain the experimental PDF and the experiment specific parameters are + displayed. Parameters describing experimental resolution effects, Qdamp + and Qbroad, and experimental conditions, such as temperature and doping + (used for bookkeeping and for parametric plots) are also shown. If no + meta-data are present in a data file, this information should be supplied + by the user. Note also that the changes occurred at this stage in the plot + control panel, allowing user to plot the data. This is achieved by + selecting r in the X-choice box and Gobs (the observed G(r)) + in the Y-list box and then pressing the “Plot” button. Since + no fitting has occurred so far, an attempt to plot calculated PDF profile + or a difference yields a blank plot. The data can also be displayed by + clicking the rightmost “quick-plot” button in the tool bar. +

+
+ + images/fig2-03 +
+

+ Figure 2.3: Adjusting data set related configuration. +

+

+ Having specified the initial structure to be refined, and the data set to + be fit, we proceed to the refinement setup. First we adjust the initial + parameters and variables, and set up the constraints. The adjustments and + constraint setup are done on both the experimental data and the refined + structure levels, toggling between the corresponding + “Configure” and “Constraints” tabs. In the present + example the data related setup will be done first. +

+

+ Click on the data set node (Ni-xray.gr) in the fit tree. In + Figure 2.3 the “Data Set + Configuration” panel is shown. We will adjust the fitting range, as + well as other parameters that reflect the experimental conditions. Since + there is no physical information in the region of r below the + nearest neighbor PDF peak position (as seen in the plot), and since this + region is often affected by noise and experimental artifacts, it is wise + to exclude it from fitting. We therefore set the value of the lower + boundary of the fitting range to 1.7. (Note that the units are Angstroms). + In addition, we set Qdamp parameter to a more realistic starting + value of 0.08. This is an instrument-dependent parameter is typically + obtained through a conventional calibration process at each PDF experiment + using a standard sample such as Ni or Si. Next, we select the + “Constraints” tab, and type @1 into the “Scale + Factor” edit box. This will assign refinement parameter 1 to the + data scale factor. Note that this is the syntax used for assigning the + refinement parameters in PDFfit2 engine. Similarly, assign parameter 2 to + Qdamp by inserting @2 into the appropriate edit box. This is + illustrated in Figure Figure 2.4. +

+
+ + images/fig2-04 +
+

+ Figure 2.4: Setting up the refinement parameters and constraints. + +

+

+ Further, we set constraints related to the structural model, by selecting + the phase node (Ni.stru) on the fit tree, adjusting the initial + parameter values if necessary (not done here), and proceeding to the + “Constraints” tab. We note that the phase configuration was + performed automatically when the structure file was loaded. We assign the + refinement parameter 3 to all three lattice constants, a, b, and c, + reflecting the fact that the structure is cubic. Isotropic ADPs are + assigned to all Ni atoms in the refined cell as refinement parameter 4. + This can conveniently be done by highlighting the “u11”, + “u22” and “u33” cells for all four atoms, and + typing @4 and then pressing “Enter” on your keyboard. + The outcome is shown in Figure Figure 2.5. +

+ +
+ + images/fig2-05 +
+

+ Figure 2.5: Setting up the refinement parameters and constraints. + +

+

+ Note that constrained parameters cannot be adjusted on the + “Configuration” panel since they are no longer independent. It + should also be noted that as a part of the PDFfit2 syntax a refinement + parameter can also be defined as a math expression + f(@n1,@n2,@n3,...) where @n1 stands for fitted parameter, + and n1, n2,... are arbitrary positive integers enumerating + the parameters. This allows simple linking of related variables. For + example, since cell lengths a, b, and c are all expressed as @3, + the refined structure will remain cubic. Also note that the enumeration of + the parameters can be arbitrary, enumeration does not have to follow any + particular order. The quantities within a fit that are enumerated with the + same number will be assigned the same parameter, hence caution should be + exercised to avoid unintentional assignment of the same parameter to + physically different quantities. Automatic parameter assignment (see + further below) is done in such a way as to disallow for such situations to + happen. If assignment is done in part manually, in particular for complex + setups, it is recommended to verify that the parameter assignment is done + correctly. +

+
+ + images/fig2-06 +
+

+ Figure 2.6: Reviewing the fit parameters and conditions. +

+

+ The setup for the present example is now completed. By selecting the fit + node on the fit tree the current action window shows + “Parameters” tab, which displays the used refinement + parameters for review, Figure 2.6. It shows the + initial values, and allows for updates and for refinement parameters to be + released or fixed depending on whether the corresponding + “Fixed” box is unchecked or checked, respectively. The + “Refined” column, which is currently empty, will be populated + with the refined values of the parameters with the fit completes. If the + initial parameter values are to be changed, using “Apply + parameters” button will update the values of the parameters on all + relevant “Configuration” panels. The refinement is executed by + clicking the “gear” icon on the tool bar. The refinement can + be stopped prematurely by clicking on the “stop” icon on the + tool bar. During the refinement the refinement progress will be directly + reported in the PDFfit2 Output panel. This is illustrated in + Figure 2.7. +

+
+ + images/fig2-07 +
+

+ Figure 2.7: While the refinement is running, the refinement progress is + displayed in the PDFfit2 Output panel. + +

+

+ After the fitting is completed, the fit summary is provided in the + “Results” tab of the current action panel associated with the + fit node. Similarly, if the “Results” tab is displayed when + Ni.stru or Ni-xray.gr are selected, values of all + corresponding refined parameters for the converged model are displayed. +

+

+ If the fit results are acceptable, one or more refined values could be + copied to become new initial parameters for possible further refinement, + where appropriate. This is be done in the “Parameters” tab of + the fit by highlighting refined parameters to be copied, right-clicking, + and and selecting Copy Refined To Initial. This is illustrated in + Figure 2.8. Note that you loose the original + starting values when copying values in this way, which may make it + difficult to reproduce the fit. +

+
+ + images/fig2-08 +
+

+ Figure 2.8: Updating the set of initial values of refined parameters. + +

+

+ The fit can be displayed graphically by clicking at the “quick + plot” icon on the tool bar. Alternatively, desired items to be + displayed can be selected from the plot control and plotted on the screen. + Depending on whether the structure or the data are selected on the fit + tree, either refined structural parameters or the experiment related + parameters and fit could be plotted. An example of the fit display is + shown in Figure 2.9, and a selected parameter + plot vs iteration step in Figure 2.10. If the + plotting window remains open while the fitting is in progress, the content + will be updated after each fit iteration. +

+
+ + images/fig2-09 +
+

+ Figure 2.9: An example of PDFgui plotting capabilities: displaying a + fit. + +

+
+ + images/fig2-10 +
+

+ Figure 2.10: An example of PDFgui plotting capabilities: displaying a + parameter. + +

+

+ PDFgui is furnished with “Journal” capability, which can be + found under the “View” menu, and represents a convenient way + to archive project-related notes, as illustrated in + Figure 2.11. These notes can be exported as a + text file, or saved along with the entire project for future reference. +

+
+ + images/fig2-11 +
+

+ Figure 2.11: Using “Journal” feature can be a convenient + way for taking notes. + +

+

+ The project can be saved at any stage in its present configuration through + choice of Save Project as or Save Project as appropriate + from the “File” drop-down menu. The PDFgui project file has + “ddp” extension. In addition to saving a project, various + parts of the project, both structure related and data related, can be + exported to external files by making an appropriate selection from the + “Phases” and “Data” drop-down menus. The phases + (starting or converged) can be saved in one of many formats. The model PDF + profile can be exported through “Data” menu and will be saved + as a five-column “.fgr” file. The first four columns are + r, G(r), dr, and dG(r), and the fifth column + is the difference curve between the data and the model. Note that the + model PDF and the difference are only calculated within the user-specified + fitting range. +

+ +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

3 Examples and tutorials

+ + + +

+ In this chapter we present series of examples and tutorials aimed at users + already comfortable with the GUI, to provide training in advanced GUI + features designed for most common modeling situations, such as building + the structure from scratch, calculating the PDF based on a given + structure, linking fits, and creating and executing a series of fits on a + sequence of data sets. +

+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

3.1 Building structure model using crystal symmetry

+ + + +

+ The purpose of this example is to demonstrate to the user the symmetry + expansion capabilities of PDFgui. The goal is again to create a simple fit + of Ni PDF, but this time from scratch rather than from a preexisting + structure file. The focus will be on the symmetry expansion of the + structure, and the steps that are described earlier in + Creating a simple fit using a preexisting structure file + are left for the user to recreate. File to be used in this exercise is + Ni-xray.gr. To start, invoke PDFgui. +

+

+ To begin, a new fit again needs to be established by right-clicking the + mouse button on the fit tree pane, and selecting New Fit. This will + generate a new fit called Fit 1 as in the previous example. The next step + in populating the fitting tree is to introduce a structural model. This + time a new phase will be added and the model built up from scratch. Select + the fit icon in the Fit Tree pane. Then right-click the mouse and select + Insert Phase, which will modify the current action panel. In the + current action panel options are offered to load a structure from a file + or to generate it from scratch. Select “New” to build up + structure from scratch. The Fit Tree will be populated with a new item + “New Phase”. Rename this phase to “Ni fcc”. The + current action panel now displays default phase configuration with + “dummy” values and no atoms. Edit the lattice parameters and + set them to reflect the symmetry, in this case set the lengths to 3.52 + Angstroms and all the angles to 90 degrees. Pressing “Tab” on + the keyboard will take you from one form-field to the next. To introduce + new atoms right-click with your mouse onto elem tab in the Phase + Constraints grid, and select desired number of atoms in the asymmetric + unit via the dialog box that pops up. For the Ni case, select one row + only. A new row will then show up in the table and the name of the element + will be highlighted. Type in Ni for the element name. It is + important that the element name is typed in correctly, as this is further + used to search a database for the scattering characteristics of that + site(1). Further, highlight cells in the + u11, u22, and u33 columns and type in the initial + value 0.0025. +

+ +

+ Now right-click with the mouse on the element name, and select + “Expand space group...” option. A dialog box will appear, as + shown in Figure 3.1, requesting space group + information and the choice of origin. Choose “Fm-3m” in the + choice box and hit enter. You can also type in the choice box + “Fm-3m” or “225”, the space group number. This + will expand the unit cell to four Ni sites with the proper symmetry. +

+
+ + images/fig3-01 +
+

+ Figure 3.1: Expanding the unit cell using space group information. + +

+

+ In order to set the symmetry constraints for the refinement, select + “Constraints” tab, highlight all the atoms, and right-click to + invoke a menu. Note that hitting “Control” and “A” + simultaneously will select all the atoms if the grid is active. (If the + fit tree is active, it will select all tree items). Click on + “Symmetry constraints...”, and a dialog box will appear asking + for the space group to be used and whether you want the positions and/or + the thermal parameters to be constrained, as shown in + Figure 3.2. The default is to use the space + group used for expansion, and to constrain everything according to the + symmetry. Since all the positions are special, these will not be refinable + by symmetry, and the thermal parameters will be isotropic. The program + will assign parameters according to symmetry using default names that can + be renamed and/or reassigned by the user. To be consistent with the naming + from the first example, one could assign the lattice parameters as + @3 and the isotropic ADPs as @4. Note that parameters can be + quickly renamed or consolidated in the “Parameters” panel of + the fit node using the right-click menu. It is important to note that the + table reflecting constraints is the only place that program refers + to for the symmetry. What is written there will be used, and if the table + is tampered with, then the original symmetry obtained using symmetry + expansion feature will not be preserved. Therefore, the expansion + tool represents a convenience tool and nothing more than that. The + remaining steps of this example are identical to these described in + Creating a simple fit using a preexisting structure file. +

+
+ + images/fig3-02 +
+

+ Figure 3.2: Setting up symmetry constraints to be used in a refinement. + +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

3.2 Calculating PDF from a structure

+ + +

+ There is often a need for obtaining a calculated PDF profile for a given + structure instead of performing a fit. In order to carry out a + calculation, an underlying structure needs to be specified. This can + either be loaded from a file or generated from scratch. Suppose that we + have a Ni structure populating a fit tree using steps described in either + Creating a simple fit using a preexisting structure file + or in + Building structure model using crystal symmetry, and that we would like to calculate Ni PDF using neutron radiation. + Highlight the Ni structure on fit tree. Either right-click and select + Insert Calculation or select New Calculation from + “Calculation” menu. The current action panel will display + information very similar to that when a data set is loaded, as shown in + Figure 3.3. +

+
+ + images/fig3-03 +
+

+ Figure 3.3: An example of the calculation configuration panel. + +

+

+ Now specify conditions to be used for the calculation, such as radiation + type, calculation range and corresponding r-grid size, as well as + instrument resolution and maximum momentum transfer parameters. For the + later two, the default values of parameters could be used, or values could + be specified that closely mimic the experimental conditions on some + particular instrument of interest. After the conditions are set, the gear + icon on the tool bar can be used to execute the calculation (or + alternatively select Run Selected Calculation from the + “Calculations” menu). For our exercise, select + Neutron scatterer type. To mimic the experimental data used earlier + in the tutorial, select for example 0.01 for the r-grid size, and + use 0.08 and 25.0 for resolution and maximum momentum transfer parameters + respectively. Execute the calculation and observe the result by clicking + on the quick plot icon on the tool bar. To export the calculated PDF, use + the Export Selected Calculation choice on the + “Calculations” menu. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

3.3 Sequential fitting

+ + +

+ In many practical situations there is a need to set a series of + refinements that are linked in a sequence. In what follows we will + describe multi-stage fitting capabilities of PDFgui, followed by + description of three pre-made macros that implement sequential fitting: + fitting of r-series on a single data set, temperature series on a + set of data corresponding to various temperatures, and a doping series on + a set of data corresponding to samples whose chemical content changes in + some systematic way. These macros can be accessed from the menu bar, + “Fits” menu, Macros selection on the drop-down menu. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

3.3.1 Multistage fitting

+ + +

+ Here we describe how to string together several fits. To begin, create a + fit as explained earlier. We assume this fit is named “Fit 1”. + The next step is to copy the fit. This is achieved by right-clicking on + the fit node in the the fit tree, and selecting “Copy” option + from the pop-up menu. Once this is done, the fit can be pasted by + selecting either “Paste Fit” or “Paste Linked Fit” + from the pop-up menu. We will link the fits manually for the sake of + instruction, so select “Paste Fit”. (“Paste Linked + Fit” will do all of what follows automatically.) Selecting + “Paste Fit” will create “Fit 1_copy”, a copy of + “Fit 1” in the fit, which has the. The next step is to link + the fits. Select the new fit node on the fit tree. All aspects of the fit + are duplicated in the new fit, but so far are not associated with the + original fit. +

+

+ In the “Parameters” panel, select the entire + “Initial” column. Type “=Fit 1” and then press + “Enter”. The “Initial” values of the parameters + should now read “=Fit 1:n”, where n is the index of the + parameter. This brings us to the linking syntax. A parameter in this fit + can be linked to any other parameter in any other fit with + “=name:index” syntax. Here, “name” is the name of + another fit to which the link is made, and “index” is the + index of a parameter in that fit. If “:index” is omitted, it + will default to the index of the parameter one is linking from. A linked + parameter uses the refined value of the link as its initial value, + or the initial value if the linked parameter is not yet refined. An + example of this is shown in Figure 3.4. +

+
+ + images/fig3-04 +
+

+ Figure 3.4: An example of linked fits. The output of a converged fit + will be fed into the succeeding fit in the sequence as an input. + +

+

+ Now that we have a linked fit, we can change it in some aspect. We could + delete and replace the data set or phase, or we could or we can add + parameter to see if we can improve the fit, without modifying the + configuration of the original fit. Here we will add additional parameters + to improve the fit. If our Ni example was used and copied in this + exercise, one can select Ni.stru phase of “Fit 1_copy” + and introduce parameter delta2 by inserting “@5” in the + appropriate box of the “Constraints” tab of that phase. This + is a quadratic atomic correlation factor, a parameter related to the + correlated motion of atoms, and as such should help in sharpening up the + nearest neighbor PDF peak in the model PDF profile. Highlight the fits on + the fit tree by holding down “Ctrl” on the keyboard while + selecting each in sequence. Alternately, select a single fit and hit + “Ctrl”+“Shift”+“A” simultaneously on + the keyboard. Once the fits are selected, run them by pressing the + “gear” icon in the tool bar. Only the highlighted fits will be + executed. The fitting will proceed in stages, so the first fit is executed + first, and, after it is converged, the second one. After the fitting of + the sequence is over, you may plot the results in the same window by + selecting both data set nodes. Change the offset in the plotting window to + 0 and plot Gcalc versus r. Notable is a sharper nearest + neighbor PDF peak in the second fit, improving the fit to the Ni data + compared to the “Fit 1” achievement. +

+

+ We note here that there is also a linear atomic correlation factor + delta1. This one is appropriate to use in cases of high + temperature, while delta2 is more appropriate for the case of low + temperatures. An alternative way to include the correlated motion effects + on PDF is to introduce sratio parameter that defines low-r + to high-r PDF peak ratio, and rcut limit needs to be + specified that defines a cutoff distance. The two approaches of accounting + for correlated motion should not be used simultaneously. See the + PDFgui publication and references therein for a more thorough description + of these parameters. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

3.3.2 Sequential fitting of incremental r-series

+ + + +

+ In certain modeling situations the user could benefit from fitting a data + set through a series of refinements that differ one from another by the + corresponding fitting ranges. This could either be a case when upper + r-limit is to be changed incrementally, or when a fixed width + r-window is to be defined for a box-car fitting approach. An + example of this when one wants to study the details of the local- to + average-structure crossover in a complex material. PDFgui has a + pre-written macro that automates the setup of this type of refinement. We + will illustrate these capabilities through a simple Ni example. +

+

+ Generate a complete fit, including a phase and a dataset, as explained in + Creating a simple fit using a preexisting structure file. Select the fit from the fit tree. From the “Fits” menu, + select Macros, and choose “r-Series” option. The + Current Action panel will display simple setting requirements, arranged in + two rows of three dialog boxes each, that need to be filled with values to + be specified by the user. An example of this is shown in Figure + Figure 3.5. +

+

+ The first row deals with the increment setup of the upper r of the + refinements. User should specify the first and the last fit maximum + r-value, and corresponding step (increment), all in units of + Angstroms. In the second row information is needed to specify the lower + r refinement limit. Again, the user sets the first and the last + value, and step. This allows for a box car of either fixed or variable + width to be defined. If the second row is left blank, the corresponding + refinement series will be with incremental maximum r only, and + fixed lower limit. For the purpose of this exercise lets perform + incremental fitting of Ni-data with 4 steps total, and fixed lower limit. + To achieve this, type 5 for the first upper limit, 20 for the last upper + limit, and the step of 5 Angstroms. Leave the second row blank. Once this + is done, make sure that the Ni fit, which in this situation serves as a + template, is highlighted in the fit tree, and then click “OK” + in the current action panel. This will generate 4 new fits below the + original fit, and these four fits will constitute your series, with + desired incremental limits. Select all four of them and execute the + refinement. Once the sequence is done, you can review the results using + the plot control. +

+
+ + images/fig3-05 +
+

+ Figure 3.5: Appearance of the setup panel for specifying an incremental + r-series fit conditions. + +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

3.3.3 Sequential fitting of temperature series

+ + + +

+ Frequently, one must handle a large number of data sets originating from a + single sample collected at various temperatures. One of the common + modeling schemes in such cases is to perform sequential fitting of such + data series, which is known to yield well behaved modeling parameters. + PDFgui has a pre-written macro that allows for this modeling situation to + be accommodated. +

+

+ We will describe the procedure using an example of a temperature series of + data collected on LaMnO3 at various temperatures from 300 K to 1150 K at + NPDF instrument at LANSCE at Los Alamos National Laboratory. This material + exhibits Jahn-Teller (JT) order-disorder phase transition just above 700 + K, where the long range orbital order is lost at high temperature, but the + local JT distortion survives. The formal space group does not change at + this transition. +

+

+ To begin, from the “File” menu use + Open Project selection to open lmo-template.dpp project from + the tutorial directory. This project consists of a fit called + lmo-pbnm , which will serve as a template and which contains + Pbnm phase of LaMnO3 and a 300 K data set. The fit refinement is + set up to cover 1.7-19.5 Angstroms range, and all the parameter values are + set to their converged values for this temperature. The fit setup uses + isotropic ADPs for all atomic sites. In the same directory data + corresponding to various temperatures exist, in particular 300K.gr, + 550K.gr, 650K.gr, 700K.gr, 720K.gr, + 730K.gr, 740K.gr, 750K.gr, 800K.gr, + 880K.gr, 980K.gr, 1050K.gr, 1100K.gr, and + 1150K.gr. We will establish a T-series fit sequence. Select + Macros + from the “Fit” menu on the menu bar, and choose + “Temperature Series”. The current action panel will reflect + the selection. A tool is provided that allows for data sets to be added. + Click on “Add” button. Using “Shift” and + mouse-select operation you should select all the data sets mentioned in + the above list, except the 300 K one, as this is already in the template + fit, and then press “Open”. All the data sets will be loaded. + Since the files contain meta-data, as mentioned earlier, the GUI is going + to pick up temperature information from the files. User should verify that + the information is correct. The data can be ordered by temperature by + clicking the “Temperature” header. +

+
+ + images/fig3-06 +
+

+ Figure 3.6: Setting up a T-series sequential refinement for LaMnO3. + Ordering by temperature will ensure that the fits are linked correctly. + +

+

+ Order the data by temperature (Figure 3.6), as + otherwise the series of fits that is to be automatically generated in the + next step will be linked in an arbitrary way in which the data were + loaded, rather than to reflect the scientific logic. There should be 13 + data sets. Next, ensure that the template fit is selected on the fit tree. + If this is the case, the “OK” button becomes clickable. + Clicking on the “OK” button will generate a sequence of linked + fits in the fit tree in the order of the temperature increase. Each fit is + linked to the previous, except for the template fit for the 300 K data. + Highlight all the fits in the fit tree to start the sequential refinement + of the T-series. The results can then be displayed in Fit Control such + that various converged fit parameters are plotted versus temperature. +

+

+ In terms of the science behind the LaMnO3 example, it is interesting to + plot isotropic ADP of the oxygen at general position. Select all the + phases on the fit tree by selecting one and then hitting the + “Control”, “Shift” and “A” keys on + your keyboard simultaneously. This will select all the phases at once. On + the plot control choose the temperature for x axis, and select the + Uiso of O2 (for example atom 20) for the y axis. Clicking + “Plot” will display the plot of Uiso(20) vs T. +

+
+ + images/fig3-07 +
+

+ Figure 3.7: Displaying the refinement results as a function of external + parameter: T-series refinement of LaMnO3, example of isotropic ADP of + oxygen atom on general position in Pbnm setting. Notable are the + offsets just above 700 K (Jahn-Teller transition), and at around 1000 K + when sample converts from orthorhombic to rhombohedral symmetry. + +

+

+ Despite quite high temperatures, an onset of the static offset above the + transition temperature is clearly marked by this parameter, as apparent in + Figure 3.7. Curious user could repeat the same + T-series refinement restricting the refinement range upper limit to say + 5-6 Angstroms and observe the outcome. The refinement sequence execution + should be very quick in this case. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

3.3.4 Sequential fitting of doping series

+ + + +

+ Fitting a series of PDF data that correspond to a set of samples with + related chemistry, such as various doping series, represents another + important sequential modeling aspect that is supported in PDFgui. +

+

+ We will describe the procedure using an example of a series of data + collected on LaMnO3 and series of Ca-doped LaMnO3 samples with various Ca + content from 0 to 0.28 at GEM instrument at ISIS, UK. To begin, from the + “File” menu use Open Project selection to open + lcmo-template.dpp project from the tutorial directory, which has an + initial setup for this exercise. Note the letter c in the file + name, in contrast to the name used in the previous example. This project + consists of a fit called lcmo-pbnm, which will serve as a template + and which contains Pbnm phase of LaMnO3 and a 10 K data set, + x000t010q35.gr. The difference here with respect to the template + used in the previous example is that Ca sites are introduced in the + structure, but are assigned zero occupancy. However, existence of the Ca + dopant species in the structure of the template is essential for the macro + to operate. Also, upper limit used in Fourier transform for obtaining this + set of data is 35 inverse Angstroms, in contrast to 32 inverse Angstroms + in previous example. Since different instrument was used, the value of + Qdamp is different than in previous example. +

+
+ + images/fig3-08 +
+

+ Figure 3.8: After loading of the Ca-doping data series of LaMnO3 + system, proper doping assignment needs to be carried out, as the doping + levels introspected from the file names in this example incorrectly + reflect the scientific situation. Note that dopant atom has to be + present in the template seed used to generate the linked sequence of + fits. + +

+

+ In the same directory data corresponding to various Ca contents exist, + collected at 10 K temperature, in particular x004t010q35.gr, + x012t010q35.gr, x016t010q35.gr, x020t010q35.gr, + x024t010q35.gr, and x028t010q35.gr. It should be noted at + this point that the data files do not contain any relevant meta-data in + the file headers. However, the doping level is somehow encrypted into the + file names. We will establish a doping series fit sequence. Select + Macros from the “Fit” menu on the menu bar, and choose + “Doping Series”. The current action panel will reflect the + selection. The base element and dopant need to be specified. A tool is + provided that allows for data sets to be added. Click on “Add” + button. Using “Shift” and mouse-select operation you should + select all the data sets mentioned in the above list, and then press + “Open” button. All the data sets will be loaded. The GUI will + introspect both the file names and files themselves in attempt to obtain + the doping (or in previous example temperature) information. Since the + files do not contain meta-data, as mentioned earlier, the GUI is going to + pick up doping information from the file names. The user should verify + that the information is correct. In this particular case the doping + information will not be correctly picked up, as for example 004 from the + name is meant to be 0.04 doping, and the GUI would try to interpret it as + 4.0 doping. Similarly 028 would be interpreted as 28.0, while it was + intended to mean 0.28 doping. These values should be edited and fixed + manually by clicking on the corresponding values and simply typing in the + correct values (Figure Figure 3.8). The data + can be ordered by doping by clicking the header. After you are done with + editing, order the data by doping, as otherwise the series of fits that is + to be automatically generated in the next step will be linked in an + arbitrary way in which the data were loaded, rather than to reflect the + scientific logic. There should be 6 data sets (with the initial x=0.0 data + set there will be 7 chained fits total after this setup is done). Next, + ensure that the template fit is selected on the fit tree. If this is the + case, the “OK” button becomes clickable. Clicking on the + “OK” button will generate a sequence of linked fits in the fit + tree in the order of the Ca content increase. Highlight all the fits in + the fit tree to start the sequential refinement of the doping series. +

+
+ + images/fig3-09 +
+

+ Figure 3.9: Sequence of refined parameters, such as lattice constants, + can be plotted vs doping using PDFgui plotting facilities. Figure + features lattice parameter b in Pbnm space group setting + for series of Ca-doped LaMnO3 samples for doping concentrations between + 0 and 0.28 at 10 K temperature. + +

+

+ After the convergence is achieved for all the fits in the fit tree, the + results can be displayed graphically such that various converged fit + parameters are plotted versus Ca content. An example is provided in Figure + Figure 3.9 + featuring one of the lattice parameters. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

+ 3.3.5 Advanced post-processing of sequential refinement +

+ + + + +

+ While PDFgui allows to collate data from a series of sequential + refinements, there are many data query options that are not possible or + very tedious with a GUI. A particularly tedious task would be to extract + bond lengths for every temperature refined in a large series. The GUI + could supply menus for these tasks, but there are just too many options to + serve them all. In fact, the GUI just does not seem to be suitable + interface and things are much easier and more flexible to accomplish with + Python scripts. +

+

+ The idea is to setup and run sequential refinement with PDFgui, but to do + complicated data extractions with simple Python scripts. The PDFgui + installation includes a ‘tui’ (Text User + Interface) module that allows simple access to the data in a PDFgui + project. +

+

+ As a first example, let us assume that a converged sequential refinement + from + Sequential fitting of temperature series + has been saved under the same name as lmo-template.ddp. The + following Python script extracts temperatures and refined values of the + lattice parameter c +

+
+
+# python script
 from diffpy.pdfgui import tui             # import the tui library
 prj = tui.LoadProject('lmo-template.ddp') # read PDFgui project file
 temperatures = prj.getTemperatures()      # list of temperature values
@@ -1940,1095 +3178,2385 @@ 

3.3.5 Advanced post-processing of sequential refinement

- -

Save the example above to a file, say “lmo_refined_c.py” and run -it as -

-
python lmo_refined_c.py
-
-

Note that the script cannot load the unmodified lmo-template.ddp file, -because it does not have any refinement results. -

- -

The tutorial directory contains an advanced script -“tui_mno_bond_lengths.py”, which extracts the shortest -Mn-O bond lengths from the same PDFgui project. Please, see -the comments in the script for detailed explanation. -

-

To learn more about the tui module and about the objects -and functions that it returns, please see the API -documentation for diffpy.pdfgui at -http://docs.danse.us/diffraction/diffpy.pdfgui/. -

-

Feel free to ask at the -diffpy-users -group if you need help with data extracting scripts. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

3.4 Nanoparticle structure

- - - -

Determining the structure of a nanoparticle is notoriously difficult. -Diffraction experiments on nanoparticle samples yield broad diffraction -patterns that are hard to analyze using conventional crystallographic -approaches. The PDF analysis of nanoparticles is becoming increasingly common. -The PDF of a nanoparticle features sharp peaks conveying structural -information. The PDF signal gets damped at higher distances due to the -diminished number of pairs in the nanoparticle structure that contribute to -those distances. For certain simpler cases when nanoparticles can be assumed to -have spherical shape, characteristic parameters such as nanoparticle diameter -can be obtained. -

-

PDFgui is capable of modeling the effect of the finite nanoparticle size using -a spherical shape factor. Relevant PDF parameter is spdiameter which is the -diameter of the nanoparticle. This parameter is highly correlated with various -other parameters one would like to refine, such as anisotropic ADPs, scale -factors, correlated motion parameters and so on. The refinement procedure is -therefore rather delicate and the solutions are not as robust as we are used to -in cases of crystalline materials. -

-

To illustrate the program capabilities we present a case of CdSe nanoparticle -approximately 3nm in size. It useful to have PDF data for a crystalline -reference, where available/applicable. In this exercise we start from a -prepared project file CdSe-nano.ddp. This project contains two fits: the -first one is a bulk CdSe reference, and the other pertains to the CdSe -nanoparticle. For consistency the PDFs of both bulk and nano samples were -obtained using Qmax of 14 inverse Angstroms, although the bulk material PDF -could have been processed using a higher value. Synchrotron x-ray radiation -was used to obtain the data at 300 K, based on an experiment carried out at -6-ID-D at the Advanced Photon Source at Argonne National Laboratory. The -structure used for both data sets is wurtzite, space group P63mc. From -calibrations on Ni standard Qdamp value of 0.0486 was obtained and is used -here. -

-

We first carry out a refinement on the bulk reference. This is carried -out over a range from 1.7 to 19.8 Angstroms, using 7 parameters: lattice -parameters a and c (@1 and @2 respectively), selenium z -fractional coordinate (@11), isotropic ADPs for Cd and Se (@21 and -@23 respectively), the data scale factor (@100), and finally -correlated motion related quadratic term coefficient delta2 (@200). -The converged fit results in parameter values that can be further used for -reference when modeling the nanoparticle data. We note that while the fit is -reasonable, the values of the isotropic ADPs are enlarged. The fit can be -further improved if anisotropic ADPs are introduced, although the z-direction -related components will remain enlarged due to the stacking disorder present in -the structure. The referent value of 5.69 for delta2 will be used as a -starting value for the nanoparticle fit. -

-

In the nanoparticle refinement we will use the same starting values for all the -parameters, except for delta2 and the nanoparticle diameter, -spdiameter. The former is set to 5.69, and the later to 25 Angstroms. In -other cases an approximate value of the spherical nanoparticle size is usually -known, and it is the best to start from a reasonably good guess. Refining the -nanoparticle data reveals nanoparticle diameter of approximately 30 Angstroms, -as further illustrated in Figure 3.10. Enlarged values of isotropic ADPs are -again observed, and the fit is reasonably good. Further improvements can be -obtained by introducing anisotropic ADPs, where again values related to the -z-direction will remain abnormally large most probably due to the stacking -related disorder. A detailed description of this system and successful -PDF modeling can be found in this publication: -Quantitative size-dependent structure and strain determination of CdSe nanoparticles using atomic pair distribution function analysis. -

-
-images/fig3-10 - -

Figure 3.10: Fitting the structure of a nanoparticle: 3nm CdSe -nanoparticle example. - -

-

In general, a successful fitting scenario depends on particular details of a -structural problem one is determined to solve. The problem of determining the -structure of a nanoparticle remains difficult. PDFgui is not intended to -necessarily provide the solution, it is rather a helpful tool in the -process of determining new details and exploring the space of possible solution -candidates, yielding success in some instances. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

4 Extras

- - - - - - - - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

4.1 PDF plotting

- - -

Plotting capabilities of PDFgui are provided through the plot control panel and -the quick-plot icon on the tool bar. A quick-plot is created by selecting a -node in the fit tree and then clicking the quick-plot icon in the tool bar. The -same quick-plot can be created by middle-clicking on a node in the fit tree. -

-

The plot control allows for selection of x and y coordinates for -plotting. The actual quantities that could be assigned to the coordinates is -determined by selection of either Fit, or Phase, or Data on the fit tree. The -choices for x and y coordinates varies depending on what is selected on -the fit tree. Special options like index, temperature and doping are available -as choices for x in cases of plotting multiple fit results from sequential -fitting protocols. The plot window provides essential functionality such as -zoom, pan, cursor coordinate tracking, and shifts. Features such as saving, -exporting and printing are also available. The principal intent of the plotting -functionality is to allow quick access to the fitting results to enhance the -scientific process. If data is selected on the fit tree, the user can plot -various aspects of the PDF function, such as data, model and difference PDF -profiles as a function of inter-atomic distance r. If the fit or the phase -are selected, then various parameters, both structural and internal can be -plotted instead. Since several formal plotting examples were given through the -tutorial exercise, and having simplicity of usage in mind, no other plotting -examples are provided, hoping that the usage is sufficiently simple for users -to master individually with ease. An example plot of Rw vs refinement step is -shown in Figure 4.1 for Ni example. -

- - -
-images/fig4-01 - -

Figure 4.1: Plotting window featuring Rw vs refinement step for Ni example. -The basic functionality for manipulating the plot is provided through icons -on the tool bar of the plotting window. - -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

4.2 Displaying the structure

- - - -

For those users with a structural visualizer available in their system -configuration, PDFgui allows for initial or refined structures to be visualized -by passing required structural information that program. This is achieved by -highlighting a desired phase on the fit tree, and then selecting Plot -Initial Structure or Plot Refined Structure from the “Phases” drop-down -menu. The quick-plot button (or middle-click) will also invoke the structure -viewer with the refined structure, or initial structure if the refined -structure does not yet exist. The control of the visualization is dependent on -the viewer used. The viewer can set under the “Edit->Preferences” menu, see -full details in Configuration of structure viewer. -

- -

An example Ni structure visualization with AtomEye is shown in Figure 4.2. -

-
-images/fig4-02 - -

Figure 4.2: Using AtomEye functionality (if installed on your system) for 3D -visualization of the initial and refined PDF structures: example of Ni -structure. - -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

4.3 Advanced usage and special needs

- - - -

The PDFgui is designed to accommodate most common modeling situations. However, -it does not encapsulate all the capabilities available within the modeling -engine, such as calculation of differential PDFs, handling atoms with special -scattering properties, etc. Advanced usage of PDFfit2 engine to resolve any -such special modeling need that user may have is available through usage of -Python scripts in the expert command line mode, similar to that featured in the -PDFFIT program. Handling these situations requires detailed knowledge of the -PDFfit2 syntax based on Python, which is beyond the scope of this user guide -and will be described elsewhere. Refer to the PDFfit2 API -(https://www.diffpy.org/doc/pdffit2 and the diffpy-users -group (https://groups.google.com/d/forum/diffpy-users) for help with PDFfit2 -scripting. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

5 PDFgui reference sheets

- - - - - - - - - - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

5.1 PDFgui shortcut keys

- - - - - -

Fit tree -

-
-
Ctrl+A
-

Select all items in the fit tree. -

-
-
Ctrl+Shift+A
-

Once an object is selected on the fit tree, using this shortcut key will -select all the objects on the tree that are of the same type. For example, if -a single data set is selected on the tree, hitting this hot key will make all -the data sets belonging to all the fits in the tree to become selected. This is -particularly useful for simultaneously plotting various fit results across the -fit tree. -

-
-
Ctrl+C
-

Copy selected item. -

-
-
Ctrl+X
-

Copy and delete selected item. -

-
-
Ctrl+V
-

Paste previously copied item. Note that this will only paste the item to a -legal position in the tree. For example, a phase node cannot be pasted into an -empty tree. -

-
-
- - -

Phase configuration grid -

-
-
Ctrl+A
-

Select all items. -

-
-
/
-

Extend existing selection by atom types or indices. -

-
-
Delete
-

Delete row. This will delete any wholly selected row. -

-
-
Ctrl++
-

Add an atom to the grid. -

-
-
Ctrl+-
-

Same as Delete. -

-
-
- - -

Phase constraints grid -

-
-
Ctrl+A
-

Select all items. -

-
-
/
-

Extend existing selection by atom types or indices. -

-
-
Delete
-

Delete contents of selected cells. -

-
-
- - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

5.2 Command line arguments

- - - - -

PDFgui can be started with an existing project file if it is given -as a command line argument. If the project file cannot be loaded, -the program terminates without starting the GUI an returns nonzero -exit code. In addition the pdfgui executable accepts the -following command line options: -

-
-
-h, --help
-

Show a brief usage information. -

-
-
-V, --version
-

Show program version. -

-
-
- - -

Debugging -

-
-
--db-noed
-

Disable exception catching to error report dialog. Unhandled -exceptions should then result in program crash. -

-
-
--db-nocf
-

No confirmation - exit without asking to save modified project. -

-
-
--db-pdb
-

Start Python debugger for unhandled error exceptions instead -of showing the error report dialog. -

-
-
- - -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

5.3 List of PDFfit2 variables

- - - - -

The following is the list of PDFfit2 variables, including their default values -in parentheses, and a brief description and a note, where appropriate. Note -that some of the variables used in PDFFIT are renamed in PDFfit2. The reference -of these changes is provided for the convenience and orientation of those users -that are used to the old naming scheme. -

- - - - - - - - -

New variables

- -
-
Phase: spdiameter
-

(float Å, default 0 Å)
-spdiameter is a particle diameter for PDF shape damping function. -Shape damping is not applied when spdiameter equals zero. -

- -
-
Phase: stepcut
-

(float Å, default 0 Å)
-The PDF is truncated to zero at r-values greater than stepcut, when -positive. -

- -
-
Phase: anisotropy(n)
-

anisotropy(n) -(bool, inferred from uij(n) values)
-Flag for anisotropic thermal displacements of atom n. -Setting of anisotropy(n) updates the uij(n) -or uisoequiv(n) values. -

- -
-
Phase: uisoequiv(n)
-

(float Å^2, calculated from uij(n) values)
-Isotropic thermal displacement of atom n or equivalent displacement for -anisotropic atom. For anisotropic sites the setting of uisoequiv(n) -scales values of the uij(n) elements. uisoequiv(n) can be -constrained only for isotropic atoms. -

- - - -

Renamed variables

- -
-
Dataset: dscale
-

(float unitless, dsca[s] in PDFFIT)
-Scale factor for the selected dataset. -

- -
-
Dataset: qdamp
-

(float Å^-1, default 0 Å^-1, qsig in PDFFIT)
-PDF Gaussian dampening envelope due to limited Q-resolution. -Not applied when equal to zero. The Gaussian envelope is of the form -

images/eq-01.png

- -
-
Dataset: qbroad
-

(float Å^-1, default 0 Å^-1, qalp in PDFFIT)
-PDF peak broadening from increased intensity noise at high Q. -Not applied when equal zero. -See the definition of the PDF peak width for a detailed explanation. -

- -
-
Phase: uij(n)
-

(float Å^2, ij=(11, 22, 33, 12, 13, 23), u[i,n] in PDFFIT)
-Elements of anisotropic displacement tensor of atom n. -

- -
-
Phase: occ(n)
-

(float unitless, o[n] in PDFFIT)
-Occupancy of site n. -

- -
-
Phase: pscale
-

(float unitless, csca[p] in PDFFIT)
-Scale factor of the current phase. -

- -
-
Phase: delta1
-

(float Å, default 0 Å, gamm in PDFFIT)
-Coefficient for (1/r) contribution to the peak sharpening. -See the definition of the PDF peak width for a detailed explanation. -

- -
-
Phase: delta2
-

(float Å^2, default 0 Å^2, delt in PDFFIT)
-Coefficient for 1/r^2 contribution to the peak sharpening. -See the definition of the PDF peak width for a detailed explanation. -

- -
-
Phase: sratio
-

(float unitless, default 1, srat in PDFFIT)
-Sigma ratio for bonded atoms. Reduction factor for PDF peak width accounting -for correlated motion of bonded atoms. -

- - - -

Preserved variables

- -
-
Dataset: qmax
-

(float Å^-1, default 0 Å)
-qmax cutoff is an experimental parameter having fixed -value determined during the PDF data processing in the Fourier -transform step. Finite data range used in the Fourier transform -is a source of termination ripples. Termination ripples are -not applied in PDF calculation when qmax is set to zero. The -effect is simulated using fast Fourier transformation (FFT). -The original array of G values is first padded by the same number of zeros -and then by more zeros to reach the next power of 2. The padded -G array is transformed by FFT and any coefficients F that correspond -to Q values greater than qmax are reset to zero. The adjusted -coefficient array F is then transformed by inverse FFT back to G’ -and cut out at the original length of G. The imaginary components -in G’ are ignored as they are only due to round-off errors. -

- -
-
Phase: lat(i)
-

(float Å or degrees, i=1,2,...,6)
-Lattice parameters a, b, c, alpha, beta, gamma of the current phase. -Can be also used as lat(’a’) etc. -

- -
-
Phase: x(n), y(n), z(n)
-

(float unitless)
-Fractional coordinates for atom n. -

- -
-
Phase: rcut
-

(float Å, default 0 Å)
-Radius cutoff for applying sratio sharpening factor. -

- -
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

5.4 PDF peak width

- -

The PDF peak width contains contributions from thermal and zero point -displacements as well as static disorder. For large distances r the motion -of the two contributing atoms is uncorrelated. For small distances, however, -the motion can be strongly correlated leading to a sharpening of the first -peak(s) in the observed PDF. PDFfit2 provides three different correction terms -for the PDF peak width. The final width is given by -

images/eq-02.png

-

Here the primed sigma is the peak width without correlation, which is -computed from the anisotropic displacement parameters. The first two terms -correct for the effects of correlated motion. Within the scope of the users -guide, we just mention that the term delta2/r^2 describes the low -temperature behavior, and term delta1/r describes the high temperature -case. Since the two parameters are highly correlated, one will in practice -choose which one to refine. The last term in the equation models the PDF peak -broadening as a result of the Q resolution of the diffractometer. In many cases -this term will only be significant for refinements over wider r-ranges. -Note that the Q resolution also results in an exponential dampening of the PDF -peaks which is modeled using the parameter qdamp. -

-
- - - - - - - - - - - - - - - -
[ << ][ < ][ Up ][ > ][ >> ]         [Top][Contents][Index][ ? ]
- -

Index

- -
Jump to:   A -   -C -   -D -   -E -   -F -   -G -   -H -   -I -   -M -   -N -   -P -   -Q -   -R -   -S -   -T -   -U -   -V -   -W -   -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Index Entry  Section

A
acknowledgments Acknowledgments
advanced usage 4.3 Advanced usage and special needs
AtomEye viewer 1.4.2 Configuration of structure viewer
availability 1.3 Availability

C
calculating PDF 3.2 Calculating PDF from a structure
command line options 5.2 Command line arguments
Community 1.6 Community
copyright Acknowledgments
create new structure 3.1 Building structure model using crystal symmetry

D
data extraction 3.3.5 Advanced post-processing of sequential refinement
development 1.4.3 Installation from sources
displaying the structure 4.2 Displaying the structure
doping series 3.3.4 Sequential fitting of doping series

E
examples 3 Examples and tutorials
extras 4 Extras

F
fit configuration 2.2 Creating a simple fit using a preexisting structure file

G
Git repository 1.4.3 Installation from sources

H
hot keys 5.1 PDFgui shortcut keys

I
installation 1.4 Installation
introduction 1 Introduction
isotope Footnotes

M
mail-list 1.6 Community
multistage fitting 3.3.1 Multistage fitting

N
nanoparticle diameter 3.4 Nanoparticle structure
nanoparticle structure 3.4 Nanoparticle structure

P
PDF plotting 4.1 PDF plotting
PDFfit2 1.1 PDFfit2
PDFfit2 variables 5.3 List of PDFfit2 variables
PDFgui 1.2 PDFgui
pdfgui arguments 5.2 Command line arguments
PDFgui layout 2.1 PDFgui layout
PDFgui reference sheets 5 PDFgui reference sheets
PDFgui shortcut keys 5.1 PDFgui shortcut keys
project post-processing 3.3.5 Advanced post-processing of sequential refinement

Q
quick start 2 Quick start

R
r-series 3.3.2 Sequential fitting of incremental r-series
reference sheets 5 PDFgui reference sheets
refinement configuration 2.2 Creating a simple fit using a preexisting structure file

S
sequential fitting 3.3 Sequential fitting
sequential fitting 3.3.2 Sequential fitting of incremental r-series
sequential fitting 3.3.3 Sequential fitting of temperature series
sequential fitting 3.3.4 Sequential fitting of doping series
shortcuts 5.1 PDFgui shortcut keys
special needs 4.3 Advanced usage and special needs
startup options 5.2 Command line arguments
structure visualization 4.2 Displaying the structure
symmetry expansion 3.1 Building structure model using crystal symmetry

T
temperature series 3.3.3 Sequential fitting of temperature series
tui scripts 3.3.5 Advanced post-processing of sequential refinement
tutorials 3 Examples and tutorials

U
user groups 1.6 Community

V
variables 5.3 List of PDFfit2 variables
versions 1.5 What is new
visualization setup 1.4.2 Configuration of structure viewer

W
whatisnew 1.5 What is new

-
Jump to:   A -   -C -   -D -   -E -   -F -   -G -   -H -   -I -   -M -   -N -   -P -   -Q -   -R -   -S -   -T -   -U -   -V -   -W -   -
- -
- - - - - - -
[Top][Contents][Index][ ? ]
-

Footnotes

- -

(1)

- - -

To enter a specific isotope, use the “NucleonNumber-Symbol” syntax, -for example “12-C”. Deuterium and tritium can be entered also as -“D” and “T” in addition to the normal syntax “2-H” and “3-H”. -


- - - - - - -
[Top][Contents][Index][ ? ]
-

Table of Contents

- - -
- - - - - - -
[Top][Contents][Index][ ? ]
-

About This Document

- -

- This document was generated on April 25, 2023 using texi2html 5.0. -

-

- The buttons in the navigation panels have the following meaning: -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Button Name Go to From 1.2.3 go to
[ << ] FastBackBeginning of this chapter or previous chapter1
[ < ] BackPrevious section in reading order1.2.2
[ Up ] UpUp section1.2
[ > ] ForwardNext section in reading order1.2.4
[ >> ] FastForwardNext chapter2
[Top] TopCover (top) of document  
[Contents] ContentsTable of contents  
[Index] IndexIndex  
[ ? ] AboutAbout (help)  
- -

- where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure: -

- -
    -
  • 1. Section One +
+
+ +

+ Save the example above to a file, say “lmo_refined_c.py” and + run it as +

+
+
+python lmo_refined_c.py
+
+
+

+ Note that the script cannot load the unmodified + lmo-template.ddp file, because it does not have any refinement + results. +

+ +

+ The tutorial directory contains an advanced script + “tui_mno_bond_lengths.py”, which extracts the shortest Mn-O + bond lengths from the same PDFgui project. Please, see the comments in the + script for detailed explanation. +

+

+ To learn more about the tui module and about the objects and functions + that it returns, please see the API documentation for diffpy.pdfgui at + http://docs.danse.us/diffraction/diffpy.pdfgui/. +

+

+ Feel free to ask at the + diffpy-users + group if you need help with data extracting scripts. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

3.4 Nanoparticle structure

+ + + +

+ Determining the structure of a nanoparticle is notoriously difficult. + Diffraction experiments on nanoparticle samples yield broad diffraction + patterns that are hard to analyze using conventional crystallographic + approaches. The PDF analysis of nanoparticles is becoming increasingly + common. The PDF of a nanoparticle features sharp peaks conveying + structural information. The PDF signal gets damped at higher distances due + to the diminished number of pairs in the nanoparticle structure that + contribute to those distances. For certain simpler cases when + nanoparticles can be assumed to have spherical shape, characteristic + parameters such as nanoparticle diameter can be obtained. +

+

+ PDFgui is capable of modeling the effect of the finite nanoparticle size + using a spherical shape factor. Relevant PDF parameter is + spdiameter which is the diameter of the nanoparticle. This + parameter is highly correlated with various other parameters one would + like to refine, such as anisotropic ADPs, scale factors, correlated motion + parameters and so on. The refinement procedure is therefore rather + delicate and the solutions are not as robust as we are used to in cases of + crystalline materials. +

+

+ To illustrate the program capabilities we present a case of CdSe + nanoparticle approximately 3nm in size. It useful to have PDF data for a + crystalline reference, where available/applicable. In this exercise we + start from a prepared project file CdSe-nano.ddp. This project + contains two fits: the first one is a bulk CdSe reference, and the other + pertains to the CdSe nanoparticle. For consistency the PDFs of both bulk + and nano samples were obtained using Qmax of 14 inverse Angstroms, + although the bulk material PDF could have been processed using a higher + value. Synchrotron x-ray radiation was used to obtain the data at 300 K, + based on an experiment carried out at 6-ID-D at the Advanced Photon Source + at Argonne National Laboratory. The structure used for both data sets is + wurtzite, space group P63mc. From calibrations on Ni standard + Qdamp value of 0.0486 was obtained and is used here. +

+

+ We first carry out a refinement on the bulk reference. This is carried out + over a range from 1.7 to 19.8 Angstroms, using 7 parameters: lattice + parameters a and c (@1 and @2 respectively), + selenium z fractional coordinate (@11), isotropic ADPs for + Cd and Se (@21 and @23 respectively), the data scale factor + (@100), and finally correlated motion related quadratic term + coefficient delta2 (@200). The converged fit results in + parameter values that can be further used for reference when modeling the + nanoparticle data. We note that while the fit is reasonable, the values of + the isotropic ADPs are enlarged. The fit can be further improved if + anisotropic ADPs are introduced, although the z-direction related + components will remain enlarged due to the stacking disorder present in + the structure. The referent value of 5.69 for delta2 will be used + as a starting value for the nanoparticle fit. +

+

+ In the nanoparticle refinement we will use the same starting values for + all the parameters, except for delta2 and the nanoparticle + diameter, spdiameter. The former is set to 5.69, and the later to + 25 Angstroms. In other cases an approximate value of the spherical + nanoparticle size is usually known, and it is the best to start from a + reasonably good guess. Refining the nanoparticle data reveals nanoparticle + diameter of approximately 30 Angstroms, as further illustrated in + Figure 3.10. Enlarged values of isotropic ADPs + are again observed, and the fit is reasonably good. Further improvements + can be obtained by introducing anisotropic ADPs, where again values + related to the z-direction will remain abnormally large most probably due + to the stacking related disorder. A detailed description of this system + and successful PDF modeling can be found in this publication: + Quantitative size-dependent structure and strain determination of CdSe + nanoparticles using atomic pair distribution function analysis. +

+
+ + images/fig3-10 +
+

+ Figure 3.10: Fitting the structure of a nanoparticle: 3nm CdSe + nanoparticle example. + +

+

+ In general, a successful fitting scenario depends on particular details of + a structural problem one is determined to solve. The problem of + determining the structure of a nanoparticle remains difficult. PDFgui is + not intended to necessarily provide the solution, it is rather a + helpful tool in the process of determining new details and exploring the + space of possible solution candidates, yielding success in some instances. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

4 Extras

+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

4.1 PDF plotting

+ + +

+ Plotting capabilities of PDFgui are provided through the plot control + panel and the quick-plot icon on the tool bar. A quick-plot is created by + selecting a node in the fit tree and then clicking the quick-plot icon in + the tool bar. The same quick-plot can be created by middle-clicking on a + node in the fit tree. +

+

+ The plot control allows for selection of x and y coordinates + for plotting. The actual quantities that could be assigned to the + coordinates is determined by selection of either Fit, or Phase, or Data on + the fit tree. The choices for x and y coordinates varies + depending on what is selected on the fit tree. Special options like index, + temperature and doping are available as choices for x in cases of + plotting multiple fit results from sequential fitting protocols. The plot + window provides essential functionality such as zoom, pan, cursor + coordinate tracking, and shifts. Features such as saving, exporting and + printing are also available. The principal intent of the plotting + functionality is to allow quick access to the fitting results to enhance + the scientific process. If data is selected on the fit tree, the user can + plot various aspects of the PDF function, such as data, model and + difference PDF profiles as a function of inter-atomic distance r. + If the fit or the phase are selected, then various parameters, both + structural and internal can be plotted instead. Since several formal + plotting examples were given through the tutorial exercise, and having + simplicity of usage in mind, no other plotting examples are provided, + hoping that the usage is sufficiently simple for users to master + individually with ease. An example plot of Rw vs refinement step is shown + in Figure 4.1 for Ni example. +

+ +
+ + images/fig4-01 +
+

+ Figure 4.1: Plotting window featuring Rw vs refinement step for Ni + example. The basic functionality for manipulating the plot is provided + through icons on the tool bar of the plotting window. + +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

4.2 Displaying the structure

+ + + +

+ For those users with a structural visualizer available in their system + configuration, PDFgui allows for initial or refined structures to be + visualized by passing required structural information that program. This + is achieved by highlighting a desired phase on the fit tree, and then + selecting Plot Initial Structure or + Plot Refined Structure from the “Phases” drop-down + menu. The quick-plot button (or middle-click) will also invoke the + structure viewer with the refined structure, or initial structure if the + refined structure does not yet exist. The control of the visualization is + dependent on the viewer used. The viewer can set under the + “Edit->Preferences” menu, see full details in + Configuration of structure viewer. +

+ +

+ An example Ni structure visualization with AtomEye is shown in + Figure 4.2. +

+
+ + images/fig4-02 +
+

+ Figure 4.2: Using AtomEye functionality (if installed on your system) + for 3D visualization of the initial and refined PDF structures: example + of Ni structure. + +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

4.3 Advanced usage and special needs

+ + + +

+ The PDFgui is designed to accommodate most common modeling situations. + However, it does not encapsulate all the capabilities available within the + modeling engine, such as calculation of differential PDFs, handling atoms + with special scattering properties, etc. Advanced usage of PDFfit2 engine + to resolve any such special modeling need that user may have is available + through usage of Python scripts in the expert command line mode, similar + to that featured in the PDFFIT program. Handling these situations requires + detailed knowledge of the PDFfit2 syntax based on Python, which is beyond + the scope of this user guide and will be described elsewhere. Refer to the + PDFfit2 API (https://www.diffpy.org/doc/pdffit2 + and the diffpy-users group (https://groups.google.com/d/forum/diffpy-users) for help with PDFfit2 scripting. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

5 PDFgui reference sheets

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

5.1 PDFgui shortcut keys

+ + + + +

Fit tree

+
+
Ctrl+A
+

Select all items in the fit tree.

+
Ctrl+Shift+A
+
+

+ Once an object is selected on the fit tree, using this shortcut key + will select all the objects on the tree that are of the same type. For + example, if a single data set is selected on the tree, hitting this + hot key will make all the data sets belonging to all the fits in the + tree to become selected. This is particularly useful for + simultaneously plotting various fit results across the fit tree. +

+
+
Ctrl+C
+

Copy selected item.

+
Ctrl+X
+

Copy and delete selected item.

+
Ctrl+V
+
+

+ Paste previously copied item. Note that this will only paste the item + to a legal position in the tree. For example, a phase node cannot be + pasted into an empty tree. +

+
+
+ +

Phase configuration grid

+
+
Ctrl+A
+

Select all items.

+
/
+

Extend existing selection by atom types or indices.

+
Delete
+

Delete row. This will delete any wholly selected row.

+
Ctrl++
+

Add an atom to the grid.

+
Ctrl+-
+

Same as Delete.

+
+ +

Phase constraints grid

+
+
Ctrl+A
+

Select all items.

+
/
+

Extend existing selection by atom types or indices.

+
Delete
+

Delete contents of selected cells.

+
+ +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

5.2 Command line arguments

+ + + + +

+ PDFgui can be started with an existing project file if it is given as a + command line argument. If the project file cannot be loaded, the program + terminates without starting the GUI an returns nonzero exit code. In + addition the pdfgui executable accepts the following command + line options: +

+
+
-h, --help
+

Show a brief usage information.

+
-V, --version
+

Show program version.

+
+ +

Debugging

+
+
--db-noed
+
+

+ Disable exception catching to error report dialog. Unhandled + exceptions should then result in program crash. +

+
+
--db-nocf
+
+

No confirmation - exit without asking to save modified project.

+
+
--db-pdb
+
+

+ Start Python debugger for unhandled error exceptions instead of + showing the error report dialog. +

+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ + > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

5.3 List of PDFfit2 variables

+ + + +

+ The following is the list of PDFfit2 variables, including their default + values in parentheses, and a brief description and a note, where + appropriate. Note that some of the variables used in PDFFIT are renamed in + PDFfit2. The reference of these changes is provided for the convenience + and orientation of those users that are used to the old naming scheme. +

+ + + + + + + + + + + + + + + + + + + + +

New variables

+ +
+
Phase: spdiameter
+
+

+ (float Å, default 0 Å)
+ spdiameter is a particle diameter for PDF shape damping + function. Shape damping is not applied when + spdiameter equals zero. +

+
+
+ +
+
Phase: stepcut
+
+

+ (float Å, default 0 Å)
+ The PDF is truncated to zero at r-values greater than + stepcut, when positive. +

+
+
+ +
+
+ Phase: anisotropy(n) +
+
+

+ anisotropy(n) (bool, inferred from uij(n) values) +
+ Flag for anisotropic thermal displacements of atom n. Setting of + anisotropy(n) updates the uij(n) or + uisoequiv(n) values. +

+
+
+ +
+
+ Phase: uisoequiv(n) +
+
+

+ (float Å^2, calculated from uij(n) values) +
+ Isotropic thermal displacement of atom n or equivalent displacement + for anisotropic atom. For anisotropic sites the setting of + uisoequiv(n) scales values of the + uij(n) elements. uisoequiv(n) can be constrained + only for isotropic atoms. +

+
+
+ + + +

Renamed variables

+ +
+
Dataset: dscale
+
+

+ (float unitless, dsca[s] in PDFFIT)
+ Scale factor for the selected dataset. +

+
+
+ +
+
Dataset: qdamp
+
+

+ (float Å^-1, default 0 Å^-1, + qsig in PDFFIT)
+ PDF Gaussian dampening envelope due to limited Q-resolution. Not + applied when equal to zero. The Gaussian envelope is of the form +

+

+ images/eq-01.png +

+
+
+ +
+
Dataset: qbroad
+
+

+ (float Å^-1, default 0 Å^-1, + qalp in PDFFIT)
+ PDF peak broadening from increased intensity noise at high Q. Not + applied when equal zero. See the definition of the + PDF peak width for a detailed + explanation. +

+
+
+ +
+
Phase: uij(n)
+
+

+ (float Å^2, ij=(11, 22, 33, 12, 13, 23), + u[i,n] in PDFFIT)
+ Elements of anisotropic displacement tensor of atom n. +

+
+
+ +
+
Phase: occ(n)
+
+

+ (float unitless, o[n] in PDFFIT)
+ Occupancy of site n. +

+
+
+ +
+
Phase: pscale
+
+

+ (float unitless, csca[p] in PDFFIT)
+ Scale factor of the current phase. +

+
+
+ +
+
Phase: delta1
+
+

+ (float Å, default 0 Å, gamm in PDFFIT)
+ Coefficient for (1/r) contribution to the peak sharpening. See the + definition of the PDF peak width for a + detailed explanation. +

+
+
+ +
+
Phase: delta2
+
+

+ (float Å^2, default 0 Å^2, + delt in PDFFIT)
+ Coefficient for 1/r^2 contribution to the peak sharpening. + See the definition of the + PDF peak width for a detailed + explanation. +

+
+
+ +
+
Phase: sratio
+
+

+ (float unitless, default 1, srat in PDFFIT)
+ Sigma ratio for bonded atoms. Reduction factor for PDF peak width + accounting for correlated motion of bonded atoms. +

+
+
+ + + +

Preserved variables

+ +
+
Dataset: qmax
+
+

+ (float Å^-1, default 0 Å)
+ qmax cutoff is an experimental parameter having fixed value + determined during the PDF data processing in the Fourier transform + step. Finite data range used in the Fourier transform is a source of + termination ripples. Termination ripples are not applied in PDF + calculation when qmax is set to zero. The effect is + simulated using fast Fourier transformation (FFT). The original array + of G values is first padded by the same number of zeros and + then by more zeros to reach the next power of 2. The padded + G array is transformed by FFT and any coefficients + F that correspond to Q values greater than + qmax are reset to zero. The adjusted coefficient array + F is then transformed by inverse FFT back to + G’ and cut out at the original length of G. The + imaginary components in G’ are ignored as they are only + due to round-off errors. +

+
+
+ +
+
Phase: lat(i)
+
+

+ (float Å or degrees, i=1,2,...,6)
+ Lattice parameters a, b, c, alpha, beta, gamma of the current phase. + Can be also used as lat(’a’) etc. +

+
+
+ +
+
+ Phase: x(n), y(n), z(n) +
+
+

+ (float unitless)
+ Fractional coordinates for atom n. +

+
+
+ +
+
Phase: rcut
+
+

+ (float Å, default 0 Å)
+ Radius cutoff for applying sratio sharpening factor. +

+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + + [ > ] + + [ >> ] +      + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

5.4 PDF peak width

+ +

+ The PDF peak width contains contributions from thermal and zero point + displacements as well as static disorder. For large distances r the + motion of the two contributing atoms is uncorrelated. For small distances, + however, the motion can be strongly correlated leading to a sharpening of + the first peak(s) in the observed PDF. PDFfit2 provides three different + correction terms for the PDF peak width. The final width is given by +

+

+ images/eq-02.png +

+

+ Here the primed sigma is the peak width without correlation, which is + computed from the anisotropic displacement parameters. The first two terms + correct for the effects of correlated motion. Within the scope of the + users guide, we just mention that the term + delta2/r^2 describes the low temperature behavior, and + term delta1/r describes the high temperature case. Since the + two parameters are highly correlated, one will in practice choose which + one to refine. The last term in the equation models the PDF peak + broadening as a result of the Q resolution of the diffractometer. In many + cases this term will only be significant for refinements over wider + r-ranges. Note that the Q resolution also results in an exponential + dampening of the PDF peaks which is modeled using the parameter + qdamp. +

+
+ + + + + + + + + + + + + + + + + +
+ [ + << ] + + [ + < ] + + [ Up ] + [ > ][ >> ]     + [Top] + + [Contents] + + [Index] + + [ ? ] +
+ +

Index

+ + + + + + +
Jump to:   + A +   + C +   + D +   + E +   + F +   + G +   + H +   + I +   + M +   + N +   + P +   + Q +   + R +   + S +   + T +   + U +   + V +   + W +   +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Index Entry Section

A
+ acknowledgments +  Acknowledgments
advanced usage  + 4.3 Advanced usage and special needs +
AtomEye viewer  + 1.4.2 Configuration of structure viewer +
availability 1.3 Availability

C
+ calculating PDF +   + 3.2 Calculating PDF from a structure +
+ command line options +   + 5.2 Command line arguments +
Community 1.6 Community
copyright Acknowledgments
+ create new structure +   + 3.1 Building structure model using crystal symmetry +

D
+ data extraction +   + 3.3.5 Advanced post-processing of sequential refinement +
development  + 1.4.3 Installation from sources +
+ displaying the structure +   + 4.2 Displaying the structure +
doping series  + 3.3.4 Sequential fitting of doping series +

E
examples  + 3 Examples and tutorials +
extras 4 Extras

F
+ fit configuration +   + 2.2 Creating a simple fit using a preexisting structure file +

G
Git repository  + 1.4.3 Installation from sources +

H
hot keys  + 5.1 PDFgui shortcut keys +

I
installation 1.4 Installation
introduction 1 Introduction
isotope Footnotes

M
mail-list 1.6 Community
+ multistage fitting +   + 3.3.1 Multistage fitting +

N
+ nanoparticle diameter +   + 3.4 Nanoparticle structure +
+ nanoparticle structure +   + 3.4 Nanoparticle structure +

P
PDF plotting 4.1 PDF plotting
PDFfit2 1.1 PDFfit2
+ PDFfit2 variables +   + 5.3 List of PDFfit2 variables +
PDFgui 1.2 PDFgui
+ pdfgui arguments +   + 5.2 Command line arguments +
PDFgui layout 2.1 PDFgui layout
+ PDFgui reference sheets +   + 5 PDFgui reference sheets +
+ PDFgui shortcut keys +   + 5.1 PDFgui shortcut keys +
+ project post-processing +   + 3.3.5 Advanced post-processing of sequential refinement +

Q
quick start 2 Quick start

R
r-series  + 3.3.2 Sequential fitting of incremental r-series +
+ reference sheets +   + 5 PDFgui reference sheets +
+ refinement configuration +   + 2.2 Creating a simple fit using a preexisting structure file +

S
+ sequential fitting +   + 3.3 Sequential fitting +
+ sequential fitting +   + 3.3.2 Sequential fitting of incremental r-series +
+ sequential fitting +   + 3.3.3 Sequential fitting of temperature series +
+ sequential fitting +   + 3.3.4 Sequential fitting of doping series +
shortcuts  + 5.1 PDFgui shortcut keys +
special needs  + 4.3 Advanced usage and special needs +
+ startup options +   + 5.2 Command line arguments +
+ structure visualization +   + 4.2 Displaying the structure +
+ symmetry expansion +   + 3.1 Building structure model using crystal symmetry +

T
+ temperature series +   + 3.3.3 Sequential fitting of temperature series +
tui scripts  + 3.3.5 Advanced post-processing of sequential refinement +
tutorials  + 3 Examples and tutorials +

U
user groups 1.6 Community

V
variables  + 5.3 List of PDFfit2 variables +
versions 1.5 What is new
+ visualization setup +   + 1.4.2 Configuration of structure viewer +

W
whatisnew 1.5 What is new

+ + + + + +
Jump to:   + A +   + C +   + D +   + E +   + F +   + G +   + H +   + I +   + M +   + N +   + P +   + Q +   + R +   + S +   + T +   + U +   + V +   + W +   +
+ +
+ + + + + + + + +
+ [Top] + + [Contents] + + [Index] + + [ ? ] +
+

Footnotes

+ +

(1)

+ + +

+ To enter a specific isotope, use the “NucleonNumber-Symbol” + syntax, for example “12-C”. Deuterium and tritium can be + entered also as “D” and “T” in addition to the + normal syntax “2-H” and “3-H”. +

+
+ + + + + + + + +
+ [Top] + + [Contents] + + [Index] + + [ ? ] +
+

Table of Contents

+ + +
+ + + + + + + + +
+ [Top] + + [Contents] + + [Index] + + [ ? ] +
+

About This Document

+ +

+ This document was generated on April 25, 2023 using + texi2html 5.0. +

+

The buttons in the navigation panels have the following meaning:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ButtonNameGo toFrom 1.2.3 go to
[ << ]FastBackBeginning of this chapter or previous chapter1
[ < ]BackPrevious section in reading order1.2.2
[ Up ]UpUp section1.2
[ > ]ForwardNext section in reading order1.2.4
[ >> ]FastForwardNext chapter2
[Top]TopCover (top) of document 
[Contents]ContentsTable of contents 
[Index]IndexIndex 
[ ? ]AboutAbout (help) 
+ +

+ where the Example assumes that the current position is + at Subsubsection One-Two-Three of a document of the + following structure: +

+
    -
  • 1.1 Subsection One-One -
      -
    • ...
    • -
    -
  • -
  • 1.2 Subsection One-Two +
  • + 1. Section One
      -
    • 1.2.1 Subsubsection One-Two-One
    • -
    • 1.2.2 Subsubsection One-Two-Two
    • -
    • 1.2.3 Subsubsection One-Two-Three     - <== Current Position
    • -
    • 1.2.4 Subsubsection One-Two-Four
    • +
    • + 1.1 Subsection One-One +
        +
      • ...
      • +
      +
    • +
    • + 1.2 Subsection One-Two +
        +
      • 1.2.1 Subsubsection One-Two-One
      • +
      • 1.2.2 Subsubsection One-Two-Two
      • +
      • + 1.2.3 Subsubsection One-Two-Three     + <== Current Position +
      • +
      • 1.2.4 Subsubsection One-Two-Four
      • +
      +
    • +
    • + 1.3 Subsection One-Three +
        +
      • ...
      • +
      +
    • +
    • 1.4 Subsection One-Four
  • -
  • 1.3 Subsection One-Three -
      -
    • ...
    • -
    -
  • -
  • 1.4 Subsection One-Four
- - - -
-

- - This document was generated on April 25, 2023 using texi2html 5.0. - -
- -

- + +
+

+ + This document was generated on April 25, 2023 using + texi2html 5.0. + +
+

+ diff --git a/doc/source/manual_resources/tui_mno_bond_lengths.py b/doc/source/manual_resources/tui_mno_bond_lengths.py index 1f43d196..febd0b51 100755 --- a/doc/source/manual_resources/tui_mno_bond_lengths.py +++ b/doc/source/manual_resources/tui_mno_bond_lengths.py @@ -2,9 +2,10 @@ """Extract the shortest Mn-O bond lengths from all fits in PDFgui project. -This script loops through all refined phases in PDFgui project and calculates -their shortest Mn-O bond lengths using diffpy.pdffit2 library. The results -are plotted versus temperature and saved to "mno-bond-lengths.dat" file. +This script loops through all refined phases in PDFgui project and +calculates their shortest Mn-O bond lengths using diffpy.pdffit2 +library. The results are plotted versus temperature and saved to "mno- +bond-lengths.dat" file. """ import pylab @@ -32,7 +33,7 @@ def shortestBond_MnO(stru): - """extract the shortest MnO bond length in a structure. + """Extract the shortest MnO bond length in a structure. stru -- initial or refined phase from a PDFgui project diff --git a/news/updatepcmt.rst b/news/updatepcmt.rst new file mode 100644 index 00000000..df9be8ec --- /dev/null +++ b/news/updatepcmt.rst @@ -0,0 +1,23 @@ +**Added:** + +* no news: using new pre-commit + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index db812766..5adbcb4b 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -12,7 +12,6 @@ # See LICENSE.rst for license information. # ############################################################################## - """Blank namespace package for module diffpy.""" diff --git a/src/diffpy/pdfgui/__init__.py b/src/diffpy/pdfgui/__init__.py index e4d1d6c0..e94fe701 100644 --- a/src/diffpy/pdfgui/__init__.py +++ b/src/diffpy/pdfgui/__init__.py @@ -12,7 +12,6 @@ # See LICENSE.rst for license information. # ############################################################################## - """GUI for PDF simulation and structure refinement.""" # package version diff --git a/src/diffpy/pdfgui/applications/pdfgui.py b/src/diffpy/pdfgui/applications/pdfgui.py index 0c1f0b48..99b5e734 100755 --- a/src/diffpy/pdfgui/applications/pdfgui.py +++ b/src/diffpy/pdfgui/applications/pdfgui.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """ PDFgui Graphical User Interface for Pair Distribution Function fitting Usage: pdfgui [project.dpp] @@ -55,9 +54,9 @@ def version(): def processArguments(argv1): - """Process command line arguments and store results in pdfguiglobals. - This method updates cmdopts, cmdargs and dbopts attributes in the - pdfguiglobals module. + """Process command line arguments and store results in pdfguiglobals. This + method updates cmdopts, cmdargs and dbopts attributes in the pdfguiglobals + module. argv1 -- list of command line arguments excluding the executable diff --git a/src/diffpy/pdfgui/control/calculation.py b/src/diffpy/pdfgui/control/calculation.py index 27f98dc2..28be348e 100644 --- a/src/diffpy/pdfgui/control/calculation.py +++ b/src/diffpy/pdfgui/control/calculation.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""class Calculation for performing PDF simulation from model structure. -""" +"""Class Calculation for performing PDF simulation from model structure.""" import copy import math @@ -51,7 +49,7 @@ class Calculation(PDFComponent): """ def __init__(self, name): - """initialize Calculation + """Initialize Calculation. name -- calculation name """ @@ -71,15 +69,15 @@ def __init__(self, name): return def _getStrId(self): - """make a string identifier + """Make a string identifier. return value: string id """ return "c_" + self.name def setRGrid(self, rmin=None, rstep=None, rmax=None): - """Change specified r-grid parameters (rmin, rstep, rmax). - Adjust rmax for integer number of steps. + """Change specified r-grid parameters (rmin, rstep, rmax). Adjust rmax + for integer number of steps. rmin -- new low rcalc boundary rstep -- new r-grid step @@ -120,7 +118,7 @@ def setRGrid(self, rmin=None, rstep=None, rmax=None): return def start(self): - """entry function for calculation""" + """Entry function for calculation.""" from diffpy.pdfgui.control.fitting import getEngineExceptions, handleEngineException try: @@ -137,7 +135,7 @@ def start(self): return def calculate(self): - """do the real calculation""" + """Do the real calculation.""" # clean up old results self.rcalc = [] self.Gcalc = [] @@ -188,7 +186,7 @@ def calculate(self): self.Gcalc = server.getpdf_fit() def write(self, filename): - """write this calculated PDF to a file + """Write this calculated PDF to a file. filename -- name of file to write to @@ -247,7 +245,7 @@ def writeStr(self): return datastring def load(self, z, subpath): - """load data from a zipped project file + """Load data from a zipped project file. z -- zipped project file subpath -- path to its own storage within project file @@ -270,7 +268,7 @@ def load(self, z, subpath): return def save(self, z, subpath): - """save data from a zipped project file + """Save data from a zipped project file. z -- zipped project file subpath -- path to its own storage within project file @@ -292,7 +290,7 @@ def save(self, z, subpath): return def copy(self, other=None): - """copy self to other. if other is None, create new instance + """Copy self to other. if other is None, create new instance. other -- reference to other object @@ -324,7 +322,7 @@ def copy(self, other=None): return other def getYNames(self): - """get names of data item which can be plotted as y + """Get names of data item which can be plotted as y. returns a name str list """ @@ -333,7 +331,7 @@ def getYNames(self): ] def getXNames(self): - """get names of data item which can be plotted as x + """Get names of data item which can be plotted as x. returns a name str list """ @@ -342,7 +340,7 @@ def getXNames(self): ] def getData(self, dataname, step=None): - """get Calculation data member + """Get Calculation data member. name -- data item name step -- ignored, just for compatibility with Organizer.getData() @@ -355,12 +353,12 @@ def getData(self, dataname, step=None): return self.__dict__[dataname] def getMetaDataNames(self): - """return all applicable meta data names""" + """Return all applicable meta data names.""" # FIXME: Currently we haven't thought about this return [] def getMetaData(self, name): - """get meta data value + """Get meta data value. name -- meta data name returns meta data value diff --git a/src/diffpy/pdfgui/control/constraint.py b/src/diffpy/pdfgui/control/constraint.py index fac6082f..2dd2ce12 100644 --- a/src/diffpy/pdfgui/control/constraint.py +++ b/src/diffpy/pdfgui/control/constraint.py @@ -12,10 +12,8 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""class Constraint for storage of a single constraint equation -constraints will be stored in { variable : constraint } dictionary -""" +"""Class Constraint for storage of a single constraint equation constraints +will be stored in { variable : constraint } dictionary.""" import math import re @@ -24,7 +22,7 @@ class Constraint: - """Constraint --> storage and check of a single constraint equation + """Constraint --> storage and check of a single constraint equation. Data members: formula -- right-side of constraint equation (string). When @@ -39,7 +37,7 @@ class Constraint: """ def __init__(self, formula, value=None): - """initialize the Constraint. + """Initialize the Constraint. formula -- (string) right-side of constraint equation value -- (optional) current value of the variable @@ -58,7 +56,7 @@ def __init__(self, formula, value=None): return def evalFormula(self, parvalues): - """evaluate constraint formula + """Evaluate constraint formula. parvalues -- dictionary of int parameter indices and float values. @@ -69,8 +67,8 @@ def evalFormula(self, parvalues): return result def lambdaFormula(self): - """Build lambda function from constraint formula. - Lambda function expects dictionary argument. + """Build lambda function from constraint formula. Lambda function + expects dictionary argument. returns lambda function """ @@ -79,7 +77,7 @@ def lambdaFormula(self): return f def guess(self, value): - """guess the initial values of parameters contained in parguess + """Guess the initial values of parameters contained in parguess. value -- current value of the constrained variable @@ -112,7 +110,7 @@ def guess(self, value): return dict(self.parguess) def __setattr__(self, name, value): - """check math and update parguess when formula is assigned""" + """Check math and update parguess when formula is assigned.""" if name != "formula": self.__dict__[name] = value return diff --git a/src/diffpy/pdfgui/control/controlerrors.py b/src/diffpy/pdfgui/control/controlerrors.py index 3142ac17..84e2ba4c 100644 --- a/src/diffpy/pdfgui/control/controlerrors.py +++ b/src/diffpy/pdfgui/control/controlerrors.py @@ -15,10 +15,10 @@ class ControlError(Exception): - """Basic PDFGuiControl exception class""" + """Basic PDFGuiControl exception class.""" def __init__(self, info): - """initialize + """initialize. info -- description string """ @@ -30,61 +30,63 @@ def __str__(self): class ControlConfigError(ControlError): - """PDFGuiControl exception class -- object config is invalid""" + """PDFGuiControl exception class -- object config is invalid.""" pass class ControlFileError(ControlError): - """PDFGuiControl exception class -- object config is invalid""" + """PDFGuiControl exception class -- object config is invalid.""" pass class ControlKeyError(ControlError): - """PDFGuiControl exception class -- requested object can't be found""" + """PDFGuiControl exception class -- requested object can't be found.""" pass class ControlValueError(ControlError): - """PDFGuiControl exception class -- Invalid value""" + """PDFGuiControl exception class -- Invalid value.""" pass class ControlTypeError(ControlError): - """PDFGuiControl exception class -- Type mismatch""" + """PDFGuiControl exception class -- Type mismatch.""" pass class ControlStatusError(ControlError): - """PDFGuiControl exception class -- Fitting status doesn't match""" + """PDFGuiControl exception class -- Fitting status doesn't match.""" pass class ControlRuntimeError(ControlError): - """PDFGuiControl exception class -- various irrecoverable runtime error""" + """PDFGuiControl exception class -- various irrecoverable runtime error.""" pass class ControlIndexError(ControlError): - """PDFGuiControl exception class -- index out of bound""" + """PDFGuiControl exception class -- index out of bound.""" pass class ControlSyntaxError(ControlError): - """PDFGuiControl exception class -- invalid syntax of constraint formula""" + """PDFGuiControl exception class -- invalid syntax of constraint + formula.""" pass class TempControlSelectError(ControlError): - """Temporary define this error to identify the select-control error in python3""" + """Temporary define this error to identify the select-control error in + python3.""" pass diff --git a/src/diffpy/pdfgui/control/fitdataset.py b/src/diffpy/pdfgui/control/fitdataset.py index c6c8e931..607b14c4 100644 --- a/src/diffpy/pdfgui/control/fitdataset.py +++ b/src/diffpy/pdfgui/control/fitdataset.py @@ -12,9 +12,8 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""class FitDataSet for experimental PDF data and related fitting parameters -""" +"""Class FitDataSet for experimental PDF data and related fitting +parameters.""" import copy @@ -92,6 +91,7 @@ def __setattr__(self, name, value): def __getattr__(self, name): """Obtain refinable variables from self.initial. + This is called only when normal attribute lookup fails. """ if name in PDFDataSet.refinableVars: @@ -102,14 +102,14 @@ def __getattr__(self, name): return value def _getStrId(self): - """make a string identifier + """Make a string identifier. return value: string id """ return "d_" + self.name def getYNames(self): - """get names of data item which can be plotted as y + """Get names of data item which can be plotted as y. returns list of strings """ @@ -117,7 +117,7 @@ def getYNames(self): return ynames def getXNames(self): - """get names of data item which can be plotted as x + """Get names of data item which can be plotted as x. returns list of strings """ @@ -126,7 +126,7 @@ def getXNames(self): ] def getData(self, name, step=-1): - """get self's data member + """Get self's data member. name -- data item name step -- step info, it can be: @@ -203,8 +203,8 @@ def read(self, filename): return self.readObs(filename) def _updateRcalcRange(self): - """Helper method for updating fitrmin, fitrmax and fitrstep - just after reading observed values. + """Helper method for updating fitrmin, fitrmax and fitrstep just after + reading observed values. No return value. """ @@ -231,7 +231,7 @@ def readStr(self, datastring): return self.readObsStr(datastring) def readObsStr(self, datastring): - """Read experimental PDF data from a string + """Read experimental PDF data from a string. datastring -- string of raw data @@ -344,6 +344,7 @@ def writeObsStr(self): def _resampledPDFDataSet(self): """Return instance of PDFDataSet with resampled observed data. + Helper method for writeResampledObs and writeResampledObsStr. """ resampled = PDFDataSet(self.name) @@ -375,9 +376,9 @@ def writeResampledObsStr(self): return s def findParameters(self): - """Obtain dictionary of parameters used by self.constraints. - The keys of returned dictionary are integer parameter indices, and - their values Parameter instances, with guessed initial values. + """Obtain dictionary of parameters used by self.constraints. The keys + of returned dictionary are integer parameter indices, and their values + Parameter instances, with guessed initial values. returns dictionary of indices and Parameter instances """ @@ -396,7 +397,7 @@ def findParameters(self): return foundpars def applyParameters(self, parameters): - """Evaluate constraint formulas and adjust self.initial + """Evaluate constraint formulas and adjust self.initial. parameters -- dictionary of parameter indices with Parameter instances. Dictionary may also have float-type values. @@ -417,8 +418,8 @@ def applyParameters(self, parameters): def changeParameterIndex(self, oldidx, newidx): """Change a parameter index to a new value. - This will replace all instances of one parameter name with another in - this fit. + This will replace all instances of one parameter name with + another in this fit. """ import re @@ -430,7 +431,7 @@ def changeParameterIndex(self, oldidx, newidx): return def copy(self, other=None): - """Copy self to other. if other is None, create new instance + """Copy self to other. if other is None, create new instance. other -- ref to other object @@ -525,11 +526,12 @@ def save(self, z, subpath): # interface for data sampling def getFitSamplingType(self): - """Description of r-sampling used in the fit. This method - compares self.fitrstep with r-sampling in the observed data - and with Nyquist r step. + """Description of r-sampling used in the fit. This method compares + self.fitrstep with r-sampling in the observed data and with Nyquist r + step. - Return a string, possible values are "data", "Nyquist" or "custom". + Return a string, possible values are "data", "Nyquist" or + "custom". """ eps = 1e-8 if abs(self.fitrstep - self.getObsSampling()) < eps: @@ -575,6 +577,7 @@ def getObsSampling(self): def getNyquistSampling(self): """Return r-step corresponding to Nyquist sampling at the qmax value. + When qmax is zero, return r-step in the observed data. """ if self.qmax > 0.0: diff --git a/src/diffpy/pdfgui/control/fitstructure.py b/src/diffpy/pdfgui/control/fitstructure.py index 6d12c840..e31372cc 100644 --- a/src/diffpy/pdfgui/control/fitstructure.py +++ b/src/diffpy/pdfgui/control/fitstructure.py @@ -12,9 +12,8 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""class FitStructure for storage of one phase and related fitting parameters -""" +"""Class FitStructure for storage of one phase and related fitting +parameters.""" import copy import re @@ -79,8 +78,8 @@ def __init__(self, name, *args, **kwargs): return def _update_custom_spacegroup(self, parser): - """Helper method for read() and readStr(), which takes care - of setting custom_spacegroup after successful reading. + """Helper method for read() and readStr(), which takes care of setting + custom_spacegroup after successful reading. parser -- instance of StructureParser used in reading. @@ -100,9 +99,9 @@ def _update_custom_spacegroup(self, parser): return def read(self, filename, format="auto"): - """Load structure from a file, raise ControlFileError for invalid - or unknown structure format. Overloads PDFStructure.read() - to handle custom_spacegroup attribute. + """Load structure from a file, raise ControlFileError for invalid or + unknown structure format. Overloads PDFStructure.read() to handle + custom_spacegroup attribute. filename -- file to be loaded format -- structure format such as 'pdffit', 'pdb', 'xyz'. When @@ -120,11 +119,10 @@ def read(self, filename, format="auto"): return p def readStr(self, s, format="auto"): - """Same as PDFStructure.readStr, but handle the - custom_spacegroup data. + """Same as PDFStructure.readStr, but handle the custom_spacegroup data. - Return instance of StructureParser used to load the data. - See Structure.readStr() for more info. + Return instance of StructureParser used to load the data. See + Structure.readStr() for more info. """ p = PDFStructure.readStr(self, s, format) # update data only after successful reading @@ -136,6 +134,7 @@ def readStr(self, s, format="auto"): def __getattr__(self, name): """Map self.initial to self. + This is called only when normal attribute lookup fails. """ if name == "initial": @@ -146,7 +145,7 @@ def __getattr__(self, name): return value def _getStrId(self): - """make a string identifier + """Make a string identifier. return value: string id """ @@ -170,9 +169,9 @@ def obtainRefined(self, server, iphase): return def findParameters(self): - """Obtain dictionary of parameters used by self.constraints. - The keys of returned dictionary are integer parameter indices, and - the values are Parameter instances, with guessed initial values. + """Obtain dictionary of parameters used by self.constraints. The keys + of returned dictionary are integer parameter indices, and the values + are Parameter instances, with guessed initial values. returns dictionary of indices and Parameter instances """ @@ -211,8 +210,8 @@ def applyParameters(self, parameters): def changeParameterIndex(self, oldidx, newidx): """Change a parameter index to a new value. - This will replace all instances of one parameter name with another in - this fit. + This will replace all instances of one parameter name with + another in this fit. """ for var in self.constraints: formula = self.constraints[var].formula @@ -245,9 +244,9 @@ def _popAtomConstraints(self): return rv def _restoreAtomConstraints(self, acd): - """Restore self.constraints from atom constraints dictionary. This - is useful for getting correct atom indices into refvar strings. - See also _popAtomConstraints() + """Restore self.constraints from atom constraints dictionary. This is + useful for getting correct atom indices into refvar strings. See also + _popAtomConstraints() acd -- dictionary obtained from _popAtomConstraints() """ @@ -296,8 +295,8 @@ def expandSuperCell(self, mno): """Perform supercell expansion for this structure and adjust constraints for positions and lattice parameters. New lattice parameters are multiplied and fractional coordinates divided by - corresponding multiplier. New atoms are grouped with their source - in the original cell. + corresponding multiplier. New atoms are grouped with their source in + the original cell. mno -- tuple or list of three positive integer cell multipliers along the a, b, c axis @@ -370,9 +369,11 @@ def isSpaceGroupPossible(self, spacegroup): return isSpaceGroupLatPar(spacegroup, *self.initial.lattice.abcABG()) def getSpaceGroupList(self): - """Return a list of SpaceGroup instances sorted by International - Tables number. When custom_spacegroup is defined, the list starts - with custom_spacegroup. + """Return a list of SpaceGroup instances sorted by International Tables + number. + + When custom_spacegroup is defined, the list starts with + custom_spacegroup. """ if not FitStructure.sorted_standard_space_groups: import diffpy.structure.spacegroups as SG @@ -396,9 +397,8 @@ def getSpaceGroup(self, sgname): """Find space group in getSpaceGroupList() by short_name or number. sgname can be non-standard in case of CIF file defined space group. - Return instance of SpaceGroup. - Raise ValueError if sgname cannot be found or when it is not present - in getSpaceGroupList(). + Return instance of SpaceGroup. Raise ValueError if sgname cannot + be found or when it is not present in getSpaceGroupList(). """ import diffpy.structure.spacegroups as SG @@ -414,11 +414,11 @@ def getSpaceGroup(self, sgname): return sgfound def expandAsymmetricUnit(self, spacegroup, indices, sgoffset=[0, 0, 0]): - """Perform symmetry expansion for atoms at given indices. - Temperature factors may be corrected to reflect the symmetry. - All constraints for expanded atoms are erased with the exception - of the occupancy("occ". Constraints of unaffected atoms are adjusted - for new positions self.initial. + """Perform symmetry expansion for atoms at given indices. Temperature + factors may be corrected to reflect the symmetry. All constraints for + expanded atoms are erased with the exception of the occupancy("occ". + Constraints of unaffected atoms are adjusted for new positions + self.initial. spacegroup -- instance of SpaceGroup from diffpy.structure indices -- list of integer indices of atoms to be expanded @@ -463,10 +463,9 @@ def expandAsymmetricUnit(self, spacegroup, indices, sgoffset=[0, 0, 0]): def applySymmetryConstraints(self, spacegroup, indices, posflag, Uijflag, sgoffset=[0, 0, 0]): """Generate symmetry constraints for positions and thermal factors. - Both positions and thermal factors may get corrected to reflect - space group symmetry. Old positional and thermal constraints get - erased. New parameter indices start at fist decade after the last - used parameter. + Both positions and thermal factors may get corrected to reflect space + group symmetry. Old positional and thermal constraints get erased. New + parameter indices start at fist decade after the last used parameter. spacegroup -- instance of SpaceGroup from diffpy.structure indices -- list of integer indices of atoms to be expanded @@ -540,9 +539,9 @@ def applySymmetryConstraints(self, spacegroup, indices, posflag, Uijflag, sgoffs return def setSelectedPairs(self, s): - """Set the value of selected_pairs to s, raise ControlValueError when - s has invalid syntax. The selected_pairs is a comma separated list of - words formatted as + """Set the value of selected_pairs to s, raise ControlValueError when s + has invalid syntax. The selected_pairs is a comma separated list of + words formatted as. [!]{element|indexOrRange|all}-[!]{element|indexOrRange|all} @@ -718,7 +717,7 @@ def _parseAtomSelectionString(self, s): return rv def copy(self, other=None): - """copy self to other. if other is None, create new instance + """Copy self to other. if other is None, create new instance. other -- reference to other object @@ -808,14 +807,14 @@ def save(self, z, subpath): return def getYNames(self): - """get names of data item which can be plotted as y + """Get names of data item which can be plotted as y. returns a name str list """ return list(self.constraints.keys()) def getXNames(self): - """get names of data item which can be plotted as x + """Get names of data item which can be plotted as x. returns a name str list """ @@ -823,7 +822,7 @@ def getXNames(self): return [] def getData(self, name, step=-1): - """get self's data member + """Get self's data member. name -- data item name step -- step info, it can be: @@ -850,9 +849,9 @@ def getData(self, name, step=-1): def _makeParNames(sympars, parzeroindex): """Return a tuple of (symbols, parvalues), where symbols is a list of unique PDFFit parameter strings in "@%i" format and parvalues is a - dictionary of parameter indices and their values. - The symbols have indices 10n + (1, 2, 3) when referring to x, y, z, or - 10n + (4, 5, 6, 7, 8, 9) when referring to Uij. + dictionary of parameter indices and their values. The symbols have indices + 10n + (1, 2, 3) when referring to x, y, z, or 10n + (4, 5, 6, 7, 8, 9) when + referring to Uij. sympars -- pospars or Upars attribute of a SymmetryConstraints object Must be a sequence of symbols and values. diff --git a/src/diffpy/pdfgui/control/fitting.py b/src/diffpy/pdfgui/control/fitting.py index e89e0fcb..c33a6b8b 100644 --- a/src/diffpy/pdfgui/control/fitting.py +++ b/src/diffpy/pdfgui/control/fitting.py @@ -92,10 +92,10 @@ class Fitting(Organizer): PAUSED = 1 << 11 class Worker(threading.Thread): - """Worker is the daemon thread of fitting""" + """Worker is the daemon thread of fitting.""" def __init__(self, fitting): - """Worker ( self, fitting) --> initialize + """Worker ( self, fitting) --> initialize. fitting -- fitting object """ @@ -103,7 +103,7 @@ def __init__(self, fitting): self.fitting = fitting def run(self): - """overload function from Thread""" + """Overload function from Thread.""" try: self.fitting.run() except ControlError as error: @@ -118,7 +118,7 @@ def run(self): return def __init__(self, name): - """initialize + """initialize. name -- name of this fitting """ @@ -151,7 +151,7 @@ def __init__(self, name): self.itemIndex = 0 def __changeStatus(self, fitStatus=None, jobStatus=None): - """change current status of fitting + """Change current status of fitting. fitStatus -- new fitting status jobStatus -- new thread status @@ -165,19 +165,19 @@ def __changeStatus(self, fitStatus=None, jobStatus=None): gui.postEvent(gui.OUTPUT, None) def _release(self): - """release resources""" + """Release resources.""" if self.server: # server has been allocated, we need free the memory self.server.reset() def _getStrId(self): - """make a string identifier + """Make a string identifier. return value: string id """ return "f_" + self.name def copy(self, other=None): - """copy self to other. if other is None, create an instance + """Copy self to other. if other is None, create an instance. other -- ref to other object return value: reference to copied object @@ -195,7 +195,7 @@ def copy(self, other=None): return other def load(self, z, subpath): - """load data from a zipped project file + """Load data from a zipped project file. z -- zipped project file subpath -- path to its own storage within project file @@ -220,7 +220,7 @@ def load(self, z, subpath): return Organizer.load(self, z, subpath) def save(self, z, subpath): - """save data from a zipped project file + """Save data from a zipped project file. z -- zipped project file subpath -- path to its own storage within project file @@ -288,8 +288,8 @@ def applyParameters(self): def changeParameterIndex(self, oldidx, newidx): """Change a parameter index to a new value. - This will replace all instances of one parameter name with another in - the containing fit. + This will replace all instances of one parameter name with + another in the containing fit. """ # Change the index in the current structure for struc in self.strucs: @@ -314,7 +314,7 @@ def changeParameterIndex(self, oldidx, newidx): return def queue(self, enter=True): - """queue or dequeue self + """Queue or dequeue self. enter -- True to queue, False to dequeue """ @@ -326,7 +326,7 @@ def queue(self, enter=True): self.__changeStatus(jobStatus=Fitting.VOID) def getServer(self): - """get a PDFfit2 instance either locally or remotely""" + """Get a PDFfit2 instance either locally or remotely.""" if self.fitStatus != Fitting.INITIALIZED: return # create a new instance of calculation server @@ -336,7 +336,7 @@ def getServer(self): self.__changeStatus(fitStatus=Fitting.CONNECTED) def configure(self): - """configure fitting""" + """Configure fitting.""" if self.fitStatus != Fitting.CONNECTED: return @@ -386,7 +386,7 @@ def configure(self): return def resetStatus(self): - """reset status back to initialized""" + """Reset status back to initialized.""" self.snapshots = [] self.step = 0 if self.fitStatus == Fitting.INITIALIZED: @@ -396,7 +396,7 @@ def resetStatus(self): self.__changeStatus(fitStatus=Fitting.INITIALIZED) def run(self): - """function to be run in daemon thread.""" + """Function to be run in daemon thread.""" # Begin self.__changeStatus(jobStatus=Fitting.RUNNING) try: @@ -446,9 +446,9 @@ def _configureBondCalculation(self, struc): return def outputBondAngle(self, struc, i, j, k): - """Output bond angle defined by atoms i, j, k. - The angle is calculated using the shortest lengths ji and jk with - respect to periodic boundary conditions. + """Output bond angle defined by atoms i, j, k. The angle is calculated + using the shortest lengths ji and jk with respect to periodic boundary + conditions. struc -- instance of PDFStructure i, j, k -- atom indices starting at 1 @@ -470,8 +470,8 @@ def outputBondAngle(self, struc, i, j, k): return def outputBondLengthAtoms(self, struc, i, j): - """Output shortest bond between atoms i, j. - Periodic boundary conditions are applied to find the shortest bond. + """Output shortest bond between atoms i, j. Periodic boundary + conditions are applied to find the shortest bond. struc -- instance of PDFStructure i, j -- atom indices starting at 1 @@ -518,7 +518,7 @@ def outputBondLengthTypes(self, struc, a1, a2, lb, ub): return def pause(self, bPause=None): - """pause ( self, bPause = None ) --> pause a fitting process + """Pause ( self, bPause = None ) --> pause a fitting process. bPause -- True to pause, False to restart. If None, it will figure out by itself. @@ -533,7 +533,7 @@ def pause(self, bPause=None): self.pauseEvent.set() def start(self): - """start fitting""" + """Start fitting.""" # check if paused if self.jobStatus == Fitting.PAUSED: self.pause(False) @@ -549,7 +549,7 @@ def start(self): self.thread.start() def stop(self): - """stop the fitting""" + """Stop the fitting.""" self.stopped = True # wake up daemon thread if it is paused @@ -557,20 +557,20 @@ def stop(self): self.pause(False) def isThreadRunning(self): - """check if fitting thread is running + """Check if fitting thread is running. return: True if running, False otherwise """ return self.thread is not None and self.thread.is_alive() def join(self): - """wait for current fitting to finish""" + """Wait for current fitting to finish.""" if self.thread: self.thread.join() self.thread = None def close(self, force=False): - """close up the fitting in order to exit + """Close up the fitting in order to exit. force -- if force to exit """ @@ -586,8 +586,8 @@ def close(self, force=False): self.thread.join() def buildNameDict(self): - """build up a data name dictionary, which will map data name to a - unique index + """Build up a data name dictionary, which will map data name to a + unique index. The private dataNameDict has such structure: { 'd_data1':{'Gobs':12, 'Gcalc':11, ....}, @@ -636,8 +636,8 @@ def buildNameDict(self): self.dataNameDict = dataNameDict def appendStep(self, source): - """after a refinement step is done, append all data from self to the - historical storage, i.e., self.snapshots + """After a refinement step is done, append all data from self to the + historical storage, i.e., self.snapshots. source -- where to get the fitted data, in deed it's a PdfFit2 instance """ @@ -727,7 +727,7 @@ def refine_step(self): return finished def getYNames(self): - """get names of data item which can be plotted as y + """Get names of data item which can be plotted as y. returns a name str list """ @@ -736,14 +736,14 @@ def getYNames(self): return names def getXNames(self): - """get names of data item which can be plotted as x + """Get names of data item which can be plotted as x. returns a name str list """ return [] def getData(self, name, step=-1): - """get self's data member + """Get self's data member. name -- data item name step -- step info, it can be: @@ -763,7 +763,7 @@ def getData(self, name, step=-1): return self._getData(self, name, step) def getMetaDataNames(self): - """return all applicable meta data names""" + """Return all applicable meta data names.""" names = [] for dataset in self.datasets: # build up the name list @@ -776,7 +776,7 @@ def getMetaDataNames(self): return names def getMetaData(self, name): - """get meta data value + """Get meta data value. name -- meta data name returns meta data value @@ -787,7 +787,7 @@ def getMetaData(self, name): return None def _getData(self, id, name, step=-1): - """get any data member from snapshots + """Get any data member from snapshots. id -- reference to a Fitting/Calculation/Phase/DataSet object name -- data item name diff --git a/src/diffpy/pdfgui/control/organizer.py b/src/diffpy/pdfgui/control/organizer.py index 51898fb7..cb0787b4 100644 --- a/src/diffpy/pdfgui/control/organizer.py +++ b/src/diffpy/pdfgui/control/organizer.py @@ -30,8 +30,8 @@ def spd_constrained(ds): class Organizer(PDFComponent): - """Base class for Fitting. It holds separate lists of datasets, - strucs and calculations + """Base class for Fitting. It holds separate lists of datasets, strucs and + calculations. datasets: dataset list strucs: structure list @@ -39,7 +39,7 @@ class Organizer(PDFComponent): """ def __init__(self, name): - """initialize + """initialize. name -- component name """ @@ -72,7 +72,7 @@ def __findList(self, id): raise ControlTypeError(emsg) def add(self, id, position=None): - """add structure/dataset/calculation + """Add structure/dataset/calculation. id -- reference to structure/dataset/calculation position -- position to insert, by default the last one @@ -86,7 +86,7 @@ def add(self, id, position=None): id.owner = self def remove(self, id): - """remove structure/dataset/calculation + """Remove structure/dataset/calculation. id -- reference to structure/dataset/calculation """ @@ -95,7 +95,7 @@ def remove(self, id): return id def rename(self, id, newname): - """rename structure/dataset/calculation + """Rename structure/dataset/calculation. id -- reference to structure/dataset/calculation newname -- new name to be given @@ -104,7 +104,7 @@ def rename(self, id, newname): objList.rename(id.name, newname) def index(self, id): - """find the position of item in the list + """Find the position of item in the list. id -- id of object return : object position @@ -117,7 +117,7 @@ def hasStructures(self): return len(self.strucs) > 0 def getStructure(self, pos): - """get structure by position + """Get structure by position. pos -- the position of structure in the list """ @@ -130,7 +130,7 @@ def hasDataSets(self): return len(self.datasets) > 0 def getDataSet(self, pos): - """get dataset by position + """Get dataset by position. pos -- the position of dataset in the list """ @@ -143,7 +143,7 @@ def hasCalculations(self): return len(self.calcs) > 0 def getCalculation(self, pos): - """get calculation by position + """Get calculation by position. pos -- the position of calculation in the list """ @@ -152,7 +152,7 @@ def getCalculation(self, pos): return self.calcs[pos] def load(self, z, subpath): - """load data from a zipped project file + """Load data from a zipped project file. z -- zipped project file subpath -- path to its own storage within project file @@ -187,7 +187,7 @@ def load(self, z, subpath): return self.organization() def save(self, z, subpath): - """save data from a zipped project file + """Save data from a zipped project file. z -- zipped project file subpath -- path to its own storage within project file @@ -204,7 +204,7 @@ def save(self, z, subpath): return def copy(self, other=None): - """copy self to other. if other is None, create an instance + """Copy self to other. if other is None, create an instance. other -- ref to other object returns reference to copied object @@ -221,7 +221,7 @@ def copy(self, other=None): return other def organization(self): - """get internal organization + """Get internal organization. returns a tree of internal hierarchy """ @@ -243,8 +243,8 @@ def __forward_spdiameter(self): """Copy spdiameter value loaded from fit or calculation to phase. This method takes care of loading old PDFgui projects where - spdiameter belonged to FitDataSet or Calculation classes. - It should be called only from the Organizer.load method. + spdiameter belonged to FitDataSet or Calculation classes. It + should be called only from the Organizer.load method. """ # Jump out if any of structures has spdiameter set for stru in self.strucs: diff --git a/src/diffpy/pdfgui/control/parameter.py b/src/diffpy/pdfgui/control/parameter.py index a162b96c..a4410ee4 100644 --- a/src/diffpy/pdfgui/control/parameter.py +++ b/src/diffpy/pdfgui/control/parameter.py @@ -12,10 +12,8 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""class Parameter for handling one refined parameter -To be stored in Fitting.parameters { idx : parameter } dictionary -""" +"""Class Parameter for handling one refined parameter To be stored in +Fitting.parameters { idx : parameter } dictionary.""" from diffpy.pdfgui.control.controlerrors import ( ControlError, @@ -27,8 +25,8 @@ class Parameter: """Parameter is class for value and properties of refined parameter. - Because the initial value of Parameter may come from another Fitting, - it is accessed by setInitial(), initialStr() and initialValue() methods. + Because the initial value of Parameter may come from another Fitting, it is + accessed by setInitial(), initialStr() and initialValue() methods. Data members: idx -- integer identifier of this parameter in PdfFit @@ -44,7 +42,7 @@ class Parameter: # fits should reference PDFGuiControl.fits def __init__(self, idx, initial=0.0): - """Initialize new parameter + """Initialize new parameter. idx -- idx of this parameter in PdfFit initial -- optional initial value of the parameter. @@ -60,7 +58,7 @@ def __init__(self, idx, initial=0.0): return def setInitial(self, initial): - """set initial value to float or refined value from another Fitting. + """Set initial value to float or refined value from another Fitting. initial -- initial value, it can be something convertible to float, Fitting reference or string in "=fitname" or @@ -153,8 +151,8 @@ def __getLinkedValue(self): def __findLinkedFitting(self): """Private search for linked Fitting by name and by representation. - Should be called only when initial value is linked to another - Fitting. Updates self.__initial and self.__fitrepr. + Should be called only when initial value is linked to another Fitting. + Updates self.__initial and self.__fitrepr. returns reference to Fitting when found or None """ diff --git a/src/diffpy/pdfgui/control/pdfcomponent.py b/src/diffpy/pdfgui/control/pdfcomponent.py index d3ac7903..2dc0a393 100644 --- a/src/diffpy/pdfgui/control/pdfcomponent.py +++ b/src/diffpy/pdfgui/control/pdfcomponent.py @@ -18,14 +18,14 @@ class PDFComponent(object): """Common base class.""" def __init__(self, name): - """initialize + """initialize. name -- object name """ self.name = name def close(self, force=False): - """close myself + """Close myself. force -- if forcibly (no wait) """ diff --git a/src/diffpy/pdfgui/control/pdfdataset.py b/src/diffpy/pdfgui/control/pdfdataset.py index d7d76725..1027e067 100644 --- a/src/diffpy/pdfgui/control/pdfdataset.py +++ b/src/diffpy/pdfgui/control/pdfdataset.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""class PDFDataSet for experimental PDF data. -""" +"""Class PDFDataSet for experimental PDF data.""" import copy import os.path @@ -82,7 +80,7 @@ def __init__(self, name): return def clear(self): - """reset all data members to initial empty values""" + """Reset all data members to initial empty values.""" self.robs = [] self.Gobs = [] self.drobs = [] @@ -101,8 +99,8 @@ def clear(self): return def setvar(self, var, value): - """Assign data member using PdfFit-style variable. - Used by applyParameters(). + """Assign data member using PdfFit-style variable. Used by + applyParameters(). var -- string representation of dataset PdfFit variable. Possible values: qdamp, qbroad, dscale @@ -118,8 +116,8 @@ def setvar(self, var, value): return def getvar(self, var): - """Obtain value corresponding to PdfFit dataset variable. - Used by findParameters(). + """Obtain value corresponding to PdfFit dataset variable. Used by + findParameters(). var -- string representation of dataset PdfFit variable. Possible values: qdamp, qbroad, dscale @@ -135,7 +133,7 @@ def getvar(self, var): return value def read(self, filename): - """load data from PDFGetX2 or PDFGetN gr file + """Load data from PDFGetX2 or PDFGetN gr file. filename -- file to read from @@ -155,7 +153,7 @@ def read(self, filename): return self def readStr(self, datastring): - """read experimental PDF data from a string + """Read experimental PDF data from a string. datastring -- string of raw data @@ -336,7 +334,7 @@ def writeStr(self): return datastring def copy(self, other=None): - """copy self to other. if other is None, create new instance + """Copy self to other. if other is None, create new instance. other -- ref to other object returns reference to copied object diff --git a/src/diffpy/pdfgui/control/pdfguicontrol.py b/src/diffpy/pdfgui/control/pdfguicontrol.py index 87f3b39d..d1eb4d6b 100644 --- a/src/diffpy/pdfgui/control/pdfguicontrol.py +++ b/src/diffpy/pdfgui/control/pdfguicontrol.py @@ -34,13 +34,14 @@ class PDFGuiControl: - """PDFGuiControl holds all the data GUI needs to access or change - It has a container of Calculation and Fitting instances. + """PDFGuiControl holds all the data GUI needs to access or change It has a + container of Calculation and Fitting instances. + Each Calculation and Fitting has a unique name. """ def __init__(self, gui=None): - """initialize + """initialize. gui: main panel of GUI """ @@ -57,7 +58,7 @@ def __init__(self, gui=None): # self.startQueue() def reset(self): - """clean up for a new project""" + """Clean up for a new project.""" self.fits = PDFList() self.plots = PDFList() self.journal = "" @@ -88,12 +89,12 @@ def run(self): time.sleep(1) def startQueue(self): - """start queue manager""" + """Start queue manager.""" self.queueManager.daemon = True self.queueManager.start() def checkQueue(self): - """find next fitting in the queue and start it""" + """Find next fitting in the queue and start it.""" if self.currentFitting: # wait for currentFitting self.currentFitting.join() @@ -112,7 +113,7 @@ def checkQueue(self): self.currentFitting.start() def enqueue(self, fits, enter=True): - """enqueue or dequeue fittings + """Enqueue or dequeue fittings. fits -- list of fittings to be queued/dequeued enter -- True to queue, False to dequeue @@ -144,7 +145,7 @@ def enqueue(self, fits, enter=True): self.lock.release() def close(self, force=True): - """close a project + """Close a project. force -- if exit forciably """ @@ -157,13 +158,13 @@ def close(self, force=True): self.reset() def exit(self): - """exit when program finished""" + """Exit when program finished.""" self.close() if self.queueManager.is_alive(): self.queueManager.running = False def newFitting(self, name, position=None): - """insert a new instance of Fitting + """Insert a new instance of Fitting. name -- unique name for this Fitting position -- where Fitting is inserted, default is last place @@ -175,7 +176,7 @@ def newFitting(self, name, position=None): return fitting def newCalculation(self, targetID, name, position=None): - """insert a new instance of Calculation to a Fitting + """Insert a new instance of Calculation to a Fitting. targetID -- reference to Fitting name -- unique name for this Calculation @@ -189,7 +190,7 @@ def newCalculation(self, targetID, name, position=None): return calculation def newStructure(self, targetID, name, position=None): - """add blank structure to a Fitting + """Add blank structure to a Fitting. targetID -- reference to Fitting name -- name of the new Structure @@ -205,7 +206,7 @@ def newStructure(self, targetID, name, position=None): return struct def loadStructure(self, targetID, filename, name=None, position=None): - """add blank structure to a Fitting + """Add blank structure to a Fitting. targetID -- reference to Fitting name -- name of the new Structure, default is file basename @@ -223,7 +224,7 @@ def loadStructure(self, targetID, filename, name=None, position=None): return struct def loadDataset(self, targetID, filename, name=None, position=None): - """load Dataset from a file to a Fitting + """Load Dataset from a file to a Fitting. targetID -- reference to Fitting name -- name of the new Dataset, default is file basename @@ -243,7 +244,7 @@ def loadDataset(self, targetID, filename, name=None, position=None): return dataset def add(self, ID, position=None): - """add fitting/calculation to internal list + """Add fitting/calculation to internal list. Id -- reference to the object to be inserted position -- where the object is to be inserted, default is last @@ -259,7 +260,7 @@ def add(self, ID, position=None): return ID def __findOwner(self, ID): - """find where the ID belongs + """Find where the ID belongs. ID -- object which can be Fitting,Calculation,FitDataSet or FitStructure return: a PDFList holding that object @@ -273,8 +274,7 @@ def __findOwner(self, ID): raise ControlTypeError("Object %s doesn't exit in the list" % ID.name) def rename(self, ID, new_name): - """rename Fitting, Calculation, Dataset or Structure - identified by ID + """Rename Fitting, Calculation, Dataset or Structure identified by ID. ID: reference to the object to be renamed new_name: new name to be given to the object @@ -283,8 +283,7 @@ def rename(self, ID, new_name): container.rename(ID, new_name) def remove(self, ID): - """remove Fitting, Calculation, Dataset or Structure - identified by ID + """Remove Fitting, Calculation, Dataset or Structure identified by ID. ID: reference to the object to be removed return: removed object @@ -294,7 +293,7 @@ def remove(self, ID): return ID def index(self, ID): - """return position index of an object in its owner list + """Return position index of an object in its owner list. ID -- ID of object return: index @@ -303,7 +302,7 @@ def index(self, ID): return container.index(ID) def copy(self, src): - """copy src object + """Copy src object. src -- reference to the source object return: reference to the copy @@ -312,8 +311,8 @@ def copy(self, src): return newObject def paste(self, dup, target=None, new_name=None, position=None): - """paste copied object to target under new_name, the default new_name - will be name of src + """Paste copied object to target under new_name, the default new_name + will be name of src. dup -- reference to the copied object target -- target object where the copy should be inserted @@ -334,13 +333,13 @@ def paste(self, dup, target=None, new_name=None, position=None): return o def load(self, projfile): - """load project from projfile. + """Load project from projfile. projfile -- a zip file of everything """ def _nameParser(namelist): - """parse the zipfile name list to get a file tree""" + """Parse the zipfile name list to get a file tree.""" fileTree = {} for name in namelist: subs = name.split("/") @@ -418,14 +417,14 @@ def _nameParser(namelist): return organizations def save(self, projfile=None): - """Save project to projfile, default projfile is self.projfile + """Save project to projfile, default projfile is self.projfile. This method first writes to a temporary file and only when - successful, it overwrites projfile with the temporary file content. - These steps prevent corruption of existing projects should - something go wrong in the middle of save. As an added benefit, - all permissions and ownership flags in an existing projfile - are preserved. + successful, it overwrites projfile with the temporary file + content. These steps prevent corruption of existing projects + should something go wrong in the middle of save. As an added + benefit, all permissions and ownership flags in an existing + projfile are preserved. """ if projfile is not None: self.projfile = projfile @@ -472,7 +471,7 @@ def save(self, projfile=None): return def plot(self, xItem, yItems, Ids, shift=1.0, dry=False): - """Make a 2D plot + """Make a 2D plot. xItem -- x data item name yItems -- list of y data item names @@ -487,7 +486,7 @@ def plot(self, xItem, yItems, Ids, shift=1.0, dry=False): self.plots.append(plotter) def start(self, IDlist): - """execute Calculations and Fittings in IDlist.""" + """Execute Calculations and Fittings in IDlist.""" self.redirectStdout() fits = [ID for ID in IDlist if isinstance(ID, Fitting)] # only add calcs which is not in fits, because fits will automatically run calcs under it anyway @@ -497,14 +496,14 @@ def start(self, IDlist): self.enqueue(fits) def stop(self): - """stop all Fittings""" + """Stop all Fittings.""" self.enqueue(self.fits, False) for id in self.fits: if isinstance(id, Fitting): id.stop() def __validateType(self, targetID): - """check if targetID is a Fitting class""" + """Check if targetID is a Fitting class.""" if not isinstance(targetID, Organizer): raise ControlTypeError("Can't insert to %s" % self.__class__.__name__) @@ -533,7 +532,7 @@ def getEngineOutput(self): def pdfguicontrol(*args, **kwargs): - """This function will return the single instance of class PDFGuiControl""" + """This function will return the single instance of class PDFGuiControl.""" global _pdfguicontrol if _pdfguicontrol is None: _pdfguicontrol = PDFGuiControl(*args, **kwargs) @@ -557,10 +556,11 @@ def _find_global(moduleName, clsName): class CtrlUnpickler: """Occasionally the project file may be generated on a platform where - PYTHONPATH is not correctly set up. CtrlUnpickler will transform the - module path in the project file to be relative to diffpy so that it can - be safely loaded. Only constraints and parameters need this class to un- - pickle. + PYTHONPATH is not correctly set up. + + CtrlUnpickler will transform the module path in the project file to + be relative to diffpy so that it can be safely loaded. Only + constraints and parameters need this class to un- pickle. """ @staticmethod diff --git a/src/diffpy/pdfgui/control/pdfguimacros.py b/src/diffpy/pdfgui/control/pdfguimacros.py index e91abe76..02eb5a81 100644 --- a/src/diffpy/pdfgui/control/pdfguimacros.py +++ b/src/diffpy/pdfgui/control/pdfguimacros.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """Methods for macros used in pdfgui.""" from __future__ import print_function diff --git a/src/diffpy/pdfgui/control/pdflist.py b/src/diffpy/pdfgui/control/pdflist.py index 00ec4a13..71bf3e4f 100644 --- a/src/diffpy/pdfgui/control/pdflist.py +++ b/src/diffpy/pdfgui/control/pdflist.py @@ -17,12 +17,11 @@ class PDFList(list): - """list class of PDFComponent, which can be accessed through index or a - name string - """ + """List class of PDFComponent, which can be accessed through index or a + name string.""" def __init__(self, *args): - """Initialize + """Initialize. args -- argument list """ @@ -30,7 +29,7 @@ def __init__(self, *args): return def __getitem__(self, idnm): - """Get the item by idnm + """Get the item by idnm. idnm -- The index or name of the item return: The requested object @@ -45,7 +44,7 @@ def __getitem__(self, idnm): raise ControlKeyError("'%s' does not exist" % idnm) def __setitem__(self, idnm, obj): - """Set the item by idnm + """Set the item by idnm. idnm -- The index or name of the item obj -- The object to be inserted @@ -75,7 +74,7 @@ def __delitem__(self, idnm): raise ControlKeyError("'%s' does not exist" % idnm) def rename(self, idnmrf, newname): - """Rename an item + """Rename an item. idnmrf -- index,name or reference to the object newname -- new name @@ -98,14 +97,14 @@ def keys(self): return [x.name for x in self] def values(self): - """Get all held objects + """Get all held objects. return: list of objects """ return self[:] def items(self): - """Get name-object pairs + """Get name-object pairs. return: a list of tuple ( name, object) """ diff --git a/src/diffpy/pdfgui/control/pdfstructure.py b/src/diffpy/pdfgui/control/pdfstructure.py index a63f8692..881e17b2 100644 --- a/src/diffpy/pdfgui/control/pdfstructure.py +++ b/src/diffpy/pdfgui/control/pdfstructure.py @@ -36,8 +36,8 @@ def __init__(self, name, *args, **kwargs): return def read(self, filename, format="auto"): - """Load structure from a file, raise ControlFileError for invalid - or unknown structure format. + """Load structure from a file, raise ControlFileError for invalid or + unknown structure format. filename -- file to be loaded format -- structure format such as 'pdffit', 'pdb', 'xyz'. When @@ -58,7 +58,7 @@ def read(self, filename, format="auto"): return p def copy(self, other=None): - """copy self to other. if other is None, create an instance + """Copy self to other. if other is None, create an instance. other -- ref to other object @@ -76,9 +76,8 @@ def copy(self, other=None): _allowed_pdffit_vars = dict.fromkeys(("spdiameter", "stepcut", "delta1", "delta2", "sratio", "rcut")) def setvar(self, var, value): - """assign to data member using PdfFit-style variable - This can be used when applying constraint equations with particular - parameter values. + """Assign to data member using PdfFit-style variable This can be used + when applying constraint equations with particular parameter values. var -- string representation of PdfFit variable. Possible values: pscale, spdiameter, stepcut, delta1, delta2, sratio, rcut, @@ -129,9 +128,8 @@ def setvar(self, var, value): return def getvar(self, var): - """obtain value corresponding to PdfFit phase variable var - This can be used when guessing Parameter values from constraints - dictionary. + """Obtain value corresponding to PdfFit phase variable var This can be + used when guessing Parameter values from constraints dictionary. var -- string representation of PdfFit variable. Possible values: pscale, spdiameter, stepcut, delta1, delta2, sratio, rcut, diff --git a/src/diffpy/pdfgui/control/plotter.py b/src/diffpy/pdfgui/control/plotter.py index 6fa5594c..b272d4f6 100644 --- a/src/diffpy/pdfgui/control/plotter.py +++ b/src/diffpy/pdfgui/control/plotter.py @@ -54,7 +54,7 @@ def _transName(name): - """translate name of y object + """Translate name of y object. This is mainly for plotting of parameters. GUI will pass in a integer to indicate which parameter to be plotted. However, in data storage the @@ -70,7 +70,7 @@ def _transName(name): def _fullName(dataId): - """construct full name""" + """Construct full name.""" from diffpy.pdfgui.control.fitting import Fitting if hasattr(dataId, "owner") and isinstance(dataId.owner, Fitting): @@ -80,7 +80,7 @@ def _fullName(dataId): def _buildStyle(plotter, name, group, yNames): - """trying to figure out a good style + """Trying to figure out a good style. 1. generally we want line style for Gcalc, Gdiff, crw, symbol style for Gobs, and line-symbol style for the rest @@ -135,12 +135,15 @@ def deblank(s): class Plotter(PDFComponent): - """Plots a single graph. It can have multiple curves.""" + """Plots a single graph. + + It can have multiple curves. + """ __plotWindowNumber = 1 class Curve: - """Curve stores the information for a curve in the plot + """Curve stores the information for a curve in the plot. There are three ways of forming x and y data lists. (1) r and g(r) from a single refinement are vectors by themselves @@ -167,7 +170,7 @@ class Curve: """ def __init__(self, name, plotwnd, xStr, yStr, steps, ids, offset, style): - """initialize + """initialize. name -- The curve name plotwnd -- The window where the curve is drawn @@ -206,7 +209,9 @@ def __init__(self, name, plotwnd, xStr, yStr, steps, ids, offset, style): self.validate() def validate(self): - """validate(self) --> check if the curve is valid. Validity + """Validate(self) --> check if the curve is valid. + + Validity is broken: (1) when xStr or yStr doesn't refer to a legal vector (2) when sizes of xStr and yStr don't match @@ -244,7 +249,7 @@ def validate(self): raise ControlConfigError(emsg) def notify(self, changedIds=None, plotwnd=None): - """notify Curve object certain data is updated + """Notify Curve object certain data is updated. changedIds -- objects to which changed data is associated with """ @@ -319,8 +324,9 @@ def _shift(y): return False def draw(self): - """draw the curve in the graph. It will make sure the data is OK, - and plot to the screen. + """Draw the curve in the graph. + + It will make sure the data is OK, and plot to the screen. """ if self.bMultiData: # xs and ys initialize here. They are actual data object to be @@ -360,7 +366,7 @@ def draw(self): return True def __init__(self, name=None): - """initialize + """initialize. name -- name of plot """ @@ -386,7 +392,7 @@ def __init__(self, name=None): return def close(self, force=True): - """close up the plot + """Close up the plot. force -- if True, close forcibly """ @@ -396,7 +402,7 @@ def close(self, force=True): self.window = None def onWindowClose(self): - """get called when self.window is closed by user""" + """Get called when self.window is closed by user.""" self.window = None try: self.controlCenter.plots.remove(self) @@ -405,7 +411,7 @@ def onWindowClose(self): pass def buildSymbolStyle(self, index=-1): - """generate a symbol style + """Generate a symbol style. index -- plotting style index """ @@ -426,7 +432,7 @@ def buildSymbolStyle(self, index=-1): } def buildLineStyle(self, index=-1): - """generate a line style + """Generate a line style. index -- plotting style index """ @@ -446,7 +452,7 @@ def buildLineStyle(self, index=-1): } def buildLineSymbolStyle(self, index=-1): - """generate a linesymbol style + """Generate a linesymbol style. index -- plotting style index """ @@ -456,7 +462,7 @@ def buildLineSymbolStyle(self, index=-1): return style def plot(self, xName, yNames, ids, shift, dry): - """Make a 2D plot + """Make a 2D plot. xName -- x data item name yNames -- list of y data item names @@ -579,7 +585,7 @@ def _addCurve(dataIds): self.show(True) def show(self, bShow=None): - """show the plot on screen + """Show the plot on screen. bShow -- True to show, False to Hide. None to toggle return value: current status of window @@ -596,7 +602,7 @@ def show(self, bShow=None): return self.isShown def notify(self, data): - """change of the data is notified + """Change of the data is notified. data -- data object that has changed """ @@ -613,7 +619,7 @@ def notify(self, data): self.window.replot() def export(self, filename): - """export current data to external file + """Export current data to external file. filename -- the name of the file to save data """ diff --git a/src/diffpy/pdfgui/control/structureviewer.py b/src/diffpy/pdfgui/control/structureviewer.py index 85308d10..128a2d8f 100644 --- a/src/diffpy/pdfgui/control/structureviewer.py +++ b/src/diffpy/pdfgui/control/structureviewer.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Structure plotting in an external viewer process. -""" +"""Structure plotting in an external viewer process.""" from __future__ import print_function @@ -38,11 +36,10 @@ def getStructureViewer(): class StructureViewer(object): - """Class for plotting structure in general structure viewer. - It takes care of creating temporary structure file in a desired - format and launching structure viewer as a background process. - The temporary files are removed when StructureViewer instance - goes out of scope. + """Class for plotting structure in general structure viewer. It takes care + of creating temporary structure file in a desired format and launching + structure viewer as a background process. The temporary files are removed + when StructureViewer instance goes out of scope. Data attributes: @@ -62,10 +59,9 @@ class StructureViewer(object): """ def __init__(self, executable=None, argstr=None, fileformat=None): - """Create StructureViewer instance. All arguments are optional, - they override defaults described in class docstring. The - configuration can be changed later using setConfig method. - + """Create StructureViewer instance. All arguments are optional, they + override defaults described in class docstring. The configuration can + be changed later using setConfig method. executable -- path to the structure viewer executable argstr -- argument string for the viewer program, it can use @@ -147,7 +143,8 @@ def plot(self, stru): return def __del__(self): - """Remove temporary files created by this instance of StructureViewer.""" + """Remove temporary files created by this instance of + StructureViewer.""" # short circuit if nothing has been created if self._tmpdir is None: return diff --git a/src/diffpy/pdfgui/gui/aboutdialog.py b/src/diffpy/pdfgui/gui/aboutdialog.py index 589e6569..fb242433 100644 --- a/src/diffpy/pdfgui/gui/aboutdialog.py +++ b/src/diffpy/pdfgui/gui/aboutdialog.py @@ -60,7 +60,7 @@ def launchBrowser(url): - """Launches browser and opens specified url + """Launches browser and opens specified url. In some cases may require BROWSER environment variable to be set up. @@ -72,10 +72,10 @@ def launchBrowser(url): class DialogAbout(wx.Dialog): - """ "About" Dialog + """The "About" Dialog. - Shows product name, current version, authors, and link to the product page. - Current version is taken from version.py + Shows product name, current version, authors, and link to the + product page. Current version is taken from version.py """ def __init__(self, *args, **kwds): diff --git a/src/diffpy/pdfgui/gui/adddatapanel.py b/src/diffpy/pdfgui/gui/adddatapanel.py index 6e9ff4ae..bf703bbd 100644 --- a/src/diffpy/pdfgui/gui/adddatapanel.py +++ b/src/diffpy/pdfgui/gui/adddatapanel.py @@ -177,7 +177,10 @@ def onOpen(self, event): # wxGlade: AddDataPanel. return def onCancel(self, event): # wxGlade: AddDataPanel. - """Cancel this addition. Go back to the last panel.""" + """Cancel this addition. + + Go back to the last panel. + """ if self.entrypoint is None: return self.mainFrame.setMode("fitting") diff --git a/src/diffpy/pdfgui/gui/addphasepanel.py b/src/diffpy/pdfgui/gui/addphasepanel.py index 20e6cce6..21e1e358 100644 --- a/src/diffpy/pdfgui/gui/addphasepanel.py +++ b/src/diffpy/pdfgui/gui/addphasepanel.py @@ -23,7 +23,7 @@ class AddPhasePanel(wx.Panel, PDFPanel): - """Panel for adding a phase + """Panel for adding a phase. Several items must know to this panel so it knows where to try to insert the phase. @@ -150,8 +150,8 @@ def onOpen(self, event): # wxGlade: AddPhasePanel. """Add a the new phase to the tree. The phase is added as a child of entryfit, right after the - entryphase, if it exists. If entryphase is None, the new phase is - appended to the end of the children of entryfit. + entryphase, if it exists. If entryphase is None, the new phase + is appended to the end of the children of entryfit. """ import os.path @@ -223,7 +223,10 @@ def onNew(self, event): # wxGlade: AddPhasePanel. return def onCancel(self, event): # wxGlade: AddPhasePanel. - """Cancel this addition. Go back to the last panel.""" + """Cancel this addition. + + Go back to the last panel. + """ self.mainFrame.setMode("fitting") self.treeCtrlMain.SetItemBold(self.entrypoint, False) self.treeCtrlMain.UnselectAll() diff --git a/src/diffpy/pdfgui/gui/blankpanel.py b/src/diffpy/pdfgui/gui/blankpanel.py index 9d10e9bf..d989e94b 100644 --- a/src/diffpy/pdfgui/gui/blankpanel.py +++ b/src/diffpy/pdfgui/gui/blankpanel.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """This module contains the BlankPanel class.""" import wx diff --git a/src/diffpy/pdfgui/gui/bondangledialog.py b/src/diffpy/pdfgui/gui/bondangledialog.py index a58c8df4..0ae91afa 100644 --- a/src/diffpy/pdfgui/gui/bondangledialog.py +++ b/src/diffpy/pdfgui/gui/bondangledialog.py @@ -91,8 +91,8 @@ def __customProperties(self): def setStructure(self, structure): """Set the structure and update the widgets. - This must be called before the spin control boxes will be settable to - anything other than 1. + This must be called before the spin control boxes will be + settable to anything other than 1. """ natoms = len(structure) self.aSpinCtrl.SetRange(1, natoms) diff --git a/src/diffpy/pdfgui/gui/bondlengthdialog.py b/src/diffpy/pdfgui/gui/bondlengthdialog.py index 7624009a..67a141bc 100644 --- a/src/diffpy/pdfgui/gui/bondlengthdialog.py +++ b/src/diffpy/pdfgui/gui/bondlengthdialog.py @@ -141,8 +141,8 @@ def __customProperties(self): def setStructure(self, structure): """Set the structure and update the widgets. - This must be called before the spin control boxes will be settable to - anything other than 1. + This must be called before the spin control boxes will be + settable to anything other than 1. """ self.okButton.Enable(True) diff --git a/src/diffpy/pdfgui/gui/datasetconfigurepanel.py b/src/diffpy/pdfgui/gui/datasetconfigurepanel.py index e5dab596..cf32dfb6 100644 --- a/src/diffpy/pdfgui/gui/datasetconfigurepanel.py +++ b/src/diffpy/pdfgui/gui/datasetconfigurepanel.py @@ -369,8 +369,8 @@ def __coerseText(self, value): def __adjustFitRange(self, name, value): """Check the fit range values. - The fit range values are set to their defaults (the data range) when the - fit range is nonsensical. + The fit range values are set to their defaults (the data range) + when the fit range is nonsensical. """ if name == "fitrmin": if value < self.configuration.rmin or value >= self.configuration.fitrmax: @@ -394,8 +394,8 @@ def onStype(self, event): # wxGlade: DataSetConfigurePanel. def onSampling(self, event): # wxGlade: DataSetConfigurePanel. """Record how the data is to be sampled during the fit. - This does not use the event argument, so feel free to call this method - programmatically. + This does not use the event argument, so feel free to call this + method programmatically. """ si = self.radioBoxSampling.GetSelection() oldsampling = self.configuration.getFitSamplingType() diff --git a/src/diffpy/pdfgui/gui/datasetconstraintpanel.py b/src/diffpy/pdfgui/gui/datasetconstraintpanel.py index 1455fca8..267f4664 100644 --- a/src/diffpy/pdfgui/gui/datasetconstraintpanel.py +++ b/src/diffpy/pdfgui/gui/datasetconstraintpanel.py @@ -115,10 +115,8 @@ def __customProperties(self): def setConstraintsData(self): """Set the values in the constraints panel. - The values come from the constraints member dictionary. - dscale - qdamp - qbroad + The values come from the constraints member dictionary. dscale + qdamp qbroad """ for par, ctrlName in self.ctrlMap.items(): textCtrl = getattr(self, ctrlName) diff --git a/src/diffpy/pdfgui/gui/debugoptions.py b/src/diffpy/pdfgui/gui/debugoptions.py index 0404eefa..167d868b 100644 --- a/src/diffpy/pdfgui/gui/debugoptions.py +++ b/src/diffpy/pdfgui/gui/debugoptions.py @@ -12,17 +12,17 @@ # See LICENSE.txt for license information. # ############################################################################## +"""DebugOptions class for storing guess three time what. -"""DebugOptions class for storing guess three time what - -There should be exactly one instance of DebugOptions in pdfguiglobals module. +There should be exactly one instance of DebugOptions in pdfguiglobals +module. """ class DebugOptions: - """DebugOptions is a place to store various debugging options. - There should be just one instance defined in pdfguiglobals module. - It would be nice to have a simple way of setting them on command line + """DebugOptions is a place to store various debugging options. There should + be just one instance defined in pdfguiglobals module. It would be nice to + have a simple way of setting them on command line. Options in short and long forms: noed, noerrordialog -- [False], disable exceptions catching and @@ -59,8 +59,8 @@ def __setattr__(self, name, value): return def __getattr__(self, name): - """Resolve values of short options. - This is called only when normal lookup fails. + """Resolve values of short options. This is called only when normal + lookup fails. returns value of short debug option """ diff --git a/src/diffpy/pdfgui/gui/errorreportdialog.py b/src/diffpy/pdfgui/gui/errorreportdialog.py index 1eea082e..f4de87aa 100644 --- a/src/diffpy/pdfgui/gui/errorreportdialog.py +++ b/src/diffpy/pdfgui/gui/errorreportdialog.py @@ -145,8 +145,7 @@ def ShowModal(self): wx.Dialog.ShowModal(self) def onGoogle(self, event): # wxGlade: ErrorReportDialog. - """ - Handle the "Google This Error" button. + """Handle the "Google This Error" button. Search for path-independent module and function names and for error message extracted from exception traceback. @@ -185,8 +184,7 @@ def onURL(self, event): # wxGlade: ErrorReportDialog. def _extractSearchTerms(tbtext): - """ - Extract search words from a Python exception traceback. + """Extract search words from a Python exception traceback. Parameters ---------- diff --git a/src/diffpy/pdfgui/gui/errorreportdialog_control_fix.py b/src/diffpy/pdfgui/gui/errorreportdialog_control_fix.py index 11a8681b..38050c98 100644 --- a/src/diffpy/pdfgui/gui/errorreportdialog_control_fix.py +++ b/src/diffpy/pdfgui/gui/errorreportdialog_control_fix.py @@ -120,8 +120,7 @@ def ShowModal(self): def _extractSearchTerms(tbtext): - """ - Extract search words from a Python exception traceback. + """Extract search words from a Python exception traceback. Parameters ---------- diff --git a/src/diffpy/pdfgui/gui/errorwrapper.py b/src/diffpy/pdfgui/gui/errorwrapper.py index 1757bcdb..862849ae 100644 --- a/src/diffpy/pdfgui/gui/errorwrapper.py +++ b/src/diffpy/pdfgui/gui/errorwrapper.py @@ -12,10 +12,10 @@ # See LICENSE.txt for license information. # ############################################################################## - """This module contains a function wrapper and an object wrapper that catch -control errors and shows them in an error report dialog. This is used by -PDFPanel and MainFrame. +control errors and shows them in an error report dialog. + +This is used by PDFPanel and MainFrame. """ import sys diff --git a/src/diffpy/pdfgui/gui/extendedplotframe.py b/src/diffpy/pdfgui/gui/extendedplotframe.py index b9962451..a5f1b2cf 100644 --- a/src/diffpy/pdfgui/gui/extendedplotframe.py +++ b/src/diffpy/pdfgui/gui/extendedplotframe.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -The module contains extensions for GUI plot frame. -""" +"""The module contains extensions for GUI plot frame.""" import os.path @@ -59,8 +56,8 @@ class ExtendedPlotFrame(wx.Frame): """An extended plotting frame with a save and close button. The class has a matplotlib.figure.Figure data member named 'figure'. - It also has a matplotlib.axes.Axes data member named 'axes'. - The normal matplotlib plot manipulations can be performed with these two + It also has a matplotlib.axes.Axes data member named 'axes'. The + normal matplotlib plot manipulations can be performed with these two data members. See the matplotlib API at: http://matplotlib.sourceforge.net/classdocs.html """ @@ -172,11 +169,11 @@ def mplKeyPress(self, event): return def replot(self): - """officially call function in matplotlib to do drawing""" + """Officially call function in matplotlib to do drawing.""" self.canvas.draw() def insertCurve(self, xData, yData, style): - """insert a new curve to the plot + """Insert a new curve to the plot. xData, yData -- x, y data to used for the curve style -- the way curve should be plotted @@ -194,7 +191,7 @@ def insertCurve(self, xData, yData, style): return curveRef def updateData(self, curveRef, xData, yData): - """update data for a existing curve + """Update data for a existing curve. curveRef -- internal reference to a curve xData, yData -- x, y data to used for the curve @@ -207,7 +204,7 @@ def updateData(self, curveRef, xData, yData): self.__updateViewLimits() def changeStyle(self, curveRef, style): - """change curve style + """Change curve style. curveRef -- internal reference to curves style -- style dictionary @@ -219,7 +216,7 @@ def changeStyle(self, curveRef, style): self.subplot.legend(**legendBoxProperties()) def removeCurve(self, curveRef): - """remove curve from plot + """Remove curve from plot. curveRef -- internal reference to curves """ @@ -229,7 +226,7 @@ def removeCurve(self, curveRef): self.__updateViewLimits() def __updateViewLimits(self): - """adjust the subplot range in order to show all curves correctly.""" + """Adjust the subplot range in order to show all curves correctly.""" # NOTE: # we need to adjust view limits by ourselves because Matplotlib can't # set the legend nicely when there are multiple curves in the plot. @@ -257,8 +254,8 @@ def __updateViewLimits(self): self.subplot.set_ylim(ymin, ymax) def __translateStyles(self, style): - """Private function to translate general probabilities to - Matplotlib specific ones + """Private function to translate general probabilities to Matplotlib + specific ones. style -- general curve style dictionary (defined in demoplot) """ @@ -323,7 +320,7 @@ def __translateStyles(self, style): return stylestr, properties def setTitle(self, wt, gt): - """set graph labels + """Set graph labels. wt -- window title gt -- graph title @@ -332,21 +329,21 @@ def setTitle(self, wt, gt): self.figure.gca().set_title(gt) def setXLabel(self, x): - """set label for x axis + """Set label for x axis. x -- x label """ self.figure.gca().set_xlabel(x) def setYLabel(self, y): - """set label for y axis + """Set label for y axis. y -- y label """ self.figure.gca().set_ylabel(y) def clear(self): - """erase all curves""" + """Erase all curves.""" self.subplot.clear() self.curverefs = [] self.replot() @@ -358,8 +355,8 @@ def clear(self): def legendBoxProperties(): """Legend properties dictionary with keys consistent with MPL version. - The argument names have changed in matplotlib 0.98.5. - Old arguments do not work with later versions of matplotlib. + The argument names have changed in matplotlib 0.98.5. Old arguments + do not work with later versions of matplotlib. Return dictionary of legend properties. """ diff --git a/src/diffpy/pdfgui/gui/fitnotebookpanel.py b/src/diffpy/pdfgui/gui/fitnotebookpanel.py index 691e472b..c35656b8 100644 --- a/src/diffpy/pdfgui/gui/fitnotebookpanel.py +++ b/src/diffpy/pdfgui/gui/fitnotebookpanel.py @@ -85,7 +85,8 @@ def refresh(self): def Enable(self, enable=True): """Keep the notebook enabled, just not the panels. - outputPanel is immune from this, since it needs to be interacted with. + outputPanel is immune from this, since it needs to be interacted + with. """ self.parametersPanel.Enable(enable) return diff --git a/src/diffpy/pdfgui/gui/fittree.py b/src/diffpy/pdfgui/gui/fittree.py index 03abeb01..eddfbbb0 100644 --- a/src/diffpy/pdfgui/gui/fittree.py +++ b/src/diffpy/pdfgui/gui/fittree.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """This module contains the FitTree object designed for use in PDFgui. Classes: @@ -60,7 +59,6 @@ class FitTree(wx12.TreeCtrl): control -- The pdfguicontrol object that interfaces between the tree and the pdffit2 engine. The tree is a mirror of the internal structure of the control. - """ def __init__( @@ -157,7 +155,8 @@ def GetAllType(self, node): def GetPhases(self, node): """Get a list of phase in branch. - node is either the fit-root or a node in the fit-branch of interest. + node is either the fit-root or a node in the fit-branch of + interest. """ nodes = self.GetChildren(self.GetFitRoot(node)) ids = [id for id in nodes if self.GetNodeType(id) == "phase"] @@ -166,7 +165,8 @@ def GetPhases(self, node): def GetDataSets(self, node): """Get a list of datasets in branch. - node is either the fit-root or a node in the fit-branch of interest. + node is either the fit-root or a node in the fit-branch of + interest. """ nodes = self.GetChildren(self.GetFitRoot(node)) ids = [id for id in nodes if self.GetNodeType(id) == "dataset"] @@ -175,7 +175,8 @@ def GetDataSets(self, node): def GetCalculations(self, node): """Get a list of calculations in branch. - node is either the fit-root or a node in the fit-branch of interest. + node is either the fit-root or a node in the fit-branch of + interest. """ nodes = self.GetChildren(self.GetFitRoot(node)) ids = [id for id in nodes if self.GetNodeType(id) == "calculation"] @@ -212,9 +213,9 @@ def GetBranchName(self, node): def GetLastPhase(self, node): """Get the last phase child of the parent node. - This method is helpful in placing datasets and phases into the fit tree. - This method depends on the fact that phases are placed before datasets - in the fit tree. + This method is helpful in placing datasets and phases into the + fit tree. This method depends on the fact that phases are placed + before datasets in the fit tree. """ siblings = self.GetChildren(node) lastphase = None @@ -230,9 +231,9 @@ def GetLastPhase(self, node): def GetLastDataSet(self, node): """Get the last dataset child of the fit node. - If there is no last dataset node, this may return the last phase node. - The purpose of getting this node is to know where to place another node, - so the actual node type is not important. + If there is no last dataset node, this may return the last phase + node. The purpose of getting this node is to know where to place + another node, so the actual node type is not important. """ siblings = self.GetChildren(node) lastdata = None @@ -266,10 +267,10 @@ def GetNumDataSets(self, node): def GetPositionInSubtree(self, node): """Get the index if the node in its subtree. - For fits the position is absolute within the tree. For phases, datasets, - and calculations, the location is taken to be in reference to the other - nodes of its type. This is designed to be compatible with the control - center. + For fits the position is absolute within the tree. For phases, + datasets, and calculations, the location is taken to be in + reference to the other nodes of its type. This is designed to be + compatible with the control center. """ parent = self.GetItemParent(node) brood = self.GetChildren(parent) @@ -289,10 +290,10 @@ def GetPositionInSubtree(self, node): def SetControlData(self, node, data): """Set the control center data associated with the node. - This need only be called for 'fit' nodes. - This is the "cdata" entry in the data dictionary of the - node. It holds the object with which the right panel interfaces. For - example, for a 'phase' node, it contains a Structure object. + This need only be called for 'fit' nodes. This is the "cdata" + entry in the data dictionary of the node. It holds the object + with which the right panel interfaces. For example, for a + 'phase' node, it contains a Structure object. """ nodetype = self.GetNodeType(node) if nodetype != "fit": @@ -562,8 +563,8 @@ def AddCalc(self, node, label, insertafter=None, makedata=True, cdata=None): def CopyBranch(self, startnode): """Make a copy of a tree branch. - The branch is held in the system clipboard so it can be used in another - instance of the fittree. + The branch is held in the system clipboard so it can be used in + another instance of the fittree. """ nodetype = self.GetNodeType(startnode) cdata = self.control.copy(self.GetControlData(startnode)) @@ -586,8 +587,8 @@ def CopyBranch(self, startnode): def GetClipboard(self): """Get the clipboard data. - Returns the controldata in the clipboard, or None if the clipboard is - empty or contains the wrong type of data. + Returns the controldata in the clipboard, or None if the + clipboard is empty or contains the wrong type of data. """ # Check to see if data is present if not wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)): @@ -915,9 +916,8 @@ def __init__(self, *args): # Utility functions def incrementName(name, namelist, start=1): - """Increment the name by assigning the lowest number to the end such - that the name does not appear in the namelist. - """ + """Increment the name by assigning the lowest number to the end such that + the name does not appear in the namelist.""" newname = name match = r"\d+$" counter = start diff --git a/src/diffpy/pdfgui/gui/main.py b/src/diffpy/pdfgui/gui/main.py index a3d37917..8c580b06 100644 --- a/src/diffpy/pdfgui/gui/main.py +++ b/src/diffpy/pdfgui/gui/main.py @@ -34,10 +34,11 @@ def OnInit(self): def main(): """Kick starter for the PDFgui graphical user interface. - This function is normally called from a light-weight console - starter diffpy.pdfgui.applications.pdfgui. - Command line options and arguments can be passed via - cmdopts and cmdargs variables of the pdfguiglobals module. + + This function is normally called from a light-weight console starter + diffpy.pdfgui.applications.pdfgui. Command line options and + arguments can be passed via cmdopts and cmdargs variables of the + pdfguiglobals module. """ app = PDFGuiApp(0) app.MainLoop() diff --git a/src/diffpy/pdfgui/gui/mainframe.py b/src/diffpy/pdfgui/gui/mainframe.py index efd2de05..16ed9551 100644 --- a/src/diffpy/pdfgui/gui/mainframe.py +++ b/src/diffpy/pdfgui/gui/mainframe.py @@ -71,8 +71,8 @@ class MainFrame(wx.Frame): panel, accessed via the data member rightPanel, which can hold one of any number of panels. The panels that can appear in the right pane must be derived from PDFPanel (in pdfpanel.py) and are defined in the dynamicPanels - dictionary, which is defined in __customProperties. A panel is placed in the - right pane by passing its dynamicPanels dictionary key to the + dictionary, which is defined in __customProperties. A panel is placed in + the right pane by passing its dynamicPanels dictionary key to the switchRightPanel method. This method takes care of displaying the panel, giving the data it needs, and calling its refresh() method. @@ -210,9 +210,9 @@ def __init__(self, *args, **kwds): def __cmdLineLoad(self): """Open file loaded from the command line. - This opens a file without any checking for existing projects. This - should only be called after all initializations. It will open a file - whose name is specified in pdfguiglobals.cmdargs. + This opens a file without any checking for existing projects. + This should only be called after all initializations. It will + open a file whose name is specified in pdfguiglobals.cmdargs. """ if pdfguiglobals.cmdargs: filename = pdfguiglobals.cmdargs[0] @@ -227,9 +227,10 @@ def __cmdLineLoad(self): def __defineLocalIds(self): """Several user functions are duplicated many times throughout the gui. - This occurs mostly between the main menu, the right-click menu, and the - many buttons in the gui. This method defines local Ids that can be used - for all of these. + + This occurs mostly between the main menu, the right-click menu, + and the many buttons in the gui. This method defines local Ids + that can be used for all of these. """ # Functions that modify the tree. # These are used in the fitting right-click menu and the main menu. @@ -746,8 +747,8 @@ def __customBindings(self): def __menuBindings(self): """Setup bindings for the main menu and toolbar. - Since all toolbar functions use the same Ids as main menu items, the - toolbar events do not need their own bindings. + Since all toolbar functions use the same Ids as main menu items, + the toolbar events do not need their own bindings. """ # File Menu self.Bind(wx.EVT_MENU, self.onNew, id=self.newId) @@ -838,7 +839,6 @@ def switchRightPanel(self, paneltype): paneltype -- The code used in self.dynamicPanels that indicates the panel to be displayed. If paneltype is None, the blank panel is displayed. - """ self.rightPanel.Enable(False) self.plotPanel.Enable(False) @@ -974,8 +974,8 @@ def setMode(self, mode): def loadConfiguration(self): """Load the configuration from file. - The MRU list is handled by the local member fileHistory, which is a - wxFileHistory object. + The MRU list is handled by the local member fileHistory, which + is a wxFileHistory object. """ # Get MRU information @@ -1116,7 +1116,8 @@ def onMainMenu(self, event): return def makeTreeSelection(self, node): - """Manually select a node of the tree and update according to selection. + """Manually select a node of the tree and update according to + selection. This makes sure that the node is visible after selection. @@ -1799,9 +1800,9 @@ def onPaste(self, event): def onPasteLink(self, event): """Paste a copied fit and link it to the original. - This should only be called on a 'fit' node, and only if the original - 'fit' node, or at least one with the same name as the original still - exists in the tree. + This should only be called on a 'fit' node, and only if the + original 'fit' node, or at least one with the same name as the + original still exists in the tree. """ selections = self.treeCtrlMain.GetSelections() cdata = self.treeCtrlMain.GetClipboard() @@ -1835,8 +1836,9 @@ def onPasteLink(self, event): def onInsData(self, event): """Insert a new dataset item. - This opens up the new data set panel from adddatapanel.py. That panel - is in charge of inserting a new phase. See the module for details. + This opens up the new data set panel from adddatapanel.py. That + panel is in charge of inserting a new phase. See the module for + details. """ selections = self.treeCtrlMain.GetSelections() if len(selections) == 1: @@ -1848,8 +1850,9 @@ def onInsData(self, event): def onInsPhase(self, event): """Insert a new phase item. - This opens up the new phase panel from addphasepanel.py. That panel is - in charge of inserting a new phase. See the module for details. + This opens up the new phase panel from addphasepanel.py. That + panel is in charge of inserting a new phase. See the module for + details. """ selections = self.treeCtrlMain.GetSelections() if len(selections) == 1: @@ -1861,8 +1864,9 @@ def onInsPhase(self, event): def onInsCalc(self, event): """Insert a new calculation item. - A calculation is given the name "Calculation n", where n is the smallest - positive integer such that the name is not already taken. + A calculation is given the name "Calculation n", where n is the + smallest positive integer such that the name is not already + taken. """ selections = self.treeCtrlMain.GetSelections() if len(selections) == 1: @@ -1961,8 +1965,8 @@ def onRun(self, event): def onStop(self, event): """Stop all fits. - This removes all items from the runningDict and changes the status - colors back to wxWHITE. + This removes all items from the runningDict and changes the + status colors back to wxWHITE. """ self.control.stop() self.needsSave() @@ -2052,7 +2056,8 @@ def _plotStruct(self, stype): return def onPrintBL(self, event): - """Print the bond lengths of a selected structure to the output panel.""" + """Print the bond lengths of a selected structure to the output + panel.""" from diffpy.pdfgui.gui.bondlengthdialog import BondLengthDialog selections = self.treeCtrlMain.GetSelections() @@ -2095,7 +2100,8 @@ def onPrintBL(self, event): return def onPrintBA(self, event): - """Print the bond angles of a selected structure to the output panel.""" + """Print the bond angles of a selected structure to the output + panel.""" from diffpy.pdfgui.gui.bondangledialog import BondAngleDialog selections = self.treeCtrlMain.GetSelections() @@ -2530,7 +2536,7 @@ def onDocumentation(self, event): # MISC INTERACTION ITEMS def showMessage(self, info, title="PDF Control Error"): - """showMessage(self, info) --> tell user about an exception and so on + """ShowMessage(self, info) --> tell user about an exception and so on. title -- window title info -- message @@ -2552,9 +2558,9 @@ def unlock(self): def postEvent(self, type, info): """This method is called by the control. - Whenever the control needs to communicate directly with the gui it can - call this method. The event is processed by onCustom and then handled by - the gui on its own terms. + Whenever the control needs to communicate directly with the gui + it can call this method. The event is processed by onCustom and + then handled by the gui on its own terms. """ event = PDFCustomEvent() event.type = type diff --git a/src/diffpy/pdfgui/gui/parameterspanel.py b/src/diffpy/pdfgui/gui/parameterspanel.py index e00c76e8..616744a2 100644 --- a/src/diffpy/pdfgui/gui/parameterspanel.py +++ b/src/diffpy/pdfgui/gui/parameterspanel.py @@ -30,7 +30,7 @@ class ParametersPanel(wx.Panel, PDFPanel): - """GUI Panel, parameters viewer/editor + """GUI Panel, parameters viewer/editor. Data members: parameters -- parameters dictionary @@ -110,7 +110,7 @@ def __customProperties(self): return def refresh(self): - """Refreshes wigets on the panel""" + """Refreshes wigets on the panel.""" # # Update the parameters dictionary # self.fitting.updateParameters() @@ -167,8 +167,8 @@ def onCellLeftClick(self, event): # wxGlade: ParametersPanel. def onGridRangeSelect(self, event): # wxGlade: ParametersPanel. """Handle range selections. - This is needed to properly handle simple left-clicking of fix/free - cells. It serves no other purpose. + This is needed to properly handle simple left-clicking of + fix/free cells. It serves no other purpose. """ event.Skip() return @@ -245,7 +245,6 @@ def applyCellChange(self, row, col, value): row -- row col -- column value -- new value - """ key = int(self.grid_parameters.GetRowLabelValue(row)) if col == 0: # initial value @@ -266,7 +265,7 @@ def applyCellChange(self, row, col, value): return def popupMenu(self, window, x, y): - """Opens a popup menu + """Opens a popup menu. window -- window, where to popup a menu x -- x coordinate @@ -299,7 +298,7 @@ def popupMenu(self, window, x, y): # Popup menu events ################################################## def onPopupFill(self, event): - """Fills cells selected in the grid with a new value""" + """Fills cells selected in the grid with a new value.""" # NOTE: GetSelectedCells returns only SINGLE selected cells, not blocks or row/columns ! if self.grid_parameters.IsSelection(): @@ -324,7 +323,7 @@ def onPopupFill(self, event): event.Skip() def onPopupFixFree(self, event): - """Fixes parameters with selected cells""" + """Fixes parameters with selected cells.""" # NOTE: GetSelectedCells returns only SINGLE selected cells, not blocks # or row/columns ! seldict = {} @@ -458,7 +457,7 @@ def dummy(self): pass def test(self): - """Testing code goes here""" + """Testing code goes here.""" from diffpy.pdfgui.control.parameter import Parameter self.window.parameters = { diff --git a/src/diffpy/pdfgui/gui/pdfguiglobals.py b/src/diffpy/pdfgui/gui/pdfguiglobals.py index cbfdc911..573a5c0c 100644 --- a/src/diffpy/pdfgui/gui/pdfguiglobals.py +++ b/src/diffpy/pdfgui/gui/pdfguiglobals.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """This module contains global parameters needed by PDFgui.""" import os.path @@ -63,9 +62,8 @@ def iconpath(iconfilename): - """Full path to the icon file in pdfgui installation. - This function should be used whenever GUI needs access - to custom icons. + """Full path to the icon file in pdfgui installation. This function should + be used whenever GUI needs access to custom icons. iconfilename -- icon file name without any path diff --git a/src/diffpy/pdfgui/gui/pdfpanel.py b/src/diffpy/pdfgui/gui/pdfpanel.py index 9ca4a862..718292f1 100644 --- a/src/diffpy/pdfgui/gui/pdfpanel.py +++ b/src/diffpy/pdfgui/gui/pdfpanel.py @@ -21,9 +21,9 @@ class PDFPanel(object): """Mix-in class for all PDF gui panels. - This method is meant to be a secondary parent class for classed derived from - wx.Panel. It defines methods and member variables necessary to all panels in - the PDFgui. + This method is meant to be a secondary parent class for classed + derived from wx.Panel. It defines methods and member variables + necessary to all panels in the PDFgui. """ def __init__(self, *args, **kwds): @@ -47,9 +47,10 @@ def refresh(self): raise NotImplementedError("refresh() must be implemented in subclass") def setToolTips(self, toolTips): - """Sets tooltips for controls + """Sets tooltips for controls. - @param toolTips: dictionary of the form {'controlname' : 'tooltip'} + @param toolTips: dictionary of the form {'controlname' : + 'tooltip'} """ for controlName, tooltip in toolTips.items(): control = getattr(self, controlName) diff --git a/src/diffpy/pdfgui/gui/phaseconfigurepanel.py b/src/diffpy/pdfgui/gui/phaseconfigurepanel.py index 1050ef42..be3e74ce 100644 --- a/src/diffpy/pdfgui/gui/phaseconfigurepanel.py +++ b/src/diffpy/pdfgui/gui/phaseconfigurepanel.py @@ -290,7 +290,8 @@ def __customProperties(self): onTextCtrlKey = textCtrlAsGridCell def _cache(self): - """Cache the current structure and constraints for future comparison.""" + """Cache the current structure and constraints for future + comparison.""" pass __this_is_first_refresh = True @@ -633,7 +634,7 @@ def onKey(self, event): # Grid popup menu and handlers def popupMenu(self, window, x, y): - """Creates the popup menu + """Creates the popup menu. window -- window, where to popup a menu x -- x coordinate diff --git a/src/diffpy/pdfgui/gui/phaseconstraintspanel.py b/src/diffpy/pdfgui/gui/phaseconstraintspanel.py index 0506b9c6..564a2d36 100644 --- a/src/diffpy/pdfgui/gui/phaseconstraintspanel.py +++ b/src/diffpy/pdfgui/gui/phaseconstraintspanel.py @@ -304,7 +304,8 @@ def __customProperties(self): onTextCtrlKey = textCtrlAsGridCell def _cache(self): - """Cache the current structure and constraints for future comparison.""" + """Cache the current structure and constraints for future + comparison.""" pass def refresh(self): @@ -573,7 +574,7 @@ def onKey(self, event): # Grid popup menu and handlers def popupMenu(self, window, x, y): - """Creates the popup menu + """Creates the popup menu. window -- window, where to popup a menu x -- x coordinate diff --git a/src/diffpy/pdfgui/gui/phasepanelutils.py b/src/diffpy/pdfgui/gui/phasepanelutils.py index 50f348b2..b74f73f9 100644 --- a/src/diffpy/pdfgui/gui/phasepanelutils.py +++ b/src/diffpy/pdfgui/gui/phasepanelutils.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """Common methods used in the phase panels.""" import wx @@ -27,7 +26,7 @@ def float2str(x): - """compact string representation of float""" + """Compact string representation of float.""" s = "%g" % x if s.find(".") == -1 and s.find("e") == -1: s = s + ".0" @@ -39,21 +38,11 @@ def refreshTextCtrls(panel): This is used by phaseconfigurepanel and phaseresultspanel. - This method updates the following TextCtrls with with contents of the - structure member variable of the panel. - textCtrlA - textCtrlB - textCtrlC - textCtrlAlpha - textCtrlBeta - textCtrlGamma - textCtrlScaleFactor - textCtrlDelta1 - textCtrlDelta2 - textCtrlSratio - textCtrlRcut - textCtrlStepcut - textCtrlSpdiameter + This method updates the following TextCtrls with with contents of + the structure member variable of the panel. textCtrlA textCtrlB + textCtrlC textCtrlAlpha textCtrlBeta textCtrlGamma + textCtrlScaleFactor textCtrlDelta1 textCtrlDelta2 textCtrlSratio + textCtrlRcut textCtrlStepcut textCtrlSpdiameter """ if panel.structure is None: # clear textcontrols @@ -96,7 +85,8 @@ def refreshGrid(panel): This is used by phaseconfigurepanel and phaseresultspanel. This method fills the grid with the contents of the structure member - variable of the panel. It is expected that the grid is named 'gridAtoms'. + variable of the panel. It is expected that the grid is named + 'gridAtoms'. """ if panel.structure is None: # remove all rows from grid @@ -185,10 +175,10 @@ def showSelectAtomsDialog(panel): def canCopySelectedCells(panel): """Check to see if we can copy selected cells. - To be copyable, the cells must exist in a single block or there must be a - single cell selected. Note that a block that is selected by individual cells - is considered a collection of individual atoms, not a block. This is default - wxPython behavior. + To be copyable, the cells must exist in a single block or there must + be a single cell selected. Note that a block that is selected by + individual cells is considered a collection of individual atoms, not + a block. This is default wxPython behavior. """ grid = panel.gridAtoms @@ -201,7 +191,8 @@ def canCopySelectedCells(panel): def canPasteIntoCells(panel): """Check if clipboard contents are formatted for grid insertion. - This also checks to see if the cell selection is appropriate for pasting. + This also checks to see if the cell selection is appropriate for + pasting. """ grid = panel.gridAtoms @@ -254,9 +245,8 @@ def canPasteIntoCells(panel): def copySelectedCells(panel): """Copy block of selected cells or individual cell into clipboard. - This stores the cells as a plain text grid so that it can be copied to and - from other applications. - Columns are delimited by tabs '\t'. + This stores the cells as a plain text grid so that it can be copied + to and from other applications. Columns are delimited by tabs '\t'. Rows are delimited by newlines '\n'. """ grid = panel.gridAtoms @@ -297,8 +287,8 @@ def copySelectedCells(panel): def pasteIntoCells(panel): """Paste clipboard contents into cells. - canPasteIntoCells must be called before this method in order to format - clipboard text for pasting. + canPasteIntoCells must be called before this method in order to + format clipboard text for pasting. """ # Double check the clipcells if len(clipcells) == 0: diff --git a/src/diffpy/pdfgui/gui/phaseresultspanel.py b/src/diffpy/pdfgui/gui/phaseresultspanel.py index 5b063994..17268f3b 100644 --- a/src/diffpy/pdfgui/gui/phaseresultspanel.py +++ b/src/diffpy/pdfgui/gui/phaseresultspanel.py @@ -212,7 +212,8 @@ def __customProperties(self): return def _cache(self): - """Cache the current structure and constraints for future comparison.""" + """Cache the current structure and constraints for future + comparison.""" pass def refresh(self): diff --git a/src/diffpy/pdfgui/gui/plotpanel.py b/src/diffpy/pdfgui/gui/plotpanel.py index f6a6d918..e1ee06dd 100644 --- a/src/diffpy/pdfgui/gui/plotpanel.py +++ b/src/diffpy/pdfgui/gui/plotpanel.py @@ -117,8 +117,7 @@ def enableWidgets(self, on=True): def updateWidgets(self): """Enable or disable certain widgets depending upon what is selected in - the tree and in the plotting widgets. - """ + the tree and in the plotting widgets.""" # selections: selected nodes in treeCtrl # fits: only different fittings # refs: data item ids ( can be calculation, fit, structure and dataset @@ -233,7 +232,7 @@ def onPlot(self, event): # wxGlade: PlotPanel. return def _plot(self, event): - """This function is not wrapped""" + """This function is not wrapped.""" selections = self.treeCtrlMain.GetSelections() refs = [self.treeCtrlMain.GetControlData(node) for node in selections] xval = self.xDataCombo.GetValue() diff --git a/src/diffpy/pdfgui/gui/preferencespanel.py b/src/diffpy/pdfgui/gui/preferencespanel.py index 94751c42..f586bc7c 100644 --- a/src/diffpy/pdfgui/gui/preferencespanel.py +++ b/src/diffpy/pdfgui/gui/preferencespanel.py @@ -124,7 +124,10 @@ def __customProperties(self): return def onCancel(self, event): # wxGlade: PreferencesPanel. - """Cancel the changes. Go back to the last panel.""" + """Cancel the changes. + + Go back to the last panel. + """ selections = self.treeCtrlMain.GetSelections() if selections: node = selections[0] diff --git a/src/diffpy/pdfgui/gui/sgconstraindialog.py b/src/diffpy/pdfgui/gui/sgconstraindialog.py index d676dc4f..18d6d20c 100644 --- a/src/diffpy/pdfgui/gui/sgconstraindialog.py +++ b/src/diffpy/pdfgui/gui/sgconstraindialog.py @@ -128,6 +128,7 @@ def __customProperties(self): def updateSpaceGroupList(self): """Update space group choices in combobox according to self.structure.getSpaceGroupList(). + Requires that structure attribute is defined. """ self.sgComboBox.Clear() diff --git a/src/diffpy/pdfgui/gui/sgstructuredialog.py b/src/diffpy/pdfgui/gui/sgstructuredialog.py index 1e2daffa..07319930 100644 --- a/src/diffpy/pdfgui/gui/sgstructuredialog.py +++ b/src/diffpy/pdfgui/gui/sgstructuredialog.py @@ -116,6 +116,7 @@ def __customProperties(self): def updateSpaceGroupList(self): """Update space group choices in combobox according to self.structure.getSpaceGroupList(). + Requires that structure attribute is defined. """ self.sgComboBox.Clear() diff --git a/src/diffpy/pdfgui/gui/tooltips.py b/src/diffpy/pdfgui/gui/tooltips.py index ff860132..3d7fdedd 100644 --- a/src/diffpy/pdfgui/gui/tooltips.py +++ b/src/diffpy/pdfgui/gui/tooltips.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Tooltips for pdfgui panels. -""" +"""Tooltips for pdfgui panels.""" def isalias(s): diff --git a/src/diffpy/pdfgui/gui/windowperspective.py b/src/diffpy/pdfgui/gui/windowperspective.py index 4c2e205b..8abf2726 100644 --- a/src/diffpy/pdfgui/gui/windowperspective.py +++ b/src/diffpy/pdfgui/gui/windowperspective.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """This contains the default perspective for the gui window.""" default = "layout2|name=dseries;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=calculation;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=welcome;caption=;state=768;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=adddata;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=serverconfig;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=addphase;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=blank;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=phase;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=dataset;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=preferences;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=fit;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=rseries;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=tseries;caption=;state=770;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=380;minw=190;minh=200;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPanel;caption=PDFfit2 Output;state=10487804;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=400;besth=40;minw=200;minh=40;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=treeCtrlMain;caption=Fit Tree;state=10487804;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=200;besth=100;minw=200;minh=40;maxw=-1;maxh=-1;floatx=471;floaty=730;floatw=208;floath=124|name=plotPanel;caption=Plot Control;state=10487804;dir=4;layer=0;row=0;pos=1;prop=100000;bestw=200;besth=250;minw=200;minh=150;maxw=-1;maxh=-1;floatx=337;floaty=393;floatw=208;floath=274|name=journalPanel;caption=Project Journal;state=10487807;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=450;besth=450;minw=200;minh=200;maxw=-1;maxh=-1;floatx=393;floaty=113;floatw=450;floath=450|dock_size(3,0,0)=59|dock_size(4,0,0)=202|dock_size(5,0,0)=362|" # noqa: E501 diff --git a/src/diffpy/pdfgui/gui/wxextensions/__init__.py b/src/diffpy/pdfgui/gui/wxextensions/__init__.py index 45cbffdc..28609540 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/__init__.py +++ b/src/diffpy/pdfgui/gui/wxextensions/__init__.py @@ -12,8 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Extensions to wxPython used in PDFgui -""" +"""Extensions to wxPython used in PDFgui.""" # End of file diff --git a/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py b/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py index 154f1fae..5afcb076 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py +++ b/src/diffpy/pdfgui/gui/wxextensions/autowidthlabelsgrid.py @@ -12,10 +12,8 @@ # See LICENSE.txt for license information. # ############################################################################## - """This module contains AutoWidthListCtrl, a wxListCtrl object that -automatically adjusts the width of its columns. -""" +automatically adjusts the width of its columns.""" import wx @@ -23,7 +21,7 @@ class AutoWidthLabelsGrid(wx.grid.Grid): - """wx grid which allows labels auto sizing""" + """Wx grid which allows labels auto sizing.""" # def __init__(self, parent, state, size): # wx.grid.Grid.__init__(self, parent, state, size) diff --git a/src/diffpy/pdfgui/gui/wxextensions/listctrls.py b/src/diffpy/pdfgui/gui/wxextensions/listctrls.py index 0d7ef8a3..d08a8cde 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/listctrls.py +++ b/src/diffpy/pdfgui/gui/wxextensions/listctrls.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """This module contains custom wxListCtrl subclasses. AutoWidthListCtrl - A wxListCtrl object that automatically adjusts the width of its columns. @@ -30,7 +29,7 @@ class AutoWidthListCtrl(wx12.ListCtrl, listmix.ListCtrlAutoWidthMixin): - """wxListCtrl subclass that automatically adjusts its column width.""" + """WxListCtrl subclass that automatically adjusts its column width.""" def __init__(self, parent, ID, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, *args, **kwargs): wx12.ListCtrl.__init__(self, parent, ID, pos, size, style, *args, **kwargs) @@ -67,13 +66,14 @@ class ColumnSortListCtrl(AutoWidthListCtrl, listmix.ColumnSorterMixin): """AutoWidthListCtrl subclass that sorts its columns when the column header is pressed. - This ListCtrl requires an itemDataMap member dictionary to be initialized - before the sorting capabilities can be realized. This dictionary simply references - the ListCtrl's entries by a unique number. This number must be stored as the - ItemData (with SetItemData) of the entry. The member data must be in the - form of a tuple, where the tuple has a number of entries as the ListCtrl has - columns. The sorting routine sorts the items in the ListCtrl by the entries - in this tuple. + This ListCtrl requires an itemDataMap member dictionary to be + initialized before the sorting capabilities can be realized. This + dictionary simply references the ListCtrl's entries by a unique + number. This number must be stored as the ItemData (with + SetItemData) of the entry. The member data must be in the form of a + tuple, where the tuple has a number of entries as the ListCtrl has + columns. The sorting routine sorts the items in the ListCtrl by the + entries in this tuple. """ def __init__(self, parent, ID, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, *args, **kwargs): @@ -96,10 +96,11 @@ def initializeSorter(self): def makeIDM(self): """This method automatically sets up the itemDataMap. - The itemDataMap gets filled with the current ListCtrl entries. The - itemDataMap does not update automatically when the list is changed. To - update the itemDataMap this method must be called again. - initializeSorter should be called after a call to this method. + The itemDataMap gets filled with the current ListCtrl entries. + The itemDataMap does not update automatically when the list is + changed. To update the itemDataMap this method must be called + again. initializeSorter should be called after a call to this + method. """ numcol = self.GetColumnCount() numrow = self.GetItemCount() diff --git a/src/diffpy/pdfgui/gui/wxextensions/paneldialog.py b/src/diffpy/pdfgui/gui/wxextensions/paneldialog.py index 2106c15f..64645e94 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/paneldialog.py +++ b/src/diffpy/pdfgui/gui/wxextensions/paneldialog.py @@ -14,19 +14,19 @@ # See LICENSE.txt for license information. # ############################################################################## - """This module contains the PanelDialog class, a simple class that turns any -panel into a dialog. -""" +panel into a dialog.""" import wx class PanelDialog(wx.Dialog): - """This class will turn any panel into a dialog. Using this makes for - quicker development and encourages the developer to design a gui as a - collection of panels, instead of a monolithic mega-panel. + """This class will turn any panel into a dialog. + + Using this makes for quicker development and encourages the + developer to design a gui as a collection of panels, instead of a + monolithic mega-panel. """ def __init__(self, *args, **kwds): @@ -38,11 +38,10 @@ def __init__(self, *args, **kwds): Unless specified, style is automatically set as wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER - Creating a PanelDialog requires three steps. - 1) Create the PanelDialog. - 2) Create the Panel, with the new PanelDialog as the parent. - 3) Call the setPanel method of the PanelDialog with the new Panel as the - the argument. + Creating a PanelDialog requires three steps. 1) Create the + PanelDialog. 2) Create the Panel, with the new PanelDialog as + the parent. 3) Call the setPanel method of the PanelDialog with + the new Panel as the the argument. """ if not hasattr(kwds, "style"): kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER diff --git a/src/diffpy/pdfgui/gui/wxextensions/textctrlutils.py b/src/diffpy/pdfgui/gui/wxextensions/textctrlutils.py index 4820cb8f..35466d67 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/textctrlutils.py +++ b/src/diffpy/pdfgui/gui/wxextensions/textctrlutils.py @@ -14,7 +14,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """This module contains utilities that can be used with wxTextCtrls.""" diff --git a/src/diffpy/pdfgui/gui/wxextensions/validators.py b/src/diffpy/pdfgui/gui/wxextensions/validators.py index dd99d7cc..8f39454f 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/validators.py +++ b/src/diffpy/pdfgui/gui/wxextensions/validators.py @@ -28,10 +28,11 @@ class TextValidator(wx.Validator): - """This validator is designed to check text input for wxTextCtrls. (It might - have uses in other widgets.) It can validate for letters only, digits only, - floats only, and can allow for a negative at the beginning of a digit string - or a negative float. + """This validator is designed to check text input for wxTextCtrls. + + (It might have uses in other widgets.) It can validate for letters + only, digits only, floats only, and can allow for a negative at the + beginning of a digit string or a negative float. """ def __init__(self, flag=DIGIT_ONLY, allowNeg=False): diff --git a/src/diffpy/pdfgui/gui/wxextensions/wx12.py b/src/diffpy/pdfgui/gui/wxextensions/wx12.py index 45552de0..9560d2d0 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/wx12.py +++ b/src/diffpy/pdfgui/gui/wxextensions/wx12.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""\ -Support for WX4-like methods and functions for WX3. +"""Support for WX4-like methods and functions for WX3. Notes ----- diff --git a/src/diffpy/pdfgui/tui.py b/src/diffpy/pdfgui/tui.py index a75933ea..d3404c96 100644 --- a/src/diffpy/pdfgui/tui.py +++ b/src/diffpy/pdfgui/tui.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """Text user interface - utilities for extracting data from project files. """ diff --git a/src/diffpy/pdfgui/utils.py b/src/diffpy/pdfgui/utils.py index e53a4c68..fdced9bf 100644 --- a/src/diffpy/pdfgui/utils.py +++ b/src/diffpy/pdfgui/utils.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """Small shared routines: numericStringSort -- sort list of strings according to numeric value safeCPickleDumps -- same as pickle.dumps, but safe for NaN and Inf @@ -20,9 +19,9 @@ def numericStringSort(lst): - """Sort list of strings inplace according to general numeric value. - Each string gets split to string and integer segments to create keys - for comparison. Signs, decimal points and exponents are ignored. + """Sort list of strings inplace according to general numeric value. Each + string gets split to string and integer segments to create keys for + comparison. Signs, decimal points and exponents are ignored. lst -- sorted list of strings diff --git a/src/diffpy/pdfgui/version.py b/src/diffpy/pdfgui/version.py index b1181880..47c1ed6e 100644 --- a/src/diffpy/pdfgui/version.py +++ b/src/diffpy/pdfgui/version.py @@ -12,7 +12,6 @@ # See LICENSE.rst for license information. # ############################################################################## - """Definition of __version__.""" # We do not use the other three variables, but can be added back if needed. diff --git a/tests/test_aboutdialog.py b/tests/test_aboutdialog.py index 547821a3..b66859e7 100644 --- a/tests/test_aboutdialog.py +++ b/tests/test_aboutdialog.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -Unit tests for class DialogAbout -""" +"""Unit tests for class DialogAbout.""" import unittest diff --git a/tests/test_calculation.py b/tests/test_calculation.py index ac6d354e..7bcd9d82 100644 --- a/tests/test_calculation.py +++ b/tests/test_calculation.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Unit tests for calculation.py -""" +"""Unit tests for calculation.py.""" import unittest @@ -43,7 +41,7 @@ def tearDown(self): # return def test_setRGrid(self): - """check Calculation.setRGrid()""" + """Check Calculation.setRGrid()""" # helper function def rgriddata(calc): diff --git a/tests/test_constraint.py b/tests/test_constraint.py index e42a4663..dfff965d 100644 --- a/tests/test_constraint.py +++ b/tests/test_constraint.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Unit tests for constraint.py -""" +"""Unit tests for constraint.py.""" import unittest @@ -25,14 +23,14 @@ ############################################################################## class TestConstraint(unittest.TestCase): - """test methods of TestConstraint""" + """Test methods of TestConstraint.""" def setUp(self): self.c = Constraint("@1") return def test___init__(self): - """check Constraint.__init__()""" + """Check Constraint.__init__()""" self.assertTrue(1 in self.c.parguess) self.assertEqual(1, len(self.c.parguess)) c1 = Constraint("2*@2 + 3.0", 13.0) @@ -41,14 +39,14 @@ def test___init__(self): return def test_guess(self): - """check Constraint.guess()""" + """Check Constraint.guess()""" self.c.guess(9) self.assertEqual(1, len(self.c.parguess)) self.assertEqual(9, self.c.parguess[1]) return def test___setattr__(self): - """check Constraint.__setattr__()""" + """Check Constraint.__setattr__()""" self.c.guess(9) self.c.formula = "9*@7 +18" self.assertEqual(1, len(self.c.parguess)) @@ -60,7 +58,7 @@ def test___setattr__(self): return def test_evalFormula(self): - """check Constraint.evalFormula()""" + """Check Constraint.evalFormula()""" value = self.c.evalFormula({1: 5.0}) self.assertEqual(5.0, value) self.c.formula = "sin(@3)" diff --git a/tests/test_datasetpanels.py b/tests/test_datasetpanels.py index ae83979b..5343a4e1 100644 --- a/tests/test_datasetpanels.py +++ b/tests/test_datasetpanels.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -Unit tests for DataSet panels. -""" +"""Unit tests for DataSet panels.""" import unittest diff --git a/tests/test_dopingseriespanel.py b/tests/test_dopingseriespanel.py index 5dd06404..325a718d 100644 --- a/tests/test_dopingseriespanel.py +++ b/tests/test_dopingseriespanel.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -Unit tests for the DopingSeriesPanel class. -""" +"""Unit tests for the DopingSeriesPanel class.""" import unittest diff --git a/tests/test_extendedplotframe.py b/tests/test_extendedplotframe.py index 4c7830bc..dbe17735 100644 --- a/tests/test_extendedplotframe.py +++ b/tests/test_extendedplotframe.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -Unit tests for the ExtendedPlotFrame class. -""" +"""Unit tests for the ExtendedPlotFrame class.""" import unittest diff --git a/tests/test_fitdataset.py b/tests/test_fitdataset.py index 994402cc..7ec0d1ff 100644 --- a/tests/test_fitdataset.py +++ b/tests/test_fitdataset.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Unit tests for fitdataset.py -""" +"""Unit tests for fitdataset.py.""" import unittest @@ -36,7 +34,7 @@ def tearDown(self): return def test_grid_interpolation(self): - """check grid_interpolation()""" + """Check grid_interpolation()""" x0 = numpy.arange(-5, 5, 0.25) y0 = numpy.sin(x0) x1 = [-6, x0[0], -0.2, x0[-1], 37] @@ -189,7 +187,7 @@ class TestFitDataSet(unittest.TestCase): # return def test__resampledPDFDataSet(self): - """check FitDataSet._resampledPDFDataSet()""" + """Check FitDataSet._resampledPDFDataSet()""" fNi_data = datafile("Ni_2-8.chi.gr") fds = FitDataSet("Ni") fds.read(fNi_data) diff --git a/tests/test_fitstructure.py b/tests/test_fitstructure.py index 090ed876..c49f93f4 100644 --- a/tests/test_fitstructure.py +++ b/tests/test_fitstructure.py @@ -1,7 +1,6 @@ #!/usr/bin/env python -"""Unit tests for class FitStructure -""" +"""Unit tests for class FitStructure.""" import unittest @@ -26,7 +25,7 @@ def tearDown(self): return def test___init__(self): - """check FitStructure.__init__()""" + """Check FitStructure.__init__()""" stru = self.stru self.assertEqual("noname", stru.name) self.assertEqual("all-all", stru.selected_pairs) @@ -48,14 +47,14 @@ def test___init__(self): # return def test___getattr__(self): - """check FitStructure.__getattr__()""" + """Check FitStructure.__getattr__()""" stru = self.stru self.assertTrue(stru is stru.initial) self.assertRaises(AttributeError, eval, "stru.notdefined", locals()) return def test__getStrId(self): - """check FitStructure._getStrId()""" + """Check FitStructure._getStrId()""" stru = self.stru self.assertEqual("p_noname", stru._getStrId()) return @@ -71,7 +70,7 @@ def test__getStrId(self): # return def test_findParameters(self): - """check FitStructure.findParameters()""" + """Check FitStructure.findParameters()""" stru = self.stru stru.read(datafile("Ni.stru"), format="pdffit") for a in stru.initial: @@ -87,7 +86,7 @@ def test_findParameters(self): return def test_applyParameters(self): - """check FitStructure.applyParameters()""" + """Check FitStructure.applyParameters()""" stru = self.stru stru.read(datafile("Ni.stru"), format="pdffit") for a in stru.initial: @@ -108,7 +107,7 @@ def test_applyParameters(self): return def test_changeParameterIndex(self): - """check FitStructure.changeParameterIndex()""" + """Check FitStructure.changeParameterIndex()""" stru = self.stru stru.constraints["pscale"] = Constraint("@7+3") stru.changeParameterIndex(7, 13) @@ -129,7 +128,7 @@ def test_changeParameterIndex(self): # return def test_insertAtoms(self): - """check FitStructure.insertAtoms()""" + """Check FitStructure.insertAtoms()""" from diffpy.structure import Atom stru = self.stru @@ -145,7 +144,7 @@ def test_insertAtoms(self): return def test_deleteAtoms(self): - """check FitStructure.deleteAtoms()""" + """Check FitStructure.deleteAtoms()""" stru = self.stru stru.read(datafile("Ni.stru"), format="pdffit") cns = Constraint("@1") @@ -208,7 +207,7 @@ def test_deleteAtoms(self): # return def test_getPairSelectionFlags(self): - """check FitStructure.getPairSelectionFlags()""" + """Check FitStructure.getPairSelectionFlags()""" cdse = self.stru cdse.read(datafile("CdSe_bulk_wur.stru"), format="pdffit") self.assertEqual("all-all", cdse.getSelectedPairs()) @@ -244,7 +243,7 @@ def test_getPairSelectionFlags(self): # return def test_copy(self): - """check FitStructure.copy()""" + """Check FitStructure.copy()""" stru2 = self.stru.copy() self.assertEqual("noname", stru2.name) stru3 = Structure() diff --git a/tests/test_insertrowsdialog.py b/tests/test_insertrowsdialog.py index 7879582c..c0a00f2e 100644 --- a/tests/test_insertrowsdialog.py +++ b/tests/test_insertrowsdialog.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -Unit tests for class InsertRowsDialog -""" +"""Unit tests for class InsertRowsDialog.""" import unittest diff --git a/tests/test_loadproject.py b/tests/test_loadproject.py index ac1f0443..3cc965d9 100644 --- a/tests/test_loadproject.py +++ b/tests/test_loadproject.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Unit tests for tui.py -""" +"""Unit tests for tui.py.""" import unittest @@ -49,13 +47,13 @@ def tearDown(self): return def test___init__(self): - """check LoadProject.__init__()""" + """Check LoadProject.__init__()""" self.assertEqual(1, len(self.prj_ni.getFits())) self.assertRaises(ControlFileError, LoadProject, "does/not/exist.ddp") return def test_getFits(self): - """check LoadProject.getFits()""" + """Check LoadProject.getFits()""" lcmofits = self.prj_lcmo.getFits() lcmofullfits = self.prj_lcmo_full.getFits() self.assertEqual(1, len(lcmofits)) @@ -66,7 +64,7 @@ def test_getFits(self): return def test_getDataSets(self): - """check LoadProject.getDataSets()""" + """Check LoadProject.getDataSets()""" lcmofullfits = self.prj_lcmo_full.getFits() datasets = self.prj_lcmo_full.getDataSets() self.assertEqual(10, len(datasets)) @@ -77,7 +75,7 @@ def test_getDataSets(self): return def test_getPhases(self): - """check LoadProject.getPhases()""" + """Check LoadProject.getPhases()""" lcmofullfits = self.prj_lcmo_full.getFits() phases = self.prj_lcmo_full.getPhases() self.assertAlmostEqual(5.53884, phases[0].refined.lattice.a, 4) @@ -88,7 +86,7 @@ def test_getPhases(self): return def test_getTemperatures(self): - """check LoadProject.getTemperatures()""" + """Check LoadProject.getTemperatures()""" temps = self.prj_lcmo_full.getTemperatures() self.assertEqual(10, len(temps)) self.assertEqual(300, temps[0]) @@ -99,7 +97,7 @@ def test_getTemperatures(self): return def test_getDopings(self): - """check LoadProject.getDopings()""" + """Check LoadProject.getDopings()""" dopings = self.prj_lcmo_full.getDopings() self.assertEqual(10 * [None], dopings) datasets3 = self.prj_lcmo_full.getDataSets()[:3] diff --git a/tests/test_mainframe.py b/tests/test_mainframe.py index 3a177a1f..0a2f63ed 100644 --- a/tests/test_mainframe.py +++ b/tests/test_mainframe.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -Unit tests for the MainFrame class. -""" +"""Unit tests for the MainFrame class.""" import unittest diff --git a/tests/test_parameter.py b/tests/test_parameter.py index b0161a9f..f711ffce 100644 --- a/tests/test_parameter.py +++ b/tests/test_parameter.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -Unit tests for the Parameter class. -""" +"""Unit tests for the Parameter class.""" import unittest diff --git a/tests/test_parameterspanel.py b/tests/test_parameterspanel.py index ddb9a81b..3f95decc 100644 --- a/tests/test_parameterspanel.py +++ b/tests/test_parameterspanel.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -Unit tests for ParametersPanel class -""" +"""Unit tests for ParametersPanel class.""" import unittest diff --git a/tests/test_pdfdataset.py b/tests/test_pdfdataset.py index be5fe080..0b268e8c 100644 --- a/tests/test_pdfdataset.py +++ b/tests/test_pdfdataset.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Unit tests for pdfdataset.py -""" +"""Unit tests for pdfdataset.py.""" import unittest @@ -55,7 +53,7 @@ def tearDown(self): # return # def test_read(self): - """check PDFDataSet.read()""" + """Check PDFDataSet.read()""" # neutron data ------------------------------------------------- fn_550K = datafile("550K.gr") self.pdfds.read(fn_550K) @@ -83,7 +81,7 @@ def test_read(self): return def test_readStr(self): - """check PDFDataSet.readStr()""" + """Check PDFDataSet.readStr()""" # read Ni xray data, but invalidate the last dGobs fx_Ni = datafile("Ni_2-8.chi.gr") with open(fx_Ni) as fp: diff --git a/tests/test_pdfguicontrol.py b/tests/test_pdfguicontrol.py index 737d5c05..fbd656c9 100644 --- a/tests/test_pdfguicontrol.py +++ b/tests/test_pdfguicontrol.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Unit tests for pdfgui.control.pdfguicontrol.py -""" +"""Unit tests for pdfgui.control.pdfguicontrol.py.""" import unittest @@ -25,7 +23,7 @@ class TestPDFGuiControl(unittest.TestCase): - """test methods of PDFGuiControl""" + """Test methods of PDFGuiControl.""" def setUp(self): self.control = PDFGuiControl() diff --git a/tests/test_pdfstructure.py b/tests/test_pdfstructure.py index 2753328d..cf9e2703 100644 --- a/tests/test_pdfstructure.py +++ b/tests/test_pdfstructure.py @@ -1,7 +1,6 @@ #!/usr/bin/env python -"""Unit tests for class PDFStructure -""" +"""Unit tests for class PDFStructure.""" import unittest @@ -23,19 +22,19 @@ def tearDown(self): return def test___init__(self): - """check PDFStructure.__init__()""" + """Check PDFStructure.__init__()""" self.assertEqual("noname", self.stru.name) return def test_read(self): - """check PDFStructure.read()""" + """Check PDFStructure.read()""" stru = self.stru notastructurefile = datafile("300K.gr") self.assertRaises(ControlFileError, stru.read, notastructurefile, format="pdffit") return def test_copy(self): - """check PDFStructure.copy()""" + """Check PDFStructure.copy()""" stru2 = self.stru.copy() self.assertEqual("noname", stru2.name) self.assertEqual(self.stru.pdffit, stru2.pdffit) @@ -43,7 +42,7 @@ def test_copy(self): return def test_setvar(self): - """check PDFStructure.setvar()""" + """Check PDFStructure.setvar()""" stru = self.stru stru.addNewAtom("C", [0, 0, 0], anisotropy=True) stru.setvar("pscale", 1.5) @@ -77,7 +76,7 @@ def test_setvar(self): return def test_getvar(self): - """check PDFStructure.getvar()""" + """Check PDFStructure.getvar()""" from diffpy.structure import Atom stru = self.stru diff --git a/tests/test_phaseconfigurepanel.py b/tests/test_phaseconfigurepanel.py index aae1a27d..eec00bdd 100644 --- a/tests/test_phaseconfigurepanel.py +++ b/tests/test_phaseconfigurepanel.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -Unit tests for PhaseConfigurePanel class. -""" +"""Unit tests for PhaseConfigurePanel class.""" import unittest diff --git a/tests/test_showphasenotebookpanel.py b/tests/test_showphasenotebookpanel.py index 5fec5d5e..93db6f8f 100644 --- a/tests/test_showphasenotebookpanel.py +++ b/tests/test_showphasenotebookpanel.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Display the PhaseNotebookPanel. -""" +"""Display the PhaseNotebookPanel.""" import wx @@ -51,7 +49,7 @@ def dummy_true(self, *args, **kwds): return True def test(self): - """Testing code goes here""" + """Testing code goes here.""" project = LoadProject(datafile("lcmo.ddp")) fstru = project.getPhases()[0] self.window.configuration = fstru diff --git a/tests/test_structureviewer.py b/tests/test_structureviewer.py index 02602087..8421e046 100644 --- a/tests/test_structureviewer.py +++ b/tests/test_structureviewer.py @@ -1,7 +1,6 @@ #!/usr/bin/env python -"""Unit tests for diffpy.pdfgui.control.structureviewer -""" +"""Unit tests for diffpy.pdfgui.control.structureviewer.""" import os @@ -16,7 +15,7 @@ ############################################################################## class TestRoutines(unittest.TestCase): def test_getStructureViewer(self): - """check getStructureViewer() returns a singleton.""" + """Check getStructureViewer() returns a singleton.""" sv0 = getStructureViewer() uid0 = id(sv0) del sv0 @@ -38,13 +37,13 @@ def tearDown(self): return def test___init__(self): - """check StructureViewer.__init__()""" + """Check StructureViewer.__init__()""" sv = StructureViewer() self.assertEqual("%s", sv.argstr) return def test_getConfig(self): - """check StructureViewer.getConfig()""" + """Check StructureViewer.getConfig()""" sv = StructureViewer() self.assertEqual("%s", sv.getConfig()["argstr"]) sv.argstr = "foooo" @@ -52,7 +51,7 @@ def test_getConfig(self): return def test_setConfig(self): - """check StructureViewer.setConfig()""" + """Check StructureViewer.setConfig()""" sv = StructureViewer() cfg0 = sv.getConfig() sv.setConfig({"asdf": 7}) @@ -62,7 +61,7 @@ def test_setConfig(self): return def test_plot(self): - """check StructureViewer.plot()""" + """Check StructureViewer.plot()""" from diffpy.pdfgui.control.fitstructure import FitStructure sv = StructureViewer() @@ -81,7 +80,7 @@ def test_plot(self): return def test___del__(self): - """check StructureViewer.__del__()""" + """Check StructureViewer.__del__()""" import gc from diffpy.pdfgui.control.fitstructure import FitStructure diff --git a/tests/test_temperatureseriespanel.py b/tests/test_temperatureseriespanel.py index 02ae7897..dd02acfb 100644 --- a/tests/test_temperatureseriespanel.py +++ b/tests/test_temperatureseriespanel.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -""" -Unit tests for the TemperatureSeriesPanel class. -""" +"""Unit tests for the TemperatureSeriesPanel class.""" import unittest diff --git a/tests/test_version.py b/tests/test_version.py index f7b12e23..d4519637 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,10 +1,10 @@ -"""Unit tests for __version__.py -""" +"""Unit tests for __version__.py.""" import diffpy.pdfgui def test_package_version(): - """Ensure the package version is defined and not set to the initial placeholder.""" + """Ensure the package version is defined and not set to the initial + placeholder.""" assert hasattr(diffpy.pdfgui, "__version__") assert diffpy.pdfgui.__version__ != "0.0.0" diff --git a/tests/testutils.py b/tests/testutils.py index 6a887686..4b810805 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Helper routines for running other unit tests. -""" +"""Helper routines for running other unit tests.""" import os from contextlib import contextmanager @@ -103,7 +101,7 @@ def tooltiptext(widget): def clickcell(grid, leftright, row, col, **kw): - """Simulate left or right mouse click over wx.grid.Grid + """Simulate left or right mouse click over wx.grid.Grid. Parameters ---------- From 1cb189096fdf3351a767d2997685812626e8c67d Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Tue, 14 Jan 2025 09:27:22 -0500 Subject: [PATCH 11/20] docs: correct manual link (#249) * docs: correct manual link * [pre-commit.ci] auto fixes from pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- news/doctab.rst | 23 +++++++++++++++++++++++ src/diffpy/pdfgui/gui/mainframe.py | 4 +--- src/diffpy/pdfgui/gui/pdfguiglobals.py | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 news/doctab.rst diff --git a/news/doctab.rst b/news/doctab.rst new file mode 100644 index 00000000..fec2f635 --- /dev/null +++ b/news/doctab.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Changed the removed local manual link to the online page. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/diffpy/pdfgui/gui/mainframe.py b/src/diffpy/pdfgui/gui/mainframe.py index 16ed9551..6bbd2676 100644 --- a/src/diffpy/pdfgui/gui/mainframe.py +++ b/src/diffpy/pdfgui/gui/mainframe.py @@ -2528,10 +2528,8 @@ def onSaveCalc(self, event): def onDocumentation(self, event): """Show information about the documentation.""" import webbrowser - from urllib.request import pathname2url - url = "file://" + pathname2url(docMainFile) - webbrowser.open(url) + webbrowser.open(docMainFile) return # MISC INTERACTION ITEMS diff --git a/src/diffpy/pdfgui/gui/pdfguiglobals.py b/src/diffpy/pdfgui/gui/pdfguiglobals.py index 573a5c0c..cae1fa74 100644 --- a/src/diffpy/pdfgui/gui/pdfguiglobals.py +++ b/src/diffpy/pdfgui/gui/pdfguiglobals.py @@ -54,7 +54,7 @@ APPDATADIR = os.path.abspath(APPDATADIR) # Location of the HTML manual -docMainFile = os.path.join(APPDATADIR, "doc/manual/pdfgui.html") +docMainFile = "https://diffpy.github.io/diffpy.pdfgui/manual.html" del _upbasedir del _development_mode From ffc429cb74748f75081bce73e86931c40b221f7c Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Thu, 16 Jan 2025 06:43:26 -0500 Subject: [PATCH 12/20] fix: fix online manual imag and doc links (#254) --- doc/manual/html/readme.txt | 2 - doc/{source => manual}/images/Makefile | 0 doc/{source => manual}/images/eq-01.png | Bin doc/{source => manual}/images/eq-02.png | Bin doc/{source => manual}/images/fig2-01.png | Bin doc/{source => manual}/images/fig2-02.png | Bin doc/{source => manual}/images/fig2-03.png | Bin doc/{source => manual}/images/fig2-04.png | Bin doc/{source => manual}/images/fig2-05.png | Bin doc/{source => manual}/images/fig2-06.png | Bin doc/{source => manual}/images/fig2-07.png | Bin doc/{source => manual}/images/fig2-08.png | Bin doc/{source => manual}/images/fig2-09.png | Bin doc/{source => manual}/images/fig2-10.png | Bin doc/{source => manual}/images/fig2-11.png | Bin doc/{source => manual}/images/fig3-01.png | Bin doc/{source => manual}/images/fig3-02.png | Bin doc/{source => manual}/images/fig3-03.png | Bin doc/{source => manual}/images/fig3-04.png | Bin doc/{source => manual}/images/fig3-05.png | Bin doc/{source => manual}/images/fig3-06.png | Bin doc/{source => manual}/images/fig3-07.png | Bin doc/{source => manual}/images/fig3-08.png | Bin doc/{source => manual}/images/fig3-09.png | Bin doc/{source => manual}/images/fig3-10.png | Bin doc/{source => manual}/images/fig4-01.png | Bin doc/{source => manual}/images/fig4-02.png | Bin .../images/originals/fig2-01.png | Bin .../images/originals/fig2-01.xcf | Bin .../images/originals/fig2-02.png | Bin .../images/originals/fig2-03.png | Bin .../images/originals/fig2-04.png | Bin .../images/originals/fig2-05.png | Bin .../images/originals/fig2-06.png | Bin .../images/originals/fig2-07.png | Bin .../images/originals/fig2-08.png | Bin .../images/originals/fig2-09.png | Bin .../images/originals/fig2-10.png | Bin .../images/originals/fig2-11.png | Bin .../images/originals/fig3-01.png | Bin .../images/originals/fig3-02.png | Bin .../images/originals/fig3-03.png | Bin .../images/originals/fig3-04.png | Bin .../images/originals/fig3-05.png | Bin .../images/originals/fig3-06.png | Bin .../images/originals/fig3-07.png | Bin .../images/originals/fig3-08.png | Bin .../images/originals/fig3-09.png | Bin .../images/originals/fig3-10.png | Bin .../images/originals/fig4-01.png | Bin .../images/originals/fig4-02.png | Bin doc/manual/{html => }/pdfgui.html | 56 +++++++++--------- doc/manual/pdfgui.texinfo | 2 +- doc/source/conf.py | 2 +- doc/source/manual.rst | 2 +- news/html.rst | 23 +++++++ 56 files changed, 53 insertions(+), 34 deletions(-) delete mode 100644 doc/manual/html/readme.txt rename doc/{source => manual}/images/Makefile (100%) rename doc/{source => manual}/images/eq-01.png (100%) rename doc/{source => manual}/images/eq-02.png (100%) rename doc/{source => manual}/images/fig2-01.png (100%) rename doc/{source => manual}/images/fig2-02.png (100%) rename doc/{source => manual}/images/fig2-03.png (100%) rename doc/{source => manual}/images/fig2-04.png (100%) rename doc/{source => manual}/images/fig2-05.png (100%) rename doc/{source => manual}/images/fig2-06.png (100%) rename doc/{source => manual}/images/fig2-07.png (100%) rename doc/{source => manual}/images/fig2-08.png (100%) rename doc/{source => manual}/images/fig2-09.png (100%) rename doc/{source => manual}/images/fig2-10.png (100%) rename doc/{source => manual}/images/fig2-11.png (100%) rename doc/{source => manual}/images/fig3-01.png (100%) rename doc/{source => manual}/images/fig3-02.png (100%) rename doc/{source => manual}/images/fig3-03.png (100%) rename doc/{source => manual}/images/fig3-04.png (100%) rename doc/{source => manual}/images/fig3-05.png (100%) rename doc/{source => manual}/images/fig3-06.png (100%) rename doc/{source => manual}/images/fig3-07.png (100%) rename doc/{source => manual}/images/fig3-08.png (100%) rename doc/{source => manual}/images/fig3-09.png (100%) rename doc/{source => manual}/images/fig3-10.png (100%) rename doc/{source => manual}/images/fig4-01.png (100%) rename doc/{source => manual}/images/fig4-02.png (100%) rename doc/{source => manual}/images/originals/fig2-01.png (100%) rename doc/{source => manual}/images/originals/fig2-01.xcf (100%) rename doc/{source => manual}/images/originals/fig2-02.png (100%) rename doc/{source => manual}/images/originals/fig2-03.png (100%) rename doc/{source => manual}/images/originals/fig2-04.png (100%) rename doc/{source => manual}/images/originals/fig2-05.png (100%) rename doc/{source => manual}/images/originals/fig2-06.png (100%) rename doc/{source => manual}/images/originals/fig2-07.png (100%) rename doc/{source => manual}/images/originals/fig2-08.png (100%) rename doc/{source => manual}/images/originals/fig2-09.png (100%) rename doc/{source => manual}/images/originals/fig2-10.png (100%) rename doc/{source => manual}/images/originals/fig2-11.png (100%) rename doc/{source => manual}/images/originals/fig3-01.png (100%) rename doc/{source => manual}/images/originals/fig3-02.png (100%) rename doc/{source => manual}/images/originals/fig3-03.png (100%) rename doc/{source => manual}/images/originals/fig3-04.png (100%) rename doc/{source => manual}/images/originals/fig3-05.png (100%) rename doc/{source => manual}/images/originals/fig3-06.png (100%) rename doc/{source => manual}/images/originals/fig3-07.png (100%) rename doc/{source => manual}/images/originals/fig3-08.png (100%) rename doc/{source => manual}/images/originals/fig3-09.png (100%) rename doc/{source => manual}/images/originals/fig3-10.png (100%) rename doc/{source => manual}/images/originals/fig4-01.png (100%) rename doc/{source => manual}/images/originals/fig4-02.png (100%) rename doc/manual/{html => }/pdfgui.html (99%) create mode 100644 news/html.rst diff --git a/doc/manual/html/readme.txt b/doc/manual/html/readme.txt deleted file mode 100644 index cf60cf43..00000000 --- a/doc/manual/html/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory need to be relatively the same as doc/build/html/manual from -doc/source/_static/images diff --git a/doc/source/images/Makefile b/doc/manual/images/Makefile similarity index 100% rename from doc/source/images/Makefile rename to doc/manual/images/Makefile diff --git a/doc/source/images/eq-01.png b/doc/manual/images/eq-01.png similarity index 100% rename from doc/source/images/eq-01.png rename to doc/manual/images/eq-01.png diff --git a/doc/source/images/eq-02.png b/doc/manual/images/eq-02.png similarity index 100% rename from doc/source/images/eq-02.png rename to doc/manual/images/eq-02.png diff --git a/doc/source/images/fig2-01.png b/doc/manual/images/fig2-01.png similarity index 100% rename from doc/source/images/fig2-01.png rename to doc/manual/images/fig2-01.png diff --git a/doc/source/images/fig2-02.png b/doc/manual/images/fig2-02.png similarity index 100% rename from doc/source/images/fig2-02.png rename to doc/manual/images/fig2-02.png diff --git a/doc/source/images/fig2-03.png b/doc/manual/images/fig2-03.png similarity index 100% rename from doc/source/images/fig2-03.png rename to doc/manual/images/fig2-03.png diff --git a/doc/source/images/fig2-04.png b/doc/manual/images/fig2-04.png similarity index 100% rename from doc/source/images/fig2-04.png rename to doc/manual/images/fig2-04.png diff --git a/doc/source/images/fig2-05.png b/doc/manual/images/fig2-05.png similarity index 100% rename from doc/source/images/fig2-05.png rename to doc/manual/images/fig2-05.png diff --git a/doc/source/images/fig2-06.png b/doc/manual/images/fig2-06.png similarity index 100% rename from doc/source/images/fig2-06.png rename to doc/manual/images/fig2-06.png diff --git a/doc/source/images/fig2-07.png b/doc/manual/images/fig2-07.png similarity index 100% rename from doc/source/images/fig2-07.png rename to doc/manual/images/fig2-07.png diff --git a/doc/source/images/fig2-08.png b/doc/manual/images/fig2-08.png similarity index 100% rename from doc/source/images/fig2-08.png rename to doc/manual/images/fig2-08.png diff --git a/doc/source/images/fig2-09.png b/doc/manual/images/fig2-09.png similarity index 100% rename from doc/source/images/fig2-09.png rename to doc/manual/images/fig2-09.png diff --git a/doc/source/images/fig2-10.png b/doc/manual/images/fig2-10.png similarity index 100% rename from doc/source/images/fig2-10.png rename to doc/manual/images/fig2-10.png diff --git a/doc/source/images/fig2-11.png b/doc/manual/images/fig2-11.png similarity index 100% rename from doc/source/images/fig2-11.png rename to doc/manual/images/fig2-11.png diff --git a/doc/source/images/fig3-01.png b/doc/manual/images/fig3-01.png similarity index 100% rename from doc/source/images/fig3-01.png rename to doc/manual/images/fig3-01.png diff --git a/doc/source/images/fig3-02.png b/doc/manual/images/fig3-02.png similarity index 100% rename from doc/source/images/fig3-02.png rename to doc/manual/images/fig3-02.png diff --git a/doc/source/images/fig3-03.png b/doc/manual/images/fig3-03.png similarity index 100% rename from doc/source/images/fig3-03.png rename to doc/manual/images/fig3-03.png diff --git a/doc/source/images/fig3-04.png b/doc/manual/images/fig3-04.png similarity index 100% rename from doc/source/images/fig3-04.png rename to doc/manual/images/fig3-04.png diff --git a/doc/source/images/fig3-05.png b/doc/manual/images/fig3-05.png similarity index 100% rename from doc/source/images/fig3-05.png rename to doc/manual/images/fig3-05.png diff --git a/doc/source/images/fig3-06.png b/doc/manual/images/fig3-06.png similarity index 100% rename from doc/source/images/fig3-06.png rename to doc/manual/images/fig3-06.png diff --git a/doc/source/images/fig3-07.png b/doc/manual/images/fig3-07.png similarity index 100% rename from doc/source/images/fig3-07.png rename to doc/manual/images/fig3-07.png diff --git a/doc/source/images/fig3-08.png b/doc/manual/images/fig3-08.png similarity index 100% rename from doc/source/images/fig3-08.png rename to doc/manual/images/fig3-08.png diff --git a/doc/source/images/fig3-09.png b/doc/manual/images/fig3-09.png similarity index 100% rename from doc/source/images/fig3-09.png rename to doc/manual/images/fig3-09.png diff --git a/doc/source/images/fig3-10.png b/doc/manual/images/fig3-10.png similarity index 100% rename from doc/source/images/fig3-10.png rename to doc/manual/images/fig3-10.png diff --git a/doc/source/images/fig4-01.png b/doc/manual/images/fig4-01.png similarity index 100% rename from doc/source/images/fig4-01.png rename to doc/manual/images/fig4-01.png diff --git a/doc/source/images/fig4-02.png b/doc/manual/images/fig4-02.png similarity index 100% rename from doc/source/images/fig4-02.png rename to doc/manual/images/fig4-02.png diff --git a/doc/source/images/originals/fig2-01.png b/doc/manual/images/originals/fig2-01.png similarity index 100% rename from doc/source/images/originals/fig2-01.png rename to doc/manual/images/originals/fig2-01.png diff --git a/doc/source/images/originals/fig2-01.xcf b/doc/manual/images/originals/fig2-01.xcf similarity index 100% rename from doc/source/images/originals/fig2-01.xcf rename to doc/manual/images/originals/fig2-01.xcf diff --git a/doc/source/images/originals/fig2-02.png b/doc/manual/images/originals/fig2-02.png similarity index 100% rename from doc/source/images/originals/fig2-02.png rename to doc/manual/images/originals/fig2-02.png diff --git a/doc/source/images/originals/fig2-03.png b/doc/manual/images/originals/fig2-03.png similarity index 100% rename from doc/source/images/originals/fig2-03.png rename to doc/manual/images/originals/fig2-03.png diff --git a/doc/source/images/originals/fig2-04.png b/doc/manual/images/originals/fig2-04.png similarity index 100% rename from doc/source/images/originals/fig2-04.png rename to doc/manual/images/originals/fig2-04.png diff --git a/doc/source/images/originals/fig2-05.png b/doc/manual/images/originals/fig2-05.png similarity index 100% rename from doc/source/images/originals/fig2-05.png rename to doc/manual/images/originals/fig2-05.png diff --git a/doc/source/images/originals/fig2-06.png b/doc/manual/images/originals/fig2-06.png similarity index 100% rename from doc/source/images/originals/fig2-06.png rename to doc/manual/images/originals/fig2-06.png diff --git a/doc/source/images/originals/fig2-07.png b/doc/manual/images/originals/fig2-07.png similarity index 100% rename from doc/source/images/originals/fig2-07.png rename to doc/manual/images/originals/fig2-07.png diff --git a/doc/source/images/originals/fig2-08.png b/doc/manual/images/originals/fig2-08.png similarity index 100% rename from doc/source/images/originals/fig2-08.png rename to doc/manual/images/originals/fig2-08.png diff --git a/doc/source/images/originals/fig2-09.png b/doc/manual/images/originals/fig2-09.png similarity index 100% rename from doc/source/images/originals/fig2-09.png rename to doc/manual/images/originals/fig2-09.png diff --git a/doc/source/images/originals/fig2-10.png b/doc/manual/images/originals/fig2-10.png similarity index 100% rename from doc/source/images/originals/fig2-10.png rename to doc/manual/images/originals/fig2-10.png diff --git a/doc/source/images/originals/fig2-11.png b/doc/manual/images/originals/fig2-11.png similarity index 100% rename from doc/source/images/originals/fig2-11.png rename to doc/manual/images/originals/fig2-11.png diff --git a/doc/source/images/originals/fig3-01.png b/doc/manual/images/originals/fig3-01.png similarity index 100% rename from doc/source/images/originals/fig3-01.png rename to doc/manual/images/originals/fig3-01.png diff --git a/doc/source/images/originals/fig3-02.png b/doc/manual/images/originals/fig3-02.png similarity index 100% rename from doc/source/images/originals/fig3-02.png rename to doc/manual/images/originals/fig3-02.png diff --git a/doc/source/images/originals/fig3-03.png b/doc/manual/images/originals/fig3-03.png similarity index 100% rename from doc/source/images/originals/fig3-03.png rename to doc/manual/images/originals/fig3-03.png diff --git a/doc/source/images/originals/fig3-04.png b/doc/manual/images/originals/fig3-04.png similarity index 100% rename from doc/source/images/originals/fig3-04.png rename to doc/manual/images/originals/fig3-04.png diff --git a/doc/source/images/originals/fig3-05.png b/doc/manual/images/originals/fig3-05.png similarity index 100% rename from doc/source/images/originals/fig3-05.png rename to doc/manual/images/originals/fig3-05.png diff --git a/doc/source/images/originals/fig3-06.png b/doc/manual/images/originals/fig3-06.png similarity index 100% rename from doc/source/images/originals/fig3-06.png rename to doc/manual/images/originals/fig3-06.png diff --git a/doc/source/images/originals/fig3-07.png b/doc/manual/images/originals/fig3-07.png similarity index 100% rename from doc/source/images/originals/fig3-07.png rename to doc/manual/images/originals/fig3-07.png diff --git a/doc/source/images/originals/fig3-08.png b/doc/manual/images/originals/fig3-08.png similarity index 100% rename from doc/source/images/originals/fig3-08.png rename to doc/manual/images/originals/fig3-08.png diff --git a/doc/source/images/originals/fig3-09.png b/doc/manual/images/originals/fig3-09.png similarity index 100% rename from doc/source/images/originals/fig3-09.png rename to doc/manual/images/originals/fig3-09.png diff --git a/doc/source/images/originals/fig3-10.png b/doc/manual/images/originals/fig3-10.png similarity index 100% rename from doc/source/images/originals/fig3-10.png rename to doc/manual/images/originals/fig3-10.png diff --git a/doc/source/images/originals/fig4-01.png b/doc/manual/images/originals/fig4-01.png similarity index 100% rename from doc/source/images/originals/fig4-01.png rename to doc/manual/images/originals/fig4-01.png diff --git a/doc/source/images/originals/fig4-02.png b/doc/manual/images/originals/fig4-02.png similarity index 100% rename from doc/source/images/originals/fig4-02.png rename to doc/manual/images/originals/fig4-02.png diff --git a/doc/manual/html/pdfgui.html b/doc/manual/pdfgui.html similarity index 99% rename from doc/manual/html/pdfgui.html rename to doc/manual/pdfgui.html index 8d7eaacd..50c9c499 100644 --- a/doc/manual/html/pdfgui.html +++ b/doc/manual/pdfgui.html @@ -1793,7 +1793,7 @@

- images/fig2-01 + images/fig2-01

- images/fig2-02 + images/fig2-02

- images/fig2-03 + images/fig2-03

Figure 2.3: Adjusting data set related configuration. @@ -1914,7 +1914,7 @@

- images/fig2-04 + images/fig2-04

- images/fig2-05 + images/fig2-05

- images/fig2-06 + images/fig2-06

Figure 2.6: Reviewing the fit parameters and conditions. @@ -1993,7 +1993,7 @@

- images/fig2-07 + images/fig2-07

- images/fig2-08 + images/fig2-08

- images/fig2-09 + images/fig2-09

- images/fig2-10 + images/fig2-10

- images/fig2-11 + images/fig2-11

3.1 Building structure model using crystal symmetry

- images/fig3-01 + images/fig3-01

3.1 Building structure model using crystal symmetry

- images/fig3-02 + images/fig3-02

3.2 Calculating PDF from a structure

- images/fig3-03 + images/fig3-03

3.3.1 Multistage fitting

- images/fig3-04 + images/fig3-04

3.3.2 Sequential fitting of incremental r-series

- images/fig3-05 + images/fig3-05

3.3.3 Sequential fitting of temperature series

- images/fig3-06 + images/fig3-06

3.3.3 Sequential fitting of temperature series

- images/fig3-07 + images/fig3-07

3.3.4 Sequential fitting of doping series

- images/fig3-08 + images/fig3-08

3.3.4 Sequential fitting of doping series

- images/fig3-09 + images/fig3-09

To learn more about the tui module and about the objects and functions that it returns, please see the API documentation for diffpy.pdfgui at - http://docs.danse.us/diffraction/diffpy.pdfgui/https://diffpy.github.io/diffpy.pdfgui.

@@ -3342,7 +3342,7 @@

3.4 Nanoparticle structure

- images/fig3-10 + images/fig3-10

4.1 PDF plotting

- images/fig4-01 + images/fig4-01

4.2 Displaying the structure

- images/fig4-02 + images/fig4-02

Renamed variables applied when equal to zero. The Gaussian envelope is of the form

- images/eq-01.png + images/eq-01.png

@@ -4366,9 +4366,7 @@

5.4 PDF peak width

the first peak(s) in the observed PDF. PDFfit2 provides three different correction terms for the PDF peak width. The final width is given by

-

- images/eq-02.png -

+

images/eq-02.png

Here the primed sigma is the peak width without correlation, which is computed from the anisotropic displacement parameters. The first two terms diff --git a/doc/manual/pdfgui.texinfo b/doc/manual/pdfgui.texinfo index 8c79bbe7..14bd3834 100644 --- a/doc/manual/pdfgui.texinfo +++ b/doc/manual/pdfgui.texinfo @@ -1446,7 +1446,7 @@ the comments in the script for detailed explanation. To learn more about the tui module and about the objects and functions that it returns, please see the API documentation for diffpy.pdfgui at -@url{http://docs.danse.us/diffraction/diffpy.pdfgui/}. +@url{https://diffpy.github.io/diffpy.pdfgui}. Feel free to ask at the @url{https://groups.google.com/d/forum/diffpy-users, diffpy-users} diff --git a/doc/source/conf.py b/doc/source/conf.py index cc57882a..e4d1788a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -158,7 +158,7 @@ # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. -# html_extra_path = [] +html_extra_path = ["../manual"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/doc/source/manual.rst b/doc/source/manual.rst index 9667d818..158bda6e 100644 --- a/doc/source/manual.rst +++ b/doc/source/manual.rst @@ -13,4 +13,4 @@ Resources used - :download:`Nanoparticle structure ` .. raw:: html - :file: ../manual/html/pdfgui.html + :file: ../manual/pdfgui.html diff --git a/news/html.rst b/news/html.rst new file mode 100644 index 00000000..176aaf08 --- /dev/null +++ b/news/html.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fixed online manual not showing images. + +**Security:** + +* From bf4873cefaa179aa8bc05985f7f4b5af5ebd12e9 Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Thu, 16 Jan 2025 06:47:20 -0500 Subject: [PATCH 13/20] fix: buggy test click button url (#255) --- news/fixwin.rst | 23 +++++++++++++++++++++++ tests/testutils.py | 11 ++++------- 2 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 news/fixwin.rst diff --git a/news/fixwin.rst b/news/fixwin.rst new file mode 100644 index 00000000..a89da426 --- /dev/null +++ b/news/fixwin.rst @@ -0,0 +1,23 @@ +**Added:** + +* no news: fix the buggy test + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/tests/testutils.py b/tests/testutils.py index 4b810805..06cedbd6 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -35,20 +35,17 @@ def overridewebbrowser(fnc_open): "Temporarily replace `webbrowser.open` with given function." import webbrowser - controller = webbrowser.get() - save_open = controller.open + save_open = webbrowser.open def open_override(url, new=0, autoraise=True): fnc_open(url) return True - controller.open = open_override + webbrowser.open = open_override try: - yield save_open + yield finally: - del controller.open - assert controller.open == save_open - pass + webbrowser.open = save_open @contextmanager From c4469699fd72c8c6c604ef0df7740ec23ffed57a Mon Sep 17 00:00:00 2001 From: Caden Myers <158210249+cadenmyers13@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:35:24 -0500 Subject: [PATCH 14/20] style: change background color to match system (#243) * change background color to match system * news * Comply with dataset config panels * remove comment --- news/textbox-color.rst | 23 ++++++++++++++++++++ src/diffpy/pdfgui/gui/phaseconfigurepanel.py | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 news/textbox-color.rst diff --git a/news/textbox-color.rst b/news/textbox-color.rst new file mode 100644 index 00000000..d8c98f14 --- /dev/null +++ b/news/textbox-color.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Change background color to match system settings in `Phase Configuration`. + +**Security:** + +* diff --git a/src/diffpy/pdfgui/gui/phaseconfigurepanel.py b/src/diffpy/pdfgui/gui/phaseconfigurepanel.py index be3e74ce..88e6e3fd 100644 --- a/src/diffpy/pdfgui/gui/phaseconfigurepanel.py +++ b/src/diffpy/pdfgui/gui/phaseconfigurepanel.py @@ -321,6 +321,7 @@ def restrictConstrainedParameters(self): self.setToolTips(tooltips.phasepanel) self.textCtrlA.DefaultStyle.BackgroundColour + txtbg = self.textCtrlScaleFactor.DefaultStyle.BackgroundColour # First the TextCtrls for key, var in self.lConstraintsMap.items(): @@ -332,8 +333,7 @@ def restrictConstrainedParameters(self): tt.SetTip(self.constraints[var].formula) else: textCtrl.SetEditable(True) - # textCtrl.SetBackgroundColour(txtbg) - textCtrl.SetBackgroundColour(wx.WHITE) + textCtrl.SetBackgroundColour(txtbg) # Now the grid rows = self.gridAtoms.GetNumberRows() From b7c5c65ae98ab47043134450aa09890529ab2aaf Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Sat, 18 Jan 2025 08:29:19 -0500 Subject: [PATCH 15/20] refactor: ending support for WX3 (#259) * refactor: ending support for WX3 * refine news * pcmt --- .../api/diffpy.pdfgui.gui.wxextensions.rst | 8 -- news/wx3.rst | 23 +++++ src/diffpy/pdfgui/gui/extendedplotframe.py | 4 +- src/diffpy/pdfgui/gui/fittree.py | 3 +- src/diffpy/pdfgui/gui/mainframe.py | 90 +++++++++--------- src/diffpy/pdfgui/gui/parameterspanel.py | 7 +- src/diffpy/pdfgui/gui/phaseconfigurepanel.py | 15 ++- .../pdfgui/gui/phaseconstraintspanel.py | 9 +- .../pdfgui/gui/wxextensions/listctrls.py | 12 +-- src/diffpy/pdfgui/gui/wxextensions/wx12.py | 95 ------------------- 10 files changed, 88 insertions(+), 178 deletions(-) create mode 100644 news/wx3.rst delete mode 100644 src/diffpy/pdfgui/gui/wxextensions/wx12.py diff --git a/doc/source/api/diffpy.pdfgui.gui.wxextensions.rst b/doc/source/api/diffpy.pdfgui.gui.wxextensions.rst index eee1258e..75979fa7 100644 --- a/doc/source/api/diffpy.pdfgui.gui.wxextensions.rst +++ b/doc/source/api/diffpy.pdfgui.gui.wxextensions.rst @@ -11,14 +11,6 @@ diffpy.pdfgui.gui.wxextensions package Submodules ---------- -diffpy.pdfgui.gui.wxextensions.wx12 module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.pdfgui.gui.wxextensions.wx12 - :members: - :undoc-members: - :show-inheritance: - diffpy.pdfgui.gui.wxextensions.listctrls module ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/news/wx3.rst b/news/wx3.rst new file mode 100644 index 00000000..84557478 --- /dev/null +++ b/news/wx3.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* Removed wx3 support that was previously deprecated. + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/diffpy/pdfgui/gui/extendedplotframe.py b/src/diffpy/pdfgui/gui/extendedplotframe.py index a5f1b2cf..cb61e5e6 100644 --- a/src/diffpy/pdfgui/gui/extendedplotframe.py +++ b/src/diffpy/pdfgui/gui/extendedplotframe.py @@ -25,11 +25,10 @@ from matplotlib.font_manager import FontProperties from diffpy.pdfgui.gui.pdfguiglobals import iconpath -from diffpy.pdfgui.gui.wxextensions import wx12 matplotlib.use("WXAgg") -DATA_SAVE_ID = wx12.NewIdRef() +DATA_SAVE_ID = wx.NewIdRef() class ExtendedToolbar(NavToolbar): @@ -40,7 +39,6 @@ class ExtendedToolbar(NavToolbar): def __init__(self, canvas): NavToolbar.__init__(self, canvas) - wx12.patchToolBarMethods(self) # Load customized icon image save_icon_fp = iconpath("exportplotdata.png") save_icon = wx.Bitmap(save_icon_fp) diff --git a/src/diffpy/pdfgui/gui/fittree.py b/src/diffpy/pdfgui/gui/fittree.py index eddfbbb0..1416db92 100644 --- a/src/diffpy/pdfgui/gui/fittree.py +++ b/src/diffpy/pdfgui/gui/fittree.py @@ -30,11 +30,10 @@ from diffpy.pdfgui.control.controlerrors import ControlError from diffpy.pdfgui.control.fitting import Fitting from diffpy.pdfgui.gui.pdfguiglobals import iconpath -from diffpy.pdfgui.gui.wxextensions import wx12 from diffpy.pdfgui.utils import safeCPickleDumps -class FitTree(wx12.TreeCtrl): +class FitTree(wx.TreeCtrl): """TreeCtrl designed to organize pdffit fits. The root of the tree is hidden. Below that there are several levels diff --git a/src/diffpy/pdfgui/gui/mainframe.py b/src/diffpy/pdfgui/gui/mainframe.py index 6bbd2676..79804b06 100644 --- a/src/diffpy/pdfgui/gui/mainframe.py +++ b/src/diffpy/pdfgui/gui/mainframe.py @@ -48,7 +48,6 @@ from diffpy.pdfgui.gui.rseriespanel import RSeriesPanel from diffpy.pdfgui.gui.temperatureseriespanel import TemperatureSeriesPanel from diffpy.pdfgui.gui.welcomepanel import WelcomePanel -from diffpy.pdfgui.gui.wxextensions import wx12 (PDFCustomEvent, EVT_PDFCUSTOM) = wx.lib.newevent.NewEvent() @@ -234,14 +233,14 @@ def __defineLocalIds(self): """ # Functions that modify the tree. # These are used in the fitting right-click menu and the main menu. - self.newFitId = wx12.NewIdRef() # New Fit - self.newCalcId = wx12.NewIdRef() # New Calculation - self.newPhaseId = wx12.NewIdRef() # New Phase - self.newDataId = wx12.NewIdRef() # New Data Set + self.newFitId = wx.NewIdRef() # New Fit + self.newCalcId = wx.NewIdRef() # New Calculation + self.newPhaseId = wx.NewIdRef() # New Phase + self.newDataId = wx.NewIdRef() # New Data Set self.deleteId = wx.ID_DELETE # Delete tree item self.copyId = wx.ID_COPY # Copy a tree item self.pasteId = wx.ID_PASTE # Paste a tree item into tree - self.pasteLinkId = wx12.NewIdRef() # Paste and link a fit node + self.pasteLinkId = wx.NewIdRef() # Paste and link a fit node # Misc. functions, these are exclusive to the main menu. self.newId = wx.ID_NEW # Start a new Project @@ -250,19 +249,19 @@ def __defineLocalIds(self): self.saveId = wx.ID_SAVE # Save the project self.saveAsId = wx.ID_SAVEAS # Save the project as... self.quitId = wx.ID_CLOSE # Quit the program - self.runFitId = wx12.NewIdRef() # Run a fit - self.stopFitId = wx12.NewIdRef() # Stop a fit - self.quickPlotId = wx12.NewIdRef() # Quick plot a fit - self.exportFitPDFId = wx12.NewIdRef() # Save a fit PDF - self.exportFitStruId = wx12.NewIdRef() # Save a fit structure - self.exportNewStruId = wx12.NewIdRef() # Export a 'new' structure - self.plotIStructId = wx12.NewIdRef() # Plot initial structure - self.plotFStructId = wx12.NewIdRef() # Plot final structure - self.printBLId = wx12.NewIdRef() # Print the bond lengths of a structure - self.printBAId = wx12.NewIdRef() # Print the bond angles of a structure - self.exportResId = wx12.NewIdRef() # Save the results file - self.runCalcId = wx12.NewIdRef() # Run a calculation - self.exportCalcPDFId = wx12.NewIdRef() # Save a calculated PDF + self.runFitId = wx.NewIdRef() # Run a fit + self.stopFitId = wx.NewIdRef() # Stop a fit + self.quickPlotId = wx.NewIdRef() # Quick plot a fit + self.exportFitPDFId = wx.NewIdRef() # Save a fit PDF + self.exportFitStruId = wx.NewIdRef() # Save a fit structure + self.exportNewStruId = wx.NewIdRef() # Export a 'new' structure + self.plotIStructId = wx.NewIdRef() # Plot initial structure + self.plotFStructId = wx.NewIdRef() # Plot final structure + self.printBLId = wx.NewIdRef() # Print the bond lengths of a structure + self.printBAId = wx.NewIdRef() # Print the bond angles of a structure + self.exportResId = wx.NewIdRef() # Save the results file + self.runCalcId = wx.NewIdRef() # Run a calculation + self.exportCalcPDFId = wx.NewIdRef() # Save a calculated PDF return def __customProperties(self): @@ -438,12 +437,12 @@ def __setupMainMenu(self): self.SetMenuBar(self.menuBar) # File Menu - self.fileMenu = wx12.Menu() + self.fileMenu = wx.Menu() self.newItem = wx.MenuItem(self.fileMenu, self.newId, "&New Project\tCtrl+n", "", wx.ITEM_NORMAL) self.fileMenu.Append(self.newItem) self.openItem = wx.MenuItem(self.fileMenu, self.openId, "&Open Project\tCtrl+o", "", wx.ITEM_NORMAL) self.fileMenu.Append(self.openItem) - self.recentMenu = wx12.Menu() + self.recentMenu = wx.Menu() msub = self.fileMenu.AppendSubMenu(self.recentMenu, "&Recent Files") self.recentId = msub.Id self.fileMenu.AppendSeparator() @@ -464,7 +463,7 @@ def __setupMainMenu(self): # End File Menu # Edit Menu - self.editMenu = wx12.Menu() + self.editMenu = wx.Menu() self.delItem = wx.MenuItem(self.editMenu, self.deleteId, "&Delete Item(s)\tCtrl+X", "", wx.ITEM_NORMAL) self.editMenu.Append(self.delItem) self.copyItem = wx.MenuItem(self.editMenu, self.copyId, "&Copy Item\tCtrl+C", "", wx.ITEM_NORMAL) @@ -474,33 +473,33 @@ def __setupMainMenu(self): self.pasteLinkItem = wx.MenuItem(self.editMenu, self.pasteLinkId, "Paste &Linked Fit", "", wx.ITEM_NORMAL) self.editMenu.Append(self.pasteLinkItem) self.editMenu.AppendSeparator() - self.prefItem = wx.MenuItem(self.editMenu, wx12.NewIdRef(), "&Preferences", "", wx.ITEM_NORMAL) + self.prefItem = wx.MenuItem(self.editMenu, wx.NewIdRef(), "&Preferences", "", wx.ITEM_NORMAL) self.editMenu.Append(self.prefItem) self.menuBar.Append(self.editMenu, "&Edit") # End Edit Menu # View Menu - self.viewMenu = wx12.Menu() + self.viewMenu = wx.Menu() self.defaultLayoutItem = wx.MenuItem( - self.editMenu, wx12.NewIdRef(), "Default Window Layout", "", wx.ITEM_NORMAL + self.editMenu, wx.NewIdRef(), "Default Window Layout", "", wx.ITEM_NORMAL ) self.viewMenu.Append(self.defaultLayoutItem) self.viewMenu.AppendSeparator() # These items are context sensitive. - self.showFitItem = wx.MenuItem(self.viewMenu, wx12.NewIdRef(), "Show Fit Tree", "", wx.ITEM_NORMAL) + self.showFitItem = wx.MenuItem(self.viewMenu, wx.NewIdRef(), "Show Fit Tree", "", wx.ITEM_NORMAL) self.viewMenu.Append(self.showFitItem) - self.showPlotItem = wx.MenuItem(self.viewMenu, wx12.NewIdRef(), "Show Plot Control", "", wx.ITEM_NORMAL) + self.showPlotItem = wx.MenuItem(self.viewMenu, wx.NewIdRef(), "Show Plot Control", "", wx.ITEM_NORMAL) self.viewMenu.Append(self.showPlotItem) - self.showOutputItem = wx.MenuItem(self.viewMenu, wx12.NewIdRef(), "Show Output", "", wx.ITEM_NORMAL) + self.showOutputItem = wx.MenuItem(self.viewMenu, wx.NewIdRef(), "Show Output", "", wx.ITEM_NORMAL) self.viewMenu.Append(self.showOutputItem) self.showJournalItem = wx.MenuItem( - self.viewMenu, wx12.NewIdRef(), "Show Journal\tCtrl+j", "", wx.ITEM_NORMAL + self.viewMenu, wx.NewIdRef(), "Show Journal\tCtrl+j", "", wx.ITEM_NORMAL ) self.viewMenu.Append(self.showJournalItem) self.menuBar.Append(self.viewMenu, "&View") # Fits Menu - self.fitsMenu = wx12.Menu() + self.fitsMenu = wx.Menu() self.newFitItem = wx.MenuItem(self.fitsMenu, self.newFitId, "&New Fit\tCtrl+t", "", wx.ITEM_NORMAL) self.fitsMenu.Append(self.newFitItem) self.fitsMenu.AppendSeparator() @@ -513,19 +512,19 @@ def __setupMainMenu(self): self.fitsMenu.Append(self.expResItem) self.fitsMenu.AppendSeparator() # Macros sub-menu - self.macrosMenu = wx12.Menu() - self.rseriesItem = wx.MenuItem(self.macrosMenu, wx12.NewIdRef(), "r-Series", "", wx.ITEM_NORMAL) + self.macrosMenu = wx.Menu() + self.rseriesItem = wx.MenuItem(self.macrosMenu, wx.NewIdRef(), "r-Series", "", wx.ITEM_NORMAL) self.macrosMenu.Append(self.rseriesItem) - self.tseriesItem = wx.MenuItem(self.macrosMenu, wx12.NewIdRef(), "Temperature Series", "", wx.ITEM_NORMAL) + self.tseriesItem = wx.MenuItem(self.macrosMenu, wx.NewIdRef(), "Temperature Series", "", wx.ITEM_NORMAL) self.macrosMenu.Append(self.tseriesItem) - self.dseriesItem = wx.MenuItem(self.macrosMenu, wx12.NewIdRef(), "Doping Series", "", wx.ITEM_NORMAL) + self.dseriesItem = wx.MenuItem(self.macrosMenu, wx.NewIdRef(), "Doping Series", "", wx.ITEM_NORMAL) self.macrosMenu.Append(self.dseriesItem) self.fitsMenu.AppendSubMenu(self.macrosMenu, "Macros") self.menuBar.Append(self.fitsMenu, "Fi&ts") # End Fits Menu # Phases Menu - self.phasesMenu = wx12.Menu() + self.phasesMenu = wx.Menu() self.newPhaseItem = wx.MenuItem(self.phasesMenu, self.newPhaseId, "&New Phase\tCtrl+p", "", wx.ITEM_NORMAL) self.phasesMenu.Append(self.newPhaseItem) self.phasesMenu.AppendSeparator() @@ -580,7 +579,7 @@ def __setupMainMenu(self): # End Phases Menu # Data Menu - self.dataMenu = wx12.Menu() + self.dataMenu = wx.Menu() self.newDataItem = wx.MenuItem(self.dataMenu, self.newDataId, "&New Data Set\tCtrl+d", "", wx.ITEM_NORMAL) self.dataMenu.Append(self.newDataItem) self.dataMenu.AppendSeparator() @@ -590,7 +589,7 @@ def __setupMainMenu(self): # End Data Menu # Calculations Menu - self.calcMenu = wx12.Menu() + self.calcMenu = wx.Menu() self.newCalcItem = wx.MenuItem( self.calcMenu, self.newCalcId, @@ -621,20 +620,20 @@ def __setupMainMenu(self): # End Calculations Menu # Help Menu - self.helpMenu = wx12.Menu() - self.docItem = wx.MenuItem(self.helpMenu, wx12.NewIdRef(), "&Documentation\tF1", "", wx.ITEM_NORMAL) + self.helpMenu = wx.Menu() + self.docItem = wx.MenuItem(self.helpMenu, wx.NewIdRef(), "&Documentation\tF1", "", wx.ITEM_NORMAL) self.helpMenu.Append(self.docItem) self.requestItem = wx.MenuItem( self.helpMenu, - wx12.NewIdRef(), + wx.NewIdRef(), "Request a Feature / Report a Bug", "", wx.ITEM_NORMAL, ) self.helpMenu.Append(self.requestItem) - self.communityItem = wx.MenuItem(self.helpMenu, wx12.NewIdRef(), "PDFgui Community", "", wx.ITEM_NORMAL) + self.communityItem = wx.MenuItem(self.helpMenu, wx.NewIdRef(), "PDFgui Community", "", wx.ITEM_NORMAL) self.helpMenu.Append(self.communityItem) - self.aboutItem = wx.MenuItem(self.helpMenu, wx12.NewIdRef(), "&About", "", wx.ITEM_NORMAL) + self.aboutItem = wx.MenuItem(self.helpMenu, wx.NewIdRef(), "&About", "", wx.ITEM_NORMAL) self.helpMenu.Append(self.aboutItem) self.menuBar.Append(self.helpMenu, "&Help") # End Help Menu @@ -648,7 +647,6 @@ def __setupMainMenu(self): def __setupToolBar(self): """This sets up the tool bar in the parent window.""" self.toolBar = self.CreateToolBar() - wx12.patchToolBarMethods(self.toolBar) size = (16, 16) bitmap = wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR, size) self.toolBar.AddTool( @@ -1312,7 +1310,7 @@ def onRightClick(self, event): # wxGlade: MainPanel. if self.mode == "fitting": # The menu Ids are defined in __defineLocalIds. - menu = wx12.Menu() + menu = wx.Menu() menu.Append(self.newFitId, "New Fit") menu.AppendSeparator() menu.Append(self.copyId, "Copy") @@ -2546,11 +2544,11 @@ def showMessage(self, info, title="PDF Control Error"): # control items def lock(self): - if not wx12.IsMainThread(): + if not wx.IsMainThread(): wx.MutexGuiEnter() def unlock(self): - if not wx12.IsMainThread(): + if not wx.IsMainThread(): wx.MutexGuiLeave() def postEvent(self, type, info): diff --git a/src/diffpy/pdfgui/gui/parameterspanel.py b/src/diffpy/pdfgui/gui/parameterspanel.py index 616744a2..6a300f7a 100644 --- a/src/diffpy/pdfgui/gui/parameterspanel.py +++ b/src/diffpy/pdfgui/gui/parameterspanel.py @@ -24,7 +24,6 @@ import wx.grid from diffpy.pdfgui.gui.pdfpanel import PDFPanel -from diffpy.pdfgui.gui.wxextensions import wx12 from diffpy.pdfgui.gui.wxextensions.autowidthlabelsgrid import AutoWidthLabelsGrid from diffpy.utils.wx import gridutils @@ -274,9 +273,9 @@ def popupMenu(self, window, x, y): # only do this part the first time so the events are only bound once if not hasattr(self, "did_popupIDs"): self.did_popupIDs = True - self.popupID1 = wx12.NewIdRef() - self.popupID2 = wx12.NewIdRef() - self.popupID3 = wx12.NewIdRef() + self.popupID1 = wx.NewIdRef() + self.popupID2 = wx.NewIdRef() + self.popupID3 = wx.NewIdRef() self.Bind(wx.EVT_MENU, self.onPopupFixFree, id=self.popupID1) self.Bind(wx.EVT_MENU, self.onPopupCopyRefinedToInitial, id=self.popupID2) diff --git a/src/diffpy/pdfgui/gui/phaseconfigurepanel.py b/src/diffpy/pdfgui/gui/phaseconfigurepanel.py index 88e6e3fd..96281d5f 100644 --- a/src/diffpy/pdfgui/gui/phaseconfigurepanel.py +++ b/src/diffpy/pdfgui/gui/phaseconfigurepanel.py @@ -24,7 +24,6 @@ from diffpy.pdfgui.gui import phasepanelutils, tooltips from diffpy.pdfgui.gui.insertrowsdialog import InsertRowsDialog from diffpy.pdfgui.gui.pdfpanel import PDFPanel -from diffpy.pdfgui.gui.wxextensions import wx12 from diffpy.pdfgui.gui.wxextensions.autowidthlabelsgrid import AutoWidthLabelsGrid from diffpy.pdfgui.gui.wxextensions.textctrlutils import textCtrlAsGridCell from diffpy.pdfgui.gui.wxextensions.validators import FLOAT_ONLY, TextValidator @@ -642,13 +641,13 @@ def popupMenu(self, window, x, y): """ # only do this part the first time so the events are only bound once if not hasattr(self, "insertID"): - self.insertID = wx12.NewIdRef() - self.deleteID = wx12.NewIdRef() - self.selectID = wx12.NewIdRef() - self.copyID = wx12.NewIdRef() - self.pasteID = wx12.NewIdRef() - self.supercellID = wx12.NewIdRef() - self.spaceGroupID = wx12.NewIdRef() + self.insertID = wx.NewIdRef() + self.deleteID = wx.NewIdRef() + self.selectID = wx.NewIdRef() + self.copyID = wx.NewIdRef() + self.pasteID = wx.NewIdRef() + self.supercellID = wx.NewIdRef() + self.spaceGroupID = wx.NewIdRef() self.Bind(wx.EVT_MENU, self.onPopupInsert, id=self.insertID) self.Bind(wx.EVT_MENU, self.onPopupDelete, id=self.deleteID) diff --git a/src/diffpy/pdfgui/gui/phaseconstraintspanel.py b/src/diffpy/pdfgui/gui/phaseconstraintspanel.py index 564a2d36..45f37b36 100644 --- a/src/diffpy/pdfgui/gui/phaseconstraintspanel.py +++ b/src/diffpy/pdfgui/gui/phaseconstraintspanel.py @@ -26,7 +26,6 @@ from diffpy.pdfgui.gui import phasepanelutils, tooltips from diffpy.pdfgui.gui.pdfpanel import PDFPanel from diffpy.pdfgui.gui.sgconstraindialog import SGConstrainDialog -from diffpy.pdfgui.gui.wxextensions import wx12 from diffpy.pdfgui.gui.wxextensions.autowidthlabelsgrid import AutoWidthLabelsGrid from diffpy.pdfgui.gui.wxextensions.textctrlutils import textCtrlAsGridCell from diffpy.utils.wx import gridutils @@ -582,10 +581,10 @@ def popupMenu(self, window, x, y): """ # only do this part the first time so the events are only bound once if not hasattr(self, "spaceGroupID"): - self.spaceGroupID = wx12.NewIdRef() - self.selectID = wx12.NewIdRef() - self.copyID = wx12.NewIdRef() - self.pasteID = wx12.NewIdRef() + self.spaceGroupID = wx.NewIdRef() + self.selectID = wx.NewIdRef() + self.copyID = wx.NewIdRef() + self.pasteID = wx.NewIdRef() self.Bind(wx.EVT_MENU, self.onPopupSpaceGroup, id=self.spaceGroupID) self.Bind(wx.EVT_MENU, self.onPopupSelect, id=self.selectID) diff --git a/src/diffpy/pdfgui/gui/wxextensions/listctrls.py b/src/diffpy/pdfgui/gui/wxextensions/listctrls.py index d08a8cde..b018ae2e 100644 --- a/src/diffpy/pdfgui/gui/wxextensions/listctrls.py +++ b/src/diffpy/pdfgui/gui/wxextensions/listctrls.py @@ -25,14 +25,12 @@ import wx import wx.lib.mixins.listctrl as listmix -from diffpy.pdfgui.gui.wxextensions import wx12 - -class AutoWidthListCtrl(wx12.ListCtrl, listmix.ListCtrlAutoWidthMixin): +class AutoWidthListCtrl(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin): """WxListCtrl subclass that automatically adjusts its column width.""" def __init__(self, parent, ID, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, *args, **kwargs): - wx12.ListCtrl.__init__(self, parent, ID, pos, size, style, *args, **kwargs) + wx.ListCtrl.__init__(self, parent, ID, pos, size, style, *args, **kwargs) listmix.ListCtrlAutoWidthMixin.__init__(self) def clearSelections(self): @@ -185,6 +183,6 @@ def OnKeyDown(self, evt): # End of class KeyEventsListCtrl # verify inheritance of all ListCtrl classes -assert issubclass(AutoWidthListCtrl, wx12.ListCtrl) -assert issubclass(ColumnSortListCtrl, wx12.ListCtrl) -assert issubclass(KeyEventsListCtrl, wx12.ListCtrl) +assert issubclass(AutoWidthListCtrl, wx.ListCtrl) +assert issubclass(ColumnSortListCtrl, wx.ListCtrl) +assert issubclass(KeyEventsListCtrl, wx.ListCtrl) diff --git a/src/diffpy/pdfgui/gui/wxextensions/wx12.py b/src/diffpy/pdfgui/gui/wxextensions/wx12.py deleted file mode 100644 index 9560d2d0..00000000 --- a/src/diffpy/pdfgui/gui/wxextensions/wx12.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.pdfgui Complex Modeling Initiative -# (c) 2019 Brookhaven Science Associates, -# Brookhaven National Laboratory. -# All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## -"""Support for WX4-like methods and functions for WX3. - -Notes ------ -This module should be removed after ending support for WX3. -Replace instances of its use with plain ``wx``. -""" - -import types - -import wx - -WX3 = wx.VERSION[0] == 3 -WX4 = wx.VERSION[0] == 4 - -# ---------------------------------------------------------------------------- - - -class Menu(wx.Menu): - def Append(self, *args, **kwargs): - na = len(args) - if isinstance(args[0], wx.MenuItem): - return super(Menu, self).AppendItem(*args, **kwargs) - if na > 2 and isinstance(args[2], wx.Menu): - return super(Menu, self).AppendMenu(*args, **kwargs) - plain_append = isinstance(args[0], int) and (na > 1 and isinstance(args[1], str) or "item" in kwargs) - if plain_append: - return super(Menu, self).Append(*args, **kwargs) - assert False, "unexpected argument types" - - -if WX4: - Menu = wx.Menu # noqa: F811 - -# ---------------------------------------------------------------------------- - - -class ListCtrl(wx.ListCtrl): - - InsertItem = wx.ListCtrl.InsertStringItem - SetItem = wx.ListCtrl.SetStringItem - - -if WX4: - ListCtrl = wx.ListCtrl # noqa: F811 - -# ---------------------------------------------------------------------------- - - -class TreeCtrl(wx.TreeCtrl): - - GetItemData = wx.TreeCtrl.GetPyData - SetItemData = wx.TreeCtrl.SetPyData - - -if WX4: - TreeCtrl = wx.TreeCtrl # noqa: F811 - -# wx.ToolBar ----------------------------------------------------------------- - - -def AddTool(self, *args, **kwargs): - return super(wx.ToolBar, self).AddLabelTool(*args, **kwargs) - - -def patchToolBarMethods(toolbar): - if WX3: - toolbar.AddTool = types.MethodType(AddTool, toolbar) - return - - -# Functions ------------------------------------------------------------------ - -IsMainThread = wx.Thread_IsMain if WX3 else wx.IsMainThread -NewIdRef = wx.NewIdRef if WX4 else wx.NewId - -# Final checks --------------------------------------------------------------- - -assert WX3 ^ (Menu is wx.Menu) -assert WX3 ^ (TreeCtrl is wx.TreeCtrl) -assert WX3 ^ (ListCtrl is wx.ListCtrl) From 792e22d9a94a81d2c01b21ad97bfb034293b94a1 Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Mon, 20 Jan 2025 06:10:18 -0500 Subject: [PATCH 16/20] ci: fix failing py3.13 on osx-64 (#258) * ci: fix failing py3.13 on osx-64 * use miniforge * better news --------- Co-authored-by: Simon Billinge --- .../matrix-and-codecov-on-merge-to-main.yml | 2 +- news/osx13.rst | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 news/osx13.rst diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml index 316ae780..8fb1923b 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -32,7 +32,7 @@ jobs: uses: conda-incubator/setup-miniconda@v3 with: activate-environment: test - auto-update-conda: true + miniforge-version: latest environment-file: environment.yml auto-activate-base: false python-version: ${{ matrix.python-version }} diff --git a/news/osx13.rst b/news/osx13.rst new file mode 100644 index 00000000..62cb825b --- /dev/null +++ b/news/osx13.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Use miniforge in CI to avoid strange error of incorrect MacOS version logged from base env + +**Security:** + +* From 6544a93b14c01559df1ba851dcb339037ba562cd Mon Sep 17 00:00:00 2001 From: Tieqiong <123656525+Tieqiong@users.noreply.github.com> Date: Fri, 24 Jan 2025 14:38:46 -0500 Subject: [PATCH 17/20] add: use ws interp for nyq grid (#263) * add: use ws interp for nyq grid * [pre-commit.ci] auto fixes from pre-commit hooks * update tests and small param order adjustment * [pre-commit.ci] auto fixes from pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- news/ws.rst | 23 +++++++++ src/diffpy/pdfgui/control/fitdataset.py | 69 +++++++++++++++++++------ tests/test_fitdataset.py | 2 +- 3 files changed, 76 insertions(+), 18 deletions(-) create mode 100644 news/ws.rst diff --git a/news/ws.rst b/news/ws.rst new file mode 100644 index 00000000..59526e7b --- /dev/null +++ b/news/ws.rst @@ -0,0 +1,23 @@ +**Added:** + +* Added Whittaker-Shannon interpolation option for grid_interpolation. + +**Changed:** + +* Use WS interpolation for Nyquist grid. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/diffpy/pdfgui/control/fitdataset.py b/src/diffpy/pdfgui/control/fitdataset.py index 607b14c4..559e9dbd 100644 --- a/src/diffpy/pdfgui/control/fitdataset.py +++ b/src/diffpy/pdfgui/control/fitdataset.py @@ -22,6 +22,7 @@ from diffpy.pdfgui.control.controlerrors import ControlStatusError from diffpy.pdfgui.control.parameter import Parameter from diffpy.pdfgui.control.pdfdataset import PDFDataSet +from diffpy.utils.resampler import wsinterp class FitDataSet(PDFDataSet): @@ -610,13 +611,14 @@ def _updateRcalcSampling(self): if frmax - (rcalcfirst + nrcalc * frstep) > frstep * 1e-8: nrcalc += 1 newrcalc = rcalcfirst + frstep * numpy.arange(nrcalc + 1) + tp = self.getFitSamplingType() # Gcalc: if len(self._Gcalc) > 0: - newGcalc = grid_interpolation(self._rcalc, self._Gcalc, newrcalc) + newGcalc = grid_interpolation(self._rcalc, self._Gcalc, newrcalc, tp=tp) self._Gcalc = list(newGcalc) # dGcalc if len(self._dGcalc) > 0: - newdGcalc = grid_interpolation(self._rcalc, self._dGcalc, newrcalc) + newdGcalc = grid_interpolation(self._rcalc, self._dGcalc, newrcalc, tp=tp) self._dGcalc = list(newdGcalc) # invalidate Gtrunc and dGtrunc self._Gtrunc = [] @@ -709,7 +711,8 @@ def _set_dGcalc(self, value): def _get_Gtrunc(self): self._updateRcalcSampling() if not self._Gtrunc: - newGtrunc = grid_interpolation(self.robs, self.Gobs, self.rcalc) + tp = self.getFitSamplingType() + newGtrunc = grid_interpolation(self.robs, self.Gobs, self.rcalc, tp=tp) self._Gtrunc = list(newGtrunc) return self._Gtrunc @@ -724,13 +727,15 @@ def _set_Gtrunc(self, value): def _get_dGtrunc(self): self._updateRcalcSampling() if not self._dGtrunc: + tp = self.getFitSamplingType() # use sum to avoid index error for empty arrays newdGtrunc = grid_interpolation( self.robs, self.dGobs, self.rcalc, - youtleft=sum(self.dGobs[:1]), - youtright=sum(self.dGobs[-1:]), + left=sum(self.dGobs[:1]), + right=sum(self.dGobs[-1:]), + tp=tp, ) self._dGtrunc = list(newdGtrunc) return self._dGtrunc @@ -775,19 +780,8 @@ def _set_crw(self, value): ############################################################################## # helper functions ############################################################################## +def _linear_interpolation(x0, y0, x1, youtleft, youtright): - -def grid_interpolation(x0, y0, x1, youtleft=0.0, youtright=0.0): - """Linear interpolation of x0, y0 values to a new grid x1. - - x0 -- original x-grid, must be equally spaced - y0 -- original y values - x1 -- new x-grid, it can have any spacing - youtleft -- value for interpolated y1 for x1 below the x0 range - youtright -- value for interpolated y1 for x1 above the x0 range - - Return numpy.array of interpolated y1 values. - """ x0 = numpy.asarray(x0, copy=None, dtype=float) y0 = numpy.asarray(y0, copy=None, dtype=float) n0 = len(x0) @@ -820,6 +814,47 @@ def grid_interpolation(x0, y0, x1, youtleft=0.0, youtright=0.0): return y1 +def grid_interpolation(x0, y0, x1, left=None, right=None, tp=None): + """Interpolate values from one grid onto another using either linear or + Whittaker–Shannon interpolation. + + Parameters + ---------- + x0 : array_like + Original x-grid, must be equally spaced. + y0 : array_like + Original values defined on x0. + x1 : array_like + New x-grid upon which to interpolate. + tp : {'data', 'Nyquist', 'custom'}, optional + Corresponding fit sampling type. Use Whittaker–Shannon interpolation + for Nyquist resampling and linear interpolation otherwise. + If not provided, linear interpolation is used. + left : float, optional + Value for interpolated y1 for x1 below the x0 range. + Default: if tp='Nyquist' then y1[0] is used. Otherwise 0.0 is used. + right : float, optional + Value for interpolated y1 for x1 above the x0 range. + Default: if tp='Nyquist' then y1[-1] is used. Otherwise 0.0 is used. + + Returns + ------- + numpy.ndarray + Array of interpolated values on the new grid x1. + + Notes + ----- + When tp='Nyquist', the function calls :func:`wsinterp` to perform Whittaker–Shannon interpolation. + Otherwise it uses the internal :func:`_linear_interpolation` routine. + """ + if tp == "Nyquist": + return wsinterp(x1, x0, y0, left, right) + else: + left = 0.0 if left is None else left + right = 0.0 if right is None else right + return _linear_interpolation(x0, y0, x1, left, right) + + # simple test code if __name__ == "__main__": FitDataSet("name") diff --git a/tests/test_fitdataset.py b/tests/test_fitdataset.py index 7ec0d1ff..2e8c0655 100644 --- a/tests/test_fitdataset.py +++ b/tests/test_fitdataset.py @@ -39,7 +39,7 @@ def test_grid_interpolation(self): y0 = numpy.sin(x0) x1 = [-6, x0[0], -0.2, x0[-1], 37] y1a = fds.grid_interpolation(x0, y0, x1) - y1b = fds.grid_interpolation(x0, y0, x1, youtleft=637, youtright=638) + y1b = fds.grid_interpolation(x0, y0, x1, left=637, right=638) # outside values self.assertEqual(0.0, y1a[0]) self.assertEqual(637, y1b[0]) From b911fddd60f4e0d24bfe62a4fd8a3608a68a6def Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Fri, 24 Jan 2025 14:39:23 -0500 Subject: [PATCH 18/20] doc: simon refresh of manual and docs (#256) * intermediate commit of new tutorial * news --- doc/source/tutorial.rst | 107 +++++++++++++++++++++++++++++++--------- news/docs2501.rst | 23 +++++++++ 2 files changed, 108 insertions(+), 22 deletions(-) create mode 100644 news/docs2501.rst diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst index 1a199f09..7b88c041 100644 --- a/doc/source/tutorial.rst +++ b/doc/source/tutorial.rst @@ -17,51 +17,114 @@ Input files: 1. Ni-xray.gr - experimental X-ray PDF data 2. Ni.stru - Ni f.c.c. structure in PDFfit format +This manual will help you to get started with ``PDFgui``. We strongly recommend that that you refer to +the book `Atomic pair distribution function analysis: a primer` by Simon J. L. Billinge, Kirsten Jensen +Soham Banerjee, Emil S. Bozin, Benjamin A. Frandsen, Maxwell W. Terban and Robert J. Koch, Oxford: +Oxford University Press, 2024. URL: https://global.oup.com/academic/product/atomicpair-distribution-function-analysis-9780198885801?cc=us&lang=en& +for much more extensive and detailed descriptions of carrying out fits with PDFgui (and the related program diffpy-cmi). + Procedure: -1. Open a terminal and type ``pdfgui`` to start the program. +1. Open ``pdfgui``. Instructions for doing this depend on your system, but an example would be + to open a terminal, activate your pdfgui conda environment, and type ``pdfgui`` at the prompt, + or to double-click a project file on windows. 2. Create a new Fit: - 1. Select "FITTING" in the left-most vertical tab. - 2. Click right mouse button in the left panel and choose "New Fit" in the pop-up menu. + 1. In the GUI locate the ``Fit Tree`` panel. In the default layout it is at the top left of the page. + 2. With your mouse on that panel, right-click the mouse and select "New Fit" from the pop-up menu. + 3. By default, your fit will be called ``Fit 1``. To give it a more meaningful name, left + click the ``Fit 1`` name. It should open an editable box and you can type in a name for your + fit such as "Fit of Ni structure to Ni data" + 4. Note, an alternative workflow to create a new fit is to find ``New fit`` under the ``Fits`` dropdown menu. 3. Load structure model: - 1. Place the cursor of the mouse onto the title of the Fit, click the right button and choose "Insert Phase" in the pop-up menu. - 2. Click the "Open" button and load the `Ni.stru` file. + 1. Carefully place your cursor on to the title of the Fit and right-click. Select "Insert Phase" from the pop-up menu. + 2. Click the "Open" button and navigate to and load the ``Ni.stru`` file that you downloaded. You could select + valid structure model file, a ``.stru`` or a ``.cif`` file. + 3. Note, an alternative workflow for adding structural models is to select ``New Phase`` from the ``Phases`` dropdown menu. + + If you select the Phase in the ``Fit Tree`` by left clicking on it, you will see in the + right panel 3 tabs, ``Configure`` ``Constraints``, ``Results``. Feel free to click one + these tabs and look inside. The Configure panel has the initial inputs from the loaded str or cif file, + The ``Constraints`` panel will hold the constraints we will set up for our fits, it should be empty now, + and the results tab will contain the results of any fit. - The right panel has 3 tabs for the initial configuration, constraints panel for expressing structure properties as functions of tunable parameters, and Results panel for refined structure. + Note that what you see on the right is "Context Dependent", it depends on what you have selected on the left. + By selecting a phase on the left, the tabs on the right contain information about that phase, and so on. 4. Load experimental PDF data: - 1. Select the title of "Fit 1", click the right button and choose "Insert Data Set" in the pop-up menu. - 2. Load the `Ni-xray.gr` file. + 1. As before, hover over your cursor over the title of your fit and right-click. This time select + ``Insert Data Set`` from the pop-up menu. + 2. Navigate to and load the `Ni-xray.gr` file that you downloaded. - Again, the right panel shows 3 tabs for properties of this dataset. + Again, the right panel shows 3 tabs, now for properties of this dataset. 5. Define what is refined: 1. Click on the `Ni-xray.gr` data and select the "Constraints" tab. - 2. Type ``@1`` into "Scale Factor" edit box. + 2. Type ``@1`` into the "Scale Factor" edit box. 3. Select the `Ni.stru` phase and its "Constraints" tab. 4. Fill "a", "b", "c" boxes with ``@5``. - A refined variable can be expressed as a math expression: + Here we are defining "variables" that will be refined and giving them names + variable "@1", "@5", etc. and linking them to model parameters by typing them + in the text-box associated with the parameter. So by typing ``@1`` in the + data "Scale-Factor" text box we are saying that we are logically assigning the constraint + equation ``data.scale_factor = variable("@1")``. + + When we assign the three parameters ``a``, ``b`` and ``c`` to the same variable, + ``@5``, we are implicitly ensuring that the refinement will respect + the cubic symmetry of the nickel structure and that ``a = b = c``, because the + three parameters are assigned to the same variable, so however much ``a`` + is changed in the refinement, ``b`` and ``c`` will be changed by the same amount. + Note that the variable ensures that changes to ``a``, ``b`` and ``c`` are always + the same, so we have to also ensure that the initial values of ``a``, ``b`` and ``c`` + are the same as each other to ensure that the structure is cubic and remains so. + + PDFgui allows us to express more complex constraint equations than + simply assigning a parameter to a variable. + In general, we can type into be Constraints tab text box any math expression: ``f(@n1, @n2, @n3, ...)`` where - ``@n1`` stands for fitted parameter and + ``@n1`` stands for the fitted parameter, where it is understood that ``n1, n2, ...`` are arbitrary positive integers. - This allows simple linking of related variables - for example, since - cell lengths a, b, c are all expressed as ``@5``, the refined structure will remain cubic. + This allows simple linking of related variables. For example, if we want to allow a + crystallographic site to contain either Ni or Pt, we don't know how much Ni or Pt is + on the site, but we want it to be always fully occupied, we could create two lattice + site entries with the same fractional coordinates, with one assigned Ni as the element and the other + assigned Pt as the element. Then we could assign the Ni occupancy as ``@100``. Then + typing ``1-@100`` into the constraint text box of the Pt occupancy ensures that however + much the occupancy of the Ni site goes down in a refinement, the occupancy of the Pt on that + same site goes up by the same amount. This ensures full occupancy of that site, as long + as the initial occupancies of the Ni and Pt added up to 1. 6. Start the refinement: - 1. Select "Fit 1" in the left panel. The parameters panel shows a list of used parameters and their initial values. - 2. Click the "gear" icon on the toolbar and watch the fit progress in the terminal window. + 1. Select the fit to run by left clicking the title of the fit in the ``Fit Tree`` panel. + The ``Parameters`` panel on the right shows a list of variables that you have defined + and their initial values. Each one also has a check-box that allows you to fix them + (prevent them from varying in the subsequent refinement). Unchecked boxes mean the variable + will be refined. + 2. When you are satisfied with the configuration, click the "gear" icon on the toolbar + and watch the fit progress in the terminal window. 7. Plot the results: - 1. Select "PLOTTING" in the left-most vertical tab. - 2. Select the `Ni-xray.gr` dataset. - 3. Select "r" as the X plotting variable. - 4. Hold down shift and select "Gcalc" and "Gtrunc" as the Y plotting variables. - 5. Click "Plot" button. + 1. Select the data in the fit (in this case the `Ni-xray.gr` dataset) by left clicking it. + 2. Click the ``plot`` icon in the toolbar. This is the icon that looks a bit like a PDF + to the right of the Gear and the red/grey X. + + A new window pops up with the plots. It will show the data in blue, the best-fit model + curve in red, and offset below, the difference curve in green. The offset of the difference + curve appears at a default value of ``-5.0``. You can make your plot more pretty and meaningful + by typing a different offset into the ``offset`` text box and hitting ``Plot`` again. + + It is possible to configure the plot in the ``Plot Control`` panel in the GUI. + In the default layout it will be at the lower-left of the GUI panel. + + 1. To plot the fit (as was done above) elect "r" as the X plotting variable. + 2. Hold down shift and select "Gcalc" and "Gtrunc" as the Y plotting variables. + 3. Click the "Plot" button. + + This panel allows more plotting options for advanced cases such as plotting the values + of parameters refined across multiple fits to extract temperature dependent information. - A new window pops up with plots. You can try out the buttons in the toolbar below. 8. Save your project for later use. diff --git a/news/docs2501.rst b/news/docs2501.rst new file mode 100644 index 00000000..72b303b6 --- /dev/null +++ b/news/docs2501.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Refreshed tutorial manual and brought documentation up to date + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 93df98ac41675b1a6229647b5ea3e01fd5b15bc9 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Fri, 24 Jan 2025 15:16:24 -0500 Subject: [PATCH 19/20] doc: intermediate commit on readme --- README.rst | 58 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index 8ad9c35d..a0ace844 100644 --- a/README.rst +++ b/README.rst @@ -67,37 +67,69 @@ cite this package as Installation ------------ +Windows, macOS (non-Arm64), Linux +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + The preferred method is to use `Miniconda Python `_ and install from the "conda-forge" channel of Conda packages. -To add "conda-forge" to the conda channels, run the following in a terminal. :: +Add the "conda-forge" channel by running the following command in a terminal: :: conda config --add channels conda-forge -We want to install our packages in a suitable conda environment. -The following creates and activates a new environment named ``diffpy.pdfgui_env`` :: +Create a new environment named ``diffpy.pdfgui_env`` and install ``diffpy.pdfgui``: :: conda create -n diffpy.pdfgui_env diffpy.pdfgui + +Activate the environment: :: + conda activate diffpy.pdfgui_env -To confirm that the installation was successful, type :: +Confirm that the installation was successful: :: python -c "import diffpy.pdfgui; print(diffpy.pdfgui.__version__)" -The output should print the latest version displayed on the badges above. +macOS (Arm64) +~~~~~~~~~~~~~ + +Create a new conda environment ``diffpy.pdfgui_env``: :: + + conda create -n diffpy.pdfgui_env python=3.13 + +Activate the environment: :: + + conda activate diffpy.pdfgui_env + +It is necessary to get versions of pdffit2 built for Mac from Python package index (Pypi). To install +pdffit2 from Pypi using ``pip`` to download and install the latest version from `Python Package Index `_: :: + + pip install diffpy.pdffit2 + +Confirm that the installation was successful: :: + + python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" + +Now we want to install PDFgui from conda-forge + + conda install diffpy.pdfgui + + +Build from source +~~~~~~~~~~~~~~~~~ -If the above does not work, you can use ``pip`` to download and install the latest release from -`Python Package Index `_. -To install using ``pip`` into your ``diffpy.pdfgui_env`` environment, type :: +For advanced users, obtain the source archive, and in the ``diffpy.pdffit2`` directory, run :: - pip install diffpy.pdfgui + conda create -n diffpy.pdffit2_env python=3.13 \ + --file requirements/test.txt \ + --file requirements/conda.txt \ + --file requirements/build.txt -If you prefer to install from sources, after installing the dependencies, obtain the source archive from -`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdfgui`` directory -and run the following :: +Activate the environment, build the package, and run unit tests by following commands sequentially: :: - pip install . + conda activate diffpy.pdffit2_env + pip install . --no-deps + pytest Getting Started --------------- From 3e9ef213d461f7226309a70ecf427172d109eba4 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Fri, 24 Jan 2025 15:56:20 -0500 Subject: [PATCH 20/20] doc: update readme install instructions --- README.rst | 5 +++-- news/readme.rst | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 news/readme.rst diff --git a/README.rst b/README.rst index a0ace844..e8c6d694 100644 --- a/README.rst +++ b/README.rst @@ -110,9 +110,10 @@ Confirm that the installation was successful: :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" -Now we want to install PDFgui from conda-forge +Now we want to install PDFgui and dependencies from conda-forge: :: - conda install diffpy.pdfgui + conda install wxpython diffpy.utils matplotlib-base + conda install diffpy.pdfgui --no-deps Build from source diff --git a/news/readme.rst b/news/readme.rst new file mode 100644 index 00000000..a023cbbd --- /dev/null +++ b/news/readme.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Updated install instructions in README.rst. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*