From 77f4e58ff42c4fc56d3d40d8ce5e4ca471b1acfd Mon Sep 17 00:00:00 2001 From: 8bitsam Date: Tue, 11 Jun 2024 13:59:39 -0400 Subject: [PATCH 001/294] added configs for vscode and any jetbrains IDEs to .gitignore --- .idea/.gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..13566b81 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml From 49fbc23672bfaec1d34a0876e6fd48fde0e38a91 Mon Sep 17 00:00:00 2001 From: 8bitsam Date: Tue, 11 Jun 2024 14:00:42 -0400 Subject: [PATCH 002/294] Added relevant IDE config files to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 7a8f6d5b..3298c515 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,10 @@ lib64 tags errors.err +# IDE configs +.idea +.vscode + # Installer logs pip-log.txt MANIFEST From 64da5cc28edce6a36f4744775c71f2d9bad8144c Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 11:41:00 -0400 Subject: [PATCH 003/294] Add pyproject.toml with black config --- pyproject.toml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..d7351b5e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[tool.black] +line-length = 115 +include = '\.pyi?$' +exclude = ''' +/( + \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | \.rst + | \.txt + | _build + | buck-out + | build + | dist + + # The following are specific to Black, you probably don't want those. + | blib2to3 + | tests/data +)/ +''' \ No newline at end of file From 7ee646176877bbdba4d708e7b4b4e964323f2f82 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 11:43:26 -0400 Subject: [PATCH 004/294] Run black --- diffpy/__init__.py | 1 + diffpy/pdffit2/ipy_ext.py | 22 +- diffpy/pdffit2/output.py | 3 + diffpy/pdffit2/pdffit.py | 213 +++--- diffpy/pdffit2/tests/ExceptionsTest.py | 307 ++++----- diffpy/pdffit2/tests/TestPdfFit.py | 750 ++++++++++----------- diffpy/pdffit2/tests/TestPhaseFractions.py | 105 ++- diffpy/pdffit2/tests/TestShapeFactors.py | 192 +++--- diffpy/pdffit2/tests/__init__.py | 34 +- diffpy/pdffit2/tests/debug.py | 5 +- diffpy/pdffit2/tests/pdffit2testutils.py | 14 +- diffpy/pdffit2/tests/run.py | 5 +- diffpy/pdffit2/tests/rundeps.py | 3 +- diffpy/pdffit2/version.py | 20 +- 14 files changed, 758 insertions(+), 916 deletions(-) diff --git a/diffpy/__init__.py b/diffpy/__init__.py index 1a099c09..f093b937 100644 --- a/diffpy/__init__.py +++ b/diffpy/__init__.py @@ -21,6 +21,7 @@ from pkgutil import extend_path + __path__ = extend_path(__path__, __name__) diff --git a/diffpy/pdffit2/ipy_ext.py b/diffpy/pdffit2/ipy_ext.py index 13b41214..df8bc537 100644 --- a/diffpy/pdffit2/ipy_ext.py +++ b/diffpy/pdffit2/ipy_ext.py @@ -9,9 +9,10 @@ def load_ipython_extension(ipython): from diffpy.pdffit2 import PdfFit + pf = PdfFit() pdf = EasyPDFPlotting(pf) - print(' Type help(pdffit) or help(topic) for information.\n') + print(" Type help(pdffit) or help(topic) for information.\n") ns = dict(pdffit=PdfFit, pdf=pdf) pf._exportAll(ns) ipython.user_ns.update(ns) @@ -19,8 +20,7 @@ def load_ipython_extension(ipython): class EasyPDFPlotting(object): - """Convenience functions for accessing and plotting PDFfit2 data. - """ + """Convenience functions for accessing and plotting PDFfit2 data.""" def __init__(self, pdffit_instance): self._pdffit = pdffit_instance @@ -55,6 +55,7 @@ def showfit(self, offset=None): """ from matplotlib.pyplot import gca from math import floor + cr = self.r cGobs = self.Gobs cGcalc = self.Gcalc @@ -62,29 +63,32 @@ def showfit(self, offset=None): if offset is None: offset = floor(min([min(cGobs), min(cGcalc)]) - max(cGdiff)) ax = gca() - ax.plot(cr, cGobs, 'r.', cr, cGcalc, 'b-', cr, cGdiff + offset, 'g-') + ax.plot(cr, cGobs, "r.", cr, cGcalc, "b-", cr, cGdiff + offset, "g-") xl = ax.xaxis.get_label().get_text() yl = ax.yaxis.get_label().get_text() if xl == "": - ax.set_xlabel('r (A)') + ax.set_xlabel("r (A)") if yl == "": - ax.set_ylabel('G (A**-2)') + ax.set_ylabel("G (A**-2)") return def showRw(self): "Plot cumulative Rw." from matplotlib.pyplot import gca + cRw = self._asarray(self._pdffit.getcrw()) ax = gca() ax.plot(self.r, cRw) - ax.set_title('Cumulative Rw = %.4f' % cRw[-1]) - ax.set_xlabel('r') - ax.set_ylabel('Rw') + ax.set_title("Cumulative Rw = %.4f" % cRw[-1]) + ax.set_xlabel("r") + ax.set_ylabel("Rw") return @staticmethod def _asarray(x, dtype=None): import numpy + return numpy.asarray(x, dtype=dtype) + # End of class EasyPDFPlotting diff --git a/diffpy/pdffit2/output.py b/diffpy/pdffit2/output.py index 71bcfe76..6d1247cf 100644 --- a/diffpy/pdffit2/output.py +++ b/diffpy/pdffit2/output.py @@ -21,6 +21,7 @@ # create module variable stdout from sys import stdout as stdout + # silence pyflakes checker assert stdout @@ -30,9 +31,11 @@ def redirect_stdout(dst): The dst value is stored in module variable stdout. """ from diffpy.pdffit2.pdffit2 import redirect_stdout + redirect_stdout(dst) global stdout stdout = dst return + # End of file diff --git a/diffpy/pdffit2/pdffit.py b/diffpy/pdffit2/pdffit.py index a3bc2d17..e39b6694 100644 --- a/diffpy/pdffit2/pdffit.py +++ b/diffpy/pdffit2/pdffit.py @@ -31,6 +31,7 @@ # helper routines + def _format_value_std(value, stdev): """Convert value to a string with standard deviation in brackets. @@ -39,9 +40,9 @@ def _format_value_std(value, stdev): Return string. """ - if stdev > abs(value)*1e-8: + if stdev > abs(value) * 1e-8: s = "%g (%g)" % (value, stdev) - elif str(stdev) == 'nan': + elif str(stdev) == "nan": s = "%g (NaN)" % value else: s = "%g" % value @@ -63,7 +64,7 @@ def _format_bond_length(dij, ddij, ij1, symij): s0 = "%s (#%i)" % (symij[0], ij1[0]) s1 = "%s (#%i)" % (symij[1], ij1[1]) leader0 = " " + s0.ljust(w_smbidx) + " - " + s1 + " " - leader1 = leader0.ljust(w_equals) + '= ' + leader1 = leader0.ljust(w_equals) + "= " s = leader1 + _format_value_std(dij, ddij) + " A" return s @@ -111,14 +112,14 @@ class PdfFit(object): # constants and enumerators from pdffit.h: # selection of all atoms - selalias = { 'ALL' : -1 } + selalias = {"ALL": -1} # constraint type identifiers - FCON = { 'USER' : 0, 'IDENT' : 1, 'FCOMP' : 2, 'FSQR' : 3 } + FCON = {"USER": 0, "IDENT": 1, "FCOMP": 2, "FSQR": 3} # scattering type identifiers - Sctp = { 'X' : 0, 'N' : 1 } + Sctp = {"X": 0, "N": 1} def _exportAll(self, namespace): - """ _exportAll(self, namespace) --> Export all 'public' class methods + """_exportAll(self, namespace) --> Export all 'public' class methods into namespace. This function allows for a module-level PdfFit object which doesn't have @@ -129,27 +130,29 @@ def _exportAll(self, namespace): # string aliases (var = "var") for a in itertools.chain(self.selalias, self.FCON, self.Sctp): exec("%s = %r" % (a, a), namespace) - public = [ a for a in dir(self) if "__" not in a and a not in - ["_handle", "_exportAll", "selalias", "FCON", "Sctp" ] ] + public = [ + a + for a in dir(self) + if "__" not in a and a not in ["_handle", "_exportAll", "selalias", "FCON", "Sctp"] + ] for funcname in public: namespace[funcname] = getattr(self, funcname) return def intro(): - """Show introductory message. - """ + """Show introductory message.""" import re from diffpy.pdffit2 import __version__, __date__ + date = __date__[:10] - d = {'version' : __version__, 'date' : date, - 'year' : date[:4] or '2019'} + d = {"version": __version__, "date": date, "year": date[:4] or "2019"} msg = __intro_message__ % d - filler = lambda mx : (mx.group(0).rstrip(' *').ljust(77) + '*') - msg_ljust = re.sub('(?m)^(.{1,77}|.{79}.*)$', filler, msg) + filler = lambda mx: (mx.group(0).rstrip(" *").ljust(77) + "*") + msg_ljust = re.sub("(?m)^(.{1,77}|.{79}.*)$", filler, msg) print(msg_ljust, file=output.stdout) return - intro = staticmethod(intro) + intro = staticmethod(intro) def add_structure(self, stru): """add_structure(stru) --> Add new structure to PdfFit instance. @@ -160,11 +163,10 @@ def add_structure(self, stru): Raises pdffit2.structureError when stru contains unknown atom species. """ - s = stru.writeStr('pdffit') + s = stru.writeStr("pdffit") self.read_struct_string(s) return - def read_struct(self, struct): """read_struct(struct) --> Read structure from file into memory. @@ -180,7 +182,6 @@ def read_struct(self, struct): self.stru_files.append(struct) return - def read_struct_string(self, struct, name=""): """read_struct_string(struct, name = "") --> Read structure from a string into memory. @@ -197,7 +198,6 @@ def read_struct_string(self, struct, name=""): self.stru_files.append(name) return - def read_data(self, data, stype, qmax, qdamp): """read_data(data, stype, qmax, qdamp) --> Read pdf data from file into memory. @@ -214,7 +214,6 @@ def read_data(self, data, stype, qmax, qdamp): self.data_files.append(data) return - def read_data_string(self, data, stype, qmax, qdamp, name=""): """read_data_string(data, stype, qmax, qdamp, name = "") --> Read pdf data from a string into memory. @@ -226,15 +225,12 @@ def read_data_string(self, data, stype, qmax, qdamp, name=""): qdamp -- instrumental Q-resolution factor name -- tag with which to label data """ - pdffit2.read_data_string(self._handle, data, six.b(stype), qmax, - qdamp, name) + pdffit2.read_data_string(self._handle, data, six.b(stype), qmax, qdamp, name) name = data self.data_files.append(name) return - - def read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, - dGr_data = None, name = "list"): + def read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, name="list"): """read_data_lists(stype, qmax, qdamp, r_data, Gr_data, dGr_data = None, name = "list") --> Read pdf data into memory from lists. @@ -250,12 +246,10 @@ def read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, Raises: ValueError when the data lists are of different length """ - pdffit2.read_data_arrays(self._handle, six.b(stype), qmax, qdamp, - r_data, Gr_data, dGr_data, name) + pdffit2.read_data_arrays(self._handle, six.b(stype), qmax, qdamp, r_data, Gr_data, dGr_data, name) self.data_files.append(name) return - def pdfrange(self, iset, rmin, rmax): """pdfrange(iset, rmin, rmax) --> Set the range of the fit. @@ -268,15 +262,13 @@ def pdfrange(self, iset, rmin, rmax): pdffit2.pdfrange(self._handle, iset, rmin, rmax) return - def reset(self): """reset() --> Clear all stored fit, structure, and parameter data.""" self.stru_files = [] self.data_files = [] - pdffit2.reset(self._handle); + pdffit2.reset(self._handle) return - def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): """alloc(stype, qmax, qdamp, rmin, rmax, bin) --> Allocate space for a PDF calculation. @@ -295,11 +287,9 @@ def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): ValueError for bad input values pdffit.unassignedError when no structure has been loaded """ - pdffit2.alloc(self._handle, six.b(stype), qmax, qdamp, rmin, - rmax, bin) + pdffit2.alloc(self._handle, six.b(stype), qmax, qdamp, rmin, rmax, bin) return - def calc(self): """calc() --> Calculate the PDF of the imported structure. @@ -315,7 +305,6 @@ def calc(self): pdffit2.calc(self._handle) return - def refine(self, toler=0.00000001): """refine(toler = 0.00000001) --> Fit the theory to the imported data. @@ -335,7 +324,6 @@ def refine(self, toler=0.00000001): step += 1 return - def refine_step(self, toler=0.00000001): """refine_step(toler = 0.00000001) --> Run a single step of the fit. @@ -353,7 +341,6 @@ def refine_step(self, toler=0.00000001): self.finished = pdffit2.refine_step(self._handle, toler) return self.finished - def save_pdf(self, iset, fname): """save_pdf(iset, fname) --> Save calculated or fitted PDF to file. @@ -366,7 +353,6 @@ def save_pdf(self, iset, fname): pdffit2.save_pdf(self._handle, iset, fname) return - def save_pdf_string(self, iset): """save_pdf_string(iset) --> Save calculated or fitted PDF to string. @@ -380,7 +366,6 @@ def save_pdf_string(self, iset): pdffilestring = pdffit2.save_pdf(self._handle, iset, "") return pdffilestring - def save_dif(self, iset, fname): """save_dif(iset, fname) --> Save data and fitted PDF difference to file. @@ -394,7 +379,6 @@ def save_dif(self, iset, fname): pdffit2.save_dif(self._handle, iset, fname) return - def save_dif_string(self, iset): """save_dif_string(iset) --> Save data and fitted PDF difference to string. @@ -409,7 +393,6 @@ def save_dif_string(self, iset): diffilestring = pdffit2.save_dif(self._handle, iset, "") return diffilestring - def save_res(self, fname): """save_res(fname) --> Save fit-specific data to file. @@ -420,7 +403,6 @@ def save_res(self, fname): pdffit2.save_res(self._handle, fname) return - def save_res_string(self): """save_res_string() --> Save fit-specific data to a string. @@ -432,7 +414,6 @@ def save_res_string(self): resfilestring = pdffit2.save_res(self._handle, "") return resfilestring - def get_structure(self, ip): """get_structure(ip) --> Get a copy of specified phase data. @@ -442,12 +423,12 @@ def get_structure(self, ip): Raise pdffit2.unassignedError if phase ip is undefined. """ from diffpy.structure import PDFFitStructure + s = self.save_struct_string(ip) stru = PDFFitStructure() - stru.readStr(s, 'pdffit') + stru.readStr(s, "pdffit") return stru - def save_struct(self, ip, fname): """save_struct(ip, fname) --> Save structure resulting from fit to file. @@ -461,7 +442,6 @@ def save_struct(self, ip, fname): pdffit2.save_struct(self._handle, ip, fname) return - def save_struct_string(self, ip): """save_struct(ip) --> Save structure resulting from fit to string. @@ -475,7 +455,6 @@ def save_struct_string(self, ip): structfilestring = pdffit2.save_struct(self._handle, ip, "") return structfilestring - def show_struct(self, ip): """show_struct(ip) --> Print structure resulting from fit. @@ -486,7 +465,6 @@ def show_struct(self, ip): pdffit2.show_struct(self._handle, ip) return - def constrain(self, var, par, fcon=None): """constrain(var, par[, fcon]) --> Constrain a variable to a parameter. @@ -520,7 +498,6 @@ def constrain(self, var, par, fcon=None): pdffit2.constrain_int(self._handle, var_ref, varnc, par) return - def setpar(self, par, val): """setpar(par, val) --> Set value of constrained parameter. @@ -540,7 +517,6 @@ def setpar(self, par, val): pdffit2.setpar_RV(self._handle, par, var_ref) return - def setvar(self, var, val): """setvar(var, val) --> Set the value of a variable. @@ -552,7 +528,6 @@ def setvar(self, var, val): pdffit2.setvar(self._handle, var_ref, val) return - def getvar(self, var): """getvar(var) --> Get stored value of a variable. @@ -564,7 +539,6 @@ def getvar(self, var): retval = pdffit2.getvar(self._handle, var_ref) return retval - def getrw(self): """getrw() --> Get normalized total error of the fit rw. @@ -575,7 +549,6 @@ def getrw(self): rw = pdffit2.getrw(self._handle) return rw - def getcrw(self): """getcrw() --> Get cumulative Rw for the current dataset. @@ -591,7 +564,6 @@ def getcrw(self): crw = pdffit2.getcrw(self._handle) return crw - def getR(self): """getR() --> Get r-points used in the fit. @@ -606,7 +578,6 @@ def getR(self): R = pdffit2.getR(self._handle) return R - def getpdf_fit(self): """getpdf_fit() --> Get fitted PDF. @@ -620,7 +591,6 @@ def getpdf_fit(self): pdfdata = pdffit2.getpdf_fit(self._handle) return pdfdata - def getpdf_obs(self): """getpdf_obs() --> Get observed PDF. @@ -635,7 +605,6 @@ def getpdf_obs(self): pdfdata = pdffit2.getpdf_obs(self._handle) return pdfdata - def getpdf_diff(self): """Obtain difference between observed and fitted PDF. @@ -650,7 +619,6 @@ def getpdf_diff(self): Gdiff = pdffit2.getpdf_diff(self._handle) return Gdiff - def get_atoms(self, ip=None): """get_atoms() --> Get element symbols of all atoms in the structure. @@ -663,11 +631,12 @@ def get_atoms(self, ip=None): Returns: List of atom names in structure. """ - if ip is None: rv = pdffit2.get_atoms(self._handle) - else: rv = pdffit2.get_atoms(self._handle, ip) + if ip is None: + rv = pdffit2.get_atoms(self._handle) + else: + rv = pdffit2.get_atoms(self._handle, ip) return rv - def get_atom_types(self, ip=None): """get_atom_types() --> Ordered unique element symbols in the structure. @@ -681,11 +650,12 @@ def get_atom_types(self, ip=None): Returns: List of unique atom symbols as they occur in structure. """ - if ip is None: rv = pdffit2.get_atom_types(self._handle) - else: rv = pdffit2.get_atom_types(self._handle, ip) + if ip is None: + rv = pdffit2.get_atom_types(self._handle) + else: + rv = pdffit2.get_atom_types(self._handle, ip) return rv - def getpar(self, par): """getpar(par) --> Get value of parameter. @@ -693,7 +663,6 @@ def getpar(self, par): """ return pdffit2.getpar(self._handle, par) - def fixpar(self, par): """fixpar(par) --> Fix a parameter. @@ -707,7 +676,6 @@ def fixpar(self, par): pdffit2.fixpar(self._handle, par) return - def freepar(self, par): """freepar(par) --> Free a parameter. @@ -721,7 +689,6 @@ def freepar(self, par): pdffit2.freepar(self._handle, par) return - def setphase(self, ip): """setphase(ip) --> Switch to phase ip. @@ -735,7 +702,6 @@ def setphase(self, ip): pdffit2.setphase(self._handle, ip) return - def setdata(self, iset): """setdata(iset) --> Set the data set in focus. @@ -746,7 +712,6 @@ def setdata(self, iset): pdffit2.setdata(self._handle, iset) return - def psel(self, ip): """psel(ip) --> Include phase ip in calculation of total PDF @@ -759,7 +724,6 @@ def psel(self, ip): pdffit2.psel(self._handle, ip) return - def pdesel(self, ip): """pdesel(ip) --> Exclude phase ip from calculation of total PDF. @@ -772,7 +736,6 @@ def pdesel(self, ip): pdffit2.pdesel(self._handle, ip) return - def selectAtomType(self, ip, ijchar, symbol, flag): """Configure partial PDF - mark the specified atom type in phase ip as included or excluded as a first or second in pair for distance @@ -790,7 +753,6 @@ def selectAtomType(self, ip, ijchar, symbol, flag): pdffit2.selectAtomType(self._handle, ip, six.b(ijchar), symbol, flag) return - def selectAtomIndex(self, ip, ijchar, aidx, flag): """Configure partial PDF - mark the atom of given index in phase ip as included or excluded as a first or second in pair for distance @@ -808,7 +770,6 @@ def selectAtomIndex(self, ip, ijchar, aidx, flag): pdffit2.selectAtomIndex(self._handle, ip, six.b(ijchar), aidx, flag) return - def selectAll(self, ip, ijchar): """Configure partial PDF - include all atoms of phase ip as first or second element in pair for distance evaluation. @@ -823,7 +784,6 @@ def selectAll(self, ip, ijchar): pdffit2.selectAll(self._handle, ip, six.b(ijchar)) return - def selectNone(self, ip, ijchar): """Configure partial PDF - exclude all atoms of phase ip from first or second element of pair distance evaluation. @@ -838,7 +798,6 @@ def selectNone(self, ip, ijchar): pdffit2.selectNone(self._handle, ip, six.b(ijchar)) return - def bang(self, i, j, k): """bang(i, j, k) --> Show bond angle defined by atoms i, j, k. @@ -850,14 +809,18 @@ def bang(self, i, j, k): angle, stdev = pdffit2.bond_angle(self._handle, i, j, k) # indices should be already checked here by bond_angle atom_symbols = self.get_atoms() - leader = " %s (#%i) - %s (#%i) - %s (#%i) = " % \ - (atom_symbols[i-1], i, atom_symbols[j-1], j, - atom_symbols[k-1], k) + leader = " %s (#%i) - %s (#%i) - %s (#%i) = " % ( + atom_symbols[i - 1], + i, + atom_symbols[j - 1], + j, + atom_symbols[k - 1], + k, + ) s = leader + _format_value_std(angle, stdev) + " degrees" print(s, file=output.stdout) return - def bond_angle(self, i, j, k): """bond_angle(i, j, k) --> bond angle defined by atoms i, j, k. Angle is calculated using the shortest ji and jk lengths with @@ -873,7 +836,6 @@ def bond_angle(self, i, j, k): rv = pdffit2.bond_angle(self._handle, i, j, k) return rv - def blen(self, *args): """blen(i, j) --> Show bond length defined by atoms i and j. @@ -897,42 +859,42 @@ def blen(self, *args): pdffit.unassignedError when no structure has been loaded """ # first form - if len(args)==2: + if len(args) == 2: dij, ddij = self.bond_length_atoms(*args[0:2]) atom_symbols = self.get_atoms() ij = (args[0], args[1]) # indices were already checked in bond_length_atoms call assert (0 <= min(ij) - 1) and (max(ij) - 1 < len(atom_symbols)) - symij = ( atom_symbols[ij[0] - 1].upper(), - atom_symbols[ij[1] - 1].upper() ) + symij = (atom_symbols[ij[0] - 1].upper(), atom_symbols[ij[1] - 1].upper()) print(_format_bond_length(dij, ddij, ij, symij), file=output.stdout) # second form - elif len(args)==4: + elif len(args) == 4: a1, a2, lb, ub = args try: atom_types = self.get_atom_types() - if isinstance(a1, numbers.Integral): a1 = atom_types[a1 - 1] - if isinstance(a2, numbers.Integral): a2 = atom_types[a2 - 1] + if isinstance(a1, numbers.Integral): + a1 = atom_types[a1 - 1] + if isinstance(a2, numbers.Integral): + a2 = atom_types[a2 - 1] except IndexError: # index of non-existant atom type return # arguments are OK here, get bond length dictionary bld = pdffit2.bond_length_types(self._handle, a1, a2, lb, ub) - s = "(%s,%s) bond lengths in [%gA,%gA] for current phase :" % \ - (a1, a2, lb, ub) + s = "(%s,%s) bond lengths in [%gA,%gA] for current phase :" % (a1, a2, lb, ub) print(s, file=output.stdout) atom_symbols = self.get_atoms() - npts = len(bld['dij']) + npts = len(bld["dij"]) for idx in range(npts): - dij = bld['dij'][idx] - ddij = bld['ddij'][idx] - ij0 = bld['ij0'][idx] - ij1 = bld['ij1'][idx] + dij = bld["dij"][idx] + ddij = bld["ddij"][idx] + ij0 = bld["ij0"][idx] + ij1 = bld["ij1"][idx] symij = (atom_symbols[ij0[0]], atom_symbols[ij0[1]]) s = _format_bond_length(dij, ddij, ij1, symij) print(s, file=output.stdout) print(file=output.stdout) - if not bld['dij']: + if not bld["dij"]: print(" *** No pairs found ***", file=output.stdout) else: emsg = "blen() takes 2 or 4 arguments (%i given)" % len(args) @@ -940,7 +902,6 @@ def blen(self, *args): # done return - def bond_length_atoms(self, i, j): """bond_length_atoms(i, j) --> shortest distance between atoms i, j. Periodic boundary conditions are applied to find the shortest bond. @@ -956,7 +917,6 @@ def bond_length_atoms(self, i, j): rv = pdffit2.bond_length_atoms(self._handle, i, j) return rv - def bond_length_types(self, a1, a2, lb, ub): """bond_length_types(a1, a2, lb, ub) --> get all a1-a2 distances. @@ -978,7 +938,6 @@ def bond_length_types(self, a1, a2, lb, ub): rv = pdffit2.bond_length_types(self._handle, a1, a2, lb, ub) return rv - def show_scat(self, stype): """show_scat(stype) --> Print scattering length for all atoms in the current phase. @@ -990,7 +949,6 @@ def show_scat(self, stype): print(self.get_scat_string(stype), file=output.stdout) return - def get_scat_string(self, stype): """get_scat_string(stype) --> Get string with scattering factors of all atoms in the current phase. @@ -1004,7 +962,6 @@ def get_scat_string(self, stype): """ return pdffit2.get_scat_string(self._handle, six.b(stype)) - def get_scat(self, stype, element): """get_scat(stype, element) --> Get active scattering factor for given element. If scattering factor has been changed using @@ -1022,7 +979,6 @@ def get_scat(self, stype, element): rv = pdffit2.get_scat(self._handle, six.b(stype), element) return rv - def set_scat(self, stype, element, value): """set_scat(stype, element, value) --> Set custom scattering factor for given element. The new scattering factor applies only for the @@ -1043,7 +999,6 @@ def set_scat(self, stype, element, value): pdffit2.set_scat(self._handle, six.b(stype), element, value) return - def reset_scat(self, element): """reset_scat(stype, element) --> Reset scattering factors for given element to their standard values. The reset_scat applies @@ -1057,7 +1012,6 @@ def reset_scat(self, element): pdffit2.reset_scat(self._handle, element) return - def num_atoms(self): """num_atoms() --> Get number of atoms in current phase. @@ -1065,7 +1019,6 @@ def num_atoms(self): """ return pdffit2.num_atoms(self._handle) - def num_phases(self): """num_phases() --> Number of phases loaded in PdfFit instance. @@ -1076,7 +1029,6 @@ def num_phases(self): n = pdffit2.num_phases(self._handle) return n - def num_datasets(self): """num_datasets() --> Number of datasets loaded in PdfFit instance. @@ -1087,7 +1039,6 @@ def num_datasets(self): n = pdffit2.num_datasets(self._handle) return n - def phase_fractions(self): """phase_fractions() --> relative phase fractions for current dataset. Convert phase scale factors to relative phase fractions given the @@ -1119,30 +1070,30 @@ def lat(n): 5 <==> 'beta' 6 <==> 'gamma' """ - LatParams = { 'a':1, 'b':2, 'c':3, 'alpha':4, 'beta':5, 'gamma':6 } + LatParams = {"a": 1, "b": 2, "c": 3, "alpha": 4, "beta": 5, "gamma": 6} if isinstance(n, six.string_types): n = LatParams[n] return "lat(%i)" % n - lat = staticmethod(lat) + lat = staticmethod(lat) def x(i): """x(i) --> Get reference to x-value of atom i.""" return "x(%i)" % i - x = staticmethod(x) + x = staticmethod(x) def y(i): """y(i) --> Get reference to y-value of atom i.""" return "y(%i)" % i - y = staticmethod(y) + y = staticmethod(y) def z(i): """z(i) --> Get reference to z-value of atom i.""" return "z(%i)" % i - z = staticmethod(z) + z = staticmethod(z) def u11(i): """u11(i) --> Get reference to U(1,1) for atom i. @@ -1150,8 +1101,8 @@ def u11(i): U is the anisotropic thermal factor tensor. """ return "u11(%i)" % i - u11 = staticmethod(u11) + u11 = staticmethod(u11) def u22(i): """u22(i) --> Get reference to U(2,2) for atom i. @@ -1159,8 +1110,8 @@ def u22(i): U is the anisotropic thermal factor tensor. """ return "u22(%i)" % i - u22 = staticmethod(u22) + u22 = staticmethod(u22) def u33(i): """u33(i) --> Get reference to U(3,3) for atom i. @@ -1168,8 +1119,8 @@ def u33(i): U is the anisotropic thermal factor tensor. """ return "u33(%i)" % i - u33 = staticmethod(u33) + u33 = staticmethod(u33) def u12(i): """u12(i) --> Get reference to U(1,2) for atom i. @@ -1177,8 +1128,8 @@ def u12(i): U is the anisotropic thermal factor tensor. """ return "u12(%i)" % i - u12 = staticmethod(u12) + u12 = staticmethod(u12) def u13(i): """u13(i) --> Get reference to U(1,3) for atom i. @@ -1186,8 +1137,8 @@ def u13(i): U is the anisotropic thermal factor tensor. """ return "u13(%i)" % i - u13 = staticmethod(u13) + u13 = staticmethod(u13) def u23(i): """u23(i) --> Get reference to U(2,3) for atom i. @@ -1195,14 +1146,14 @@ def u23(i): U is the anisotropic thermal factor tensor. """ return "u23(%i)" % i - u23 = staticmethod(u23) + u23 = staticmethod(u23) def occ(i): """occ(i) --> Get reference to occupancy of atom i.""" return "occ(%i)" % i - occ = staticmethod(occ) + occ = staticmethod(occ) def pscale(): """pscale() --> Get reference to pscale. @@ -1211,8 +1162,8 @@ def pscale(): represents. """ return "pscale" - pscale = staticmethod(pscale) + pscale = staticmethod(pscale) def sratio(): """sratio() --> Get reference to sigma ratio. @@ -1221,15 +1172,14 @@ def sratio(): distances below rcut. """ return "sratio" - sratio = staticmethod(sratio) + sratio = staticmethod(sratio) def delta1(): - """delta1() --> Get reference to 1/R peak sharpening factor. - """ + """delta1() --> Get reference to 1/R peak sharpening factor.""" return "delta1" - delta1 = staticmethod(delta1) + delta1 = staticmethod(delta1) def delta2(): """delta2() --> Reference to (1/R^2) sharpening factor. @@ -1237,8 +1187,8 @@ def delta2(): The (1/R^2) peak sharpening factor. """ return "delta2" - delta2 = staticmethod(delta2) + delta2 = staticmethod(delta2) def dscale(): """dscale() --> Get reference to dscale. @@ -1246,8 +1196,8 @@ def dscale(): The data scale factor. """ return "dscale" - dscale = staticmethod(dscale) + dscale = staticmethod(dscale) def qdamp(): """qdamp() --> Get reference to qdamp. @@ -1255,8 +1205,8 @@ def qdamp(): Qdamp controls PDF damping due to instrument Q-resolution. """ return "qdamp" - qdamp = staticmethod(qdamp) + qdamp = staticmethod(qdamp) def qbroad(): """qbroad() --> Get reference to qbroad. @@ -1264,8 +1214,8 @@ def qbroad(): Quadratic peak broadening factor. """ return "qbroad" - qbroad = staticmethod(qbroad) + qbroad = staticmethod(qbroad) def spdiameter(): """spdiameter() --> Get reference to spdiameter (phase property). @@ -1274,8 +1224,8 @@ def spdiameter(): Spherical envelope is not applied when spdiameter equals 0. """ return "spdiameter" - spdiameter = staticmethod(spdiameter) + spdiameter = staticmethod(spdiameter) def stepcut(): """stepcut() --> Get reference to stepcut (phase property). @@ -1287,8 +1237,8 @@ def stepcut(): Step cutoff is not applied when stepcut equals 0. """ return "stepcut" - stepcut = staticmethod(stepcut) + stepcut = staticmethod(stepcut) def rcut(): """rcut() --> Get reference to rcut. @@ -1297,8 +1247,8 @@ def rcut(): the sigma ratio (sratio), applies. rcut cannot be refined. """ return "rcut" - rcut = staticmethod(rcut) + rcut = staticmethod(rcut) # End refinable variables. @@ -1311,7 +1261,6 @@ def __init__(self): self.intro() return - def __getRef(self, var_string): """Return the actual reference to the variable in the var_string. @@ -1328,7 +1277,7 @@ def __getRef(self, var_string): method_string, arg_string = var_string.split("(") method_string = method_string.strip() arg_int = int(arg_string.strip(")").strip()) - except ValueError: #There is no arg_string + except ValueError: # There is no arg_string method_string = var_string.strip() f = getattr(pdffit2, method_string) diff --git a/diffpy/pdffit2/tests/ExceptionsTest.py b/diffpy/pdffit2/tests/ExceptionsTest.py index a1b800a0..a88decbe 100644 --- a/diffpy/pdffit2/tests/ExceptionsTest.py +++ b/diffpy/pdffit2/tests/ExceptionsTest.py @@ -22,7 +22,6 @@ class read_structExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -35,17 +34,15 @@ def test_IOError(self): def test_structureError(self): """raise pdffit2.structureError when structure is malformed""" - self.assertRaises(pdffit2.structureError, self.P.read_struct, - datafile("badNi.stru")) + self.assertRaises(pdffit2.structureError, self.P.read_struct, datafile("badNi.stru")) def test_structureErrorZeroVolume(self): """raise pdffit2.structureError when unit cell volume is negative""" - #I don't know how to test for this, but it's in the library code - self.assertRaises(pdffit2.structureError, - self.P.read_struct, datafile("badNiZeroVolume.stru")) + # I don't know how to test for this, but it's in the library code + self.assertRaises(pdffit2.structureError, self.P.read_struct, datafile("badNiZeroVolume.stru")) -class read_dataExceptions(unittest.TestCase): +class read_dataExceptions(unittest.TestCase): def setUp(self): self.P = PdfFit() @@ -54,16 +51,14 @@ def tearDown(self): def test_IOError(self): """raise IOError when data file does not exist""" - self.assertRaises(IOError, self.P.read_data, "Nofile.dat", - 'X', 25.0, 0.5) + self.assertRaises(IOError, self.P.read_data, "Nofile.dat", "X", 25.0, 0.5) def test_dataError(self): """raise pdffit2.dataError when data has improper spacing""" - self.assertRaises(pdffit2.dataError, self.P.read_data, - datafile("badNi.dat"), 'X', 25.0, 0.5) + self.assertRaises(pdffit2.dataError, self.P.read_data, datafile("badNi.dat"), "X", 25.0, 0.5) -class read_data_listsExceptions(unittest.TestCase): +class read_data_listsExceptions(unittest.TestCase): def setUp(self): self.P = PdfFit() self.r_data = [0.1, 0.2] @@ -76,28 +71,31 @@ def tearDown(self): def test_ValueError1(self): """raise ValueError when lists are of different length""" - self.assertRaises(ValueError, self.P.read_data_lists, 'X', self.qmax, - self.qdamp, self.r_data, self.Gr_data) + self.assertRaises( + ValueError, self.P.read_data_lists, "X", self.qmax, self.qdamp, self.r_data, self.Gr_data + ) def test_ValueError2(self): """raise ValueError when qmax < 0""" - self.assertRaises(ValueError, self.P.read_data_lists, 'X', -self.qmax, - self.qdamp, self.r_data, self.Gr_data) + self.assertRaises( + ValueError, self.P.read_data_lists, "X", -self.qmax, self.qdamp, self.r_data, self.Gr_data + ) def test_ValueError3(self): """raise ValueError when qdamp < 0""" - self.assertRaises(ValueError, self.P.read_data_lists, 'X', self.qmax, - -self.qdamp, self.r_data, self.Gr_data) + self.assertRaises( + ValueError, self.P.read_data_lists, "X", self.qmax, -self.qdamp, self.r_data, self.Gr_data + ) def test_dataError(self): """raise pdffit2.dataError when data has improper spacing""" r_data = [0.1, 0.52, 0.2] - self.assertRaises(pdffit2.dataError, self.P.read_data_lists, 'X', self.qmax, - self.qdamp, r_data, self.Gr_data) + self.assertRaises( + pdffit2.dataError, self.P.read_data_lists, "X", self.qmax, self.qdamp, r_data, self.Gr_data + ) class pdfrangeExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.iset = 1 @@ -109,24 +107,20 @@ def tearDown(self): def test_ValueError1(self): """raise ValueError when iset does not exist""" - self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmin, - self.rmax) + self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmin, self.rmax) def test_ValueError2(self): """raise ValueError when rmax < rmin""" - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.5) - self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmax, - self.rmin) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmax, self.rmin) def test_ValueError3(self): """raise ValueError when range outside of data""" - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.5) - self.assertRaises(ValueError, self.P.pdfrange, self.iset, -self.rmin, - self.rmax) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.assertRaises(ValueError, self.P.pdfrange, self.iset, -self.rmin, self.rmax) class allocExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.qmax = 25 @@ -141,48 +135,40 @@ def tearDown(self): def test_ValueError1(self): """raise ValueError when qmax < 0""" self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, 'X', -self.qmax, self.qdamp, - self.rmin, self.rmax, self.bin) + self.assertRaises(ValueError, self.P.alloc, "X", -self.qmax, self.qdamp, self.rmin, self.rmax, self.bin) def test_ValueError2(self): """raise ValueError when qdamp < 0""" self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, 'X', self.qmax, -self.qdamp, - self.rmin, self.rmax, self.bin) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, -self.qdamp, self.rmin, self.rmax, self.bin) def test_ValueError3(self): """raise ValueError when rmin < 0""" self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, 'X', self.qmax, self.qdamp, - -self.rmin, self.rmax, self.bin) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, -self.rmin, self.rmax, self.bin) def test_ValueError4(self): """raise ValueError when rmax < 0""" self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, 'X', self.qmax, self.qdamp, - self.rmin, -self.rmax, self.bin) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, -self.rmax, self.bin) def test_ValueError5(self): """raise ValueError when bin < 0""" self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, 'X', self.qmax, self.qdamp, - self.rmin, self.rmax, -self.bin) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) def test_ValueError6(self): """raise ValueError when rmax < rmin""" self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, 'X', self.qmax, self.qdamp, - self.rmax, self.rmin, self.bin) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmax, self.rmin, self.bin) def test_ValueError7(self): """raise ValueError when qdamp < 0""" self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, 'X', self.qmax, self.qdamp, - self.rmin, self.rmax, -self.bin) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) class calcExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.P.read_struct(datafile("Ni.stru")) @@ -194,6 +180,7 @@ def test_unassignedError(self): """raise pdffit2.unassignedError when no space has been allocated""" self.assertRaises(pdffit2.unassignedError, self.P.calc) + # PJ 2006-03-06 # # test_calculationError raised exception, because for Qmax=0.5, rmax would @@ -207,8 +194,8 @@ def test_unassignedError(self): # self.assertRaises(pdffit2.calculationError, self.P.calc) -#class refineExceptions(unittest.TestCase): - #I'm not sure how to test these +# class refineExceptions(unittest.TestCase): +# I'm not sure how to test these # def setUp(self): # self.P = PdfFit() @@ -222,8 +209,8 @@ def test_unassignedError(self): # #self.assertRaises(pdffit2.constraintError, self.P.calc) -#class refine_stepExceptions(unittest.TestCase): - #I'm not sure how to test these +# class refine_stepExceptions(unittest.TestCase): +# I'm not sure how to test these # def setUp(self): # self.P = PdfFit() @@ -238,7 +225,6 @@ def test_unassignedError(self): class save_pdfExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.strufile = "temp.pdf" @@ -249,19 +235,16 @@ def tearDown(self): def test_IOError(self): """raise IOError when structure cannot be saved""" self.P.read_struct(datafile("Ni.stru")) - self.P.alloc('X', 30.0, 0.05, 2, 10, 100) + self.P.alloc("X", 30.0, 0.05, 2, 10, 100) self.P.calc() - self.assertRaises(IOError, self.P.save_pdf, 1, - "nodir183160/"+self.strufile) + self.assertRaises(IOError, self.P.save_pdf, 1, "nodir183160/" + self.strufile) def test_unassignedError(self): """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_pdf, 1, - self.strufile) + self.assertRaises(pdffit2.unassignedError, self.P.save_pdf, 1, self.strufile) class save_difExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.strufile = "temp.dif" @@ -272,20 +255,17 @@ def tearDown(self): def test_IOError(self): """raise IOError when dif cannot be saved""" self.P.read_struct(datafile("Ni.stru")) - self.P.alloc('X', 30.0, 0.05, 2, 10, 100) + self.P.alloc("X", 30.0, 0.05, 2, 10, 100) self.P.calc() - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.5) - self.assertRaises(IOError, self.P.save_dif, 1, - "nodir183160/"+self.strufile) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.assertRaises(IOError, self.P.save_dif, 1, "nodir183160/" + self.strufile) def test_unassignedError(self): """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_dif, 1, - self.strufile) + self.assertRaises(pdffit2.unassignedError, self.P.save_dif, 1, self.strufile) class save_resExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.resfile = "temp.res" @@ -296,22 +276,20 @@ def tearDown(self): def test_IOError(self): """raise IOError when residual file cannot be saved""" self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), 'X', 30.0, 0.0) + self.P.read_data(datafile("Ni.dat"), "X", 30.0, 0.0) self.P.constrain(self.P.lat(1), 1) self.P.setpar(1, 3.0) - self.P.pdfrange(1,2.0,10.0) + self.P.pdfrange(1, 2.0, 10.0) self.P.refine_step() - self.assertRaises(IOError, self.P.save_res, - "nodir183160/"+self.resfile) + self.assertRaises(IOError, self.P.save_res, "nodir183160/" + self.resfile) def test_unassignedError(self): """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_res, - self.resfile) + self.assertRaises(pdffit2.unassignedError, self.P.save_res, self.resfile) class save_structExceptions(unittest.TestCase): - #Same code as show_struct + # Same code as show_struct def setUp(self): self.P = PdfFit() @@ -323,17 +301,14 @@ def tearDown(self): def test_IOError(self): """raise IOError when structure cannot be saved""" self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(IOError, self.P.save_struct, 1, - "nodir183160/"+self.strufile) + self.assertRaises(IOError, self.P.save_struct, 1, "nodir183160/" + self.strufile) def test_unassignedError(self): """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_struct, 1, - self.strufile) + self.assertRaises(pdffit2.unassignedError, self.P.save_struct, 1, self.strufile) class constrainExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.par = 1 @@ -346,8 +321,8 @@ def tearDown(self): def test_constraintError(self): """raise constraintError when constraint is bad""" self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) - self.P.constrain('x(1)', 'junk+@1') + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.constrain("x(1)", "junk+@1") self.P.setpar(1, 0.01) self.assertRaises(pdffit2.constraintError, self.P.calc) self.assertRaises(pdffit2.constraintError, self.P.refine) @@ -355,33 +330,26 @@ def test_constraintError(self): def test_unassignedError(self): """raise pdffit2.unassignedError when variable is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.constrain, self.P.x(1), - self.par) + self.assertRaises(pdffit2.unassignedError, self.P.constrain, self.P.x(1), self.par) return def test_ValueError(self): """raise ValueError when a variable index does not exist""" self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.constrain, self.P.x(6), - self.par) + self.assertRaises(ValueError, self.P.constrain, self.P.x(6), self.par) return def test_constrainNonRefVar(self): "raise constraintError when attempting to constrain non-refinables" self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) - self.assertRaises(pdffit2.constraintError, - self.P.constrain, 'rcut', '@7') - self.assertRaises(pdffit2.constraintError, - self.P.constrain, 'rcut', 13) - self.assertRaises(pdffit2.constraintError, - self.P.constrain, 'stepcut', '@17') + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", "@7") + self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", 13) + self.assertRaises(pdffit2.constraintError, self.P.constrain, "stepcut", "@17") return - class setvarExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.val = 3.0 @@ -391,18 +359,15 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when variable is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.setvar, self.P.lat(1), - self.val) + self.assertRaises(pdffit2.unassignedError, self.P.setvar, self.P.lat(1), self.val) def test_ValueError(self): """raise ValueError when a variable index does not exist""" self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.setvar, self.P.lat(7), - self.val) + self.assertRaises(ValueError, self.P.setvar, self.P.lat(7), self.val) class getvarExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -411,8 +376,7 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when variable is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.getvar, - self.P.pscale()) + self.assertRaises(pdffit2.unassignedError, self.P.getvar, self.P.pscale()) def test_ValueError(self): """raise ValueError when a variable index does not exist""" @@ -421,7 +385,6 @@ def test_ValueError(self): class getRExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -434,7 +397,6 @@ def test_unassignedError(self): class getpdf_fitExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -447,7 +409,6 @@ def test_unassignedError(self): class getpdf_obsExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -460,7 +421,6 @@ def test_unassignedError(self): class getpdf_diffExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -473,7 +433,6 @@ def test_unassignedError(self): class get_atomsExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -486,7 +445,6 @@ def test_unassignedError(self): class getparExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -505,7 +463,6 @@ def test_unassignedError2(self): class pselExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.ip = 1 @@ -523,7 +480,6 @@ def test_unassignedError2(self): class pdeselExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.ip = 1 @@ -542,7 +498,6 @@ def test_unassignedError2(self): class selectAtomTypeExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.iset = 1 @@ -553,32 +508,28 @@ def tearDown(self): def test_unassignedError1(self): """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, - self.iset, 'i', 'Ni', True) + self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, self.iset, "i", "Ni", True) def test_unassignedError2(self): """raise pdffit2.unassignedError when set does not exist""" self.P.read_struct(datafile("Ni.stru")) # selectAtomType should pass with one phase defined - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) - self.P.selectAtomType(self.iset, 'i', 'Ni', True) - self.P.selectAtomType(self.iset, 'j', 'Ni', False) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.selectAtomType(self.iset, "i", "Ni", True) + self.P.selectAtomType(self.iset, "j", "Ni", False) # but fail for phase 2 which is not present - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, - 2, 'i', 'Ca', True) + self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, 2, "i", "Ca", True) def test_ijcharValueError(self): """raise ValueError when ijchar is neither 'i' nor 'j'""" self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) - self.P.selectAtomType(self.iset, 'i', 'Ni', True) - self.P.selectAtomType(self.iset, 'j', 'Ni', True) - self.assertRaises(ValueError, self.P.selectAtomType, - self.iset, 'k', 'Ni', True) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.selectAtomType(self.iset, "i", "Ni", True) + self.P.selectAtomType(self.iset, "j", "Ni", True) + self.assertRaises(ValueError, self.P.selectAtomType, self.iset, "k", "Ni", True) class selectAtomIndexExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.iset = 1 @@ -589,30 +540,26 @@ def tearDown(self): def test_unassignedError1(self): """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, - self.iset, 'i', self.i, True) + self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, self.iset, "i", self.i, True) def test_unassignedError2(self): """raise pdffit2.unassignedError when set does not exist""" self.P.read_struct(datafile("Ni.stru")) # pass for phase 1 - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) - self.P.selectAtomIndex(self.iset, 'i', 1, True) - self.P.selectAtomIndex(self.iset, 'i', 2, False) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.selectAtomIndex(self.iset, "i", 1, True) + self.P.selectAtomIndex(self.iset, "i", 2, False) # fail for phase 2 - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, - 2, 'i', 1, True) + self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, 2, "i", 1, True) def test_ValueError(self): """raise ValueError when selected atom does not exist""" self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) - self.assertRaises(ValueError, self.P.selectAtomIndex, - self.iset, 'i', 6, True) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.assertRaises(ValueError, self.P.selectAtomIndex, self.iset, "i", 6, True) class selectAllExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.iset = 1 @@ -623,26 +570,23 @@ def tearDown(self): def test_unassignedError1(self): """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, - self.iset, 'i') + self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") def test_unassignedError2(self): """raise pdffit2.unassignedError when set does not exist""" self.P.read_struct(datafile("Ni.stru")) # fail when there is no dataset - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, - self.iset, 'i') + self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") # pass with dataset - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) - self.P.selectAll(self.iset, 'i') - self.P.selectAll(self.iset, 'j') + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.selectAll(self.iset, "i") + self.P.selectAll(self.iset, "j") # fail for phase 2 - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, 2, 'i') - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, 2, 'j') + self.assertRaises(pdffit2.unassignedError, self.P.selectAll, 2, "i") + self.assertRaises(pdffit2.unassignedError, self.P.selectAll, 2, "j") class selectNoneExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.iset = 1 @@ -653,26 +597,23 @@ def tearDown(self): def test_unassignedError1(self): """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, - self.iset, 'i') + self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") def test_unassignedError2(self): """raise pdffit2.unassignedError when set does not exist""" self.P.read_struct(datafile("Ni.stru")) # fail when there is no dataset - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, - self.iset, 'i') + self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") # pass with dataset - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) - self.P.selectNone(self.iset, 'i') - self.P.selectNone(self.iset, 'j') + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.selectNone(self.iset, "i") + self.P.selectNone(self.iset, "j") # fail for phase 2 - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, 2, 'i') - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, 2, 'j') + self.assertRaises(pdffit2.unassignedError, self.P.selectNone, 2, "i") + self.assertRaises(pdffit2.unassignedError, self.P.selectNone, 2, "j") class bangExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.a1 = 1 @@ -684,31 +625,26 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.bang, self.a1, - self.a2, self.a3) + self.assertRaises(pdffit2.unassignedError, self.P.bang, self.a1, self.a2, self.a3) def test_ValueError1(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile('Ni.stru')) - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) - self.assertRaises(ValueError, self.P.bang, 0, - self.a2, self.a3) + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.assertRaises(ValueError, self.P.bang, 0, self.a2, self.a3) def test_ValueError2(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile('Ni.stru')) - self.assertRaises(ValueError, self.P.bang, self.a1, - -1, self.a3) + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.bang, self.a1, -1, self.a3) def test_ValueError3(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile('Ni.stru')) - self.assertRaises(ValueError, self.P.bang, self.a1, - self.a2, 6) + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.bang, self.a1, self.a2, 6) class blenExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() self.a1 = 1 @@ -719,27 +655,25 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when no data exists""" - self.assertRaises(pdffit2.unassignedError, self.P.blen, self.a1, - self.a2) + self.assertRaises(pdffit2.unassignedError, self.P.blen, self.a1, self.a2) def test_ValueError1(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile('Ni.stru')) + self.P.read_struct(datafile("Ni.stru")) self.assertRaises(ValueError, self.P.blen, 0, self.a2) def test_ValueError2(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile('Ni.stru')) + self.P.read_struct(datafile("Ni.stru")) self.assertRaises(ValueError, self.P.blen, self.a1, 6) def test_ValueError3(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile('Ni.stru')) + self.P.read_struct(datafile("Ni.stru")) self.assertRaises(ValueError, self.P.blen, 0, 6) class show_scatExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -748,11 +682,11 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.show_scat, 'X') + self.assertRaises(pdffit2.unassignedError, self.P.show_scat, "X") -#class set_scatExceptions(unittest.TestCase): - #I'm not sure how to use this function +# class set_scatExceptions(unittest.TestCase): +# I'm not sure how to use this function # def setUp(self): # self.P = PdfFit() @@ -771,7 +705,6 @@ def test_unassignedError(self): class num_atomsExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -782,8 +715,8 @@ def test_unassignedError(self): """raise pdffit2.unassignedError when no atoms exist""" self.assertRaises(pdffit2.unassignedError, self.P.num_atoms) -class fixparExceptions(unittest.TestCase): +class fixparExceptions(unittest.TestCase): def setUp(self): self.P = PdfFit() @@ -793,12 +726,11 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when parameter does not exist""" self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.fixpar, 1) class freeparExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -808,12 +740,11 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when parameter does not exist""" self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.freepar, 1) class setphaseExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -823,12 +754,11 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when phase does not exist""" self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.setphase, 2) class setdataExceptions(unittest.TestCase): - def setUp(self): self.P = PdfFit() @@ -838,11 +768,11 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when data set does not exist""" self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), 'X', 25.0, 0.0) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.setdata, 2) -class getcrwExceptions(unittest.TestCase): +class getcrwExceptions(unittest.TestCase): def setUp(self): self.P = PdfFit() @@ -854,13 +784,12 @@ def test_unassignedError(self): self.assertRaises(pdffit2.unassignedError, self.P.getcrw) - -#main -if __name__ == '__main__': - #suite = unittest.makeSuite(num_atomsExceptions) - #unittest.TextTestRunner(verbosity=3).run(suite) - #testcase = calcExceptions('test_unassignedError') - #unittest.TextTestRunner(verbosity=3).run(testcase) +# main +if __name__ == "__main__": + # suite = unittest.makeSuite(num_atomsExceptions) + # unittest.TextTestRunner(verbosity=3).run(suite) + # testcase = calcExceptions('test_unassignedError') + # unittest.TextTestRunner(verbosity=3).run(testcase) unittest.main() # End of file diff --git a/diffpy/pdffit2/tests/TestPdfFit.py b/diffpy/pdffit2/tests/TestPdfFit.py index 90f1ad7c..8102b8b9 100644 --- a/diffpy/pdffit2/tests/TestPdfFit.py +++ b/diffpy/pdffit2/tests/TestPdfFit.py @@ -14,6 +14,7 @@ # ---------------------------------------------------------------------------- + class TestPdfFit(unittest.TestCase): places = 6 @@ -30,299 +31,289 @@ def test__exportAll(self): "check PdfFit._exportAll()" ns = {} self.P._exportAll(ns) - self.assertEqual('ALL', ns['ALL']) - self.assertEqual('FSQR', ns['FSQR']) - self.assertEqual('N', ns['N']) - self.assertIs('N', ns['N']) - self.assertIs(self.P.lat, ns['lat']) - self.assertEqual(self.P.reset, ns['reset']) + self.assertEqual("ALL", ns["ALL"]) + self.assertEqual("FSQR", ns["FSQR"]) + self.assertEqual("N", ns["N"]) + self.assertIs("N", ns["N"]) + self.assertIs(self.P.lat, ns["lat"]) + self.assertEqual(self.P.reset, ns["reset"]) return -# def test_intro(self): -# """check PdfFit.intro() -# """ -# return + # def test_intro(self): + # """check PdfFit.intro() + # """ + # return def test_add_structure(self): - """check PdfFit.add_structure() - """ - ni = loadStructure(datafile('Ni.stru')) + """check PdfFit.add_structure()""" + ni = loadStructure(datafile("Ni.stru")) self.P.add_structure(ni) self.assertEqual(4, self.P.num_atoms()) return -# def test_read_struct(self): -# """check PdfFit.read_struct() -# """ -# return -# -# def test_read_struct_string(self): -# """check PdfFit.read_struct_string() -# """ -# return -# -# def test_read_data(self): -# """check PdfFit.read_data() -# """ -# return + # def test_read_struct(self): + # """check PdfFit.read_struct() + # """ + # return + # + # def test_read_struct_string(self): + # """check PdfFit.read_struct_string() + # """ + # return + # + # def test_read_data(self): + # """check PdfFit.read_data() + # """ + # return def test_read_data_string(self): - """check PdfFit.read_data_string() - """ + """check PdfFit.read_data_string()""" pf = self.P - with open(datafile('300K.gr')) as fp: + with open(datafile("300K.gr")) as fp: s = fp.read() self.assertEqual([], pf.data_files) - pf.read_data_string(s, 'N', 32, 0.03, 'lmo') + pf.read_data_string(s, "N", 32, 0.03, "lmo") self.assertEqual(1, len(pf.data_files)) gobs = pf.getpdf_obs() self.assertEqual(2000, len(gobs)) self.assertEqual(0.384, gobs[-1]) - self.assertEqual(0.03, pf.getvar('qdamp')) - return - -# def test_read_data_lists(self): -# """check PdfFit.read_data_lists() -# """ -# return -# -# def test_pdfrange(self): -# """check PdfFit.pdfrange() -# """ -# return -# -# def test_reset(self): -# """check PdfFit.reset() -# """ -# return + self.assertEqual(0.03, pf.getvar("qdamp")) + return + + # def test_read_data_lists(self): + # """check PdfFit.read_data_lists() + # """ + # return + # + # def test_pdfrange(self): + # """check PdfFit.pdfrange() + # """ + # return + # + # def test_reset(self): + # """check PdfFit.reset() + # """ + # return def test_alloc(self): - """check PdfFit.alloc() - """ + """check PdfFit.alloc()""" # alloc and read_struct can be called in any order. - self.P.alloc('X', 25, 0.0, 0.01, 10, 1000) + self.P.alloc("X", 25, 0.0, 0.01, 10, 1000) # without a structure calculated PDF is all zero self.P.calc() Gzero = self.P.getpdf_fit() - self.assertEqual(1000*[0.0], Gzero) - self.P.read_struct(datafile('Ni.stru')) + self.assertEqual(1000 * [0.0], Gzero) + self.P.read_struct(datafile("Ni.stru")) self.P.calc() # check r-values r = self.P.getR() self.assertEqual(1000, len(r)) for i in range(1000): - self.assertAlmostEqual(0.01*(i + 1), r[i], self.places) + self.assertAlmostEqual(0.01 * (i + 1), r[i], self.places) Gfit_alloc_read = self.P.getpdf_fit() # now try the other order self.P.reset() - self.P.read_struct(datafile('Ni.stru')) - self.P.alloc('X', 25, 0.0, 0.01, 10, 1000) + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 25, 0.0, 0.01, 10, 1000) self.P.calc() Gfit_read_alloc = self.P.getpdf_fit() # and they should be the same self.assertEqual(Gfit_read_alloc, Gfit_alloc_read) return -# def test_calc(self): -# """check PdfFit.calc() -# """ -# return -# -# def test_refine(self): -# """check PdfFit.refine() -# """ -# return -# -# def test_refine_step(self): -# """check PdfFit.refine_step() -# """ -# return -# -# def test_save_pdf(self): -# """check PdfFit.save_pdf() -# """ -# return -# -# def test_save_pdf_string(self): -# """check PdfFit.save_pdf_string() -# """ -# return -# -# def test_save_dif(self): -# """check PdfFit.save_dif() -# """ -# return -# -# def test_save_dif_string(self): -# """check PdfFit.save_dif_string() -# """ -# return -# -# def test_save_res(self): -# """check PdfFit.save_res() -# """ -# return -# -# def test_save_res_string(self): -# """check PdfFit.save_res_string() -# """ -# return + # def test_calc(self): + # """check PdfFit.calc() + # """ + # return + # + # def test_refine(self): + # """check PdfFit.refine() + # """ + # return + # + # def test_refine_step(self): + # """check PdfFit.refine_step() + # """ + # return + # + # def test_save_pdf(self): + # """check PdfFit.save_pdf() + # """ + # return + # + # def test_save_pdf_string(self): + # """check PdfFit.save_pdf_string() + # """ + # return + # + # def test_save_dif(self): + # """check PdfFit.save_dif() + # """ + # return + # + # def test_save_dif_string(self): + # """check PdfFit.save_dif_string() + # """ + # return + # + # def test_save_res(self): + # """check PdfFit.save_res() + # """ + # return + # + # def test_save_res_string(self): + # """check PdfFit.save_res_string() + # """ + # return def test_get_structure(self): - """check PdfFit.get_structure() - """ - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) + """check PdfFit.get_structure()""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) stru1 = self.P.get_structure(1) self.assertEqual(4, len(stru1)) - self.assertEqual('Ni', stru1[0].element) + self.assertEqual("Ni", stru1[0].element) stru2 = self.P.get_structure(2) self.assertEqual(56, len(stru2)) - self.assertEqual('Ti', stru2[-1].element) - return - -# def test_save_struct(self): -# """check PdfFit.save_struct() -# """ -# return -# -# def test_save_struct_string(self): -# """check PdfFit.save_struct_string() -# """ -# return -# -# def test_show_struct(self): -# """check PdfFit.show_struct() -# """ -# return -# -# def test_constrain(self): -# """check PdfFit.constrain() -# """ -# return + self.assertEqual("Ti", stru2[-1].element) + return + + # def test_save_struct(self): + # """check PdfFit.save_struct() + # """ + # return + # + # def test_save_struct_string(self): + # """check PdfFit.save_struct_string() + # """ + # return + # + # def test_show_struct(self): + # """check PdfFit.show_struct() + # """ + # return + # + # def test_constrain(self): + # """check PdfFit.constrain() + # """ + # return def test_setpar(self): - """check PdfFit.setpar() - """ + """check PdfFit.setpar()""" pf = self.P - pf.read_struct(datafile('Ni.stru')) - pf.setpar(1, 'lat(1)') + pf.read_struct(datafile("Ni.stru")) + pf.setpar(1, "lat(1)") self.assertEqual(3.52, pf.getpar(1)) pf.setpar(1, 4.0) self.assertEqual(4, pf.getpar(1)) - pf.setpar(1, pf.lat('a')) + pf.setpar(1, pf.lat("a")) self.assertEqual(3.52, pf.getpar(1)) return def test_setvar(self): - """check PdfFit.setvar() - """ + """check PdfFit.setvar()""" pf = self.P - pf.read_struct(datafile('Ni.stru')) + pf.read_struct(datafile("Ni.stru")) pf.setvar(pf.delta1, 1.2) self.assertEqual(1.2, pf.getvar(pf.delta1)) - pf.setvar('delta1', 1.7) - self.assertEqual(1.7, pf.getvar('delta1')) - return - -# def test_getvar(self): -# """check PdfFit.getvar() -# """ -# return -# -# def test_getrw(self): -# """check PdfFit.getrw() -# """ -# return -# -# def test_getR(self): -# """check PdfFit.getR() -# """ -# return -# -# def test_getpdf_fit(self): -# """check PdfFit.getpdf_fit() -# """ -# return -# -# def test_getpdf_obs(self): -# """check PdfFit.getpdf_obs() -# """ -# return -# -# def test_getpdf_diff(self): -# """check PdfFit.getpdf_diff() -# """ -# return + pf.setvar("delta1", 1.7) + self.assertEqual(1.7, pf.getvar("delta1")) + return + + # def test_getvar(self): + # """check PdfFit.getvar() + # """ + # return + # + # def test_getrw(self): + # """check PdfFit.getrw() + # """ + # return + # + # def test_getR(self): + # """check PdfFit.getR() + # """ + # return + # + # def test_getpdf_fit(self): + # """check PdfFit.getpdf_fit() + # """ + # return + # + # def test_getpdf_obs(self): + # """check PdfFit.getpdf_obs() + # """ + # return + # + # def test_getpdf_diff(self): + # """check PdfFit.getpdf_diff() + # """ + # return def test_get_atoms(self): - """check PdfFit.get_atoms() - """ - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) + """check PdfFit.get_atoms()""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) self.P.setphase(1) a1 = self.P.get_atoms() a2 = self.P.get_atoms(2) - self.assertEqual(4*['NI'], a1) - self.assertEqual(8*['PB']+24*['O']+8*['SC']+8*['W']+8*['TI'], a2) + self.assertEqual(4 * ["NI"], a1) + self.assertEqual(8 * ["PB"] + 24 * ["O"] + 8 * ["SC"] + 8 * ["W"] + 8 * ["TI"], a2) return def test_get_atom_types(self): - """check PdfFit.get_atom_types() - """ - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) + """check PdfFit.get_atom_types()""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) self.P.setphase(1) atp1 = self.P.get_atom_types() atp2 = self.P.get_atom_types(2) - self.assertEqual(['NI'], atp1) - self.assertEqual(['PB', 'O', 'SC', 'W', 'TI'], atp2) + self.assertEqual(["NI"], atp1) + self.assertEqual(["PB", "O", "SC", "W", "TI"], atp2) return def test_num_phases(self): - """check PdfFit.num_phases() - """ + """check PdfFit.num_phases()""" self.assertEqual(0, self.P.num_phases()) - self.P.read_struct(datafile('Ni.stru')) + self.P.read_struct(datafile("Ni.stru")) self.assertEqual(1, self.P.num_phases()) - self.P.read_struct(datafile('PbScW25TiO3.stru')) + self.P.read_struct(datafile("PbScW25TiO3.stru")) self.assertEqual(2, self.P.num_phases()) self.P.reset() self.assertEqual(0, self.P.num_phases()) return def test_num_datasets(self): - """check PdfFit.num_datasets() - """ + """check PdfFit.num_datasets()""" self.assertEqual(0, self.P.num_datasets()) - self.P.read_data(datafile('Ni.dat'), 'X', 25.0, 0.5) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) self.assertEqual(1, self.P.num_datasets()) # failed data should not increase num_datasets try: - self.P.read_data(datafile('badNi.dat')) + self.P.read_data(datafile("badNi.dat")) except: pass self.assertEqual(1, self.P.num_datasets()) # alloc should increase number of datasets # alloc requires a loaded structure - self.P.read_struct(datafile('Ni.stru')) - self.P.alloc('X', 30.0, 0.05, 2, 10, 100) + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 30.0, 0.05, 2, 10, 100) self.assertEqual(2, self.P.num_datasets()) self.P.reset() self.assertEqual(0, self.P.num_datasets()) return def test_getcrw(self): - """check PdfFit.getcrw() - """ + """check PdfFit.getcrw()""" import numpy + self.assertEqual(0, self.P.num_datasets()) # Setting qmax=0 so that partial crw are not disturbed by # termination ripples. - self.P.read_data(datafile('Ni.dat'), 'X', 0.0, 0.0) + self.P.read_data(datafile("Ni.dat"), "X", 0.0, 0.0) # crw is empty before data refinement self.assertEqual([], self.P.getcrw()) - self.P.read_struct(datafile('Ni.stru')) + self.P.read_struct(datafile("Ni.stru")) self.P.pdfrange(1, 2, 19) self.P.refine() crw19 = numpy.array(self.P.getcrw()) @@ -334,10 +325,10 @@ def test_getcrw(self): self.assertAlmostEqual(self.P.getrw(), rw19, self.places) # renormalize cumulative Rw and compare with Rw at r=15 Gobs19 = numpy.array(self.P.getpdf_obs()) - Gnorm19 = numpy.sqrt(numpy.sum(Gobs19**2)) + Gnorm19 = numpy.sqrt(numpy.sum(Gobs19 ** 2)) r = numpy.array(self.P.getR()) idx = numpy.nonzero(r <= 15)[0] - Gnorm15 = numpy.sqrt(numpy.sum(Gobs19[idx]**2)) + Gnorm15 = numpy.sqrt(numpy.sum(Gobs19[idx] ** 2)) i15 = idx[-1] rw15 = crw19[i15] * Gnorm19 / Gnorm15 self.P.pdfrange(1, 2, r[i15] + 1e-5) @@ -346,17 +337,16 @@ def test_getcrw(self): return def test_getcrw_two_datasets(self): - """check that getcrw() and getrw() are consistent for two datasets. - """ - self.P.read_data(datafile('Ni.dat'), 'X', 25.0, 0.0) + """check that getcrw() and getrw() are consistent for two datasets.""" + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) self.P.pdfrange(1, 2, 8) - self.P.read_data(datafile('300K.gr'), 'N', 32.0, 0.0) + self.P.read_data(datafile("300K.gr"), "N", 32.0, 0.0) self.P.pdfrange(2, 1, 11) - self.P.read_struct(datafile('Ni.stru')) + self.P.read_struct(datafile("Ni.stru")) # mess lattice parameters to have comparable Rw contributions - self.P.setvar('lat(1)', 3) - self.P.setvar('lat(2)', 3) - self.P.setvar('lat(3)', 3) + self.P.setvar("lat(1)", 3) + self.P.setvar("lat(2)", 3) + self.P.setvar("lat(3)", 3) self.P.refine() rwtot = self.P.getrw() self.assertTrue(rwtot > 0.0) @@ -364,72 +354,70 @@ def test_getcrw_two_datasets(self): rw1 = self.P.getcrw()[-1] self.P.setdata(2) rw2 = self.P.getcrw()[-1] - self.assertAlmostEqual(rwtot**2, rw1**2 + rw2**2, self.places) + self.assertAlmostEqual(rwtot ** 2, rw1 ** 2 + rw2 ** 2, self.places) return -# def test_getpar(self): -# """check PdfFit.getpar() -# """ -# return + # def test_getpar(self): + # """check PdfFit.getpar() + # """ + # return def test_fixpar(self): - """check PdfFit.fixpar() - """ - self.P.fixpar('all') - self.assertRaises(TypeError, self.P.fixpar, 'x') + """check PdfFit.fixpar()""" + self.P.fixpar("all") + self.assertRaises(TypeError, self.P.fixpar, "x") return def test_freepar(self): - """check PdfFit.freepar() - """ - self.P.freepar('all') - self.assertRaises(TypeError, self.P.freepar, 'x') - return - -# def test_setphase(self): -# """check PdfFit.setphase() -# """ -# return -# -# def test_setdata(self): -# """check PdfFit.setdata() -# """ -# return -# + """check PdfFit.freepar()""" + self.P.freepar("all") + self.assertRaises(TypeError, self.P.freepar, "x") + return + + # def test_setphase(self): + # """check PdfFit.setphase() + # """ + # return + # + # def test_setdata(self): + # """check PdfFit.setdata() + # """ + # return + # def test_psel(self): - """check PdfFit.psel() - """ + """check PdfFit.psel()""" + def doalloc(): - self.P.alloc('X', 30.0, 0.05, 2, 10, 100) + self.P.alloc("X", 30.0, 0.05, 2, 10, 100) return + self.assertRaises(pdffit2.unassignedError, self.P.psel, 0) self.assertRaises(pdffit2.unassignedError, self.P.psel, 1) - self.P.read_struct(datafile('Ni.stru')) + self.P.read_struct(datafile("Ni.stru")) doalloc() self.P.calc() G1 = self.P.getpdf_fit() self.P.reset() - self.P.read_struct(datafile('PbScW25TiO3.stru')) + self.P.read_struct(datafile("PbScW25TiO3.stru")) doalloc() self.P.calc() G2 = self.P.getpdf_fit() self.P.reset() - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) doalloc() - self.P.pdesel('ALL') + self.P.pdesel("ALL") self.P.psel(1) self.P.calc() self.assertEqual(G1, self.P.getpdf_fit()) - self.P.pdesel('ALL') + self.P.pdesel("ALL") self.P.psel(2) self.P.calc() self.assertEqual(G2, self.P.getpdf_fit()) - self.P.psel('ALL') + self.P.psel("ALL") self.P.calc() Gall = self.P.getpdf_fit() - dGmax = max([abs(g1 + g2 - gall) - for g1, g2, gall in zip(G1, G2, Gall)]) + dGmax = max([abs(g1 + g2 - gall) for g1, g2, gall in zip(G1, G2, Gall)]) self.assertAlmostEqual(0, dGmax, self.places) self.assertRaises(pdffit2.unassignedError, self.P.psel, 10) self.assertRaises(pdffit2.unassignedError, self.P.psel, 0) @@ -437,67 +425,68 @@ def doalloc(): return def test_pdesel(self): - """check PdfFit.pdesel() - """ + """check PdfFit.pdesel()""" + def doalloc(): - self.P.alloc('X', 30.0, 0.05, 2, 10, 100) + self.P.alloc("X", 30.0, 0.05, 2, 10, 100) return + self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 0) self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 1) - self.P.read_struct(datafile('Ni.stru')) + self.P.read_struct(datafile("Ni.stru")) doalloc() self.P.calc() G1 = self.P.getpdf_fit() self.P.reset() - self.P.read_struct(datafile('PbScW25TiO3.stru')) + self.P.read_struct(datafile("PbScW25TiO3.stru")) doalloc() self.P.calc() G2 = self.P.getpdf_fit() self.P.reset() - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) doalloc() - self.P.psel('ALL') + self.P.psel("ALL") self.P.pdesel(2) self.P.calc() self.assertEqual(G1, self.P.getpdf_fit()) - self.P.psel('ALL') + self.P.psel("ALL") self.P.pdesel(1) self.P.calc() self.assertEqual(G2, self.P.getpdf_fit()) - self.P.pdesel('ALL') + self.P.pdesel("ALL") self.P.calc() G0 = self.P.getpdf_fit() - self.assertEqual([0.0]*len(G0), G0) + self.assertEqual([0.0] * len(G0), G0) self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 10) self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 0) self.assertRaises(pdffit2.unassignedError, self.P.pdesel, -100) return -# -# def test_selectAtomType(self): -# """check PdfFit.selectAtomType() -# """ -# return -# -# def test_selectAtomIndex(self): -# """check PdfFit.selectAtomIndex() -# """ -# return -# -# def test_selectAll(self): -# """check PdfFit.selectAll() -# """ -# return -# -# def test_selectNone(self): -# """check PdfFit.selectNone() -# """ -# return + + # + # def test_selectAtomType(self): + # """check PdfFit.selectAtomType() + # """ + # return + # + # def test_selectAtomIndex(self): + # """check PdfFit.selectAtomIndex() + # """ + # return + # + # def test_selectAll(self): + # """check PdfFit.selectAll() + # """ + # return + # + # def test_selectNone(self): + # """check PdfFit.selectNone() + # """ + # return def test_bond_angle(self): - """check PdfFit.bond_angle() - """ - self.P.read_struct(datafile('Ni.stru')) + """check PdfFit.bond_angle()""" + self.P.read_struct(datafile("Ni.stru")) a, e = self.P.bond_angle(1, 2, 3) self.assertAlmostEqual(60.0, a, self.places) self.assertRaises(ValueError, self.P.bond_angle, 0, 1, 2) @@ -506,17 +495,16 @@ def test_bond_angle(self): def test_bang(self): "check PdfFit.bang() function" - self.P.read_struct(datafile('Ni.stru')) + self.P.read_struct(datafile("Ni.stru")) out = capture_output(self.P.bang, 1, 2, 3).strip() - self.assertTrue(out.endswith('60 degrees')) - self.assertTrue(out.startswith('NI (#1) - NI (#2) - NI (#3)')) + self.assertTrue(out.endswith("60 degrees")) + self.assertTrue(out.startswith("NI (#1) - NI (#2) - NI (#3)")) return def test_bond_length_atoms(self): - """check PdfFit.bond_length_atoms() - """ - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) + """check PdfFit.bond_length_atoms()""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) dij, ddij = self.P.bond_length_atoms(1, 5) self.assertAlmostEqual(4.03635, dij, self.places) self.P.setphase(1) @@ -524,152 +512,145 @@ def test_bond_length_atoms(self): return def test_bond_length_types(self): - """check PdfFit.bond_length_types() - """ - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) - dPbO = self.P.bond_length_types('Pb', 'O', 0.1, 3.0) + """check PdfFit.bond_length_types()""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + dPbO = self.P.bond_length_types("Pb", "O", 0.1, 3.0) # check if keys are present - self.assertTrue('dij' in dPbO) - self.assertTrue('ddij' in dPbO) - self.assertTrue('ij0' in dPbO) - self.assertTrue('ij1' in dPbO) + self.assertTrue("dij" in dPbO) + self.assertTrue("ddij" in dPbO) + self.assertTrue("ij0" in dPbO) + self.assertTrue("ij1" in dPbO) # check if they have the same length - npts = len(dPbO['dij']) - self.assertEqual(npts, len(dPbO['ddij'])) - self.assertEqual(npts, len(dPbO['ij0'])) - self.assertEqual(npts, len(dPbO['ij1'])) + npts = len(dPbO["dij"]) + self.assertEqual(npts, len(dPbO["ddij"])) + self.assertEqual(npts, len(dPbO["ij0"])) + self.assertEqual(npts, len(dPbO["ij1"])) # 8 Pb atoms have coordination 12 in perovskite structure - self.assertEqual(8*12, len(dPbO['dij'])) + self.assertEqual(8 * 12, len(dPbO["dij"])) self.P.setphase(1) - dfcc = self.P.bond_length_types('ALL', 'ALL', 0.1, 2.6) + dfcc = self.P.bond_length_types("ALL", "ALL", 0.1, 2.6) # 4 Ni atoms with coordination 12 - self.assertEqual(4*12, len(dfcc['dij'])) + self.assertEqual(4 * 12, len(dfcc["dij"])) # invalid element - self.assertRaises(ValueError, self.P.bond_length_types, 'Ni', 'Nix', 0.1, 5.0) + self.assertRaises(ValueError, self.P.bond_length_types, "Ni", "Nix", 0.1, 5.0) # check indices ij0 - allij0 = sum(dfcc['ij0'], tuple()) + allij0 = sum(dfcc["ij0"], tuple()) self.assertEqual(0, min(allij0)) self.assertEqual(3, max(allij0)) # check indices ij1 - allij1 = sum(dfcc['ij1'], tuple()) + allij1 = sum(dfcc["ij1"], tuple()) self.assertEqual(1, min(allij1)) self.assertEqual(4, max(allij1)) # check index values - ij0check = [(i1 - 1, j1 - 1) for i1, j1 in dfcc['ij1']] - self.assertEqual(ij0check, dfcc['ij0']) + ij0check = [(i1 - 1, j1 - 1) for i1, j1 in dfcc["ij1"]] + self.assertEqual(ij0check, dfcc["ij0"]) # test valid element which is not present in the structure - dnone = self.P.bond_length_types('Ni', 'Au', 0.1, 5.0) - self.assertEqual(0, len(dnone['dij'])) - self.assertEqual(0, len(dnone['ddij'])) - self.assertEqual(0, len(dnone['ij0'])) - self.assertEqual(0, len(dnone['ij1'])) + dnone = self.P.bond_length_types("Ni", "Au", 0.1, 5.0) + self.assertEqual(0, len(dnone["dij"])) + self.assertEqual(0, len(dnone["ddij"])) + self.assertEqual(0, len(dnone["ij0"])) + self.assertEqual(0, len(dnone["ij1"])) return def test_blen(self): - """check PdfFit.blen() - """ - self.P.read_struct(datafile('PbScW25TiO3.stru')) + """check PdfFit.blen()""" + self.P.read_struct(datafile("PbScW25TiO3.stru")) blen = self.P.blen o = capture_output(blen, 1, 5).strip() - self.assertTrue(o.endswith('4.03635 A')) - self.assertTrue('PB (#1)' in o) - self.assertTrue('PB (#5)' in o) + self.assertTrue(o.endswith("4.03635 A")) + self.assertTrue("PB (#1)" in o) + self.assertTrue("PB (#5)" in o) self.assertRaises(ValueError, blen, 1, 99) self.assertRaises(ValueError, blen, 0, 1) o1 = capture_output(blen, 1, 1, 0.1, 1) - self.assertTrue('No pairs found' in o1) + self.assertTrue("No pairs found" in o1) o2 = capture_output(blen, 1, 50, 0.1, 1) - self.assertEqual('', o2) - o3 = capture_output(blen, 'Sc', 'O', 0.5, 2.3).strip() - self.assertEqual(1 + 48, len(o3.split('\n'))) + self.assertEqual("", o2) + o3 = capture_output(blen, "Sc", "O", 0.5, 2.3).strip() + self.assertEqual(1 + 48, len(o3.split("\n"))) self.assertEqual(6, o3.count("SC (#33)")) self.assertEqual(2, o3.count("O (#9)")) self.assertRaises(TypeError, blen, "Sc", "O", 0.5) return -# def test_show_scat(self): -# """check PdfFit.show_scat() -# """ -# return -# -# def test_get_scat_string(self): -# """check PdfFit.get_scat_string() -# """ -# return + # def test_show_scat(self): + # """check PdfFit.show_scat() + # """ + # return + # + # def test_get_scat_string(self): + # """check PdfFit.get_scat_string() + # """ + # return def test_get_scat(self): - """check PdfFit.get_scat() - """ + """check PdfFit.get_scat()""" # x-ray scattering factors - fPb = self.P.get_scat('X', 'Pb') + fPb = self.P.get_scat("X", "Pb") self.assertEqual(82.0, fPb) - fTi = self.P.get_scat('X', 'tI') + fTi = self.P.get_scat("X", "tI") self.assertEqual(22.0, fTi) # neutron scattering lengths - bPb = self.P.get_scat('N', 'PB') + bPb = self.P.get_scat("N", "PB") self.assertAlmostEqual(9.401, bPb, 3) - bTi = self.P.get_scat('N', 'ti') + bTi = self.P.get_scat("N", "ti") self.assertAlmostEqual(-3.370, bTi, 3) # exceptions - self.assertRaises(ValueError, self.P.get_scat, 'N', 'zz') - self.assertRaises(ValueError, self.P.get_scat, 'Z', 'Ti') + self.assertRaises(ValueError, self.P.get_scat, "N", "zz") + self.assertRaises(ValueError, self.P.get_scat, "Z", "Ti") return def test_set_scat(self): - """check PdfFit.set_scat() - """ + """check PdfFit.set_scat()""" # raises exception when no phase exists - self.assertRaises(pdffit2.unassignedError, - self.P.set_scat, 'N', 'Ti', -11) + self.assertRaises(pdffit2.unassignedError, self.P.set_scat, "N", "Ti", -11) # check if it is local to phase - fPb = self.P.get_scat('X', 'Pb') - bPb = self.P.get_scat('N', 'Pb') - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.P.set_scat('X', 'Pb', 142) - self.assertEqual(142, self.P.get_scat('X', 'Pb')) - self.assertEqual(bPb, self.P.get_scat('N', 'Pb')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.assertEqual(fPb, self.P.get_scat('X', 'Pb')) + fPb = self.P.get_scat("X", "Pb") + bPb = self.P.get_scat("N", "Pb") + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.set_scat("X", "Pb", 142) + self.assertEqual(142, self.P.get_scat("X", "Pb")) + self.assertEqual(bPb, self.P.get_scat("N", "Pb")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.assertEqual(fPb, self.P.get_scat("X", "Pb")) self.P.setphase(1) - self.assertEqual(142, self.P.get_scat('X', 'Pb')) + self.assertEqual(142, self.P.get_scat("X", "Pb")) self.P.setphase(2) - self.assertEqual(fPb, self.P.get_scat('X', 'Pb')) + self.assertEqual(fPb, self.P.get_scat("X", "Pb")) # check exception for invalid inputs - self.assertRaises(ValueError, self.P.set_scat, 'Z', 'C', 123) - self.assertRaises(ValueError, self.P.set_scat, 'X', 'ZZ', 123) + self.assertRaises(ValueError, self.P.set_scat, "Z", "C", 123) + self.assertRaises(ValueError, self.P.set_scat, "X", "ZZ", 123) return def test_reset_scat(self): - """check PdfFit.reset_scat() - """ + """check PdfFit.reset_scat()""" # raises exception when no phase exists - self.assertRaises(pdffit2.unassignedError, self.P.reset_scat, 'Ti') + self.assertRaises(pdffit2.unassignedError, self.P.reset_scat, "Ti") # check if it is local to phase - fPb = self.P.get_scat('X', 'Pb') - bPb = self.P.get_scat('N', 'Pb') - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.P.set_scat('X', 'Pb', 142) - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.P.set_scat('N', 'Pb', -17) + fPb = self.P.get_scat("X", "Pb") + bPb = self.P.get_scat("N", "Pb") + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.set_scat("X", "Pb", 142) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.set_scat("N", "Pb", -17) self.P.setphase(1) - self.assertNotEqual(fPb, self.P.get_scat('X', 'Pb')) - self.P.reset_scat('Pb') - self.assertEqual(fPb, self.P.get_scat('X', 'Pb')) + self.assertNotEqual(fPb, self.P.get_scat("X", "Pb")) + self.P.reset_scat("Pb") + self.assertEqual(fPb, self.P.get_scat("X", "Pb")) self.P.setphase(2) - self.assertNotEqual(bPb, self.P.get_scat('N', 'Pb')) - self.P.reset_scat('Pb') - self.assertEqual(bPb, self.P.get_scat('N', 'Pb')) + self.assertNotEqual(bPb, self.P.get_scat("N", "Pb")) + self.P.reset_scat("Pb") + self.assertEqual(bPb, self.P.get_scat("N", "Pb")) # check exception for invalid inputs - self.assertRaises(ValueError, self.P.reset_scat, 'Zz') + self.assertRaises(ValueError, self.P.reset_scat, "Zz") return def test_num_atoms(self): - """check PdfFit.num_atoms() - """ - self.P.read_struct(datafile('Ni.stru')) + """check PdfFit.num_atoms()""" + self.P.read_struct(datafile("Ni.stru")) self.assertEqual(4, self.P.num_atoms()) - self.P.read_struct(datafile('PbScW25TiO3.stru')) + self.P.read_struct(datafile("PbScW25TiO3.stru")) self.assertEqual(56, self.P.num_atoms()) self.P.setphase(1) self.assertEqual(4, self.P.num_atoms()) @@ -678,30 +659,27 @@ def test_num_atoms(self): return def test_lat(self): - """check PdfFit.lat() - """ + """check PdfFit.lat()""" pf = self.P - pf.read_struct(datafile('Ni.stru')) - for i in ('a', 'b', 'c', 1, 2, 3): + pf.read_struct(datafile("Ni.stru")) + for i in ("a", "b", "c", 1, 2, 3): self.assertEqual(3.52, pf.getvar(pf.lat(i))) - for i in ('alpha', 'beta', 'gamma', 4, 5, 6): + for i in ("alpha", "beta", "gamma", 4, 5, 6): self.assertEqual(90, pf.getvar(pf.lat(i))) return def test_xyz(self): - """check PdfFit.x() PdfFit.y(), PdfFit.z() - """ + """check PdfFit.x() PdfFit.y(), PdfFit.z()""" pf = self.P - pf.read_struct(datafile('Ni.stru')) + pf.read_struct(datafile("Ni.stru")) self.assertEqual(0.5, pf.getvar(pf.x(3))) self.assertEqual(0, pf.getvar(pf.y(3))) self.assertEqual(0.5, pf.getvar(pf.z(3))) return def test_uij(self): - """check PdfFit.uij() - """ - ni = loadStructure(datafile('Ni.stru')) + """check PdfFit.uij()""" + ni = loadStructure(datafile("Ni.stru")) ni[2].anisotropy = True ni[2].U11, ni[2].U22, ni[2].U33 = 1, 2, 3 ni[2].U12, ni[2].U13, ni[2].U23 = 4, 5, 6 @@ -716,14 +694,14 @@ def test_uij(self): return def test_occ(self): - """check PdfFit.occ() - """ + """check PdfFit.occ()""" pf = self.P - pf.read_struct(datafile('Ni.stru')) + pf.read_struct(datafile("Ni.stru")) for i in range(1, 5): self.assertEqual(1, pf.getvar(pf.occ(i))) return + # def test_pscale(self): # """check PdfFit.pscale() # """ @@ -781,7 +759,7 @@ def test_occ(self): # End of class TestPdfFit -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() # End of file diff --git a/diffpy/pdffit2/tests/TestPhaseFractions.py b/diffpy/pdffit2/tests/TestPhaseFractions.py index aa3b27e6..2bbebf76 100644 --- a/diffpy/pdffit2/tests/TestPhaseFractions.py +++ b/diffpy/pdffit2/tests/TestPhaseFractions.py @@ -16,10 +16,10 @@ class TestPhaseFractions(unittest.TestCase): def setUp(self): self.P = PdfFit() - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) - self.P.alloc('N', 0.0, 0.05, 0.1, 10, 200) + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.alloc("N", 0.0, 0.05, 0.1, 10, 200) return def tearDown(self): @@ -27,83 +27,70 @@ def tearDown(self): return def test_xray_fractions(self): - """test_xray_fractions -- check phase fractions in x-ray dataset. - """ + """test_xray_fractions -- check phase fractions in x-ray dataset.""" self.P.setdata(1) ph = self.P.phase_fractions() - bb1 = 28**2 - bb2 = ((8*82 + 24*8 + 4*21 + 2*74 + 2*22) / 40.0)**2 - self.assertAlmostEqual(1.0, sum(ph['atom']), self.places) - self.assertAlmostEqual(1.0, sum(ph['cell']), self.places) - self.assertAlmostEqual(1.0, sum(ph['mass']), self.places) - self.assertAlmostEqual(bb2/bb1, - ph['atom'][0]/ph['atom'][1], self.places) - self.assertAlmostEqual(bb2/bb1 * 40.0/4.0, - ph['cell'][0]/ph['cell'][1], self.places) + bb1 = 28 ** 2 + bb2 = ((8 * 82 + 24 * 8 + 4 * 21 + 2 * 74 + 2 * 22) / 40.0) ** 2 + self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) + self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) + self.assertAlmostEqual(1.0, sum(ph["mass"]), self.places) + self.assertAlmostEqual(bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places) + self.assertAlmostEqual(bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places) mavg1 = 58.69 - mavg2 = (8*207.19 + 24*15.994 + 4*44.956 + 2*183.85 + 2*47.90)/40.0 - self.assertAlmostEqual(bb2/bb1 * mavg1/mavg2, - ph['mass'][0]/ph['mass'][1], self.places) - self.assertEqual(0.0, sum(ph['stdatom'])) - self.assertEqual(0.0, sum(ph['stdcell'])) - self.assertEqual(0.0, sum(ph['stdmass'])) + mavg2 = (8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90) / 40.0 + self.assertAlmostEqual(bb2 / bb1 * mavg1 / mavg2, ph["mass"][0] / ph["mass"][1], self.places) + self.assertEqual(0.0, sum(ph["stdatom"])) + self.assertEqual(0.0, sum(ph["stdcell"])) + self.assertEqual(0.0, sum(ph["stdmass"])) self.P.setphase(1) - self.P.setvar('pscale', 2.0) + self.P.setvar("pscale", 2.0) ph2 = self.P.phase_fractions() - self.assertAlmostEqual(1.0, sum(ph2['atom']), self.places) - self.assertAlmostEqual(1.0, sum(ph2['cell']), self.places) - self.assertAlmostEqual(1.0, sum(ph2['mass']), self.places) - self.assertAlmostEqual(2.0, ph2['atom'][0]/ph2['atom'][1] / - (ph['atom'][0]/ph['atom'][1]), self.places) - self.assertAlmostEqual(2.0, ph2['cell'][0]/ph2['cell'][1] / - (ph['cell'][0]/ph['cell'][1]), self.places) - self.assertAlmostEqual(2.0, ph2['mass'][0]/ph2['mass'][1] / - (ph['mass'][0]/ph['mass'][1]), self.places) + self.assertAlmostEqual(1.0, sum(ph2["atom"]), self.places) + self.assertAlmostEqual(1.0, sum(ph2["cell"]), self.places) + self.assertAlmostEqual(1.0, sum(ph2["mass"]), self.places) + self.assertAlmostEqual(2.0, ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), self.places) + self.assertAlmostEqual(2.0, ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), self.places) + self.assertAlmostEqual(2.0, ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), self.places) return def test_neutron_fractions(self): - """test_neutron_fractions -- check phase fractions in neutron dataset. - """ + """test_neutron_fractions -- check phase fractions in neutron dataset.""" self.P.setdata(2) ph = self.P.phase_fractions() - bb1 = 10.31**2 + bb1 = 10.31 ** 2 bPb = 9.4012 bO = 5.8054 bSc = 12.11 bW = 4.75518 bTi = -3.37013 - bb2 = ((8*bPb + 24*bO + 4*bSc + 2*bW + 2*bTi) / 40.0)**2 - self.assertAlmostEqual(1.0, sum(ph['atom']), self.places) - self.assertAlmostEqual(1.0, sum(ph['cell']), self.places) - self.assertAlmostEqual(1.0, sum(ph['mass']), self.places) - self.assertAlmostEqual(bb2/bb1, - ph['atom'][0]/ph['atom'][1], self.places) - self.assertAlmostEqual(bb2/bb1 * 40.0/4.0, - ph['cell'][0]/ph['cell'][1], self.places) + bb2 = ((8 * bPb + 24 * bO + 4 * bSc + 2 * bW + 2 * bTi) / 40.0) ** 2 + self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) + self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) + self.assertAlmostEqual(1.0, sum(ph["mass"]), self.places) + self.assertAlmostEqual(bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places) + self.assertAlmostEqual(bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places) mavg1 = 58.69 - mavg2 = (8*207.19 + 24*15.994 + 4*44.956 + 2*183.85 + 2*47.90)/40.0 - self.assertAlmostEqual(bb2/bb1 * mavg1/mavg2, - ph['mass'][0]/ph['mass'][1], self.places) - self.assertEqual(0.0, sum(ph['stdatom'])) - self.assertEqual(0.0, sum(ph['stdcell'])) - self.assertEqual(0.0, sum(ph['stdmass'])) + mavg2 = (8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90) / 40.0 + self.assertAlmostEqual(bb2 / bb1 * mavg1 / mavg2, ph["mass"][0] / ph["mass"][1], self.places) + self.assertEqual(0.0, sum(ph["stdatom"])) + self.assertEqual(0.0, sum(ph["stdcell"])) + self.assertEqual(0.0, sum(ph["stdmass"])) self.P.setphase(1) - self.P.setvar('pscale', 2.0) + self.P.setvar("pscale", 2.0) ph2 = self.P.phase_fractions() - self.assertAlmostEqual(1.0, sum(ph2['atom']), self.places) - self.assertAlmostEqual(1.0, sum(ph2['cell']), self.places) - self.assertAlmostEqual(1.0, sum(ph2['mass']), self.places) - self.assertAlmostEqual(2.0, ph2['atom'][0]/ph2['atom'][1] / - (ph['atom'][0]/ph['atom'][1]), self.places) - self.assertAlmostEqual(2.0, ph2['cell'][0]/ph2['cell'][1] / - (ph['cell'][0]/ph['cell'][1]), self.places) - self.assertAlmostEqual(2.0, ph2['mass'][0]/ph2['mass'][1] / - (ph['mass'][0]/ph['mass'][1]), self.places) + self.assertAlmostEqual(1.0, sum(ph2["atom"]), self.places) + self.assertAlmostEqual(1.0, sum(ph2["cell"]), self.places) + self.assertAlmostEqual(1.0, sum(ph2["mass"]), self.places) + self.assertAlmostEqual(2.0, ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), self.places) + self.assertAlmostEqual(2.0, ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), self.places) + self.assertAlmostEqual(2.0, ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), self.places) return + # End of class TestSphereEnvelope -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() # End of file diff --git a/diffpy/pdffit2/tests/TestShapeFactors.py b/diffpy/pdffit2/tests/TestShapeFactors.py index 26e5bb46..9c870c4a 100644 --- a/diffpy/pdffit2/tests/TestShapeFactors.py +++ b/diffpy/pdffit2/tests/TestShapeFactors.py @@ -21,7 +21,7 @@ def spherefactor(r, d): Return numpy array of shape correction envelope. """ r1 = numpy.array(r) - fsph = 1.0 - 1.5*r1/d + 0.5*(r1/d)**3 + fsph = 1.0 - 1.5 * r1 / d + 0.5 * (r1 / d) ** 3 fsph[r1 > d] = 0.0 return fsph @@ -39,33 +39,29 @@ def tearDown(self): self.P = None return - def test_calculation(self): - """check calculation of sphere envelope factor - """ - self.P.read_struct(datafile('Ni.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) + """check calculation of sphere envelope factor""" + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.calc() d = 8.0 r = numpy.array(self.P.getR()) G0 = numpy.array(self.P.getpdf_fit()) - self.P.setvar('spdiameter', d) + self.P.setvar("spdiameter", d) self.P.calc() G1 = numpy.array(self.P.getpdf_fit()) - dG = (G0*spherefactor(r, d) - G1) - msd = numpy.dot(dG, dG)/len(r) + dG = G0 * spherefactor(r, d) - G1 + msd = numpy.dot(dG, dG) / len(r) self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) return - def test_refinement(self): - """check refinement of sphere envelope factor - """ + """check refinement of sphere envelope factor""" dcheck = 8.0 dstart = 12.0 - self.P.read_struct(datafile('Ni.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) - self.P.setvar('spdiameter', dcheck) + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("spdiameter", dcheck) self.P.calc() r = numpy.array(self.P.getR()) Gd8 = numpy.array(self.P.getpdf_fit()) @@ -73,65 +69,61 @@ def test_refinement(self): Gd8noise[::2] += 0.01 Gd8noise[1::2] -= 0.01 self.P.reset() - self.P.read_struct(datafile('Ni.stru')) - self.P.read_data_lists('X', 0.0, 0.05, list(r), list(Gd8noise)) - self.P.constrain('spdiameter', '@8') + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data_lists("X", 0.0, 0.05, list(r), list(Gd8noise)) + self.P.constrain("spdiameter", "@8") self.P.setpar(8, dstart) self.P.refine() - dfinal = self.P.getvar('spdiameter') + dfinal = self.P.getvar("spdiameter") self.assertAlmostEqual(dcheck, dfinal, 3) return - def test_twophase_calculation(self): - """check PDF calculation for 2 phases with different spdiameters - """ + """check PDF calculation for 2 phases with different spdiameters""" d1 = 6 d2 = 9 - self.P.read_struct(datafile('Ni.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) - self.P.setvar('spdiameter', d1) + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("spdiameter", d1) self.P.calc() G1 = numpy.array(self.P.getpdf_fit()) self.P.reset() - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) - self.P.setvar('spdiameter', d2) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("spdiameter", d2) self.P.calc() G2 = numpy.array(self.P.getpdf_fit()) self.P.reset() - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setphase(1) - self.P.setvar('spdiameter', d1) + self.P.setvar("spdiameter", d1) self.P.setphase(2) - self.P.setvar('spdiameter', d2) + self.P.setvar("spdiameter", d2) self.P.calc() Gtot = numpy.array(self.P.getpdf_fit()) - dG = (G1 + G2 - Gtot) + dG = G1 + G2 - Gtot r = numpy.array(self.P.getR()) - msd = numpy.dot(dG, dG)/len(r) + msd = numpy.dot(dG, dG) / len(r) self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) return - def test_twophase_refinement(self): - """check PDF refinement of 2 phases that have different spdiameter. - """ + """check PDF refinement of 2 phases that have different spdiameter.""" dcheck1 = 8.0 dstart1 = 8.2 dcheck2 = 6.0 dstart2 = 5.5 - self.P.read_struct(datafile('Ni.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) - self.P.setvar('spdiameter', dcheck1) + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("spdiameter", dcheck1) self.P.calc() G1 = numpy.array(self.P.getpdf_fit()) self.P.reset() - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) - self.P.setvar('spdiameter', dcheck2) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("spdiameter", dcheck2) self.P.calc() G2 = numpy.array(self.P.getpdf_fit()) r = numpy.array(self.P.getR()) @@ -139,48 +131,46 @@ def test_twophase_refinement(self): Gnoise[::2] += 0.01 Gnoise[1::2] -= 0.01 self.P.reset() - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.P.read_data_lists('X', 0.0, 0.05, list(r), list(Gnoise)) + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_data_lists("X", 0.0, 0.05, list(r), list(Gnoise)) self.P.setphase(1) - self.P.constrain('spdiameter', '@11') + self.P.constrain("spdiameter", "@11") self.P.setphase(2) - self.P.constrain('spdiameter', '@12') + self.P.constrain("spdiameter", "@12") self.P.setpar(11, dstart1) self.P.setpar(12, dstart2) self.P.refine() - dfinal2 = self.P.getvar('spdiameter') + dfinal2 = self.P.getvar("spdiameter") self.P.setphase(1) - dfinal1 = self.P.getvar('spdiameter') + dfinal1 = self.P.getvar("spdiameter") self.assertAlmostEqual(dcheck1, dfinal1, 3) self.assertAlmostEqual(dcheck2, dfinal2, 3) return - def test_spdiameter_io(self): - """Check reading and writing of spdiameter from structure file. - """ + """Check reading and writing of spdiameter from structure file.""" import re - self.P.read_struct(datafile('Ni.stru')) - self.assertEqual(0.0, self.P.getvar('spdiameter')) + + self.P.read_struct(datafile("Ni.stru")) + self.assertEqual(0.0, self.P.getvar("spdiameter")) # engine should not write shape factor when not defined spdnone = self.P.save_struct_string(1) - self.assertTrue(not re.search('(?m)^shape +sphere,', spdnone)) - self.P.setvar('spdiameter', 7) + self.assertTrue(not re.search("(?m)^shape +sphere,", spdnone)) + self.P.setvar("spdiameter", 7) spd7 = self.P.save_struct_string(1) # spd7 should contain shape factor data - self.assertTrue(re.search('(?m)^shape +sphere,', spd7)) + self.assertTrue(re.search("(?m)^shape +sphere,", spd7)) self.P.reset() self.P.read_struct_string(spd7) - self.assertEqual(7.0, self.P.getvar('spdiameter')) + self.assertEqual(7.0, self.P.getvar("spdiameter")) # try to read without comma - spd14 = re.sub('(?m)^shape +sphere.*$', 'shape sphere 14.00', spd7) + spd14 = re.sub("(?m)^shape +sphere.*$", "shape sphere 14.00", spd7) self.P.read_struct_string(spd14) - self.assertEqual(14.0, self.P.getvar('spdiameter')) + self.assertEqual(14.0, self.P.getvar("spdiameter")) # try to read invalid shape data - sinvalid = re.sub('(?m)^shape .*', 'shape invalid, 1', spd7) - self.assertRaises(pdffit2.structureError, - self.P.read_struct_string, sinvalid) + sinvalid = re.sub("(?m)^shape .*", "shape invalid, 1", spd7) + self.assertRaises(pdffit2.structureError, self.P.read_struct_string, sinvalid) return @@ -200,91 +190,85 @@ def tearDown(self): self.P = None return - def test_stepcut_calculation(self): - """check calculation of sphere envelope factor - """ - self.P.read_struct(datafile('Ni.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) + """check calculation of sphere envelope factor""" + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.calc() stepcut = 8.0 r = numpy.array(self.P.getR()) G0 = numpy.array(self.P.getpdf_fit()) G0[r > stepcut] = 0.0 - self.P.setvar('stepcut', stepcut) + self.P.setvar("stepcut", stepcut) self.P.calc() G1 = numpy.array(self.P.getpdf_fit()) - dG = (G0 - G1) - msd = numpy.dot(dG, dG)/len(r) + dG = G0 - G1 + msd = numpy.dot(dG, dG) / len(r) self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) return - def test_twophase_stepcut_calculation(self): - """check PDF calculation for 2 phases with different spdiameters - """ + """check PDF calculation for 2 phases with different spdiameters""" d1 = 6 d2 = 9 - self.P.read_struct(datafile('Ni.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) - self.P.setvar('stepcut', d1) + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("stepcut", d1) self.P.calc() G1 = numpy.array(self.P.getpdf_fit()) self.P.reset() - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) - self.P.setvar('stepcut', d2) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("stepcut", d2) self.P.calc() G2 = numpy.array(self.P.getpdf_fit()) self.P.reset() - self.P.read_struct(datafile('Ni.stru')) - self.P.read_struct(datafile('PbScW25TiO3.stru')) - self.P.alloc('X', 0.0, 0.05, 0.1, 10, 200) + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setphase(1) - self.P.setvar('stepcut', d1) + self.P.setvar("stepcut", d1) self.P.setphase(2) - self.P.setvar('stepcut', d2) + self.P.setvar("stepcut", d2) self.P.calc() Gtot = numpy.array(self.P.getpdf_fit()) - dG = (G1 + G2 - Gtot) + dG = G1 + G2 - Gtot r = numpy.array(self.P.getR()) - msd = numpy.dot(dG, dG)/len(r) + msd = numpy.dot(dG, dG) / len(r) self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) # G after step should be zero self.assertTrue(numpy.all(0 == Gtot[r > max(d1, d2)])) return - def test_stepcut_io(self): - """Check reading and writing of stepcut from structure file. - """ + """Check reading and writing of stepcut from structure file.""" import re - self.P.read_struct(datafile('Ni.stru')) - self.assertEqual(0.0, self.P.getvar('stepcut')) + + self.P.read_struct(datafile("Ni.stru")) + self.assertEqual(0.0, self.P.getvar("stepcut")) # engine should not write shape factor when not defined sscnone = self.P.save_struct_string(1) - self.assertTrue(not re.search('(?m)^shape +stepcut,', sscnone)) - self.P.setvar('stepcut', 7) + self.assertTrue(not re.search("(?m)^shape +stepcut,", sscnone)) + self.P.setvar("stepcut", 7) ssc7 = self.P.save_struct_string(1) # ssc7 should contain shape factor data - self.assertTrue(re.search('(?m)^shape +stepcut,', ssc7)) + self.assertTrue(re.search("(?m)^shape +stepcut,", ssc7)) self.P.reset() self.P.read_struct_string(ssc7) - self.assertEqual(7.0, self.P.getvar('stepcut')) + self.assertEqual(7.0, self.P.getvar("stepcut")) # try to read without comma - ssc14 = re.sub('(?m)^shape +stepcut.*$', 'shape stepcut 14.00', ssc7) + ssc14 = re.sub("(?m)^shape +stepcut.*$", "shape stepcut 14.00", ssc7) self.P.read_struct_string(ssc14) - self.assertEqual(14.0, self.P.getvar('stepcut')) + self.assertEqual(14.0, self.P.getvar("stepcut")) # try to read invalid shape data - sinvalid = re.sub('(?m)^shape .*', 'shape invalid, 1', ssc7) - self.assertRaises(pdffit2.structureError, - self.P.read_struct_string, sinvalid) + sinvalid = re.sub("(?m)^shape .*", "shape invalid, 1", ssc7) + self.assertRaises(pdffit2.structureError, self.P.read_struct_string, sinvalid) return # End of class TestStepCutEnvelope -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() # End of file diff --git a/diffpy/pdffit2/tests/__init__.py b/diffpy/pdffit2/tests/__init__.py index 4a21417c..8eca524f 100644 --- a/diffpy/pdffit2/tests/__init__.py +++ b/diffpy/pdffit2/tests/__init__.py @@ -18,8 +18,9 @@ import unittest -def testsuite(pattern=''): - '''Create a unit tests suite for the diffpy.pdffit2 package. + +def testsuite(pattern=""): + """Create a unit tests suite for the diffpy.pdffit2 package. Parameters ---------- @@ -32,30 +33,30 @@ def testsuite(pattern=''): ------- suite : `unittest.TestSuite` The TestSuite object containing the matching tests. - ''' + """ import re from os.path import dirname from itertools import chain from pkg_resources import resource_filename + loader = unittest.defaultTestLoader - thisdir = resource_filename(__name__, '') - depth = __name__.count('.') + 1 + thisdir = resource_filename(__name__, "") + depth = __name__.count(".") + 1 topdir = thisdir for i in range(depth): topdir = dirname(topdir) - suite_all = loader.discover(thisdir, pattern='*Test*.py', - top_level_dir=topdir) + suite_all = loader.discover(thisdir, pattern="*Test*.py", top_level_dir=topdir) # always filter the suite by pattern to test-cover the selection code. suite = unittest.TestSuite() rx = re.compile(pattern) tsuites = list(chain.from_iterable(suite_all)) tsok = all(isinstance(ts, unittest.TestSuite) for ts in tsuites) - if not tsok: # pragma: no cover + if not tsok: # pragma: no cover return suite_all tcases = chain.from_iterable(tsuites) for tc in tcases: - tcwords = tc.id().split('.') - shortname = '.'.join(tcwords[-3:]) + tcwords = tc.id().split(".") + shortname = ".".join(tcwords[-3:]) if rx.search(shortname): suite.addTest(tc) # verify all tests are found for an empty pattern. @@ -64,12 +65,12 @@ def testsuite(pattern=''): def test(): - '''Execute all unit tests for the diffpy.pdffit2 package. + """Execute all unit tests for the diffpy.pdffit2 package. Returns ------- result : `unittest.TestResult` - ''' + """ suite = testsuite() runner = unittest.TextTestRunner() result = runner.run(suite) @@ -77,17 +78,18 @@ def test(): def testdeps(): - '''Execute all unit tests for diffpy.pdffit2 and its dependencies. + """Execute all unit tests for diffpy.pdffit2 and its dependencies. Returns ------- result : `unittest.TestResult` - ''' + """ from importlib import import_module - modulenames = ''' + + modulenames = """ diffpy.pdffit2.tests diffpy.structure.tests - '''.split() + """.split() suite = unittest.TestSuite() for mname in modulenames: mod = import_module(mname) diff --git a/diffpy/pdffit2/tests/debug.py b/diffpy/pdffit2/tests/debug.py index be6e48e4..b99602d4 100644 --- a/diffpy/pdffit2/tests/debug.py +++ b/diffpy/pdffit2/tests/debug.py @@ -23,10 +23,11 @@ """ -if __name__ == '__main__': +if __name__ == "__main__": import sys from diffpy.pdffit2.tests import testsuite - pattern = sys.argv[1] if len(sys.argv) > 1 else '' + + pattern = sys.argv[1] if len(sys.argv) > 1 else "" suite = testsuite(pattern) suite.debug() diff --git a/diffpy/pdffit2/tests/pdffit2testutils.py b/diffpy/pdffit2/tests/pdffit2testutils.py index 18dabf11..c2d82948 100644 --- a/diffpy/pdffit2/tests/pdffit2testutils.py +++ b/diffpy/pdffit2/tests/pdffit2testutils.py @@ -23,22 +23,21 @@ import diffpy.pdffit2 # silence the C++ engine output -diffpy.pdffit2.redirect_stdout(open(os.path.devnull, 'w')) +diffpy.pdffit2.redirect_stdout(open(os.path.devnull, "w")) # path variables -thisfile = locals().get('__file__', 'file.py') +thisfile = locals().get("__file__", "file.py") tests_dir = os.path.dirname(os.path.abspath(thisfile)) -testdata_dir = os.path.join(tests_dir, 'testdata') +testdata_dir = os.path.join(tests_dir, "testdata") + def datafile(filename): - """prepend testdata_dir to filename. - """ + """prepend testdata_dir to filename.""" return os.path.join(testdata_dir, filename) def capture_output(f, *args, **kwargs): - """Capture output from pdffit2 engine produced in function call. - """ + """Capture output from pdffit2 engine produced in function call.""" savestdout = diffpy.pdffit2.output.stdout fp = six.StringIO() diffpy.pdffit2.redirect_stdout(fp) @@ -48,4 +47,5 @@ def capture_output(f, *args, **kwargs): diffpy.pdffit2.redirect_stdout(savestdout) return fp.getvalue() + # End of file diff --git a/diffpy/pdffit2/tests/run.py b/diffpy/pdffit2/tests/run.py index 8519454c..7eb6aadd 100644 --- a/diffpy/pdffit2/tests/run.py +++ b/diffpy/pdffit2/tests/run.py @@ -19,15 +19,18 @@ """ -if __name__ == '__main__': +if __name__ == "__main__": import sys + # show warnings by default if not sys.warnoptions: import os, warnings + warnings.simplefilter("default") # also affect subprocesses os.environ["PYTHONWARNINGS"] = "default" from diffpy.pdffit2.tests import test + # produce zero exit code for a successful test sys.exit(not test().wasSuccessful()) diff --git a/diffpy/pdffit2/tests/rundeps.py b/diffpy/pdffit2/tests/rundeps.py index 9e3c5ee9..420c4d6f 100644 --- a/diffpy/pdffit2/tests/rundeps.py +++ b/diffpy/pdffit2/tests/rundeps.py @@ -19,9 +19,10 @@ """ -if __name__ == '__main__': +if __name__ == "__main__": import sys from diffpy.pdffit2.tests import testdeps + # produce zero exit code for a successful test sys.exit(not testdeps().wasSuccessful()) diff --git a/diffpy/pdffit2/version.py b/diffpy/pdffit2/version.py index e77b09d0..098dcde1 100644 --- a/diffpy/pdffit2/version.py +++ b/diffpy/pdffit2/version.py @@ -22,7 +22,7 @@ Use `__git_commit__` instead. """ -__all__ = ['__date__', '__git_commit__', '__timestamp__', '__version__'] +__all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] import os.path @@ -30,22 +30,22 @@ # obtain version information from the version.cfg file -cp = dict(version='', date='', commit='', timestamp='0') -fcfg = resource_filename(__name__, 'version.cfg') -if not os.path.isfile(fcfg): # pragma: no cover +cp = dict(version="", date="", commit="", timestamp="0") +fcfg = resource_filename(__name__, "version.cfg") +if not os.path.isfile(fcfg): # pragma: no cover from warnings import warn + warn('Package metadata not found, execute "./setup.py egg_info".') fcfg = os.devnull with open(fcfg) as fp: - kwords = [[w.strip() for w in line.split(' = ', 1)] - for line in fp if line[:1].isalpha() and ' = ' in line] + kwords = [[w.strip() for w in line.split(" = ", 1)] for line in fp if line[:1].isalpha() and " = " in line] assert all(w[0] in cp for w in kwords), "received unrecognized keyword" cp.update(kwords) -__version__ = cp['version'] -__date__ = cp['date'] -__git_commit__ = cp['commit'] -__timestamp__ = int(cp['timestamp']) +__version__ = cp["version"] +__date__ = cp["date"] +__git_commit__ = cp["commit"] +__timestamp__ = int(cp["timestamp"]) # TODO remove deprecated __gitsha__ in version 1.3. __gitsha__ = __git_commit__ From 18944da4b3cfd8db81e1b73d3951696805a5fb5a Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 11:44:05 -0400 Subject: [PATCH 005/294] Run black on full package --- conda-recipe/run_test.py | 1 + examples/Ni_calculation.py | 8 +- examples/Ni_plot_pdf.py | 15 ++- examples/Ni_refinement.py | 32 ++--- setup.py | 256 +++++++++++++++++++------------------ 5 files changed, 158 insertions(+), 154 deletions(-) diff --git a/conda-recipe/run_test.py b/conda-recipe/run_test.py index f7099645..1432eed6 100644 --- a/conda-recipe/run_test.py +++ b/conda-recipe/run_test.py @@ -1,4 +1,5 @@ #!/usr/bin/env python import diffpy.pdffit2.tests + assert diffpy.pdffit2.tests.test().wasSuccessful() diff --git a/examples/Ni_calculation.py b/examples/Ni_calculation.py index bfe1e941..fd789c56 100755 --- a/examples/Ni_calculation.py +++ b/examples/Ni_calculation.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -'''Calculate PDF of FCC nickel. Save data to Ni_calculation.cgr. -''' +"""Calculate PDF of FCC nickel. Save data to Ni_calculation.cgr. +""" from diffpy.pdffit2 import PdfFit @@ -11,9 +11,9 @@ # load structure file in PDFFIT or DISCUS format P.read_struct("Ni.stru") -radiation_type = 'X' # x-rays +radiation_type = "X" # x-rays qmax = 30.0 # Q-cutoff used in PDF calculation in 1/A -qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay +qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay rmin = 0.01 # minimum r-value rmax = 30.0 # maximum r-value npts = 3000 # number of points in the r-grid diff --git a/examples/Ni_plot_pdf.py b/examples/Ni_plot_pdf.py index f6019d2a..9b1fd4ad 100755 --- a/examples/Ni_plot_pdf.py +++ b/examples/Ni_plot_pdf.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -'''Calculate PDF of FCC nickel and plot it using matplotlib. -''' +"""Calculate PDF of FCC nickel and plot it using matplotlib. +""" from diffpy.pdffit2 import PdfFit @@ -12,9 +12,9 @@ # load structure file in PDFFIT or DISCUS format P.read_struct("Ni.stru") -radiation_type = 'X' # x-rays +radiation_type = "X" # x-rays qmax = 30.0 # Q-cutoff used in PDF calculation in 1/A -qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay +qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay rmin = 0.01 # minimum r-value rmax = 30.0 # maximum r-value npts = 3000 # number of points in the r-grid @@ -29,10 +29,11 @@ # pylab is matplotlib interface with MATLAB-like plotting commands import pylab + pylab.plot(r, G) -pylab.xlabel(u'r (Å)') -pylab.ylabel(u'G (Å$^{-2}$)') -pylab.title('x-ray PDF of nickel simulated at Qmax = %g' % qmax) +pylab.xlabel(u"r (Å)") +pylab.ylabel(u"G (Å$^{-2}$)") +pylab.title("x-ray PDF of nickel simulated at Qmax = %g" % qmax) # display plot window, this must be the last command in the script pylab.show() diff --git a/examples/Ni_refinement.py b/examples/Ni_refinement.py index 177659d2..2a467cde 100755 --- a/examples/Ni_refinement.py +++ b/examples/Ni_refinement.py @@ -1,9 +1,9 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -'''Perform simple refinement of Ni structure to the experimental x-ray PDF. +"""Perform simple refinement of Ni structure to the experimental x-ray PDF. Save fitted curve, refined structure and results summary. -''' +""" from diffpy.pdffit2 import PdfFit @@ -14,11 +14,11 @@ # Load experimental x-ray PDF data qmax = 30.0 # Q-cutoff used in PDF calculation in 1/A -qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay -pf.read_data('Ni-xray.gr', 'X', qmax, qdamp) +qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay +pf.read_data("Ni-xray.gr", "X", qmax, qdamp) # Load nickel structure, must be in PDFFIT or DISCUS format -pf.read_struct('Ni.stru') +pf.read_struct("Ni.stru") # Configure Refinement ------------------------------------------------------- @@ -31,12 +31,12 @@ pf.setpar(1, pf.lat(1)) # Refine phase scale factor. Right side can have formulas. -pf.constrain('pscale', '@20 * 2') +pf.constrain("pscale", "@20 * 2") pf.setpar(20, pf.getvar(pf.pscale) / 2.0) # Refine PDF damping due to instrument Q-resolution. # Left side can be also passed as a reference to PdfFit object -pf.constrain(pf.qdamp, '@21') +pf.constrain(pf.qdamp, "@21") pf.setpar(21, 0.03) # Refine sharpening factor for correlated motion of close atoms. @@ -45,9 +45,9 @@ # Set all temperature factors isotropic and equal to @4 for idx in range(1, 5): - pf.constrain(pf.u11(idx), '@4') - pf.constrain(pf.u22(idx), '@4') - pf.constrain(pf.u33(idx), '@4') + pf.constrain(pf.u11(idx), "@4") + pf.constrain(pf.u22(idx), "@4") + pf.constrain(pf.u33(idx), "@4") pf.setpar(4, pf.u11(1)) # Refine --------------------------------------------------------------------- @@ -76,13 +76,13 @@ Gdiff = pylab.array(Gobs) - pylab.array(Gfit) Gdiff_baseline = -10 -pylab.plot(r, Gobs, 'ko') -pylab.plot(r, Gfit, 'b-') -pylab.plot(r, Gdiff + Gdiff_baseline, 'r-') +pylab.plot(r, Gobs, "ko") +pylab.plot(r, Gfit, "b-") +pylab.plot(r, Gdiff + Gdiff_baseline, "r-") -pylab.xlabel(u'r (Å)') -pylab.ylabel(u'G (Å$^{-2}$)') -pylab.title('Fit of nickel to x-ray experimental PDF') +pylab.xlabel(u"r (Å)") +pylab.ylabel(u"G (Å$^{-2}$)") +pylab.title("Fit of nickel to x-ray experimental PDF") # display plot window, this must be the last command in the script pylab.show() diff --git a/setup.py b/setup.py index bb6bb72a..70e6c6d5 100755 --- a/setup.py +++ b/setup.py @@ -18,29 +18,30 @@ # Use this version when git data are not available, like in git zip archive. # Update when tagging a new release. -FALLBACK_VERSION = '1.4.2' +FALLBACK_VERSION = "1.4.2" # determine if we run with Python 3. -PY3 = (sys.version_info[0] == 3) +PY3 = sys.version_info[0] == 3 # versioncfgfile holds version data for git commit hash and date. # It must reside in the same directory as version.py. MYDIR = os.path.dirname(os.path.abspath(__file__)) -versioncfgfile = os.path.join(MYDIR, 'diffpy/pdffit2/version.cfg') -gitarchivecfgfile = os.path.join(MYDIR, '.gitarchive.cfg') +versioncfgfile = os.path.join(MYDIR, "diffpy/pdffit2/version.cfg") +gitarchivecfgfile = os.path.join(MYDIR, ".gitarchive.cfg") def gitinfo(): from subprocess import Popen, PIPE, check_output + kw = dict(stdout=PIPE, cwd=MYDIR, universal_newlines=True) - proc = Popen(['git', 'describe', '--tags', '--match=[v,V,[:digit:]]*'], **kw) + proc = Popen(["git", "describe", "--tags", "--match=[v,V,[:digit:]]*"], **kw) desc = proc.stdout.read() - proc = Popen(['git', 'log', '-1', '--format=%H %ct %ci'], **kw) + proc = Popen(["git", "log", "-1", "--format=%H %ct %ci"], **kw) glog = proc.stdout.read() rv = {} - rv['commit'], rv['timestamp'], rv['date'] = glog.strip().split(None, 2) - version = '.post'.join(desc.strip().split('-')[:2]).lstrip('vV') - rv['version'] = version + rv["commit"], rv["timestamp"], rv["date"] = glog.strip().split(None, 2) + version = ".post".join(desc.strip().split("-")[:2]).lstrip("vV") + rv["version"] = version return rv @@ -49,19 +50,19 @@ def getversioncfg(): from configparser import RawConfigParser else: from ConfigParser import RawConfigParser - vd0 = dict(version=FALLBACK_VERSION, commit='', date='', timestamp=0) + vd0 = dict(version=FALLBACK_VERSION, commit="", date="", timestamp=0) # first fetch data from gitarchivecfgfile, ignore if it is unexpanded g = vd0.copy() cp0 = RawConfigParser(vd0) cp0.read(gitarchivecfgfile) - if len(cp0.get('DEFAULT', 'commit')) > 20: + if len(cp0.get("DEFAULT", "commit")) > 20: g = cp0.defaults() - mx = re.search(r'\btag: [vV]?(\d[^,]*)', g.pop('refnames')) + mx = re.search(r"\btag: [vV]?(\d[^,]*)", g.pop("refnames")) if mx: - g['version'] = mx.group(1) + g["version"] = mx.group(1) # then try to obtain version data from git. - gitdir = os.path.join(MYDIR, '.git') - if os.path.exists(gitdir) or 'GIT_DIR' in os.environ: + gitdir = os.path.join(MYDIR, ".git") + if os.path.exists(gitdir) or "GIT_DIR" in os.environ: try: g = gitinfo() except OSError: @@ -71,40 +72,39 @@ def getversioncfg(): cp = RawConfigParser() cp.read(versioncfgfile) d = cp.defaults() - rewrite = not d or (g['commit'] and ( - g['version'] != d.get('version') or g['commit'] != d.get('commit'))) + rewrite = not d or (g["commit"] and (g["version"] != d.get("version") or g["commit"] != d.get("commit"))) if rewrite: - cp.set('DEFAULT', 'version', g['version']) - cp.set('DEFAULT', 'commit', g['commit']) - cp.set('DEFAULT', 'date', g['date']) - cp.set('DEFAULT', 'timestamp', g['timestamp']) - with open(versioncfgfile, 'w') as fp: + cp.set("DEFAULT", "version", g["version"]) + cp.set("DEFAULT", "commit", g["commit"]) + cp.set("DEFAULT", "date", g["date"]) + cp.set("DEFAULT", "timestamp", g["timestamp"]) + with open(versioncfgfile, "w") as fp: cp.write(fp) return cp + versiondata = getversioncfg() # Helper functions ----------------------------------------------------------- + def get_compiler_type(): - """find compiler used for building extensions. - """ - cc_arg = [a for a in sys.argv if a.startswith('--compiler=')] + """find compiler used for building extensions.""" + cc_arg = [a for a in sys.argv if a.startswith("--compiler=")] if cc_arg: - compiler_type = cc_arg[-1].split('=', 1)[1] + compiler_type = cc_arg[-1].split("=", 1)[1] else: from distutils.ccompiler import new_compiler + compiler_type = new_compiler().compiler_type return compiler_type def get_gsl_config(): - '''Return dictionary with paths to GSL library. - ''' - gslcfgpaths = [os.path.join(p, 'gsl-config') - for p in ([MYDIR] + os.environ['PATH'].split(os.pathsep))] + """Return dictionary with paths to GSL library.""" + gslcfgpaths = [os.path.join(p, "gsl-config") for p in ([MYDIR] + os.environ["PATH"].split(os.pathsep))] gslcfgpaths = [p for p in gslcfgpaths if os.path.isfile(p)] - rv = {'include_dirs': [], 'library_dirs': []} + rv = {"include_dirs": [], "library_dirs": []} if not gslcfgpaths: wmsg = "Cannot find gsl-config in {!r} nor in system PATH." warnings.warn(wmsg.format(MYDIR)) @@ -112,41 +112,43 @@ def get_gsl_config(): gslcfg = gslcfgpaths[0] with open(gslcfg) as fp: txt = fp.read() - mprefix = re.search('(?m)^prefix=(.+)', txt) - minclude = re.search(r'(?m)^[^#]*\s-I(\S+)', txt) - mlibpath = re.search(r'(?m)^[^#]*\s-L(\S+)', txt) + mprefix = re.search("(?m)^prefix=(.+)", txt) + minclude = re.search(r"(?m)^[^#]*\s-I(\S+)", txt) + mlibpath = re.search(r"(?m)^[^#]*\s-L(\S+)", txt) if not mprefix: emsg = "Cannot find 'prefix=' line in {}." raise RuntimeError(emsg.format(gslcfg)) p = mprefix.group(1) - inc = minclude.group(1) if minclude else (p + '/include') - lib = mlibpath.group(1) if mlibpath else (p + '/lib') - rv['include_dirs'] += [inc] - rv['library_dirs'] += [lib] + inc = minclude.group(1) if minclude else (p + "/include") + lib = mlibpath.group(1) if mlibpath else (p + "/lib") + rv["include_dirs"] += [inc] + rv["library_dirs"] += [lib] return rv + def get_gsl_config_win(): - '''Return dictionary with paths to GSL library, windwows version. - This version is installed with conda. - ''' - conda_prefix = os.environ['CONDA_PREFIX'] - inc = os.path.join(conda_prefix, 'Library', 'include') - lib = os.path.join(conda_prefix, 'Library', 'lib') - rv = {'include_dirs': [], 'library_dirs': []} - rv['include_dirs'] += [inc] - rv['library_dirs'] += [lib] + """Return dictionary with paths to GSL library, windwows version. + This version is installed with conda. + """ + conda_prefix = os.environ["CONDA_PREFIX"] + inc = os.path.join(conda_prefix, "Library", "include") + lib = os.path.join(conda_prefix, "Library", "lib") + rv = {"include_dirs": [], "library_dirs": []} + rv["include_dirs"] += [inc] + rv["library_dirs"] += [lib] return rv + # ---------------------------------------------------------------------------- # compile and link options define_macros = [] os_name = os.name -if os_name == 'nt': +if os_name == "nt": gcfg = get_gsl_config_win() else: gcfg = get_gsl_config() -include_dirs = [MYDIR] + gcfg['include_dirs'] +include_dirs = [MYDIR] + gcfg["include_dirs"] library_dirs = [] libraries = [] extra_objects = [] @@ -155,102 +157,102 @@ def get_gsl_config_win(): compiler_type = get_compiler_type() if compiler_type in ("unix", "cygwin", "mingw32"): - extra_compile_args = ['-std=c++11', '-Wall', '-Wno-write-strings', - '-O3', '-funroll-loops', '-ffast-math'] - extra_objects += ((p + '/libgsl.a') for p in gcfg['library_dirs']) + extra_compile_args = ["-std=c++11", "-Wall", "-Wno-write-strings", "-O3", "-funroll-loops", "-ffast-math"] + extra_objects += ((p + "/libgsl.a") for p in gcfg["library_dirs"]) elif compiler_type == "msvc": - define_macros += [('_USE_MATH_DEFINES', None)] - extra_compile_args = ['/EHs'] - libraries += ['gsl'] - library_dirs += gcfg['library_dirs'] + define_macros += [("_USE_MATH_DEFINES", None)] + extra_compile_args = ["/EHs"] + libraries += ["gsl"] + library_dirs += gcfg["library_dirs"] # add optimization flags for other compilers if needed # define extension here -pdffit2module = Extension('diffpy.pdffit2.pdffit2', [ - 'pdffit2module/bindings.cc', - 'pdffit2module/misc.cc', - 'pdffit2module/pdffit2module.cc', - 'pdffit2module/pyexceptions.cc', - 'libpdffit2/Atom.cc', - 'libpdffit2/LocalPeriodicTable.cc', - 'libpdffit2/OutputStreams.cc', - 'libpdffit2/PeriodicTable.cc', - 'libpdffit2/PointsInSphere.cc', - 'libpdffit2/StringUtils.cc', - 'libpdffit2/fit.cc', - 'libpdffit2/gaussj.cc', - 'libpdffit2/metric.cc', - 'libpdffit2/nrutil.cc', - 'libpdffit2/output.cc', - 'libpdffit2/parser.cc', - 'libpdffit2/pdf.cc', - 'libpdffit2/pdffit.cc', - 'libpdffit2/pdflsmin.cc', - 'libpdffit2/scatlen.cc', - 'libpdffit2/stru.cc', - ], - include_dirs = include_dirs, - libraries = libraries, - library_dirs = library_dirs, - define_macros = define_macros, - extra_compile_args = extra_compile_args, - extra_link_args = extra_link_args, - extra_objects = extra_objects, +pdffit2module = Extension( + "diffpy.pdffit2.pdffit2", + [ + "pdffit2module/bindings.cc", + "pdffit2module/misc.cc", + "pdffit2module/pdffit2module.cc", + "pdffit2module/pyexceptions.cc", + "libpdffit2/Atom.cc", + "libpdffit2/LocalPeriodicTable.cc", + "libpdffit2/OutputStreams.cc", + "libpdffit2/PeriodicTable.cc", + "libpdffit2/PointsInSphere.cc", + "libpdffit2/StringUtils.cc", + "libpdffit2/fit.cc", + "libpdffit2/gaussj.cc", + "libpdffit2/metric.cc", + "libpdffit2/nrutil.cc", + "libpdffit2/output.cc", + "libpdffit2/parser.cc", + "libpdffit2/pdf.cc", + "libpdffit2/pdffit.cc", + "libpdffit2/pdflsmin.cc", + "libpdffit2/scatlen.cc", + "libpdffit2/stru.cc", + ], + include_dirs=include_dirs, + libraries=libraries, + library_dirs=library_dirs, + define_macros=define_macros, + extra_compile_args=extra_compile_args, + extra_link_args=extra_link_args, + extra_objects=extra_objects, ) -with open(os.path.join(MYDIR, 'README.rst')) as fp: +with open(os.path.join(MYDIR, "README.rst")) as fp: long_description = fp.read() # define distribution setup_args = dict( - name = 'diffpy.pdffit2', - version = versiondata.get('DEFAULT', 'version'), - packages = find_packages(), - test_suite = 'diffpy.pdffit2.tests', - ext_modules = [pdffit2module], - include_package_data = True, - install_requires = [ - 'six', - 'diffpy.structure>=3', + name="diffpy.pdffit2", + version=versiondata.get("DEFAULT", "version"), + packages=find_packages(), + test_suite="diffpy.pdffit2.tests", + ext_modules=[pdffit2module], + include_package_data=True, + install_requires=[ + "six", + "diffpy.structure>=3", ], - zip_safe = False, - - author = 'Simon J.L. Billinge', - author_email = 'sb2896@columbia.edu', - maintainer = 'Pavol Juhas', - maintainer_email = 'pavol.juhas@gmail.com', - url = 'https://github.com/diffpy/diffpy.pdffit2', - description = 'PDFfit2 - real space structure refinement program.', - long_description = long_description, - long_description_content_type = 'text/x-rst', - license = 'BSD', - keywords = 'PDF structure refinement', - classifiers = [ + zip_safe=False, + author="Simon J.L. Billinge", + author_email="sb2896@columbia.edu", + maintainer="Pavol Juhas", + maintainer_email="pavol.juhas@gmail.com", + url="https://github.com/diffpy/diffpy.pdffit2", + description="PDFfit2 - real space structure refinement program.", + long_description=long_description, + long_description_content_type="text/x-rst", + license="BSD", + keywords="PDF structure refinement", + classifiers=[ # List of possible values at # http://pypi.python.org/pypi?:action=list_classifiers - 'Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Operating System :: MacOS', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX', - 'Programming Language :: C++', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Topic :: Scientific/Engineering :: Chemistry', - 'Topic :: Scientific/Engineering :: Physics', + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Programming Language :: C++", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering :: Chemistry", + "Topic :: Scientific/Engineering :: Physics", ], ) -if __name__ == '__main__': +if __name__ == "__main__": setup(**setup_args) # End of file From ff5140df48b4b5873555200143e1ac42eb53e5e7 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 11:45:18 -0400 Subject: [PATCH 006/294] Add flake8 config --- .flake8 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..076b9924 --- /dev/null +++ b/.flake8 @@ -0,0 +1,11 @@ +[flake8] +exclude = + .git, + __pycache__, + build, + dist, + doc/source/conf.py +max-line-length = 115 +# Ignore some style 'errors' produced while formatting by 'black' +# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings +extend-ignore = E203 \ No newline at end of file From 7d76d7dac6c324f70bc038151fbe17a37daf3e08 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 11:56:13 -0400 Subject: [PATCH 007/294] flake8 fixes --- diffpy/pdffit2/pdffit.py | 4 ++-- diffpy/pdffit2/tests/TestPdfFit.py | 5 ++--- diffpy/pdffit2/tests/TestPhaseFractions.py | 3 +-- diffpy/pdffit2/tests/run.py | 3 ++- examples/Ni_plot_pdf.py | 3 +-- examples/Ni_refinement.py | 4 ++-- setup.py | 2 +- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/diffpy/pdffit2/pdffit.py b/diffpy/pdffit2/pdffit.py index e39b6694..cb4f82c9 100644 --- a/diffpy/pdffit2/pdffit.py +++ b/diffpy/pdffit2/pdffit.py @@ -29,6 +29,7 @@ from diffpy.pdffit2 import pdffit2 from diffpy.pdffit2 import output + # helper routines @@ -147,7 +148,7 @@ def intro(): date = __date__[:10] d = {"version": __version__, "date": date, "year": date[:4] or "2019"} msg = __intro_message__ % d - filler = lambda mx: (mx.group(0).rstrip(" *").ljust(77) + "*") + def filler(mx): return mx.group(0).rstrip(" *").ljust(77) + "*" msg_ljust = re.sub("(?m)^(.{1,77}|.{79}.*)$", filler, msg) print(msg_ljust, file=output.stdout) return @@ -1287,7 +1288,6 @@ def __getRef(self, var_string): retval = f(self._handle, arg_int) return retval - # End of class PdfFit diff --git a/diffpy/pdffit2/tests/TestPdfFit.py b/diffpy/pdffit2/tests/TestPdfFit.py index 8102b8b9..43dd2085 100644 --- a/diffpy/pdffit2/tests/TestPdfFit.py +++ b/diffpy/pdffit2/tests/TestPdfFit.py @@ -3,7 +3,6 @@ """Unit tests for PdfFit.py """ - import unittest from diffpy.structure import loadStructure @@ -12,11 +11,11 @@ from diffpy.pdffit2 import pdffit2 from diffpy.pdffit2.tests.pdffit2testutils import datafile, capture_output + # ---------------------------------------------------------------------------- class TestPdfFit(unittest.TestCase): - places = 6 def setUp(self): @@ -291,7 +290,7 @@ def test_num_datasets(self): # failed data should not increase num_datasets try: self.P.read_data(datafile("badNi.dat")) - except: + except (ValueError, IOError): pass self.assertEqual(1, self.P.num_datasets()) # alloc should increase number of datasets diff --git a/diffpy/pdffit2/tests/TestPhaseFractions.py b/diffpy/pdffit2/tests/TestPhaseFractions.py index 2bbebf76..0b90a703 100644 --- a/diffpy/pdffit2/tests/TestPhaseFractions.py +++ b/diffpy/pdffit2/tests/TestPhaseFractions.py @@ -3,15 +3,14 @@ """Unit tests for phase fraction calculations. """ - import unittest from diffpy.pdffit2 import PdfFit from diffpy.pdffit2.tests.pdffit2testutils import datafile + ############################################################################## class TestPhaseFractions(unittest.TestCase): - places = 4 def setUp(self): diff --git a/diffpy/pdffit2/tests/run.py b/diffpy/pdffit2/tests/run.py index 7eb6aadd..790e018d 100644 --- a/diffpy/pdffit2/tests/run.py +++ b/diffpy/pdffit2/tests/run.py @@ -24,7 +24,8 @@ # show warnings by default if not sys.warnoptions: - import os, warnings + import os + import warnings warnings.simplefilter("default") # also affect subprocesses diff --git a/examples/Ni_plot_pdf.py b/examples/Ni_plot_pdf.py index 9b1fd4ad..1f8cb97d 100755 --- a/examples/Ni_plot_pdf.py +++ b/examples/Ni_plot_pdf.py @@ -5,6 +5,7 @@ """ from diffpy.pdffit2 import PdfFit +import pylab # create new PDF calculator object P = PdfFit() @@ -28,8 +29,6 @@ G = P.getpdf_fit() # pylab is matplotlib interface with MATLAB-like plotting commands -import pylab - pylab.plot(r, G) pylab.xlabel(u"r (Å)") pylab.ylabel(u"G (Å$^{-2}$)") diff --git a/examples/Ni_refinement.py b/examples/Ni_refinement.py index 2a467cde..11f6f1ec 100755 --- a/examples/Ni_refinement.py +++ b/examples/Ni_refinement.py @@ -6,6 +6,8 @@ """ from diffpy.pdffit2 import PdfFit +import pylab + # Create new PDF calculator object. pf = PdfFit() @@ -64,8 +66,6 @@ # Plot results --------------------------------------------------------------- # pylab is matplotlib interface with MATLAB-like plotting commands -import pylab - # obtain data from PdfFit calculator object r = pf.getR() Gobs = pf.getpdf_obs() diff --git a/setup.py b/setup.py index 70e6c6d5..6a32d3b1 100755 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def gitinfo(): - from subprocess import Popen, PIPE, check_output + from subprocess import Popen, PIPE kw = dict(stdout=PIPE, cwd=MYDIR, universal_newlines=True) proc = Popen(["git", "describe", "--tags", "--match=[v,V,[:digit:]]*"], **kw) From db1e93630a83e20ea276803988792150fd24c798 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 12:14:06 -0400 Subject: [PATCH 008/294] add further error catching to test_num_datasets --- diffpy/pdffit2/tests/TestPdfFit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diffpy/pdffit2/tests/TestPdfFit.py b/diffpy/pdffit2/tests/TestPdfFit.py index 43dd2085..0a7e944c 100644 --- a/diffpy/pdffit2/tests/TestPdfFit.py +++ b/diffpy/pdffit2/tests/TestPdfFit.py @@ -290,7 +290,7 @@ def test_num_datasets(self): # failed data should not increase num_datasets try: self.P.read_data(datafile("badNi.dat")) - except (ValueError, IOError): + except (RuntimeError, TypeError, NameError, ValueError, IOError): pass self.assertEqual(1, self.P.num_datasets()) # alloc should increase number of datasets From 3577bf0be3819f4677d26a0e0a8c3d82ef74d49e Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 13:04:10 -0400 Subject: [PATCH 009/294] pre-commit fixes --- .flake8 | 2 +- .github/workflows/build.yaml | 2 +- .pre-commit-config.yaml | 43 + CHANGELOG.md | 2 +- devutils/makesdist | 38 +- diffpy/pdffit2/ipy_ext.py | 1 - diffpy/pdffit2/pdffit.py | 6 +- diffpy/pdffit2/tests/ExceptionsTest.py | 3 +- diffpy/pdffit2/tests/TestPdfFit.py | 11 +- diffpy/pdffit2/tests/TestPhaseFractions.py | 4 +- diffpy/pdffit2/tests/__init__.py | 3 +- diffpy/pdffit2/tests/debug.py | 1 + diffpy/pdffit2/tests/pdffit2testutils.py | 2 + diffpy/pdffit2/tests/rundeps.py | 1 + diffpy/pdffit2/tests/testdata/300K.gr | 14 +- diffpy/pdffit2/version.py | 1 - examples/Ni-xray.gr | 4006 ++++++++++---------- examples/Ni_plot_pdf.py | 4 +- examples/Ni_refinement.py | 4 +- pyproject.toml | 2 +- setup.py | 2 +- 21 files changed, 2102 insertions(+), 2050 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.flake8 b/.flake8 index 076b9924..2d2cb168 100644 --- a/.flake8 +++ b/.flake8 @@ -8,4 +8,4 @@ exclude = max-line-length = 115 # Ignore some style 'errors' produced while formatting by 'black' # https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings -extend-ignore = E203 \ No newline at end of file +extend-ignore = E203 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 82adbdc8..9f8369e5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -59,7 +59,7 @@ jobs: # This step will upload tagged commits to pypi. # The pypi token must be added to GH secrets - # + # # - name: Publish package # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') # uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..377da527 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,43 @@ +default_language_version: + 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 +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + exclude: '\.(rst|txt)$' + - repo: https://github.com/psf/black + rev: 24.4.2 + hooks: + - id: black + - repo: https://github.com/pycqa/flake8 + rev: 7.0.0 + hooks: + - id: flake8 + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + args: ["--profile", "black"] + - repo: https://github.com/kynan/nbstripout + rev: 0.7.1 + hooks: + - id: nbstripout + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: no-commit-to-branch + name: Prevent Commit to Main Branch + args: ["--branch", "main"] + #stages: [pre-commit] \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b77944e4..b101ecc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,5 +13,5 @@ No notable functional changes from 1.4.1 ### Deprecated ### Removed - + ### Fixed diff --git a/devutils/makesdist b/devutils/makesdist index 6aaae616..e77257ea 100755 --- a/devutils/makesdist +++ b/devutils/makesdist @@ -1,51 +1,57 @@ #!/usr/bin/env python -'''Create source distribution tar.gz archive, where each file belongs +"""Create source distribution tar.gz archive, where each file belongs to a root user and modification time is set to the git commit time. -''' +""" -import sys +import glob +import gzip import os import subprocess -import glob +import sys import tarfile -import gzip BASEDIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0, BASEDIR) -from setup import versiondata, FALLBACK_VERSION -timestamp = versiondata.getint('DEFAULT', 'timestamp') +from setup import FALLBACK_VERSION, versiondata -vfb = versiondata.get('DEFAULT', 'version').split('.post')[0] + '.post0' +timestamp = versiondata.getint("DEFAULT", "timestamp") + +vfb = versiondata.get("DEFAULT", "version").split(".post")[0] + ".post0" emsg = "Invalid FALLBACK_VERSION. Expected %r got %r." assert vfb == FALLBACK_VERSION, emsg % (vfb, FALLBACK_VERSION) + def inform(s): sys.stdout.write(s) sys.stdout.flush() return + inform('Run "setup.py sdist --formats=tar" ') -cmd_sdist = [sys.executable] + 'setup.py sdist --formats=tar'.split() -ec = subprocess.call(cmd_sdist, cwd=BASEDIR, stdout=open(os.devnull, 'w')) -if ec: sys.exit(ec) +cmd_sdist = [sys.executable] + "setup.py sdist --formats=tar".split() +ec = subprocess.call(cmd_sdist, cwd=BASEDIR, stdout=open(os.devnull, "w")) +if ec: + sys.exit(ec) inform("[done]\n") -tarname = max(glob.glob(BASEDIR + '/dist/*.tar'), key=os.path.getmtime) +tarname = max(glob.glob(BASEDIR + "/dist/*.tar"), key=os.path.getmtime) tfin = tarfile.open(tarname) -fpout = gzip.GzipFile(tarname + '.gz', 'w', mtime=0) -tfout = tarfile.open(fileobj=fpout, mode='w') +fpout = gzip.GzipFile(tarname + ".gz", "w", mtime=0) +tfout = tarfile.open(fileobj=fpout, mode="w") + def fixtarinfo(tinfo): tinfo.uid = tinfo.gid = 0 - tinfo.uname = tinfo.gname = 'root' + tinfo.uname = tinfo.gname = "root" tinfo.mtime = timestamp tinfo.mode &= ~0o022 return tinfo -inform('Filter %s --> %s.gz ' % (2 * (os.path.basename(tarname),))) + +inform("Filter %s --> %s.gz " % (2 * (os.path.basename(tarname),))) for ti in tfin: tfout.addfile(fixtarinfo(ti), tfin.extractfile(ti)) diff --git a/diffpy/pdffit2/ipy_ext.py b/diffpy/pdffit2/ipy_ext.py index df8bc537..dd96b7bf 100644 --- a/diffpy/pdffit2/ipy_ext.py +++ b/diffpy/pdffit2/ipy_ext.py @@ -54,7 +54,6 @@ def showfit(self, offset=None): No return value. """ from matplotlib.pyplot import gca - from math import floor cr = self.r cGobs = self.Gobs diff --git a/diffpy/pdffit2/pdffit.py b/diffpy/pdffit2/pdffit.py index cb4f82c9..43685ad1 100644 --- a/diffpy/pdffit2/pdffit.py +++ b/diffpy/pdffit2/pdffit.py @@ -148,7 +148,10 @@ def intro(): date = __date__[:10] d = {"version": __version__, "date": date, "year": date[:4] or "2019"} msg = __intro_message__ % d - def filler(mx): return mx.group(0).rstrip(" *").ljust(77) + "*" + + def filler(mx): + return mx.group(0).rstrip(" *").ljust(77) + "*" + msg_ljust = re.sub("(?m)^(.{1,77}|.{79}.*)$", filler, msg) print(msg_ljust, file=output.stdout) return @@ -1288,6 +1291,7 @@ def __getRef(self, var_string): retval = f(self._handle, arg_int) return retval + # End of class PdfFit diff --git a/diffpy/pdffit2/tests/ExceptionsTest.py b/diffpy/pdffit2/tests/ExceptionsTest.py index a88decbe..5dee1b75 100644 --- a/diffpy/pdffit2/tests/ExceptionsTest.py +++ b/diffpy/pdffit2/tests/ExceptionsTest.py @@ -16,8 +16,7 @@ import unittest -from diffpy.pdffit2 import PdfFit -from diffpy.pdffit2 import pdffit2 +from diffpy.pdffit2 import PdfFit, pdffit2 from diffpy.pdffit2.tests.pdffit2testutils import datafile diff --git a/diffpy/pdffit2/tests/TestPdfFit.py b/diffpy/pdffit2/tests/TestPdfFit.py index 0a7e944c..70712356 100644 --- a/diffpy/pdffit2/tests/TestPdfFit.py +++ b/diffpy/pdffit2/tests/TestPdfFit.py @@ -5,13 +5,10 @@ import unittest +from diffpy.pdffit2 import PdfFit, pdffit2 +from diffpy.pdffit2.tests.pdffit2testutils import capture_output, datafile from diffpy.structure import loadStructure -from diffpy.pdffit2 import PdfFit -from diffpy.pdffit2 import pdffit2 -from diffpy.pdffit2.tests.pdffit2testutils import datafile, capture_output - - # ---------------------------------------------------------------------------- @@ -324,7 +321,7 @@ def test_getcrw(self): self.assertAlmostEqual(self.P.getrw(), rw19, self.places) # renormalize cumulative Rw and compare with Rw at r=15 Gobs19 = numpy.array(self.P.getpdf_obs()) - Gnorm19 = numpy.sqrt(numpy.sum(Gobs19 ** 2)) + Gnorm19 = numpy.sqrt(numpy.sum(Gobs19**2)) r = numpy.array(self.P.getR()) idx = numpy.nonzero(r <= 15)[0] Gnorm15 = numpy.sqrt(numpy.sum(Gobs19[idx] ** 2)) @@ -353,7 +350,7 @@ def test_getcrw_two_datasets(self): rw1 = self.P.getcrw()[-1] self.P.setdata(2) rw2 = self.P.getcrw()[-1] - self.assertAlmostEqual(rwtot ** 2, rw1 ** 2 + rw2 ** 2, self.places) + self.assertAlmostEqual(rwtot**2, rw1**2 + rw2**2, self.places) return # def test_getpar(self): diff --git a/diffpy/pdffit2/tests/TestPhaseFractions.py b/diffpy/pdffit2/tests/TestPhaseFractions.py index 0b90a703..afc57c06 100644 --- a/diffpy/pdffit2/tests/TestPhaseFractions.py +++ b/diffpy/pdffit2/tests/TestPhaseFractions.py @@ -29,7 +29,7 @@ def test_xray_fractions(self): """test_xray_fractions -- check phase fractions in x-ray dataset.""" self.P.setdata(1) ph = self.P.phase_fractions() - bb1 = 28 ** 2 + bb1 = 28**2 bb2 = ((8 * 82 + 24 * 8 + 4 * 21 + 2 * 74 + 2 * 22) / 40.0) ** 2 self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) @@ -57,7 +57,7 @@ def test_neutron_fractions(self): """test_neutron_fractions -- check phase fractions in neutron dataset.""" self.P.setdata(2) ph = self.P.phase_fractions() - bb1 = 10.31 ** 2 + bb1 = 10.31**2 bPb = 9.4012 bO = 5.8054 bSc = 12.11 diff --git a/diffpy/pdffit2/tests/__init__.py b/diffpy/pdffit2/tests/__init__.py index 8eca524f..e01060cf 100644 --- a/diffpy/pdffit2/tests/__init__.py +++ b/diffpy/pdffit2/tests/__init__.py @@ -35,8 +35,9 @@ def testsuite(pattern=""): The TestSuite object containing the matching tests. """ import re - from os.path import dirname from itertools import chain + from os.path import dirname + from pkg_resources import resource_filename loader = unittest.defaultTestLoader diff --git a/diffpy/pdffit2/tests/debug.py b/diffpy/pdffit2/tests/debug.py index b99602d4..83074005 100644 --- a/diffpy/pdffit2/tests/debug.py +++ b/diffpy/pdffit2/tests/debug.py @@ -25,6 +25,7 @@ if __name__ == "__main__": import sys + from diffpy.pdffit2.tests import testsuite pattern = sys.argv[1] if len(sys.argv) > 1 else "" diff --git a/diffpy/pdffit2/tests/pdffit2testutils.py b/diffpy/pdffit2/tests/pdffit2testutils.py index c2d82948..ce61aa16 100644 --- a/diffpy/pdffit2/tests/pdffit2testutils.py +++ b/diffpy/pdffit2/tests/pdffit2testutils.py @@ -19,7 +19,9 @@ import os.path + import six + import diffpy.pdffit2 # silence the C++ engine output diff --git a/diffpy/pdffit2/tests/rundeps.py b/diffpy/pdffit2/tests/rundeps.py index 420c4d6f..038475ae 100644 --- a/diffpy/pdffit2/tests/rundeps.py +++ b/diffpy/pdffit2/tests/rundeps.py @@ -21,6 +21,7 @@ if __name__ == "__main__": import sys + from diffpy.pdffit2.tests import testdeps # produce zero exit code for a successful test diff --git a/diffpy/pdffit2/tests/testdata/300K.gr b/diffpy/pdffit2/tests/testdata/300K.gr index 7a6c0968..15578911 100644 --- a/diffpy/pdffit2/tests/testdata/300K.gr +++ b/diffpy/pdffit2/tests/testdata/300K.gr @@ -1,5 +1,5 @@ History written: Fri Apr 30 13:05:36 2004 -produced by +produced by ##### Run Information runCorrection=T prep=gsas machine=npdf run=300K background=npdf_00907 @@ -27,12 +27,12 @@ density= effDensity=3.4138 ##### Banks=6 deltaQ=0.01 matchRef=0 matchScal=T matchOffset=T bank angle blendQmin blendQmax (0.0 means no info) - 1 90.0 1.62 29.42 - 2 -90.0 1.62 29.42 - 3 119.0 1.97 35.85 - 4 -119.0 1.97 35.85 - 5 148.0 2.20 40.00 - 6 -148.0 2.20 40.00 + 1 90.0 1.62 29.42 + 2 -90.0 1.62 29.42 + 3 119.0 1.97 35.85 + 4 -119.0 1.97 35.85 + 5 148.0 2.20 40.00 + 6 -148.0 2.20 40.00 ##### Program Specific Information ## Ft calcError=1 (1 for true, 0 for false) diff --git a/diffpy/pdffit2/version.py b/diffpy/pdffit2/version.py index 098dcde1..0e60302c 100644 --- a/diffpy/pdffit2/version.py +++ b/diffpy/pdffit2/version.py @@ -28,7 +28,6 @@ from pkg_resources import resource_filename - # obtain version information from the version.cfg file cp = dict(version="", date="", commit="", timestamp="0") fcfg = resource_filename(__name__, "version.cfg") diff --git a/examples/Ni-xray.gr b/examples/Ni-xray.gr index 14193844..76b7a94f 100644 --- a/examples/Ni-xray.gr +++ b/examples/Ni-xray.gr @@ -26,7 +26,7 @@ sambkgfile= num_sambkgs=1 confile= num_cons=1 conbkgfile= num_conbkgs=1 det# used xcol detcol deterrcol xmin xmax add_det mul_det add_bkg mul_bkg add_con mul_con add_conbkg mul_conbkg - 0 1 0 1 3 0.00000 35.0000 0.00000 1.00000 0.00000 0.998691 0.00000 1.00000 0.00000 1.00000 + 0 1 0 1 3 0.00000 35.0000 0.00000 1.00000 0.00000 0.998691 0.00000 1.00000 0.00000 1.00000 ##### Experiment_Setup title=Ni at 300K with MAR345 Image Plate at 6-ID-DAPS Synchrotron @@ -128,2007 +128,2007 @@ gropttype=OptFq miscdatatype=AtomASF ##### start data #F Ni_2-8.chi.gr #D Tue Feb 8 11:46:14 2005 -#C +#C #S 1 G(r) -#D +#D #L r G(r) d_r d_Gr - 1.000000e-02 -7.734561e-02 -1.381170e-02 3.134926e-02 - 2.000000e-02 -1.596764e-01 -2.762339e-02 6.045792e-02 - 3.000000e-02 -2.516875e-01 -4.143509e-02 8.526468e-02 - 4.000000e-02 -3.575096e-01 -5.524679e-02 1.040541e-01 - 5.000000e-02 -4.804651e-01 -6.905849e-02 1.155991e-01 - 6.000000e-02 -6.228668e-01 -8.287018e-02 1.192732e-01 - 7.000000e-02 -7.858705e-01 -9.668188e-02 1.151330e-01 - 8.000000e-02 -9.693874e-01 -1.104936e-01 1.039918e-01 - 9.000000e-02 -1.172061e+00 -1.243053e-01 8.755577e-02 - 1.000000e-01 -1.391306e+00 -1.381170e-01 6.884717e-02 - 1.100000e-01 -1.623409e+00 -1.519287e-01 5.341991e-02 - 1.200000e-01 -1.863680e+00 -1.657404e-01 4.979434e-02 - 1.300000e-01 -2.106649e+00 -1.795521e-01 6.017895e-02 - 1.400000e-01 -2.346295e+00 -1.933638e-01 7.640497e-02 - 1.500000e-01 -2.576293e+00 -2.071755e-01 9.161881e-02 - 1.600000e-01 -2.790268e+00 -2.209872e-01 1.024655e-01 - 1.700000e-01 -2.982047e+00 -2.347989e-01 1.074539e-01 - 1.800000e-01 -3.145891e+00 -2.486105e-01 1.062389e-01 - 1.900000e-01 -3.276707e+00 -2.624222e-01 9.942805e-02 - 2.000000e-01 -3.370223e+00 -2.762339e-01 8.860376e-02 - 2.100000e-01 -3.423130e+00 -2.900456e-01 7.650761e-02 - 2.200000e-01 -3.433181e+00 -3.038573e-01 6.719764e-02 - 2.300000e-01 -3.399254e+00 -3.176690e-01 6.493149e-02 - 2.400000e-01 -3.321377e+00 -3.314807e-01 7.061632e-02 - 2.500000e-01 -3.200715e+00 -3.452924e-01 8.074527e-02 - 2.600000e-01 -3.039527e+00 -3.591041e-01 9.101665e-02 - 2.700000e-01 -2.841094e+00 -3.729158e-01 9.850821e-02 - 2.800000e-01 -2.609626e+00 -3.867275e-01 1.017102e-01 - 2.900000e-01 -2.350147e+00 -4.005392e-01 1.002266e-01 - 3.000000e-01 -2.068363e+00 -4.143509e-01 9.462396e-02 - 3.100000e-01 -1.770519e+00 -4.281626e-01 8.640470e-02 - 3.200000e-01 -1.463237e+00 -4.419743e-01 7.800773e-02 - 3.300000e-01 -1.153355e+00 -4.557860e-01 7.249483e-02 - 3.400000e-01 -8.477479e-01 -4.695977e-01 7.224522e-02 - 3.500000e-01 -5.531450e-01 -4.834094e-01 7.713224e-02 - 3.600000e-01 -2.759477e-01 -4.972211e-01 8.467203e-02 - 3.700000e-01 -2.204310e-02 -5.110328e-01 9.195493e-02 - 3.800000e-01 2.033757e-01 -5.248445e-01 9.686320e-02 - 3.900000e-01 3.959788e-01 -5.386562e-01 9.828977e-02 - 4.000000e-01 5.524508e-01 -5.524679e-01 9.606310e-02 - 4.100000e-01 6.706182e-01 -5.662796e-01 9.087598e-02 - 4.200000e-01 7.495432e-01 -5.800913e-01 8.423689e-02 - 4.300000e-01 7.895774e-01 -5.939030e-01 7.831796e-02 - 4.400000e-01 7.923692e-01 -6.077147e-01 7.538431e-02 - 4.500000e-01 7.608195e-01 -6.215264e-01 7.662821e-02 - 4.600000e-01 6.989824e-01 -6.353381e-01 8.131523e-02 - 4.700000e-01 6.119129e-01 -6.491498e-01 8.737928e-02 - 4.800000e-01 5.054623e-01 -6.629615e-01 9.267455e-02 - 4.900000e-01 3.860302e-01 -6.767732e-01 9.569092e-02 - 5.000000e-01 2.602819e-01 -6.905849e-01 9.573000e-02 - 5.100000e-01 1.348438e-01 -7.043966e-01 9.289354e-02 - 5.200000e-01 1.599279e-02 -7.182083e-01 8.803723e-02 - 5.300000e-01 -9.064421e-02 -7.320200e-01 8.267435e-02 - 5.400000e-01 -1.803637e-01 -7.458316e-01 7.868367e-02 - 5.500000e-01 -2.496148e-01 -7.596433e-01 7.762463e-02 - 5.600000e-01 -2.961697e-01 -7.734550e-01 7.986113e-02 - 5.700000e-01 -3.192238e-01 -7.872667e-01 8.433275e-02 - 5.800000e-01 -3.194177e-01 -8.010784e-01 8.926692e-02 - 5.900000e-01 -2.987769e-01 -8.148901e-01 9.303294e-02 - 6.000000e-01 -2.605717e-01 -8.287018e-01 9.458206e-02 - 6.100000e-01 -2.091040e-01 -8.425135e-01 9.356811e-02 - 6.200000e-01 -1.494329e-01 -8.563252e-01 9.034444e-02 - 6.300000e-01 -8.705466e-02 -8.701369e-01 8.590452e-02 - 6.400000e-01 -2.755745e-02 -8.839486e-01 8.171553e-02 - 6.500000e-01 2.372868e-02 -8.977603e-01 7.931299e-02 - 6.600000e-01 6.206366e-02 -9.115720e-01 7.962749e-02 - 6.700000e-01 8.359014e-02 -9.253837e-01 8.244920e-02 - 6.800000e-01 8.556789e-02 -9.391954e-01 8.658046e-02 - 6.900000e-01 6.653458e-02 -9.530071e-01 9.051104e-02 - 7.000000e-01 2.638255e-02 -9.668188e-01 9.300732e-02 - 7.100000e-01 -3.365350e-02 -9.806305e-01 9.339048e-02 - 7.200000e-01 -1.110967e-01 -9.944422e-01 9.161189e-02 - 7.300000e-01 -2.024086e-01 -1.008254e+00 8.823550e-02 - 7.400000e-01 -3.032383e-01 -1.022066e+00 8.434109e-02 - 7.500000e-01 -4.087215e-01 -1.035877e+00 8.127899e-02 - 7.600000e-01 -5.138097e-01 -1.049689e+00 8.019975e-02 - 7.700000e-01 -6.136058e-01 -1.063501e+00 8.149425e-02 - 7.800000e-01 -7.036833e-01 -1.077312e+00 8.457797e-02 - 7.900000e-01 -7.803670e-01 -1.091124e+00 8.824255e-02 - 8.000000e-01 -8.409562e-01 -1.104936e+00 9.123004e-02 - 8.100000e-01 -8.838756e-01 -1.118747e+00 9.263856e-02 - 8.200000e-01 -9.087437e-01 -1.132559e+00 9.209884e-02 - 8.300000e-01 -9.163567e-01 -1.146371e+00 8.981209e-02 - 8.400000e-01 -9.085893e-01 -1.160183e+00 8.650416e-02 - 8.500000e-01 -8.882216e-01 -1.173994e+00 8.327654e-02 - 8.600000e-01 -8.587063e-01 -1.187806e+00 8.129051e-02 - 8.700000e-01 -8.238944e-01 -1.201618e+00 8.129498e-02 - 8.800000e-01 -7.877398e-01 -1.215429e+00 8.324441e-02 - 8.900000e-01 -7.540061e-01 -1.229241e+00 8.633665e-02 - 9.000000e-01 -7.259969e-01 -1.243053e+00 8.943578e-02 - 9.100000e-01 -7.063286e-01 -1.256864e+00 9.152907e-02 - 9.200000e-01 -6.967632e-01 -1.270676e+00 9.200378e-02 - 9.300000e-01 -6.981108e-01 -1.284488e+00 9.075509e-02 - 9.400000e-01 -7.102095e-01 -1.298300e+00 8.818933e-02 - 9.500000e-01 -7.319798e-01 -1.312111e+00 8.513983e-02 - 9.600000e-01 -7.615502e-01 -1.325923e+00 8.266016e-02 - 9.700000e-01 -7.964408e-01 -1.339735e+00 8.166394e-02 - 9.800000e-01 -8.337897e-01 -1.353546e+00 8.251468e-02 - 9.900000e-01 -8.706036e-01 -1.367358e+00 8.484194e-02 - 1.000000e-00 -9.040117e-01 -1.381170e+00 8.774748e-02 - 1.010000e+00 -9.315033e-01 -1.394981e+00 9.021996e-02 - 1.020000e+00 -9.511296e-01 -1.408793e+00 9.148261e-02 - 1.030000e+00 -9.616553e-01 -1.422605e+00 9.117828e-02 - 1.040000e+00 -9.626475e-01 -1.436417e+00 8.942710e-02 - 1.050000e+00 -9.544971e-01 -1.450228e+00 8.679399e-02 - 1.060000e+00 -9.383712e-01 -1.464040e+00 8.415952e-02 - 1.070000e+00 -9.161027e-01 -1.477852e+00 8.246149e-02 - 1.080000e+00 -8.900263e-01 -1.491663e+00 8.233013e-02 - 1.090000e+00 -8.627749e-01 -1.505475e+00 8.378993e-02 - 1.100000e+00 -8.370557e-01 -1.519287e+00 8.625490e-02 - 1.110000e+00 -8.154227e-01 -1.533098e+00 8.882170e-02 - 1.120000e+00 -8.000647e-01 -1.546910e+00 9.063428e-02 - 1.130000e+00 -7.926282e-01 -1.560722e+00 9.113887e-02 - 1.140000e+00 -7.940862e-01 -1.574533e+00 9.020245e-02 - 1.150000e+00 -8.046667e-01 -1.588345e+00 8.812929e-02 - 1.160000e+00 -8.238427e-01 -1.602157e+00 8.559113e-02 - 1.170000e+00 -8.503875e-01 -1.615969e+00 8.345275e-02 - 1.180000e+00 -8.824866e-01 -1.629780e+00 8.248185e-02 - 1.190000e+00 -9.178991e-01 -1.643592e+00 8.302436e-02 - 1.200000e+00 -9.541530e-01 -1.657404e+00 8.484068e-02 - 1.210000e+00 -9.887581e-01 -1.671215e+00 8.723378e-02 - 1.220000e+00 -1.019420e+00 -1.685027e+00 8.936506e-02 - 1.230000e+00 -1.044233e+00 -1.698839e+00 9.055378e-02 - 1.240000e+00 -1.061845e+00 -1.712650e+00 9.045794e-02 - 1.250000e+00 -1.071566e+00 -1.726462e+00 8.914106e-02 - 1.260000e+00 -1.073431e+00 -1.740274e+00 8.704942e-02 - 1.270000e+00 -1.068188e+00 -1.754086e+00 8.489959e-02 - 1.280000e+00 -1.057242e+00 -1.767897e+00 8.346229e-02 - 1.290000e+00 -1.042527e+00 -1.781709e+00 8.327095e-02 - 1.300000e+00 -1.026351e+00 -1.795521e+00 8.438368e-02 - 1.310000e+00 -1.011191e+00 -1.809332e+00 8.636090e-02 - 1.320000e+00 -9.994919e-01 -1.823144e+00 8.847613e-02 - 1.330000e+00 -9.934586e-01 -1.836956e+00 9.000844e-02 - 1.340000e+00 -9.948682e-01 -1.850767e+00 9.047021e-02 - 1.350000e+00 -1.004922e+00 -1.864579e+00 8.972635e-02 - 1.360000e+00 -1.024143e+00 -1.878391e+00 8.801881e-02 - 1.370000e+00 -1.052329e+00 -1.892203e+00 8.590676e-02 - 1.380000e+00 -1.088569e+00 -1.906014e+00 8.411382e-02 - 1.390000e+00 -1.131312e+00 -1.919826e+00 8.328369e-02 - 1.400000e+00 -1.178493e+00 -1.933638e+00 8.371558e-02 - 1.410000e+00 -1.227697e+00 -1.947449e+00 8.522786e-02 - 1.420000e+00 -1.276352e+00 -1.961261e+00 8.724927e-02 - 1.430000e+00 -1.321931e+00 -1.975073e+00 8.906920e-02 - 1.440000e+00 -1.362151e+00 -1.988884e+00 9.009276e-02 - 1.450000e+00 -1.395148e+00 -2.002696e+00 9.000846e-02 - 1.460000e+00 -1.419612e+00 -2.016508e+00 8.885776e-02 - 1.470000e+00 -1.434881e+00 -2.030319e+00 8.702023e-02 - 1.480000e+00 -1.440976e+00 -2.044131e+00 8.511516e-02 - 1.490000e+00 -1.438578e+00 -2.057943e+00 8.381334e-02 - 1.500000e+00 -1.428952e+00 -2.071755e+00 8.358812e-02 - 1.510000e+00 -1.413823e+00 -2.085566e+00 8.451113e-02 - 1.520000e+00 -1.395219e+00 -2.099378e+00 8.622309e-02 - 1.530000e+00 -1.375288e+00 -2.113190e+00 8.810063e-02 - 1.540000e+00 -1.356109e+00 -2.127001e+00 8.950526e-02 - 1.550000e+00 -1.339521e+00 -2.140813e+00 8.998983e-02 - 1.560000e+00 -1.326967e+00 -2.154625e+00 8.941412e-02 - 1.570000e+00 -1.319389e+00 -2.168436e+00 8.797326e-02 - 1.580000e+00 -1.317160e+00 -2.182248e+00 8.614643e-02 - 1.590000e+00 -1.320081e+00 -2.196060e+00 8.456224e-02 - 1.600000e+00 -1.327421e+00 -2.209872e+00 8.378773e-02 - 1.610000e+00 -1.338016e+00 -2.223683e+00 8.410190e-02 - 1.620000e+00 -1.350401e+00 -2.237495e+00 8.537324e-02 - 1.630000e+00 -1.362974e+00 -2.251307e+00 8.712414e-02 - 1.640000e+00 -1.374170e+00 -2.265118e+00 8.873653e-02 - 1.650000e+00 -1.382635e+00 -2.278930e+00 8.967598e-02 - 1.660000e+00 -1.387368e+00 -2.292742e+00 8.964903e-02 - 1.670000e+00 -1.387843e+00 -2.306553e+00 8.867411e-02 - 1.680000e+00 -1.384077e+00 -2.320365e+00 8.707293e-02 - 1.690000e+00 -1.376637e+00 -2.334177e+00 8.538419e-02 - 1.700000e+00 -1.366606e+00 -2.347989e+00 8.419842e-02 - 1.710000e+00 -1.355480e+00 -2.361800e+00 8.394229e-02 - 1.720000e+00 -1.345031e+00 -2.375612e+00 8.470005e-02 - 1.730000e+00 -1.337123e+00 -2.389424e+00 8.617890e-02 - 1.740000e+00 -1.333527e+00 -2.403235e+00 8.784186e-02 - 1.750000e+00 -1.335716e+00 -2.417047e+00 8.912123e-02 - 1.760000e+00 -1.344696e+00 -2.430859e+00 8.960623e-02 - 1.770000e+00 -1.360861e+00 -2.444670e+00 8.915473e-02 - 1.780000e+00 -1.383901e+00 -2.458482e+00 8.792463e-02 - 1.790000e+00 -1.412776e+00 -2.472294e+00 8.633026e-02 - 1.800000e+00 -1.445754e+00 -2.486105e+00 8.492298e-02 - 1.810000e+00 -1.480514e+00 -2.499917e+00 8.420620e-02 - 1.820000e+00 -1.514312e+00 -2.513729e+00 8.443860e-02 - 1.830000e+00 -1.544202e+00 -2.527541e+00 8.552365e-02 - 1.840000e+00 -1.567278e+00 -2.541352e+00 8.705601e-02 - 1.850000e+00 -1.580939e+00 -2.555164e+00 8.849338e-02 - 1.860000e+00 -1.583140e+00 -2.568976e+00 8.935436e-02 - 1.870000e+00 -1.572609e+00 -2.582787e+00 8.936496e-02 - 1.880000e+00 -1.549013e+00 -2.596599e+00 8.852906e-02 - 1.890000e+00 -1.513057e+00 -2.610411e+00 8.712423e-02 - 1.900000e+00 -1.466490e+00 -2.624222e+00 8.562504e-02 - 1.910000e+00 -1.412034e+00 -2.638034e+00 8.455578e-02 - 1.920000e+00 -1.353220e+00 -2.651846e+00 8.430059e-02 - 1.930000e+00 -1.294150e+00 -2.665658e+00 8.494598e-02 - 1.940000e+00 -1.239192e+00 -2.679469e+00 8.624521e-02 - 1.950000e+00 -1.192639e+00 -2.693281e+00 8.772760e-02 - 1.960000e+00 -1.158358e+00 -2.707093e+00 8.888395e-02 - 1.970000e+00 -1.139441e+00 -2.720904e+00 8.933725e-02 - 1.980000e+00 -1.137915e+00 -2.734716e+00 8.894918e-02 - 1.990000e+00 -1.154511e+00 -2.748528e+00 8.785320e-02 - 2.000000e+00 -1.188531e+00 -2.762339e+00 8.641699e-02 - 2.010000e+00 -1.237823e+00 -2.776151e+00 8.513478e-02 - 2.020000e+00 -1.298870e+00 -2.789963e+00 8.446166e-02 - 2.030000e+00 -1.366998e+00 -2.803775e+00 8.463800e-02 - 2.040000e+00 -1.436686e+00 -2.817586e+00 8.558855e-02 - 2.050000e+00 -1.501962e+00 -2.831398e+00 8.695755e-02 - 2.060000e+00 -1.556856e+00 -2.845210e+00 8.825708e-02 - 2.070000e+00 -1.595879e+00 -2.859021e+00 8.904528e-02 - 2.080000e+00 -1.614491e+00 -2.872833e+00 8.906364e-02 - 2.090000e+00 -1.609514e+00 -2.886645e+00 8.830655e-02 - 2.100000e+00 -1.579460e+00 -2.900456e+00 8.702107e-02 - 2.110000e+00 -1.524741e+00 -2.914268e+00 8.563829e-02 - 2.120000e+00 -1.447736e+00 -2.928080e+00 8.463963e-02 - 2.130000e+00 -1.352693e+00 -2.941891e+00 8.438444e-02 - 2.140000e+00 -1.245484e+00 -2.955703e+00 8.496517e-02 - 2.150000e+00 -1.133191e+00 -2.969515e+00 8.616936e-02 - 2.160000e+00 -1.023574e+00 -2.983327e+00 8.757206e-02 - 2.170000e+00 -9.244251e-01 -2.997138e+00 8.870195e-02 - 2.180000e+00 -8.428719e-01 -3.010950e+00 8.920000e-02 - 2.190000e+00 -7.846657e-01 -3.024762e+00 8.892219e-02 - 2.200000e+00 -7.535071e-01 -3.038573e+00 8.797447e-02 - 2.210000e+00 -7.504647e-01 -3.052385e+00 8.668116e-02 - 2.220000e+00 -7.735306e-01 -3.066197e+00 8.548894e-02 - 2.230000e+00 -8.173576e-01 -3.080008e+00 8.481846e-02 - 2.240000e+00 -8.732071e-01 -3.093820e+00 8.490579e-02 - 2.250000e+00 -9.291271e-01 -3.107632e+00 8.570642e-02 - 2.260000e+00 -9.703641e-01 -3.121444e+00 8.691730e-02 - 2.270000e+00 -9.799987e-01 -3.135255e+00 8.810312e-02 - 2.280000e+00 -9.397761e-01 -3.149067e+00 8.885701e-02 - 2.290000e+00 -8.310933e-01 -3.162879e+00 8.893019e-02 - 2.300000e+00 -6.360900e-01 -3.176690e+00 8.830113e-02 - 2.310000e+00 -3.387799e-01 -3.190502e+00 8.717917e-02 - 2.320000e+00 7.384109e-02 -3.204314e+00 8.594395e-02 - 2.330000e+00 6.107803e-01 -3.218125e+00 8.502589e-02 - 2.340000e+00 1.276191e+00 -3.231937e+00 8.475268e-02 - 2.350000e+00 2.068731e+00 -3.245749e+00 8.521931e-02 - 2.360000e+00 2.981181e+00 -3.259561e+00 8.624936e-02 - 2.370000e+00 4.000357e+00 -3.273372e+00 8.747046e-02 - 2.380000e+00 5.107337e+00 -3.287184e+00 8.845949e-02 - 2.390000e+00 6.277992e+00 -3.300996e+00 8.888735e-02 - 2.400000e+00 7.483803e+00 -3.314807e+00 8.861696e-02 - 2.410000e+00 8.692939e+00 -3.328619e+00 8.773945e-02 - 2.420000e+00 9.871525e+00 -3.342431e+00 8.654753e-02 - 2.430000e+00 1.098505e+01 -3.356242e+00 8.544831e-02 - 2.440000e+00 1.199985e+01 -3.370054e+00 8.482790e-02 - 2.450000e+00 1.288455e+01 -3.383866e+00 8.490680e-02 - 2.460000e+00 1.361146e+01 -3.397678e+00 8.565094e-02 - 2.470000e+00 1.415774e+01 -3.411489e+00 8.678792e-02 - 2.480000e+00 1.450644e+01 -3.425301e+00 8.791879e-02 - 2.490000e+00 1.464718e+01 -3.439113e+00 8.866444e-02 - 2.500000e+00 1.457658e+01 -3.452924e+00 8.878714e-02 - 2.510000e+00 1.429830e+01 -3.466736e+00 8.825730e-02 - 2.520000e+00 1.382281e+01 -3.480548e+00 8.725920e-02 - 2.530000e+00 1.316686e+01 -3.494359e+00 8.613645e-02 - 2.540000e+00 1.235258e+01 -3.508171e+00 8.528323e-02 - 2.550000e+00 1.140650e+01 -3.521983e+00 8.500491e-02 - 2.560000e+00 1.035826e+01 -3.535794e+00 8.539895e-02 - 2.570000e+00 9.239323e+00 -3.549606e+00 8.631613e-02 - 2.580000e+00 8.081607e+00 -3.563418e+00 8.742391e-02 - 2.590000e+00 6.916163e+00 -3.577230e+00 8.833600e-02 - 2.600000e+00 5.771973e+00 -3.591041e+00 8.874584e-02 - 2.610000e+00 4.674897e+00 -3.604853e+00 8.852008e-02 - 2.620000e+00 3.646830e+00 -3.618665e+00 8.773500e-02 - 2.630000e+00 2.705100e+00 -3.632476e+00 8.665363e-02 - 2.640000e+00 1.862122e+00 -3.646288e+00 8.564608e-02 - 2.650000e+00 1.125307e+00 -3.660100e+00 8.506583e-02 - 2.660000e+00 4.972252e-01 -3.673911e+00 8.511794e-02 - 2.670000e+00 -2.400927e-02 -3.687723e+00 8.577693e-02 - 2.680000e+00 -4.441723e-01 -3.701535e+00 8.679855e-02 - 2.690000e+00 -7.722150e-01 -3.715347e+00 8.781860e-02 - 2.700000e+00 -1.019459e+00 -3.729158e+00 8.848654e-02 - 2.710000e+00 -1.198748e+00 -3.742970e+00 8.857941e-02 - 2.720000e+00 -1.323610e+00 -3.756782e+00 8.806668e-02 - 2.730000e+00 -1.407472e+00 -3.770593e+00 8.711793e-02 - 2.740000e+00 -1.462967e+00 -3.784405e+00 8.605324e-02 - 2.750000e+00 -1.501372e+00 -3.798217e+00 8.524228e-02 - 2.760000e+00 -1.532185e+00 -3.812028e+00 8.497442e-02 - 2.770000e+00 -1.562860e+00 -3.825840e+00 8.534686e-02 - 2.780000e+00 -1.598702e+00 -3.839652e+00 8.622582e-02 - 2.790000e+00 -1.642903e+00 -3.853464e+00 8.730239e-02 - 2.800000e+00 -1.696711e+00 -3.867275e+00 8.821161e-02 - 2.810000e+00 -1.759700e+00 -3.881087e+00 8.865812e-02 - 2.820000e+00 -1.830120e+00 -3.894899e+00 8.850613e-02 - 2.830000e+00 -1.905285e+00 -3.908710e+00 8.781616e-02 - 2.840000e+00 -1.981979e+00 -3.922522e+00 8.682582e-02 - 2.850000e+00 -2.056843e+00 -3.936334e+00 8.587719e-02 - 2.860000e+00 -2.126718e+00 -3.950145e+00 8.530316e-02 - 2.870000e+00 -2.188935e+00 -3.963957e+00 8.530532e-02 - 2.880000e+00 -2.241518e+00 -3.977769e+00 8.587504e-02 - 2.890000e+00 -2.283314e+00 -3.991580e+00 8.679888e-02 - 2.900000e+00 -2.314031e+00 -4.005392e+00 8.774513e-02 - 2.910000e+00 -2.334204e+00 -4.019204e+00 8.838627e-02 - 2.920000e+00 -2.345096e+00 -4.033016e+00 8.850696e-02 - 2.930000e+00 -2.348533e+00 -4.046827e+00 8.806776e-02 - 2.940000e+00 -2.346723e+00 -4.060639e+00 8.721507e-02 - 2.950000e+00 -2.342043e+00 -4.074451e+00 8.623706e-02 - 2.960000e+00 -2.336835e+00 -4.088262e+00 8.547181e-02 - 2.970000e+00 -2.333219e+00 -4.102074e+00 8.518872e-02 - 2.980000e+00 -2.332935e+00 -4.115886e+00 8.548554e-02 - 2.990000e+00 -2.337236e+00 -4.129697e+00 8.624986e-02 - 3.000000e+00 -2.346817e+00 -4.143509e+00 8.720597e-02 - 3.010000e+00 -2.361806e+00 -4.157321e+00 8.802122e-02 - 3.020000e+00 -2.381792e+00 -4.171133e+00 8.842215e-02 - 3.030000e+00 -2.405909e+00 -4.184944e+00 8.828001e-02 - 3.040000e+00 -2.432939e+00 -4.198756e+00 8.764730e-02 - 3.050000e+00 -2.461444e+00 -4.212568e+00 8.674126e-02 - 3.060000e+00 -2.489911e+00 -4.226379e+00 8.587672e-02 - 3.070000e+00 -2.516886e+00 -4.240191e+00 8.536071e-02 - 3.080000e+00 -2.541103e+00 -4.254003e+00 8.537964e-02 - 3.090000e+00 -2.561584e+00 -4.267814e+00 8.592621e-02 - 3.100000e+00 -2.577712e+00 -4.281626e+00 8.680329e-02 - 3.110000e+00 -2.589266e+00 -4.295438e+00 8.770250e-02 - 3.120000e+00 -2.596420e+00 -4.309250e+00 8.831725e-02 - 3.130000e+00 -2.599709e+00 -4.323061e+00 8.844402e-02 - 3.140000e+00 -2.599957e+00 -4.336873e+00 8.804325e-02 - 3.150000e+00 -2.598188e+00 -4.350685e+00 8.724975e-02 - 3.160000e+00 -2.595516e+00 -4.364496e+00 8.633174e-02 - 3.170000e+00 -2.593021e+00 -4.378308e+00 8.560513e-02 - 3.180000e+00 -2.591636e+00 -4.392120e+00 8.532290e-02 - 3.190000e+00 -2.592035e+00 -4.405931e+00 8.557901e-02 - 3.200000e+00 -2.594543e+00 -4.419743e+00 8.627157e-02 - 3.210000e+00 -2.599066e+00 -4.433555e+00 8.714478e-02 - 3.220000e+00 -2.605049e+00 -4.447366e+00 8.788730e-02 - 3.230000e+00 -2.611468e+00 -4.461178e+00 8.824143e-02 - 3.240000e+00 -2.616842e+00 -4.474990e+00 8.808516e-02 - 3.250000e+00 -2.619286e+00 -4.488802e+00 8.746838e-02 - 3.260000e+00 -2.616581e+00 -4.502613e+00 8.659820e-02 - 3.270000e+00 -2.606259e+00 -4.516425e+00 8.577550e-02 - 3.280000e+00 -2.585719e+00 -4.530237e+00 8.529449e-02 - 3.290000e+00 -2.552333e+00 -4.544048e+00 8.533489e-02 - 3.300000e+00 -2.503569e+00 -4.557860e+00 8.589126e-02 - 3.310000e+00 -2.437100e+00 -4.571672e+00 8.677526e-02 - 3.320000e+00 -2.350917e+00 -4.585483e+00 8.768926e-02 - 3.330000e+00 -2.243420e+00 -4.599295e+00 8.833407e-02 - 3.340000e+00 -2.113503e+00 -4.613107e+00 8.850678e-02 - 3.350000e+00 -1.960618e+00 -4.626919e+00 8.816083e-02 - 3.360000e+00 -1.784825e+00 -4.640730e+00 8.741788e-02 - 3.370000e+00 -1.586825e+00 -4.654542e+00 8.653083e-02 - 3.380000e+00 -1.367979e+00 -4.668354e+00 8.580368e-02 - 3.390000e+00 -1.130302e+00 -4.682165e+00 8.548686e-02 - 3.400000e+00 -8.764571e-01 -4.695977e+00 8.568406e-02 - 3.410000e+00 -6.097196e-01 -4.709789e+00 8.631281e-02 - 3.420000e+00 -3.339377e-01 -4.723600e+00 8.713910e-02 - 3.430000e+00 -5.347346e-02 -4.737412e+00 8.786787e-02 - 3.440000e+00 2.268704e-01 -4.751224e+00 8.824708e-02 - 3.450000e+00 5.019383e-01 -4.765036e+00 8.814830e-02 - 3.460000e+00 7.663258e-01 -4.778847e+00 8.760434e-02 - 3.470000e+00 1.014500e+00 -4.792659e+00 8.679847e-02 - 3.480000e+00 1.240932e+00 -4.806471e+00 8.600717e-02 - 3.490000e+00 1.440250e+00 -4.820282e+00 8.550784e-02 - 3.500000e+00 1.607392e+00 -4.834094e+00 8.547816e-02 - 3.510000e+00 1.737778e+00 -4.847906e+00 8.592753e-02 - 3.520000e+00 1.827471e+00 -4.861717e+00 8.669413e-02 - 3.530000e+00 1.873343e+00 -4.875529e+00 8.750884e-02 - 3.540000e+00 1.873221e+00 -4.889341e+00 8.809407e-02 - 3.550000e+00 1.826015e+00 -4.903152e+00 8.825661e-02 - 3.560000e+00 1.731819e+00 -4.916964e+00 8.794676e-02 - 3.570000e+00 1.591965e+00 -4.930776e+00 8.727197e-02 - 3.580000e+00 1.409047e+00 -4.944588e+00 8.646361e-02 - 3.590000e+00 1.186882e+00 -4.958399e+00 8.580261e-02 - 3.600000e+00 9.304277e-01 -4.972211e+00 8.552186e-02 - 3.610000e+00 6.456414e-01 -4.986023e+00 8.571906e-02 - 3.620000e+00 3.392945e-01 -4.999834e+00 8.631881e-02 - 3.630000e+00 1.873856e-02 -5.013646e+00 8.710326e-02 - 3.640000e+00 -3.083619e-01 -5.027458e+00 8.779520e-02 - 3.650000e+00 -6.343206e-01 -5.041269e+00 8.815575e-02 - 3.660000e+00 -9.517301e-01 -5.055081e+00 8.806124e-02 - 3.670000e+00 -1.253756e+00 -5.068893e+00 8.754045e-02 - 3.680000e+00 -1.534413e+00 -5.082705e+00 8.676573e-02 - 3.690000e+00 -1.788795e+00 -5.096516e+00 8.599990e-02 - 3.700000e+00 -2.013266e+00 -5.110328e+00 8.550922e-02 - 3.710000e+00 -2.205580e+00 -5.124140e+00 8.546775e-02 - 3.720000e+00 -2.364928e+00 -5.137951e+00 8.589091e-02 - 3.730000e+00 -2.491921e+00 -5.151763e+00 8.663012e-02 - 3.740000e+00 -2.588479e+00 -5.165575e+00 8.743106e-02 - 3.750000e+00 -2.657671e+00 -5.179386e+00 8.802674e-02 - 3.760000e+00 -2.703479e+00 -5.193198e+00 8.822663e-02 - 3.770000e+00 -2.730520e+00 -5.207010e+00 8.797479e-02 - 3.780000e+00 -2.743737e+00 -5.220822e+00 8.736478e-02 - 3.790000e+00 -2.748083e+00 -5.234633e+00 8.660995e-02 - 3.800000e+00 -2.748209e+00 -5.248445e+00 8.597450e-02 - 3.810000e+00 -2.748188e+00 -5.262257e+00 8.568213e-02 - 3.820000e+00 -2.751276e+00 -5.276068e+00 8.583325e-02 - 3.830000e+00 -2.759752e+00 -5.289880e+00 8.636683e-02 - 3.840000e+00 -2.774817e+00 -5.303692e+00 8.708555e-02 - 3.850000e+00 -2.796588e+00 -5.317503e+00 8.773157e-02 - 3.860000e+00 -2.824158e+00 -5.331315e+00 8.807818e-02 - 3.870000e+00 -2.855748e+00 -5.345127e+00 8.800391e-02 - 3.880000e+00 -2.888908e+00 -5.358939e+00 8.752973e-02 - 3.890000e+00 -2.920779e+00 -5.372750e+00 8.681247e-02 - 3.900000e+00 -2.948371e+00 -5.386562e+00 8.609591e-02 - 3.910000e+00 -2.968861e+00 -5.400374e+00 8.562970e-02 - 3.920000e+00 -2.979857e+00 -5.414185e+00 8.557964e-02 - 3.930000e+00 -2.979632e+00 -5.427997e+00 8.596450e-02 - 3.940000e+00 -2.967290e+00 -5.441809e+00 8.664908e-02 - 3.950000e+00 -2.942857e+00 -5.455620e+00 8.739672e-02 - 3.960000e+00 -2.907272e+00 -5.469432e+00 8.795581e-02 - 3.970000e+00 -2.862300e+00 -5.483244e+00 8.814437e-02 - 3.980000e+00 -2.810334e+00 -5.497055e+00 8.790624e-02 - 3.990000e+00 -2.754132e+00 -5.510867e+00 8.732687e-02 - 4.000000e+00 -2.696475e+00 -5.524679e+00 8.660621e-02 - 4.010000e+00 -2.639789e+00 -5.538491e+00 8.599417e-02 - 4.020000e+00 -2.585754e+00 -5.552302e+00 8.570445e-02 - 4.030000e+00 -2.534926e+00 -5.566114e+00 8.583588e-02 - 4.040000e+00 -2.486404e+00 -5.579926e+00 8.633496e-02 - 4.050000e+00 -2.437580e+00 -5.593737e+00 8.701785e-02 - 4.060000e+00 -2.383991e+00 -5.607549e+00 8.764065e-02 - 4.070000e+00 -2.319291e+00 -5.621361e+00 8.798621e-02 - 4.080000e+00 -2.235371e+00 -5.635172e+00 8.793541e-02 - 4.090000e+00 -2.122615e+00 -5.648984e+00 8.750393e-02 - 4.100000e+00 -1.970297e+00 -5.662796e+00 8.683711e-02 - 4.110000e+00 -1.767102e+00 -5.676608e+00 8.616432e-02 - 4.120000e+00 -1.501749e+00 -5.690419e+00 8.572243e-02 - 4.130000e+00 -1.163683e+00 -5.704231e+00 8.567084e-02 - 4.140000e+00 -7.438005e-01 -5.718043e+00 8.603091e-02 - 4.150000e+00 -2.351580e-01 -5.731854e+00 8.667774e-02 - 4.160000e+00 3.663656e-01 -5.745666e+00 8.738832e-02 - 4.170000e+00 1.061510e+00 -5.759478e+00 8.792278e-02 - 4.180000e+00 1.847208e+00 -5.773289e+00 8.810524e-02 - 4.190000e+00 2.716329e+00 -5.787101e+00 8.787868e-02 - 4.200000e+00 3.657618e+00 -5.800913e+00 8.732138e-02 - 4.210000e+00 4.655841e+00 -5.814725e+00 8.662233e-02 - 4.220000e+00 5.692133e+00 -5.828536e+00 8.602054e-02 - 4.230000e+00 6.744555e+00 -5.842348e+00 8.572319e-02 - 4.240000e+00 7.788825e+00 -5.856160e+00 8.583002e-02 - 4.250000e+00 8.799190e+00 -5.869971e+00 8.629595e-02 - 4.260000e+00 9.749408e+00 -5.883783e+00 8.694977e-02 - 4.270000e+00 1.061379e+01 -5.897595e+00 8.755959e-02 - 4.280000e+00 1.136822e+01 -5.911406e+00 8.791545e-02 - 4.290000e+00 1.199120e+01 -5.925218e+00 8.789847e-02 - 4.300000e+00 1.246467e+01 -5.939030e+00 8.751740e-02 - 4.310000e+00 1.277484e+01 -5.952841e+00 8.690514e-02 - 4.320000e+00 1.291270e+01 -5.966653e+00 8.627632e-02 - 4.330000e+00 1.287439e+01 -5.980465e+00 8.585518e-02 - 4.340000e+00 1.266135e+01 -5.994277e+00 8.579510e-02 - 4.350000e+00 1.228021e+01 -6.008088e+00 8.612033e-02 - 4.360000e+00 1.174245e+01 -6.021900e+00 8.671645e-02 - 4.370000e+00 1.106387e+01 -6.035712e+00 8.737418e-02 - 4.380000e+00 1.026392e+01 -6.049523e+00 8.786556e-02 - 4.390000e+00 9.364814e+00 -6.063335e+00 8.802129e-02 - 4.400000e+00 8.390613e+00 -6.077147e+00 8.778446e-02 - 4.410000e+00 7.366263e+00 -6.090958e+00 8.722793e-02 - 4.420000e+00 6.316617e+00 -6.104770e+00 8.653223e-02 - 4.430000e+00 5.265521e+00 -6.118582e+00 8.592841e-02 - 4.440000e+00 4.234999e+00 -6.132394e+00 8.561983e-02 - 4.450000e+00 3.244559e+00 -6.146205e+00 8.570877e-02 - 4.460000e+00 2.310668e+00 -6.160017e+00 8.615855e-02 - 4.470000e+00 1.446384e+00 -6.173829e+00 8.680890e-02 - 4.480000e+00 6.611823e-01 -6.187640e+00 8.743706e-02 - 4.490000e+00 -3.905441e-02 -6.201452e+00 8.783681e-02 - 4.500000e+00 -6.518808e-01 -6.215264e+00 8.788586e-02 - 4.510000e+00 -1.177993e+00 -6.229075e+00 8.758252e-02 - 4.520000e+00 -1.620823e+00 -6.242887e+00 8.704418e-02 - 4.530000e+00 -1.986045e+00 -6.256699e+00 8.646856e-02 - 4.540000e+00 -2.281044e+00 -6.270511e+00 8.606669e-02 - 4.550000e+00 -2.514362e+00 -6.284322e+00 8.598740e-02 - 4.560000e+00 -2.695158e+00 -6.298134e+00 8.626153e-02 - 4.570000e+00 -2.832719e+00 -6.311946e+00 8.679056e-02 - 4.580000e+00 -2.936024e+00 -6.325757e+00 8.738503e-02 - 4.590000e+00 -3.013391e+00 -6.339569e+00 8.783451e-02 - 4.600000e+00 -3.072212e+00 -6.353381e+00 8.798044e-02 - 4.610000e+00 -3.118767e+00 -6.367192e+00 8.776777e-02 - 4.620000e+00 -3.158134e+00 -6.381004e+00 8.726241e-02 - 4.630000e+00 -3.194163e+00 -6.394816e+00 8.663102e-02 - 4.640000e+00 -3.229516e+00 -6.408627e+00 8.608727e-02 - 4.650000e+00 -3.265756e+00 -6.422439e+00 8.581849e-02 - 4.660000e+00 -3.303465e+00 -6.436251e+00 8.591708e-02 - 4.670000e+00 -3.342377e+00 -6.450063e+00 8.634536e-02 - 4.680000e+00 -3.381515e+00 -6.463874e+00 8.695011e-02 - 4.690000e+00 -3.419326e+00 -6.477686e+00 8.751985e-02 - 4.700000e+00 -3.453792e+00 -6.491498e+00 8.785941e-02 - 4.710000e+00 -3.482530e+00 -6.505309e+00 8.785407e-02 - 4.720000e+00 -3.502873e+00 -6.519121e+00 8.750507e-02 - 4.730000e+00 -3.511939e+00 -6.532933e+00 8.692868e-02 - 4.740000e+00 -3.506682e+00 -6.546744e+00 8.631937e-02 - 4.750000e+00 -3.483957e+00 -6.560556e+00 8.588540e-02 - 4.760000e+00 -3.440576e+00 -6.574368e+00 8.577557e-02 - 4.770000e+00 -3.373385e+00 -6.588180e+00 8.602434e-02 - 4.780000e+00 -3.279357e+00 -6.601991e+00 8.653953e-02 - 4.790000e+00 -3.155710e+00 -6.615803e+00 8.713833e-02 - 4.800000e+00 -3.000036e+00 -6.629615e+00 8.761468e-02 - 4.810000e+00 -2.810458e+00 -6.643426e+00 8.781026e-02 - 4.820000e+00 -2.585794e+00 -6.657238e+00 8.766528e-02 - 4.830000e+00 -2.325724e+00 -6.671050e+00 8.723634e-02 - 4.840000e+00 -2.030943e+00 -6.684861e+00 8.667774e-02 - 4.850000e+00 -1.703304e+00 -6.698673e+00 8.619059e-02 - 4.860000e+00 -1.345909e+00 -6.712485e+00 8.595303e-02 - 4.870000e+00 -9.631702e-01 -6.726297e+00 8.605479e-02 - 4.880000e+00 -5.608041e-01 -6.740108e+00 8.646303e-02 - 4.890000e+00 -1.457638e-01 -6.753920e+00 8.703493e-02 - 4.900000e+00 2.738950e-01 -6.767732e+00 8.757120e-02 - 4.910000e+00 6.892164e-01 -6.781543e+00 8.788676e-02 - 4.920000e+00 1.090608e+00 -6.795355e+00 8.787244e-02 - 4.930000e+00 1.468155e+00 -6.809167e+00 8.752974e-02 - 4.940000e+00 1.811980e+00 -6.822978e+00 8.697063e-02 - 4.950000e+00 2.112617e+00 -6.836790e+00 8.638246e-02 - 4.960000e+00 2.361395e+00 -6.850602e+00 8.596608e-02 - 4.970000e+00 2.550801e+00 -6.864413e+00 8.586518e-02 - 4.980000e+00 2.674816e+00 -6.878225e+00 8.611303e-02 - 4.990000e+00 2.729185e+00 -6.892037e+00 8.661999e-02 - 5.000000e+00 2.711627e+00 -6.905849e+00 8.720766e-02 - 5.010000e+00 2.621959e+00 -6.919660e+00 8.767376e-02 - 5.020000e+00 2.462128e+00 -6.933472e+00 8.786104e-02 - 5.030000e+00 2.236157e+00 -6.947284e+00 8.770755e-02 - 5.040000e+00 1.949990e+00 -6.961095e+00 8.726511e-02 - 5.050000e+00 1.611265e+00 -6.974907e+00 8.668269e-02 - 5.060000e+00 1.229002e+00 -6.988719e+00 8.615816e-02 - 5.070000e+00 8.132488e-01 -7.002530e+00 8.587099e-02 - 5.080000e+00 3.746712e-01 -7.016342e+00 8.591790e-02 - 5.090000e+00 -7.586038e-02 -7.030154e+00 8.627722e-02 - 5.100000e+00 -5.276906e-01 -7.043966e+00 8.681827e-02 - 5.110000e+00 -9.707736e-01 -7.057777e+00 8.735105e-02 - 5.120000e+00 -1.396027e+00 -7.071589e+00 8.769425e-02 - 5.130000e+00 -1.795627e+00 -7.085401e+00 8.773588e-02 - 5.140000e+00 -2.163237e+00 -7.099212e+00 8.746834e-02 - 5.150000e+00 -2.494151e+00 -7.113024e+00 8.698983e-02 - 5.160000e+00 -2.785361e+00 -7.126836e+00 8.647198e-02 - 5.170000e+00 -3.035536e+00 -7.140647e+00 8.610178e-02 - 5.180000e+00 -3.244924e+00 -7.154459e+00 8.601496e-02 - 5.190000e+00 -3.415178e+00 -7.168271e+00 8.624523e-02 - 5.200000e+00 -3.549129e+00 -7.182083e+00 8.671154e-02 - 5.210000e+00 -3.650505e+00 -7.195894e+00 8.724892e-02 - 5.220000e+00 -3.723620e+00 -7.209706e+00 8.766895e-02 - 5.230000e+00 -3.773049e+00 -7.223518e+00 8.782505e-02 - 5.240000e+00 -3.803304e+00 -7.237329e+00 8.766071e-02 - 5.250000e+00 -3.818524e+00 -7.251141e+00 8.722768e-02 - 5.260000e+00 -3.822194e+00 -7.264953e+00 8.667016e-02 - 5.270000e+00 -3.816918e+00 -7.278764e+00 8.617831e-02 - 5.280000e+00 -3.804229e+00 -7.292576e+00 8.592329e-02 - 5.290000e+00 -3.784477e+00 -7.306388e+00 8.599517e-02 - 5.300000e+00 -3.756772e+00 -7.320200e+00 8.636886e-02 - 5.310000e+00 -3.718998e+00 -7.334011e+00 8.691337e-02 - 5.320000e+00 -3.667897e+00 -7.347823e+00 8.744021e-02 - 5.330000e+00 -3.599214e+00 -7.361635e+00 8.776965e-02 - 5.340000e+00 -3.507905e+00 -7.375446e+00 8.779011e-02 - 5.350000e+00 -3.388388e+00 -7.389258e+00 8.749321e-02 - 5.360000e+00 -3.234838e+00 -7.403070e+00 8.697617e-02 - 5.370000e+00 -3.041515e+00 -7.416881e+00 8.641121e-02 - 5.380000e+00 -2.803099e+00 -7.430693e+00 8.598917e-02 - 5.390000e+00 -2.515036e+00 -7.444505e+00 8.585342e-02 - 5.400000e+00 -2.173860e+00 -7.458316e+00 8.604798e-02 - 5.410000e+00 -1.777503e+00 -7.472128e+00 8.650183e-02 - 5.420000e+00 -1.325552e+00 -7.485940e+00 8.705661e-02 - 5.430000e+00 -8.194596e-01 -7.499752e+00 8.752478e-02 - 5.440000e+00 -2.626892e-01 -7.513563e+00 8.775421e-02 - 5.450000e+00 3.392176e-01 -7.527375e+00 8.767696e-02 - 5.460000e+00 9.786512e-01 -7.541187e+00 8.732932e-02 - 5.470000e+00 1.646031e+00 -7.554998e+00 8.683885e-02 - 5.480000e+00 2.329988e+00 -7.568810e+00 8.638176e-02 - 5.490000e+00 3.017633e+00 -7.582622e+00 8.612218e-02 - 5.500000e+00 3.694900e+00 -7.596433e+00 8.615289e-02 - 5.510000e+00 4.346958e+00 -7.610245e+00 8.646102e-02 - 5.520000e+00 4.958674e+00 -7.624057e+00 8.693372e-02 - 5.530000e+00 5.515119e+00 -7.637869e+00 8.740100e-02 - 5.540000e+00 6.002084e+00 -7.651680e+00 8.769710e-02 - 5.550000e+00 6.406594e+00 -7.665492e+00 8.771699e-02 - 5.560000e+00 6.717406e+00 -7.679304e+00 8.745053e-02 - 5.570000e+00 6.925442e+00 -7.693115e+00 8.698579e-02 - 5.580000e+00 7.024169e+00 -7.706927e+00 8.648066e-02 - 5.590000e+00 7.009884e+00 -7.720739e+00 8.610998e-02 - 5.600000e+00 6.881897e+00 -7.734550e+00 8.600369e-02 - 5.610000e+00 6.642601e+00 -7.748362e+00 8.619864e-02 - 5.620000e+00 6.297426e+00 -7.762174e+00 8.662450e-02 - 5.630000e+00 5.854665e+00 -7.775986e+00 8.713015e-02 - 5.640000e+00 5.325193e+00 -7.789797e+00 8.753878e-02 - 5.650000e+00 4.722072e+00 -7.803609e+00 8.770900e-02 - 5.660000e+00 4.060080e+00 -7.817421e+00 8.758144e-02 - 5.670000e+00 3.355160e+00 -7.831232e+00 8.719768e-02 - 5.680000e+00 2.623839e+00 -7.845044e+00 8.668744e-02 - 5.690000e+00 1.882618e+00 -7.858856e+00 8.622663e-02 - 5.700000e+00 1.147384e+00 -7.872667e+00 8.597749e-02 - 5.710000e+00 4.328576e-01 -7.886479e+00 8.603025e-02 - 5.720000e+00 -2.478914e-01 -7.900291e+00 8.636931e-02 - 5.730000e+00 -8.838435e-01 -7.914102e+00 8.687907e-02 - 5.740000e+00 -1.466320e+00 -7.927914e+00 8.738655e-02 - 5.750000e+00 -1.989158e+00 -7.941726e+00 8.772229e-02 - 5.760000e+00 -2.448757e+00 -7.955538e+00 8.777674e-02 - 5.770000e+00 -2.844007e+00 -7.969349e+00 8.753466e-02 - 5.780000e+00 -3.176100e+00 -7.983161e+00 8.707946e-02 - 5.790000e+00 -3.448233e+00 -7.996973e+00 8.656641e-02 - 5.800000e+00 -3.665236e+00 -8.010784e+00 8.617139e-02 - 5.810000e+00 -3.833133e+00 -8.024596e+00 8.602990e-02 - 5.820000e+00 -3.958675e+00 -8.038408e+00 8.618804e-02 - 5.830000e+00 -4.048865e+00 -8.052219e+00 8.658593e-02 - 5.840000e+00 -4.110503e+00 -8.066031e+00 8.708082e-02 - 5.850000e+00 -4.149782e+00 -8.079843e+00 8.749955e-02 - 5.860000e+00 -4.171953e+00 -8.093655e+00 8.769861e-02 - 5.870000e+00 -4.181080e+00 -8.107466e+00 8.761101e-02 - 5.880000e+00 -4.179890e+00 -8.121278e+00 8.726695e-02 - 5.890000e+00 -4.169735e+00 -8.135090e+00 8.678365e-02 - 5.900000e+00 -4.150654e+00 -8.148901e+00 8.632682e-02 - 5.910000e+00 -4.121538e+00 -8.162713e+00 8.605422e-02 - 5.920000e+00 -4.080373e+00 -8.176525e+00 8.605936e-02 - 5.930000e+00 -4.024548e+00 -8.190336e+00 8.633734e-02 - 5.940000e+00 -3.951214e+00 -8.204148e+00 8.678737e-02 - 5.950000e+00 -3.857649e+00 -8.217960e+00 8.725091e-02 - 5.960000e+00 -3.741620e+00 -8.231772e+00 8.756870e-02 - 5.970000e+00 -3.601711e+00 -8.245583e+00 8.763482e-02 - 5.980000e+00 -3.437595e+00 -8.259395e+00 8.743080e-02 - 5.990000e+00 -3.250224e+00 -8.273207e+00 8.703087e-02 - 6.000000e+00 -3.041939e+00 -8.287018e+00 8.657745e-02 - 6.010000e+00 -2.816474e+00 -8.300830e+00 8.623311e-02 - 6.020000e+00 -2.578867e+00 -8.314642e+00 8.612316e-02 - 6.030000e+00 -2.335272e+00 -8.328453e+00 8.628953e-02 - 6.040000e+00 -2.092693e+00 -8.342265e+00 8.667500e-02 - 6.050000e+00 -1.858648e+00 -8.356077e+00 8.714473e-02 - 6.060000e+00 -1.640791e+00 -8.369888e+00 8.753548e-02 - 6.070000e+00 -1.446513e+00 -8.383700e+00 8.771242e-02 - 6.080000e+00 -1.282544e+00 -8.397512e+00 8.761380e-02 - 6.090000e+00 -1.154595e+00 -8.411324e+00 8.727067e-02 - 6.100000e+00 -1.067042e+00 -8.425135e+00 8.679705e-02 - 6.110000e+00 -1.022691e+00 -8.438947e+00 8.635272e-02 - 6.120000e+00 -1.022633e+00 -8.452759e+00 8.608880e-02 - 6.130000e+00 -1.066192e+00 -8.466570e+00 8.609374e-02 - 6.140000e+00 -1.150981e+00 -8.480382e+00 8.636059e-02 - 6.150000e+00 -1.273047e+00 -8.494194e+00 8.678994e-02 - 6.160000e+00 -1.427113e+00 -8.508005e+00 8.722702e-02 - 6.170000e+00 -1.606882e+00 -8.521817e+00 8.751718e-02 - 6.180000e+00 -1.805393e+00 -8.535629e+00 8.755858e-02 - 6.190000e+00 -2.015408e+00 -8.549441e+00 8.733548e-02 - 6.200000e+00 -2.229787e+00 -8.563252e+00 8.692355e-02 - 6.210000e+00 -2.441843e+00 -8.577064e+00 8.646565e-02 - 6.220000e+00 -2.645638e+00 -8.590876e+00 8.612434e-02 - 6.230000e+00 -2.836214e+00 -8.604687e+00 8.602490e-02 - 6.240000e+00 -3.009722e+00 -8.618499e+00 8.620926e-02 - 6.250000e+00 -3.163462e+00 -8.632311e+00 8.661987e-02 - 6.260000e+00 -3.295813e+00 -8.646122e+00 8.712074e-02 - 6.270000e+00 -3.406071e+00 -8.659934e+00 8.754630e-02 - 6.280000e+00 -3.494195e+00 -8.673746e+00 8.775802e-02 - 6.290000e+00 -3.560494e+00 -8.687558e+00 8.768946e-02 - 6.300000e+00 -3.605266e+00 -8.701369e+00 8.736689e-02 - 6.310000e+00 -3.628425e+00 -8.715181e+00 8.690065e-02 - 6.320000e+00 -3.629147e+00 -8.728993e+00 8.644948e-02 - 6.330000e+00 -3.605564e+00 -8.742804e+00 8.616701e-02 - 6.340000e+00 -3.554534e+00 -8.756616e+00 8.614766e-02 - 6.350000e+00 -3.471511e+00 -8.770428e+00 8.639233e-02 - 6.360000e+00 -3.350547e+00 -8.784239e+00 8.680872e-02 - 6.370000e+00 -3.184410e+00 -8.798051e+00 8.724599e-02 - 6.380000e+00 -2.964853e+00 -8.811863e+00 8.754876e-02 - 6.390000e+00 -2.683002e+00 -8.825674e+00 8.760987e-02 - 6.400000e+00 -2.329863e+00 -8.839486e+00 8.740504e-02 - 6.410000e+00 -1.896913e+00 -8.853298e+00 8.700040e-02 - 6.420000e+00 -1.376751e+00 -8.867110e+00 8.653120e-02 - 6.430000e+00 -7.637666e-01 -8.880921e+00 8.615719e-02 - 6.440000e+00 -5.478658e-02 -8.894733e+00 8.600743e-02 - 6.450000e+00 7.503419e-01 -8.908545e+00 8.613388e-02 - 6.460000e+00 1.648275e+00 -8.922356e+00 8.649247e-02 - 6.470000e+00 2.631839e+00 -8.936168e+00 8.696004e-02 - 6.480000e+00 3.689864e+00 -8.949980e+00 8.737928e-02 - 6.490000e+00 4.807217e+00 -8.963791e+00 8.761334e-02 - 6.500000e+00 5.965040e+00 -8.977603e+00 8.759051e-02 - 6.510000e+00 7.141184e+00 -8.991415e+00 8.732628e-02 - 6.520000e+00 8.310844e+00 -9.005227e+00 8.691727e-02 - 6.530000e+00 9.447355e+00 -9.019038e+00 8.650892e-02 - 6.540000e+00 1.052313e+01 -9.032850e+00 8.624585e-02 - 6.550000e+00 1.151068e+01 -9.046662e+00 8.622056e-02 - 6.560000e+00 1.238368e+01 -9.060473e+00 8.643989e-02 - 6.570000e+00 1.311803e+01 -9.074285e+00 8.682322e-02 - 6.580000e+00 1.369284e+01 -9.088097e+00 8.723311e-02 - 6.590000e+00 1.409131e+01 -9.101908e+00 8.752513e-02 - 6.600000e+00 1.430143e+01 -9.115720e+00 8.759756e-02 - 6.610000e+00 1.431653e+01 -9.129532e+00 8.742490e-02 - 6.620000e+00 1.413553e+01 -9.143344e+00 8.706581e-02 - 6.630000e+00 1.376303e+01 -9.157155e+00 8.664383e-02 - 6.640000e+00 1.320907e+01 -9.170967e+00 8.630586e-02 - 6.650000e+00 1.248876e+01 -9.184779e+00 8.617074e-02 - 6.660000e+00 1.162158e+01 -9.198590e+00 8.628606e-02 - 6.670000e+00 1.063063e+01 -9.212402e+00 8.661044e-02 - 6.680000e+00 9.541615e+00 -9.226214e+00 8.702918e-02 - 6.690000e+00 8.381888e+00 -9.240025e+00 8.739620e-02 - 6.700000e+00 7.179331e+00 -9.253837e+00 8.758517e-02 - 6.710000e+00 5.961341e+00 -9.267649e+00 8.753185e-02 - 6.720000e+00 4.753851e+00 -9.281461e+00 8.725476e-02 - 6.730000e+00 3.580485e+00 -9.295272e+00 8.684917e-02 - 6.740000e+00 2.461850e+00 -9.309084e+00 8.645577e-02 - 6.750000e+00 1.415025e+00 -9.322896e+00 8.621269e-02 - 6.760000e+00 4.532287e-01 -9.336707e+00 8.620624e-02 - 6.770000e+00 -4.142968e-01 -9.350519e+00 8.643915e-02 - 6.780000e+00 -1.182223e+00 -9.364331e+00 8.682945e-02 - 6.790000e+00 -1.848891e+00 -9.378142e+00 8.724072e-02 - 6.800000e+00 -2.415919e+00 -9.391954e+00 8.753056e-02 - 6.810000e+00 -2.887703e+00 -9.405766e+00 8.759901e-02 - 6.820000e+00 -3.270830e+00 -9.419577e+00 8.742103e-02 - 6.830000e+00 -3.573468e+00 -9.433389e+00 8.705433e-02 - 6.840000e+00 -3.804748e+00 -9.447201e+00 8.662072e-02 - 6.850000e+00 -3.974192e+00 -9.461013e+00 8.626564e-02 - 6.860000e+00 -4.091203e+00 -9.474824e+00 8.610804e-02 - 6.870000e+00 -4.164653e+00 -9.488636e+00 8.619781e-02 - 6.880000e+00 -4.202570e+00 -9.502448e+00 8.649787e-02 - 6.890000e+00 -4.211947e+00 -9.516259e+00 8.689872e-02 - 6.900000e+00 -4.198652e+00 -9.530071e+00 8.725885e-02 - 6.910000e+00 -4.167450e+00 -9.543883e+00 8.745463e-02 - 6.920000e+00 -4.122095e+00 -9.557694e+00 8.742188e-02 - 6.930000e+00 -4.065505e+00 -9.571506e+00 8.717653e-02 - 6.940000e+00 -3.999959e+00 -9.585318e+00 8.680901e-02 - 6.950000e+00 -3.927327e+00 -9.599130e+00 8.645406e-02 - 6.960000e+00 -3.849278e+00 -9.612941e+00 8.624413e-02 - 6.970000e+00 -3.767473e+00 -9.626753e+00 8.626168e-02 - 6.980000e+00 -3.683709e+00 -9.640565e+00 8.650827e-02 - 6.990000e+00 -3.600007e+00 -9.654376e+00 8.690351e-02 - 7.000000e+00 -3.518647e+00 -9.668188e+00 8.731419e-02 - 7.010000e+00 -3.442143e+00 -9.682000e+00 8.760140e-02 - 7.020000e+00 -3.373162e+00 -9.695811e+00 8.766765e-02 - 7.030000e+00 -3.314405e+00 -9.709623e+00 8.748867e-02 - 7.040000e+00 -3.268464e+00 -9.723435e+00 8.712136e-02 - 7.050000e+00 -3.237658e+00 -9.737247e+00 8.668565e-02 - 7.060000e+00 -3.223883e+00 -9.751058e+00 8.632511e-02 - 7.070000e+00 -3.228470e+00 -9.764870e+00 8.615774e-02 - 7.080000e+00 -3.252079e+00 -9.778682e+00 8.623406e-02 - 7.090000e+00 -3.294630e+00 -9.792493e+00 8.651903e-02 - 7.100000e+00 -3.355279e+00 -9.806305e+00 8.690579e-02 - 7.110000e+00 -3.432434e+00 -9.820117e+00 8.725504e-02 - 7.120000e+00 -3.523812e+00 -9.833928e+00 8.744407e-02 - 7.130000e+00 -3.626529e+00 -9.847740e+00 8.740803e-02 - 7.140000e+00 -3.737210e+00 -9.861552e+00 8.716079e-02 - 7.150000e+00 -3.852113e+00 -9.875363e+00 8.679014e-02 - 7.160000e+00 -3.967249e+00 -9.889175e+00 8.642857e-02 - 7.170000e+00 -4.078489e+00 -9.902987e+00 8.620775e-02 - 7.180000e+00 -4.181658e+00 -9.916799e+00 8.621132e-02 - 7.190000e+00 -4.272592e+00 -9.930610e+00 8.644384e-02 - 7.200000e+00 -4.347178e+00 -9.944422e+00 8.682872e-02 - 7.210000e+00 -4.401366e+00 -9.958234e+00 8.723616e-02 - 7.220000e+00 -4.431155e+00 -9.972045e+00 8.752910e-02 - 7.230000e+00 -4.432579e+00 -9.985857e+00 8.760985e-02 - 7.240000e+00 -4.401686e+00 -9.999669e+00 8.745203e-02 - 7.250000e+00 -4.334534e+00 -1.001348e+01 8.710905e-02 - 7.260000e+00 -4.227210e+00 -1.002729e+01 8.669701e-02 - 7.270000e+00 -4.075886e+00 -1.004110e+01 8.635634e-02 - 7.280000e+00 -3.876916e+00 -1.005492e+01 8.620357e-02 - 7.290000e+00 -3.626982e+00 -1.006873e+01 8.628964e-02 - 7.300000e+00 -3.323282e+00 -1.008254e+01 8.658147e-02 - 7.310000e+00 -2.963758e+00 -1.009635e+01 8.697451e-02 - 7.320000e+00 -2.547353e+00 -1.011016e+01 8.733096e-02 - 7.330000e+00 -2.074275e+00 -1.012397e+01 8.752789e-02 - 7.340000e+00 -1.546259e+00 -1.013779e+01 8.749837e-02 - 7.350000e+00 -9.667883e-01 -1.015160e+01 8.725294e-02 - 7.360000e+00 -3.412800e-01 -1.016541e+01 8.687595e-02 - 7.370000e+00 3.228177e-01 -1.017922e+01 8.649780e-02 - 7.380000e+00 1.016010e+00 -1.019303e+01 8.625065e-02 - 7.390000e+00 1.726847e+00 -1.020684e+01 8.622171e-02 - 7.400000e+00 2.442125e+00 -1.022066e+01 8.642147e-02 - 7.410000e+00 3.147204e+00 -1.023447e+01 8.677992e-02 - 7.420000e+00 3.826419e+00 -1.024828e+01 8.717238e-02 - 7.430000e+00 4.463596e+00 -1.026209e+01 8.746396e-02 - 7.440000e+00 5.042623e+00 -1.027590e+01 8.755554e-02 - 7.450000e+00 5.548071e+00 -1.028971e+01 8.741620e-02 - 7.460000e+00 5.965823e+00 -1.030353e+01 8.709278e-02 - 7.470000e+00 6.283678e+00 -1.031734e+01 8.669456e-02 - 7.480000e+00 6.491899e+00 -1.033115e+01 8.635679e-02 - 7.490000e+00 6.583679e+00 -1.034496e+01 8.619412e-02 - 7.500000e+00 6.555482e+00 -1.035877e+01 8.625962e-02 - 7.510000e+00 6.407260e+00 -1.037258e+01 8.652573e-02 - 7.520000e+00 6.142512e+00 -1.038640e+01 8.689495e-02 - 7.530000e+00 5.768195e+00 -1.040021e+01 8.723582e-02 - 7.540000e+00 5.294482e+00 -1.041402e+01 8.742941e-02 - 7.550000e+00 4.734383e+00 -1.042783e+01 8.740958e-02 - 7.560000e+00 4.103251e+00 -1.044164e+01 8.718460e-02 - 7.570000e+00 3.418196e+00 -1.045545e+01 8.683440e-02 - 7.580000e+00 2.697439e+00 -1.046927e+01 8.648406e-02 - 7.590000e+00 1.959645e+00 -1.048308e+01 8.626112e-02 - 7.600000e+00 1.223256e+00 -1.049689e+01 8.625008e-02 - 7.610000e+00 5.058789e-01 -1.051070e+01 8.646118e-02 - 7.620000e+00 -1.762705e-01 -1.052451e+01 8.682625e-02 - 7.630000e+00 -8.088206e-01 -1.053832e+01 8.722328e-02 - 7.640000e+00 -1.379593e+00 -1.055214e+01 8.751959e-02 - 7.650000e+00 -1.878834e+00 -1.056595e+01 8.761687e-02 - 7.660000e+00 -2.299321e+00 -1.057976e+01 8.748327e-02 - 7.670000e+00 -2.636371e+00 -1.059357e+01 8.716352e-02 - 7.680000e+00 -2.887729e+00 -1.060738e+01 8.676455e-02 - 7.690000e+00 -3.053399e+00 -1.062120e+01 8.642026e-02 - 7.700000e+00 -3.135390e+00 -1.063501e+01 8.624582e-02 - 7.710000e+00 -3.137448e+00 -1.064882e+01 8.629701e-02 - 7.720000e+00 -3.064754e+00 -1.066263e+01 8.655023e-02 - 7.730000e+00 -2.923640e+00 -1.067644e+01 8.691194e-02 - 7.740000e+00 -2.721321e+00 -1.069025e+01 8.725297e-02 - 7.750000e+00 -2.465665e+00 -1.070407e+01 8.745415e-02 - 7.760000e+00 -2.165005e+00 -1.071788e+01 8.744637e-02 - 7.770000e+00 -1.827993e+00 -1.073169e+01 8.723295e-02 - 7.780000e+00 -1.463495e+00 -1.074550e+01 8.688815e-02 - 7.790000e+00 -1.080518e+00 -1.075931e+01 8.653246e-02 - 7.800000e+00 -6.881554e-01 -1.077312e+01 8.629153e-02 - 7.810000e+00 -2.955460e-01 -1.078694e+01 8.625170e-02 - 7.820000e+00 8.818105e-02 -1.080075e+01 8.642853e-02 - 7.830000e+00 4.539747e-01 -1.081456e+01 8.676105e-02 - 7.840000e+00 7.929615e-01 -1.082837e+01 8.713417e-02 - 7.850000e+00 1.096579e+00 -1.084218e+01 8.741985e-02 - 7.860000e+00 1.356747e+00 -1.085599e+01 8.752100e-02 - 7.870000e+00 1.566073e+00 -1.086981e+01 8.740354e-02 - 7.880000e+00 1.718081e+00 -1.088362e+01 8.710728e-02 - 7.890000e+00 1.807461e+00 -1.089743e+01 8.673292e-02 - 7.900000e+00 1.830310e+00 -1.091124e+01 8.640862e-02 - 7.910000e+00 1.784361e+00 -1.092505e+01 8.624595e-02 - 7.920000e+00 1.669172e+00 -1.093886e+01 8.630016e-02 - 7.930000e+00 1.486265e+00 -1.095268e+01 8.655020e-02 - 7.940000e+00 1.239192e+00 -1.096649e+01 8.690681e-02 - 7.950000e+00 9.335295e-01 -1.098030e+01 8.724518e-02 - 7.960000e+00 5.767748e-01 -1.099411e+01 8.744885e-02 - 7.970000e+00 1.781685e-01 -1.100792e+01 8.744896e-02 - 7.980000e+00 -2.515741e-01 -1.102173e+01 8.724661e-02 - 7.990000e+00 -7.006017e-01 -1.103555e+01 8.691219e-02 - 8.000000e+00 -1.156323e+00 -1.104936e+01 8.656200e-02 - 8.010000e+00 -1.605844e+00 -1.106317e+01 8.631875e-02 - 8.020000e+00 -2.036420e+00 -1.107698e+01 8.626827e-02 - 8.030000e+00 -2.435906e+00 -1.109079e+01 8.642838e-02 - 8.040000e+00 -2.793178e+00 -1.110460e+01 8.674233e-02 - 8.050000e+00 -3.098512e+00 -1.111842e+01 8.709977e-02 - 8.060000e+00 -3.343890e+00 -1.113223e+01 8.737617e-02 - 8.070000e+00 -3.523241e+00 -1.114604e+01 8.747575e-02 - 8.080000e+00 -3.632589e+00 -1.115985e+01 8.736322e-02 - 8.090000e+00 -3.670114e+00 -1.117366e+01 8.707518e-02 - 8.100000e+00 -3.636133e+00 -1.118747e+01 8.670830e-02 - 8.110000e+00 -3.532999e+00 -1.120129e+01 8.638727e-02 - 8.120000e+00 -3.364936e+00 -1.121510e+01 8.622217e-02 - 8.130000e+00 -3.137818e+00 -1.122891e+01 8.626941e-02 - 8.140000e+00 -2.858915e+00 -1.124272e+01 8.651148e-02 - 8.150000e+00 -2.536611e+00 -1.125653e+01 8.686382e-02 - 8.160000e+00 -2.180124e+00 -1.127034e+01 8.720573e-02 - 8.170000e+00 -1.799223e+00 -1.128416e+01 8.742290e-02 - 8.180000e+00 -1.403965e+00 -1.129797e+01 8.744584e-02 - 8.190000e+00 -1.004458e+00 -1.131178e+01 8.727231e-02 - 8.200000e+00 -6.106442e-01 -1.132559e+01 8.696732e-02 - 8.210000e+00 -2.321136e-01 -1.133940e+01 8.664116e-02 - 8.220000e+00 1.220572e-01 -1.135322e+01 8.641148e-02 - 8.230000e+00 4.434491e-01 -1.136703e+01 8.636156e-02 - 8.240000e+00 7.244291e-01 -1.138084e+01 8.650989e-02 - 8.250000e+00 9.582697e-01 -1.139465e+01 8.680331e-02 - 8.260000e+00 1.139265e+00 -1.140846e+01 8.713658e-02 - 8.270000e+00 1.262844e+00 -1.142227e+01 8.739024e-02 - 8.280000e+00 1.325686e+00 -1.143609e+01 8.747210e-02 - 8.290000e+00 1.325830e+00 -1.144990e+01 8.734839e-02 - 8.300000e+00 1.262779e+00 -1.146371e+01 8.705530e-02 - 8.310000e+00 1.137587e+00 -1.147752e+01 8.668776e-02 - 8.320000e+00 9.529220e-01 -1.149133e+01 8.636844e-02 - 8.330000e+00 7.130975e-01 -1.150514e+01 8.620594e-02 - 8.340000e+00 4.240556e-01 -1.151896e+01 8.625642e-02 - 8.350000e+00 9.329779e-02 -1.153277e+01 8.650321e-02 - 8.360000e+00 -2.702450e-01 -1.154658e+01 8.686301e-02 - 8.370000e+00 -6.564063e-01 -1.156039e+01 8.721593e-02 - 8.380000e+00 -1.054043e+00 -1.157420e+01 8.744716e-02 - 8.390000e+00 -1.451351e+00 -1.158801e+01 8.748512e-02 - 8.400000e+00 -1.836238e+00 -1.160183e+01 8.732405e-02 - 8.410000e+00 -2.196723e+00 -1.161564e+01 8.702498e-02 - 8.420000e+00 -2.521366e+00 -1.162945e+01 8.669490e-02 - 8.430000e+00 -2.799690e+00 -1.164326e+01 8.645018e-02 - 8.440000e+00 -3.022590e+00 -1.165707e+01 8.637573e-02 - 8.450000e+00 -3.182695e+00 -1.167088e+01 8.649456e-02 - 8.460000e+00 -3.274671e+00 -1.168470e+01 8.675976e-02 - 8.470000e+00 -3.295447e+00 -1.169851e+01 8.707235e-02 - 8.480000e+00 -3.244348e+00 -1.171232e+01 8.731743e-02 - 8.490000e+00 -3.123134e+00 -1.172613e+01 8.740456e-02 - 8.500000e+00 -2.935929e+00 -1.173994e+01 8.729860e-02 - 8.510000e+00 -2.689061e+00 -1.175375e+01 8.703170e-02 - 8.520000e+00 -2.390808e+00 -1.176757e+01 8.669304e-02 - 8.530000e+00 -2.051063e+00 -1.178138e+01 8.639925e-02 - 8.540000e+00 -1.680950e+00 -1.179519e+01 8.625415e-02 - 8.550000e+00 -1.292393e+00 -1.180900e+01 8.631147e-02 - 8.560000e+00 -8.976655e-01 -1.182281e+01 8.655493e-02 - 8.570000e+00 -5.089507e-01 -1.183662e+01 8.690379e-02 - 8.580000e+00 -1.379157e-01 -1.185044e+01 8.724170e-02 - 8.590000e+00 2.046711e-01 -1.186425e+01 8.745698e-02 - 8.600000e+00 5.092724e-01 -1.187806e+01 8.747997e-02 - 8.610000e+00 7.678529e-01 -1.189187e+01 8.730537e-02 - 8.620000e+00 9.740860e-01 -1.190568e+01 8.699360e-02 - 8.630000e+00 1.123495e+00 -1.191949e+01 8.665084e-02 - 8.640000e+00 1.213531e+00 -1.193331e+01 8.639336e-02 - 8.650000e+00 1.243602e+00 -1.194712e+01 8.630718e-02 - 8.660000e+00 1.215045e+00 -1.196093e+01 8.641768e-02 - 8.670000e+00 1.131068e+00 -1.197474e+01 8.668092e-02 - 8.680000e+00 9.966652e-01 -1.198855e+01 8.700042e-02 - 8.690000e+00 8.184972e-01 -1.200236e+01 8.726226e-02 - 8.700000e+00 6.047687e-01 -1.201618e+01 8.737496e-02 - 8.710000e+00 3.650812e-01 -1.202999e+01 8.730014e-02 - 8.720000e+00 1.102728e-01 -1.204380e+01 8.706510e-02 - 8.730000e+00 -1.477617e-01 -1.205761e+01 8.675349e-02 - 8.740000e+00 -3.962768e-01 -1.207142e+01 8.647706e-02 - 8.750000e+00 -6.219127e-01 -1.208524e+01 8.633674e-02 - 8.760000e+00 -8.109697e-01 -1.209905e+01 8.638627e-02 - 8.770000e+00 -9.497260e-01 -1.211286e+01 8.661224e-02 - 8.780000e+00 -1.024799e+00 -1.212667e+01 8.693873e-02 - 8.790000e+00 -1.023552e+00 -1.214048e+01 8.725461e-02 - 8.800000e+00 -9.345354e-01 -1.215429e+01 8.745244e-02 - 8.810000e+00 -7.479563e-01 -1.216811e+01 8.746492e-02 - 8.820000e+00 -4.561570e-01 -1.218192e+01 8.728703e-02 - 8.830000e+00 -5.408176e-02 -1.219573e+01 8.697780e-02 - 8.840000e+00 4.602920e-01 -1.220954e+01 8.664106e-02 - 8.850000e+00 1.085586e+00 -1.222335e+01 8.639072e-02 - 8.860000e+00 1.816743e+00 -1.223716e+01 8.631117e-02 - 8.870000e+00 2.644869e+00 -1.225098e+01 8.642725e-02 - 8.880000e+00 3.557207e+00 -1.226479e+01 8.669538e-02 - 8.890000e+00 4.537280e+00 -1.227860e+01 8.701972e-02 - 8.900000e+00 5.565186e+00 -1.229241e+01 8.728657e-02 - 8.910000e+00 6.618072e+00 -1.230622e+01 8.740369e-02 - 8.920000e+00 7.670763e+00 -1.232003e+01 8.733101e-02 - 8.930000e+00 8.696530e+00 -1.233385e+01 8.709356e-02 - 8.940000e+00 9.667974e+00 -1.234766e+01 8.677302e-02 - 8.950000e+00 1.055799e+01 -1.236147e+01 8.648046e-02 - 8.960000e+00 1.134075e+01 -1.237528e+01 8.631808e-02 - 8.970000e+00 1.199270e+01 -1.238909e+01 8.634303e-02 - 8.980000e+00 1.249350e+01 -1.240290e+01 8.654665e-02 - 8.990000e+00 1.282679e+01 -1.241672e+01 8.685784e-02 - 9.000000e+00 1.298090e+01 -1.243053e+01 8.716892e-02 - 9.010000e+00 1.294932e+01 -1.244434e+01 8.737363e-02 - 9.020000e+00 1.273097e+01 -1.245815e+01 8.740326e-02 - 9.030000e+00 1.233022e+01 -1.247196e+01 8.724920e-02 - 9.040000e+00 1.175672e+01 -1.248577e+01 8.696564e-02 - 9.050000e+00 1.102496e+01 -1.249959e+01 8.665154e-02 - 9.060000e+00 1.015368e+01 -1.251340e+01 8.641715e-02 - 9.070000e+00 9.165054e+00 -1.252721e+01 8.634552e-02 - 9.080000e+00 8.083764e+00 -1.254102e+01 8.646260e-02 - 9.090000e+00 6.936027e+00 -1.255483e+01 8.672781e-02 - 9.100000e+00 5.748546e+00 -1.256864e+01 8.704891e-02 - 9.110000e+00 4.547501e+00 -1.258246e+01 8.731494e-02 - 9.120000e+00 3.357612e+00 -1.259627e+01 8.743453e-02 - 9.130000e+00 2.201315e+00 -1.261008e+01 8.736635e-02 - 9.140000e+00 1.098084e+00 -1.262389e+01 8.713241e-02 - 9.150000e+00 6.393724e-02 -1.263770e+01 8.681078e-02 - 9.160000e+00 -8.888679e-01 -1.265151e+01 8.650957e-02 - 9.170000e+00 -1.751948e+00 -1.266533e+01 8.633011e-02 - 9.180000e+00 -2.520712e+00 -1.267914e+01 8.633136e-02 - 9.190000e+00 -3.194120e+00 -1.269295e+01 8.650901e-02 - 9.200000e+00 -3.774287e+00 -1.270676e+01 8.679761e-02 - 9.210000e+00 -4.265986e+00 -1.272057e+01 8.709484e-02 - 9.220000e+00 -4.676078e+00 -1.273438e+01 8.729798e-02 - 9.230000e+00 -5.012897e+00 -1.274820e+01 8.733918e-02 - 9.240000e+00 -5.285654e+00 -1.276201e+01 8.720785e-02 - 9.250000e+00 -5.503858e+00 -1.277582e+01 8.695382e-02 - 9.260000e+00 -5.676820e+00 -1.278963e+01 8.667035e-02 - 9.270000e+00 -5.813222e+00 -1.280344e+01 8.646195e-02 - 9.280000e+00 -5.920798e+00 -1.281725e+01 8.640730e-02 - 9.290000e+00 -6.006108e+00 -1.283107e+01 8.653038e-02 - 9.300000e+00 -6.074419e+00 -1.284488e+01 8.679133e-02 - 9.310000e+00 -6.129667e+00 -1.285869e+01 8.710062e-02 - 9.320000e+00 -6.174503e+00 -1.287250e+01 8.735094e-02 - 9.330000e+00 -6.210392e+00 -1.288631e+01 8.745438e-02 - 9.340000e+00 -6.237755e+00 -1.290013e+01 8.737209e-02 - 9.350000e+00 -6.256124e+00 -1.291394e+01 8.712738e-02 - 9.360000e+00 -6.264304e+00 -1.292775e+01 8.679863e-02 - 9.370000e+00 -6.260523e+00 -1.294156e+01 8.649375e-02 - 9.380000e+00 -6.242561e+00 -1.295537e+01 8.631371e-02 - 9.390000e+00 -6.207852e+00 -1.296918e+01 8.631735e-02 - 9.400000e+00 -6.153565e+00 -1.298300e+01 8.650032e-02 - 9.410000e+00 -6.076659e+00 -1.299681e+01 8.679699e-02 - 9.420000e+00 -5.973936e+00 -1.301062e+01 8.710424e-02 - 9.430000e+00 -5.842086e+00 -1.302443e+01 8.731774e-02 - 9.440000e+00 -5.677740e+00 -1.303824e+01 8.736720e-02 - 9.450000e+00 -5.477554e+00 -1.305205e+01 8.723917e-02 - 9.460000e+00 -5.238312e+00 -1.306587e+01 8.698093e-02 - 9.470000e+00 -4.957070e+00 -1.307968e+01 8.668442e-02 - 9.480000e+00 -4.631329e+00 -1.309349e+01 8.645490e-02 - 9.490000e+00 -4.259246e+00 -1.310730e+01 8.637421e-02 - 9.500000e+00 -3.839860e+00 -1.312111e+01 8.647142e-02 - 9.510000e+00 -3.373332e+00 -1.313492e+01 8.671246e-02 - 9.520000e+00 -2.861170e+00 -1.314874e+01 8.701277e-02 - 9.530000e+00 -2.306436e+00 -1.316255e+01 8.726783e-02 - 9.540000e+00 -1.713899e+00 -1.317636e+01 8.738967e-02 - 9.550000e+00 -1.090124e+00 -1.319017e+01 8.733651e-02 - 9.560000e+00 -4.434820e-01 -1.320398e+01 8.712656e-02 - 9.570000e+00 2.159325e-01 -1.321779e+01 8.683195e-02 - 9.580000e+00 8.764886e-01 -1.323161e+01 8.655460e-02 - 9.590000e+00 1.525300e+00 -1.324542e+01 8.639119e-02 - 9.600000e+00 2.148600e+00 -1.325923e+01 8.639887e-02 - 9.610000e+00 2.732200e+00 -1.327304e+01 8.657453e-02 - 9.620000e+00 3.262001e+00 -1.328685e+01 8.685595e-02 - 9.630000e+00 3.724542e+00 -1.330066e+01 8.714429e-02 - 9.640000e+00 4.107565e+00 -1.331448e+01 8.733899e-02 - 9.650000e+00 4.400543e+00 -1.332829e+01 8.737213e-02 - 9.660000e+00 4.595165e+00 -1.334210e+01 8.723101e-02 - 9.670000e+00 4.685740e+00 -1.335591e+01 8.696239e-02 - 9.680000e+00 4.669497e+00 -1.336972e+01 8.665720e-02 - 9.690000e+00 4.546759e+00 -1.338353e+01 8.642001e-02 - 9.700000e+00 4.320990e+00 -1.339735e+01 8.633296e-02 - 9.710000e+00 3.998700e+00 -1.341116e+01 8.642649e-02 - 9.720000e+00 3.589214e+00 -1.342497e+01 8.666849e-02 - 9.730000e+00 3.104320e+00 -1.343878e+01 8.697614e-02 - 9.740000e+00 2.557813e+00 -1.345259e+01 8.724548e-02 - 9.750000e+00 1.964951e+00 -1.346640e+01 8.738734e-02 - 9.760000e+00 1.341861e+00 -1.348022e+01 8.735698e-02 - 9.770000e+00 7.049174e-01 -1.349403e+01 8.716823e-02 - 9.780000e+00 7.012748e-02 -1.350784e+01 8.688841e-02 - 9.790000e+00 -5.474493e-01 -1.352165e+01 8.661543e-02 - 9.800000e+00 -1.134219e+00 -1.353546e+01 8.644403e-02 - 9.810000e+00 -1.678491e+00 -1.354927e+01 8.643230e-02 - 9.820000e+00 -2.170806e+00 -1.356309e+01 8.658090e-02 - 9.830000e+00 -2.604164e+00 -1.357690e+01 8.683326e-02 - 9.840000e+00 -2.974131e+00 -1.359071e+01 8.709657e-02 - 9.850000e+00 -3.278823e+00 -1.360452e+01 8.727520e-02 - 9.860000e+00 -3.518798e+00 -1.361833e+01 8.730399e-02 - 9.870000e+00 -3.696842e+00 -1.363215e+01 8.717051e-02 - 9.880000e+00 -3.817675e+00 -1.364596e+01 8.691943e-02 - 9.890000e+00 -3.887602e+00 -1.365977e+01 8.663786e-02 - 9.900000e+00 -3.914115e+00 -1.367358e+01 8.642579e-02 - 9.910000e+00 -3.905480e+00 -1.368739e+01 8.636104e-02 - 9.920000e+00 -3.870320e+00 -1.370120e+01 8.647090e-02 - 9.930000e+00 -3.817203e+00 -1.371502e+01 8.672179e-02 - 9.940000e+00 -3.754274e+00 -1.372883e+01 8.703094e-02 - 9.950000e+00 -3.688918e+00 -1.374264e+01 8.729552e-02 - 9.960000e+00 -3.627475e+00 -1.375645e+01 8.742791e-02 - 9.970000e+00 -3.575013e+00 -1.377026e+01 8.738488e-02 - 9.980000e+00 -3.535158e+00 -1.378407e+01 8.718164e-02 - 9.990000e+00 -3.509989e+00 -1.379789e+01 8.688691e-02 - 1.000000e+01 -3.499993e+00 -1.381170e+01 8.660026e-02 - 1.001000e+01 -3.504072e+00 -1.382551e+01 8.641841e-02 - 1.002000e+01 -3.519616e+00 -1.383932e+01 8.640157e-02 - 1.003000e+01 -3.542627e+00 -1.385313e+01 8.655216e-02 - 1.004000e+01 -3.567881e+00 -1.386694e+01 8.681427e-02 - 1.005000e+01 -3.589155e+00 -1.388076e+01 8.709419e-02 - 1.006000e+01 -3.599469e+00 -1.389457e+01 8.729364e-02 - 1.007000e+01 -3.591385e+00 -1.390838e+01 8.734331e-02 - 1.008000e+01 -3.557318e+00 -1.392219e+01 8.722578e-02 - 1.009000e+01 -3.489873e+00 -1.393600e+01 8.698092e-02 - 1.010000e+01 -3.382189e+00 -1.394981e+01 8.669241e-02 - 1.011000e+01 -3.228289e+00 -1.396363e+01 8.645935e-02 - 1.012000e+01 -3.023408e+00 -1.397744e+01 8.636177e-02 - 1.013000e+01 -2.764303e+00 -1.399125e+01 8.643218e-02 - 1.014000e+01 -2.449523e+00 -1.400506e+01 8.664393e-02 - 1.015000e+01 -2.079619e+00 -1.401887e+01 8.692128e-02 - 1.016000e+01 -1.657294e+00 -1.403268e+01 8.716681e-02 - 1.017000e+01 -1.187470e+00 -1.404650e+01 8.729563e-02 - 1.018000e+01 -6.772696e-01 -1.406031e+01 8.726425e-02 - 1.019000e+01 -1.358937e-01 -1.407412e+01 8.708504e-02 - 1.020000e+01 4.255869e-01 -1.408793e+01 8.682200e-02 - 1.021000e+01 9.945439e-01 -1.410174e+01 8.656929e-02 - 1.022000e+01 1.557189e+00 -1.411555e+01 8.641868e-02 - 1.023000e+01 2.099047e+00 -1.412937e+01 8.642691e-02 - 1.024000e+01 2.605490e+00 -1.414318e+01 8.659488e-02 - 1.025000e+01 3.062306e+00 -1.415699e+01 8.686709e-02 - 1.026000e+01 3.456283e+00 -1.417080e+01 8.715138e-02 - 1.027000e+01 3.775775e+00 -1.418461e+01 8.735130e-02 - 1.028000e+01 4.011229e+00 -1.419842e+01 8.739897e-02 - 1.029000e+01 4.155640e+00 -1.421224e+01 8.727770e-02 - 1.030000e+01 4.204914e+00 -1.422605e+01 8.702751e-02 - 1.031000e+01 4.158113e+00 -1.423986e+01 8.673214e-02 - 1.032000e+01 4.017568e+00 -1.425367e+01 8.649118e-02 - 1.033000e+01 3.788855e+00 -1.426748e+01 8.638585e-02 - 1.034000e+01 3.480622e+00 -1.428129e+01 8.645047e-02 - 1.035000e+01 3.104278e+00 -1.429511e+01 8.666030e-02 - 1.036000e+01 2.673553e+00 -1.430892e+01 8.694084e-02 - 1.037000e+01 2.203951e+00 -1.432273e+01 8.719458e-02 - 1.038000e+01 1.712118e+00 -1.433654e+01 8.733498e-02 - 1.039000e+01 1.215153e+00 -1.435035e+01 8.731546e-02 - 1.040000e+01 7.298949e-01 -1.436417e+01 8.714454e-02 - 1.041000e+01 2.722260e-01 -1.437798e+01 8.688261e-02 - 1.042000e+01 -1.435834e-01 -1.439179e+01 8.662157e-02 - 1.043000e+01 -5.054535e-01 -1.440560e+01 8.645317e-02 - 1.044000e+01 -8.039674e-01 -1.441941e+01 8.643676e-02 - 1.045000e+01 -1.032717e+00 -1.443322e+01 8.657798e-02 - 1.046000e+01 -1.188507e+00 -1.444704e+01 8.682686e-02 - 1.047000e+01 -1.271401e+00 -1.446085e+01 8.709613e-02 - 1.048000e+01 -1.284622e+00 -1.447466e+01 8.729218e-02 - 1.049000e+01 -1.234299e+00 -1.448847e+01 8.734732e-02 - 1.050000e+01 -1.129080e+00 -1.450228e+01 8.724243e-02 - 1.051000e+01 -9.796357e-01 -1.451609e+01 8.701305e-02 - 1.052000e+01 -7.980667e-01 -1.452991e+01 8.673757e-02 - 1.053000e+01 -5.972583e-01 -1.454372e+01 8.651054e-02 - 1.054000e+01 -3.902032e-01 -1.455753e+01 8.640985e-02 - 1.055000e+01 -1.893300e-01 -1.457134e+01 8.646890e-02 - 1.056000e+01 -5.868969e-03 -1.458515e+01 8.666457e-02 - 1.057000e+01 1.507162e-01 -1.459896e+01 8.692576e-02 - 1.058000e+01 2.732033e-01 -1.461278e+01 8.715906e-02 - 1.059000e+01 3.569721e-01 -1.462659e+01 8.728155e-02 - 1.060000e+01 4.002350e-01 -1.464040e+01 8.724917e-02 - 1.061000e+01 4.041267e-01 -1.465421e+01 8.707157e-02 - 1.062000e+01 3.726514e-01 -1.466802e+01 8.680913e-02 - 1.063000e+01 3.124882e-01 -1.468183e+01 8.655297e-02 - 1.064000e+01 2.326669e-01 -1.469565e+01 8.639387e-02 - 1.065000e+01 1.441274e-01 -1.470946e+01 8.639026e-02 - 1.066000e+01 5.918253e-02 -1.472327e+01 8.654709e-02 - 1.067000e+01 -9.089408e-03 -1.473708e+01 8.681372e-02 - 1.068000e+01 -4.749838e-02 -1.475089e+01 8.710195e-02 - 1.069000e+01 -4.341128e-02 -1.476470e+01 8.731675e-02 - 1.070000e+01 1.459279e-02 -1.477852e+01 8.738842e-02 - 1.071000e+01 1.361100e-01 -1.479233e+01 8.729542e-02 - 1.072000e+01 3.283693e-01 -1.480614e+01 8.707112e-02 - 1.073000e+01 5.957845e-01 -1.481995e+01 8.679261e-02 - 1.074000e+01 9.396214e-01 -1.483376e+01 8.655478e-02 - 1.075000e+01 1.357797e+00 -1.484757e+01 8.643778e-02 - 1.076000e+01 1.844820e+00 -1.486139e+01 8.647898e-02 - 1.077000e+01 2.391879e+00 -1.487520e+01 8.665995e-02 - 1.078000e+01 2.987079e+00 -1.488901e+01 8.691370e-02 - 1.079000e+01 3.615810e+00 -1.490282e+01 8.714917e-02 - 1.080000e+01 4.261249e+00 -1.491663e+01 8.728329e-02 - 1.081000e+01 4.904966e+00 -1.493044e+01 8.726934e-02 - 1.082000e+01 5.527609e+00 -1.494426e+01 8.711234e-02 - 1.083000e+01 6.109646e+00 -1.495807e+01 8.686715e-02 - 1.084000e+01 6.632134e+00 -1.497188e+01 8.661987e-02 - 1.085000e+01 7.077476e+00 -1.498569e+01 8.645806e-02 - 1.086000e+01 7.430133e+00 -1.499950e+01 8.643983e-02 - 1.087000e+01 7.677269e+00 -1.501331e+01 8.657274e-02 - 1.088000e+01 7.809287e+00 -1.502713e+01 8.681111e-02 - 1.089000e+01 7.820243e+00 -1.504094e+01 8.707253e-02 - 1.090000e+01 7.708102e+00 -1.505475e+01 8.726713e-02 - 1.091000e+01 7.474844e+00 -1.506856e+01 8.732861e-02 - 1.092000e+01 7.126393e+00 -1.508237e+01 8.723654e-02 - 1.093000e+01 6.672383e+00 -1.509619e+01 8.702312e-02 - 1.094000e+01 6.125769e+00 -1.511000e+01 8.676251e-02 - 1.095000e+01 5.502291e+00 -1.512381e+01 8.654572e-02 - 1.096000e+01 4.819826e+00 -1.513762e+01 8.644903e-02 - 1.097000e+01 4.097651e+00 -1.515143e+01 8.650673e-02 - 1.098000e+01 3.355657e+00 -1.516524e+01 8.669867e-02 - 1.099000e+01 2.613538e+00 -1.517906e+01 8.695747e-02 - 1.100000e+01 1.890007e+00 -1.519287e+01 8.719265e-02 - 1.101000e+01 1.202072e+00 -1.520668e+01 8.732212e-02 - 1.102000e+01 5.644048e-01 -1.522049e+01 8.730016e-02 - 1.103000e+01 -1.117578e-02 -1.523430e+01 8.713260e-02 - 1.104000e+01 -5.160635e-01 -1.524811e+01 8.687511e-02 - 1.105000e+01 -9.450700e-01 -1.526193e+01 8.661474e-02 - 1.106000e+01 -1.296459e+00 -1.527574e+01 8.644044e-02 - 1.107000e+01 -1.571811e+00 -1.528955e+01 8.641206e-02 - 1.108000e+01 -1.775734e+00 -1.530336e+01 8.653895e-02 - 1.109000e+01 -1.915430e+00 -1.531717e+01 8.677666e-02 - 1.110000e+01 -2.000150e+00 -1.533098e+01 8.704302e-02 - 1.111000e+01 -2.040561e+00 -1.534480e+01 8.724705e-02 - 1.112000e+01 -2.048072e+00 -1.535861e+01 8.732011e-02 - 1.113000e+01 -2.034146e+00 -1.537242e+01 8.723861e-02 - 1.114000e+01 -2.009629e+00 -1.538623e+01 8.703151e-02 - 1.115000e+01 -1.984157e+00 -1.540004e+01 8.677052e-02 - 1.116000e+01 -1.965642e+00 -1.541385e+01 8.654577e-02 - 1.117000e+01 -1.959882e+00 -1.542767e+01 8.643477e-02 - 1.118000e+01 -1.970309e+00 -1.544148e+01 8.647500e-02 - 1.119000e+01 -1.997881e+00 -1.545529e+01 8.665064e-02 - 1.120000e+01 -2.041129e+00 -1.546910e+01 8.689860e-02 - 1.121000e+01 -2.096343e+00 -1.548291e+01 8.713137e-02 - 1.122000e+01 -2.157899e+00 -1.549672e+01 8.726780e-02 - 1.123000e+01 -2.218678e+00 -1.551054e+01 8.726082e-02 - 1.124000e+01 -2.270590e+00 -1.552435e+01 8.711302e-02 - 1.125000e+01 -2.305135e+00 -1.553816e+01 8.687573e-02 - 1.126000e+01 -2.313987e+00 -1.555197e+01 8.663170e-02 - 1.127000e+01 -2.289573e+00 -1.556578e+01 8.646671e-02 - 1.128000e+01 -2.225594e+00 -1.557959e+01 8.643942e-02 - 1.129000e+01 -2.117479e+00 -1.559341e+01 8.656027e-02 - 1.130000e+01 -1.962742e+00 -1.560722e+01 8.678773e-02 - 1.131000e+01 -1.761217e+00 -1.562103e+01 8.704332e-02 - 1.132000e+01 -1.515167e+00 -1.563484e+01 8.723945e-02 - 1.133000e+01 -1.229262e+00 -1.564865e+01 8.730965e-02 - 1.134000e+01 -9.104208e-01 -1.566246e+01 8.723088e-02 - 1.135000e+01 -5.675403e-01 -1.567628e+01 8.703110e-02 - 1.136000e+01 -2.111127e-01 -1.569009e+01 8.677987e-02 - 1.137000e+01 1.472366e-01 -1.570390e+01 8.656488e-02 - 1.138000e+01 4.952728e-01 -1.571771e+01 8.646148e-02 - 1.139000e+01 8.207056e-01 -1.573152e+01 8.650596e-02 - 1.140000e+01 1.111748e+00 -1.574533e+01 8.668240e-02 - 1.141000e+01 1.357647e+00 -1.575915e+01 8.692850e-02 - 1.142000e+01 1.549171e+00 -1.577296e+01 8.715797e-02 - 1.143000e+01 1.679013e+00 -1.578677e+01 8.729070e-02 - 1.144000e+01 1.742111e+00 -1.580058e+01 8.728018e-02 - 1.145000e+01 1.735857e+00 -1.581439e+01 8.712905e-02 - 1.146000e+01 1.660190e+00 -1.582820e+01 8.688833e-02 - 1.147000e+01 1.517580e+00 -1.584202e+01 8.664048e-02 - 1.148000e+01 1.312886e+00 -1.585583e+01 8.647135e-02 - 1.149000e+01 1.053117e+00 -1.586964e+01 8.644017e-02 - 1.150000e+01 7.471025e-01 -1.588345e+01 8.655827e-02 - 1.151000e+01 4.050765e-01 -1.589726e+01 8.678499e-02 - 1.152000e+01 3.822206e-02 -1.591108e+01 8.704223e-02 - 1.153000e+01 -3.418258e-01 -1.592489e+01 8.724198e-02 - 1.154000e+01 -7.234805e-01 -1.593870e+01 8.731646e-02 - 1.155000e+01 -1.095689e+00 -1.595251e+01 8.724078e-02 - 1.156000e+01 -1.448379e+00 -1.596632e+01 8.704099e-02 - 1.157000e+01 -1.772845e+00 -1.598013e+01 8.678539e-02 - 1.158000e+01 -2.062066e+00 -1.599395e+01 8.656163e-02 - 1.159000e+01 -2.310919e+00 -1.600776e+01 8.644656e-02 - 1.160000e+01 -2.516314e+00 -1.602157e+01 8.647927e-02 - 1.161000e+01 -2.677205e+00 -1.603538e+01 8.664723e-02 - 1.162000e+01 -2.794523e+00 -1.604919e+01 8.689108e-02 - 1.163000e+01 -2.870991e+00 -1.606300e+01 8.712607e-02 - 1.164000e+01 -2.910869e+00 -1.607682e+01 8.727177e-02 - 1.165000e+01 -2.919626e+00 -1.609063e+01 8.727937e-02 - 1.166000e+01 -2.903548e+00 -1.610444e+01 8.714783e-02 - 1.167000e+01 -2.869334e+00 -1.611825e+01 8.692387e-02 - 1.168000e+01 -2.823663e+00 -1.613206e+01 8.668616e-02 - 1.169000e+01 -2.772784e+00 -1.614587e+01 8.651824e-02 - 1.170000e+01 -2.722144e+00 -1.615969e+01 8.647921e-02 - 1.171000e+01 -2.676059e+00 -1.617350e+01 8.658254e-02 - 1.172000e+01 -2.637473e+00 -1.618731e+01 8.679125e-02 - 1.173000e+01 -2.607795e+00 -1.620112e+01 8.703142e-02 - 1.174000e+01 -2.586832e+00 -1.621493e+01 8.721852e-02 - 1.175000e+01 -2.572831e+00 -1.622874e+01 8.728674e-02 - 1.176000e+01 -2.562607e+00 -1.624256e+01 8.721136e-02 - 1.177000e+01 -2.551775e+00 -1.625637e+01 8.701698e-02 - 1.178000e+01 -2.535058e+00 -1.627018e+01 8.676945e-02 - 1.179000e+01 -2.506656e+00 -1.628399e+01 8.655367e-02 - 1.180000e+01 -2.460660e+00 -1.629780e+01 8.644429e-02 - 1.181000e+01 -2.391487e+00 -1.631161e+01 8.647926e-02 - 1.182000e+01 -2.294308e+00 -1.632543e+01 8.664617e-02 - 1.183000e+01 -2.165445e+00 -1.633924e+01 8.688672e-02 - 1.184000e+01 -2.002710e+00 -1.635305e+01 8.711760e-02 - 1.185000e+01 -1.805678e+00 -1.636686e+01 8.725964e-02 - 1.186000e+01 -1.575853e+00 -1.638067e+01 8.726476e-02 - 1.187000e+01 -1.316743e+00 -1.639448e+01 8.713197e-02 - 1.188000e+01 -1.033807e+00 -1.640830e+01 8.690762e-02 - 1.189000e+01 -7.343041e-01 -1.642211e+01 8.666991e-02 - 1.190000e+01 -4.270274e-01 -1.643592e+01 8.650215e-02 - 1.191000e+01 -1.219464e-01 -1.644973e+01 8.646365e-02 - 1.192000e+01 1.702256e-01 -1.646354e+01 8.656845e-02 - 1.193000e+01 4.385179e-01 -1.647735e+01 8.678025e-02 - 1.194000e+01 6.722155e-01 -1.649117e+01 8.702549e-02 - 1.195000e+01 8.613718e-01 -1.650498e+01 8.721939e-02 - 1.196000e+01 9.972917e-01 -1.651879e+01 8.729525e-02 - 1.197000e+01 1.072960e+00 -1.653260e+01 8.722691e-02 - 1.198000e+01 1.083388e+00 -1.654641e+01 8.703750e-02 - 1.199000e+01 1.025863e+00 -1.656022e+01 8.679182e-02 - 1.200000e+01 9.000883e-01 -1.657404e+01 8.657464e-02 - 1.201000e+01 7.081926e-01 -1.658785e+01 8.646157e-02 - 1.202000e+01 4.546330e-01 -1.660166e+01 8.649249e-02 - 1.203000e+01 1.459752e-01 -1.661547e+01 8.665720e-02 - 1.204000e+01 -2.094234e-01 -1.662928e+01 8.689918e-02 - 1.205000e+01 -6.018116e-01 -1.664310e+01 8.713577e-02 - 1.206000e+01 -1.020500e+00 -1.665691e+01 8.728698e-02 - 1.207000e+01 -1.454349e+00 -1.667072e+01 8.730257e-02 - 1.208000e+01 -1.892254e+00 -1.668453e+01 8.717861e-02 - 1.209000e+01 -2.323611e+00 -1.669834e+01 8.695856e-02 - 1.210000e+01 -2.738726e+00 -1.671215e+01 8.671861e-02 - 1.211000e+01 -3.129152e+00 -1.672597e+01 8.654174e-02 - 1.212000e+01 -3.487930e+00 -1.673978e+01 8.648877e-02 - 1.213000e+01 -3.809734e+00 -1.675359e+01 8.657682e-02 - 1.214000e+01 -4.090900e+00 -1.676740e+01 8.677324e-02 - 1.215000e+01 -4.329355e+00 -1.678121e+01 8.700753e-02 - 1.216000e+01 -4.524443e+00 -1.679502e+01 8.719647e-02 - 1.217000e+01 -4.676680e+00 -1.680884e+01 8.727295e-02 - 1.218000e+01 -4.787434e+00 -1.682265e+01 8.720863e-02 - 1.219000e+01 -4.858581e+00 -1.683646e+01 8.702334e-02 - 1.220000e+01 -4.892147e+00 -1.685027e+01 8.677848e-02 - 1.221000e+01 -4.889964e+00 -1.686408e+01 8.655639e-02 - 1.222000e+01 -4.853374e+00 -1.687789e+01 8.643217e-02 - 1.223000e+01 -4.782995e+00 -1.689171e+01 8.644725e-02 - 1.224000e+01 -4.678572e+00 -1.690552e+01 8.659482e-02 - 1.225000e+01 -4.538928e+00 -1.691933e+01 8.682247e-02 - 1.226000e+01 -4.362009e+00 -1.693314e+01 8.705119e-02 - 1.227000e+01 -4.145042e+00 -1.694695e+01 8.720315e-02 - 1.228000e+01 -3.884773e+00 -1.696076e+01 8.722833e-02 - 1.229000e+01 -3.577793e+00 -1.697458e+01 8.712105e-02 - 1.230000e+01 -3.220920e+00 -1.698839e+01 8.692162e-02 - 1.231000e+01 -2.811608e+00 -1.700220e+01 8.670249e-02 - 1.232000e+01 -2.348369e+00 -1.701601e+01 8.654327e-02 - 1.233000e+01 -1.831168e+00 -1.702982e+01 8.650268e-02 - 1.234000e+01 -1.261761e+00 -1.704363e+01 8.659741e-02 - 1.235000e+01 -6.439623e-01 -1.705745e+01 8.679596e-02 - 1.236000e+01 1.619533e-02 -1.707126e+01 8.702998e-02 - 1.237000e+01 7.104125e-01 -1.708507e+01 8.721853e-02 - 1.238000e+01 1.428205e+00 -1.709888e+01 8.729621e-02 - 1.239000e+01 2.157113e+00 -1.711269e+01 8.723538e-02 - 1.240000e+01 2.883035e+00 -1.712650e+01 8.705554e-02 - 1.241000e+01 3.590672e+00 -1.714032e+01 8.681702e-02 - 1.242000e+01 4.264062e+00 -1.715413e+01 8.660088e-02 - 1.243000e+01 4.887185e+00 -1.716794e+01 8.648117e-02 - 1.244000e+01 5.444599e+00 -1.718175e+01 8.649889e-02 - 1.245000e+01 5.922081e+00 -1.719556e+01 8.664741e-02 - 1.246000e+01 6.307240e+00 -1.720937e+01 8.687486e-02 - 1.247000e+01 6.590063e+00 -1.722319e+01 8.710268e-02 - 1.248000e+01 6.763375e+00 -1.723700e+01 8.725305e-02 - 1.249000e+01 6.823174e+00 -1.725081e+01 8.727533e-02 - 1.250000e+01 6.768833e+00 -1.726462e+01 8.716280e-02 - 1.251000e+01 6.603155e+00 -1.727843e+01 8.695464e-02 - 1.252000e+01 6.332272e+00 -1.729224e+01 8.672268e-02 - 1.253000e+01 5.965397e+00 -1.730606e+01 8.654691e-02 - 1.254000e+01 5.514443e+00 -1.731987e+01 8.648757e-02 - 1.255000e+01 4.993524e+00 -1.733368e+01 8.656378e-02 - 1.256000e+01 4.418364e+00 -1.734749e+01 8.674682e-02 - 1.257000e+01 3.805654e+00 -1.736130e+01 8.697064e-02 - 1.258000e+01 3.172377e+00 -1.737512e+01 8.715550e-02 - 1.259000e+01 2.535149e+00 -1.738893e+01 8.723579e-02 - 1.260000e+01 1.909600e+00 -1.740274e+01 8.718240e-02 - 1.261000e+01 1.309839e+00 -1.741655e+01 8.701253e-02 - 1.262000e+01 7.480110e-01 -1.743036e+01 8.678406e-02 - 1.263000e+01 2.339870e-01 -1.744417e+01 8.657617e-02 - 1.264000e+01 -2.248141e-01 -1.745799e+01 8.646206e-02 - 1.265000e+01 -6.234624e-01 -1.747180e+01 8.648318e-02 - 1.266000e+01 -9.594159e-01 -1.748561e+01 8.663426e-02 - 1.267000e+01 -1.232294e+00 -1.749942e+01 8.686518e-02 - 1.268000e+01 -1.443546e+00 -1.751323e+01 8.709868e-02 - 1.269000e+01 -1.596039e+00 -1.752704e+01 8.725726e-02 - 1.270000e+01 -1.693595e+00 -1.754086e+01 8.728943e-02 - 1.271000e+01 -1.740512e+00 -1.755467e+01 8.718665e-02 - 1.272000e+01 -1.741106e+00 -1.756848e+01 8.698587e-02 - 1.273000e+01 -1.699295e+00 -1.758229e+01 8.675708e-02 - 1.274000e+01 -1.618267e+00 -1.759610e+01 8.657944e-02 - 1.275000e+01 -1.500248e+00 -1.760991e+01 8.651388e-02 - 1.276000e+01 -1.346380e+00 -1.762373e+01 8.658162e-02 - 1.277000e+01 -1.156738e+00 -1.763754e+01 8.675681e-02 - 1.278000e+01 -9.304549e-01 -1.765135e+01 8.697617e-02 - 1.279000e+01 -6.659689e-01 -1.766516e+01 8.716167e-02 - 1.280000e+01 -3.613674e-01 -1.767897e+01 8.724787e-02 - 1.281000e+01 -1.479615e-02 -1.769278e+01 8.720413e-02 - 1.282000e+01 3.750883e-01 -1.770660e+01 8.704486e-02 - 1.283000e+01 8.086627e-01 -1.772041e+01 8.682463e-02 - 1.284000e+01 1.284911e+00 -1.773422e+01 8.661965e-02 - 1.285000e+01 1.801066e+00 -1.774803e+01 8.650142e-02 - 1.286000e+01 2.352344e+00 -1.776184e+01 8.651145e-02 - 1.287000e+01 2.931804e+00 -1.777565e+01 8.664630e-02 - 1.288000e+01 3.530348e+00 -1.778947e+01 8.685881e-02 - 1.289000e+01 4.136866e+00 -1.780328e+01 8.707494e-02 - 1.290000e+01 4.738538e+00 -1.781709e+01 8.721979e-02 - 1.291000e+01 5.321262e+00 -1.783090e+01 8.724332e-02 - 1.292000e+01 5.870205e+00 -1.784471e+01 8.713713e-02 - 1.293000e+01 6.370443e+00 -1.785852e+01 8.693730e-02 - 1.294000e+01 6.807651e+00 -1.787234e+01 8.671240e-02 - 1.295000e+01 7.168799e+00 -1.788615e+01 8.654021e-02 - 1.296000e+01 7.442828e+00 -1.789996e+01 8.648076e-02 - 1.297000e+01 7.621238e+00 -1.791377e+01 8.655504e-02 - 1.298000e+01 7.698580e+00 -1.792758e+01 8.673754e-02 - 1.299000e+01 7.672791e+00 -1.794139e+01 8.696542e-02 - 1.300000e+01 7.545364e+00 -1.795521e+01 8.716080e-02 - 1.301000e+01 7.321336e+00 -1.796902e+01 8.725769e-02 - 1.302000e+01 7.009091e+00 -1.798283e+01 8.722421e-02 - 1.303000e+01 6.619978e+00 -1.799664e+01 8.707300e-02 - 1.304000e+01 6.167776e+00 -1.801045e+01 8.685689e-02 - 1.305000e+01 5.668028e+00 -1.802426e+01 8.665092e-02 - 1.306000e+01 5.137281e+00 -1.803808e+01 8.652655e-02 - 1.307000e+01 4.592276e+00 -1.805189e+01 8.652657e-02 - 1.308000e+01 4.049143e+00 -1.806570e+01 8.664985e-02 - 1.309000e+01 3.522635e+00 -1.807951e+01 8.685195e-02 - 1.310000e+01 3.025452e+00 -1.809332e+01 8.706123e-02 - 1.311000e+01 2.567700e+00 -1.810714e+01 8.720411e-02 - 1.312000e+01 2.156499e+00 -1.812095e+01 8.723055e-02 - 1.313000e+01 1.795783e+00 -1.813476e+01 8.713085e-02 - 1.314000e+01 1.486275e+00 -1.814857e+01 8.693898e-02 - 1.315000e+01 1.225663e+00 -1.816238e+01 8.672112e-02 - 1.316000e+01 1.008933e+00 -1.817619e+01 8.655317e-02 - 1.317000e+01 8.288618e-01 -1.819001e+01 8.649430e-02 - 1.318000e+01 6.766120e-01 -1.820382e+01 8.656584e-02 - 1.319000e+01 5.424062e-01 -1.821763e+01 8.674359e-02 - 1.320000e+01 4.162247e-01 -1.823144e+01 8.696646e-02 - 1.321000e+01 2.884859e-01 -1.824525e+01 8.715806e-02 - 1.322000e+01 1.506670e-01 -1.825906e+01 8.725317e-02 - 1.323000e+01 -4.176142e-03 -1.827288e+01 8.721970e-02 - 1.324000e+01 -1.810185e-01 -1.828669e+01 8.706934e-02 - 1.325000e+01 -3.826260e-01 -1.830050e+01 8.685354e-02 - 1.326000e+01 -6.094786e-01 -1.831431e+01 8.664622e-02 - 1.327000e+01 -8.598531e-01 -1.832812e+01 8.651835e-02 - 1.328000e+01 -1.130056e+00 -1.834193e+01 8.651319e-02 - 1.329000e+01 -1.414786e+00 -1.835575e+01 8.663091e-02 - 1.330000e+01 -1.707590e+00 -1.836956e+01 8.682878e-02 - 1.331000e+01 -2.001388e+00 -1.838337e+01 8.703661e-02 - 1.332000e+01 -2.289020e+00 -1.839718e+01 8.718159e-02 - 1.333000e+01 -2.563773e+00 -1.841099e+01 8.721341e-02 - 1.334000e+01 -2.819863e+00 -1.842480e+01 8.712116e-02 - 1.335000e+01 -3.052826e+00 -1.843862e+01 8.693697e-02 - 1.336000e+01 -3.259805e+00 -1.845243e+01 8.672516e-02 - 1.337000e+01 -3.439707e+00 -1.846624e+01 8.656022e-02 - 1.338000e+01 -3.593226e+00 -1.848005e+01 8.650086e-02 - 1.339000e+01 -3.722743e+00 -1.849386e+01 8.656903e-02 - 1.340000e+01 -3.832096e+00 -1.850767e+01 8.674195e-02 - 1.341000e+01 -3.926265e+00 -1.852149e+01 8.696027e-02 - 1.342000e+01 -4.010981e+00 -1.853530e+01 8.714905e-02 - 1.343000e+01 -4.092286e+00 -1.854911e+01 8.724376e-02 - 1.344000e+01 -4.176105e+00 -1.856292e+01 8.721219e-02 - 1.345000e+01 -4.267821e+00 -1.857673e+01 8.706518e-02 - 1.346000e+01 -4.371916e+00 -1.859054e+01 8.685304e-02 - 1.347000e+01 -4.491687e+00 -1.860436e+01 8.664868e-02 - 1.348000e+01 -4.629050e+00 -1.861817e+01 8.652270e-02 - 1.349000e+01 -4.784448e+00 -1.863198e+01 8.651870e-02 - 1.350000e+01 -4.956864e+00 -1.864579e+01 8.663784e-02 - 1.351000e+01 -5.143928e+00 -1.865960e+01 8.683855e-02 - 1.352000e+01 -5.342101e+00 -1.867341e+01 8.705148e-02 - 1.353000e+01 -5.546924e+00 -1.868723e+01 8.720391e-02 - 1.354000e+01 -5.753306e+00 -1.870104e+01 8.724463e-02 - 1.355000e+01 -5.955817e+00 -1.871485e+01 8.716110e-02 - 1.356000e+01 -6.148971e+00 -1.872866e+01 8.698342e-02 - 1.357000e+01 -6.327478e+00 -1.874247e+01 8.677405e-02 - 1.358000e+01 -6.486436e+00 -1.875628e+01 8.660648e-02 - 1.359000e+01 -6.621461e+00 -1.877010e+01 8.653958e-02 - 1.360000e+01 -6.728749e+00 -1.878391e+01 8.659674e-02 - 1.361000e+01 -6.805065e+00 -1.879772e+01 8.675746e-02 - 1.362000e+01 -6.847679e+00 -1.881153e+01 8.696484e-02 - 1.363000e+01 -6.854252e+00 -1.882534e+01 8.714585e-02 - 1.364000e+01 -6.822699e+00 -1.883915e+01 8.723680e-02 - 1.365000e+01 -6.751047e+00 -1.885297e+01 8.720513e-02 - 1.366000e+01 -6.637312e+00 -1.886678e+01 8.706033e-02 - 1.367000e+01 -6.479411e+00 -1.888059e+01 8.685082e-02 - 1.368000e+01 -6.275138e+00 -1.889440e+01 8.664769e-02 - 1.369000e+01 -6.022197e+00 -1.890821e+01 8.652037e-02 - 1.370000e+01 -5.718318e+00 -1.892203e+01 8.651225e-02 - 1.371000e+01 -5.361436e+00 -1.893584e+01 8.662527e-02 - 1.372000e+01 -4.949941e+00 -1.894965e+01 8.681930e-02 - 1.373000e+01 -4.482964e+00 -1.896346e+01 8.702647e-02 - 1.374000e+01 -3.960701e+00 -1.897727e+01 8.717513e-02 - 1.375000e+01 -3.384724e+00 -1.899108e+01 8.721440e-02 - 1.376000e+01 -2.758268e+00 -1.900490e+01 8.713130e-02 - 1.377000e+01 -2.086466e+00 -1.901871e+01 8.695496e-02 - 1.378000e+01 -1.376492e+00 -1.903252e+01 8.674677e-02 - 1.379000e+01 -6.376060e-01 -1.904633e+01 8.657948e-02 - 1.380000e+01 1.189154e-01 -1.906014e+01 8.651187e-02 - 1.381000e+01 8.799825e-01 -1.907395e+01 8.656795e-02 - 1.382000e+01 1.631013e+00 -1.908777e+01 8.672833e-02 - 1.383000e+01 2.356368e+00 -1.910158e+01 8.693729e-02 - 1.384000e+01 3.039881e+00 -1.911539e+01 8.712256e-02 - 1.385000e+01 3.665462e+00 -1.912920e+01 8.722057e-02 - 1.386000e+01 4.217727e+00 -1.914301e+01 8.719805e-02 - 1.387000e+01 4.682640e+00 -1.915682e+01 8.706323e-02 - 1.388000e+01 5.048115e+00 -1.917064e+01 8.686301e-02 - 1.389000e+01 5.304554e+00 -1.918445e+01 8.666718e-02 - 1.390000e+01 5.445279e+00 -1.919826e+01 8.654443e-02 - 1.391000e+01 5.466843e+00 -1.921207e+01 8.653820e-02 - 1.392000e+01 5.369194e+00 -1.922588e+01 8.665117e-02 - 1.393000e+01 5.155694e+00 -1.923969e+01 8.684424e-02 - 1.394000e+01 4.832977e+00 -1.925351e+01 8.705052e-02 - 1.395000e+01 4.410678e+00 -1.926732e+01 8.719880e-02 - 1.396000e+01 3.901022e+00 -1.928113e+01 8.723803e-02 - 1.397000e+01 3.318331e+00 -1.929494e+01 8.715449e-02 - 1.398000e+01 2.678455e+00 -1.930875e+01 8.697640e-02 - 1.399000e+01 1.998167e+00 -1.932256e+01 8.676445e-02 - 1.400000e+01 1.294562e+00 -1.933638e+01 8.659131e-02 - 1.401000e+01 5.844846e-01 -1.935019e+01 8.651647e-02 - 1.402000e+01 -1.159802e-01 -1.936400e+01 8.656534e-02 - 1.403000e+01 -7.919358e-01 -1.937781e+01 8.672021e-02 - 1.404000e+01 -1.430003e+00 -1.939162e+01 8.692668e-02 - 1.405000e+01 -2.018545e+00 -1.940543e+01 8.711310e-02 - 1.406000e+01 -2.547779e+00 -1.941925e+01 8.721543e-02 - 1.407000e+01 -3.009802e+00 -1.943306e+01 8.719908e-02 - 1.408000e+01 -3.398520e+00 -1.944687e+01 8.707031e-02 - 1.409000e+01 -3.709518e+00 -1.946068e+01 8.687410e-02 - 1.410000e+01 -3.939893e+00 -1.947449e+01 8.667883e-02 - 1.411000e+01 -4.088053e+00 -1.948830e+01 8.655280e-02 - 1.412000e+01 -4.153539e+00 -1.950212e+01 8.654022e-02 - 1.413000e+01 -4.136856e+00 -1.951593e+01 8.664544e-02 - 1.414000e+01 -4.039348e+00 -1.952974e+01 8.683144e-02 - 1.415000e+01 -3.863122e+00 -1.954355e+01 8.703311e-02 - 1.416000e+01 -3.611024e+00 -1.955736e+01 8.718022e-02 - 1.417000e+01 -3.286660e+00 -1.957117e+01 8.722168e-02 - 1.418000e+01 -2.894460e+00 -1.958499e+01 8.714281e-02 - 1.419000e+01 -2.439767e+00 -1.959880e+01 8.697027e-02 - 1.420000e+01 -1.928925e+00 -1.961261e+01 8.676321e-02 - 1.421000e+01 -1.369369e+00 -1.962642e+01 8.659313e-02 - 1.422000e+01 -7.696641e-01 -1.964023e+01 8.651919e-02 - 1.423000e+01 -1.395087e-01 -1.965405e+01 8.656721e-02 - 1.424000e+01 5.103362e-01 -1.966786e+01 8.672041e-02 - 1.425000e+01 1.168189e+00 -1.968167e+01 8.692539e-02 - 1.426000e+01 1.821671e+00 -1.969548e+01 8.711108e-02 - 1.427000e+01 2.457998e+00 -1.970929e+01 8.721334e-02 - 1.428000e+01 3.064343e+00 -1.972310e+01 8.719685e-02 - 1.429000e+01 3.628244e+00 -1.973692e+01 8.706682e-02 - 1.430000e+01 4.138038e+00 -1.975073e+01 8.686730e-02 - 1.431000e+01 4.583296e+00 -1.976454e+01 8.666640e-02 - 1.432000e+01 4.955240e+00 -1.977835e+01 8.653308e-02 - 1.433000e+01 5.247099e+00 -1.979216e+01 8.651313e-02 - 1.434000e+01 5.454396e+00 -1.980597e+01 8.661301e-02 - 1.435000e+01 5.575138e+00 -1.981979e+01 8.679766e-02 - 1.436000e+01 5.609900e+00 -1.983360e+01 8.700313e-02 - 1.437000e+01 5.561781e+00 -1.984741e+01 8.715912e-02 - 1.438000e+01 5.436253e+00 -1.986122e+01 8.721313e-02 - 1.439000e+01 5.240895e+00 -1.987503e+01 8.714810e-02 - 1.440000e+01 4.985026e+00 -1.988884e+01 8.698788e-02 - 1.441000e+01 4.679273e+00 -1.990266e+01 8.678910e-02 - 1.442000e+01 4.335075e+00 -1.991647e+01 8.662183e-02 - 1.443000e+01 3.964178e+00 -1.993028e+01 8.654520e-02 - 1.444000e+01 3.578123e+00 -1.994409e+01 8.658651e-02 - 1.445000e+01 3.187783e+00 -1.995790e+01 8.673150e-02 - 1.446000e+01 2.802954e+00 -1.997171e+01 8.692952e-02 - 1.447000e+01 2.432023e+00 -1.998553e+01 8.711160e-02 - 1.448000e+01 2.081747e+00 -1.999934e+01 8.721460e-02 - 1.449000e+01 1.757120e+00 -2.001315e+01 8.720277e-02 - 1.450000e+01 1.461361e+00 -2.002696e+01 8.707979e-02 - 1.451000e+01 1.195997e+00 -2.004077e+01 8.688753e-02 - 1.452000e+01 9.610290e-01 -2.005458e+01 8.669200e-02 - 1.453000e+01 7.551803e-01 -2.006840e+01 8.656071e-02 - 1.454000e+01 5.761841e-01 -2.008221e+01 8.653907e-02 - 1.455000e+01 4.211026e-01 -2.009602e+01 8.663426e-02 - 1.456000e+01 2.866464e-01 -2.010983e+01 8.681266e-02 - 1.457000e+01 1.694743e-01 -2.012364e+01 8.701187e-02 - 1.458000e+01 6.645185e-02 -2.013745e+01 8.716272e-02 - 1.459000e+01 -2.514443e-02 -2.015127e+01 8.721308e-02 - 1.460000e+01 -1.074894e-01 -2.016508e+01 8.714545e-02 - 1.461000e+01 -1.821416e-01 -2.017889e+01 8.698281e-02 - 1.462000e+01 -2.500448e-01 -2.019270e+01 8.678086e-02 - 1.463000e+01 -3.115920e-01 -2.020651e+01 8.660920e-02 - 1.464000e+01 -3.667410e-01 -2.022032e+01 8.652729e-02 - 1.465000e+01 -4.151668e-01 -2.023414e+01 8.656352e-02 - 1.466000e+01 -4.564340e-01 -2.024795e+01 8.670512e-02 - 1.467000e+01 -4.901719e-01 -2.026176e+01 8.690285e-02 - 1.468000e+01 -5.162349e-01 -2.027557e+01 8.708850e-02 - 1.469000e+01 -5.348347e-01 -2.028938e+01 8.719871e-02 - 1.470000e+01 -5.466305e-01 -2.030319e+01 8.719651e-02 - 1.471000e+01 -5.527720e-01 -2.031701e+01 8.708366e-02 - 1.472000e+01 -5.548896e-01 -2.033082e+01 8.689996e-02 - 1.473000e+01 -5.550346e-01 -2.034463e+01 8.670973e-02 - 1.474000e+01 -5.555731e-01 -2.035844e+01 8.657974e-02 - 1.475000e+01 -5.590439e-01 -2.037225e+01 8.655587e-02 - 1.476000e+01 -5.679911e-01 -2.038607e+01 8.664678e-02 - 1.477000e+01 -5.847853e-01 -2.039988e+01 8.682083e-02 - 1.478000e+01 -6.114465e-01 -2.041369e+01 8.701749e-02 - 1.479000e+01 -6.494827e-01 -2.042750e+01 8.716862e-02 - 1.480000e+01 -6.997548e-01 -2.044131e+01 8.722207e-02 - 1.481000e+01 -7.623785e-01 -2.045512e+01 8.715926e-02 - 1.482000e+01 -8.366678e-01 -2.046894e+01 8.700137e-02 - 1.483000e+01 -9.211228e-01 -2.048275e+01 8.680223e-02 - 1.484000e+01 -1.013463e+00 -2.049656e+01 8.663007e-02 - 1.485000e+01 -1.110697e+00 -2.051037e+01 8.654393e-02 - 1.486000e+01 -1.209235e+00 -2.052418e+01 8.657293e-02 - 1.487000e+01 -1.305011e+00 -2.053799e+01 8.670590e-02 - 1.488000e+01 -1.393638e+00 -2.055181e+01 8.689546e-02 - 1.489000e+01 -1.470557e+00 -2.056562e+01 8.707496e-02 - 1.490000e+01 -1.531186e+00 -2.057943e+01 8.718178e-02 - 1.491000e+01 -1.571064e+00 -2.059324e+01 8.717868e-02 - 1.492000e+01 -1.585969e+00 -2.060705e+01 8.706638e-02 - 1.493000e+01 -1.572029e+00 -2.062086e+01 8.688319e-02 - 1.494000e+01 -1.525798e+00 -2.063468e+01 8.669216e-02 - 1.495000e+01 -1.444329e+00 -2.064849e+01 8.655945e-02 - 1.496000e+01 -1.325218e+00 -2.066230e+01 8.653123e-02 - 1.497000e+01 -1.166644e+00 -2.067611e+01 8.661736e-02 - 1.498000e+01 -9.674051e-01 -2.068992e+01 8.678785e-02 - 1.499000e+01 -7.269469e-01 -2.070373e+01 8.698363e-02 - 1.500000e+01 -4.454000e-01 -2.071755e+01 8.713743e-02 - 1.501000e+01 -1.236221e-01 -2.073136e+01 8.719695e-02 - 1.502000e+01 2.367538e-01 -2.074517e+01 8.714255e-02 - 1.503000e+01 6.332650e-01 -2.075898e+01 8.699371e-02 - 1.504000e+01 1.062564e+00 -2.077279e+01 8.680245e-02 - 1.505000e+01 1.520368e+00 -2.078660e+01 8.663558e-02 - 1.506000e+01 2.001423e+00 -2.080042e+01 8.655162e-02 - 1.507000e+01 2.499483e+00 -2.081423e+01 8.658014e-02 - 1.508000e+01 3.007331e+00 -2.082804e+01 8.671129e-02 - 1.509000e+01 3.516827e+00 -2.084185e+01 8.689934e-02 - 1.510000e+01 4.019008e+00 -2.085566e+01 8.707903e-02 - 1.511000e+01 4.504236e+00 -2.086947e+01 8.718840e-02 - 1.512000e+01 4.962400e+00 -2.088329e+01 8.719001e-02 - 1.513000e+01 5.383163e+00 -2.089710e+01 8.708351e-02 - 1.514000e+01 5.756255e+00 -2.091091e+01 8.690578e-02 - 1.515000e+01 6.071799e+00 -2.092472e+01 8.671843e-02 - 1.516000e+01 6.320652e+00 -2.093853e+01 8.658676e-02 - 1.517000e+01 6.494763e+00 -2.095234e+01 8.655692e-02 - 1.518000e+01 6.587501e+00 -2.096616e+01 8.663953e-02 - 1.519000e+01 6.593970e+00 -2.097997e+01 8.680590e-02 - 1.520000e+01 6.511261e+00 -2.099378e+01 8.699829e-02 - 1.521000e+01 6.338644e+00 -2.100759e+01 8.715026e-02 - 1.522000e+01 6.077686e+00 -2.102140e+01 8.720959e-02 - 1.523000e+01 5.732276e+00 -2.103521e+01 8.715597e-02 - 1.524000e+01 5.308559e+00 -2.104903e+01 8.700773e-02 - 1.525000e+01 4.814774e+00 -2.106284e+01 8.681567e-02 - 1.526000e+01 4.261014e+00 -2.107665e+01 8.664582e-02 - 1.527000e+01 3.658895e+00 -2.109046e+01 8.655666e-02 - 1.528000e+01 3.021173e+00 -2.110427e+01 8.657858e-02 - 1.529000e+01 2.361305e+00 -2.111808e+01 8.670310e-02 - 1.530000e+01 1.692992e+00 -2.113190e+01 8.688598e-02 - 1.531000e+01 1.029719e+00 -2.114571e+01 8.706302e-02 - 1.532000e+01 3.843055e-01 -2.115952e+01 8.717253e-02 - 1.533000e+01 -2.314983e-01 -2.117333e+01 8.717646e-02 - 1.534000e+01 -8.073607e-01 -2.118714e+01 8.707316e-02 - 1.535000e+01 -1.334647e+00 -2.120096e+01 8.689792e-02 - 1.536000e+01 -1.806617e+00 -2.121477e+01 8.671103e-02 - 1.537000e+01 -2.218534e+00 -2.122858e+01 8.657716e-02 - 1.538000e+01 -2.567686e+00 -2.124239e+01 8.654282e-02 - 1.539000e+01 -2.853326e+00 -2.125620e+01 8.661987e-02 - 1.540000e+01 -3.076533e+00 -2.127001e+01 8.678136e-02 - 1.541000e+01 -3.240015e+00 -2.128383e+01 8.697121e-02 - 1.542000e+01 -3.347861e+00 -2.129764e+01 8.712405e-02 - 1.543000e+01 -3.405258e+00 -2.131145e+01 8.718786e-02 - 1.544000e+01 -3.418200e+00 -2.132526e+01 8.714159e-02 - 1.545000e+01 -3.393192e+00 -2.133907e+01 8.700214e-02 - 1.546000e+01 -3.336974e+00 -2.135288e+01 8.681863e-02 - 1.547000e+01 -3.256275e+00 -2.136670e+01 8.665566e-02 - 1.548000e+01 -3.157593e+00 -2.138051e+01 8.657086e-02 - 1.549000e+01 -3.047040e+00 -2.139432e+01 8.659456e-02 - 1.550000e+01 -2.930208e+00 -2.140813e+01 8.671892e-02 - 1.551000e+01 -2.812102e+00 -2.142194e+01 8.690064e-02 - 1.552000e+01 -2.697099e+00 -2.143575e+01 8.707639e-02 - 1.553000e+01 -2.588949e+00 -2.144957e+01 8.718490e-02 - 1.554000e+01 -2.490803e+00 -2.146338e+01 8.718799e-02 - 1.555000e+01 -2.405253e+00 -2.147719e+01 8.708347e-02 - 1.556000e+01 -2.334388e+00 -2.149100e+01 8.690596e-02 - 1.557000e+01 -2.279846e+00 -2.150481e+01 8.671539e-02 - 1.558000e+01 -2.242860e+00 -2.151862e+01 8.657662e-02 - 1.559000e+01 -2.224294e+00 -2.153244e+01 8.653701e-02 - 1.560000e+01 -2.224665e+00 -2.154625e+01 8.660975e-02 - 1.561000e+01 -2.244148e+00 -2.156006e+01 8.676924e-02 - 1.562000e+01 -2.282567e+00 -2.157387e+01 8.696030e-02 - 1.563000e+01 -2.339377e+00 -2.158768e+01 8.711762e-02 - 1.564000e+01 -2.413641e+00 -2.160149e+01 8.718828e-02 - 1.565000e+01 -2.504009e+00 -2.161531e+01 8.714959e-02 - 1.566000e+01 -2.608694e+00 -2.162912e+01 8.701652e-02 - 1.567000e+01 -2.725478e+00 -2.164293e+01 8.683646e-02 - 1.568000e+01 -2.851718e+00 -2.165674e+01 8.667307e-02 - 1.569000e+01 -2.984382e+00 -2.167055e+01 8.658420e-02 - 1.570000e+01 -3.120107e+00 -2.168436e+01 8.660152e-02 - 1.571000e+01 -3.255281e+00 -2.169818e+01 8.671925e-02 - 1.572000e+01 -3.386141e+00 -2.171199e+01 8.689629e-02 - 1.573000e+01 -3.508893e+00 -2.172580e+01 8.707088e-02 - 1.574000e+01 -3.619842e+00 -2.173961e+01 8.718225e-02 - 1.575000e+01 -3.715524e+00 -2.175342e+01 8.719152e-02 - 1.576000e+01 -3.792840e+00 -2.176723e+01 8.709476e-02 - 1.577000e+01 -3.849176e+00 -2.178105e+01 8.692438e-02 - 1.578000e+01 -3.882504e+00 -2.179486e+01 8.673815e-02 - 1.579000e+01 -3.891464e+00 -2.180867e+01 8.659954e-02 - 1.580000e+01 -3.875416e+00 -2.182248e+01 8.655563e-02 - 1.581000e+01 -3.834455e+00 -2.183629e+01 8.662049e-02 - 1.582000e+01 -3.769399e+00 -2.185010e+01 8.677023e-02 - 1.583000e+01 -3.681745e+00 -2.186392e+01 8.695160e-02 - 1.584000e+01 -3.573588e+00 -2.187773e+01 8.710090e-02 - 1.585000e+01 -3.447530e+00 -2.189154e+01 8.716604e-02 - 1.586000e+01 -3.306553e+00 -2.190535e+01 8.712429e-02 - 1.587000e+01 -3.153896e+00 -2.191916e+01 8.698994e-02 - 1.588000e+01 -2.992916e+00 -2.193298e+01 8.680943e-02 - 1.589000e+01 -2.826957e+00 -2.194679e+01 8.664565e-02 - 1.590000e+01 -2.659230e+00 -2.196060e+01 8.655622e-02 - 1.591000e+01 -2.492706e+00 -2.197441e+01 8.657323e-02 - 1.592000e+01 -2.330024e+00 -2.198822e+01 8.669178e-02 - 1.593000e+01 -2.173434e+00 -2.200203e+01 8.687175e-02 - 1.594000e+01 -2.024744e+00 -2.201585e+01 8.705200e-02 - 1.595000e+01 -1.885313e+00 -2.202966e+01 8.717166e-02 - 1.596000e+01 -1.756044e+00 -2.204347e+01 8.719096e-02 - 1.597000e+01 -1.637404e+00 -2.205728e+01 8.710449e-02 - 1.598000e+01 -1.529458e+00 -2.207109e+01 8.694291e-02 - 1.599000e+01 -1.431911e+00 -2.208490e+01 8.676253e-02 - 1.600000e+01 -1.344145e+00 -2.209872e+01 8.662605e-02 - 1.601000e+01 -1.265271e+00 -2.211253e+01 8.658077e-02 - 1.602000e+01 -1.194158e+00 -2.212634e+01 8.664190e-02 - 1.603000e+01 -1.129475e+00 -2.214015e+01 8.678723e-02 - 1.604000e+01 -1.069708e+00 -2.215396e+01 8.696517e-02 - 1.605000e+01 -1.013175e+00 -2.216777e+01 8.711310e-02 - 1.606000e+01 -9.580365e-01 -2.218159e+01 8.717913e-02 - 1.607000e+01 -9.022976e-01 -2.219540e+01 8.713980e-02 - 1.608000e+01 -8.438092e-01 -2.220921e+01 8.700803e-02 - 1.609000e+01 -7.802728e-01 -2.222302e+01 8.682870e-02 - 1.610000e+01 -7.092517e-01 -2.223683e+01 8.666351e-02 - 1.611000e+01 -6.281935e-01 -2.225064e+01 8.656967e-02 - 1.612000e+01 -5.344664e-01 -2.226446e+01 8.657978e-02 - 1.613000e+01 -4.254127e-01 -2.227827e+01 8.669028e-02 - 1.614000e+01 -2.984207e-01 -2.229208e+01 8.686268e-02 - 1.615000e+01 -1.510139e-01 -2.230589e+01 8.703726e-02 - 1.616000e+01 1.904334e-02 -2.231970e+01 8.715393e-02 - 1.617000e+01 2.136275e-01 -2.233351e+01 8.717286e-02 - 1.618000e+01 4.341297e-01 -2.234733e+01 8.708780e-02 - 1.619000e+01 6.813283e-01 -2.236114e+01 8.692818e-02 - 1.620000e+01 9.552663e-01 -2.237495e+01 8.674911e-02 - 1.621000e+01 1.255142e+00 -2.238876e+01 8.661257e-02 - 1.622000e+01 1.579220e+00 -2.240257e+01 8.656588e-02 - 1.623000e+01 1.924770e+00 -2.241638e+01 8.662499e-02 - 1.624000e+01 2.288039e+00 -2.243020e+01 8.676888e-02 - 1.625000e+01 2.664263e+00 -2.244401e+01 8.694708e-02 - 1.626000e+01 3.047722e+00 -2.245782e+01 8.709763e-02 - 1.627000e+01 3.431836e+00 -2.247163e+01 8.716854e-02 - 1.628000e+01 3.809304e+00 -2.248544e+01 8.713550e-02 - 1.629000e+01 4.172289e+00 -2.249925e+01 8.701008e-02 - 1.630000e+01 4.512626e+00 -2.251307e+01 8.683574e-02 - 1.631000e+01 4.822073e+00 -2.252688e+01 8.667314e-02 - 1.632000e+01 5.092568e+00 -2.254069e+01 8.657922e-02 - 1.633000e+01 5.316504e+00 -2.255450e+01 8.658719e-02 - 1.634000e+01 5.487003e+00 -2.256831e+01 8.669477e-02 - 1.635000e+01 5.598176e+00 -2.258212e+01 8.686500e-02 - 1.636000e+01 5.645362e+00 -2.259594e+01 8.703936e-02 - 1.637000e+01 5.625337e+00 -2.260975e+01 8.715825e-02 - 1.638000e+01 5.536483e+00 -2.262356e+01 8.718141e-02 - 1.639000e+01 5.378903e+00 -2.263737e+01 8.710144e-02 - 1.640000e+01 5.154495e+00 -2.265118e+01 8.694617e-02 - 1.641000e+01 4.866954e+00 -2.266500e+01 8.676927e-02 - 1.642000e+01 4.521731e+00 -2.267881e+01 8.663185e-02 - 1.643000e+01 4.125925e+00 -2.269262e+01 8.658129e-02 - 1.644000e+01 3.688121e+00 -2.270643e+01 8.663452e-02 - 1.645000e+01 3.218184e+00 -2.272024e+01 8.677209e-02 - 1.646000e+01 2.727006e+00 -2.273405e+01 8.694519e-02 - 1.647000e+01 2.226214e+00 -2.274787e+01 8.709303e-02 - 1.648000e+01 1.727859e+00 -2.276168e+01 8.716397e-02 - 1.649000e+01 1.244083e+00 -2.277549e+01 8.713314e-02 - 1.650000e+01 7.867764e-01 -2.278930e+01 8.701083e-02 - 1.651000e+01 3.672473e-01 -2.280311e+01 8.683899e-02 - 1.652000e+01 -4.106897e-03 -2.281692e+01 8.667696e-02 - 1.653000e+01 -3.180983e-01 -2.283074e+01 8.658105e-02 - 1.654000e+01 -5.670198e-01 -2.284455e+01 8.658475e-02 - 1.655000e+01 -7.448772e-01 -2.285836e+01 8.668684e-02 - 1.656000e+01 -8.475763e-01 -2.287217e+01 8.685183e-02 - 1.657000e+01 -8.730600e-01 -2.288598e+01 8.702265e-02 - 1.658000e+01 -8.213907e-01 -2.289979e+01 8.714060e-02 - 1.659000e+01 -6.947757e-01 -2.291361e+01 8.716553e-02 - 1.660000e+01 -4.975349e-01 -2.292742e+01 8.708940e-02 - 1.661000e+01 -2.360089e-01 -2.294123e+01 8.693890e-02 - 1.662000e+01 8.158785e-02 -2.295504e+01 8.676641e-02 - 1.663000e+01 4.453688e-01 -2.296885e+01 8.663207e-02 - 1.664000e+01 8.440257e-01 -2.298266e+01 8.658288e-02 - 1.665000e+01 1.265123e+00 -2.299648e+01 8.663604e-02 - 1.666000e+01 1.695427e+00 -2.301029e+01 8.677288e-02 - 1.667000e+01 2.121268e+00 -2.302410e+01 8.694556e-02 - 1.668000e+01 2.528916e+00 -2.303791e+01 8.709395e-02 - 1.669000e+01 2.904967e+00 -2.305172e+01 8.716660e-02 - 1.670000e+01 3.236733e+00 -2.306553e+01 8.713823e-02 - 1.671000e+01 3.512608e+00 -2.307935e+01 8.701830e-02 - 1.672000e+01 3.722423e+00 -2.309316e+01 8.684779e-02 - 1.673000e+01 3.857756e+00 -2.310697e+01 8.668536e-02 - 1.674000e+01 3.912201e+00 -2.312078e+01 8.658717e-02 - 1.675000e+01 3.881580e+00 -2.313459e+01 8.658725e-02 - 1.676000e+01 3.764095e+00 -2.314840e+01 8.668542e-02 - 1.677000e+01 3.560410e+00 -2.316222e+01 8.684746e-02 - 1.678000e+01 3.273652e+00 -2.317603e+01 8.701727e-02 - 1.679000e+01 2.909355e+00 -2.318984e+01 8.713655e-02 - 1.680000e+01 2.475305e+00 -2.320365e+01 8.716485e-02 - 1.681000e+01 1.981337e+00 -2.321746e+01 8.709319e-02 - 1.682000e+01 1.439047e+00 -2.323127e+01 8.694702e-02 - 1.683000e+01 8.614615e-01 -2.324509e+01 8.677753e-02 - 1.684000e+01 2.626474e-01 -2.325890e+01 8.664413e-02 - 1.685000e+01 -3.427034e-01 -2.327271e+01 8.659376e-02 - 1.686000e+01 -9.397152e-01 -2.328652e+01 8.664432e-02 - 1.687000e+01 -1.513775e+00 -2.330033e+01 8.677822e-02 - 1.688000e+01 -2.050971e+00 -2.331414e+01 8.694875e-02 - 1.689000e+01 -2.538503e+00 -2.332796e+01 8.709653e-02 - 1.690000e+01 -2.965063e+00 -2.334177e+01 8.717022e-02 - 1.691000e+01 -3.321160e+00 -2.335558e+01 8.714398e-02 - 1.692000e+01 -3.599382e+00 -2.336939e+01 8.702621e-02 - 1.693000e+01 -3.794593e+00 -2.338320e+01 8.685672e-02 - 1.694000e+01 -3.904057e+00 -2.339702e+01 8.669324e-02 - 1.695000e+01 -3.927475e+00 -2.341083e+01 8.659162e-02 - 1.696000e+01 -3.866950e+00 -2.342464e+01 8.658630e-02 - 1.697000e+01 -3.726880e+00 -2.343845e+01 8.667811e-02 - 1.698000e+01 -3.513775e+00 -2.345226e+01 8.683405e-02 - 1.699000e+01 -3.236015e+00 -2.346607e+01 8.699912e-02 - 1.700000e+01 -2.903556e+00 -2.347989e+01 8.711559e-02 - 1.701000e+01 -2.527597e+00 -2.349370e+01 8.714296e-02 - 1.702000e+01 -2.120218e+00 -2.350751e+01 8.707167e-02 - 1.703000e+01 -1.694000e+00 -2.352132e+01 8.692631e-02 - 1.704000e+01 -1.261644e+00 -2.353513e+01 8.675731e-02 - 1.705000e+01 -8.356002e-01 -2.354894e+01 8.662374e-02 - 1.706000e+01 -4.277182e-01 -2.356276e+01 8.657281e-02 - 1.707000e+01 -4.892143e-02 -2.357657e+01 8.662316e-02 - 1.708000e+01 2.910743e-01 -2.359038e+01 8.675822e-02 - 1.709000e+01 5.840006e-01 -2.360419e+01 8.693214e-02 - 1.710000e+01 8.232263e-01 -2.361800e+01 8.708590e-02 - 1.711000e+01 1.003896e+00 -2.363181e+01 8.716778e-02 - 1.712000e+01 1.123014e+00 -2.364563e+01 8.715096e-02 - 1.713000e+01 1.179478e+00 -2.365944e+01 8.704241e-02 - 1.714000e+01 1.174056e+00 -2.367325e+01 8.688049e-02 - 1.715000e+01 1.109323e+00 -2.368706e+01 8.672189e-02 - 1.716000e+01 9.895443e-01 -2.370087e+01 8.662208e-02 - 1.717000e+01 8.205209e-01 -2.371468e+01 8.661594e-02 - 1.718000e+01 6.094028e-01 -2.372850e+01 8.670535e-02 - 1.719000e+01 3.644659e-01 -2.374231e+01 8.685859e-02 - 1.720000e+01 9.486754e-02 -2.375612e+01 8.702171e-02 - 1.721000e+01 -1.896189e-01 -2.376993e+01 8.713742e-02 - 1.722000e+01 -4.788820e-01 -2.378374e+01 8.716496e-02 - 1.723000e+01 -7.627576e-01 -2.379755e+01 8.709387e-02 - 1.724000e+01 -1.031315e+00 -2.381137e+01 8.694759e-02 - 1.725000e+01 -1.275137e+00 -2.382518e+01 8.677555e-02 - 1.726000e+01 -1.485587e+00 -2.383899e+01 8.663639e-02 - 1.727000e+01 -1.655059e+00 -2.385280e+01 8.657763e-02 - 1.728000e+01 -1.777198e+00 -2.386661e+01 8.661901e-02 - 1.729000e+01 -1.847091e+00 -2.388042e+01 8.674544e-02 - 1.730000e+01 -1.861422e+00 -2.389424e+01 8.691249e-02 - 1.731000e+01 -1.818574e+00 -2.390805e+01 8.706206e-02 - 1.732000e+01 -1.718697e+00 -2.392186e+01 8.714263e-02 - 1.733000e+01 -1.563709e+00 -2.393567e+01 8.712675e-02 - 1.734000e+01 -1.357258e+00 -2.394948e+01 8.702031e-02 - 1.735000e+01 -1.104620e+00 -2.396329e+01 8.686045e-02 - 1.736000e+01 -8.125520e-01 -2.397711e+01 8.670292e-02 - 1.737000e+01 -4.890906e-01 -2.399092e+01 8.660293e-02 - 1.738000e+01 -1.433124e-01 -2.400473e+01 8.659576e-02 - 1.739000e+01 2.149441e-01 -2.401854e+01 8.668431e-02 - 1.740000e+01 5.753838e-01 -2.403235e+01 8.683806e-02 - 1.741000e+01 9.275768e-01 -2.404616e+01 8.700392e-02 - 1.742000e+01 1.261287e+00 -2.405998e+01 8.712489e-02 - 1.743000e+01 1.566793e+00 -2.407379e+01 8.715968e-02 - 1.744000e+01 1.835197e+00 -2.408760e+01 8.709670e-02 - 1.745000e+01 2.058695e+00 -2.410141e+01 8.695786e-02 - 1.746000e+01 2.230823e+00 -2.411522e+01 8.679122e-02 - 1.747000e+01 2.346639e+00 -2.412903e+01 8.665454e-02 - 1.748000e+01 2.402862e+00 -2.414285e+01 8.659530e-02 - 1.749000e+01 2.397953e+00 -2.415666e+01 8.663394e-02 - 1.750000e+01 2.332120e+00 -2.417047e+01 8.675670e-02 - 1.751000e+01 2.207283e+00 -2.418428e+01 8.692050e-02 - 1.752000e+01 2.026962e+00 -2.419809e+01 8.706826e-02 - 1.753000e+01 1.796122e+00 -2.421191e+01 8.714880e-02 - 1.754000e+01 1.520973e+00 -2.422572e+01 8.713429e-02 - 1.755000e+01 1.208728e+00 -2.423953e+01 8.702966e-02 - 1.756000e+01 8.673386e-01 -2.425334e+01 8.687089e-02 - 1.757000e+01 5.052165e-01 -2.426715e+01 8.671285e-02 - 1.758000e+01 1.309496e-01 -2.428096e+01 8.661037e-02 - 1.759000e+01 -2.469724e-01 -2.429478e+01 8.659908e-02 - 1.760000e+01 -6.204145e-01 -2.430859e+01 8.668283e-02 - 1.761000e+01 -9.818255e-01 -2.432240e+01 8.683227e-02 - 1.762000e+01 -1.324432e+00 -2.433621e+01 8.699534e-02 - 1.763000e+01 -1.642390e+00 -2.435002e+01 8.711552e-02 - 1.764000e+01 -1.930898e+00 -2.436383e+01 8.715136e-02 - 1.765000e+01 -2.186256e+00 -2.437765e+01 8.709049e-02 - 1.766000e+01 -2.405888e+00 -2.439146e+01 8.695380e-02 - 1.767000e+01 -2.588317e+00 -2.440527e+01 8.678836e-02 - 1.768000e+01 -2.733104e+00 -2.441908e+01 8.665140e-02 - 1.769000e+01 -2.840752e+00 -2.443289e+01 8.659050e-02 - 1.770000e+01 -2.912593e+00 -2.444670e+01 8.662688e-02 - 1.771000e+01 -2.950643e+00 -2.446052e+01 8.674783e-02 - 1.772000e+01 -2.957458e+00 -2.447433e+01 8.691132e-02 - 1.773000e+01 -2.935981e+00 -2.448814e+01 8.706087e-02 - 1.774000e+01 -2.889393e+00 -2.450195e+01 8.714520e-02 - 1.775000e+01 -2.820974e+00 -2.451576e+01 8.713574e-02 - 1.776000e+01 -2.733977e+00 -2.452957e+01 8.703622e-02 - 1.777000e+01 -2.631524e+00 -2.454339e+01 8.688139e-02 - 1.778000e+01 -2.516520e+00 -2.455720e+01 8.672516e-02 - 1.779000e+01 -2.391589e+00 -2.457101e+01 8.662212e-02 - 1.780000e+01 -2.259035e+00 -2.458482e+01 8.660840e-02 - 1.781000e+01 -2.120827e+00 -2.459863e+01 8.668891e-02 - 1.782000e+01 -1.978597e+00 -2.461244e+01 8.683560e-02 - 1.783000e+01 -1.833662e+00 -2.462626e+01 8.699740e-02 - 1.784000e+01 -1.687057e+00 -2.464007e+01 8.711823e-02 - 1.785000e+01 -1.539578e+00 -2.465388e+01 8.715627e-02 - 1.786000e+01 -1.391838e+00 -2.466769e+01 8.709820e-02 - 1.787000e+01 -1.244314e+00 -2.468150e+01 8.696366e-02 - 1.788000e+01 -1.097405e+00 -2.469531e+01 8.679860e-02 - 1.789000e+01 -9.514796e-01 -2.470913e+01 8.665973e-02 - 1.790000e+01 -8.069198e-01 -2.472294e+01 8.659487e-02 - 1.791000e+01 -6.641559e-01 -2.473675e+01 8.662618e-02 - 1.792000e+01 -5.236915e-01 -2.475056e+01 8.674239e-02 - 1.793000e+01 -3.861179e-01 -2.476437e+01 8.690283e-02 - 1.794000e+01 -2.521187e-01 -2.477818e+01 8.705183e-02 - 1.795000e+01 -1.224641e-01 -2.479200e+01 8.713817e-02 - 1.796000e+01 2.002381e-03 -2.480581e+01 8.713247e-02 - 1.797000e+01 1.203851e-01 -2.481962e+01 8.703715e-02 - 1.798000e+01 2.317610e-01 -2.483343e+01 8.688545e-02 - 1.799000e+01 3.352080e-01 -2.484724e+01 8.673017e-02 - 1.800000e+01 4.298322e-01 -2.486105e+01 8.662547e-02 - 1.801000e+01 5.147948e-01 -2.487487e+01 8.660800e-02 - 1.802000e+01 5.893341e-01 -2.488868e+01 8.668387e-02 - 1.803000e+01 6.527827e-01 -2.490249e+01 8.682659e-02 - 1.804000e+01 7.045791e-01 -2.491630e+01 8.698645e-02 - 1.805000e+01 7.442724e-01 -2.493011e+01 8.710806e-02 - 1.806000e+01 7.715211e-01 -2.494393e+01 8.714944e-02 - 1.807000e+01 7.860873e-01 -2.495774e+01 8.709627e-02 - 1.808000e+01 7.878271e-01 -2.497155e+01 8.696669e-02 - 1.809000e+01 7.766795e-01 -2.498536e+01 8.680515e-02 - 1.810000e+01 7.526563e-01 -2.499917e+01 8.666724e-02 - 1.811000e+01 7.158358e-01 -2.501298e+01 8.660047e-02 - 1.812000e+01 6.663611e-01 -2.502680e+01 8.662762e-02 - 1.813000e+01 6.044479e-01 -2.504061e+01 8.673865e-02 - 1.814000e+01 5.303998e-01 -2.505442e+01 8.689440e-02 - 1.815000e+01 4.446352e-01 -2.506823e+01 8.704050e-02 - 1.816000e+01 3.477236e-01 -2.508204e+01 8.712634e-02 - 1.817000e+01 2.404307e-01 -2.509585e+01 8.712243e-02 - 1.818000e+01 1.237700e-01 -2.510967e+01 8.703037e-02 - 1.819000e+01 -9.416308e-04 -2.512348e+01 8.688225e-02 - 1.820000e+01 -1.320299e-01 -2.513729e+01 8.672973e-02 - 1.821000e+01 -2.674146e-01 -2.515110e+01 8.662628e-02 - 1.822000e+01 -4.045726e-01 -2.516491e+01 8.660846e-02 - 1.823000e+01 -5.405171e-01 -2.517872e+01 8.668296e-02 - 1.824000e+01 -6.717992e-01 -2.519254e+01 8.682420e-02 - 1.825000e+01 -7.945361e-01 -2.520635e+01 8.698340e-02 - 1.826000e+01 -9.044691e-01 -2.522016e+01 8.710574e-02 - 1.827000e+01 -9.970535e-01 -2.523397e+01 8.714922e-02 - 1.828000e+01 -1.067581e+00 -2.524778e+01 8.709899e-02 - 1.829000e+01 -1.111334e+00 -2.526159e+01 8.697229e-02 - 1.830000e+01 -1.123760e+00 -2.527541e+01 8.681263e-02 - 1.831000e+01 -1.100680e+00 -2.528922e+01 8.667502e-02 - 1.832000e+01 -1.038493e+00 -2.530303e+01 8.660692e-02 - 1.833000e+01 -9.343971e-01 -2.531684e+01 8.663167e-02 - 1.834000e+01 -7.865948e-01 -2.533065e+01 8.674018e-02 - 1.835000e+01 -5.944846e-01 -2.534446e+01 8.689429e-02 - 1.836000e+01 -3.588183e-01 -2.535828e+01 8.704028e-02 - 1.837000e+01 -8.181862e-02 -2.537209e+01 8.712763e-02 - 1.838000e+01 2.327552e-01 -2.538590e+01 8.712632e-02 - 1.839000e+01 5.796003e-01 -2.539971e+01 8.703698e-02 - 1.840000e+01 9.519272e-01 -2.541352e+01 8.689062e-02 - 1.841000e+01 1.341585e+00 -2.542733e+01 8.673808e-02 - 1.842000e+01 1.739249e+00 -2.544115e+01 8.663261e-02 - 1.843000e+01 2.134674e+00 -2.545496e+01 8.661124e-02 - 1.844000e+01 2.517002e+00 -2.546877e+01 8.668172e-02 - 1.845000e+01 2.875107e+00 -2.548258e+01 8.681972e-02 - 1.846000e+01 3.197976e+00 -2.549639e+01 8.697754e-02 - 1.847000e+01 3.475105e+00 -2.551020e+01 8.710080e-02 - 1.848000e+01 3.696893e+00 -2.552402e+01 8.714724e-02 - 1.849000e+01 3.855011e+00 -2.553783e+01 8.710102e-02 - 1.850000e+01 3.942748e+00 -2.555164e+01 8.697805e-02 - 1.851000e+01 3.955291e+00 -2.556545e+01 8.682055e-02 - 1.852000e+01 3.889955e+00 -2.557926e+01 8.668268e-02 - 1.853000e+01 3.746327e+00 -2.559307e+01 8.661186e-02 - 1.854000e+01 3.526329e+00 -2.560689e+01 8.663212e-02 - 1.855000e+01 3.234200e+00 -2.562070e+01 8.673571e-02 - 1.856000e+01 2.876383e+00 -2.563451e+01 8.688589e-02 - 1.857000e+01 2.461332e+00 -2.564832e+01 8.703003e-02 - 1.858000e+01 1.999250e+00 -2.566213e+01 8.711799e-02 - 1.859000e+01 1.501751e+00 -2.567595e+01 8.711936e-02 - 1.860000e+01 9.814823e-01 -2.568976e+01 8.703370e-02 - 1.861000e+01 4.517027e-01 -2.570357e+01 8.689062e-02 - 1.862000e+01 -7.414835e-02 -2.571738e+01 8.673974e-02 - 1.863000e+01 -5.828892e-01 -2.573119e+01 8.663363e-02 - 1.864000e+01 -1.062014e+00 -2.574500e+01 8.660942e-02 - 1.865000e+01 -1.500081e+00 -2.575882e+01 8.667576e-02 - 1.866000e+01 -1.887051e+00 -2.577263e+01 8.680969e-02 - 1.867000e+01 -2.214570e+00 -2.578644e+01 8.696490e-02 - 1.868000e+01 -2.476187e+00 -2.580025e+01 8.708798e-02 - 1.869000e+01 -2.667493e+00 -2.581406e+01 8.713694e-02 - 1.870000e+01 -2.786196e+00 -2.582787e+01 8.709541e-02 - 1.871000e+01 -2.832105e+00 -2.584169e+01 8.697819e-02 - 1.872000e+01 -2.807064e+00 -2.585550e+01 8.682608e-02 - 1.873000e+01 -2.714802e+00 -2.586931e+01 8.669201e-02 - 1.874000e+01 -2.560741e+00 -2.588312e+01 8.662265e-02 - 1.875000e+01 -2.351752e+00 -2.589693e+01 8.664204e-02 - 1.876000e+01 -2.095870e+00 -2.591074e+01 8.674305e-02 - 1.877000e+01 -1.802001e+00 -2.592456e+01 8.689001e-02 - 1.878000e+01 -1.479602e+00 -2.593837e+01 8.703136e-02 - 1.879000e+01 -1.138366e+00 -2.595218e+01 8.711776e-02 - 1.880000e+01 -7.879214e-01 -2.596599e+01 8.711906e-02 - 1.881000e+01 -4.375466e-01 -2.597980e+01 8.703452e-02 - 1.882000e+01 -9.591223e-02 -2.599361e+01 8.689316e-02 - 1.883000e+01 2.291400e-01 -2.600743e+01 8.674382e-02 - 1.884000e+01 5.307793e-01 -2.602124e+01 8.663848e-02 - 1.885000e+01 8.033258e-01 -2.603505e+01 8.661408e-02 - 1.886000e+01 1.042344e+00 -2.604886e+01 8.667944e-02 - 1.887000e+01 1.244694e+00 -2.606267e+01 8.681211e-02 - 1.888000e+01 1.408534e+00 -2.607648e+01 8.696633e-02 - 1.889000e+01 1.533284e+00 -2.609030e+01 8.708914e-02 - 1.890000e+01 1.619555e+00 -2.610411e+01 8.713861e-02 - 1.891000e+01 1.669032e+00 -2.611792e+01 8.709817e-02 - 1.892000e+01 1.684341e+00 -2.613173e+01 8.698215e-02 - 1.893000e+01 1.668888e+00 -2.614554e+01 8.683088e-02 - 1.894000e+01 1.626680e+00 -2.615935e+01 8.669698e-02 - 1.895000e+01 1.562134e+00 -2.617317e+01 8.662709e-02 - 1.896000e+01 1.479893e+00 -2.618698e+01 8.664556e-02 - 1.897000e+01 1.384630e+00 -2.620079e+01 8.674573e-02 - 1.898000e+01 1.280880e+00 -2.621460e+01 8.689237e-02 - 1.899000e+01 1.172869e+00 -2.622841e+01 8.703415e-02 - 1.900000e+01 1.064382e+00 -2.624222e+01 8.712155e-02 - 1.901000e+01 9.586432e-01 -2.625604e+01 8.712391e-02 - 1.902000e+01 8.582358e-01 -2.626985e+01 8.703982e-02 - 1.903000e+01 7.650479e-01 -2.628366e+01 8.689764e-02 - 1.904000e+01 6.802536e-01 -2.629747e+01 8.674590e-02 - 1.905000e+01 6.043264e-01 -2.631128e+01 8.663675e-02 - 1.906000e+01 5.370840e-01 -2.632509e+01 8.660775e-02 - 1.907000e+01 4.777607e-01 -2.633891e+01 8.666869e-02 - 1.908000e+01 4.251049e-01 -2.635272e+01 8.679810e-02 - 1.909000e+01 3.774942e-01 -2.636653e+01 8.695090e-02 - 1.910000e+01 3.330653e-01 -2.638034e+01 8.707426e-02 - 1.911000e+01 2.898492e-01 -2.639415e+01 8.712585e-02 - 1.912000e+01 2.459072e-01 -2.640797e+01 8.708827e-02 - 1.913000e+01 1.994612e-01 -2.642178e+01 8.697485e-02 - 1.914000e+01 1.490112e-01 -2.643559e+01 8.682517e-02 - 1.915000e+01 9.343576e-02 -2.644940e+01 8.669150e-02 - 1.916000e+01 3.207130e-02 -2.646321e+01 8.662080e-02 - 1.917000e+01 -3.523389e-02 -2.647702e+01 8.663819e-02 - 1.918000e+01 -1.080916e-01 -2.649084e+01 8.673807e-02 - 1.919000e+01 -1.855728e-01 -2.650465e+01 8.688609e-02 - 1.920000e+01 -2.662331e-01 -2.651846e+01 8.703131e-02 - 1.921000e+01 -3.481626e-01 -2.653227e+01 8.712394e-02 - 1.922000e+01 -4.290574e-01 -2.654608e+01 8.713244e-02 - 1.923000e+01 -5.063087e-01 -2.655989e+01 8.705411e-02 - 1.924000e+01 -5.771067e-01 -2.657371e+01 8.691603e-02 - 1.925000e+01 -6.385529e-01 -2.658752e+01 8.676580e-02 - 1.926000e+01 -6.877780e-01 -2.660133e+01 8.665529e-02 - 1.927000e+01 -7.220605e-01 -2.661514e+01 8.662258e-02 - 1.928000e+01 -7.389414e-01 -2.662895e+01 8.667855e-02 - 1.929000e+01 -7.363326e-01 -2.664276e+01 8.680308e-02 - 1.930000e+01 -7.126151e-01 -2.665658e+01 8.695223e-02 - 1.931000e+01 -6.667246e-01 -2.667039e+01 8.707374e-02 - 1.932000e+01 -5.982225e-01 -2.668420e+01 8.712516e-02 - 1.933000e+01 -5.073506e-01 -2.669801e+01 8.708834e-02 - 1.934000e+01 -3.950681e-01 -2.671182e+01 8.697554e-02 - 1.935000e+01 -2.630694e-01 -2.672563e+01 8.682530e-02 - 1.936000e+01 -1.137826e-01 -2.673945e+01 8.668935e-02 - 1.937000e+01 4.965341e-02 -2.675326e+01 8.661471e-02 - 1.938000e+01 2.234330e-01 -2.676707e+01 8.662727e-02 - 1.939000e+01 4.031503e-01 -2.678088e+01 8.672263e-02 - 1.940000e+01 5.838880e-01 -2.679469e+01 8.686764e-02 - 1.941000e+01 7.603286e-01 -2.680850e+01 8.701220e-02 - 1.942000e+01 9.268876e-01 -2.682232e+01 8.710673e-02 - 1.943000e+01 1.077867e+00 -2.683613e+01 8.711916e-02 - 1.944000e+01 1.207627e+00 -2.684994e+01 8.704579e-02 - 1.945000e+01 1.310772e+00 -2.686375e+01 8.691245e-02 - 1.946000e+01 1.382344e+00 -2.687756e+01 8.676570e-02 - 1.947000e+01 1.418029e+00 -2.689137e+01 8.665689e-02 - 1.948000e+01 1.414343e+00 -2.690519e+01 8.662421e-02 - 1.949000e+01 1.368829e+00 -2.691900e+01 8.667927e-02 - 1.950000e+01 1.280213e+00 -2.693281e+01 8.680296e-02 - 1.951000e+01 1.148547e+00 -2.694662e+01 8.695227e-02 - 1.952000e+01 9.753031e-01 -2.696043e+01 8.707545e-02 - 1.953000e+01 7.634311e-01 -2.697424e+01 8.712995e-02 - 1.954000e+01 5.173547e-01 -2.698806e+01 8.709697e-02 - 1.955000e+01 2.429157e-01 -2.700187e+01 8.698780e-02 - 1.956000e+01 -5.274497e-02 -2.701568e+01 8.684001e-02 - 1.957000e+01 -3.613665e-01 -2.702949e+01 8.670468e-02 - 1.958000e+01 -6.738055e-01 -2.704330e+01 8.662878e-02 - 1.959000e+01 -9.803250e-01 -2.705711e+01 8.663873e-02 - 1.960000e+01 -1.270927e+00 -2.707093e+01 8.673105e-02 - 1.961000e+01 -1.535714e+00 -2.708474e+01 8.687359e-02 - 1.962000e+01 -1.765271e+00 -2.709855e+01 8.701693e-02 - 1.963000e+01 -1.951044e+00 -2.711236e+01 8.711161e-02 - 1.964000e+01 -2.085707e+00 -2.712617e+01 8.712512e-02 - 1.965000e+01 -2.163487e+00 -2.713998e+01 8.705289e-02 - 1.966000e+01 -2.180452e+00 -2.715380e+01 8.691976e-02 - 1.967000e+01 -2.134721e+00 -2.716761e+01 8.677159e-02 - 1.968000e+01 -2.026606e+00 -2.718142e+01 8.665955e-02 - 1.969000e+01 -1.858664e+00 -2.719523e+01 8.662232e-02 - 1.970000e+01 -1.635658e+00 -2.720904e+01 8.667250e-02 - 1.971000e+01 -1.364429e+00 -2.722286e+01 8.679216e-02 - 1.972000e+01 -1.053676e+00 -2.723667e+01 8.693928e-02 - 1.973000e+01 -7.136597e-01 -2.725048e+01 8.706254e-02 - 1.974000e+01 -3.558338e-01 -2.726429e+01 8.711913e-02 - 1.975000e+01 7.572895e-03 -2.727810e+01 8.708940e-02 - 1.976000e+01 3.640104e-01 -2.729191e+01 8.698344e-02 - 1.977000e+01 7.010758e-01 -2.730573e+01 8.683771e-02 - 1.978000e+01 1.006975e+00 -2.731954e+01 8.670262e-02 - 1.979000e+01 1.270958e+00 -2.733335e+01 8.662514e-02 - 1.980000e+01 1.483711e+00 -2.734716e+01 8.663239e-02 - 1.981000e+01 1.637679e+00 -2.736097e+01 8.672204e-02 - 1.982000e+01 1.727326e+00 -2.737478e+01 8.686318e-02 - 1.983000e+01 1.749294e+00 -2.738860e+01 8.700723e-02 - 1.984000e+01 1.702483e+00 -2.740241e+01 8.710492e-02 - 1.985000e+01 1.588034e+00 -2.741622e+01 8.712322e-02 - 1.986000e+01 1.409227e+00 -2.743003e+01 8.705644e-02 - 1.987000e+01 1.171294e+00 -2.744384e+01 8.692811e-02 - 1.988000e+01 8.811625e-01 -2.745765e+01 8.678293e-02 - 1.989000e+01 5.471485e-01 -2.747147e+01 8.667148e-02 - 1.990000e+01 1.786013e-01 -2.748528e+01 8.663257e-02 - 1.991000e+01 -2.144701e-01 -2.749909e+01 8.667962e-02 - 1.992000e+01 -6.217781e-01 -2.751290e+01 8.679592e-02 - 1.993000e+01 -1.033127e+00 -2.752671e+01 8.694062e-02 - 1.994000e+01 -1.438757e+00 -2.754052e+01 8.706314e-02 - 1.995000e+01 -1.829651e+00 -2.755434e+01 8.712079e-02 - 1.996000e+01 -2.197791e+00 -2.756815e+01 8.709333e-02 - 1.997000e+01 -2.536358e+00 -2.758196e+01 8.698987e-02 - 1.998000e+01 -2.839868e+00 -2.759577e+01 8.684575e-02 - 1.999000e+01 -3.104253e+00 -2.760958e+01 8.671056e-02 - 2.000000e+01 -3.326870e+00 -2.762339e+01 8.663104e-02 + 1.000000e-02 -7.734561e-02 -1.381170e-02 3.134926e-02 + 2.000000e-02 -1.596764e-01 -2.762339e-02 6.045792e-02 + 3.000000e-02 -2.516875e-01 -4.143509e-02 8.526468e-02 + 4.000000e-02 -3.575096e-01 -5.524679e-02 1.040541e-01 + 5.000000e-02 -4.804651e-01 -6.905849e-02 1.155991e-01 + 6.000000e-02 -6.228668e-01 -8.287018e-02 1.192732e-01 + 7.000000e-02 -7.858705e-01 -9.668188e-02 1.151330e-01 + 8.000000e-02 -9.693874e-01 -1.104936e-01 1.039918e-01 + 9.000000e-02 -1.172061e+00 -1.243053e-01 8.755577e-02 + 1.000000e-01 -1.391306e+00 -1.381170e-01 6.884717e-02 + 1.100000e-01 -1.623409e+00 -1.519287e-01 5.341991e-02 + 1.200000e-01 -1.863680e+00 -1.657404e-01 4.979434e-02 + 1.300000e-01 -2.106649e+00 -1.795521e-01 6.017895e-02 + 1.400000e-01 -2.346295e+00 -1.933638e-01 7.640497e-02 + 1.500000e-01 -2.576293e+00 -2.071755e-01 9.161881e-02 + 1.600000e-01 -2.790268e+00 -2.209872e-01 1.024655e-01 + 1.700000e-01 -2.982047e+00 -2.347989e-01 1.074539e-01 + 1.800000e-01 -3.145891e+00 -2.486105e-01 1.062389e-01 + 1.900000e-01 -3.276707e+00 -2.624222e-01 9.942805e-02 + 2.000000e-01 -3.370223e+00 -2.762339e-01 8.860376e-02 + 2.100000e-01 -3.423130e+00 -2.900456e-01 7.650761e-02 + 2.200000e-01 -3.433181e+00 -3.038573e-01 6.719764e-02 + 2.300000e-01 -3.399254e+00 -3.176690e-01 6.493149e-02 + 2.400000e-01 -3.321377e+00 -3.314807e-01 7.061632e-02 + 2.500000e-01 -3.200715e+00 -3.452924e-01 8.074527e-02 + 2.600000e-01 -3.039527e+00 -3.591041e-01 9.101665e-02 + 2.700000e-01 -2.841094e+00 -3.729158e-01 9.850821e-02 + 2.800000e-01 -2.609626e+00 -3.867275e-01 1.017102e-01 + 2.900000e-01 -2.350147e+00 -4.005392e-01 1.002266e-01 + 3.000000e-01 -2.068363e+00 -4.143509e-01 9.462396e-02 + 3.100000e-01 -1.770519e+00 -4.281626e-01 8.640470e-02 + 3.200000e-01 -1.463237e+00 -4.419743e-01 7.800773e-02 + 3.300000e-01 -1.153355e+00 -4.557860e-01 7.249483e-02 + 3.400000e-01 -8.477479e-01 -4.695977e-01 7.224522e-02 + 3.500000e-01 -5.531450e-01 -4.834094e-01 7.713224e-02 + 3.600000e-01 -2.759477e-01 -4.972211e-01 8.467203e-02 + 3.700000e-01 -2.204310e-02 -5.110328e-01 9.195493e-02 + 3.800000e-01 2.033757e-01 -5.248445e-01 9.686320e-02 + 3.900000e-01 3.959788e-01 -5.386562e-01 9.828977e-02 + 4.000000e-01 5.524508e-01 -5.524679e-01 9.606310e-02 + 4.100000e-01 6.706182e-01 -5.662796e-01 9.087598e-02 + 4.200000e-01 7.495432e-01 -5.800913e-01 8.423689e-02 + 4.300000e-01 7.895774e-01 -5.939030e-01 7.831796e-02 + 4.400000e-01 7.923692e-01 -6.077147e-01 7.538431e-02 + 4.500000e-01 7.608195e-01 -6.215264e-01 7.662821e-02 + 4.600000e-01 6.989824e-01 -6.353381e-01 8.131523e-02 + 4.700000e-01 6.119129e-01 -6.491498e-01 8.737928e-02 + 4.800000e-01 5.054623e-01 -6.629615e-01 9.267455e-02 + 4.900000e-01 3.860302e-01 -6.767732e-01 9.569092e-02 + 5.000000e-01 2.602819e-01 -6.905849e-01 9.573000e-02 + 5.100000e-01 1.348438e-01 -7.043966e-01 9.289354e-02 + 5.200000e-01 1.599279e-02 -7.182083e-01 8.803723e-02 + 5.300000e-01 -9.064421e-02 -7.320200e-01 8.267435e-02 + 5.400000e-01 -1.803637e-01 -7.458316e-01 7.868367e-02 + 5.500000e-01 -2.496148e-01 -7.596433e-01 7.762463e-02 + 5.600000e-01 -2.961697e-01 -7.734550e-01 7.986113e-02 + 5.700000e-01 -3.192238e-01 -7.872667e-01 8.433275e-02 + 5.800000e-01 -3.194177e-01 -8.010784e-01 8.926692e-02 + 5.900000e-01 -2.987769e-01 -8.148901e-01 9.303294e-02 + 6.000000e-01 -2.605717e-01 -8.287018e-01 9.458206e-02 + 6.100000e-01 -2.091040e-01 -8.425135e-01 9.356811e-02 + 6.200000e-01 -1.494329e-01 -8.563252e-01 9.034444e-02 + 6.300000e-01 -8.705466e-02 -8.701369e-01 8.590452e-02 + 6.400000e-01 -2.755745e-02 -8.839486e-01 8.171553e-02 + 6.500000e-01 2.372868e-02 -8.977603e-01 7.931299e-02 + 6.600000e-01 6.206366e-02 -9.115720e-01 7.962749e-02 + 6.700000e-01 8.359014e-02 -9.253837e-01 8.244920e-02 + 6.800000e-01 8.556789e-02 -9.391954e-01 8.658046e-02 + 6.900000e-01 6.653458e-02 -9.530071e-01 9.051104e-02 + 7.000000e-01 2.638255e-02 -9.668188e-01 9.300732e-02 + 7.100000e-01 -3.365350e-02 -9.806305e-01 9.339048e-02 + 7.200000e-01 -1.110967e-01 -9.944422e-01 9.161189e-02 + 7.300000e-01 -2.024086e-01 -1.008254e+00 8.823550e-02 + 7.400000e-01 -3.032383e-01 -1.022066e+00 8.434109e-02 + 7.500000e-01 -4.087215e-01 -1.035877e+00 8.127899e-02 + 7.600000e-01 -5.138097e-01 -1.049689e+00 8.019975e-02 + 7.700000e-01 -6.136058e-01 -1.063501e+00 8.149425e-02 + 7.800000e-01 -7.036833e-01 -1.077312e+00 8.457797e-02 + 7.900000e-01 -7.803670e-01 -1.091124e+00 8.824255e-02 + 8.000000e-01 -8.409562e-01 -1.104936e+00 9.123004e-02 + 8.100000e-01 -8.838756e-01 -1.118747e+00 9.263856e-02 + 8.200000e-01 -9.087437e-01 -1.132559e+00 9.209884e-02 + 8.300000e-01 -9.163567e-01 -1.146371e+00 8.981209e-02 + 8.400000e-01 -9.085893e-01 -1.160183e+00 8.650416e-02 + 8.500000e-01 -8.882216e-01 -1.173994e+00 8.327654e-02 + 8.600000e-01 -8.587063e-01 -1.187806e+00 8.129051e-02 + 8.700000e-01 -8.238944e-01 -1.201618e+00 8.129498e-02 + 8.800000e-01 -7.877398e-01 -1.215429e+00 8.324441e-02 + 8.900000e-01 -7.540061e-01 -1.229241e+00 8.633665e-02 + 9.000000e-01 -7.259969e-01 -1.243053e+00 8.943578e-02 + 9.100000e-01 -7.063286e-01 -1.256864e+00 9.152907e-02 + 9.200000e-01 -6.967632e-01 -1.270676e+00 9.200378e-02 + 9.300000e-01 -6.981108e-01 -1.284488e+00 9.075509e-02 + 9.400000e-01 -7.102095e-01 -1.298300e+00 8.818933e-02 + 9.500000e-01 -7.319798e-01 -1.312111e+00 8.513983e-02 + 9.600000e-01 -7.615502e-01 -1.325923e+00 8.266016e-02 + 9.700000e-01 -7.964408e-01 -1.339735e+00 8.166394e-02 + 9.800000e-01 -8.337897e-01 -1.353546e+00 8.251468e-02 + 9.900000e-01 -8.706036e-01 -1.367358e+00 8.484194e-02 + 1.000000e-00 -9.040117e-01 -1.381170e+00 8.774748e-02 + 1.010000e+00 -9.315033e-01 -1.394981e+00 9.021996e-02 + 1.020000e+00 -9.511296e-01 -1.408793e+00 9.148261e-02 + 1.030000e+00 -9.616553e-01 -1.422605e+00 9.117828e-02 + 1.040000e+00 -9.626475e-01 -1.436417e+00 8.942710e-02 + 1.050000e+00 -9.544971e-01 -1.450228e+00 8.679399e-02 + 1.060000e+00 -9.383712e-01 -1.464040e+00 8.415952e-02 + 1.070000e+00 -9.161027e-01 -1.477852e+00 8.246149e-02 + 1.080000e+00 -8.900263e-01 -1.491663e+00 8.233013e-02 + 1.090000e+00 -8.627749e-01 -1.505475e+00 8.378993e-02 + 1.100000e+00 -8.370557e-01 -1.519287e+00 8.625490e-02 + 1.110000e+00 -8.154227e-01 -1.533098e+00 8.882170e-02 + 1.120000e+00 -8.000647e-01 -1.546910e+00 9.063428e-02 + 1.130000e+00 -7.926282e-01 -1.560722e+00 9.113887e-02 + 1.140000e+00 -7.940862e-01 -1.574533e+00 9.020245e-02 + 1.150000e+00 -8.046667e-01 -1.588345e+00 8.812929e-02 + 1.160000e+00 -8.238427e-01 -1.602157e+00 8.559113e-02 + 1.170000e+00 -8.503875e-01 -1.615969e+00 8.345275e-02 + 1.180000e+00 -8.824866e-01 -1.629780e+00 8.248185e-02 + 1.190000e+00 -9.178991e-01 -1.643592e+00 8.302436e-02 + 1.200000e+00 -9.541530e-01 -1.657404e+00 8.484068e-02 + 1.210000e+00 -9.887581e-01 -1.671215e+00 8.723378e-02 + 1.220000e+00 -1.019420e+00 -1.685027e+00 8.936506e-02 + 1.230000e+00 -1.044233e+00 -1.698839e+00 9.055378e-02 + 1.240000e+00 -1.061845e+00 -1.712650e+00 9.045794e-02 + 1.250000e+00 -1.071566e+00 -1.726462e+00 8.914106e-02 + 1.260000e+00 -1.073431e+00 -1.740274e+00 8.704942e-02 + 1.270000e+00 -1.068188e+00 -1.754086e+00 8.489959e-02 + 1.280000e+00 -1.057242e+00 -1.767897e+00 8.346229e-02 + 1.290000e+00 -1.042527e+00 -1.781709e+00 8.327095e-02 + 1.300000e+00 -1.026351e+00 -1.795521e+00 8.438368e-02 + 1.310000e+00 -1.011191e+00 -1.809332e+00 8.636090e-02 + 1.320000e+00 -9.994919e-01 -1.823144e+00 8.847613e-02 + 1.330000e+00 -9.934586e-01 -1.836956e+00 9.000844e-02 + 1.340000e+00 -9.948682e-01 -1.850767e+00 9.047021e-02 + 1.350000e+00 -1.004922e+00 -1.864579e+00 8.972635e-02 + 1.360000e+00 -1.024143e+00 -1.878391e+00 8.801881e-02 + 1.370000e+00 -1.052329e+00 -1.892203e+00 8.590676e-02 + 1.380000e+00 -1.088569e+00 -1.906014e+00 8.411382e-02 + 1.390000e+00 -1.131312e+00 -1.919826e+00 8.328369e-02 + 1.400000e+00 -1.178493e+00 -1.933638e+00 8.371558e-02 + 1.410000e+00 -1.227697e+00 -1.947449e+00 8.522786e-02 + 1.420000e+00 -1.276352e+00 -1.961261e+00 8.724927e-02 + 1.430000e+00 -1.321931e+00 -1.975073e+00 8.906920e-02 + 1.440000e+00 -1.362151e+00 -1.988884e+00 9.009276e-02 + 1.450000e+00 -1.395148e+00 -2.002696e+00 9.000846e-02 + 1.460000e+00 -1.419612e+00 -2.016508e+00 8.885776e-02 + 1.470000e+00 -1.434881e+00 -2.030319e+00 8.702023e-02 + 1.480000e+00 -1.440976e+00 -2.044131e+00 8.511516e-02 + 1.490000e+00 -1.438578e+00 -2.057943e+00 8.381334e-02 + 1.500000e+00 -1.428952e+00 -2.071755e+00 8.358812e-02 + 1.510000e+00 -1.413823e+00 -2.085566e+00 8.451113e-02 + 1.520000e+00 -1.395219e+00 -2.099378e+00 8.622309e-02 + 1.530000e+00 -1.375288e+00 -2.113190e+00 8.810063e-02 + 1.540000e+00 -1.356109e+00 -2.127001e+00 8.950526e-02 + 1.550000e+00 -1.339521e+00 -2.140813e+00 8.998983e-02 + 1.560000e+00 -1.326967e+00 -2.154625e+00 8.941412e-02 + 1.570000e+00 -1.319389e+00 -2.168436e+00 8.797326e-02 + 1.580000e+00 -1.317160e+00 -2.182248e+00 8.614643e-02 + 1.590000e+00 -1.320081e+00 -2.196060e+00 8.456224e-02 + 1.600000e+00 -1.327421e+00 -2.209872e+00 8.378773e-02 + 1.610000e+00 -1.338016e+00 -2.223683e+00 8.410190e-02 + 1.620000e+00 -1.350401e+00 -2.237495e+00 8.537324e-02 + 1.630000e+00 -1.362974e+00 -2.251307e+00 8.712414e-02 + 1.640000e+00 -1.374170e+00 -2.265118e+00 8.873653e-02 + 1.650000e+00 -1.382635e+00 -2.278930e+00 8.967598e-02 + 1.660000e+00 -1.387368e+00 -2.292742e+00 8.964903e-02 + 1.670000e+00 -1.387843e+00 -2.306553e+00 8.867411e-02 + 1.680000e+00 -1.384077e+00 -2.320365e+00 8.707293e-02 + 1.690000e+00 -1.376637e+00 -2.334177e+00 8.538419e-02 + 1.700000e+00 -1.366606e+00 -2.347989e+00 8.419842e-02 + 1.710000e+00 -1.355480e+00 -2.361800e+00 8.394229e-02 + 1.720000e+00 -1.345031e+00 -2.375612e+00 8.470005e-02 + 1.730000e+00 -1.337123e+00 -2.389424e+00 8.617890e-02 + 1.740000e+00 -1.333527e+00 -2.403235e+00 8.784186e-02 + 1.750000e+00 -1.335716e+00 -2.417047e+00 8.912123e-02 + 1.760000e+00 -1.344696e+00 -2.430859e+00 8.960623e-02 + 1.770000e+00 -1.360861e+00 -2.444670e+00 8.915473e-02 + 1.780000e+00 -1.383901e+00 -2.458482e+00 8.792463e-02 + 1.790000e+00 -1.412776e+00 -2.472294e+00 8.633026e-02 + 1.800000e+00 -1.445754e+00 -2.486105e+00 8.492298e-02 + 1.810000e+00 -1.480514e+00 -2.499917e+00 8.420620e-02 + 1.820000e+00 -1.514312e+00 -2.513729e+00 8.443860e-02 + 1.830000e+00 -1.544202e+00 -2.527541e+00 8.552365e-02 + 1.840000e+00 -1.567278e+00 -2.541352e+00 8.705601e-02 + 1.850000e+00 -1.580939e+00 -2.555164e+00 8.849338e-02 + 1.860000e+00 -1.583140e+00 -2.568976e+00 8.935436e-02 + 1.870000e+00 -1.572609e+00 -2.582787e+00 8.936496e-02 + 1.880000e+00 -1.549013e+00 -2.596599e+00 8.852906e-02 + 1.890000e+00 -1.513057e+00 -2.610411e+00 8.712423e-02 + 1.900000e+00 -1.466490e+00 -2.624222e+00 8.562504e-02 + 1.910000e+00 -1.412034e+00 -2.638034e+00 8.455578e-02 + 1.920000e+00 -1.353220e+00 -2.651846e+00 8.430059e-02 + 1.930000e+00 -1.294150e+00 -2.665658e+00 8.494598e-02 + 1.940000e+00 -1.239192e+00 -2.679469e+00 8.624521e-02 + 1.950000e+00 -1.192639e+00 -2.693281e+00 8.772760e-02 + 1.960000e+00 -1.158358e+00 -2.707093e+00 8.888395e-02 + 1.970000e+00 -1.139441e+00 -2.720904e+00 8.933725e-02 + 1.980000e+00 -1.137915e+00 -2.734716e+00 8.894918e-02 + 1.990000e+00 -1.154511e+00 -2.748528e+00 8.785320e-02 + 2.000000e+00 -1.188531e+00 -2.762339e+00 8.641699e-02 + 2.010000e+00 -1.237823e+00 -2.776151e+00 8.513478e-02 + 2.020000e+00 -1.298870e+00 -2.789963e+00 8.446166e-02 + 2.030000e+00 -1.366998e+00 -2.803775e+00 8.463800e-02 + 2.040000e+00 -1.436686e+00 -2.817586e+00 8.558855e-02 + 2.050000e+00 -1.501962e+00 -2.831398e+00 8.695755e-02 + 2.060000e+00 -1.556856e+00 -2.845210e+00 8.825708e-02 + 2.070000e+00 -1.595879e+00 -2.859021e+00 8.904528e-02 + 2.080000e+00 -1.614491e+00 -2.872833e+00 8.906364e-02 + 2.090000e+00 -1.609514e+00 -2.886645e+00 8.830655e-02 + 2.100000e+00 -1.579460e+00 -2.900456e+00 8.702107e-02 + 2.110000e+00 -1.524741e+00 -2.914268e+00 8.563829e-02 + 2.120000e+00 -1.447736e+00 -2.928080e+00 8.463963e-02 + 2.130000e+00 -1.352693e+00 -2.941891e+00 8.438444e-02 + 2.140000e+00 -1.245484e+00 -2.955703e+00 8.496517e-02 + 2.150000e+00 -1.133191e+00 -2.969515e+00 8.616936e-02 + 2.160000e+00 -1.023574e+00 -2.983327e+00 8.757206e-02 + 2.170000e+00 -9.244251e-01 -2.997138e+00 8.870195e-02 + 2.180000e+00 -8.428719e-01 -3.010950e+00 8.920000e-02 + 2.190000e+00 -7.846657e-01 -3.024762e+00 8.892219e-02 + 2.200000e+00 -7.535071e-01 -3.038573e+00 8.797447e-02 + 2.210000e+00 -7.504647e-01 -3.052385e+00 8.668116e-02 + 2.220000e+00 -7.735306e-01 -3.066197e+00 8.548894e-02 + 2.230000e+00 -8.173576e-01 -3.080008e+00 8.481846e-02 + 2.240000e+00 -8.732071e-01 -3.093820e+00 8.490579e-02 + 2.250000e+00 -9.291271e-01 -3.107632e+00 8.570642e-02 + 2.260000e+00 -9.703641e-01 -3.121444e+00 8.691730e-02 + 2.270000e+00 -9.799987e-01 -3.135255e+00 8.810312e-02 + 2.280000e+00 -9.397761e-01 -3.149067e+00 8.885701e-02 + 2.290000e+00 -8.310933e-01 -3.162879e+00 8.893019e-02 + 2.300000e+00 -6.360900e-01 -3.176690e+00 8.830113e-02 + 2.310000e+00 -3.387799e-01 -3.190502e+00 8.717917e-02 + 2.320000e+00 7.384109e-02 -3.204314e+00 8.594395e-02 + 2.330000e+00 6.107803e-01 -3.218125e+00 8.502589e-02 + 2.340000e+00 1.276191e+00 -3.231937e+00 8.475268e-02 + 2.350000e+00 2.068731e+00 -3.245749e+00 8.521931e-02 + 2.360000e+00 2.981181e+00 -3.259561e+00 8.624936e-02 + 2.370000e+00 4.000357e+00 -3.273372e+00 8.747046e-02 + 2.380000e+00 5.107337e+00 -3.287184e+00 8.845949e-02 + 2.390000e+00 6.277992e+00 -3.300996e+00 8.888735e-02 + 2.400000e+00 7.483803e+00 -3.314807e+00 8.861696e-02 + 2.410000e+00 8.692939e+00 -3.328619e+00 8.773945e-02 + 2.420000e+00 9.871525e+00 -3.342431e+00 8.654753e-02 + 2.430000e+00 1.098505e+01 -3.356242e+00 8.544831e-02 + 2.440000e+00 1.199985e+01 -3.370054e+00 8.482790e-02 + 2.450000e+00 1.288455e+01 -3.383866e+00 8.490680e-02 + 2.460000e+00 1.361146e+01 -3.397678e+00 8.565094e-02 + 2.470000e+00 1.415774e+01 -3.411489e+00 8.678792e-02 + 2.480000e+00 1.450644e+01 -3.425301e+00 8.791879e-02 + 2.490000e+00 1.464718e+01 -3.439113e+00 8.866444e-02 + 2.500000e+00 1.457658e+01 -3.452924e+00 8.878714e-02 + 2.510000e+00 1.429830e+01 -3.466736e+00 8.825730e-02 + 2.520000e+00 1.382281e+01 -3.480548e+00 8.725920e-02 + 2.530000e+00 1.316686e+01 -3.494359e+00 8.613645e-02 + 2.540000e+00 1.235258e+01 -3.508171e+00 8.528323e-02 + 2.550000e+00 1.140650e+01 -3.521983e+00 8.500491e-02 + 2.560000e+00 1.035826e+01 -3.535794e+00 8.539895e-02 + 2.570000e+00 9.239323e+00 -3.549606e+00 8.631613e-02 + 2.580000e+00 8.081607e+00 -3.563418e+00 8.742391e-02 + 2.590000e+00 6.916163e+00 -3.577230e+00 8.833600e-02 + 2.600000e+00 5.771973e+00 -3.591041e+00 8.874584e-02 + 2.610000e+00 4.674897e+00 -3.604853e+00 8.852008e-02 + 2.620000e+00 3.646830e+00 -3.618665e+00 8.773500e-02 + 2.630000e+00 2.705100e+00 -3.632476e+00 8.665363e-02 + 2.640000e+00 1.862122e+00 -3.646288e+00 8.564608e-02 + 2.650000e+00 1.125307e+00 -3.660100e+00 8.506583e-02 + 2.660000e+00 4.972252e-01 -3.673911e+00 8.511794e-02 + 2.670000e+00 -2.400927e-02 -3.687723e+00 8.577693e-02 + 2.680000e+00 -4.441723e-01 -3.701535e+00 8.679855e-02 + 2.690000e+00 -7.722150e-01 -3.715347e+00 8.781860e-02 + 2.700000e+00 -1.019459e+00 -3.729158e+00 8.848654e-02 + 2.710000e+00 -1.198748e+00 -3.742970e+00 8.857941e-02 + 2.720000e+00 -1.323610e+00 -3.756782e+00 8.806668e-02 + 2.730000e+00 -1.407472e+00 -3.770593e+00 8.711793e-02 + 2.740000e+00 -1.462967e+00 -3.784405e+00 8.605324e-02 + 2.750000e+00 -1.501372e+00 -3.798217e+00 8.524228e-02 + 2.760000e+00 -1.532185e+00 -3.812028e+00 8.497442e-02 + 2.770000e+00 -1.562860e+00 -3.825840e+00 8.534686e-02 + 2.780000e+00 -1.598702e+00 -3.839652e+00 8.622582e-02 + 2.790000e+00 -1.642903e+00 -3.853464e+00 8.730239e-02 + 2.800000e+00 -1.696711e+00 -3.867275e+00 8.821161e-02 + 2.810000e+00 -1.759700e+00 -3.881087e+00 8.865812e-02 + 2.820000e+00 -1.830120e+00 -3.894899e+00 8.850613e-02 + 2.830000e+00 -1.905285e+00 -3.908710e+00 8.781616e-02 + 2.840000e+00 -1.981979e+00 -3.922522e+00 8.682582e-02 + 2.850000e+00 -2.056843e+00 -3.936334e+00 8.587719e-02 + 2.860000e+00 -2.126718e+00 -3.950145e+00 8.530316e-02 + 2.870000e+00 -2.188935e+00 -3.963957e+00 8.530532e-02 + 2.880000e+00 -2.241518e+00 -3.977769e+00 8.587504e-02 + 2.890000e+00 -2.283314e+00 -3.991580e+00 8.679888e-02 + 2.900000e+00 -2.314031e+00 -4.005392e+00 8.774513e-02 + 2.910000e+00 -2.334204e+00 -4.019204e+00 8.838627e-02 + 2.920000e+00 -2.345096e+00 -4.033016e+00 8.850696e-02 + 2.930000e+00 -2.348533e+00 -4.046827e+00 8.806776e-02 + 2.940000e+00 -2.346723e+00 -4.060639e+00 8.721507e-02 + 2.950000e+00 -2.342043e+00 -4.074451e+00 8.623706e-02 + 2.960000e+00 -2.336835e+00 -4.088262e+00 8.547181e-02 + 2.970000e+00 -2.333219e+00 -4.102074e+00 8.518872e-02 + 2.980000e+00 -2.332935e+00 -4.115886e+00 8.548554e-02 + 2.990000e+00 -2.337236e+00 -4.129697e+00 8.624986e-02 + 3.000000e+00 -2.346817e+00 -4.143509e+00 8.720597e-02 + 3.010000e+00 -2.361806e+00 -4.157321e+00 8.802122e-02 + 3.020000e+00 -2.381792e+00 -4.171133e+00 8.842215e-02 + 3.030000e+00 -2.405909e+00 -4.184944e+00 8.828001e-02 + 3.040000e+00 -2.432939e+00 -4.198756e+00 8.764730e-02 + 3.050000e+00 -2.461444e+00 -4.212568e+00 8.674126e-02 + 3.060000e+00 -2.489911e+00 -4.226379e+00 8.587672e-02 + 3.070000e+00 -2.516886e+00 -4.240191e+00 8.536071e-02 + 3.080000e+00 -2.541103e+00 -4.254003e+00 8.537964e-02 + 3.090000e+00 -2.561584e+00 -4.267814e+00 8.592621e-02 + 3.100000e+00 -2.577712e+00 -4.281626e+00 8.680329e-02 + 3.110000e+00 -2.589266e+00 -4.295438e+00 8.770250e-02 + 3.120000e+00 -2.596420e+00 -4.309250e+00 8.831725e-02 + 3.130000e+00 -2.599709e+00 -4.323061e+00 8.844402e-02 + 3.140000e+00 -2.599957e+00 -4.336873e+00 8.804325e-02 + 3.150000e+00 -2.598188e+00 -4.350685e+00 8.724975e-02 + 3.160000e+00 -2.595516e+00 -4.364496e+00 8.633174e-02 + 3.170000e+00 -2.593021e+00 -4.378308e+00 8.560513e-02 + 3.180000e+00 -2.591636e+00 -4.392120e+00 8.532290e-02 + 3.190000e+00 -2.592035e+00 -4.405931e+00 8.557901e-02 + 3.200000e+00 -2.594543e+00 -4.419743e+00 8.627157e-02 + 3.210000e+00 -2.599066e+00 -4.433555e+00 8.714478e-02 + 3.220000e+00 -2.605049e+00 -4.447366e+00 8.788730e-02 + 3.230000e+00 -2.611468e+00 -4.461178e+00 8.824143e-02 + 3.240000e+00 -2.616842e+00 -4.474990e+00 8.808516e-02 + 3.250000e+00 -2.619286e+00 -4.488802e+00 8.746838e-02 + 3.260000e+00 -2.616581e+00 -4.502613e+00 8.659820e-02 + 3.270000e+00 -2.606259e+00 -4.516425e+00 8.577550e-02 + 3.280000e+00 -2.585719e+00 -4.530237e+00 8.529449e-02 + 3.290000e+00 -2.552333e+00 -4.544048e+00 8.533489e-02 + 3.300000e+00 -2.503569e+00 -4.557860e+00 8.589126e-02 + 3.310000e+00 -2.437100e+00 -4.571672e+00 8.677526e-02 + 3.320000e+00 -2.350917e+00 -4.585483e+00 8.768926e-02 + 3.330000e+00 -2.243420e+00 -4.599295e+00 8.833407e-02 + 3.340000e+00 -2.113503e+00 -4.613107e+00 8.850678e-02 + 3.350000e+00 -1.960618e+00 -4.626919e+00 8.816083e-02 + 3.360000e+00 -1.784825e+00 -4.640730e+00 8.741788e-02 + 3.370000e+00 -1.586825e+00 -4.654542e+00 8.653083e-02 + 3.380000e+00 -1.367979e+00 -4.668354e+00 8.580368e-02 + 3.390000e+00 -1.130302e+00 -4.682165e+00 8.548686e-02 + 3.400000e+00 -8.764571e-01 -4.695977e+00 8.568406e-02 + 3.410000e+00 -6.097196e-01 -4.709789e+00 8.631281e-02 + 3.420000e+00 -3.339377e-01 -4.723600e+00 8.713910e-02 + 3.430000e+00 -5.347346e-02 -4.737412e+00 8.786787e-02 + 3.440000e+00 2.268704e-01 -4.751224e+00 8.824708e-02 + 3.450000e+00 5.019383e-01 -4.765036e+00 8.814830e-02 + 3.460000e+00 7.663258e-01 -4.778847e+00 8.760434e-02 + 3.470000e+00 1.014500e+00 -4.792659e+00 8.679847e-02 + 3.480000e+00 1.240932e+00 -4.806471e+00 8.600717e-02 + 3.490000e+00 1.440250e+00 -4.820282e+00 8.550784e-02 + 3.500000e+00 1.607392e+00 -4.834094e+00 8.547816e-02 + 3.510000e+00 1.737778e+00 -4.847906e+00 8.592753e-02 + 3.520000e+00 1.827471e+00 -4.861717e+00 8.669413e-02 + 3.530000e+00 1.873343e+00 -4.875529e+00 8.750884e-02 + 3.540000e+00 1.873221e+00 -4.889341e+00 8.809407e-02 + 3.550000e+00 1.826015e+00 -4.903152e+00 8.825661e-02 + 3.560000e+00 1.731819e+00 -4.916964e+00 8.794676e-02 + 3.570000e+00 1.591965e+00 -4.930776e+00 8.727197e-02 + 3.580000e+00 1.409047e+00 -4.944588e+00 8.646361e-02 + 3.590000e+00 1.186882e+00 -4.958399e+00 8.580261e-02 + 3.600000e+00 9.304277e-01 -4.972211e+00 8.552186e-02 + 3.610000e+00 6.456414e-01 -4.986023e+00 8.571906e-02 + 3.620000e+00 3.392945e-01 -4.999834e+00 8.631881e-02 + 3.630000e+00 1.873856e-02 -5.013646e+00 8.710326e-02 + 3.640000e+00 -3.083619e-01 -5.027458e+00 8.779520e-02 + 3.650000e+00 -6.343206e-01 -5.041269e+00 8.815575e-02 + 3.660000e+00 -9.517301e-01 -5.055081e+00 8.806124e-02 + 3.670000e+00 -1.253756e+00 -5.068893e+00 8.754045e-02 + 3.680000e+00 -1.534413e+00 -5.082705e+00 8.676573e-02 + 3.690000e+00 -1.788795e+00 -5.096516e+00 8.599990e-02 + 3.700000e+00 -2.013266e+00 -5.110328e+00 8.550922e-02 + 3.710000e+00 -2.205580e+00 -5.124140e+00 8.546775e-02 + 3.720000e+00 -2.364928e+00 -5.137951e+00 8.589091e-02 + 3.730000e+00 -2.491921e+00 -5.151763e+00 8.663012e-02 + 3.740000e+00 -2.588479e+00 -5.165575e+00 8.743106e-02 + 3.750000e+00 -2.657671e+00 -5.179386e+00 8.802674e-02 + 3.760000e+00 -2.703479e+00 -5.193198e+00 8.822663e-02 + 3.770000e+00 -2.730520e+00 -5.207010e+00 8.797479e-02 + 3.780000e+00 -2.743737e+00 -5.220822e+00 8.736478e-02 + 3.790000e+00 -2.748083e+00 -5.234633e+00 8.660995e-02 + 3.800000e+00 -2.748209e+00 -5.248445e+00 8.597450e-02 + 3.810000e+00 -2.748188e+00 -5.262257e+00 8.568213e-02 + 3.820000e+00 -2.751276e+00 -5.276068e+00 8.583325e-02 + 3.830000e+00 -2.759752e+00 -5.289880e+00 8.636683e-02 + 3.840000e+00 -2.774817e+00 -5.303692e+00 8.708555e-02 + 3.850000e+00 -2.796588e+00 -5.317503e+00 8.773157e-02 + 3.860000e+00 -2.824158e+00 -5.331315e+00 8.807818e-02 + 3.870000e+00 -2.855748e+00 -5.345127e+00 8.800391e-02 + 3.880000e+00 -2.888908e+00 -5.358939e+00 8.752973e-02 + 3.890000e+00 -2.920779e+00 -5.372750e+00 8.681247e-02 + 3.900000e+00 -2.948371e+00 -5.386562e+00 8.609591e-02 + 3.910000e+00 -2.968861e+00 -5.400374e+00 8.562970e-02 + 3.920000e+00 -2.979857e+00 -5.414185e+00 8.557964e-02 + 3.930000e+00 -2.979632e+00 -5.427997e+00 8.596450e-02 + 3.940000e+00 -2.967290e+00 -5.441809e+00 8.664908e-02 + 3.950000e+00 -2.942857e+00 -5.455620e+00 8.739672e-02 + 3.960000e+00 -2.907272e+00 -5.469432e+00 8.795581e-02 + 3.970000e+00 -2.862300e+00 -5.483244e+00 8.814437e-02 + 3.980000e+00 -2.810334e+00 -5.497055e+00 8.790624e-02 + 3.990000e+00 -2.754132e+00 -5.510867e+00 8.732687e-02 + 4.000000e+00 -2.696475e+00 -5.524679e+00 8.660621e-02 + 4.010000e+00 -2.639789e+00 -5.538491e+00 8.599417e-02 + 4.020000e+00 -2.585754e+00 -5.552302e+00 8.570445e-02 + 4.030000e+00 -2.534926e+00 -5.566114e+00 8.583588e-02 + 4.040000e+00 -2.486404e+00 -5.579926e+00 8.633496e-02 + 4.050000e+00 -2.437580e+00 -5.593737e+00 8.701785e-02 + 4.060000e+00 -2.383991e+00 -5.607549e+00 8.764065e-02 + 4.070000e+00 -2.319291e+00 -5.621361e+00 8.798621e-02 + 4.080000e+00 -2.235371e+00 -5.635172e+00 8.793541e-02 + 4.090000e+00 -2.122615e+00 -5.648984e+00 8.750393e-02 + 4.100000e+00 -1.970297e+00 -5.662796e+00 8.683711e-02 + 4.110000e+00 -1.767102e+00 -5.676608e+00 8.616432e-02 + 4.120000e+00 -1.501749e+00 -5.690419e+00 8.572243e-02 + 4.130000e+00 -1.163683e+00 -5.704231e+00 8.567084e-02 + 4.140000e+00 -7.438005e-01 -5.718043e+00 8.603091e-02 + 4.150000e+00 -2.351580e-01 -5.731854e+00 8.667774e-02 + 4.160000e+00 3.663656e-01 -5.745666e+00 8.738832e-02 + 4.170000e+00 1.061510e+00 -5.759478e+00 8.792278e-02 + 4.180000e+00 1.847208e+00 -5.773289e+00 8.810524e-02 + 4.190000e+00 2.716329e+00 -5.787101e+00 8.787868e-02 + 4.200000e+00 3.657618e+00 -5.800913e+00 8.732138e-02 + 4.210000e+00 4.655841e+00 -5.814725e+00 8.662233e-02 + 4.220000e+00 5.692133e+00 -5.828536e+00 8.602054e-02 + 4.230000e+00 6.744555e+00 -5.842348e+00 8.572319e-02 + 4.240000e+00 7.788825e+00 -5.856160e+00 8.583002e-02 + 4.250000e+00 8.799190e+00 -5.869971e+00 8.629595e-02 + 4.260000e+00 9.749408e+00 -5.883783e+00 8.694977e-02 + 4.270000e+00 1.061379e+01 -5.897595e+00 8.755959e-02 + 4.280000e+00 1.136822e+01 -5.911406e+00 8.791545e-02 + 4.290000e+00 1.199120e+01 -5.925218e+00 8.789847e-02 + 4.300000e+00 1.246467e+01 -5.939030e+00 8.751740e-02 + 4.310000e+00 1.277484e+01 -5.952841e+00 8.690514e-02 + 4.320000e+00 1.291270e+01 -5.966653e+00 8.627632e-02 + 4.330000e+00 1.287439e+01 -5.980465e+00 8.585518e-02 + 4.340000e+00 1.266135e+01 -5.994277e+00 8.579510e-02 + 4.350000e+00 1.228021e+01 -6.008088e+00 8.612033e-02 + 4.360000e+00 1.174245e+01 -6.021900e+00 8.671645e-02 + 4.370000e+00 1.106387e+01 -6.035712e+00 8.737418e-02 + 4.380000e+00 1.026392e+01 -6.049523e+00 8.786556e-02 + 4.390000e+00 9.364814e+00 -6.063335e+00 8.802129e-02 + 4.400000e+00 8.390613e+00 -6.077147e+00 8.778446e-02 + 4.410000e+00 7.366263e+00 -6.090958e+00 8.722793e-02 + 4.420000e+00 6.316617e+00 -6.104770e+00 8.653223e-02 + 4.430000e+00 5.265521e+00 -6.118582e+00 8.592841e-02 + 4.440000e+00 4.234999e+00 -6.132394e+00 8.561983e-02 + 4.450000e+00 3.244559e+00 -6.146205e+00 8.570877e-02 + 4.460000e+00 2.310668e+00 -6.160017e+00 8.615855e-02 + 4.470000e+00 1.446384e+00 -6.173829e+00 8.680890e-02 + 4.480000e+00 6.611823e-01 -6.187640e+00 8.743706e-02 + 4.490000e+00 -3.905441e-02 -6.201452e+00 8.783681e-02 + 4.500000e+00 -6.518808e-01 -6.215264e+00 8.788586e-02 + 4.510000e+00 -1.177993e+00 -6.229075e+00 8.758252e-02 + 4.520000e+00 -1.620823e+00 -6.242887e+00 8.704418e-02 + 4.530000e+00 -1.986045e+00 -6.256699e+00 8.646856e-02 + 4.540000e+00 -2.281044e+00 -6.270511e+00 8.606669e-02 + 4.550000e+00 -2.514362e+00 -6.284322e+00 8.598740e-02 + 4.560000e+00 -2.695158e+00 -6.298134e+00 8.626153e-02 + 4.570000e+00 -2.832719e+00 -6.311946e+00 8.679056e-02 + 4.580000e+00 -2.936024e+00 -6.325757e+00 8.738503e-02 + 4.590000e+00 -3.013391e+00 -6.339569e+00 8.783451e-02 + 4.600000e+00 -3.072212e+00 -6.353381e+00 8.798044e-02 + 4.610000e+00 -3.118767e+00 -6.367192e+00 8.776777e-02 + 4.620000e+00 -3.158134e+00 -6.381004e+00 8.726241e-02 + 4.630000e+00 -3.194163e+00 -6.394816e+00 8.663102e-02 + 4.640000e+00 -3.229516e+00 -6.408627e+00 8.608727e-02 + 4.650000e+00 -3.265756e+00 -6.422439e+00 8.581849e-02 + 4.660000e+00 -3.303465e+00 -6.436251e+00 8.591708e-02 + 4.670000e+00 -3.342377e+00 -6.450063e+00 8.634536e-02 + 4.680000e+00 -3.381515e+00 -6.463874e+00 8.695011e-02 + 4.690000e+00 -3.419326e+00 -6.477686e+00 8.751985e-02 + 4.700000e+00 -3.453792e+00 -6.491498e+00 8.785941e-02 + 4.710000e+00 -3.482530e+00 -6.505309e+00 8.785407e-02 + 4.720000e+00 -3.502873e+00 -6.519121e+00 8.750507e-02 + 4.730000e+00 -3.511939e+00 -6.532933e+00 8.692868e-02 + 4.740000e+00 -3.506682e+00 -6.546744e+00 8.631937e-02 + 4.750000e+00 -3.483957e+00 -6.560556e+00 8.588540e-02 + 4.760000e+00 -3.440576e+00 -6.574368e+00 8.577557e-02 + 4.770000e+00 -3.373385e+00 -6.588180e+00 8.602434e-02 + 4.780000e+00 -3.279357e+00 -6.601991e+00 8.653953e-02 + 4.790000e+00 -3.155710e+00 -6.615803e+00 8.713833e-02 + 4.800000e+00 -3.000036e+00 -6.629615e+00 8.761468e-02 + 4.810000e+00 -2.810458e+00 -6.643426e+00 8.781026e-02 + 4.820000e+00 -2.585794e+00 -6.657238e+00 8.766528e-02 + 4.830000e+00 -2.325724e+00 -6.671050e+00 8.723634e-02 + 4.840000e+00 -2.030943e+00 -6.684861e+00 8.667774e-02 + 4.850000e+00 -1.703304e+00 -6.698673e+00 8.619059e-02 + 4.860000e+00 -1.345909e+00 -6.712485e+00 8.595303e-02 + 4.870000e+00 -9.631702e-01 -6.726297e+00 8.605479e-02 + 4.880000e+00 -5.608041e-01 -6.740108e+00 8.646303e-02 + 4.890000e+00 -1.457638e-01 -6.753920e+00 8.703493e-02 + 4.900000e+00 2.738950e-01 -6.767732e+00 8.757120e-02 + 4.910000e+00 6.892164e-01 -6.781543e+00 8.788676e-02 + 4.920000e+00 1.090608e+00 -6.795355e+00 8.787244e-02 + 4.930000e+00 1.468155e+00 -6.809167e+00 8.752974e-02 + 4.940000e+00 1.811980e+00 -6.822978e+00 8.697063e-02 + 4.950000e+00 2.112617e+00 -6.836790e+00 8.638246e-02 + 4.960000e+00 2.361395e+00 -6.850602e+00 8.596608e-02 + 4.970000e+00 2.550801e+00 -6.864413e+00 8.586518e-02 + 4.980000e+00 2.674816e+00 -6.878225e+00 8.611303e-02 + 4.990000e+00 2.729185e+00 -6.892037e+00 8.661999e-02 + 5.000000e+00 2.711627e+00 -6.905849e+00 8.720766e-02 + 5.010000e+00 2.621959e+00 -6.919660e+00 8.767376e-02 + 5.020000e+00 2.462128e+00 -6.933472e+00 8.786104e-02 + 5.030000e+00 2.236157e+00 -6.947284e+00 8.770755e-02 + 5.040000e+00 1.949990e+00 -6.961095e+00 8.726511e-02 + 5.050000e+00 1.611265e+00 -6.974907e+00 8.668269e-02 + 5.060000e+00 1.229002e+00 -6.988719e+00 8.615816e-02 + 5.070000e+00 8.132488e-01 -7.002530e+00 8.587099e-02 + 5.080000e+00 3.746712e-01 -7.016342e+00 8.591790e-02 + 5.090000e+00 -7.586038e-02 -7.030154e+00 8.627722e-02 + 5.100000e+00 -5.276906e-01 -7.043966e+00 8.681827e-02 + 5.110000e+00 -9.707736e-01 -7.057777e+00 8.735105e-02 + 5.120000e+00 -1.396027e+00 -7.071589e+00 8.769425e-02 + 5.130000e+00 -1.795627e+00 -7.085401e+00 8.773588e-02 + 5.140000e+00 -2.163237e+00 -7.099212e+00 8.746834e-02 + 5.150000e+00 -2.494151e+00 -7.113024e+00 8.698983e-02 + 5.160000e+00 -2.785361e+00 -7.126836e+00 8.647198e-02 + 5.170000e+00 -3.035536e+00 -7.140647e+00 8.610178e-02 + 5.180000e+00 -3.244924e+00 -7.154459e+00 8.601496e-02 + 5.190000e+00 -3.415178e+00 -7.168271e+00 8.624523e-02 + 5.200000e+00 -3.549129e+00 -7.182083e+00 8.671154e-02 + 5.210000e+00 -3.650505e+00 -7.195894e+00 8.724892e-02 + 5.220000e+00 -3.723620e+00 -7.209706e+00 8.766895e-02 + 5.230000e+00 -3.773049e+00 -7.223518e+00 8.782505e-02 + 5.240000e+00 -3.803304e+00 -7.237329e+00 8.766071e-02 + 5.250000e+00 -3.818524e+00 -7.251141e+00 8.722768e-02 + 5.260000e+00 -3.822194e+00 -7.264953e+00 8.667016e-02 + 5.270000e+00 -3.816918e+00 -7.278764e+00 8.617831e-02 + 5.280000e+00 -3.804229e+00 -7.292576e+00 8.592329e-02 + 5.290000e+00 -3.784477e+00 -7.306388e+00 8.599517e-02 + 5.300000e+00 -3.756772e+00 -7.320200e+00 8.636886e-02 + 5.310000e+00 -3.718998e+00 -7.334011e+00 8.691337e-02 + 5.320000e+00 -3.667897e+00 -7.347823e+00 8.744021e-02 + 5.330000e+00 -3.599214e+00 -7.361635e+00 8.776965e-02 + 5.340000e+00 -3.507905e+00 -7.375446e+00 8.779011e-02 + 5.350000e+00 -3.388388e+00 -7.389258e+00 8.749321e-02 + 5.360000e+00 -3.234838e+00 -7.403070e+00 8.697617e-02 + 5.370000e+00 -3.041515e+00 -7.416881e+00 8.641121e-02 + 5.380000e+00 -2.803099e+00 -7.430693e+00 8.598917e-02 + 5.390000e+00 -2.515036e+00 -7.444505e+00 8.585342e-02 + 5.400000e+00 -2.173860e+00 -7.458316e+00 8.604798e-02 + 5.410000e+00 -1.777503e+00 -7.472128e+00 8.650183e-02 + 5.420000e+00 -1.325552e+00 -7.485940e+00 8.705661e-02 + 5.430000e+00 -8.194596e-01 -7.499752e+00 8.752478e-02 + 5.440000e+00 -2.626892e-01 -7.513563e+00 8.775421e-02 + 5.450000e+00 3.392176e-01 -7.527375e+00 8.767696e-02 + 5.460000e+00 9.786512e-01 -7.541187e+00 8.732932e-02 + 5.470000e+00 1.646031e+00 -7.554998e+00 8.683885e-02 + 5.480000e+00 2.329988e+00 -7.568810e+00 8.638176e-02 + 5.490000e+00 3.017633e+00 -7.582622e+00 8.612218e-02 + 5.500000e+00 3.694900e+00 -7.596433e+00 8.615289e-02 + 5.510000e+00 4.346958e+00 -7.610245e+00 8.646102e-02 + 5.520000e+00 4.958674e+00 -7.624057e+00 8.693372e-02 + 5.530000e+00 5.515119e+00 -7.637869e+00 8.740100e-02 + 5.540000e+00 6.002084e+00 -7.651680e+00 8.769710e-02 + 5.550000e+00 6.406594e+00 -7.665492e+00 8.771699e-02 + 5.560000e+00 6.717406e+00 -7.679304e+00 8.745053e-02 + 5.570000e+00 6.925442e+00 -7.693115e+00 8.698579e-02 + 5.580000e+00 7.024169e+00 -7.706927e+00 8.648066e-02 + 5.590000e+00 7.009884e+00 -7.720739e+00 8.610998e-02 + 5.600000e+00 6.881897e+00 -7.734550e+00 8.600369e-02 + 5.610000e+00 6.642601e+00 -7.748362e+00 8.619864e-02 + 5.620000e+00 6.297426e+00 -7.762174e+00 8.662450e-02 + 5.630000e+00 5.854665e+00 -7.775986e+00 8.713015e-02 + 5.640000e+00 5.325193e+00 -7.789797e+00 8.753878e-02 + 5.650000e+00 4.722072e+00 -7.803609e+00 8.770900e-02 + 5.660000e+00 4.060080e+00 -7.817421e+00 8.758144e-02 + 5.670000e+00 3.355160e+00 -7.831232e+00 8.719768e-02 + 5.680000e+00 2.623839e+00 -7.845044e+00 8.668744e-02 + 5.690000e+00 1.882618e+00 -7.858856e+00 8.622663e-02 + 5.700000e+00 1.147384e+00 -7.872667e+00 8.597749e-02 + 5.710000e+00 4.328576e-01 -7.886479e+00 8.603025e-02 + 5.720000e+00 -2.478914e-01 -7.900291e+00 8.636931e-02 + 5.730000e+00 -8.838435e-01 -7.914102e+00 8.687907e-02 + 5.740000e+00 -1.466320e+00 -7.927914e+00 8.738655e-02 + 5.750000e+00 -1.989158e+00 -7.941726e+00 8.772229e-02 + 5.760000e+00 -2.448757e+00 -7.955538e+00 8.777674e-02 + 5.770000e+00 -2.844007e+00 -7.969349e+00 8.753466e-02 + 5.780000e+00 -3.176100e+00 -7.983161e+00 8.707946e-02 + 5.790000e+00 -3.448233e+00 -7.996973e+00 8.656641e-02 + 5.800000e+00 -3.665236e+00 -8.010784e+00 8.617139e-02 + 5.810000e+00 -3.833133e+00 -8.024596e+00 8.602990e-02 + 5.820000e+00 -3.958675e+00 -8.038408e+00 8.618804e-02 + 5.830000e+00 -4.048865e+00 -8.052219e+00 8.658593e-02 + 5.840000e+00 -4.110503e+00 -8.066031e+00 8.708082e-02 + 5.850000e+00 -4.149782e+00 -8.079843e+00 8.749955e-02 + 5.860000e+00 -4.171953e+00 -8.093655e+00 8.769861e-02 + 5.870000e+00 -4.181080e+00 -8.107466e+00 8.761101e-02 + 5.880000e+00 -4.179890e+00 -8.121278e+00 8.726695e-02 + 5.890000e+00 -4.169735e+00 -8.135090e+00 8.678365e-02 + 5.900000e+00 -4.150654e+00 -8.148901e+00 8.632682e-02 + 5.910000e+00 -4.121538e+00 -8.162713e+00 8.605422e-02 + 5.920000e+00 -4.080373e+00 -8.176525e+00 8.605936e-02 + 5.930000e+00 -4.024548e+00 -8.190336e+00 8.633734e-02 + 5.940000e+00 -3.951214e+00 -8.204148e+00 8.678737e-02 + 5.950000e+00 -3.857649e+00 -8.217960e+00 8.725091e-02 + 5.960000e+00 -3.741620e+00 -8.231772e+00 8.756870e-02 + 5.970000e+00 -3.601711e+00 -8.245583e+00 8.763482e-02 + 5.980000e+00 -3.437595e+00 -8.259395e+00 8.743080e-02 + 5.990000e+00 -3.250224e+00 -8.273207e+00 8.703087e-02 + 6.000000e+00 -3.041939e+00 -8.287018e+00 8.657745e-02 + 6.010000e+00 -2.816474e+00 -8.300830e+00 8.623311e-02 + 6.020000e+00 -2.578867e+00 -8.314642e+00 8.612316e-02 + 6.030000e+00 -2.335272e+00 -8.328453e+00 8.628953e-02 + 6.040000e+00 -2.092693e+00 -8.342265e+00 8.667500e-02 + 6.050000e+00 -1.858648e+00 -8.356077e+00 8.714473e-02 + 6.060000e+00 -1.640791e+00 -8.369888e+00 8.753548e-02 + 6.070000e+00 -1.446513e+00 -8.383700e+00 8.771242e-02 + 6.080000e+00 -1.282544e+00 -8.397512e+00 8.761380e-02 + 6.090000e+00 -1.154595e+00 -8.411324e+00 8.727067e-02 + 6.100000e+00 -1.067042e+00 -8.425135e+00 8.679705e-02 + 6.110000e+00 -1.022691e+00 -8.438947e+00 8.635272e-02 + 6.120000e+00 -1.022633e+00 -8.452759e+00 8.608880e-02 + 6.130000e+00 -1.066192e+00 -8.466570e+00 8.609374e-02 + 6.140000e+00 -1.150981e+00 -8.480382e+00 8.636059e-02 + 6.150000e+00 -1.273047e+00 -8.494194e+00 8.678994e-02 + 6.160000e+00 -1.427113e+00 -8.508005e+00 8.722702e-02 + 6.170000e+00 -1.606882e+00 -8.521817e+00 8.751718e-02 + 6.180000e+00 -1.805393e+00 -8.535629e+00 8.755858e-02 + 6.190000e+00 -2.015408e+00 -8.549441e+00 8.733548e-02 + 6.200000e+00 -2.229787e+00 -8.563252e+00 8.692355e-02 + 6.210000e+00 -2.441843e+00 -8.577064e+00 8.646565e-02 + 6.220000e+00 -2.645638e+00 -8.590876e+00 8.612434e-02 + 6.230000e+00 -2.836214e+00 -8.604687e+00 8.602490e-02 + 6.240000e+00 -3.009722e+00 -8.618499e+00 8.620926e-02 + 6.250000e+00 -3.163462e+00 -8.632311e+00 8.661987e-02 + 6.260000e+00 -3.295813e+00 -8.646122e+00 8.712074e-02 + 6.270000e+00 -3.406071e+00 -8.659934e+00 8.754630e-02 + 6.280000e+00 -3.494195e+00 -8.673746e+00 8.775802e-02 + 6.290000e+00 -3.560494e+00 -8.687558e+00 8.768946e-02 + 6.300000e+00 -3.605266e+00 -8.701369e+00 8.736689e-02 + 6.310000e+00 -3.628425e+00 -8.715181e+00 8.690065e-02 + 6.320000e+00 -3.629147e+00 -8.728993e+00 8.644948e-02 + 6.330000e+00 -3.605564e+00 -8.742804e+00 8.616701e-02 + 6.340000e+00 -3.554534e+00 -8.756616e+00 8.614766e-02 + 6.350000e+00 -3.471511e+00 -8.770428e+00 8.639233e-02 + 6.360000e+00 -3.350547e+00 -8.784239e+00 8.680872e-02 + 6.370000e+00 -3.184410e+00 -8.798051e+00 8.724599e-02 + 6.380000e+00 -2.964853e+00 -8.811863e+00 8.754876e-02 + 6.390000e+00 -2.683002e+00 -8.825674e+00 8.760987e-02 + 6.400000e+00 -2.329863e+00 -8.839486e+00 8.740504e-02 + 6.410000e+00 -1.896913e+00 -8.853298e+00 8.700040e-02 + 6.420000e+00 -1.376751e+00 -8.867110e+00 8.653120e-02 + 6.430000e+00 -7.637666e-01 -8.880921e+00 8.615719e-02 + 6.440000e+00 -5.478658e-02 -8.894733e+00 8.600743e-02 + 6.450000e+00 7.503419e-01 -8.908545e+00 8.613388e-02 + 6.460000e+00 1.648275e+00 -8.922356e+00 8.649247e-02 + 6.470000e+00 2.631839e+00 -8.936168e+00 8.696004e-02 + 6.480000e+00 3.689864e+00 -8.949980e+00 8.737928e-02 + 6.490000e+00 4.807217e+00 -8.963791e+00 8.761334e-02 + 6.500000e+00 5.965040e+00 -8.977603e+00 8.759051e-02 + 6.510000e+00 7.141184e+00 -8.991415e+00 8.732628e-02 + 6.520000e+00 8.310844e+00 -9.005227e+00 8.691727e-02 + 6.530000e+00 9.447355e+00 -9.019038e+00 8.650892e-02 + 6.540000e+00 1.052313e+01 -9.032850e+00 8.624585e-02 + 6.550000e+00 1.151068e+01 -9.046662e+00 8.622056e-02 + 6.560000e+00 1.238368e+01 -9.060473e+00 8.643989e-02 + 6.570000e+00 1.311803e+01 -9.074285e+00 8.682322e-02 + 6.580000e+00 1.369284e+01 -9.088097e+00 8.723311e-02 + 6.590000e+00 1.409131e+01 -9.101908e+00 8.752513e-02 + 6.600000e+00 1.430143e+01 -9.115720e+00 8.759756e-02 + 6.610000e+00 1.431653e+01 -9.129532e+00 8.742490e-02 + 6.620000e+00 1.413553e+01 -9.143344e+00 8.706581e-02 + 6.630000e+00 1.376303e+01 -9.157155e+00 8.664383e-02 + 6.640000e+00 1.320907e+01 -9.170967e+00 8.630586e-02 + 6.650000e+00 1.248876e+01 -9.184779e+00 8.617074e-02 + 6.660000e+00 1.162158e+01 -9.198590e+00 8.628606e-02 + 6.670000e+00 1.063063e+01 -9.212402e+00 8.661044e-02 + 6.680000e+00 9.541615e+00 -9.226214e+00 8.702918e-02 + 6.690000e+00 8.381888e+00 -9.240025e+00 8.739620e-02 + 6.700000e+00 7.179331e+00 -9.253837e+00 8.758517e-02 + 6.710000e+00 5.961341e+00 -9.267649e+00 8.753185e-02 + 6.720000e+00 4.753851e+00 -9.281461e+00 8.725476e-02 + 6.730000e+00 3.580485e+00 -9.295272e+00 8.684917e-02 + 6.740000e+00 2.461850e+00 -9.309084e+00 8.645577e-02 + 6.750000e+00 1.415025e+00 -9.322896e+00 8.621269e-02 + 6.760000e+00 4.532287e-01 -9.336707e+00 8.620624e-02 + 6.770000e+00 -4.142968e-01 -9.350519e+00 8.643915e-02 + 6.780000e+00 -1.182223e+00 -9.364331e+00 8.682945e-02 + 6.790000e+00 -1.848891e+00 -9.378142e+00 8.724072e-02 + 6.800000e+00 -2.415919e+00 -9.391954e+00 8.753056e-02 + 6.810000e+00 -2.887703e+00 -9.405766e+00 8.759901e-02 + 6.820000e+00 -3.270830e+00 -9.419577e+00 8.742103e-02 + 6.830000e+00 -3.573468e+00 -9.433389e+00 8.705433e-02 + 6.840000e+00 -3.804748e+00 -9.447201e+00 8.662072e-02 + 6.850000e+00 -3.974192e+00 -9.461013e+00 8.626564e-02 + 6.860000e+00 -4.091203e+00 -9.474824e+00 8.610804e-02 + 6.870000e+00 -4.164653e+00 -9.488636e+00 8.619781e-02 + 6.880000e+00 -4.202570e+00 -9.502448e+00 8.649787e-02 + 6.890000e+00 -4.211947e+00 -9.516259e+00 8.689872e-02 + 6.900000e+00 -4.198652e+00 -9.530071e+00 8.725885e-02 + 6.910000e+00 -4.167450e+00 -9.543883e+00 8.745463e-02 + 6.920000e+00 -4.122095e+00 -9.557694e+00 8.742188e-02 + 6.930000e+00 -4.065505e+00 -9.571506e+00 8.717653e-02 + 6.940000e+00 -3.999959e+00 -9.585318e+00 8.680901e-02 + 6.950000e+00 -3.927327e+00 -9.599130e+00 8.645406e-02 + 6.960000e+00 -3.849278e+00 -9.612941e+00 8.624413e-02 + 6.970000e+00 -3.767473e+00 -9.626753e+00 8.626168e-02 + 6.980000e+00 -3.683709e+00 -9.640565e+00 8.650827e-02 + 6.990000e+00 -3.600007e+00 -9.654376e+00 8.690351e-02 + 7.000000e+00 -3.518647e+00 -9.668188e+00 8.731419e-02 + 7.010000e+00 -3.442143e+00 -9.682000e+00 8.760140e-02 + 7.020000e+00 -3.373162e+00 -9.695811e+00 8.766765e-02 + 7.030000e+00 -3.314405e+00 -9.709623e+00 8.748867e-02 + 7.040000e+00 -3.268464e+00 -9.723435e+00 8.712136e-02 + 7.050000e+00 -3.237658e+00 -9.737247e+00 8.668565e-02 + 7.060000e+00 -3.223883e+00 -9.751058e+00 8.632511e-02 + 7.070000e+00 -3.228470e+00 -9.764870e+00 8.615774e-02 + 7.080000e+00 -3.252079e+00 -9.778682e+00 8.623406e-02 + 7.090000e+00 -3.294630e+00 -9.792493e+00 8.651903e-02 + 7.100000e+00 -3.355279e+00 -9.806305e+00 8.690579e-02 + 7.110000e+00 -3.432434e+00 -9.820117e+00 8.725504e-02 + 7.120000e+00 -3.523812e+00 -9.833928e+00 8.744407e-02 + 7.130000e+00 -3.626529e+00 -9.847740e+00 8.740803e-02 + 7.140000e+00 -3.737210e+00 -9.861552e+00 8.716079e-02 + 7.150000e+00 -3.852113e+00 -9.875363e+00 8.679014e-02 + 7.160000e+00 -3.967249e+00 -9.889175e+00 8.642857e-02 + 7.170000e+00 -4.078489e+00 -9.902987e+00 8.620775e-02 + 7.180000e+00 -4.181658e+00 -9.916799e+00 8.621132e-02 + 7.190000e+00 -4.272592e+00 -9.930610e+00 8.644384e-02 + 7.200000e+00 -4.347178e+00 -9.944422e+00 8.682872e-02 + 7.210000e+00 -4.401366e+00 -9.958234e+00 8.723616e-02 + 7.220000e+00 -4.431155e+00 -9.972045e+00 8.752910e-02 + 7.230000e+00 -4.432579e+00 -9.985857e+00 8.760985e-02 + 7.240000e+00 -4.401686e+00 -9.999669e+00 8.745203e-02 + 7.250000e+00 -4.334534e+00 -1.001348e+01 8.710905e-02 + 7.260000e+00 -4.227210e+00 -1.002729e+01 8.669701e-02 + 7.270000e+00 -4.075886e+00 -1.004110e+01 8.635634e-02 + 7.280000e+00 -3.876916e+00 -1.005492e+01 8.620357e-02 + 7.290000e+00 -3.626982e+00 -1.006873e+01 8.628964e-02 + 7.300000e+00 -3.323282e+00 -1.008254e+01 8.658147e-02 + 7.310000e+00 -2.963758e+00 -1.009635e+01 8.697451e-02 + 7.320000e+00 -2.547353e+00 -1.011016e+01 8.733096e-02 + 7.330000e+00 -2.074275e+00 -1.012397e+01 8.752789e-02 + 7.340000e+00 -1.546259e+00 -1.013779e+01 8.749837e-02 + 7.350000e+00 -9.667883e-01 -1.015160e+01 8.725294e-02 + 7.360000e+00 -3.412800e-01 -1.016541e+01 8.687595e-02 + 7.370000e+00 3.228177e-01 -1.017922e+01 8.649780e-02 + 7.380000e+00 1.016010e+00 -1.019303e+01 8.625065e-02 + 7.390000e+00 1.726847e+00 -1.020684e+01 8.622171e-02 + 7.400000e+00 2.442125e+00 -1.022066e+01 8.642147e-02 + 7.410000e+00 3.147204e+00 -1.023447e+01 8.677992e-02 + 7.420000e+00 3.826419e+00 -1.024828e+01 8.717238e-02 + 7.430000e+00 4.463596e+00 -1.026209e+01 8.746396e-02 + 7.440000e+00 5.042623e+00 -1.027590e+01 8.755554e-02 + 7.450000e+00 5.548071e+00 -1.028971e+01 8.741620e-02 + 7.460000e+00 5.965823e+00 -1.030353e+01 8.709278e-02 + 7.470000e+00 6.283678e+00 -1.031734e+01 8.669456e-02 + 7.480000e+00 6.491899e+00 -1.033115e+01 8.635679e-02 + 7.490000e+00 6.583679e+00 -1.034496e+01 8.619412e-02 + 7.500000e+00 6.555482e+00 -1.035877e+01 8.625962e-02 + 7.510000e+00 6.407260e+00 -1.037258e+01 8.652573e-02 + 7.520000e+00 6.142512e+00 -1.038640e+01 8.689495e-02 + 7.530000e+00 5.768195e+00 -1.040021e+01 8.723582e-02 + 7.540000e+00 5.294482e+00 -1.041402e+01 8.742941e-02 + 7.550000e+00 4.734383e+00 -1.042783e+01 8.740958e-02 + 7.560000e+00 4.103251e+00 -1.044164e+01 8.718460e-02 + 7.570000e+00 3.418196e+00 -1.045545e+01 8.683440e-02 + 7.580000e+00 2.697439e+00 -1.046927e+01 8.648406e-02 + 7.590000e+00 1.959645e+00 -1.048308e+01 8.626112e-02 + 7.600000e+00 1.223256e+00 -1.049689e+01 8.625008e-02 + 7.610000e+00 5.058789e-01 -1.051070e+01 8.646118e-02 + 7.620000e+00 -1.762705e-01 -1.052451e+01 8.682625e-02 + 7.630000e+00 -8.088206e-01 -1.053832e+01 8.722328e-02 + 7.640000e+00 -1.379593e+00 -1.055214e+01 8.751959e-02 + 7.650000e+00 -1.878834e+00 -1.056595e+01 8.761687e-02 + 7.660000e+00 -2.299321e+00 -1.057976e+01 8.748327e-02 + 7.670000e+00 -2.636371e+00 -1.059357e+01 8.716352e-02 + 7.680000e+00 -2.887729e+00 -1.060738e+01 8.676455e-02 + 7.690000e+00 -3.053399e+00 -1.062120e+01 8.642026e-02 + 7.700000e+00 -3.135390e+00 -1.063501e+01 8.624582e-02 + 7.710000e+00 -3.137448e+00 -1.064882e+01 8.629701e-02 + 7.720000e+00 -3.064754e+00 -1.066263e+01 8.655023e-02 + 7.730000e+00 -2.923640e+00 -1.067644e+01 8.691194e-02 + 7.740000e+00 -2.721321e+00 -1.069025e+01 8.725297e-02 + 7.750000e+00 -2.465665e+00 -1.070407e+01 8.745415e-02 + 7.760000e+00 -2.165005e+00 -1.071788e+01 8.744637e-02 + 7.770000e+00 -1.827993e+00 -1.073169e+01 8.723295e-02 + 7.780000e+00 -1.463495e+00 -1.074550e+01 8.688815e-02 + 7.790000e+00 -1.080518e+00 -1.075931e+01 8.653246e-02 + 7.800000e+00 -6.881554e-01 -1.077312e+01 8.629153e-02 + 7.810000e+00 -2.955460e-01 -1.078694e+01 8.625170e-02 + 7.820000e+00 8.818105e-02 -1.080075e+01 8.642853e-02 + 7.830000e+00 4.539747e-01 -1.081456e+01 8.676105e-02 + 7.840000e+00 7.929615e-01 -1.082837e+01 8.713417e-02 + 7.850000e+00 1.096579e+00 -1.084218e+01 8.741985e-02 + 7.860000e+00 1.356747e+00 -1.085599e+01 8.752100e-02 + 7.870000e+00 1.566073e+00 -1.086981e+01 8.740354e-02 + 7.880000e+00 1.718081e+00 -1.088362e+01 8.710728e-02 + 7.890000e+00 1.807461e+00 -1.089743e+01 8.673292e-02 + 7.900000e+00 1.830310e+00 -1.091124e+01 8.640862e-02 + 7.910000e+00 1.784361e+00 -1.092505e+01 8.624595e-02 + 7.920000e+00 1.669172e+00 -1.093886e+01 8.630016e-02 + 7.930000e+00 1.486265e+00 -1.095268e+01 8.655020e-02 + 7.940000e+00 1.239192e+00 -1.096649e+01 8.690681e-02 + 7.950000e+00 9.335295e-01 -1.098030e+01 8.724518e-02 + 7.960000e+00 5.767748e-01 -1.099411e+01 8.744885e-02 + 7.970000e+00 1.781685e-01 -1.100792e+01 8.744896e-02 + 7.980000e+00 -2.515741e-01 -1.102173e+01 8.724661e-02 + 7.990000e+00 -7.006017e-01 -1.103555e+01 8.691219e-02 + 8.000000e+00 -1.156323e+00 -1.104936e+01 8.656200e-02 + 8.010000e+00 -1.605844e+00 -1.106317e+01 8.631875e-02 + 8.020000e+00 -2.036420e+00 -1.107698e+01 8.626827e-02 + 8.030000e+00 -2.435906e+00 -1.109079e+01 8.642838e-02 + 8.040000e+00 -2.793178e+00 -1.110460e+01 8.674233e-02 + 8.050000e+00 -3.098512e+00 -1.111842e+01 8.709977e-02 + 8.060000e+00 -3.343890e+00 -1.113223e+01 8.737617e-02 + 8.070000e+00 -3.523241e+00 -1.114604e+01 8.747575e-02 + 8.080000e+00 -3.632589e+00 -1.115985e+01 8.736322e-02 + 8.090000e+00 -3.670114e+00 -1.117366e+01 8.707518e-02 + 8.100000e+00 -3.636133e+00 -1.118747e+01 8.670830e-02 + 8.110000e+00 -3.532999e+00 -1.120129e+01 8.638727e-02 + 8.120000e+00 -3.364936e+00 -1.121510e+01 8.622217e-02 + 8.130000e+00 -3.137818e+00 -1.122891e+01 8.626941e-02 + 8.140000e+00 -2.858915e+00 -1.124272e+01 8.651148e-02 + 8.150000e+00 -2.536611e+00 -1.125653e+01 8.686382e-02 + 8.160000e+00 -2.180124e+00 -1.127034e+01 8.720573e-02 + 8.170000e+00 -1.799223e+00 -1.128416e+01 8.742290e-02 + 8.180000e+00 -1.403965e+00 -1.129797e+01 8.744584e-02 + 8.190000e+00 -1.004458e+00 -1.131178e+01 8.727231e-02 + 8.200000e+00 -6.106442e-01 -1.132559e+01 8.696732e-02 + 8.210000e+00 -2.321136e-01 -1.133940e+01 8.664116e-02 + 8.220000e+00 1.220572e-01 -1.135322e+01 8.641148e-02 + 8.230000e+00 4.434491e-01 -1.136703e+01 8.636156e-02 + 8.240000e+00 7.244291e-01 -1.138084e+01 8.650989e-02 + 8.250000e+00 9.582697e-01 -1.139465e+01 8.680331e-02 + 8.260000e+00 1.139265e+00 -1.140846e+01 8.713658e-02 + 8.270000e+00 1.262844e+00 -1.142227e+01 8.739024e-02 + 8.280000e+00 1.325686e+00 -1.143609e+01 8.747210e-02 + 8.290000e+00 1.325830e+00 -1.144990e+01 8.734839e-02 + 8.300000e+00 1.262779e+00 -1.146371e+01 8.705530e-02 + 8.310000e+00 1.137587e+00 -1.147752e+01 8.668776e-02 + 8.320000e+00 9.529220e-01 -1.149133e+01 8.636844e-02 + 8.330000e+00 7.130975e-01 -1.150514e+01 8.620594e-02 + 8.340000e+00 4.240556e-01 -1.151896e+01 8.625642e-02 + 8.350000e+00 9.329779e-02 -1.153277e+01 8.650321e-02 + 8.360000e+00 -2.702450e-01 -1.154658e+01 8.686301e-02 + 8.370000e+00 -6.564063e-01 -1.156039e+01 8.721593e-02 + 8.380000e+00 -1.054043e+00 -1.157420e+01 8.744716e-02 + 8.390000e+00 -1.451351e+00 -1.158801e+01 8.748512e-02 + 8.400000e+00 -1.836238e+00 -1.160183e+01 8.732405e-02 + 8.410000e+00 -2.196723e+00 -1.161564e+01 8.702498e-02 + 8.420000e+00 -2.521366e+00 -1.162945e+01 8.669490e-02 + 8.430000e+00 -2.799690e+00 -1.164326e+01 8.645018e-02 + 8.440000e+00 -3.022590e+00 -1.165707e+01 8.637573e-02 + 8.450000e+00 -3.182695e+00 -1.167088e+01 8.649456e-02 + 8.460000e+00 -3.274671e+00 -1.168470e+01 8.675976e-02 + 8.470000e+00 -3.295447e+00 -1.169851e+01 8.707235e-02 + 8.480000e+00 -3.244348e+00 -1.171232e+01 8.731743e-02 + 8.490000e+00 -3.123134e+00 -1.172613e+01 8.740456e-02 + 8.500000e+00 -2.935929e+00 -1.173994e+01 8.729860e-02 + 8.510000e+00 -2.689061e+00 -1.175375e+01 8.703170e-02 + 8.520000e+00 -2.390808e+00 -1.176757e+01 8.669304e-02 + 8.530000e+00 -2.051063e+00 -1.178138e+01 8.639925e-02 + 8.540000e+00 -1.680950e+00 -1.179519e+01 8.625415e-02 + 8.550000e+00 -1.292393e+00 -1.180900e+01 8.631147e-02 + 8.560000e+00 -8.976655e-01 -1.182281e+01 8.655493e-02 + 8.570000e+00 -5.089507e-01 -1.183662e+01 8.690379e-02 + 8.580000e+00 -1.379157e-01 -1.185044e+01 8.724170e-02 + 8.590000e+00 2.046711e-01 -1.186425e+01 8.745698e-02 + 8.600000e+00 5.092724e-01 -1.187806e+01 8.747997e-02 + 8.610000e+00 7.678529e-01 -1.189187e+01 8.730537e-02 + 8.620000e+00 9.740860e-01 -1.190568e+01 8.699360e-02 + 8.630000e+00 1.123495e+00 -1.191949e+01 8.665084e-02 + 8.640000e+00 1.213531e+00 -1.193331e+01 8.639336e-02 + 8.650000e+00 1.243602e+00 -1.194712e+01 8.630718e-02 + 8.660000e+00 1.215045e+00 -1.196093e+01 8.641768e-02 + 8.670000e+00 1.131068e+00 -1.197474e+01 8.668092e-02 + 8.680000e+00 9.966652e-01 -1.198855e+01 8.700042e-02 + 8.690000e+00 8.184972e-01 -1.200236e+01 8.726226e-02 + 8.700000e+00 6.047687e-01 -1.201618e+01 8.737496e-02 + 8.710000e+00 3.650812e-01 -1.202999e+01 8.730014e-02 + 8.720000e+00 1.102728e-01 -1.204380e+01 8.706510e-02 + 8.730000e+00 -1.477617e-01 -1.205761e+01 8.675349e-02 + 8.740000e+00 -3.962768e-01 -1.207142e+01 8.647706e-02 + 8.750000e+00 -6.219127e-01 -1.208524e+01 8.633674e-02 + 8.760000e+00 -8.109697e-01 -1.209905e+01 8.638627e-02 + 8.770000e+00 -9.497260e-01 -1.211286e+01 8.661224e-02 + 8.780000e+00 -1.024799e+00 -1.212667e+01 8.693873e-02 + 8.790000e+00 -1.023552e+00 -1.214048e+01 8.725461e-02 + 8.800000e+00 -9.345354e-01 -1.215429e+01 8.745244e-02 + 8.810000e+00 -7.479563e-01 -1.216811e+01 8.746492e-02 + 8.820000e+00 -4.561570e-01 -1.218192e+01 8.728703e-02 + 8.830000e+00 -5.408176e-02 -1.219573e+01 8.697780e-02 + 8.840000e+00 4.602920e-01 -1.220954e+01 8.664106e-02 + 8.850000e+00 1.085586e+00 -1.222335e+01 8.639072e-02 + 8.860000e+00 1.816743e+00 -1.223716e+01 8.631117e-02 + 8.870000e+00 2.644869e+00 -1.225098e+01 8.642725e-02 + 8.880000e+00 3.557207e+00 -1.226479e+01 8.669538e-02 + 8.890000e+00 4.537280e+00 -1.227860e+01 8.701972e-02 + 8.900000e+00 5.565186e+00 -1.229241e+01 8.728657e-02 + 8.910000e+00 6.618072e+00 -1.230622e+01 8.740369e-02 + 8.920000e+00 7.670763e+00 -1.232003e+01 8.733101e-02 + 8.930000e+00 8.696530e+00 -1.233385e+01 8.709356e-02 + 8.940000e+00 9.667974e+00 -1.234766e+01 8.677302e-02 + 8.950000e+00 1.055799e+01 -1.236147e+01 8.648046e-02 + 8.960000e+00 1.134075e+01 -1.237528e+01 8.631808e-02 + 8.970000e+00 1.199270e+01 -1.238909e+01 8.634303e-02 + 8.980000e+00 1.249350e+01 -1.240290e+01 8.654665e-02 + 8.990000e+00 1.282679e+01 -1.241672e+01 8.685784e-02 + 9.000000e+00 1.298090e+01 -1.243053e+01 8.716892e-02 + 9.010000e+00 1.294932e+01 -1.244434e+01 8.737363e-02 + 9.020000e+00 1.273097e+01 -1.245815e+01 8.740326e-02 + 9.030000e+00 1.233022e+01 -1.247196e+01 8.724920e-02 + 9.040000e+00 1.175672e+01 -1.248577e+01 8.696564e-02 + 9.050000e+00 1.102496e+01 -1.249959e+01 8.665154e-02 + 9.060000e+00 1.015368e+01 -1.251340e+01 8.641715e-02 + 9.070000e+00 9.165054e+00 -1.252721e+01 8.634552e-02 + 9.080000e+00 8.083764e+00 -1.254102e+01 8.646260e-02 + 9.090000e+00 6.936027e+00 -1.255483e+01 8.672781e-02 + 9.100000e+00 5.748546e+00 -1.256864e+01 8.704891e-02 + 9.110000e+00 4.547501e+00 -1.258246e+01 8.731494e-02 + 9.120000e+00 3.357612e+00 -1.259627e+01 8.743453e-02 + 9.130000e+00 2.201315e+00 -1.261008e+01 8.736635e-02 + 9.140000e+00 1.098084e+00 -1.262389e+01 8.713241e-02 + 9.150000e+00 6.393724e-02 -1.263770e+01 8.681078e-02 + 9.160000e+00 -8.888679e-01 -1.265151e+01 8.650957e-02 + 9.170000e+00 -1.751948e+00 -1.266533e+01 8.633011e-02 + 9.180000e+00 -2.520712e+00 -1.267914e+01 8.633136e-02 + 9.190000e+00 -3.194120e+00 -1.269295e+01 8.650901e-02 + 9.200000e+00 -3.774287e+00 -1.270676e+01 8.679761e-02 + 9.210000e+00 -4.265986e+00 -1.272057e+01 8.709484e-02 + 9.220000e+00 -4.676078e+00 -1.273438e+01 8.729798e-02 + 9.230000e+00 -5.012897e+00 -1.274820e+01 8.733918e-02 + 9.240000e+00 -5.285654e+00 -1.276201e+01 8.720785e-02 + 9.250000e+00 -5.503858e+00 -1.277582e+01 8.695382e-02 + 9.260000e+00 -5.676820e+00 -1.278963e+01 8.667035e-02 + 9.270000e+00 -5.813222e+00 -1.280344e+01 8.646195e-02 + 9.280000e+00 -5.920798e+00 -1.281725e+01 8.640730e-02 + 9.290000e+00 -6.006108e+00 -1.283107e+01 8.653038e-02 + 9.300000e+00 -6.074419e+00 -1.284488e+01 8.679133e-02 + 9.310000e+00 -6.129667e+00 -1.285869e+01 8.710062e-02 + 9.320000e+00 -6.174503e+00 -1.287250e+01 8.735094e-02 + 9.330000e+00 -6.210392e+00 -1.288631e+01 8.745438e-02 + 9.340000e+00 -6.237755e+00 -1.290013e+01 8.737209e-02 + 9.350000e+00 -6.256124e+00 -1.291394e+01 8.712738e-02 + 9.360000e+00 -6.264304e+00 -1.292775e+01 8.679863e-02 + 9.370000e+00 -6.260523e+00 -1.294156e+01 8.649375e-02 + 9.380000e+00 -6.242561e+00 -1.295537e+01 8.631371e-02 + 9.390000e+00 -6.207852e+00 -1.296918e+01 8.631735e-02 + 9.400000e+00 -6.153565e+00 -1.298300e+01 8.650032e-02 + 9.410000e+00 -6.076659e+00 -1.299681e+01 8.679699e-02 + 9.420000e+00 -5.973936e+00 -1.301062e+01 8.710424e-02 + 9.430000e+00 -5.842086e+00 -1.302443e+01 8.731774e-02 + 9.440000e+00 -5.677740e+00 -1.303824e+01 8.736720e-02 + 9.450000e+00 -5.477554e+00 -1.305205e+01 8.723917e-02 + 9.460000e+00 -5.238312e+00 -1.306587e+01 8.698093e-02 + 9.470000e+00 -4.957070e+00 -1.307968e+01 8.668442e-02 + 9.480000e+00 -4.631329e+00 -1.309349e+01 8.645490e-02 + 9.490000e+00 -4.259246e+00 -1.310730e+01 8.637421e-02 + 9.500000e+00 -3.839860e+00 -1.312111e+01 8.647142e-02 + 9.510000e+00 -3.373332e+00 -1.313492e+01 8.671246e-02 + 9.520000e+00 -2.861170e+00 -1.314874e+01 8.701277e-02 + 9.530000e+00 -2.306436e+00 -1.316255e+01 8.726783e-02 + 9.540000e+00 -1.713899e+00 -1.317636e+01 8.738967e-02 + 9.550000e+00 -1.090124e+00 -1.319017e+01 8.733651e-02 + 9.560000e+00 -4.434820e-01 -1.320398e+01 8.712656e-02 + 9.570000e+00 2.159325e-01 -1.321779e+01 8.683195e-02 + 9.580000e+00 8.764886e-01 -1.323161e+01 8.655460e-02 + 9.590000e+00 1.525300e+00 -1.324542e+01 8.639119e-02 + 9.600000e+00 2.148600e+00 -1.325923e+01 8.639887e-02 + 9.610000e+00 2.732200e+00 -1.327304e+01 8.657453e-02 + 9.620000e+00 3.262001e+00 -1.328685e+01 8.685595e-02 + 9.630000e+00 3.724542e+00 -1.330066e+01 8.714429e-02 + 9.640000e+00 4.107565e+00 -1.331448e+01 8.733899e-02 + 9.650000e+00 4.400543e+00 -1.332829e+01 8.737213e-02 + 9.660000e+00 4.595165e+00 -1.334210e+01 8.723101e-02 + 9.670000e+00 4.685740e+00 -1.335591e+01 8.696239e-02 + 9.680000e+00 4.669497e+00 -1.336972e+01 8.665720e-02 + 9.690000e+00 4.546759e+00 -1.338353e+01 8.642001e-02 + 9.700000e+00 4.320990e+00 -1.339735e+01 8.633296e-02 + 9.710000e+00 3.998700e+00 -1.341116e+01 8.642649e-02 + 9.720000e+00 3.589214e+00 -1.342497e+01 8.666849e-02 + 9.730000e+00 3.104320e+00 -1.343878e+01 8.697614e-02 + 9.740000e+00 2.557813e+00 -1.345259e+01 8.724548e-02 + 9.750000e+00 1.964951e+00 -1.346640e+01 8.738734e-02 + 9.760000e+00 1.341861e+00 -1.348022e+01 8.735698e-02 + 9.770000e+00 7.049174e-01 -1.349403e+01 8.716823e-02 + 9.780000e+00 7.012748e-02 -1.350784e+01 8.688841e-02 + 9.790000e+00 -5.474493e-01 -1.352165e+01 8.661543e-02 + 9.800000e+00 -1.134219e+00 -1.353546e+01 8.644403e-02 + 9.810000e+00 -1.678491e+00 -1.354927e+01 8.643230e-02 + 9.820000e+00 -2.170806e+00 -1.356309e+01 8.658090e-02 + 9.830000e+00 -2.604164e+00 -1.357690e+01 8.683326e-02 + 9.840000e+00 -2.974131e+00 -1.359071e+01 8.709657e-02 + 9.850000e+00 -3.278823e+00 -1.360452e+01 8.727520e-02 + 9.860000e+00 -3.518798e+00 -1.361833e+01 8.730399e-02 + 9.870000e+00 -3.696842e+00 -1.363215e+01 8.717051e-02 + 9.880000e+00 -3.817675e+00 -1.364596e+01 8.691943e-02 + 9.890000e+00 -3.887602e+00 -1.365977e+01 8.663786e-02 + 9.900000e+00 -3.914115e+00 -1.367358e+01 8.642579e-02 + 9.910000e+00 -3.905480e+00 -1.368739e+01 8.636104e-02 + 9.920000e+00 -3.870320e+00 -1.370120e+01 8.647090e-02 + 9.930000e+00 -3.817203e+00 -1.371502e+01 8.672179e-02 + 9.940000e+00 -3.754274e+00 -1.372883e+01 8.703094e-02 + 9.950000e+00 -3.688918e+00 -1.374264e+01 8.729552e-02 + 9.960000e+00 -3.627475e+00 -1.375645e+01 8.742791e-02 + 9.970000e+00 -3.575013e+00 -1.377026e+01 8.738488e-02 + 9.980000e+00 -3.535158e+00 -1.378407e+01 8.718164e-02 + 9.990000e+00 -3.509989e+00 -1.379789e+01 8.688691e-02 + 1.000000e+01 -3.499993e+00 -1.381170e+01 8.660026e-02 + 1.001000e+01 -3.504072e+00 -1.382551e+01 8.641841e-02 + 1.002000e+01 -3.519616e+00 -1.383932e+01 8.640157e-02 + 1.003000e+01 -3.542627e+00 -1.385313e+01 8.655216e-02 + 1.004000e+01 -3.567881e+00 -1.386694e+01 8.681427e-02 + 1.005000e+01 -3.589155e+00 -1.388076e+01 8.709419e-02 + 1.006000e+01 -3.599469e+00 -1.389457e+01 8.729364e-02 + 1.007000e+01 -3.591385e+00 -1.390838e+01 8.734331e-02 + 1.008000e+01 -3.557318e+00 -1.392219e+01 8.722578e-02 + 1.009000e+01 -3.489873e+00 -1.393600e+01 8.698092e-02 + 1.010000e+01 -3.382189e+00 -1.394981e+01 8.669241e-02 + 1.011000e+01 -3.228289e+00 -1.396363e+01 8.645935e-02 + 1.012000e+01 -3.023408e+00 -1.397744e+01 8.636177e-02 + 1.013000e+01 -2.764303e+00 -1.399125e+01 8.643218e-02 + 1.014000e+01 -2.449523e+00 -1.400506e+01 8.664393e-02 + 1.015000e+01 -2.079619e+00 -1.401887e+01 8.692128e-02 + 1.016000e+01 -1.657294e+00 -1.403268e+01 8.716681e-02 + 1.017000e+01 -1.187470e+00 -1.404650e+01 8.729563e-02 + 1.018000e+01 -6.772696e-01 -1.406031e+01 8.726425e-02 + 1.019000e+01 -1.358937e-01 -1.407412e+01 8.708504e-02 + 1.020000e+01 4.255869e-01 -1.408793e+01 8.682200e-02 + 1.021000e+01 9.945439e-01 -1.410174e+01 8.656929e-02 + 1.022000e+01 1.557189e+00 -1.411555e+01 8.641868e-02 + 1.023000e+01 2.099047e+00 -1.412937e+01 8.642691e-02 + 1.024000e+01 2.605490e+00 -1.414318e+01 8.659488e-02 + 1.025000e+01 3.062306e+00 -1.415699e+01 8.686709e-02 + 1.026000e+01 3.456283e+00 -1.417080e+01 8.715138e-02 + 1.027000e+01 3.775775e+00 -1.418461e+01 8.735130e-02 + 1.028000e+01 4.011229e+00 -1.419842e+01 8.739897e-02 + 1.029000e+01 4.155640e+00 -1.421224e+01 8.727770e-02 + 1.030000e+01 4.204914e+00 -1.422605e+01 8.702751e-02 + 1.031000e+01 4.158113e+00 -1.423986e+01 8.673214e-02 + 1.032000e+01 4.017568e+00 -1.425367e+01 8.649118e-02 + 1.033000e+01 3.788855e+00 -1.426748e+01 8.638585e-02 + 1.034000e+01 3.480622e+00 -1.428129e+01 8.645047e-02 + 1.035000e+01 3.104278e+00 -1.429511e+01 8.666030e-02 + 1.036000e+01 2.673553e+00 -1.430892e+01 8.694084e-02 + 1.037000e+01 2.203951e+00 -1.432273e+01 8.719458e-02 + 1.038000e+01 1.712118e+00 -1.433654e+01 8.733498e-02 + 1.039000e+01 1.215153e+00 -1.435035e+01 8.731546e-02 + 1.040000e+01 7.298949e-01 -1.436417e+01 8.714454e-02 + 1.041000e+01 2.722260e-01 -1.437798e+01 8.688261e-02 + 1.042000e+01 -1.435834e-01 -1.439179e+01 8.662157e-02 + 1.043000e+01 -5.054535e-01 -1.440560e+01 8.645317e-02 + 1.044000e+01 -8.039674e-01 -1.441941e+01 8.643676e-02 + 1.045000e+01 -1.032717e+00 -1.443322e+01 8.657798e-02 + 1.046000e+01 -1.188507e+00 -1.444704e+01 8.682686e-02 + 1.047000e+01 -1.271401e+00 -1.446085e+01 8.709613e-02 + 1.048000e+01 -1.284622e+00 -1.447466e+01 8.729218e-02 + 1.049000e+01 -1.234299e+00 -1.448847e+01 8.734732e-02 + 1.050000e+01 -1.129080e+00 -1.450228e+01 8.724243e-02 + 1.051000e+01 -9.796357e-01 -1.451609e+01 8.701305e-02 + 1.052000e+01 -7.980667e-01 -1.452991e+01 8.673757e-02 + 1.053000e+01 -5.972583e-01 -1.454372e+01 8.651054e-02 + 1.054000e+01 -3.902032e-01 -1.455753e+01 8.640985e-02 + 1.055000e+01 -1.893300e-01 -1.457134e+01 8.646890e-02 + 1.056000e+01 -5.868969e-03 -1.458515e+01 8.666457e-02 + 1.057000e+01 1.507162e-01 -1.459896e+01 8.692576e-02 + 1.058000e+01 2.732033e-01 -1.461278e+01 8.715906e-02 + 1.059000e+01 3.569721e-01 -1.462659e+01 8.728155e-02 + 1.060000e+01 4.002350e-01 -1.464040e+01 8.724917e-02 + 1.061000e+01 4.041267e-01 -1.465421e+01 8.707157e-02 + 1.062000e+01 3.726514e-01 -1.466802e+01 8.680913e-02 + 1.063000e+01 3.124882e-01 -1.468183e+01 8.655297e-02 + 1.064000e+01 2.326669e-01 -1.469565e+01 8.639387e-02 + 1.065000e+01 1.441274e-01 -1.470946e+01 8.639026e-02 + 1.066000e+01 5.918253e-02 -1.472327e+01 8.654709e-02 + 1.067000e+01 -9.089408e-03 -1.473708e+01 8.681372e-02 + 1.068000e+01 -4.749838e-02 -1.475089e+01 8.710195e-02 + 1.069000e+01 -4.341128e-02 -1.476470e+01 8.731675e-02 + 1.070000e+01 1.459279e-02 -1.477852e+01 8.738842e-02 + 1.071000e+01 1.361100e-01 -1.479233e+01 8.729542e-02 + 1.072000e+01 3.283693e-01 -1.480614e+01 8.707112e-02 + 1.073000e+01 5.957845e-01 -1.481995e+01 8.679261e-02 + 1.074000e+01 9.396214e-01 -1.483376e+01 8.655478e-02 + 1.075000e+01 1.357797e+00 -1.484757e+01 8.643778e-02 + 1.076000e+01 1.844820e+00 -1.486139e+01 8.647898e-02 + 1.077000e+01 2.391879e+00 -1.487520e+01 8.665995e-02 + 1.078000e+01 2.987079e+00 -1.488901e+01 8.691370e-02 + 1.079000e+01 3.615810e+00 -1.490282e+01 8.714917e-02 + 1.080000e+01 4.261249e+00 -1.491663e+01 8.728329e-02 + 1.081000e+01 4.904966e+00 -1.493044e+01 8.726934e-02 + 1.082000e+01 5.527609e+00 -1.494426e+01 8.711234e-02 + 1.083000e+01 6.109646e+00 -1.495807e+01 8.686715e-02 + 1.084000e+01 6.632134e+00 -1.497188e+01 8.661987e-02 + 1.085000e+01 7.077476e+00 -1.498569e+01 8.645806e-02 + 1.086000e+01 7.430133e+00 -1.499950e+01 8.643983e-02 + 1.087000e+01 7.677269e+00 -1.501331e+01 8.657274e-02 + 1.088000e+01 7.809287e+00 -1.502713e+01 8.681111e-02 + 1.089000e+01 7.820243e+00 -1.504094e+01 8.707253e-02 + 1.090000e+01 7.708102e+00 -1.505475e+01 8.726713e-02 + 1.091000e+01 7.474844e+00 -1.506856e+01 8.732861e-02 + 1.092000e+01 7.126393e+00 -1.508237e+01 8.723654e-02 + 1.093000e+01 6.672383e+00 -1.509619e+01 8.702312e-02 + 1.094000e+01 6.125769e+00 -1.511000e+01 8.676251e-02 + 1.095000e+01 5.502291e+00 -1.512381e+01 8.654572e-02 + 1.096000e+01 4.819826e+00 -1.513762e+01 8.644903e-02 + 1.097000e+01 4.097651e+00 -1.515143e+01 8.650673e-02 + 1.098000e+01 3.355657e+00 -1.516524e+01 8.669867e-02 + 1.099000e+01 2.613538e+00 -1.517906e+01 8.695747e-02 + 1.100000e+01 1.890007e+00 -1.519287e+01 8.719265e-02 + 1.101000e+01 1.202072e+00 -1.520668e+01 8.732212e-02 + 1.102000e+01 5.644048e-01 -1.522049e+01 8.730016e-02 + 1.103000e+01 -1.117578e-02 -1.523430e+01 8.713260e-02 + 1.104000e+01 -5.160635e-01 -1.524811e+01 8.687511e-02 + 1.105000e+01 -9.450700e-01 -1.526193e+01 8.661474e-02 + 1.106000e+01 -1.296459e+00 -1.527574e+01 8.644044e-02 + 1.107000e+01 -1.571811e+00 -1.528955e+01 8.641206e-02 + 1.108000e+01 -1.775734e+00 -1.530336e+01 8.653895e-02 + 1.109000e+01 -1.915430e+00 -1.531717e+01 8.677666e-02 + 1.110000e+01 -2.000150e+00 -1.533098e+01 8.704302e-02 + 1.111000e+01 -2.040561e+00 -1.534480e+01 8.724705e-02 + 1.112000e+01 -2.048072e+00 -1.535861e+01 8.732011e-02 + 1.113000e+01 -2.034146e+00 -1.537242e+01 8.723861e-02 + 1.114000e+01 -2.009629e+00 -1.538623e+01 8.703151e-02 + 1.115000e+01 -1.984157e+00 -1.540004e+01 8.677052e-02 + 1.116000e+01 -1.965642e+00 -1.541385e+01 8.654577e-02 + 1.117000e+01 -1.959882e+00 -1.542767e+01 8.643477e-02 + 1.118000e+01 -1.970309e+00 -1.544148e+01 8.647500e-02 + 1.119000e+01 -1.997881e+00 -1.545529e+01 8.665064e-02 + 1.120000e+01 -2.041129e+00 -1.546910e+01 8.689860e-02 + 1.121000e+01 -2.096343e+00 -1.548291e+01 8.713137e-02 + 1.122000e+01 -2.157899e+00 -1.549672e+01 8.726780e-02 + 1.123000e+01 -2.218678e+00 -1.551054e+01 8.726082e-02 + 1.124000e+01 -2.270590e+00 -1.552435e+01 8.711302e-02 + 1.125000e+01 -2.305135e+00 -1.553816e+01 8.687573e-02 + 1.126000e+01 -2.313987e+00 -1.555197e+01 8.663170e-02 + 1.127000e+01 -2.289573e+00 -1.556578e+01 8.646671e-02 + 1.128000e+01 -2.225594e+00 -1.557959e+01 8.643942e-02 + 1.129000e+01 -2.117479e+00 -1.559341e+01 8.656027e-02 + 1.130000e+01 -1.962742e+00 -1.560722e+01 8.678773e-02 + 1.131000e+01 -1.761217e+00 -1.562103e+01 8.704332e-02 + 1.132000e+01 -1.515167e+00 -1.563484e+01 8.723945e-02 + 1.133000e+01 -1.229262e+00 -1.564865e+01 8.730965e-02 + 1.134000e+01 -9.104208e-01 -1.566246e+01 8.723088e-02 + 1.135000e+01 -5.675403e-01 -1.567628e+01 8.703110e-02 + 1.136000e+01 -2.111127e-01 -1.569009e+01 8.677987e-02 + 1.137000e+01 1.472366e-01 -1.570390e+01 8.656488e-02 + 1.138000e+01 4.952728e-01 -1.571771e+01 8.646148e-02 + 1.139000e+01 8.207056e-01 -1.573152e+01 8.650596e-02 + 1.140000e+01 1.111748e+00 -1.574533e+01 8.668240e-02 + 1.141000e+01 1.357647e+00 -1.575915e+01 8.692850e-02 + 1.142000e+01 1.549171e+00 -1.577296e+01 8.715797e-02 + 1.143000e+01 1.679013e+00 -1.578677e+01 8.729070e-02 + 1.144000e+01 1.742111e+00 -1.580058e+01 8.728018e-02 + 1.145000e+01 1.735857e+00 -1.581439e+01 8.712905e-02 + 1.146000e+01 1.660190e+00 -1.582820e+01 8.688833e-02 + 1.147000e+01 1.517580e+00 -1.584202e+01 8.664048e-02 + 1.148000e+01 1.312886e+00 -1.585583e+01 8.647135e-02 + 1.149000e+01 1.053117e+00 -1.586964e+01 8.644017e-02 + 1.150000e+01 7.471025e-01 -1.588345e+01 8.655827e-02 + 1.151000e+01 4.050765e-01 -1.589726e+01 8.678499e-02 + 1.152000e+01 3.822206e-02 -1.591108e+01 8.704223e-02 + 1.153000e+01 -3.418258e-01 -1.592489e+01 8.724198e-02 + 1.154000e+01 -7.234805e-01 -1.593870e+01 8.731646e-02 + 1.155000e+01 -1.095689e+00 -1.595251e+01 8.724078e-02 + 1.156000e+01 -1.448379e+00 -1.596632e+01 8.704099e-02 + 1.157000e+01 -1.772845e+00 -1.598013e+01 8.678539e-02 + 1.158000e+01 -2.062066e+00 -1.599395e+01 8.656163e-02 + 1.159000e+01 -2.310919e+00 -1.600776e+01 8.644656e-02 + 1.160000e+01 -2.516314e+00 -1.602157e+01 8.647927e-02 + 1.161000e+01 -2.677205e+00 -1.603538e+01 8.664723e-02 + 1.162000e+01 -2.794523e+00 -1.604919e+01 8.689108e-02 + 1.163000e+01 -2.870991e+00 -1.606300e+01 8.712607e-02 + 1.164000e+01 -2.910869e+00 -1.607682e+01 8.727177e-02 + 1.165000e+01 -2.919626e+00 -1.609063e+01 8.727937e-02 + 1.166000e+01 -2.903548e+00 -1.610444e+01 8.714783e-02 + 1.167000e+01 -2.869334e+00 -1.611825e+01 8.692387e-02 + 1.168000e+01 -2.823663e+00 -1.613206e+01 8.668616e-02 + 1.169000e+01 -2.772784e+00 -1.614587e+01 8.651824e-02 + 1.170000e+01 -2.722144e+00 -1.615969e+01 8.647921e-02 + 1.171000e+01 -2.676059e+00 -1.617350e+01 8.658254e-02 + 1.172000e+01 -2.637473e+00 -1.618731e+01 8.679125e-02 + 1.173000e+01 -2.607795e+00 -1.620112e+01 8.703142e-02 + 1.174000e+01 -2.586832e+00 -1.621493e+01 8.721852e-02 + 1.175000e+01 -2.572831e+00 -1.622874e+01 8.728674e-02 + 1.176000e+01 -2.562607e+00 -1.624256e+01 8.721136e-02 + 1.177000e+01 -2.551775e+00 -1.625637e+01 8.701698e-02 + 1.178000e+01 -2.535058e+00 -1.627018e+01 8.676945e-02 + 1.179000e+01 -2.506656e+00 -1.628399e+01 8.655367e-02 + 1.180000e+01 -2.460660e+00 -1.629780e+01 8.644429e-02 + 1.181000e+01 -2.391487e+00 -1.631161e+01 8.647926e-02 + 1.182000e+01 -2.294308e+00 -1.632543e+01 8.664617e-02 + 1.183000e+01 -2.165445e+00 -1.633924e+01 8.688672e-02 + 1.184000e+01 -2.002710e+00 -1.635305e+01 8.711760e-02 + 1.185000e+01 -1.805678e+00 -1.636686e+01 8.725964e-02 + 1.186000e+01 -1.575853e+00 -1.638067e+01 8.726476e-02 + 1.187000e+01 -1.316743e+00 -1.639448e+01 8.713197e-02 + 1.188000e+01 -1.033807e+00 -1.640830e+01 8.690762e-02 + 1.189000e+01 -7.343041e-01 -1.642211e+01 8.666991e-02 + 1.190000e+01 -4.270274e-01 -1.643592e+01 8.650215e-02 + 1.191000e+01 -1.219464e-01 -1.644973e+01 8.646365e-02 + 1.192000e+01 1.702256e-01 -1.646354e+01 8.656845e-02 + 1.193000e+01 4.385179e-01 -1.647735e+01 8.678025e-02 + 1.194000e+01 6.722155e-01 -1.649117e+01 8.702549e-02 + 1.195000e+01 8.613718e-01 -1.650498e+01 8.721939e-02 + 1.196000e+01 9.972917e-01 -1.651879e+01 8.729525e-02 + 1.197000e+01 1.072960e+00 -1.653260e+01 8.722691e-02 + 1.198000e+01 1.083388e+00 -1.654641e+01 8.703750e-02 + 1.199000e+01 1.025863e+00 -1.656022e+01 8.679182e-02 + 1.200000e+01 9.000883e-01 -1.657404e+01 8.657464e-02 + 1.201000e+01 7.081926e-01 -1.658785e+01 8.646157e-02 + 1.202000e+01 4.546330e-01 -1.660166e+01 8.649249e-02 + 1.203000e+01 1.459752e-01 -1.661547e+01 8.665720e-02 + 1.204000e+01 -2.094234e-01 -1.662928e+01 8.689918e-02 + 1.205000e+01 -6.018116e-01 -1.664310e+01 8.713577e-02 + 1.206000e+01 -1.020500e+00 -1.665691e+01 8.728698e-02 + 1.207000e+01 -1.454349e+00 -1.667072e+01 8.730257e-02 + 1.208000e+01 -1.892254e+00 -1.668453e+01 8.717861e-02 + 1.209000e+01 -2.323611e+00 -1.669834e+01 8.695856e-02 + 1.210000e+01 -2.738726e+00 -1.671215e+01 8.671861e-02 + 1.211000e+01 -3.129152e+00 -1.672597e+01 8.654174e-02 + 1.212000e+01 -3.487930e+00 -1.673978e+01 8.648877e-02 + 1.213000e+01 -3.809734e+00 -1.675359e+01 8.657682e-02 + 1.214000e+01 -4.090900e+00 -1.676740e+01 8.677324e-02 + 1.215000e+01 -4.329355e+00 -1.678121e+01 8.700753e-02 + 1.216000e+01 -4.524443e+00 -1.679502e+01 8.719647e-02 + 1.217000e+01 -4.676680e+00 -1.680884e+01 8.727295e-02 + 1.218000e+01 -4.787434e+00 -1.682265e+01 8.720863e-02 + 1.219000e+01 -4.858581e+00 -1.683646e+01 8.702334e-02 + 1.220000e+01 -4.892147e+00 -1.685027e+01 8.677848e-02 + 1.221000e+01 -4.889964e+00 -1.686408e+01 8.655639e-02 + 1.222000e+01 -4.853374e+00 -1.687789e+01 8.643217e-02 + 1.223000e+01 -4.782995e+00 -1.689171e+01 8.644725e-02 + 1.224000e+01 -4.678572e+00 -1.690552e+01 8.659482e-02 + 1.225000e+01 -4.538928e+00 -1.691933e+01 8.682247e-02 + 1.226000e+01 -4.362009e+00 -1.693314e+01 8.705119e-02 + 1.227000e+01 -4.145042e+00 -1.694695e+01 8.720315e-02 + 1.228000e+01 -3.884773e+00 -1.696076e+01 8.722833e-02 + 1.229000e+01 -3.577793e+00 -1.697458e+01 8.712105e-02 + 1.230000e+01 -3.220920e+00 -1.698839e+01 8.692162e-02 + 1.231000e+01 -2.811608e+00 -1.700220e+01 8.670249e-02 + 1.232000e+01 -2.348369e+00 -1.701601e+01 8.654327e-02 + 1.233000e+01 -1.831168e+00 -1.702982e+01 8.650268e-02 + 1.234000e+01 -1.261761e+00 -1.704363e+01 8.659741e-02 + 1.235000e+01 -6.439623e-01 -1.705745e+01 8.679596e-02 + 1.236000e+01 1.619533e-02 -1.707126e+01 8.702998e-02 + 1.237000e+01 7.104125e-01 -1.708507e+01 8.721853e-02 + 1.238000e+01 1.428205e+00 -1.709888e+01 8.729621e-02 + 1.239000e+01 2.157113e+00 -1.711269e+01 8.723538e-02 + 1.240000e+01 2.883035e+00 -1.712650e+01 8.705554e-02 + 1.241000e+01 3.590672e+00 -1.714032e+01 8.681702e-02 + 1.242000e+01 4.264062e+00 -1.715413e+01 8.660088e-02 + 1.243000e+01 4.887185e+00 -1.716794e+01 8.648117e-02 + 1.244000e+01 5.444599e+00 -1.718175e+01 8.649889e-02 + 1.245000e+01 5.922081e+00 -1.719556e+01 8.664741e-02 + 1.246000e+01 6.307240e+00 -1.720937e+01 8.687486e-02 + 1.247000e+01 6.590063e+00 -1.722319e+01 8.710268e-02 + 1.248000e+01 6.763375e+00 -1.723700e+01 8.725305e-02 + 1.249000e+01 6.823174e+00 -1.725081e+01 8.727533e-02 + 1.250000e+01 6.768833e+00 -1.726462e+01 8.716280e-02 + 1.251000e+01 6.603155e+00 -1.727843e+01 8.695464e-02 + 1.252000e+01 6.332272e+00 -1.729224e+01 8.672268e-02 + 1.253000e+01 5.965397e+00 -1.730606e+01 8.654691e-02 + 1.254000e+01 5.514443e+00 -1.731987e+01 8.648757e-02 + 1.255000e+01 4.993524e+00 -1.733368e+01 8.656378e-02 + 1.256000e+01 4.418364e+00 -1.734749e+01 8.674682e-02 + 1.257000e+01 3.805654e+00 -1.736130e+01 8.697064e-02 + 1.258000e+01 3.172377e+00 -1.737512e+01 8.715550e-02 + 1.259000e+01 2.535149e+00 -1.738893e+01 8.723579e-02 + 1.260000e+01 1.909600e+00 -1.740274e+01 8.718240e-02 + 1.261000e+01 1.309839e+00 -1.741655e+01 8.701253e-02 + 1.262000e+01 7.480110e-01 -1.743036e+01 8.678406e-02 + 1.263000e+01 2.339870e-01 -1.744417e+01 8.657617e-02 + 1.264000e+01 -2.248141e-01 -1.745799e+01 8.646206e-02 + 1.265000e+01 -6.234624e-01 -1.747180e+01 8.648318e-02 + 1.266000e+01 -9.594159e-01 -1.748561e+01 8.663426e-02 + 1.267000e+01 -1.232294e+00 -1.749942e+01 8.686518e-02 + 1.268000e+01 -1.443546e+00 -1.751323e+01 8.709868e-02 + 1.269000e+01 -1.596039e+00 -1.752704e+01 8.725726e-02 + 1.270000e+01 -1.693595e+00 -1.754086e+01 8.728943e-02 + 1.271000e+01 -1.740512e+00 -1.755467e+01 8.718665e-02 + 1.272000e+01 -1.741106e+00 -1.756848e+01 8.698587e-02 + 1.273000e+01 -1.699295e+00 -1.758229e+01 8.675708e-02 + 1.274000e+01 -1.618267e+00 -1.759610e+01 8.657944e-02 + 1.275000e+01 -1.500248e+00 -1.760991e+01 8.651388e-02 + 1.276000e+01 -1.346380e+00 -1.762373e+01 8.658162e-02 + 1.277000e+01 -1.156738e+00 -1.763754e+01 8.675681e-02 + 1.278000e+01 -9.304549e-01 -1.765135e+01 8.697617e-02 + 1.279000e+01 -6.659689e-01 -1.766516e+01 8.716167e-02 + 1.280000e+01 -3.613674e-01 -1.767897e+01 8.724787e-02 + 1.281000e+01 -1.479615e-02 -1.769278e+01 8.720413e-02 + 1.282000e+01 3.750883e-01 -1.770660e+01 8.704486e-02 + 1.283000e+01 8.086627e-01 -1.772041e+01 8.682463e-02 + 1.284000e+01 1.284911e+00 -1.773422e+01 8.661965e-02 + 1.285000e+01 1.801066e+00 -1.774803e+01 8.650142e-02 + 1.286000e+01 2.352344e+00 -1.776184e+01 8.651145e-02 + 1.287000e+01 2.931804e+00 -1.777565e+01 8.664630e-02 + 1.288000e+01 3.530348e+00 -1.778947e+01 8.685881e-02 + 1.289000e+01 4.136866e+00 -1.780328e+01 8.707494e-02 + 1.290000e+01 4.738538e+00 -1.781709e+01 8.721979e-02 + 1.291000e+01 5.321262e+00 -1.783090e+01 8.724332e-02 + 1.292000e+01 5.870205e+00 -1.784471e+01 8.713713e-02 + 1.293000e+01 6.370443e+00 -1.785852e+01 8.693730e-02 + 1.294000e+01 6.807651e+00 -1.787234e+01 8.671240e-02 + 1.295000e+01 7.168799e+00 -1.788615e+01 8.654021e-02 + 1.296000e+01 7.442828e+00 -1.789996e+01 8.648076e-02 + 1.297000e+01 7.621238e+00 -1.791377e+01 8.655504e-02 + 1.298000e+01 7.698580e+00 -1.792758e+01 8.673754e-02 + 1.299000e+01 7.672791e+00 -1.794139e+01 8.696542e-02 + 1.300000e+01 7.545364e+00 -1.795521e+01 8.716080e-02 + 1.301000e+01 7.321336e+00 -1.796902e+01 8.725769e-02 + 1.302000e+01 7.009091e+00 -1.798283e+01 8.722421e-02 + 1.303000e+01 6.619978e+00 -1.799664e+01 8.707300e-02 + 1.304000e+01 6.167776e+00 -1.801045e+01 8.685689e-02 + 1.305000e+01 5.668028e+00 -1.802426e+01 8.665092e-02 + 1.306000e+01 5.137281e+00 -1.803808e+01 8.652655e-02 + 1.307000e+01 4.592276e+00 -1.805189e+01 8.652657e-02 + 1.308000e+01 4.049143e+00 -1.806570e+01 8.664985e-02 + 1.309000e+01 3.522635e+00 -1.807951e+01 8.685195e-02 + 1.310000e+01 3.025452e+00 -1.809332e+01 8.706123e-02 + 1.311000e+01 2.567700e+00 -1.810714e+01 8.720411e-02 + 1.312000e+01 2.156499e+00 -1.812095e+01 8.723055e-02 + 1.313000e+01 1.795783e+00 -1.813476e+01 8.713085e-02 + 1.314000e+01 1.486275e+00 -1.814857e+01 8.693898e-02 + 1.315000e+01 1.225663e+00 -1.816238e+01 8.672112e-02 + 1.316000e+01 1.008933e+00 -1.817619e+01 8.655317e-02 + 1.317000e+01 8.288618e-01 -1.819001e+01 8.649430e-02 + 1.318000e+01 6.766120e-01 -1.820382e+01 8.656584e-02 + 1.319000e+01 5.424062e-01 -1.821763e+01 8.674359e-02 + 1.320000e+01 4.162247e-01 -1.823144e+01 8.696646e-02 + 1.321000e+01 2.884859e-01 -1.824525e+01 8.715806e-02 + 1.322000e+01 1.506670e-01 -1.825906e+01 8.725317e-02 + 1.323000e+01 -4.176142e-03 -1.827288e+01 8.721970e-02 + 1.324000e+01 -1.810185e-01 -1.828669e+01 8.706934e-02 + 1.325000e+01 -3.826260e-01 -1.830050e+01 8.685354e-02 + 1.326000e+01 -6.094786e-01 -1.831431e+01 8.664622e-02 + 1.327000e+01 -8.598531e-01 -1.832812e+01 8.651835e-02 + 1.328000e+01 -1.130056e+00 -1.834193e+01 8.651319e-02 + 1.329000e+01 -1.414786e+00 -1.835575e+01 8.663091e-02 + 1.330000e+01 -1.707590e+00 -1.836956e+01 8.682878e-02 + 1.331000e+01 -2.001388e+00 -1.838337e+01 8.703661e-02 + 1.332000e+01 -2.289020e+00 -1.839718e+01 8.718159e-02 + 1.333000e+01 -2.563773e+00 -1.841099e+01 8.721341e-02 + 1.334000e+01 -2.819863e+00 -1.842480e+01 8.712116e-02 + 1.335000e+01 -3.052826e+00 -1.843862e+01 8.693697e-02 + 1.336000e+01 -3.259805e+00 -1.845243e+01 8.672516e-02 + 1.337000e+01 -3.439707e+00 -1.846624e+01 8.656022e-02 + 1.338000e+01 -3.593226e+00 -1.848005e+01 8.650086e-02 + 1.339000e+01 -3.722743e+00 -1.849386e+01 8.656903e-02 + 1.340000e+01 -3.832096e+00 -1.850767e+01 8.674195e-02 + 1.341000e+01 -3.926265e+00 -1.852149e+01 8.696027e-02 + 1.342000e+01 -4.010981e+00 -1.853530e+01 8.714905e-02 + 1.343000e+01 -4.092286e+00 -1.854911e+01 8.724376e-02 + 1.344000e+01 -4.176105e+00 -1.856292e+01 8.721219e-02 + 1.345000e+01 -4.267821e+00 -1.857673e+01 8.706518e-02 + 1.346000e+01 -4.371916e+00 -1.859054e+01 8.685304e-02 + 1.347000e+01 -4.491687e+00 -1.860436e+01 8.664868e-02 + 1.348000e+01 -4.629050e+00 -1.861817e+01 8.652270e-02 + 1.349000e+01 -4.784448e+00 -1.863198e+01 8.651870e-02 + 1.350000e+01 -4.956864e+00 -1.864579e+01 8.663784e-02 + 1.351000e+01 -5.143928e+00 -1.865960e+01 8.683855e-02 + 1.352000e+01 -5.342101e+00 -1.867341e+01 8.705148e-02 + 1.353000e+01 -5.546924e+00 -1.868723e+01 8.720391e-02 + 1.354000e+01 -5.753306e+00 -1.870104e+01 8.724463e-02 + 1.355000e+01 -5.955817e+00 -1.871485e+01 8.716110e-02 + 1.356000e+01 -6.148971e+00 -1.872866e+01 8.698342e-02 + 1.357000e+01 -6.327478e+00 -1.874247e+01 8.677405e-02 + 1.358000e+01 -6.486436e+00 -1.875628e+01 8.660648e-02 + 1.359000e+01 -6.621461e+00 -1.877010e+01 8.653958e-02 + 1.360000e+01 -6.728749e+00 -1.878391e+01 8.659674e-02 + 1.361000e+01 -6.805065e+00 -1.879772e+01 8.675746e-02 + 1.362000e+01 -6.847679e+00 -1.881153e+01 8.696484e-02 + 1.363000e+01 -6.854252e+00 -1.882534e+01 8.714585e-02 + 1.364000e+01 -6.822699e+00 -1.883915e+01 8.723680e-02 + 1.365000e+01 -6.751047e+00 -1.885297e+01 8.720513e-02 + 1.366000e+01 -6.637312e+00 -1.886678e+01 8.706033e-02 + 1.367000e+01 -6.479411e+00 -1.888059e+01 8.685082e-02 + 1.368000e+01 -6.275138e+00 -1.889440e+01 8.664769e-02 + 1.369000e+01 -6.022197e+00 -1.890821e+01 8.652037e-02 + 1.370000e+01 -5.718318e+00 -1.892203e+01 8.651225e-02 + 1.371000e+01 -5.361436e+00 -1.893584e+01 8.662527e-02 + 1.372000e+01 -4.949941e+00 -1.894965e+01 8.681930e-02 + 1.373000e+01 -4.482964e+00 -1.896346e+01 8.702647e-02 + 1.374000e+01 -3.960701e+00 -1.897727e+01 8.717513e-02 + 1.375000e+01 -3.384724e+00 -1.899108e+01 8.721440e-02 + 1.376000e+01 -2.758268e+00 -1.900490e+01 8.713130e-02 + 1.377000e+01 -2.086466e+00 -1.901871e+01 8.695496e-02 + 1.378000e+01 -1.376492e+00 -1.903252e+01 8.674677e-02 + 1.379000e+01 -6.376060e-01 -1.904633e+01 8.657948e-02 + 1.380000e+01 1.189154e-01 -1.906014e+01 8.651187e-02 + 1.381000e+01 8.799825e-01 -1.907395e+01 8.656795e-02 + 1.382000e+01 1.631013e+00 -1.908777e+01 8.672833e-02 + 1.383000e+01 2.356368e+00 -1.910158e+01 8.693729e-02 + 1.384000e+01 3.039881e+00 -1.911539e+01 8.712256e-02 + 1.385000e+01 3.665462e+00 -1.912920e+01 8.722057e-02 + 1.386000e+01 4.217727e+00 -1.914301e+01 8.719805e-02 + 1.387000e+01 4.682640e+00 -1.915682e+01 8.706323e-02 + 1.388000e+01 5.048115e+00 -1.917064e+01 8.686301e-02 + 1.389000e+01 5.304554e+00 -1.918445e+01 8.666718e-02 + 1.390000e+01 5.445279e+00 -1.919826e+01 8.654443e-02 + 1.391000e+01 5.466843e+00 -1.921207e+01 8.653820e-02 + 1.392000e+01 5.369194e+00 -1.922588e+01 8.665117e-02 + 1.393000e+01 5.155694e+00 -1.923969e+01 8.684424e-02 + 1.394000e+01 4.832977e+00 -1.925351e+01 8.705052e-02 + 1.395000e+01 4.410678e+00 -1.926732e+01 8.719880e-02 + 1.396000e+01 3.901022e+00 -1.928113e+01 8.723803e-02 + 1.397000e+01 3.318331e+00 -1.929494e+01 8.715449e-02 + 1.398000e+01 2.678455e+00 -1.930875e+01 8.697640e-02 + 1.399000e+01 1.998167e+00 -1.932256e+01 8.676445e-02 + 1.400000e+01 1.294562e+00 -1.933638e+01 8.659131e-02 + 1.401000e+01 5.844846e-01 -1.935019e+01 8.651647e-02 + 1.402000e+01 -1.159802e-01 -1.936400e+01 8.656534e-02 + 1.403000e+01 -7.919358e-01 -1.937781e+01 8.672021e-02 + 1.404000e+01 -1.430003e+00 -1.939162e+01 8.692668e-02 + 1.405000e+01 -2.018545e+00 -1.940543e+01 8.711310e-02 + 1.406000e+01 -2.547779e+00 -1.941925e+01 8.721543e-02 + 1.407000e+01 -3.009802e+00 -1.943306e+01 8.719908e-02 + 1.408000e+01 -3.398520e+00 -1.944687e+01 8.707031e-02 + 1.409000e+01 -3.709518e+00 -1.946068e+01 8.687410e-02 + 1.410000e+01 -3.939893e+00 -1.947449e+01 8.667883e-02 + 1.411000e+01 -4.088053e+00 -1.948830e+01 8.655280e-02 + 1.412000e+01 -4.153539e+00 -1.950212e+01 8.654022e-02 + 1.413000e+01 -4.136856e+00 -1.951593e+01 8.664544e-02 + 1.414000e+01 -4.039348e+00 -1.952974e+01 8.683144e-02 + 1.415000e+01 -3.863122e+00 -1.954355e+01 8.703311e-02 + 1.416000e+01 -3.611024e+00 -1.955736e+01 8.718022e-02 + 1.417000e+01 -3.286660e+00 -1.957117e+01 8.722168e-02 + 1.418000e+01 -2.894460e+00 -1.958499e+01 8.714281e-02 + 1.419000e+01 -2.439767e+00 -1.959880e+01 8.697027e-02 + 1.420000e+01 -1.928925e+00 -1.961261e+01 8.676321e-02 + 1.421000e+01 -1.369369e+00 -1.962642e+01 8.659313e-02 + 1.422000e+01 -7.696641e-01 -1.964023e+01 8.651919e-02 + 1.423000e+01 -1.395087e-01 -1.965405e+01 8.656721e-02 + 1.424000e+01 5.103362e-01 -1.966786e+01 8.672041e-02 + 1.425000e+01 1.168189e+00 -1.968167e+01 8.692539e-02 + 1.426000e+01 1.821671e+00 -1.969548e+01 8.711108e-02 + 1.427000e+01 2.457998e+00 -1.970929e+01 8.721334e-02 + 1.428000e+01 3.064343e+00 -1.972310e+01 8.719685e-02 + 1.429000e+01 3.628244e+00 -1.973692e+01 8.706682e-02 + 1.430000e+01 4.138038e+00 -1.975073e+01 8.686730e-02 + 1.431000e+01 4.583296e+00 -1.976454e+01 8.666640e-02 + 1.432000e+01 4.955240e+00 -1.977835e+01 8.653308e-02 + 1.433000e+01 5.247099e+00 -1.979216e+01 8.651313e-02 + 1.434000e+01 5.454396e+00 -1.980597e+01 8.661301e-02 + 1.435000e+01 5.575138e+00 -1.981979e+01 8.679766e-02 + 1.436000e+01 5.609900e+00 -1.983360e+01 8.700313e-02 + 1.437000e+01 5.561781e+00 -1.984741e+01 8.715912e-02 + 1.438000e+01 5.436253e+00 -1.986122e+01 8.721313e-02 + 1.439000e+01 5.240895e+00 -1.987503e+01 8.714810e-02 + 1.440000e+01 4.985026e+00 -1.988884e+01 8.698788e-02 + 1.441000e+01 4.679273e+00 -1.990266e+01 8.678910e-02 + 1.442000e+01 4.335075e+00 -1.991647e+01 8.662183e-02 + 1.443000e+01 3.964178e+00 -1.993028e+01 8.654520e-02 + 1.444000e+01 3.578123e+00 -1.994409e+01 8.658651e-02 + 1.445000e+01 3.187783e+00 -1.995790e+01 8.673150e-02 + 1.446000e+01 2.802954e+00 -1.997171e+01 8.692952e-02 + 1.447000e+01 2.432023e+00 -1.998553e+01 8.711160e-02 + 1.448000e+01 2.081747e+00 -1.999934e+01 8.721460e-02 + 1.449000e+01 1.757120e+00 -2.001315e+01 8.720277e-02 + 1.450000e+01 1.461361e+00 -2.002696e+01 8.707979e-02 + 1.451000e+01 1.195997e+00 -2.004077e+01 8.688753e-02 + 1.452000e+01 9.610290e-01 -2.005458e+01 8.669200e-02 + 1.453000e+01 7.551803e-01 -2.006840e+01 8.656071e-02 + 1.454000e+01 5.761841e-01 -2.008221e+01 8.653907e-02 + 1.455000e+01 4.211026e-01 -2.009602e+01 8.663426e-02 + 1.456000e+01 2.866464e-01 -2.010983e+01 8.681266e-02 + 1.457000e+01 1.694743e-01 -2.012364e+01 8.701187e-02 + 1.458000e+01 6.645185e-02 -2.013745e+01 8.716272e-02 + 1.459000e+01 -2.514443e-02 -2.015127e+01 8.721308e-02 + 1.460000e+01 -1.074894e-01 -2.016508e+01 8.714545e-02 + 1.461000e+01 -1.821416e-01 -2.017889e+01 8.698281e-02 + 1.462000e+01 -2.500448e-01 -2.019270e+01 8.678086e-02 + 1.463000e+01 -3.115920e-01 -2.020651e+01 8.660920e-02 + 1.464000e+01 -3.667410e-01 -2.022032e+01 8.652729e-02 + 1.465000e+01 -4.151668e-01 -2.023414e+01 8.656352e-02 + 1.466000e+01 -4.564340e-01 -2.024795e+01 8.670512e-02 + 1.467000e+01 -4.901719e-01 -2.026176e+01 8.690285e-02 + 1.468000e+01 -5.162349e-01 -2.027557e+01 8.708850e-02 + 1.469000e+01 -5.348347e-01 -2.028938e+01 8.719871e-02 + 1.470000e+01 -5.466305e-01 -2.030319e+01 8.719651e-02 + 1.471000e+01 -5.527720e-01 -2.031701e+01 8.708366e-02 + 1.472000e+01 -5.548896e-01 -2.033082e+01 8.689996e-02 + 1.473000e+01 -5.550346e-01 -2.034463e+01 8.670973e-02 + 1.474000e+01 -5.555731e-01 -2.035844e+01 8.657974e-02 + 1.475000e+01 -5.590439e-01 -2.037225e+01 8.655587e-02 + 1.476000e+01 -5.679911e-01 -2.038607e+01 8.664678e-02 + 1.477000e+01 -5.847853e-01 -2.039988e+01 8.682083e-02 + 1.478000e+01 -6.114465e-01 -2.041369e+01 8.701749e-02 + 1.479000e+01 -6.494827e-01 -2.042750e+01 8.716862e-02 + 1.480000e+01 -6.997548e-01 -2.044131e+01 8.722207e-02 + 1.481000e+01 -7.623785e-01 -2.045512e+01 8.715926e-02 + 1.482000e+01 -8.366678e-01 -2.046894e+01 8.700137e-02 + 1.483000e+01 -9.211228e-01 -2.048275e+01 8.680223e-02 + 1.484000e+01 -1.013463e+00 -2.049656e+01 8.663007e-02 + 1.485000e+01 -1.110697e+00 -2.051037e+01 8.654393e-02 + 1.486000e+01 -1.209235e+00 -2.052418e+01 8.657293e-02 + 1.487000e+01 -1.305011e+00 -2.053799e+01 8.670590e-02 + 1.488000e+01 -1.393638e+00 -2.055181e+01 8.689546e-02 + 1.489000e+01 -1.470557e+00 -2.056562e+01 8.707496e-02 + 1.490000e+01 -1.531186e+00 -2.057943e+01 8.718178e-02 + 1.491000e+01 -1.571064e+00 -2.059324e+01 8.717868e-02 + 1.492000e+01 -1.585969e+00 -2.060705e+01 8.706638e-02 + 1.493000e+01 -1.572029e+00 -2.062086e+01 8.688319e-02 + 1.494000e+01 -1.525798e+00 -2.063468e+01 8.669216e-02 + 1.495000e+01 -1.444329e+00 -2.064849e+01 8.655945e-02 + 1.496000e+01 -1.325218e+00 -2.066230e+01 8.653123e-02 + 1.497000e+01 -1.166644e+00 -2.067611e+01 8.661736e-02 + 1.498000e+01 -9.674051e-01 -2.068992e+01 8.678785e-02 + 1.499000e+01 -7.269469e-01 -2.070373e+01 8.698363e-02 + 1.500000e+01 -4.454000e-01 -2.071755e+01 8.713743e-02 + 1.501000e+01 -1.236221e-01 -2.073136e+01 8.719695e-02 + 1.502000e+01 2.367538e-01 -2.074517e+01 8.714255e-02 + 1.503000e+01 6.332650e-01 -2.075898e+01 8.699371e-02 + 1.504000e+01 1.062564e+00 -2.077279e+01 8.680245e-02 + 1.505000e+01 1.520368e+00 -2.078660e+01 8.663558e-02 + 1.506000e+01 2.001423e+00 -2.080042e+01 8.655162e-02 + 1.507000e+01 2.499483e+00 -2.081423e+01 8.658014e-02 + 1.508000e+01 3.007331e+00 -2.082804e+01 8.671129e-02 + 1.509000e+01 3.516827e+00 -2.084185e+01 8.689934e-02 + 1.510000e+01 4.019008e+00 -2.085566e+01 8.707903e-02 + 1.511000e+01 4.504236e+00 -2.086947e+01 8.718840e-02 + 1.512000e+01 4.962400e+00 -2.088329e+01 8.719001e-02 + 1.513000e+01 5.383163e+00 -2.089710e+01 8.708351e-02 + 1.514000e+01 5.756255e+00 -2.091091e+01 8.690578e-02 + 1.515000e+01 6.071799e+00 -2.092472e+01 8.671843e-02 + 1.516000e+01 6.320652e+00 -2.093853e+01 8.658676e-02 + 1.517000e+01 6.494763e+00 -2.095234e+01 8.655692e-02 + 1.518000e+01 6.587501e+00 -2.096616e+01 8.663953e-02 + 1.519000e+01 6.593970e+00 -2.097997e+01 8.680590e-02 + 1.520000e+01 6.511261e+00 -2.099378e+01 8.699829e-02 + 1.521000e+01 6.338644e+00 -2.100759e+01 8.715026e-02 + 1.522000e+01 6.077686e+00 -2.102140e+01 8.720959e-02 + 1.523000e+01 5.732276e+00 -2.103521e+01 8.715597e-02 + 1.524000e+01 5.308559e+00 -2.104903e+01 8.700773e-02 + 1.525000e+01 4.814774e+00 -2.106284e+01 8.681567e-02 + 1.526000e+01 4.261014e+00 -2.107665e+01 8.664582e-02 + 1.527000e+01 3.658895e+00 -2.109046e+01 8.655666e-02 + 1.528000e+01 3.021173e+00 -2.110427e+01 8.657858e-02 + 1.529000e+01 2.361305e+00 -2.111808e+01 8.670310e-02 + 1.530000e+01 1.692992e+00 -2.113190e+01 8.688598e-02 + 1.531000e+01 1.029719e+00 -2.114571e+01 8.706302e-02 + 1.532000e+01 3.843055e-01 -2.115952e+01 8.717253e-02 + 1.533000e+01 -2.314983e-01 -2.117333e+01 8.717646e-02 + 1.534000e+01 -8.073607e-01 -2.118714e+01 8.707316e-02 + 1.535000e+01 -1.334647e+00 -2.120096e+01 8.689792e-02 + 1.536000e+01 -1.806617e+00 -2.121477e+01 8.671103e-02 + 1.537000e+01 -2.218534e+00 -2.122858e+01 8.657716e-02 + 1.538000e+01 -2.567686e+00 -2.124239e+01 8.654282e-02 + 1.539000e+01 -2.853326e+00 -2.125620e+01 8.661987e-02 + 1.540000e+01 -3.076533e+00 -2.127001e+01 8.678136e-02 + 1.541000e+01 -3.240015e+00 -2.128383e+01 8.697121e-02 + 1.542000e+01 -3.347861e+00 -2.129764e+01 8.712405e-02 + 1.543000e+01 -3.405258e+00 -2.131145e+01 8.718786e-02 + 1.544000e+01 -3.418200e+00 -2.132526e+01 8.714159e-02 + 1.545000e+01 -3.393192e+00 -2.133907e+01 8.700214e-02 + 1.546000e+01 -3.336974e+00 -2.135288e+01 8.681863e-02 + 1.547000e+01 -3.256275e+00 -2.136670e+01 8.665566e-02 + 1.548000e+01 -3.157593e+00 -2.138051e+01 8.657086e-02 + 1.549000e+01 -3.047040e+00 -2.139432e+01 8.659456e-02 + 1.550000e+01 -2.930208e+00 -2.140813e+01 8.671892e-02 + 1.551000e+01 -2.812102e+00 -2.142194e+01 8.690064e-02 + 1.552000e+01 -2.697099e+00 -2.143575e+01 8.707639e-02 + 1.553000e+01 -2.588949e+00 -2.144957e+01 8.718490e-02 + 1.554000e+01 -2.490803e+00 -2.146338e+01 8.718799e-02 + 1.555000e+01 -2.405253e+00 -2.147719e+01 8.708347e-02 + 1.556000e+01 -2.334388e+00 -2.149100e+01 8.690596e-02 + 1.557000e+01 -2.279846e+00 -2.150481e+01 8.671539e-02 + 1.558000e+01 -2.242860e+00 -2.151862e+01 8.657662e-02 + 1.559000e+01 -2.224294e+00 -2.153244e+01 8.653701e-02 + 1.560000e+01 -2.224665e+00 -2.154625e+01 8.660975e-02 + 1.561000e+01 -2.244148e+00 -2.156006e+01 8.676924e-02 + 1.562000e+01 -2.282567e+00 -2.157387e+01 8.696030e-02 + 1.563000e+01 -2.339377e+00 -2.158768e+01 8.711762e-02 + 1.564000e+01 -2.413641e+00 -2.160149e+01 8.718828e-02 + 1.565000e+01 -2.504009e+00 -2.161531e+01 8.714959e-02 + 1.566000e+01 -2.608694e+00 -2.162912e+01 8.701652e-02 + 1.567000e+01 -2.725478e+00 -2.164293e+01 8.683646e-02 + 1.568000e+01 -2.851718e+00 -2.165674e+01 8.667307e-02 + 1.569000e+01 -2.984382e+00 -2.167055e+01 8.658420e-02 + 1.570000e+01 -3.120107e+00 -2.168436e+01 8.660152e-02 + 1.571000e+01 -3.255281e+00 -2.169818e+01 8.671925e-02 + 1.572000e+01 -3.386141e+00 -2.171199e+01 8.689629e-02 + 1.573000e+01 -3.508893e+00 -2.172580e+01 8.707088e-02 + 1.574000e+01 -3.619842e+00 -2.173961e+01 8.718225e-02 + 1.575000e+01 -3.715524e+00 -2.175342e+01 8.719152e-02 + 1.576000e+01 -3.792840e+00 -2.176723e+01 8.709476e-02 + 1.577000e+01 -3.849176e+00 -2.178105e+01 8.692438e-02 + 1.578000e+01 -3.882504e+00 -2.179486e+01 8.673815e-02 + 1.579000e+01 -3.891464e+00 -2.180867e+01 8.659954e-02 + 1.580000e+01 -3.875416e+00 -2.182248e+01 8.655563e-02 + 1.581000e+01 -3.834455e+00 -2.183629e+01 8.662049e-02 + 1.582000e+01 -3.769399e+00 -2.185010e+01 8.677023e-02 + 1.583000e+01 -3.681745e+00 -2.186392e+01 8.695160e-02 + 1.584000e+01 -3.573588e+00 -2.187773e+01 8.710090e-02 + 1.585000e+01 -3.447530e+00 -2.189154e+01 8.716604e-02 + 1.586000e+01 -3.306553e+00 -2.190535e+01 8.712429e-02 + 1.587000e+01 -3.153896e+00 -2.191916e+01 8.698994e-02 + 1.588000e+01 -2.992916e+00 -2.193298e+01 8.680943e-02 + 1.589000e+01 -2.826957e+00 -2.194679e+01 8.664565e-02 + 1.590000e+01 -2.659230e+00 -2.196060e+01 8.655622e-02 + 1.591000e+01 -2.492706e+00 -2.197441e+01 8.657323e-02 + 1.592000e+01 -2.330024e+00 -2.198822e+01 8.669178e-02 + 1.593000e+01 -2.173434e+00 -2.200203e+01 8.687175e-02 + 1.594000e+01 -2.024744e+00 -2.201585e+01 8.705200e-02 + 1.595000e+01 -1.885313e+00 -2.202966e+01 8.717166e-02 + 1.596000e+01 -1.756044e+00 -2.204347e+01 8.719096e-02 + 1.597000e+01 -1.637404e+00 -2.205728e+01 8.710449e-02 + 1.598000e+01 -1.529458e+00 -2.207109e+01 8.694291e-02 + 1.599000e+01 -1.431911e+00 -2.208490e+01 8.676253e-02 + 1.600000e+01 -1.344145e+00 -2.209872e+01 8.662605e-02 + 1.601000e+01 -1.265271e+00 -2.211253e+01 8.658077e-02 + 1.602000e+01 -1.194158e+00 -2.212634e+01 8.664190e-02 + 1.603000e+01 -1.129475e+00 -2.214015e+01 8.678723e-02 + 1.604000e+01 -1.069708e+00 -2.215396e+01 8.696517e-02 + 1.605000e+01 -1.013175e+00 -2.216777e+01 8.711310e-02 + 1.606000e+01 -9.580365e-01 -2.218159e+01 8.717913e-02 + 1.607000e+01 -9.022976e-01 -2.219540e+01 8.713980e-02 + 1.608000e+01 -8.438092e-01 -2.220921e+01 8.700803e-02 + 1.609000e+01 -7.802728e-01 -2.222302e+01 8.682870e-02 + 1.610000e+01 -7.092517e-01 -2.223683e+01 8.666351e-02 + 1.611000e+01 -6.281935e-01 -2.225064e+01 8.656967e-02 + 1.612000e+01 -5.344664e-01 -2.226446e+01 8.657978e-02 + 1.613000e+01 -4.254127e-01 -2.227827e+01 8.669028e-02 + 1.614000e+01 -2.984207e-01 -2.229208e+01 8.686268e-02 + 1.615000e+01 -1.510139e-01 -2.230589e+01 8.703726e-02 + 1.616000e+01 1.904334e-02 -2.231970e+01 8.715393e-02 + 1.617000e+01 2.136275e-01 -2.233351e+01 8.717286e-02 + 1.618000e+01 4.341297e-01 -2.234733e+01 8.708780e-02 + 1.619000e+01 6.813283e-01 -2.236114e+01 8.692818e-02 + 1.620000e+01 9.552663e-01 -2.237495e+01 8.674911e-02 + 1.621000e+01 1.255142e+00 -2.238876e+01 8.661257e-02 + 1.622000e+01 1.579220e+00 -2.240257e+01 8.656588e-02 + 1.623000e+01 1.924770e+00 -2.241638e+01 8.662499e-02 + 1.624000e+01 2.288039e+00 -2.243020e+01 8.676888e-02 + 1.625000e+01 2.664263e+00 -2.244401e+01 8.694708e-02 + 1.626000e+01 3.047722e+00 -2.245782e+01 8.709763e-02 + 1.627000e+01 3.431836e+00 -2.247163e+01 8.716854e-02 + 1.628000e+01 3.809304e+00 -2.248544e+01 8.713550e-02 + 1.629000e+01 4.172289e+00 -2.249925e+01 8.701008e-02 + 1.630000e+01 4.512626e+00 -2.251307e+01 8.683574e-02 + 1.631000e+01 4.822073e+00 -2.252688e+01 8.667314e-02 + 1.632000e+01 5.092568e+00 -2.254069e+01 8.657922e-02 + 1.633000e+01 5.316504e+00 -2.255450e+01 8.658719e-02 + 1.634000e+01 5.487003e+00 -2.256831e+01 8.669477e-02 + 1.635000e+01 5.598176e+00 -2.258212e+01 8.686500e-02 + 1.636000e+01 5.645362e+00 -2.259594e+01 8.703936e-02 + 1.637000e+01 5.625337e+00 -2.260975e+01 8.715825e-02 + 1.638000e+01 5.536483e+00 -2.262356e+01 8.718141e-02 + 1.639000e+01 5.378903e+00 -2.263737e+01 8.710144e-02 + 1.640000e+01 5.154495e+00 -2.265118e+01 8.694617e-02 + 1.641000e+01 4.866954e+00 -2.266500e+01 8.676927e-02 + 1.642000e+01 4.521731e+00 -2.267881e+01 8.663185e-02 + 1.643000e+01 4.125925e+00 -2.269262e+01 8.658129e-02 + 1.644000e+01 3.688121e+00 -2.270643e+01 8.663452e-02 + 1.645000e+01 3.218184e+00 -2.272024e+01 8.677209e-02 + 1.646000e+01 2.727006e+00 -2.273405e+01 8.694519e-02 + 1.647000e+01 2.226214e+00 -2.274787e+01 8.709303e-02 + 1.648000e+01 1.727859e+00 -2.276168e+01 8.716397e-02 + 1.649000e+01 1.244083e+00 -2.277549e+01 8.713314e-02 + 1.650000e+01 7.867764e-01 -2.278930e+01 8.701083e-02 + 1.651000e+01 3.672473e-01 -2.280311e+01 8.683899e-02 + 1.652000e+01 -4.106897e-03 -2.281692e+01 8.667696e-02 + 1.653000e+01 -3.180983e-01 -2.283074e+01 8.658105e-02 + 1.654000e+01 -5.670198e-01 -2.284455e+01 8.658475e-02 + 1.655000e+01 -7.448772e-01 -2.285836e+01 8.668684e-02 + 1.656000e+01 -8.475763e-01 -2.287217e+01 8.685183e-02 + 1.657000e+01 -8.730600e-01 -2.288598e+01 8.702265e-02 + 1.658000e+01 -8.213907e-01 -2.289979e+01 8.714060e-02 + 1.659000e+01 -6.947757e-01 -2.291361e+01 8.716553e-02 + 1.660000e+01 -4.975349e-01 -2.292742e+01 8.708940e-02 + 1.661000e+01 -2.360089e-01 -2.294123e+01 8.693890e-02 + 1.662000e+01 8.158785e-02 -2.295504e+01 8.676641e-02 + 1.663000e+01 4.453688e-01 -2.296885e+01 8.663207e-02 + 1.664000e+01 8.440257e-01 -2.298266e+01 8.658288e-02 + 1.665000e+01 1.265123e+00 -2.299648e+01 8.663604e-02 + 1.666000e+01 1.695427e+00 -2.301029e+01 8.677288e-02 + 1.667000e+01 2.121268e+00 -2.302410e+01 8.694556e-02 + 1.668000e+01 2.528916e+00 -2.303791e+01 8.709395e-02 + 1.669000e+01 2.904967e+00 -2.305172e+01 8.716660e-02 + 1.670000e+01 3.236733e+00 -2.306553e+01 8.713823e-02 + 1.671000e+01 3.512608e+00 -2.307935e+01 8.701830e-02 + 1.672000e+01 3.722423e+00 -2.309316e+01 8.684779e-02 + 1.673000e+01 3.857756e+00 -2.310697e+01 8.668536e-02 + 1.674000e+01 3.912201e+00 -2.312078e+01 8.658717e-02 + 1.675000e+01 3.881580e+00 -2.313459e+01 8.658725e-02 + 1.676000e+01 3.764095e+00 -2.314840e+01 8.668542e-02 + 1.677000e+01 3.560410e+00 -2.316222e+01 8.684746e-02 + 1.678000e+01 3.273652e+00 -2.317603e+01 8.701727e-02 + 1.679000e+01 2.909355e+00 -2.318984e+01 8.713655e-02 + 1.680000e+01 2.475305e+00 -2.320365e+01 8.716485e-02 + 1.681000e+01 1.981337e+00 -2.321746e+01 8.709319e-02 + 1.682000e+01 1.439047e+00 -2.323127e+01 8.694702e-02 + 1.683000e+01 8.614615e-01 -2.324509e+01 8.677753e-02 + 1.684000e+01 2.626474e-01 -2.325890e+01 8.664413e-02 + 1.685000e+01 -3.427034e-01 -2.327271e+01 8.659376e-02 + 1.686000e+01 -9.397152e-01 -2.328652e+01 8.664432e-02 + 1.687000e+01 -1.513775e+00 -2.330033e+01 8.677822e-02 + 1.688000e+01 -2.050971e+00 -2.331414e+01 8.694875e-02 + 1.689000e+01 -2.538503e+00 -2.332796e+01 8.709653e-02 + 1.690000e+01 -2.965063e+00 -2.334177e+01 8.717022e-02 + 1.691000e+01 -3.321160e+00 -2.335558e+01 8.714398e-02 + 1.692000e+01 -3.599382e+00 -2.336939e+01 8.702621e-02 + 1.693000e+01 -3.794593e+00 -2.338320e+01 8.685672e-02 + 1.694000e+01 -3.904057e+00 -2.339702e+01 8.669324e-02 + 1.695000e+01 -3.927475e+00 -2.341083e+01 8.659162e-02 + 1.696000e+01 -3.866950e+00 -2.342464e+01 8.658630e-02 + 1.697000e+01 -3.726880e+00 -2.343845e+01 8.667811e-02 + 1.698000e+01 -3.513775e+00 -2.345226e+01 8.683405e-02 + 1.699000e+01 -3.236015e+00 -2.346607e+01 8.699912e-02 + 1.700000e+01 -2.903556e+00 -2.347989e+01 8.711559e-02 + 1.701000e+01 -2.527597e+00 -2.349370e+01 8.714296e-02 + 1.702000e+01 -2.120218e+00 -2.350751e+01 8.707167e-02 + 1.703000e+01 -1.694000e+00 -2.352132e+01 8.692631e-02 + 1.704000e+01 -1.261644e+00 -2.353513e+01 8.675731e-02 + 1.705000e+01 -8.356002e-01 -2.354894e+01 8.662374e-02 + 1.706000e+01 -4.277182e-01 -2.356276e+01 8.657281e-02 + 1.707000e+01 -4.892143e-02 -2.357657e+01 8.662316e-02 + 1.708000e+01 2.910743e-01 -2.359038e+01 8.675822e-02 + 1.709000e+01 5.840006e-01 -2.360419e+01 8.693214e-02 + 1.710000e+01 8.232263e-01 -2.361800e+01 8.708590e-02 + 1.711000e+01 1.003896e+00 -2.363181e+01 8.716778e-02 + 1.712000e+01 1.123014e+00 -2.364563e+01 8.715096e-02 + 1.713000e+01 1.179478e+00 -2.365944e+01 8.704241e-02 + 1.714000e+01 1.174056e+00 -2.367325e+01 8.688049e-02 + 1.715000e+01 1.109323e+00 -2.368706e+01 8.672189e-02 + 1.716000e+01 9.895443e-01 -2.370087e+01 8.662208e-02 + 1.717000e+01 8.205209e-01 -2.371468e+01 8.661594e-02 + 1.718000e+01 6.094028e-01 -2.372850e+01 8.670535e-02 + 1.719000e+01 3.644659e-01 -2.374231e+01 8.685859e-02 + 1.720000e+01 9.486754e-02 -2.375612e+01 8.702171e-02 + 1.721000e+01 -1.896189e-01 -2.376993e+01 8.713742e-02 + 1.722000e+01 -4.788820e-01 -2.378374e+01 8.716496e-02 + 1.723000e+01 -7.627576e-01 -2.379755e+01 8.709387e-02 + 1.724000e+01 -1.031315e+00 -2.381137e+01 8.694759e-02 + 1.725000e+01 -1.275137e+00 -2.382518e+01 8.677555e-02 + 1.726000e+01 -1.485587e+00 -2.383899e+01 8.663639e-02 + 1.727000e+01 -1.655059e+00 -2.385280e+01 8.657763e-02 + 1.728000e+01 -1.777198e+00 -2.386661e+01 8.661901e-02 + 1.729000e+01 -1.847091e+00 -2.388042e+01 8.674544e-02 + 1.730000e+01 -1.861422e+00 -2.389424e+01 8.691249e-02 + 1.731000e+01 -1.818574e+00 -2.390805e+01 8.706206e-02 + 1.732000e+01 -1.718697e+00 -2.392186e+01 8.714263e-02 + 1.733000e+01 -1.563709e+00 -2.393567e+01 8.712675e-02 + 1.734000e+01 -1.357258e+00 -2.394948e+01 8.702031e-02 + 1.735000e+01 -1.104620e+00 -2.396329e+01 8.686045e-02 + 1.736000e+01 -8.125520e-01 -2.397711e+01 8.670292e-02 + 1.737000e+01 -4.890906e-01 -2.399092e+01 8.660293e-02 + 1.738000e+01 -1.433124e-01 -2.400473e+01 8.659576e-02 + 1.739000e+01 2.149441e-01 -2.401854e+01 8.668431e-02 + 1.740000e+01 5.753838e-01 -2.403235e+01 8.683806e-02 + 1.741000e+01 9.275768e-01 -2.404616e+01 8.700392e-02 + 1.742000e+01 1.261287e+00 -2.405998e+01 8.712489e-02 + 1.743000e+01 1.566793e+00 -2.407379e+01 8.715968e-02 + 1.744000e+01 1.835197e+00 -2.408760e+01 8.709670e-02 + 1.745000e+01 2.058695e+00 -2.410141e+01 8.695786e-02 + 1.746000e+01 2.230823e+00 -2.411522e+01 8.679122e-02 + 1.747000e+01 2.346639e+00 -2.412903e+01 8.665454e-02 + 1.748000e+01 2.402862e+00 -2.414285e+01 8.659530e-02 + 1.749000e+01 2.397953e+00 -2.415666e+01 8.663394e-02 + 1.750000e+01 2.332120e+00 -2.417047e+01 8.675670e-02 + 1.751000e+01 2.207283e+00 -2.418428e+01 8.692050e-02 + 1.752000e+01 2.026962e+00 -2.419809e+01 8.706826e-02 + 1.753000e+01 1.796122e+00 -2.421191e+01 8.714880e-02 + 1.754000e+01 1.520973e+00 -2.422572e+01 8.713429e-02 + 1.755000e+01 1.208728e+00 -2.423953e+01 8.702966e-02 + 1.756000e+01 8.673386e-01 -2.425334e+01 8.687089e-02 + 1.757000e+01 5.052165e-01 -2.426715e+01 8.671285e-02 + 1.758000e+01 1.309496e-01 -2.428096e+01 8.661037e-02 + 1.759000e+01 -2.469724e-01 -2.429478e+01 8.659908e-02 + 1.760000e+01 -6.204145e-01 -2.430859e+01 8.668283e-02 + 1.761000e+01 -9.818255e-01 -2.432240e+01 8.683227e-02 + 1.762000e+01 -1.324432e+00 -2.433621e+01 8.699534e-02 + 1.763000e+01 -1.642390e+00 -2.435002e+01 8.711552e-02 + 1.764000e+01 -1.930898e+00 -2.436383e+01 8.715136e-02 + 1.765000e+01 -2.186256e+00 -2.437765e+01 8.709049e-02 + 1.766000e+01 -2.405888e+00 -2.439146e+01 8.695380e-02 + 1.767000e+01 -2.588317e+00 -2.440527e+01 8.678836e-02 + 1.768000e+01 -2.733104e+00 -2.441908e+01 8.665140e-02 + 1.769000e+01 -2.840752e+00 -2.443289e+01 8.659050e-02 + 1.770000e+01 -2.912593e+00 -2.444670e+01 8.662688e-02 + 1.771000e+01 -2.950643e+00 -2.446052e+01 8.674783e-02 + 1.772000e+01 -2.957458e+00 -2.447433e+01 8.691132e-02 + 1.773000e+01 -2.935981e+00 -2.448814e+01 8.706087e-02 + 1.774000e+01 -2.889393e+00 -2.450195e+01 8.714520e-02 + 1.775000e+01 -2.820974e+00 -2.451576e+01 8.713574e-02 + 1.776000e+01 -2.733977e+00 -2.452957e+01 8.703622e-02 + 1.777000e+01 -2.631524e+00 -2.454339e+01 8.688139e-02 + 1.778000e+01 -2.516520e+00 -2.455720e+01 8.672516e-02 + 1.779000e+01 -2.391589e+00 -2.457101e+01 8.662212e-02 + 1.780000e+01 -2.259035e+00 -2.458482e+01 8.660840e-02 + 1.781000e+01 -2.120827e+00 -2.459863e+01 8.668891e-02 + 1.782000e+01 -1.978597e+00 -2.461244e+01 8.683560e-02 + 1.783000e+01 -1.833662e+00 -2.462626e+01 8.699740e-02 + 1.784000e+01 -1.687057e+00 -2.464007e+01 8.711823e-02 + 1.785000e+01 -1.539578e+00 -2.465388e+01 8.715627e-02 + 1.786000e+01 -1.391838e+00 -2.466769e+01 8.709820e-02 + 1.787000e+01 -1.244314e+00 -2.468150e+01 8.696366e-02 + 1.788000e+01 -1.097405e+00 -2.469531e+01 8.679860e-02 + 1.789000e+01 -9.514796e-01 -2.470913e+01 8.665973e-02 + 1.790000e+01 -8.069198e-01 -2.472294e+01 8.659487e-02 + 1.791000e+01 -6.641559e-01 -2.473675e+01 8.662618e-02 + 1.792000e+01 -5.236915e-01 -2.475056e+01 8.674239e-02 + 1.793000e+01 -3.861179e-01 -2.476437e+01 8.690283e-02 + 1.794000e+01 -2.521187e-01 -2.477818e+01 8.705183e-02 + 1.795000e+01 -1.224641e-01 -2.479200e+01 8.713817e-02 + 1.796000e+01 2.002381e-03 -2.480581e+01 8.713247e-02 + 1.797000e+01 1.203851e-01 -2.481962e+01 8.703715e-02 + 1.798000e+01 2.317610e-01 -2.483343e+01 8.688545e-02 + 1.799000e+01 3.352080e-01 -2.484724e+01 8.673017e-02 + 1.800000e+01 4.298322e-01 -2.486105e+01 8.662547e-02 + 1.801000e+01 5.147948e-01 -2.487487e+01 8.660800e-02 + 1.802000e+01 5.893341e-01 -2.488868e+01 8.668387e-02 + 1.803000e+01 6.527827e-01 -2.490249e+01 8.682659e-02 + 1.804000e+01 7.045791e-01 -2.491630e+01 8.698645e-02 + 1.805000e+01 7.442724e-01 -2.493011e+01 8.710806e-02 + 1.806000e+01 7.715211e-01 -2.494393e+01 8.714944e-02 + 1.807000e+01 7.860873e-01 -2.495774e+01 8.709627e-02 + 1.808000e+01 7.878271e-01 -2.497155e+01 8.696669e-02 + 1.809000e+01 7.766795e-01 -2.498536e+01 8.680515e-02 + 1.810000e+01 7.526563e-01 -2.499917e+01 8.666724e-02 + 1.811000e+01 7.158358e-01 -2.501298e+01 8.660047e-02 + 1.812000e+01 6.663611e-01 -2.502680e+01 8.662762e-02 + 1.813000e+01 6.044479e-01 -2.504061e+01 8.673865e-02 + 1.814000e+01 5.303998e-01 -2.505442e+01 8.689440e-02 + 1.815000e+01 4.446352e-01 -2.506823e+01 8.704050e-02 + 1.816000e+01 3.477236e-01 -2.508204e+01 8.712634e-02 + 1.817000e+01 2.404307e-01 -2.509585e+01 8.712243e-02 + 1.818000e+01 1.237700e-01 -2.510967e+01 8.703037e-02 + 1.819000e+01 -9.416308e-04 -2.512348e+01 8.688225e-02 + 1.820000e+01 -1.320299e-01 -2.513729e+01 8.672973e-02 + 1.821000e+01 -2.674146e-01 -2.515110e+01 8.662628e-02 + 1.822000e+01 -4.045726e-01 -2.516491e+01 8.660846e-02 + 1.823000e+01 -5.405171e-01 -2.517872e+01 8.668296e-02 + 1.824000e+01 -6.717992e-01 -2.519254e+01 8.682420e-02 + 1.825000e+01 -7.945361e-01 -2.520635e+01 8.698340e-02 + 1.826000e+01 -9.044691e-01 -2.522016e+01 8.710574e-02 + 1.827000e+01 -9.970535e-01 -2.523397e+01 8.714922e-02 + 1.828000e+01 -1.067581e+00 -2.524778e+01 8.709899e-02 + 1.829000e+01 -1.111334e+00 -2.526159e+01 8.697229e-02 + 1.830000e+01 -1.123760e+00 -2.527541e+01 8.681263e-02 + 1.831000e+01 -1.100680e+00 -2.528922e+01 8.667502e-02 + 1.832000e+01 -1.038493e+00 -2.530303e+01 8.660692e-02 + 1.833000e+01 -9.343971e-01 -2.531684e+01 8.663167e-02 + 1.834000e+01 -7.865948e-01 -2.533065e+01 8.674018e-02 + 1.835000e+01 -5.944846e-01 -2.534446e+01 8.689429e-02 + 1.836000e+01 -3.588183e-01 -2.535828e+01 8.704028e-02 + 1.837000e+01 -8.181862e-02 -2.537209e+01 8.712763e-02 + 1.838000e+01 2.327552e-01 -2.538590e+01 8.712632e-02 + 1.839000e+01 5.796003e-01 -2.539971e+01 8.703698e-02 + 1.840000e+01 9.519272e-01 -2.541352e+01 8.689062e-02 + 1.841000e+01 1.341585e+00 -2.542733e+01 8.673808e-02 + 1.842000e+01 1.739249e+00 -2.544115e+01 8.663261e-02 + 1.843000e+01 2.134674e+00 -2.545496e+01 8.661124e-02 + 1.844000e+01 2.517002e+00 -2.546877e+01 8.668172e-02 + 1.845000e+01 2.875107e+00 -2.548258e+01 8.681972e-02 + 1.846000e+01 3.197976e+00 -2.549639e+01 8.697754e-02 + 1.847000e+01 3.475105e+00 -2.551020e+01 8.710080e-02 + 1.848000e+01 3.696893e+00 -2.552402e+01 8.714724e-02 + 1.849000e+01 3.855011e+00 -2.553783e+01 8.710102e-02 + 1.850000e+01 3.942748e+00 -2.555164e+01 8.697805e-02 + 1.851000e+01 3.955291e+00 -2.556545e+01 8.682055e-02 + 1.852000e+01 3.889955e+00 -2.557926e+01 8.668268e-02 + 1.853000e+01 3.746327e+00 -2.559307e+01 8.661186e-02 + 1.854000e+01 3.526329e+00 -2.560689e+01 8.663212e-02 + 1.855000e+01 3.234200e+00 -2.562070e+01 8.673571e-02 + 1.856000e+01 2.876383e+00 -2.563451e+01 8.688589e-02 + 1.857000e+01 2.461332e+00 -2.564832e+01 8.703003e-02 + 1.858000e+01 1.999250e+00 -2.566213e+01 8.711799e-02 + 1.859000e+01 1.501751e+00 -2.567595e+01 8.711936e-02 + 1.860000e+01 9.814823e-01 -2.568976e+01 8.703370e-02 + 1.861000e+01 4.517027e-01 -2.570357e+01 8.689062e-02 + 1.862000e+01 -7.414835e-02 -2.571738e+01 8.673974e-02 + 1.863000e+01 -5.828892e-01 -2.573119e+01 8.663363e-02 + 1.864000e+01 -1.062014e+00 -2.574500e+01 8.660942e-02 + 1.865000e+01 -1.500081e+00 -2.575882e+01 8.667576e-02 + 1.866000e+01 -1.887051e+00 -2.577263e+01 8.680969e-02 + 1.867000e+01 -2.214570e+00 -2.578644e+01 8.696490e-02 + 1.868000e+01 -2.476187e+00 -2.580025e+01 8.708798e-02 + 1.869000e+01 -2.667493e+00 -2.581406e+01 8.713694e-02 + 1.870000e+01 -2.786196e+00 -2.582787e+01 8.709541e-02 + 1.871000e+01 -2.832105e+00 -2.584169e+01 8.697819e-02 + 1.872000e+01 -2.807064e+00 -2.585550e+01 8.682608e-02 + 1.873000e+01 -2.714802e+00 -2.586931e+01 8.669201e-02 + 1.874000e+01 -2.560741e+00 -2.588312e+01 8.662265e-02 + 1.875000e+01 -2.351752e+00 -2.589693e+01 8.664204e-02 + 1.876000e+01 -2.095870e+00 -2.591074e+01 8.674305e-02 + 1.877000e+01 -1.802001e+00 -2.592456e+01 8.689001e-02 + 1.878000e+01 -1.479602e+00 -2.593837e+01 8.703136e-02 + 1.879000e+01 -1.138366e+00 -2.595218e+01 8.711776e-02 + 1.880000e+01 -7.879214e-01 -2.596599e+01 8.711906e-02 + 1.881000e+01 -4.375466e-01 -2.597980e+01 8.703452e-02 + 1.882000e+01 -9.591223e-02 -2.599361e+01 8.689316e-02 + 1.883000e+01 2.291400e-01 -2.600743e+01 8.674382e-02 + 1.884000e+01 5.307793e-01 -2.602124e+01 8.663848e-02 + 1.885000e+01 8.033258e-01 -2.603505e+01 8.661408e-02 + 1.886000e+01 1.042344e+00 -2.604886e+01 8.667944e-02 + 1.887000e+01 1.244694e+00 -2.606267e+01 8.681211e-02 + 1.888000e+01 1.408534e+00 -2.607648e+01 8.696633e-02 + 1.889000e+01 1.533284e+00 -2.609030e+01 8.708914e-02 + 1.890000e+01 1.619555e+00 -2.610411e+01 8.713861e-02 + 1.891000e+01 1.669032e+00 -2.611792e+01 8.709817e-02 + 1.892000e+01 1.684341e+00 -2.613173e+01 8.698215e-02 + 1.893000e+01 1.668888e+00 -2.614554e+01 8.683088e-02 + 1.894000e+01 1.626680e+00 -2.615935e+01 8.669698e-02 + 1.895000e+01 1.562134e+00 -2.617317e+01 8.662709e-02 + 1.896000e+01 1.479893e+00 -2.618698e+01 8.664556e-02 + 1.897000e+01 1.384630e+00 -2.620079e+01 8.674573e-02 + 1.898000e+01 1.280880e+00 -2.621460e+01 8.689237e-02 + 1.899000e+01 1.172869e+00 -2.622841e+01 8.703415e-02 + 1.900000e+01 1.064382e+00 -2.624222e+01 8.712155e-02 + 1.901000e+01 9.586432e-01 -2.625604e+01 8.712391e-02 + 1.902000e+01 8.582358e-01 -2.626985e+01 8.703982e-02 + 1.903000e+01 7.650479e-01 -2.628366e+01 8.689764e-02 + 1.904000e+01 6.802536e-01 -2.629747e+01 8.674590e-02 + 1.905000e+01 6.043264e-01 -2.631128e+01 8.663675e-02 + 1.906000e+01 5.370840e-01 -2.632509e+01 8.660775e-02 + 1.907000e+01 4.777607e-01 -2.633891e+01 8.666869e-02 + 1.908000e+01 4.251049e-01 -2.635272e+01 8.679810e-02 + 1.909000e+01 3.774942e-01 -2.636653e+01 8.695090e-02 + 1.910000e+01 3.330653e-01 -2.638034e+01 8.707426e-02 + 1.911000e+01 2.898492e-01 -2.639415e+01 8.712585e-02 + 1.912000e+01 2.459072e-01 -2.640797e+01 8.708827e-02 + 1.913000e+01 1.994612e-01 -2.642178e+01 8.697485e-02 + 1.914000e+01 1.490112e-01 -2.643559e+01 8.682517e-02 + 1.915000e+01 9.343576e-02 -2.644940e+01 8.669150e-02 + 1.916000e+01 3.207130e-02 -2.646321e+01 8.662080e-02 + 1.917000e+01 -3.523389e-02 -2.647702e+01 8.663819e-02 + 1.918000e+01 -1.080916e-01 -2.649084e+01 8.673807e-02 + 1.919000e+01 -1.855728e-01 -2.650465e+01 8.688609e-02 + 1.920000e+01 -2.662331e-01 -2.651846e+01 8.703131e-02 + 1.921000e+01 -3.481626e-01 -2.653227e+01 8.712394e-02 + 1.922000e+01 -4.290574e-01 -2.654608e+01 8.713244e-02 + 1.923000e+01 -5.063087e-01 -2.655989e+01 8.705411e-02 + 1.924000e+01 -5.771067e-01 -2.657371e+01 8.691603e-02 + 1.925000e+01 -6.385529e-01 -2.658752e+01 8.676580e-02 + 1.926000e+01 -6.877780e-01 -2.660133e+01 8.665529e-02 + 1.927000e+01 -7.220605e-01 -2.661514e+01 8.662258e-02 + 1.928000e+01 -7.389414e-01 -2.662895e+01 8.667855e-02 + 1.929000e+01 -7.363326e-01 -2.664276e+01 8.680308e-02 + 1.930000e+01 -7.126151e-01 -2.665658e+01 8.695223e-02 + 1.931000e+01 -6.667246e-01 -2.667039e+01 8.707374e-02 + 1.932000e+01 -5.982225e-01 -2.668420e+01 8.712516e-02 + 1.933000e+01 -5.073506e-01 -2.669801e+01 8.708834e-02 + 1.934000e+01 -3.950681e-01 -2.671182e+01 8.697554e-02 + 1.935000e+01 -2.630694e-01 -2.672563e+01 8.682530e-02 + 1.936000e+01 -1.137826e-01 -2.673945e+01 8.668935e-02 + 1.937000e+01 4.965341e-02 -2.675326e+01 8.661471e-02 + 1.938000e+01 2.234330e-01 -2.676707e+01 8.662727e-02 + 1.939000e+01 4.031503e-01 -2.678088e+01 8.672263e-02 + 1.940000e+01 5.838880e-01 -2.679469e+01 8.686764e-02 + 1.941000e+01 7.603286e-01 -2.680850e+01 8.701220e-02 + 1.942000e+01 9.268876e-01 -2.682232e+01 8.710673e-02 + 1.943000e+01 1.077867e+00 -2.683613e+01 8.711916e-02 + 1.944000e+01 1.207627e+00 -2.684994e+01 8.704579e-02 + 1.945000e+01 1.310772e+00 -2.686375e+01 8.691245e-02 + 1.946000e+01 1.382344e+00 -2.687756e+01 8.676570e-02 + 1.947000e+01 1.418029e+00 -2.689137e+01 8.665689e-02 + 1.948000e+01 1.414343e+00 -2.690519e+01 8.662421e-02 + 1.949000e+01 1.368829e+00 -2.691900e+01 8.667927e-02 + 1.950000e+01 1.280213e+00 -2.693281e+01 8.680296e-02 + 1.951000e+01 1.148547e+00 -2.694662e+01 8.695227e-02 + 1.952000e+01 9.753031e-01 -2.696043e+01 8.707545e-02 + 1.953000e+01 7.634311e-01 -2.697424e+01 8.712995e-02 + 1.954000e+01 5.173547e-01 -2.698806e+01 8.709697e-02 + 1.955000e+01 2.429157e-01 -2.700187e+01 8.698780e-02 + 1.956000e+01 -5.274497e-02 -2.701568e+01 8.684001e-02 + 1.957000e+01 -3.613665e-01 -2.702949e+01 8.670468e-02 + 1.958000e+01 -6.738055e-01 -2.704330e+01 8.662878e-02 + 1.959000e+01 -9.803250e-01 -2.705711e+01 8.663873e-02 + 1.960000e+01 -1.270927e+00 -2.707093e+01 8.673105e-02 + 1.961000e+01 -1.535714e+00 -2.708474e+01 8.687359e-02 + 1.962000e+01 -1.765271e+00 -2.709855e+01 8.701693e-02 + 1.963000e+01 -1.951044e+00 -2.711236e+01 8.711161e-02 + 1.964000e+01 -2.085707e+00 -2.712617e+01 8.712512e-02 + 1.965000e+01 -2.163487e+00 -2.713998e+01 8.705289e-02 + 1.966000e+01 -2.180452e+00 -2.715380e+01 8.691976e-02 + 1.967000e+01 -2.134721e+00 -2.716761e+01 8.677159e-02 + 1.968000e+01 -2.026606e+00 -2.718142e+01 8.665955e-02 + 1.969000e+01 -1.858664e+00 -2.719523e+01 8.662232e-02 + 1.970000e+01 -1.635658e+00 -2.720904e+01 8.667250e-02 + 1.971000e+01 -1.364429e+00 -2.722286e+01 8.679216e-02 + 1.972000e+01 -1.053676e+00 -2.723667e+01 8.693928e-02 + 1.973000e+01 -7.136597e-01 -2.725048e+01 8.706254e-02 + 1.974000e+01 -3.558338e-01 -2.726429e+01 8.711913e-02 + 1.975000e+01 7.572895e-03 -2.727810e+01 8.708940e-02 + 1.976000e+01 3.640104e-01 -2.729191e+01 8.698344e-02 + 1.977000e+01 7.010758e-01 -2.730573e+01 8.683771e-02 + 1.978000e+01 1.006975e+00 -2.731954e+01 8.670262e-02 + 1.979000e+01 1.270958e+00 -2.733335e+01 8.662514e-02 + 1.980000e+01 1.483711e+00 -2.734716e+01 8.663239e-02 + 1.981000e+01 1.637679e+00 -2.736097e+01 8.672204e-02 + 1.982000e+01 1.727326e+00 -2.737478e+01 8.686318e-02 + 1.983000e+01 1.749294e+00 -2.738860e+01 8.700723e-02 + 1.984000e+01 1.702483e+00 -2.740241e+01 8.710492e-02 + 1.985000e+01 1.588034e+00 -2.741622e+01 8.712322e-02 + 1.986000e+01 1.409227e+00 -2.743003e+01 8.705644e-02 + 1.987000e+01 1.171294e+00 -2.744384e+01 8.692811e-02 + 1.988000e+01 8.811625e-01 -2.745765e+01 8.678293e-02 + 1.989000e+01 5.471485e-01 -2.747147e+01 8.667148e-02 + 1.990000e+01 1.786013e-01 -2.748528e+01 8.663257e-02 + 1.991000e+01 -2.144701e-01 -2.749909e+01 8.667962e-02 + 1.992000e+01 -6.217781e-01 -2.751290e+01 8.679592e-02 + 1.993000e+01 -1.033127e+00 -2.752671e+01 8.694062e-02 + 1.994000e+01 -1.438757e+00 -2.754052e+01 8.706314e-02 + 1.995000e+01 -1.829651e+00 -2.755434e+01 8.712079e-02 + 1.996000e+01 -2.197791e+00 -2.756815e+01 8.709333e-02 + 1.997000e+01 -2.536358e+00 -2.758196e+01 8.698987e-02 + 1.998000e+01 -2.839868e+00 -2.759577e+01 8.684575e-02 + 1.999000e+01 -3.104253e+00 -2.760958e+01 8.671056e-02 + 2.000000e+01 -3.326870e+00 -2.762339e+01 8.663104e-02 diff --git a/examples/Ni_plot_pdf.py b/examples/Ni_plot_pdf.py index 1f8cb97d..4e61d200 100755 --- a/examples/Ni_plot_pdf.py +++ b/examples/Ni_plot_pdf.py @@ -30,8 +30,8 @@ # pylab is matplotlib interface with MATLAB-like plotting commands pylab.plot(r, G) -pylab.xlabel(u"r (Å)") -pylab.ylabel(u"G (Å$^{-2}$)") +pylab.xlabel("r (Å)") +pylab.ylabel("G (Å$^{-2}$)") pylab.title("x-ray PDF of nickel simulated at Qmax = %g" % qmax) # display plot window, this must be the last command in the script diff --git a/examples/Ni_refinement.py b/examples/Ni_refinement.py index 11f6f1ec..7c8862f6 100755 --- a/examples/Ni_refinement.py +++ b/examples/Ni_refinement.py @@ -80,8 +80,8 @@ pylab.plot(r, Gfit, "b-") pylab.plot(r, Gdiff + Gdiff_baseline, "r-") -pylab.xlabel(u"r (Å)") -pylab.ylabel(u"G (Å$^{-2}$)") +pylab.xlabel("r (Å)") +pylab.ylabel("G (Å$^{-2}$)") pylab.title("Fit of nickel to x-ray experimental PDF") # display plot window, this must be the last command in the script diff --git a/pyproject.toml b/pyproject.toml index d7351b5e..e537e24a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,4 +19,4 @@ exclude = ''' | blib2to3 | tests/data )/ -''' \ No newline at end of file +''' diff --git a/setup.py b/setup.py index 6a32d3b1..18e30554 100755 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ def gitinfo(): - from subprocess import Popen, PIPE + from subprocess import PIPE, Popen kw = dict(stdout=PIPE, cwd=MYDIR, universal_newlines=True) proc = Popen(["git", "describe", "--tags", "--match=[v,V,[:digit:]]*"], **kw) From b634598217718a21167d4068acf24524d34d11be Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 13:08:17 -0400 Subject: [PATCH 010/294] stages uncommented --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 377da527..14d7a2eb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,4 +40,4 @@ repos: - id: no-commit-to-branch name: Prevent Commit to Main Branch args: ["--branch", "main"] - #stages: [pre-commit] \ No newline at end of file + stages: [pre-commit] \ No newline at end of file From f0920e8dbead1eb4721bea771ae196183ac08ca8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:11:49 +0000 Subject: [PATCH 011/294] [pre-commit.ci] auto fixes from pre-commit hooks --- .pre-commit-config.yaml | 2 +- diffpy/pdffit2/__init__.py | 4 ++-- diffpy/pdffit2/pdffit.py | 7 +++---- diffpy/pdffit2/tests/TestShapeFactors.py | 4 ++-- examples/Ni_plot_pdf.py | 3 ++- examples/Ni_refinement.py | 2 +- setup.py | 3 +-- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14d7a2eb..c4588061 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,4 +40,4 @@ repos: - id: no-commit-to-branch name: Prevent Commit to Main Branch args: ["--branch", "main"] - stages: [pre-commit] \ No newline at end of file + stages: [pre-commit] diff --git a/diffpy/pdffit2/__init__.py b/diffpy/pdffit2/__init__.py index 0f33c5c4..d0b98683 100644 --- a/diffpy/pdffit2/__init__.py +++ b/diffpy/pdffit2/__init__.py @@ -21,10 +21,10 @@ """ -from diffpy.pdffit2.version import __version__, __date__ -from diffpy.pdffit2.pdffit import PdfFit from diffpy.pdffit2.output import redirect_stdout +from diffpy.pdffit2.pdffit import PdfFit from diffpy.pdffit2.pdffit2 import is_element +from diffpy.pdffit2.version import __date__, __version__ # silence pyflakes checker assert __version__ or True diff --git a/diffpy/pdffit2/pdffit.py b/diffpy/pdffit2/pdffit.py index 43685ad1..255e8b0f 100644 --- a/diffpy/pdffit2/pdffit.py +++ b/diffpy/pdffit2/pdffit.py @@ -26,9 +26,7 @@ # Note that "import diffpy.pdffit2.output as output" would # crash with AttributeError when executed during imports of # parent packages. -from diffpy.pdffit2 import pdffit2 -from diffpy.pdffit2 import output - +from diffpy.pdffit2 import output, pdffit2 # helper routines @@ -143,7 +141,8 @@ def _exportAll(self, namespace): def intro(): """Show introductory message.""" import re - from diffpy.pdffit2 import __version__, __date__ + + from diffpy.pdffit2 import __date__, __version__ date = __date__[:10] d = {"version": __version__, "date": date, "year": date[:4] or "2019"} diff --git a/diffpy/pdffit2/tests/TestShapeFactors.py b/diffpy/pdffit2/tests/TestShapeFactors.py index 9c870c4a..1eaa9711 100644 --- a/diffpy/pdffit2/tests/TestShapeFactors.py +++ b/diffpy/pdffit2/tests/TestShapeFactors.py @@ -5,10 +5,10 @@ import unittest + import numpy -from diffpy.pdffit2 import PdfFit -from diffpy.pdffit2 import pdffit2 +from diffpy.pdffit2 import PdfFit, pdffit2 from diffpy.pdffit2.tests.pdffit2testutils import datafile diff --git a/examples/Ni_plot_pdf.py b/examples/Ni_plot_pdf.py index 4e61d200..603c65c9 100755 --- a/examples/Ni_plot_pdf.py +++ b/examples/Ni_plot_pdf.py @@ -4,9 +4,10 @@ """Calculate PDF of FCC nickel and plot it using matplotlib. """ -from diffpy.pdffit2 import PdfFit import pylab +from diffpy.pdffit2 import PdfFit + # create new PDF calculator object P = PdfFit() diff --git a/examples/Ni_refinement.py b/examples/Ni_refinement.py index 7c8862f6..665e92f4 100755 --- a/examples/Ni_refinement.py +++ b/examples/Ni_refinement.py @@ -5,9 +5,9 @@ Save fitted curve, refined structure and results summary. """ -from diffpy.pdffit2 import PdfFit import pylab +from diffpy.pdffit2 import PdfFit # Create new PDF calculator object. pf = PdfFit() diff --git a/setup.py b/setup.py index 18e30554..32800328 100755 --- a/setup.py +++ b/setup.py @@ -13,8 +13,7 @@ import sys import warnings -from setuptools import setup, find_packages -from setuptools import Extension +from setuptools import Extension, find_packages, setup # Use this version when git data are not available, like in git zip archive. # Update when tagging a new release. From 0921249f8f72aa24d9db0a0ae46969756023e553 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 13:21:31 -0400 Subject: [PATCH 012/294] more pep8 fixes --- .github/workflows/build.yaml | 2 +- devutils/makesdist | 4 ++-- diffpy/pdffit2/ipy_ext.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9f8369e5..610ebbde 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -64,4 +64,4 @@ jobs: # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') # uses: pypa/gh-action-pypi-publish@release/v1 # with: - # password: ${{ secrets.PYPI_API_TOKEN }} + # password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/devutils/makesdist b/devutils/makesdist index e77257ea..dccfaa99 100755 --- a/devutils/makesdist +++ b/devutils/makesdist @@ -11,11 +11,11 @@ import subprocess import sys import tarfile +from setup import FALLBACK_VERSION, versiondata + BASEDIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.insert(0, BASEDIR) -from setup import FALLBACK_VERSION, versiondata - timestamp = versiondata.getint("DEFAULT", "timestamp") vfb = versiondata.get("DEFAULT", "version").split(".post")[0] + ".post0" diff --git a/diffpy/pdffit2/ipy_ext.py b/diffpy/pdffit2/ipy_ext.py index dd96b7bf..c136bd45 100644 --- a/diffpy/pdffit2/ipy_ext.py +++ b/diffpy/pdffit2/ipy_ext.py @@ -54,6 +54,7 @@ def showfit(self, offset=None): No return value. """ from matplotlib.pyplot import gca + from math import floor cr = self.r cGobs = self.Gobs @@ -89,5 +90,4 @@ def _asarray(x, dtype=None): return numpy.asarray(x, dtype=dtype) - # End of class EasyPDFPlotting From 545cc0a3cade4cf5a0343f2ab0d43cc6c865105c Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 13:27:02 -0400 Subject: [PATCH 013/294] black fixes --- diffpy/pdffit2/ipy_ext.py | 1 + diffpy/pdffit2/pdffit.py | 3 ++- diffpy/pdffit2/tests/TestPdfFit.py | 4 ++-- diffpy/pdffit2/tests/TestPhaseFractions.py | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/diffpy/pdffit2/ipy_ext.py b/diffpy/pdffit2/ipy_ext.py index c136bd45..df8bc537 100644 --- a/diffpy/pdffit2/ipy_ext.py +++ b/diffpy/pdffit2/ipy_ext.py @@ -90,4 +90,5 @@ def _asarray(x, dtype=None): return numpy.asarray(x, dtype=dtype) + # End of class EasyPDFPlotting diff --git a/diffpy/pdffit2/pdffit.py b/diffpy/pdffit2/pdffit.py index 255e8b0f..9d0f164b 100644 --- a/diffpy/pdffit2/pdffit.py +++ b/diffpy/pdffit2/pdffit.py @@ -26,7 +26,8 @@ # Note that "import diffpy.pdffit2.output as output" would # crash with AttributeError when executed during imports of # parent packages. -from diffpy.pdffit2 import output, pdffit2 +from diffpy.pdffit2 import pdffit2 +from diffpy.pdffit2 import output # helper routines diff --git a/diffpy/pdffit2/tests/TestPdfFit.py b/diffpy/pdffit2/tests/TestPdfFit.py index 70712356..38d73f46 100644 --- a/diffpy/pdffit2/tests/TestPdfFit.py +++ b/diffpy/pdffit2/tests/TestPdfFit.py @@ -321,7 +321,7 @@ def test_getcrw(self): self.assertAlmostEqual(self.P.getrw(), rw19, self.places) # renormalize cumulative Rw and compare with Rw at r=15 Gobs19 = numpy.array(self.P.getpdf_obs()) - Gnorm19 = numpy.sqrt(numpy.sum(Gobs19**2)) + Gnorm19 = numpy.sqrt(numpy.sum(Gobs19 ** 2)) r = numpy.array(self.P.getR()) idx = numpy.nonzero(r <= 15)[0] Gnorm15 = numpy.sqrt(numpy.sum(Gobs19[idx] ** 2)) @@ -350,7 +350,7 @@ def test_getcrw_two_datasets(self): rw1 = self.P.getcrw()[-1] self.P.setdata(2) rw2 = self.P.getcrw()[-1] - self.assertAlmostEqual(rwtot**2, rw1**2 + rw2**2, self.places) + self.assertAlmostEqual(rwtot ** 2, rw1 ** 2 + rw2 ** 2, self.places) return # def test_getpar(self): diff --git a/diffpy/pdffit2/tests/TestPhaseFractions.py b/diffpy/pdffit2/tests/TestPhaseFractions.py index afc57c06..0b90a703 100644 --- a/diffpy/pdffit2/tests/TestPhaseFractions.py +++ b/diffpy/pdffit2/tests/TestPhaseFractions.py @@ -29,7 +29,7 @@ def test_xray_fractions(self): """test_xray_fractions -- check phase fractions in x-ray dataset.""" self.P.setdata(1) ph = self.P.phase_fractions() - bb1 = 28**2 + bb1 = 28 ** 2 bb2 = ((8 * 82 + 24 * 8 + 4 * 21 + 2 * 74 + 2 * 22) / 40.0) ** 2 self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) @@ -57,7 +57,7 @@ def test_neutron_fractions(self): """test_neutron_fractions -- check phase fractions in neutron dataset.""" self.P.setdata(2) ph = self.P.phase_fractions() - bb1 = 10.31**2 + bb1 = 10.31 ** 2 bPb = 9.4012 bO = 5.8054 bSc = 12.11 From dcd0ee8bf1281b8326ea0930dc45e9d1a84ad293 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 13:27:36 -0400 Subject: [PATCH 014/294] pre-commit keep imports same to not break package --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c4588061..c8536852 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: rev: 5.13.2 hooks: - id: isort - args: ["--profile", "black"] + args: ["--profile", "black", "--order-by-type"] - repo: https://github.com/kynan/nbstripout rev: 0.7.1 hooks: From 794324c2da069550abbfd85d86a3029c73523a7d Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 13:29:59 -0400 Subject: [PATCH 015/294] fix __init__.py as was broken by pre-commit bot --- diffpy/pdffit2/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diffpy/pdffit2/__init__.py b/diffpy/pdffit2/__init__.py index d0b98683..0f33c5c4 100644 --- a/diffpy/pdffit2/__init__.py +++ b/diffpy/pdffit2/__init__.py @@ -21,10 +21,10 @@ """ -from diffpy.pdffit2.output import redirect_stdout +from diffpy.pdffit2.version import __version__, __date__ from diffpy.pdffit2.pdffit import PdfFit +from diffpy.pdffit2.output import redirect_stdout from diffpy.pdffit2.pdffit2 import is_element -from diffpy.pdffit2.version import __date__, __version__ # silence pyflakes checker assert __version__ or True From 74a0d1c5e6f870030666f6a97d84fd0a3ed84e4b Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 13:38:26 -0400 Subject: [PATCH 016/294] further pre-commit fixes --- .github/workflows/build.yaml | 2 +- diffpy/pdffit2/ipy_ext.py | 3 ++- diffpy/pdffit2/pdffit.py | 3 +-- diffpy/pdffit2/tests/TestPdfFit.py | 4 ++-- diffpy/pdffit2/tests/TestPhaseFractions.py | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 610ebbde..9f8369e5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -64,4 +64,4 @@ jobs: # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') # uses: pypa/gh-action-pypi-publish@release/v1 # with: - # password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + # password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/diffpy/pdffit2/ipy_ext.py b/diffpy/pdffit2/ipy_ext.py index df8bc537..4546967e 100644 --- a/diffpy/pdffit2/ipy_ext.py +++ b/diffpy/pdffit2/ipy_ext.py @@ -53,9 +53,10 @@ def showfit(self, offset=None): No return value. """ - from matplotlib.pyplot import gca from math import floor + from matplotlib.pyplot import gca + cr = self.r cGobs = self.Gobs cGcalc = self.Gcalc diff --git a/diffpy/pdffit2/pdffit.py b/diffpy/pdffit2/pdffit.py index 9d0f164b..255e8b0f 100644 --- a/diffpy/pdffit2/pdffit.py +++ b/diffpy/pdffit2/pdffit.py @@ -26,8 +26,7 @@ # Note that "import diffpy.pdffit2.output as output" would # crash with AttributeError when executed during imports of # parent packages. -from diffpy.pdffit2 import pdffit2 -from diffpy.pdffit2 import output +from diffpy.pdffit2 import output, pdffit2 # helper routines diff --git a/diffpy/pdffit2/tests/TestPdfFit.py b/diffpy/pdffit2/tests/TestPdfFit.py index 38d73f46..70712356 100644 --- a/diffpy/pdffit2/tests/TestPdfFit.py +++ b/diffpy/pdffit2/tests/TestPdfFit.py @@ -321,7 +321,7 @@ def test_getcrw(self): self.assertAlmostEqual(self.P.getrw(), rw19, self.places) # renormalize cumulative Rw and compare with Rw at r=15 Gobs19 = numpy.array(self.P.getpdf_obs()) - Gnorm19 = numpy.sqrt(numpy.sum(Gobs19 ** 2)) + Gnorm19 = numpy.sqrt(numpy.sum(Gobs19**2)) r = numpy.array(self.P.getR()) idx = numpy.nonzero(r <= 15)[0] Gnorm15 = numpy.sqrt(numpy.sum(Gobs19[idx] ** 2)) @@ -350,7 +350,7 @@ def test_getcrw_two_datasets(self): rw1 = self.P.getcrw()[-1] self.P.setdata(2) rw2 = self.P.getcrw()[-1] - self.assertAlmostEqual(rwtot ** 2, rw1 ** 2 + rw2 ** 2, self.places) + self.assertAlmostEqual(rwtot**2, rw1**2 + rw2**2, self.places) return # def test_getpar(self): diff --git a/diffpy/pdffit2/tests/TestPhaseFractions.py b/diffpy/pdffit2/tests/TestPhaseFractions.py index 0b90a703..afc57c06 100644 --- a/diffpy/pdffit2/tests/TestPhaseFractions.py +++ b/diffpy/pdffit2/tests/TestPhaseFractions.py @@ -29,7 +29,7 @@ def test_xray_fractions(self): """test_xray_fractions -- check phase fractions in x-ray dataset.""" self.P.setdata(1) ph = self.P.phase_fractions() - bb1 = 28 ** 2 + bb1 = 28**2 bb2 = ((8 * 82 + 24 * 8 + 4 * 21 + 2 * 74 + 2 * 22) / 40.0) ** 2 self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) @@ -57,7 +57,7 @@ def test_neutron_fractions(self): """test_neutron_fractions -- check phase fractions in neutron dataset.""" self.P.setdata(2) ph = self.P.phase_fractions() - bb1 = 10.31 ** 2 + bb1 = 10.31**2 bPb = 9.4012 bO = 5.8054 bSc = 12.11 From fe5b5b049cbb5c0c654bb48c5a68a4be75fcb19b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:38:38 +0000 Subject: [PATCH 017/294] [pre-commit.ci] auto fixes from pre-commit hooks --- diffpy/pdffit2/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diffpy/pdffit2/__init__.py b/diffpy/pdffit2/__init__.py index 0f33c5c4..d0b98683 100644 --- a/diffpy/pdffit2/__init__.py +++ b/diffpy/pdffit2/__init__.py @@ -21,10 +21,10 @@ """ -from diffpy.pdffit2.version import __version__, __date__ -from diffpy.pdffit2.pdffit import PdfFit from diffpy.pdffit2.output import redirect_stdout +from diffpy.pdffit2.pdffit import PdfFit from diffpy.pdffit2.pdffit2 import is_element +from diffpy.pdffit2.version import __date__, __version__ # silence pyflakes checker assert __version__ or True From c9f5cd67537dd66d58a51ea51b87ab8bace448aa Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 13:45:39 -0400 Subject: [PATCH 018/294] exclude __init__.py from pre-commit as it breaks imports --- .pre-commit-config.yaml | 3 ++- diffpy/pdffit2/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c8536852..41a8d7dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,6 +30,7 @@ repos: hooks: - id: isort args: ["--profile", "black", "--order-by-type"] + exclude: diffpy/pdffit2/__init__\.py$ - repo: https://github.com/kynan/nbstripout rev: 0.7.1 hooks: @@ -40,4 +41,4 @@ repos: - id: no-commit-to-branch name: Prevent Commit to Main Branch args: ["--branch", "main"] - stages: [pre-commit] + #stages: [pre-commit] diff --git a/diffpy/pdffit2/__init__.py b/diffpy/pdffit2/__init__.py index d0b98683..0f33c5c4 100644 --- a/diffpy/pdffit2/__init__.py +++ b/diffpy/pdffit2/__init__.py @@ -21,10 +21,10 @@ """ -from diffpy.pdffit2.output import redirect_stdout +from diffpy.pdffit2.version import __version__, __date__ from diffpy.pdffit2.pdffit import PdfFit +from diffpy.pdffit2.output import redirect_stdout from diffpy.pdffit2.pdffit2 import is_element -from diffpy.pdffit2.version import __date__, __version__ # silence pyflakes checker assert __version__ or True From 0efa6e0b6a2750865d6806eb4451e504c58ba093 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 13:45:57 -0400 Subject: [PATCH 019/294] minor fixes --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 41a8d7dd..c52e9bdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,4 +41,4 @@ repos: - id: no-commit-to-branch name: Prevent Commit to Main Branch args: ["--branch", "main"] - #stages: [pre-commit] + stages: [pre-commit] From ce3dea4d557e53bfd626a5a6e0b77e1efebf72d2 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 16 Jul 2024 14:02:35 -0400 Subject: [PATCH 020/294] Exclude meta.yaml since hook not properly checking jinja2 --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c52e9bdf..0ab2ecdd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,6 +14,7 @@ repos: rev: v4.6.0 hooks: - id: check-yaml + exclude: ^conda-recipe/meta\.yaml$ - id: end-of-file-fixer - id: trailing-whitespace exclude: '\.(rst|txt)$' @@ -30,7 +31,7 @@ repos: hooks: - id: isort args: ["--profile", "black", "--order-by-type"] - exclude: diffpy/pdffit2/__init__\.py$ + exclude: ^diffpy/pdffit2/__init__\.py$ - repo: https://github.com/kynan/nbstripout rev: 0.7.1 hooks: From 04f7267115f9747db4392c37a6e15b5a890ee1ea Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Mon, 22 Jul 2024 11:50:03 -0400 Subject: [PATCH 021/294] Added src directory with Python code --- src/diffpy/__init__.py | 24 + src/diffpy/pdffit2/__init__.py | 24 + src/diffpy/pdffit2/ipy_ext.py | 95 + src/diffpy/pdffit2/output.py | 41 + src/diffpy/pdffit2/pdffit.py | 1297 +++++++++++ src/diffpy/pdffit2/tests/ExceptionsTest.py | 794 +++++++ src/diffpy/pdffit2/tests/TestPdfFit.py | 761 ++++++ .../pdffit2/tests/TestPhaseFractions.py | 95 + src/diffpy/pdffit2/tests/TestShapeFactors.py | 274 +++ src/diffpy/pdffit2/tests/__init__.py | 0 src/diffpy/pdffit2/tests/conftest.py | 19 + src/diffpy/pdffit2/tests/debug.py | 35 + src/diffpy/pdffit2/tests/pdffit2testutils.py | 53 + src/diffpy/pdffit2/tests/run.py | 34 + src/diffpy/pdffit2/tests/rundeps.py | 30 + src/diffpy/pdffit2/tests/testdata/300K.gr | 2062 +++++++++++++++++ src/diffpy/pdffit2/tests/testdata/Ni.dat | 1001 ++++++++ src/diffpy/pdffit2/tests/testdata/Ni.stru | 33 + .../pdffit2/tests/testdata/PbScW25TiO3.stru | 345 +++ src/diffpy/pdffit2/tests/testdata/badNi.dat | 1001 ++++++++ src/diffpy/pdffit2/tests/testdata/badNi.stru | 32 + .../tests/testdata/badNiZeroVolume.stru | 33 + .../pdffit2/tests/testdata/noLattice.stru | 32 + src/diffpy/pdffit2/version.py | 26 + 24 files changed, 8141 insertions(+) create mode 100644 src/diffpy/__init__.py create mode 100644 src/diffpy/pdffit2/__init__.py create mode 100644 src/diffpy/pdffit2/ipy_ext.py create mode 100644 src/diffpy/pdffit2/output.py create mode 100644 src/diffpy/pdffit2/pdffit.py create mode 100644 src/diffpy/pdffit2/tests/ExceptionsTest.py create mode 100644 src/diffpy/pdffit2/tests/TestPdfFit.py create mode 100644 src/diffpy/pdffit2/tests/TestPhaseFractions.py create mode 100644 src/diffpy/pdffit2/tests/TestShapeFactors.py create mode 100644 src/diffpy/pdffit2/tests/__init__.py create mode 100644 src/diffpy/pdffit2/tests/conftest.py create mode 100644 src/diffpy/pdffit2/tests/debug.py create mode 100644 src/diffpy/pdffit2/tests/pdffit2testutils.py create mode 100644 src/diffpy/pdffit2/tests/run.py create mode 100644 src/diffpy/pdffit2/tests/rundeps.py create mode 100644 src/diffpy/pdffit2/tests/testdata/300K.gr create mode 100644 src/diffpy/pdffit2/tests/testdata/Ni.dat create mode 100644 src/diffpy/pdffit2/tests/testdata/Ni.stru create mode 100644 src/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru create mode 100644 src/diffpy/pdffit2/tests/testdata/badNi.dat create mode 100644 src/diffpy/pdffit2/tests/testdata/badNi.stru create mode 100644 src/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru create mode 100644 src/diffpy/pdffit2/tests/testdata/noLattice.stru create mode 100644 src/diffpy/pdffit2/version.py diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py new file mode 100644 index 00000000..71428827 --- /dev/null +++ b/src/diffpy/__init__.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +############################################################################## +# +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. +# +# File coded by: Billinge Group members and community contributors. +# +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors +# +# See LICENSE.rst for license information. +# +############################################################################## + +"""Blank namespace package for module diffpy.""" + + +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) + +# End of file + diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py new file mode 100644 index 00000000..e12b2fb9 --- /dev/null +++ b/src/diffpy/pdffit2/__init__.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python +############################################################################## +# +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. +# +# File coded by: Billinge Group members and community contributors. +# +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors +# +# See LICENSE.rst for license information. +# +############################################################################## + +"""PDFfit2 - real space structure refinement program.""" + +# package version +from diffpy.pdffit2.version import __version__ + +# silence the pyflakes syntax checker +assert __version__ or True + +# End of file diff --git a/src/diffpy/pdffit2/ipy_ext.py b/src/diffpy/pdffit2/ipy_ext.py new file mode 100644 index 00000000..4546967e --- /dev/null +++ b/src/diffpy/pdffit2/ipy_ext.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python + +"""This module defines functions within IPython session to simulate +the old pdffit2 interactive session. + +Usage: %load_ext diffpy.pdffit2.ipy_ext +""" + + +def load_ipython_extension(ipython): + from diffpy.pdffit2 import PdfFit + + pf = PdfFit() + pdf = EasyPDFPlotting(pf) + print(" Type help(pdffit) or help(topic) for information.\n") + ns = dict(pdffit=PdfFit, pdf=pdf) + pf._exportAll(ns) + ipython.user_ns.update(ns) + return + + +class EasyPDFPlotting(object): + """Convenience functions for accessing and plotting PDFfit2 data.""" + + def __init__(self, pdffit_instance): + self._pdffit = pdffit_instance + return + + @property + def r(self): + "R-grid for PDF simulation." + return self._asarray(self._pdffit.getR(), dtype=float) + + @property + def Gobs(self): + "Observed PDF data." + return self._asarray(self._pdffit.getpdf_obs(), dtype=float) + + @property + def Gcalc(self): + "Calculated PDF data." + return self._asarray(self._pdffit.getpdf_fit()) + + @property + def Gdiff(self): + "Difference between the observed and simulated PDF." + return self.Gobs - self.Gcalc + + def showfit(self, offset=None): + """Plot observed and simulated PDFs and the difference curve. + + offset -- offset for the difference curve. + + No return value. + """ + from math import floor + + from matplotlib.pyplot import gca + + cr = self.r + cGobs = self.Gobs + cGcalc = self.Gcalc + cGdiff = self.Gdiff + if offset is None: + offset = floor(min([min(cGobs), min(cGcalc)]) - max(cGdiff)) + ax = gca() + ax.plot(cr, cGobs, "r.", cr, cGcalc, "b-", cr, cGdiff + offset, "g-") + xl = ax.xaxis.get_label().get_text() + yl = ax.yaxis.get_label().get_text() + if xl == "": + ax.set_xlabel("r (A)") + if yl == "": + ax.set_ylabel("G (A**-2)") + return + + def showRw(self): + "Plot cumulative Rw." + from matplotlib.pyplot import gca + + cRw = self._asarray(self._pdffit.getcrw()) + ax = gca() + ax.plot(self.r, cRw) + ax.set_title("Cumulative Rw = %.4f" % cRw[-1]) + ax.set_xlabel("r") + ax.set_ylabel("Rw") + return + + @staticmethod + def _asarray(x, dtype=None): + import numpy + + return numpy.asarray(x, dtype=dtype) + + +# End of class EasyPDFPlotting diff --git a/src/diffpy/pdffit2/output.py b/src/diffpy/pdffit2/output.py new file mode 100644 index 00000000..6d1247cf --- /dev/null +++ b/src/diffpy/pdffit2/output.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +############################################################################## +# +# pdffit2 by DANSE Diffraction group +# Simon J. L. Billinge +# (c) 2007 trustees of the Michigan State University. +# All rights reserved. +# +# File coded by: Pavol Juhas +# +# See AUTHORS.txt for a list of people who contributed. +# See LICENSE.txt for license information. +# +############################################################################## + +"""Take care of sending engine output to given file-like object. +The output file is stored in local module variable stdout. +""" + + +# create module variable stdout + +from sys import stdout as stdout + +# silence pyflakes checker +assert stdout + + +def redirect_stdout(dst): + """Redirect PDFfit2 standard output to a file-like object dst. + The dst value is stored in module variable stdout. + """ + from diffpy.pdffit2.pdffit2 import redirect_stdout + + redirect_stdout(dst) + global stdout + stdout = dst + return + + +# End of file diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py new file mode 100644 index 00000000..255e8b0f --- /dev/null +++ b/src/diffpy/pdffit2/pdffit.py @@ -0,0 +1,1297 @@ +#!/usr/bin/env python +############################################################################## +# +# pdffit2 by DANSE Diffraction group +# Simon J. L. Billinge +# (c) 2006 trustees of the Michigan State University. +# All rights reserved. +# +# File coded by: Chris Farros, Pavol Juhas +# +# See AUTHORS.txt for a list of people who contributed. +# See LICENSE.txt for license information. +# +############################################################################## + +"""PdfFit class for fitting pdf data to a model.""" + +from __future__ import print_function + +import itertools +import numbers + +import six + +# Load pdffit2 and output modules to the current namespace. +# Note that "import diffpy.pdffit2.output as output" would +# crash with AttributeError when executed during imports of +# parent packages. +from diffpy.pdffit2 import output, pdffit2 + +# helper routines + + +def _format_value_std(value, stdev): + """Convert value to a string with standard deviation in brackets. + + value -- a number + stdev -- standard deviation. Ignored when small compared to value. + + Return string. + """ + if stdev > abs(value) * 1e-8: + s = "%g (%g)" % (value, stdev) + elif str(stdev) == "nan": + s = "%g (NaN)" % value + else: + s = "%g" % value + return s + + +def _format_bond_length(dij, ddij, ij1, symij): + """Return string with formatted bond length info for a pair of atoms. + + dij -- distance between atoms i and j + ddij -- standard deviation of dij. Ignored when small relative to dij. + ij1 -- tuple of atom indices starting at 1 + symij -- tuple of atom symbols + + Return formatted string. + """ + w_smbidx = 10 + w_equals = 30 + s0 = "%s (#%i)" % (symij[0], ij1[0]) + s1 = "%s (#%i)" % (symij[1], ij1[1]) + leader0 = " " + s0.ljust(w_smbidx) + " - " + s1 + " " + leader1 = leader0.ljust(w_equals) + "= " + s = leader1 + _format_value_std(dij, ddij) + " A" + return s + + +def _convertCallable(var): + """Convert an object to the result of its call when callable. + + var -- string or callable object that returns string + + Return var or var(). + """ + if callable(var): + rv = var() + else: + rv = var + return rv + + +# constants + +__intro_message__ = """ +****************************************************************************** +* P D F F I T Version %(version)s * +* %(date)s * +* -------------------------------------------------------------------------- * +* (c) 1998-2007 Trustees of the Michigan State University. * +* (c) 2008-%(year)s Trustees of the Columbia University * +* in the city of New York. * +* * +* Authors: * +* Thomas Proffen - Email: tproffen@lanl.gov * +* Jacques Bloch - Email: bloch@pa.msu.edu * +* Christopher Farrow - Email: clf2121@columbia.edu * +* Pavol Juhas - Email: pjuhas@bnl.gov * +* Simon Billinge - Email: sb2896@columbia.edu * +****************************************************************************** +""" + + +############################################################################## + + +class PdfFit(object): + """Create PdfFit object.""" + + # constants and enumerators from pdffit.h: + # selection of all atoms + selalias = {"ALL": -1} + # constraint type identifiers + FCON = {"USER": 0, "IDENT": 1, "FCOMP": 2, "FSQR": 3} + # scattering type identifiers + Sctp = {"X": 0, "N": 1} + + def _exportAll(self, namespace): + """_exportAll(self, namespace) --> Export all 'public' class methods + into namespace. + + This function allows for a module-level PdfFit object which doesn't have + to be referenced when calling a method. This function makes old (python) + scripts compatible with this class. At the top of the script, create a + pdffit object, and then call this method. Usually, namespace = locals(). + """ + # string aliases (var = "var") + for a in itertools.chain(self.selalias, self.FCON, self.Sctp): + exec("%s = %r" % (a, a), namespace) + public = [ + a + for a in dir(self) + if "__" not in a and a not in ["_handle", "_exportAll", "selalias", "FCON", "Sctp"] + ] + for funcname in public: + namespace[funcname] = getattr(self, funcname) + return + + def intro(): + """Show introductory message.""" + import re + + from diffpy.pdffit2 import __date__, __version__ + + date = __date__[:10] + d = {"version": __version__, "date": date, "year": date[:4] or "2019"} + msg = __intro_message__ % d + + def filler(mx): + return mx.group(0).rstrip(" *").ljust(77) + "*" + + msg_ljust = re.sub("(?m)^(.{1,77}|.{79}.*)$", filler, msg) + print(msg_ljust, file=output.stdout) + return + + intro = staticmethod(intro) + + def add_structure(self, stru): + """add_structure(stru) --> Add new structure to PdfFit instance. + + stru -- instance of Structure class from diffpy.structure. + + No return value. + Raises pdffit2.structureError when stru contains unknown + atom species. + """ + s = stru.writeStr("pdffit") + self.read_struct_string(s) + return + + def read_struct(self, struct): + """read_struct(struct) --> Read structure from file into memory. + + struct -- name of file from which to read structure + + Raises: + pdffit2.calculationError when a lattice cannot be created from the + given structure + pdffit2.structureError when a structure file is malformed + IOError when the file cannot be read from the disk + """ + pdffit2.read_struct(self._handle, struct) + self.stru_files.append(struct) + return + + def read_struct_string(self, struct, name=""): + """read_struct_string(struct, name = "") --> Read structure from + a string into memory. + + struct -- string containing the contents of the structure file + name -- tag with which to label structure + + Raises: + pdffit2.calculationError when a lattice cannot be created from the + given structure + pdffit2.structureError when a structure file is malformed + """ + pdffit2.read_struct_string(self._handle, struct) + self.stru_files.append(name) + return + + def read_data(self, data, stype, qmax, qdamp): + """read_data(data, stype, qmax, qdamp) --> Read pdf data from file into + memory. + + data -- name of file from which to read data + stype -- 'X' (xray) or 'N' (neutron) + qmax -- Q-value cutoff used in PDF calculation. + Use qmax=0 to neglect termination ripples. + qdamp -- instrumental Q-resolution factor + + Raises: IOError when the file cannot be read from disk + """ + pdffit2.read_data(self._handle, data, six.b(stype), qmax, qdamp) + self.data_files.append(data) + return + + def read_data_string(self, data, stype, qmax, qdamp, name=""): + """read_data_string(data, stype, qmax, qdamp, name = "") --> Read + pdf data from a string into memory. + + data -- string containing the contents of the data file + stype -- 'X' (xray) or 'N' (neutron) + qmax -- Q-value cutoff used in PDF calculation. + Use qmax=0 to neglect termination ripples. + qdamp -- instrumental Q-resolution factor + name -- tag with which to label data + """ + pdffit2.read_data_string(self._handle, data, six.b(stype), qmax, qdamp, name) + name = data + self.data_files.append(name) + return + + def read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, name="list"): + """read_data_lists(stype, qmax, qdamp, r_data, Gr_data, dGr_data = + None, name = "list") --> Read pdf data into memory from lists. + + All lists must be of the same length. + stype -- 'X' (xray) or 'N' (neutron) + qmax -- Q-value cutoff used in PDF calculation. + Use qmax=0 to neglect termination ripples. + qdamp -- instrumental Q-resolution factor + r_data -- list of r-values + Gr_data -- list of G(r) values + dGr_data -- list of G(r) uncertainty values + name -- tag with which to label data + + Raises: ValueError when the data lists are of different length + """ + pdffit2.read_data_arrays(self._handle, six.b(stype), qmax, qdamp, r_data, Gr_data, dGr_data, name) + self.data_files.append(name) + return + + def pdfrange(self, iset, rmin, rmax): + """pdfrange(iset, rmin, rmax) --> Set the range of the fit. + + iset -- data set to consider + rmin -- minimum r-value of fit + rmax -- maximum r-value of fit + + Raises: ValueError for bad input values + """ + pdffit2.pdfrange(self._handle, iset, rmin, rmax) + return + + def reset(self): + """reset() --> Clear all stored fit, structure, and parameter data.""" + self.stru_files = [] + self.data_files = [] + pdffit2.reset(self._handle) + return + + def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): + """alloc(stype, qmax, qdamp, rmin, rmax, bin) --> Allocate space + for a PDF calculation. + + The structure from which to calculate the PDF must first be imported + with the read_struct() or read_struct_string() method. + stype -- 'X' (xray) or 'N' (neutron) + qmax -- Q-value cutoff used in PDF calculation. + Use qmax=0 to neglect termination ripples. + qdamp -- instrumental Q-resolution factor + rmin -- minimum r-value of calculation + rmax -- maximum r-value of calculation + bin -- number of data points in calculation + + Raises: + ValueError for bad input values + pdffit.unassignedError when no structure has been loaded + """ + pdffit2.alloc(self._handle, six.b(stype), qmax, qdamp, rmin, rmax, bin) + return + + def calc(self): + """calc() --> Calculate the PDF of the imported structure. + + Space for the calculation must first be allocated with the alloc() + method. + + Raises: + pdffit2.calculationError when allocated space cannot + accomodate calculation + pdffit.unassignedError when space for calculation has not been + allocated + """ + pdffit2.calc(self._handle) + return + + def refine(self, toler=0.00000001): + """refine(toler = 0.00000001) --> Fit the theory to the imported data. + + toler -- tolerance of the fit + + Raises: + pdffit2.calculationError when the model pdf cannot be calculated + pdffit2.constraintError when refinement fails due to bad + constraint + pdffit2.unassigedError when a constraint used but never initialized + using setpar() + """ + step = 0 + finished = 0 + while not finished: + finished = pdffit2.refine_step(self._handle, toler) + step += 1 + return + + def refine_step(self, toler=0.00000001): + """refine_step(toler = 0.00000001) --> Run a single step of the fit. + + toler -- tolerance of the fit + + Raises: + pdffit2.calculationError when the model pdf cannot be calculated + pdffit2.constraintError when refinement fails due to bad + constraint + pdffit2.unassigedError when a constraint used but never initialized + using setpar() + + Returns: 1 (0) if refinement is (is not) finished + """ + self.finished = pdffit2.refine_step(self._handle, toler) + return self.finished + + def save_pdf(self, iset, fname): + """save_pdf(iset, fname) --> Save calculated or fitted PDF to file. + + iset -- data set to save + + Raises: + IOError if file cannot be saved + pdffit2.unassignedError if the data set is undefined + """ + pdffit2.save_pdf(self._handle, iset, fname) + return + + def save_pdf_string(self, iset): + """save_pdf_string(iset) --> Save calculated or fitted PDF to string. + + iset -- data set to save + + Raises: + pdffit2.unassignedError if the data set is undefined + + Returns: string containing contents of save file + """ + pdffilestring = pdffit2.save_pdf(self._handle, iset, "") + return pdffilestring + + def save_dif(self, iset, fname): + """save_dif(iset, fname) --> Save data and fitted PDF difference to + file. + + iset -- data set to save + + Raises: + IOError if file cannot be saved + pdffit2.unassignedError if the data set is undefined + """ + pdffit2.save_dif(self._handle, iset, fname) + return + + def save_dif_string(self, iset): + """save_dif_string(iset) --> Save data and fitted PDF difference to + string. + + iset -- data set to save + + Raises: + pdffit2.unassignedError if the data set is undefined + + Returns: string containing contents of save file + """ + diffilestring = pdffit2.save_dif(self._handle, iset, "") + return diffilestring + + def save_res(self, fname): + """save_res(fname) --> Save fit-specific data to file. + + Raises: + IOError if file cannot be saved + pdffit2.unassignedError if there is no refinement data to save + """ + pdffit2.save_res(self._handle, fname) + return + + def save_res_string(self): + """save_res_string() --> Save fit-specific data to a string. + + Raises: + pdffit2.unassignedError if there is no refinement data to save + + Returns: string containing contents of save file + """ + resfilestring = pdffit2.save_res(self._handle, "") + return resfilestring + + def get_structure(self, ip): + """get_structure(ip) --> Get a copy of specified phase data. + + ip -- index of existing PdfFit phase starting from 1 + + Return Structure object from diffpy.structure. + Raise pdffit2.unassignedError if phase ip is undefined. + """ + from diffpy.structure import PDFFitStructure + + s = self.save_struct_string(ip) + stru = PDFFitStructure() + stru.readStr(s, "pdffit") + return stru + + def save_struct(self, ip, fname): + """save_struct(ip, fname) --> Save structure resulting from fit + to file. + + ip -- phase to save + + Raises: + IOError if file cannot be saved + pdffit2.unassignedError if the data set is undefined + """ + pdffit2.save_struct(self._handle, ip, fname) + return + + def save_struct_string(self, ip): + """save_struct(ip) --> Save structure resulting from fit to string. + + ip -- phase to save + + Raises: + pdffit2.unassignedError if phase ip is undefined. + + Returns: string containing contents of save file + """ + structfilestring = pdffit2.save_struct(self._handle, ip, "") + return structfilestring + + def show_struct(self, ip): + """show_struct(ip) --> Print structure resulting from fit. + + ip -- phase to display + + Raises: pdffit2.unassignedError if the phase is undefined + """ + pdffit2.show_struct(self._handle, ip) + return + + def constrain(self, var, par, fcon=None): + """constrain(var, par[, fcon]) --> Constrain a variable to a parameter. + + A variable can be constrained to a number or equation string. + var -- variable to constrain, such as x(1) + par -- parameter which to constrain the variable. This can be + an integer or an equation string containing a reference + to another parameter. Equation strings use standard c++ + syntax. The value of a constrained parameter is accessed + as @p in an equation string, where p is the parameter. + e.g. + >>> constrain(x(1), 1) + >>> constrain(x(2), "0.5+@1") + fcon -- 'USER', 'IDENT', 'FCOMP', or 'FSQR' + this is an optional parameter, and I don't know how it is + used! + + Raises: + pdffit2.constraintError if a constraint is bad + pdffit2.unassignedError if variable does not yet exist + ValueError if variable index does not exist (e.g. lat(7)) + """ + var_ref = self.__getRef(var) + varnc = _convertCallable(var) + if fcon: + fc = self.FCON[fcon] + pdffit2.constrain_int(self._handle, var_ref, varnc, par, fc) + elif isinstance(par, six.string_types): + pdffit2.constrain_str(self._handle, var_ref, varnc, par) + else: + pdffit2.constrain_int(self._handle, var_ref, varnc, par) + return + + def setpar(self, par, val): + """setpar(par, val) --> Set value of constrained parameter. + + val -- Either a numerical value or a reference to a variable + + Raises: + pdffit2.unassignedError when variable is yet to be assigned + """ + # people do not use parenthesis, e.g., "setpar(3, qdamp)" + # in such case val is a reference to PdfFit method + val = _convertCallable(val) + try: + val = float(val) + pdffit2.setpar_dbl(self._handle, par, val) + except ValueError: + var_ref = self.__getRef(val) + pdffit2.setpar_RV(self._handle, par, var_ref) + return + + def setvar(self, var, val): + """setvar(var, val) --> Set the value of a variable. + + Raises: + pdffit2.unassignedError if variable does not yet exist + ValueError if variable index does not exist (e.g. lat(7)) + """ + var_ref = self.__getRef(var) + pdffit2.setvar(self._handle, var_ref, val) + return + + def getvar(self, var): + """getvar(var) --> Get stored value of a variable. + + Raises: + pdffit2.unassignedError if variable does not yet exist + ValueError if variable index does not exist (e.g. lat(7)) + """ + var_ref = self.__getRef(var) + retval = pdffit2.getvar(self._handle, var_ref) + return retval + + def getrw(self): + """getrw() --> Get normalized total error of the fit rw. + + getrw calculates total fit error summed for all datasets in the fit. + + Return float. + """ + rw = pdffit2.getrw(self._handle) + return rw + + def getcrw(self): + """getcrw() --> Get cumulative Rw for the current dataset. + + Cumulative Rw is a list of Rw partial sums cost values evaluated against + observed PDF data in the error sums evaluated against + the r-points in the fit. + + Raises: pdffit2.unassignedError if no data exists + + Returns: List of crw points, equidistant in r or empty list + if the refine function has not been called yet. + """ + crw = pdffit2.getcrw(self._handle) + return crw + + def getR(self): + """getR() --> Get r-points used in the fit. + + This function should only be called after data has been loaded or + calculated. Before a refinement, the list of r-points will reflect the + data. Afterwords, they will reflect the fit range. + + Raises: pdffit2.unassignedError if no data exists + + Returns: List of equidistance r-points used in fit. + """ + R = pdffit2.getR(self._handle) + return R + + def getpdf_fit(self): + """getpdf_fit() --> Get fitted PDF. + + This function should only be called after a refinement or refinement + step has been done. + + Raises: pdffit2.unassignedError if no data exists + + Returns: List of fitted points, equidistant in r. + """ + pdfdata = pdffit2.getpdf_fit(self._handle) + return pdfdata + + def getpdf_obs(self): + """getpdf_obs() --> Get observed PDF. + + This function should only be called after data has been loaded or + calculated. Before a refinement, the list of r-points will reflect the + data. Afterwords, they will reflect the fit range. + + Raises: pdffit2.unassignedError if no data exists + + Returns: List of data points, equidistant in r. + """ + pdfdata = pdffit2.getpdf_obs(self._handle) + return pdfdata + + def getpdf_diff(self): + """Obtain difference between observed and fitted PDF. + + This function should only be called after data has been loaded or + calculated. Before a refinement, the list of r-points will reflect the + data. Afterwords, they will reflect the fit range. + + Raises: pdffit2.unassignedError if no data exists + + Returns: List of data points, equidistant in r. + """ + Gdiff = pdffit2.getpdf_diff(self._handle) + return Gdiff + + def get_atoms(self, ip=None): + """get_atoms() --> Get element symbols of all atoms in the structure. + + ip -- index of phase to get the elements from (starting from 1) + when ip is not given, use current phase + + This function should only be called after a structure has been loaded. + + Raises: pdffit2.unassignedError if no structure exists + + Returns: List of atom names in structure. + """ + if ip is None: + rv = pdffit2.get_atoms(self._handle) + else: + rv = pdffit2.get_atoms(self._handle, ip) + return rv + + def get_atom_types(self, ip=None): + """get_atom_types() --> Ordered unique element symbols in the structure. + + ip -- index of phase to get the elements from (starting from 1) + when ip is not given, use current phase + + This function should only be called after a structure has been loaded. + + Raises: + pdffit2.unassignedError if no structure exists + + Returns: List of unique atom symbols as they occur in structure. + """ + if ip is None: + rv = pdffit2.get_atom_types(self._handle) + else: + rv = pdffit2.get_atom_types(self._handle, ip) + return rv + + def getpar(self, par): + """getpar(par) --> Get value of parameter. + + Raises: ValueError if parameter does not exists + """ + return pdffit2.getpar(self._handle, par) + + def fixpar(self, par): + """fixpar(par) --> Fix a parameter. + + Fixed parameters are not fitted in a refinement. Passed parameter + can be 'ALL', in which case all parameters are fixed. + + Raises: pdffit.unassignedError when parameter has not been assigned + """ + if isinstance(par, six.string_types) and par.upper() in self.selalias: + par = self.selalias[par.upper()] + pdffit2.fixpar(self._handle, par) + return + + def freepar(self, par): + """freepar(par) --> Free a parameter. + + Freed parameters are fitted in a refinement. Passed parameter + can be 'ALL', in which case all parameters are freed. + + Raises: pdffit.unassignedError when parameter has not been assigned + """ + if isinstance(par, six.string_types) and par.upper() in self.selalias: + par = self.selalias[par.upper()] + pdffit2.freepar(self._handle, par) + return + + def setphase(self, ip): + """setphase(ip) --> Switch to phase ip. + + ip -- index of the phase starting at 1. + + All parameters assigned after this method is called refer only to the + current phase. + + Raises: pdffit.unassignedError when phase does not exist + """ + pdffit2.setphase(self._handle, ip) + return + + def setdata(self, iset): + """setdata(iset) --> Set the data set in focus. + + iset -- integer index of data set starting at 1. + + Raises: pdffit.unassignedError when data set does not exist + """ + pdffit2.setdata(self._handle, iset) + return + + def psel(self, ip): + """psel(ip) --> Include phase ip in calculation of total PDF + + psel('ALL') selects all phases for PDF calculation. + + Raises: pdffit2.unassignedError if selected phase does not exist + """ + if isinstance(ip, six.string_types) and ip.upper() in self.selalias: + ip = self.selalias[ip.upper()] + pdffit2.psel(self._handle, ip) + return + + def pdesel(self, ip): + """pdesel(ip) --> Exclude phase ip from calculation of total PDF. + + pdesel('ALL') excludes all phases from PDF calculation. + + Raises: pdffit2.unassignedError if selected phase does not exist + """ + if isinstance(ip, six.string_types) and ip.upper() in self.selalias: + ip = self.selalias[ip.upper()] + pdffit2.pdesel(self._handle, ip) + return + + def selectAtomType(self, ip, ijchar, symbol, flag): + """Configure partial PDF - mark the specified atom type in phase ip + as included or excluded as a first or second in pair for distance + evaluation. + + ip -- phase index starting at 1 + ijchar -- 'i' or 'j' for first or second in pair + symbol -- element symbol + flag -- bool flag, True for selection, False for exclusion + + Raises: + pdffit2.unassignedError if selected phase does not exist + ValueError for invalid value of ijchar + """ + pdffit2.selectAtomType(self._handle, ip, six.b(ijchar), symbol, flag) + return + + def selectAtomIndex(self, ip, ijchar, aidx, flag): + """Configure partial PDF - mark the atom of given index in phase ip + as included or excluded as a first or second in pair for distance + evaluation. + + ip -- phase index starting at 1 + ijchar -- 'i' or 'j' for first or second in pair + aidx -- integer index of atom starting at 1 + flag -- bool flag, True for selection, False for exclusion + + Raises: + pdffit2.unassignedError if selected phase does not exist + ValueError if atom index or ijchar are invalid + """ + pdffit2.selectAtomIndex(self._handle, ip, six.b(ijchar), aidx, flag) + return + + def selectAll(self, ip, ijchar): + """Configure partial PDF - include all atoms of phase ip as first or + second element in pair for distance evaluation. + + ip -- phase index starting at 1 + ijchar -- 'i' or 'j' for first or second in pair + + Raises: + pdffit2.unassignedError if selected phase does not exist + ValueError if ijchar is invalid + """ + pdffit2.selectAll(self._handle, ip, six.b(ijchar)) + return + + def selectNone(self, ip, ijchar): + """Configure partial PDF - exclude all atoms of phase ip from first + or second element of pair distance evaluation. + + ip -- phase index starting at 1 + ijchar -- 'i' or 'j' for first or second in pair + + Raises: + pdffit2.unassignedError if selected phase does not exist + ValueError if ijchar is invalid + """ + pdffit2.selectNone(self._handle, ip, six.b(ijchar)) + return + + def bang(self, i, j, k): + """bang(i, j, k) --> Show bond angle defined by atoms i, j, k. + + No return value. Use bond_angle() to get the result. + + Raises: ValueError if selected atom(s) does not exist + pdffit.unassignedError when no structure has been loaded + """ + angle, stdev = pdffit2.bond_angle(self._handle, i, j, k) + # indices should be already checked here by bond_angle + atom_symbols = self.get_atoms() + leader = " %s (#%i) - %s (#%i) - %s (#%i) = " % ( + atom_symbols[i - 1], + i, + atom_symbols[j - 1], + j, + atom_symbols[k - 1], + k, + ) + s = leader + _format_value_std(angle, stdev) + " degrees" + print(s, file=output.stdout) + return + + def bond_angle(self, i, j, k): + """bond_angle(i, j, k) --> bond angle defined by atoms i, j, k. + Angle is calculated using the shortest ji and jk lengths with + respect to periodic boundary conditions. + + i, j, k -- atom indices starting at 1 + + Return a tuple of (angle, angle_error), both values are in degrees. + + Raises: ValueError if selected atom(s) does not exist + pdffit.unassignedError when no structure has been loaded + """ + rv = pdffit2.bond_angle(self._handle, i, j, k) + return rv + + def blen(self, *args): + """blen(i, j) --> Show bond length defined by atoms i and j. + + i -- index of the first atom starting at 1 + j -- index of the second atom starting at 1 + + No return value. Use bond_length_atoms() to retrieve result. + + Second form: + + blen(a1, a2, lb, ub) --> Show sorted lengths of all a1-a2 bonds. + + a1 -- symbol of the first element in pair or "ALL" + a2 -- symbol of the second element in pair or "ALL" + lb -- lower bond length boundary + ub -- upper bond length boundary + + No return value. Use bond_length_types() to retrieve results. + + Raises: ValueError if selected atom(s) does not exist + pdffit.unassignedError when no structure has been loaded + """ + # first form + if len(args) == 2: + dij, ddij = self.bond_length_atoms(*args[0:2]) + atom_symbols = self.get_atoms() + ij = (args[0], args[1]) + # indices were already checked in bond_length_atoms call + assert (0 <= min(ij) - 1) and (max(ij) - 1 < len(atom_symbols)) + symij = (atom_symbols[ij[0] - 1].upper(), atom_symbols[ij[1] - 1].upper()) + print(_format_bond_length(dij, ddij, ij, symij), file=output.stdout) + # second form + elif len(args) == 4: + a1, a2, lb, ub = args + try: + atom_types = self.get_atom_types() + if isinstance(a1, numbers.Integral): + a1 = atom_types[a1 - 1] + if isinstance(a2, numbers.Integral): + a2 = atom_types[a2 - 1] + except IndexError: + # index of non-existant atom type + return + # arguments are OK here, get bond length dictionary + bld = pdffit2.bond_length_types(self._handle, a1, a2, lb, ub) + s = "(%s,%s) bond lengths in [%gA,%gA] for current phase :" % (a1, a2, lb, ub) + print(s, file=output.stdout) + atom_symbols = self.get_atoms() + npts = len(bld["dij"]) + for idx in range(npts): + dij = bld["dij"][idx] + ddij = bld["ddij"][idx] + ij0 = bld["ij0"][idx] + ij1 = bld["ij1"][idx] + symij = (atom_symbols[ij0[0]], atom_symbols[ij0[1]]) + s = _format_bond_length(dij, ddij, ij1, symij) + print(s, file=output.stdout) + print(file=output.stdout) + if not bld["dij"]: + print(" *** No pairs found ***", file=output.stdout) + else: + emsg = "blen() takes 2 or 4 arguments (%i given)" % len(args) + raise TypeError(emsg) + # done + return + + def bond_length_atoms(self, i, j): + """bond_length_atoms(i, j) --> shortest distance between atoms i, j. + Periodic boundary conditions are applied to find the shortest bond. + + i -- index of the first atom starting at 1 + j -- index of the second atom starting at 1 + + Return a tuple of (distance, distance_error). + + Raises: ValueError if selected atom(s) does not exist + pdffit.unassignedError when no structure has been loaded. + """ + rv = pdffit2.bond_length_atoms(self._handle, i, j) + return rv + + def bond_length_types(self, a1, a2, lb, ub): + """bond_length_types(a1, a2, lb, ub) --> get all a1-a2 distances. + + a1 -- symbol of the first element in pair or "ALL" + a2 -- symbol of the second element in pair or "ALL" + lb -- lower bond length boundary + ub -- upper bond length boundary + + Return a dictionary of distance data containing + + dij : list of bond lenghts within given bounds + ddij : list of bond legnth standard deviations + ij0 : pairs of atom indices starting from 0 + ij1 : pairs of atom indices starting from 1 + + Raises: ValueError if selected atom(s) does not exist + pdffit.unassignedError when no structure has been loaded. + """ + rv = pdffit2.bond_length_types(self._handle, a1, a2, lb, ub) + return rv + + def show_scat(self, stype): + """show_scat(stype) --> Print scattering length for all atoms in + the current phase. + + stype -- 'X' (xray) or 'N' (neutron). + + Raises: pdffit2.unassignedError if no phase exists + """ + print(self.get_scat_string(stype), file=output.stdout) + return + + def get_scat_string(self, stype): + """get_scat_string(stype) --> Get string with scattering factors + of all atoms in the current phase. + + stype -- 'X' (xray) or 'N' (neutron). + + Raises: + pdffit2.unassignedError if no phase exists + + Returns: string with all scattering factors. + """ + return pdffit2.get_scat_string(self._handle, six.b(stype)) + + def get_scat(self, stype, element): + """get_scat(stype, element) --> Get active scattering factor for + given element. If scattering factor has been changed using + set_scat the result may depend on the active phase. When no + phase has been loaded, return the standard value. + + stype -- 'X' (xray) or 'N' (neutron). + element -- case-insensitive element symbol such as "Na" or "CL" + + Return float. + + Raises: + ValueError if element is not known. + """ + rv = pdffit2.get_scat(self._handle, six.b(stype), element) + return rv + + def set_scat(self, stype, element, value): + """set_scat(stype, element, value) --> Set custom scattering factor + for given element. The new scattering factor applies only for the + current phase, in other phases it keeps its default value. + + stype -- 'X' (xray) or 'N' (neutron). + element -- case-insensitive element symbol such as "Na" or "CL" + value -- new value of scattering factor + + No return value. + + Raises: + pdffit2.unassignedError if no phase exists. + ValueError if element is not known. + + See also reset_scat, get_scat. + """ + pdffit2.set_scat(self._handle, six.b(stype), element, value) + return + + def reset_scat(self, element): + """reset_scat(stype, element) --> Reset scattering factors for + given element to their standard values. The reset_scat applies + only for the current phase. + + element -- case-insensitive element symbol such as "Na" or "CL" + Raises: + pdffit2.unassignedError if no phase exists + ValueError if element is not known. + """ + pdffit2.reset_scat(self._handle, element) + return + + def num_atoms(self): + """num_atoms() --> Get number of atoms in current phase. + + Raises: pdffit2.unassignedError if no atoms exist + """ + return pdffit2.num_atoms(self._handle) + + def num_phases(self): + """num_phases() --> Number of phases loaded in PdfFit instance. + + Use setphase to bring a specific phase in focus. + + Return integer. + """ + n = pdffit2.num_phases(self._handle) + return n + + def num_datasets(self): + """num_datasets() --> Number of datasets loaded in PdfFit instance. + + Use setdata to bring a specific dataset in focus. + + Return integer. + """ + n = pdffit2.num_datasets(self._handle) + return n + + def phase_fractions(self): + """phase_fractions() --> relative phase fractions for current dataset. + Convert phase scale factors to relative phase fractions given the + scattering type of current dataset. + + Return a dictionary of phase fractions with following keys: + + "atom" -- list of fractions normalized to atom count + "stdatom" -- errors of atom count fractions + "cell" -- list of fractions normalized to unit cell count + "stdcell" -- errors of unit cell count fractions + "mass" -- list of relative weight fractions + "stdmass" -- errors of relative weight fractions + + Raises: pdffit2.unassignedError if no dataset exists. + """ + return pdffit2.phase_fractions(self._handle) + + # Begin refinable variables. + + def lat(n): + """lat(n) --> Get reference to lattice variable n. + + n can be an integer or a string representing the lattice variable. + 1 <==> 'a' + 2 <==> 'b' + 3 <==> 'c' + 4 <==> 'alpha' + 5 <==> 'beta' + 6 <==> 'gamma' + """ + LatParams = {"a": 1, "b": 2, "c": 3, "alpha": 4, "beta": 5, "gamma": 6} + if isinstance(n, six.string_types): + n = LatParams[n] + return "lat(%i)" % n + + lat = staticmethod(lat) + + def x(i): + """x(i) --> Get reference to x-value of atom i.""" + return "x(%i)" % i + + x = staticmethod(x) + + def y(i): + """y(i) --> Get reference to y-value of atom i.""" + return "y(%i)" % i + + y = staticmethod(y) + + def z(i): + """z(i) --> Get reference to z-value of atom i.""" + return "z(%i)" % i + + z = staticmethod(z) + + def u11(i): + """u11(i) --> Get reference to U(1,1) for atom i. + + U is the anisotropic thermal factor tensor. + """ + return "u11(%i)" % i + + u11 = staticmethod(u11) + + def u22(i): + """u22(i) --> Get reference to U(2,2) for atom i. + + U is the anisotropic thermal factor tensor. + """ + return "u22(%i)" % i + + u22 = staticmethod(u22) + + def u33(i): + """u33(i) --> Get reference to U(3,3) for atom i. + + U is the anisotropic thermal factor tensor. + """ + return "u33(%i)" % i + + u33 = staticmethod(u33) + + def u12(i): + """u12(i) --> Get reference to U(1,2) for atom i. + + U is the anisotropic thermal factor tensor. + """ + return "u12(%i)" % i + + u12 = staticmethod(u12) + + def u13(i): + """u13(i) --> Get reference to U(1,3) for atom i. + + U is the anisotropic thermal factor tensor. + """ + return "u13(%i)" % i + + u13 = staticmethod(u13) + + def u23(i): + """u23(i) --> Get reference to U(2,3) for atom i. + + U is the anisotropic thermal factor tensor. + """ + return "u23(%i)" % i + + u23 = staticmethod(u23) + + def occ(i): + """occ(i) --> Get reference to occupancy of atom i.""" + return "occ(%i)" % i + + occ = staticmethod(occ) + + def pscale(): + """pscale() --> Get reference to pscale. + + pscale is the fraction of the total structure that the current phase + represents. + """ + return "pscale" + + pscale = staticmethod(pscale) + + def sratio(): + """sratio() --> Get reference to sigma ratio. + + The sigma ratio determines the reduction in the Debye-Waller factor for + distances below rcut. + """ + return "sratio" + + sratio = staticmethod(sratio) + + def delta1(): + """delta1() --> Get reference to 1/R peak sharpening factor.""" + return "delta1" + + delta1 = staticmethod(delta1) + + def delta2(): + """delta2() --> Reference to (1/R^2) sharpening factor. + The phenomenological correlation constant in the Debye-Waller factor. + The (1/R^2) peak sharpening factor. + """ + return "delta2" + + delta2 = staticmethod(delta2) + + def dscale(): + """dscale() --> Get reference to dscale. + + The data scale factor. + """ + return "dscale" + + dscale = staticmethod(dscale) + + def qdamp(): + """qdamp() --> Get reference to qdamp. + + Qdamp controls PDF damping due to instrument Q-resolution. + """ + return "qdamp" + + qdamp = staticmethod(qdamp) + + def qbroad(): + """qbroad() --> Get reference to qbroad. + + Quadratic peak broadening factor. + """ + return "qbroad" + + qbroad = staticmethod(qbroad) + + def spdiameter(): + """spdiameter() --> Get reference to spdiameter (phase property). + + Diameter value for the spherical particle PDF correction. + Spherical envelope is not applied when spdiameter equals 0. + """ + return "spdiameter" + + spdiameter = staticmethod(spdiameter) + + def stepcut(): + """stepcut() --> Get reference to stepcut (phase property). + + stepcut is cutoff radius for empirical step-function PDF envelope. + stepcut can be used to approximate loss of pair correlations + in amorphous phase. stepcut cannot be refined. + + Step cutoff is not applied when stepcut equals 0. + """ + return "stepcut" + + stepcut = staticmethod(stepcut) + + def rcut(): + """rcut() --> Get reference to rcut. + + rcut is the value of r below which peak sharpening, defined by + the sigma ratio (sratio), applies. rcut cannot be refined. + """ + return "rcut" + + rcut = staticmethod(rcut) + + # End refinable variables. + + def __init__(self): + + self.stru_files = [] + self.data_files = [] + + self._handle = pdffit2.create() + self.intro() + return + + def __getRef(self, var_string): + """Return the actual reference to the variable in the var_string. + + This function must be called before trying to actually reference an + internal variable. See the constrain method for an example. + + Raises: + pdffit2.unassignedError if variable is not yet assigned + ValueError if variable index does not exist (e.g. lat(7)) + """ + var_string = _convertCallable(var_string) + arg_int = None + try: + method_string, arg_string = var_string.split("(") + method_string = method_string.strip() + arg_int = int(arg_string.strip(")").strip()) + except ValueError: # There is no arg_string + method_string = var_string.strip() + + f = getattr(pdffit2, method_string) + if arg_int is None: + retval = f(self._handle) + else: + retval = f(self._handle, arg_int) + return retval + + +# End of class PdfFit + + +# End of file diff --git a/src/diffpy/pdffit2/tests/ExceptionsTest.py b/src/diffpy/pdffit2/tests/ExceptionsTest.py new file mode 100644 index 00000000..5dee1b75 --- /dev/null +++ b/src/diffpy/pdffit2/tests/ExceptionsTest.py @@ -0,0 +1,794 @@ +#!/usr/bin/env python +############################################################################## +# +# pdffit2 by DANSE Diffraction group +# Simon J. L. Billinge +# (c) 2006 trustees of the Michigan State University. +# All rights reserved. +# +# File coded by: Chris Farrow +# +# See AUTHORS.txt for a list of people who contributed. +# See LICENSE.txt for license information. +# +############################################################################## + + +import unittest + +from diffpy.pdffit2 import PdfFit, pdffit2 +from diffpy.pdffit2.tests.pdffit2testutils import datafile + + +class read_structExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_IOError(self): + """raise IOError when structure file does not exist""" + self.assertRaises(IOError, self.P.read_struct, "Nofile.stru") + + def test_structureError(self): + """raise pdffit2.structureError when structure is malformed""" + self.assertRaises(pdffit2.structureError, self.P.read_struct, datafile("badNi.stru")) + + def test_structureErrorZeroVolume(self): + """raise pdffit2.structureError when unit cell volume is negative""" + # I don't know how to test for this, but it's in the library code + self.assertRaises(pdffit2.structureError, self.P.read_struct, datafile("badNiZeroVolume.stru")) + + +class read_dataExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_IOError(self): + """raise IOError when data file does not exist""" + self.assertRaises(IOError, self.P.read_data, "Nofile.dat", "X", 25.0, 0.5) + + def test_dataError(self): + """raise pdffit2.dataError when data has improper spacing""" + self.assertRaises(pdffit2.dataError, self.P.read_data, datafile("badNi.dat"), "X", 25.0, 0.5) + + +class read_data_listsExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.r_data = [0.1, 0.2] + self.Gr_data = [1, 2, 3] + self.qmax = 10 + self.qdamp = 0.5 + + def tearDown(self): + del self.P + + def test_ValueError1(self): + """raise ValueError when lists are of different length""" + self.assertRaises( + ValueError, self.P.read_data_lists, "X", self.qmax, self.qdamp, self.r_data, self.Gr_data + ) + + def test_ValueError2(self): + """raise ValueError when qmax < 0""" + self.assertRaises( + ValueError, self.P.read_data_lists, "X", -self.qmax, self.qdamp, self.r_data, self.Gr_data + ) + + def test_ValueError3(self): + """raise ValueError when qdamp < 0""" + self.assertRaises( + ValueError, self.P.read_data_lists, "X", self.qmax, -self.qdamp, self.r_data, self.Gr_data + ) + + def test_dataError(self): + """raise pdffit2.dataError when data has improper spacing""" + r_data = [0.1, 0.52, 0.2] + self.assertRaises( + pdffit2.dataError, self.P.read_data_lists, "X", self.qmax, self.qdamp, r_data, self.Gr_data + ) + + +class pdfrangeExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.iset = 1 + self.rmin = 4.0 + self.rmax = 10.0 + + def tearDown(self): + del self.P + + def test_ValueError1(self): + """raise ValueError when iset does not exist""" + self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmin, self.rmax) + + def test_ValueError2(self): + """raise ValueError when rmax < rmin""" + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmax, self.rmin) + + def test_ValueError3(self): + """raise ValueError when range outside of data""" + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.assertRaises(ValueError, self.P.pdfrange, self.iset, -self.rmin, self.rmax) + + +class allocExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.qmax = 25 + self.qdamp = 0.5 + self.rmin = 4.0 + self.rmax = 10.0 + self.bin = 100 + + def tearDown(self): + del self.P + + def test_ValueError1(self): + """raise ValueError when qmax < 0""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.alloc, "X", -self.qmax, self.qdamp, self.rmin, self.rmax, self.bin) + + def test_ValueError2(self): + """raise ValueError when qdamp < 0""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, -self.qdamp, self.rmin, self.rmax, self.bin) + + def test_ValueError3(self): + """raise ValueError when rmin < 0""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, -self.rmin, self.rmax, self.bin) + + def test_ValueError4(self): + """raise ValueError when rmax < 0""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, -self.rmax, self.bin) + + def test_ValueError5(self): + """raise ValueError when bin < 0""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) + + def test_ValueError6(self): + """raise ValueError when rmax < rmin""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmax, self.rmin, self.bin) + + def test_ValueError7(self): + """raise ValueError when qdamp < 0""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) + + +class calcExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.P.read_struct(datafile("Ni.stru")) + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when no space has been allocated""" + self.assertRaises(pdffit2.unassignedError, self.P.calc) + + +# PJ 2006-03-06 +# +# test_calculationError raised exception, because for Qmax=0.5, rmax would +# increase to 4010A and this would throw exception when the size of bnd array +# would exceed MAXBND limit. However, bnd vector can now grow, thus rmax +# is not limited and the following test would hang indefinitely. + +# def test_calculationError(self): +# """raise pdffit2.calculationError when calculation cannot be done""" +# self.P.alloc('X', 0.01, 0.5, 2, 10, 100) +# self.assertRaises(pdffit2.calculationError, self.P.calc) + + +# class refineExceptions(unittest.TestCase): +# I'm not sure how to test these + +# def setUp(self): +# self.P = PdfFit() +# +# def test_calculationError(self): +# """raise pdffit2.calculationError when model pdf can't be calculated""" +# #self.assertRaises(pdffit2.calculationError, self.P.calc) +# +# def test_constraintError(self): +# """raise pdffit2.constraintError for bad constraint(s)""" +# #self.assertRaises(pdffit2.constraintError, self.P.calc) + + +# class refine_stepExceptions(unittest.TestCase): +# I'm not sure how to test these + +# def setUp(self): +# self.P = PdfFit() +# +# def test_calculationError(self): +# """raise pdffit2.calculationError when model pdf can't be calculated""" +# #self.assertRaises(pdffit2.calculationError, self.P.calc) +# +# def test_constraintError(self): +# """raise pdffit2.constraintError for bad constraint(s)""" +# #self.assertRaises(pdffit2.constraintError, self.P.calc) + + +class save_pdfExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.strufile = "temp.pdf" + + def tearDown(self): + del self.P + + def test_IOError(self): + """raise IOError when structure cannot be saved""" + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 30.0, 0.05, 2, 10, 100) + self.P.calc() + self.assertRaises(IOError, self.P.save_pdf, 1, "nodir183160/" + self.strufile) + + def test_unassignedError(self): + """raise pdffit2.unassignedError when structure is undefined""" + self.assertRaises(pdffit2.unassignedError, self.P.save_pdf, 1, self.strufile) + + +class save_difExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.strufile = "temp.dif" + + def tearDown(self): + del self.P + + def test_IOError(self): + """raise IOError when dif cannot be saved""" + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 30.0, 0.05, 2, 10, 100) + self.P.calc() + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.assertRaises(IOError, self.P.save_dif, 1, "nodir183160/" + self.strufile) + + def test_unassignedError(self): + """raise pdffit2.unassignedError when structure is undefined""" + self.assertRaises(pdffit2.unassignedError, self.P.save_dif, 1, self.strufile) + + +class save_resExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.resfile = "temp.res" + + def tearDown(self): + del self.P + + def test_IOError(self): + """raise IOError when residual file cannot be saved""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 30.0, 0.0) + self.P.constrain(self.P.lat(1), 1) + self.P.setpar(1, 3.0) + self.P.pdfrange(1, 2.0, 10.0) + self.P.refine_step() + self.assertRaises(IOError, self.P.save_res, "nodir183160/" + self.resfile) + + def test_unassignedError(self): + """raise pdffit2.unassignedError when structure is undefined""" + self.assertRaises(pdffit2.unassignedError, self.P.save_res, self.resfile) + + +class save_structExceptions(unittest.TestCase): + # Same code as show_struct + + def setUp(self): + self.P = PdfFit() + self.strufile = "temp.stru" + + def tearDown(self): + del self.P + + def test_IOError(self): + """raise IOError when structure cannot be saved""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(IOError, self.P.save_struct, 1, "nodir183160/" + self.strufile) + + def test_unassignedError(self): + """raise pdffit2.unassignedError when structure is undefined""" + self.assertRaises(pdffit2.unassignedError, self.P.save_struct, 1, self.strufile) + + +class constrainExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.par = 1 + return + + def tearDown(self): + self.P = None + return + + def test_constraintError(self): + """raise constraintError when constraint is bad""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.constrain("x(1)", "junk+@1") + self.P.setpar(1, 0.01) + self.assertRaises(pdffit2.constraintError, self.P.calc) + self.assertRaises(pdffit2.constraintError, self.P.refine) + return + + def test_unassignedError(self): + """raise pdffit2.unassignedError when variable is undefined""" + self.assertRaises(pdffit2.unassignedError, self.P.constrain, self.P.x(1), self.par) + return + + def test_ValueError(self): + """raise ValueError when a variable index does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.constrain, self.P.x(6), self.par) + return + + def test_constrainNonRefVar(self): + "raise constraintError when attempting to constrain non-refinables" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", "@7") + self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", 13) + self.assertRaises(pdffit2.constraintError, self.P.constrain, "stepcut", "@17") + return + + +class setvarExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.val = 3.0 + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when variable is undefined""" + self.assertRaises(pdffit2.unassignedError, self.P.setvar, self.P.lat(1), self.val) + + def test_ValueError(self): + """raise ValueError when a variable index does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.setvar, self.P.lat(7), self.val) + + +class getvarExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when variable is undefined""" + self.assertRaises(pdffit2.unassignedError, self.P.getvar, self.P.pscale()) + + def test_ValueError(self): + """raise ValueError when a variable index does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.getvar, self.P.lat(7)) + + +class getRExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when data does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.getR) + + +class getpdf_fitExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when data does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.getpdf_fit) + + +class getpdf_obsExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when data does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.getpdf_obs) + + +class getpdf_diffExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when data does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.getpdf_diff) + + +class get_atomsExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when data does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.get_atoms) + + +class getparExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError1(self): + """raise pdffit2.unassignedError when parameter does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) + + def test_unassignedError2(self): + """raise pdffit2.unassignedError when parameter does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.P.constrain(self.P.lat(1), 2) + self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) + + +class pselExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.ip = 1 + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when phase does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) + + def test_unassignedError2(self): + """raise pdffit2.unassignedError when phase does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) + + +class pdeselExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.ip = 1 + + def tearDown(self): + del self.P + + def test_unassignedError1(self): + """raise pdffit2.unassignedError when phase does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) + + def test_unassignedError2(self): + """raise pdffit2.unassignedError when phase does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) + + +class selectAtomTypeExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.iset = 1 + self.i = 1 + + def tearDown(self): + del self.P + + def test_unassignedError1(self): + """raise pdffit2.unassignedError when set does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, self.iset, "i", "Ni", True) + + def test_unassignedError2(self): + """raise pdffit2.unassignedError when set does not exist""" + self.P.read_struct(datafile("Ni.stru")) + # selectAtomType should pass with one phase defined + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.selectAtomType(self.iset, "i", "Ni", True) + self.P.selectAtomType(self.iset, "j", "Ni", False) + # but fail for phase 2 which is not present + self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, 2, "i", "Ca", True) + + def test_ijcharValueError(self): + """raise ValueError when ijchar is neither 'i' nor 'j'""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.selectAtomType(self.iset, "i", "Ni", True) + self.P.selectAtomType(self.iset, "j", "Ni", True) + self.assertRaises(ValueError, self.P.selectAtomType, self.iset, "k", "Ni", True) + + +class selectAtomIndexExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.iset = 1 + self.i = 1 + + def tearDown(self): + del self.P + + def test_unassignedError1(self): + """raise pdffit2.unassignedError when set does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, self.iset, "i", self.i, True) + + def test_unassignedError2(self): + """raise pdffit2.unassignedError when set does not exist""" + self.P.read_struct(datafile("Ni.stru")) + # pass for phase 1 + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.selectAtomIndex(self.iset, "i", 1, True) + self.P.selectAtomIndex(self.iset, "i", 2, False) + # fail for phase 2 + self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, 2, "i", 1, True) + + def test_ValueError(self): + """raise ValueError when selected atom does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.assertRaises(ValueError, self.P.selectAtomIndex, self.iset, "i", 6, True) + + +class selectAllExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.iset = 1 + self.i = 1 + + def tearDown(self): + del self.P + + def test_unassignedError1(self): + """raise pdffit2.unassignedError when set does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") + + def test_unassignedError2(self): + """raise pdffit2.unassignedError when set does not exist""" + self.P.read_struct(datafile("Ni.stru")) + # fail when there is no dataset + self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") + # pass with dataset + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.selectAll(self.iset, "i") + self.P.selectAll(self.iset, "j") + # fail for phase 2 + self.assertRaises(pdffit2.unassignedError, self.P.selectAll, 2, "i") + self.assertRaises(pdffit2.unassignedError, self.P.selectAll, 2, "j") + + +class selectNoneExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.iset = 1 + self.i = 1 + + def tearDown(self): + del self.P + + def test_unassignedError1(self): + """raise pdffit2.unassignedError when set does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") + + def test_unassignedError2(self): + """raise pdffit2.unassignedError when set does not exist""" + self.P.read_struct(datafile("Ni.stru")) + # fail when there is no dataset + self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") + # pass with dataset + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.selectNone(self.iset, "i") + self.P.selectNone(self.iset, "j") + # fail for phase 2 + self.assertRaises(pdffit2.unassignedError, self.P.selectNone, 2, "i") + self.assertRaises(pdffit2.unassignedError, self.P.selectNone, 2, "j") + + +class bangExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.a1 = 1 + self.a2 = 2 + self.a3 = 3 + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when phase does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.bang, self.a1, self.a2, self.a3) + + def test_ValueError1(self): + """raise ValueError when selected atom(s) does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.assertRaises(ValueError, self.P.bang, 0, self.a2, self.a3) + + def test_ValueError2(self): + """raise ValueError when selected atom(s) does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.bang, self.a1, -1, self.a3) + + def test_ValueError3(self): + """raise ValueError when selected atom(s) does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.bang, self.a1, self.a2, 6) + + +class blenExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + self.a1 = 1 + self.a2 = 2 + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when no data exists""" + self.assertRaises(pdffit2.unassignedError, self.P.blen, self.a1, self.a2) + + def test_ValueError1(self): + """raise ValueError when selected atom(s) does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.blen, 0, self.a2) + + def test_ValueError2(self): + """raise ValueError when selected atom(s) does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.blen, self.a1, 6) + + def test_ValueError3(self): + """raise ValueError when selected atom(s) does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.assertRaises(ValueError, self.P.blen, 0, 6) + + +class show_scatExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when phase does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.show_scat, "X") + + +# class set_scatExceptions(unittest.TestCase): +# I'm not sure how to use this function + +# def setUp(self): +# self.P = PdfFit() +# +# def test_unassignedError1(self): +# """raise pdffit2.unassignedError when phase does not exist""" +# #self.assertRaises(pdffit2.constraintError, self.P.calc) +# +# def test_unassignedError2(self): +# """raise pdffit2.unassignedError when phase does not exist""" +# #self.assertRaises(pdffit2.constraintError, self.P.calc) +# +# def test_ValueError(self): +# """raise pdffit2.unassignedError when selected atom does not exist""" +# #self.assertRaises(pdffit2.constraintError, self.P.calc) + + +class num_atomsExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when no atoms exist""" + self.assertRaises(pdffit2.unassignedError, self.P.num_atoms) + + +class fixparExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when parameter does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.assertRaises(pdffit2.unassignedError, self.P.fixpar, 1) + + +class freeparExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when parameter does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.assertRaises(pdffit2.unassignedError, self.P.freepar, 1) + + +class setphaseExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when phase does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.assertRaises(pdffit2.unassignedError, self.P.setphase, 2) + + +class setdataExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when data set does not exist""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.assertRaises(pdffit2.unassignedError, self.P.setdata, 2) + + +class getcrwExceptions(unittest.TestCase): + def setUp(self): + self.P = PdfFit() + + def tearDown(self): + del self.P + + def test_unassignedError(self): + """raise pdffit2.unassignedError when data does not exist""" + self.assertRaises(pdffit2.unassignedError, self.P.getcrw) + + +# main +if __name__ == "__main__": + # suite = unittest.makeSuite(num_atomsExceptions) + # unittest.TextTestRunner(verbosity=3).run(suite) + # testcase = calcExceptions('test_unassignedError') + # unittest.TextTestRunner(verbosity=3).run(testcase) + unittest.main() + +# End of file diff --git a/src/diffpy/pdffit2/tests/TestPdfFit.py b/src/diffpy/pdffit2/tests/TestPdfFit.py new file mode 100644 index 00000000..70712356 --- /dev/null +++ b/src/diffpy/pdffit2/tests/TestPdfFit.py @@ -0,0 +1,761 @@ +#!/usr/bin/env python + +"""Unit tests for PdfFit.py +""" + +import unittest + +from diffpy.pdffit2 import PdfFit, pdffit2 +from diffpy.pdffit2.tests.pdffit2testutils import capture_output, datafile +from diffpy.structure import loadStructure + +# ---------------------------------------------------------------------------- + + +class TestPdfFit(unittest.TestCase): + places = 6 + + def setUp(self): + self.P = PdfFit() + return + + def tearDown(self): + del self.P + return + + def test__exportAll(self): + "check PdfFit._exportAll()" + ns = {} + self.P._exportAll(ns) + self.assertEqual("ALL", ns["ALL"]) + self.assertEqual("FSQR", ns["FSQR"]) + self.assertEqual("N", ns["N"]) + self.assertIs("N", ns["N"]) + self.assertIs(self.P.lat, ns["lat"]) + self.assertEqual(self.P.reset, ns["reset"]) + return + + # def test_intro(self): + # """check PdfFit.intro() + # """ + # return + + def test_add_structure(self): + """check PdfFit.add_structure()""" + ni = loadStructure(datafile("Ni.stru")) + self.P.add_structure(ni) + self.assertEqual(4, self.P.num_atoms()) + return + + # def test_read_struct(self): + # """check PdfFit.read_struct() + # """ + # return + # + # def test_read_struct_string(self): + # """check PdfFit.read_struct_string() + # """ + # return + # + # def test_read_data(self): + # """check PdfFit.read_data() + # """ + # return + + def test_read_data_string(self): + """check PdfFit.read_data_string()""" + pf = self.P + with open(datafile("300K.gr")) as fp: + s = fp.read() + self.assertEqual([], pf.data_files) + pf.read_data_string(s, "N", 32, 0.03, "lmo") + self.assertEqual(1, len(pf.data_files)) + gobs = pf.getpdf_obs() + self.assertEqual(2000, len(gobs)) + self.assertEqual(0.384, gobs[-1]) + self.assertEqual(0.03, pf.getvar("qdamp")) + return + + # def test_read_data_lists(self): + # """check PdfFit.read_data_lists() + # """ + # return + # + # def test_pdfrange(self): + # """check PdfFit.pdfrange() + # """ + # return + # + # def test_reset(self): + # """check PdfFit.reset() + # """ + # return + + def test_alloc(self): + """check PdfFit.alloc()""" + # alloc and read_struct can be called in any order. + self.P.alloc("X", 25, 0.0, 0.01, 10, 1000) + # without a structure calculated PDF is all zero + self.P.calc() + Gzero = self.P.getpdf_fit() + self.assertEqual(1000 * [0.0], Gzero) + self.P.read_struct(datafile("Ni.stru")) + self.P.calc() + # check r-values + r = self.P.getR() + self.assertEqual(1000, len(r)) + for i in range(1000): + self.assertAlmostEqual(0.01 * (i + 1), r[i], self.places) + Gfit_alloc_read = self.P.getpdf_fit() + # now try the other order + self.P.reset() + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 25, 0.0, 0.01, 10, 1000) + self.P.calc() + Gfit_read_alloc = self.P.getpdf_fit() + # and they should be the same + self.assertEqual(Gfit_read_alloc, Gfit_alloc_read) + return + + # def test_calc(self): + # """check PdfFit.calc() + # """ + # return + # + # def test_refine(self): + # """check PdfFit.refine() + # """ + # return + # + # def test_refine_step(self): + # """check PdfFit.refine_step() + # """ + # return + # + # def test_save_pdf(self): + # """check PdfFit.save_pdf() + # """ + # return + # + # def test_save_pdf_string(self): + # """check PdfFit.save_pdf_string() + # """ + # return + # + # def test_save_dif(self): + # """check PdfFit.save_dif() + # """ + # return + # + # def test_save_dif_string(self): + # """check PdfFit.save_dif_string() + # """ + # return + # + # def test_save_res(self): + # """check PdfFit.save_res() + # """ + # return + # + # def test_save_res_string(self): + # """check PdfFit.save_res_string() + # """ + # return + + def test_get_structure(self): + """check PdfFit.get_structure()""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + stru1 = self.P.get_structure(1) + self.assertEqual(4, len(stru1)) + self.assertEqual("Ni", stru1[0].element) + stru2 = self.P.get_structure(2) + self.assertEqual(56, len(stru2)) + self.assertEqual("Ti", stru2[-1].element) + return + + # def test_save_struct(self): + # """check PdfFit.save_struct() + # """ + # return + # + # def test_save_struct_string(self): + # """check PdfFit.save_struct_string() + # """ + # return + # + # def test_show_struct(self): + # """check PdfFit.show_struct() + # """ + # return + # + # def test_constrain(self): + # """check PdfFit.constrain() + # """ + # return + + def test_setpar(self): + """check PdfFit.setpar()""" + pf = self.P + pf.read_struct(datafile("Ni.stru")) + pf.setpar(1, "lat(1)") + self.assertEqual(3.52, pf.getpar(1)) + pf.setpar(1, 4.0) + self.assertEqual(4, pf.getpar(1)) + pf.setpar(1, pf.lat("a")) + self.assertEqual(3.52, pf.getpar(1)) + return + + def test_setvar(self): + """check PdfFit.setvar()""" + pf = self.P + pf.read_struct(datafile("Ni.stru")) + pf.setvar(pf.delta1, 1.2) + self.assertEqual(1.2, pf.getvar(pf.delta1)) + pf.setvar("delta1", 1.7) + self.assertEqual(1.7, pf.getvar("delta1")) + return + + # def test_getvar(self): + # """check PdfFit.getvar() + # """ + # return + # + # def test_getrw(self): + # """check PdfFit.getrw() + # """ + # return + # + # def test_getR(self): + # """check PdfFit.getR() + # """ + # return + # + # def test_getpdf_fit(self): + # """check PdfFit.getpdf_fit() + # """ + # return + # + # def test_getpdf_obs(self): + # """check PdfFit.getpdf_obs() + # """ + # return + # + # def test_getpdf_diff(self): + # """check PdfFit.getpdf_diff() + # """ + # return + + def test_get_atoms(self): + """check PdfFit.get_atoms()""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.setphase(1) + a1 = self.P.get_atoms() + a2 = self.P.get_atoms(2) + self.assertEqual(4 * ["NI"], a1) + self.assertEqual(8 * ["PB"] + 24 * ["O"] + 8 * ["SC"] + 8 * ["W"] + 8 * ["TI"], a2) + return + + def test_get_atom_types(self): + """check PdfFit.get_atom_types()""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.setphase(1) + atp1 = self.P.get_atom_types() + atp2 = self.P.get_atom_types(2) + self.assertEqual(["NI"], atp1) + self.assertEqual(["PB", "O", "SC", "W", "TI"], atp2) + return + + def test_num_phases(self): + """check PdfFit.num_phases()""" + self.assertEqual(0, self.P.num_phases()) + self.P.read_struct(datafile("Ni.stru")) + self.assertEqual(1, self.P.num_phases()) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.assertEqual(2, self.P.num_phases()) + self.P.reset() + self.assertEqual(0, self.P.num_phases()) + return + + def test_num_datasets(self): + """check PdfFit.num_datasets()""" + self.assertEqual(0, self.P.num_datasets()) + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.assertEqual(1, self.P.num_datasets()) + # failed data should not increase num_datasets + try: + self.P.read_data(datafile("badNi.dat")) + except (RuntimeError, TypeError, NameError, ValueError, IOError): + pass + self.assertEqual(1, self.P.num_datasets()) + # alloc should increase number of datasets + # alloc requires a loaded structure + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 30.0, 0.05, 2, 10, 100) + self.assertEqual(2, self.P.num_datasets()) + self.P.reset() + self.assertEqual(0, self.P.num_datasets()) + return + + def test_getcrw(self): + """check PdfFit.getcrw()""" + import numpy + + self.assertEqual(0, self.P.num_datasets()) + # Setting qmax=0 so that partial crw are not disturbed by + # termination ripples. + self.P.read_data(datafile("Ni.dat"), "X", 0.0, 0.0) + # crw is empty before data refinement + self.assertEqual([], self.P.getcrw()) + self.P.read_struct(datafile("Ni.stru")) + self.P.pdfrange(1, 2, 19) + self.P.refine() + crw19 = numpy.array(self.P.getcrw()) + self.assertTrue(numpy.all(crw19 >= 0.0)) + # check that crw19 is non decreasing + self.assertTrue(numpy.all(numpy.diff(crw19) >= 0.0)) + # check that crw19 and getrw give the same value + rw19 = crw19[-1] + self.assertAlmostEqual(self.P.getrw(), rw19, self.places) + # renormalize cumulative Rw and compare with Rw at r=15 + Gobs19 = numpy.array(self.P.getpdf_obs()) + Gnorm19 = numpy.sqrt(numpy.sum(Gobs19**2)) + r = numpy.array(self.P.getR()) + idx = numpy.nonzero(r <= 15)[0] + Gnorm15 = numpy.sqrt(numpy.sum(Gobs19[idx] ** 2)) + i15 = idx[-1] + rw15 = crw19[i15] * Gnorm19 / Gnorm15 + self.P.pdfrange(1, 2, r[i15] + 1e-5) + self.P.refine() + self.assertAlmostEqual(self.P.getrw(), rw15, self.places) + return + + def test_getcrw_two_datasets(self): + """check that getcrw() and getrw() are consistent for two datasets.""" + self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.pdfrange(1, 2, 8) + self.P.read_data(datafile("300K.gr"), "N", 32.0, 0.0) + self.P.pdfrange(2, 1, 11) + self.P.read_struct(datafile("Ni.stru")) + # mess lattice parameters to have comparable Rw contributions + self.P.setvar("lat(1)", 3) + self.P.setvar("lat(2)", 3) + self.P.setvar("lat(3)", 3) + self.P.refine() + rwtot = self.P.getrw() + self.assertTrue(rwtot > 0.0) + self.P.setdata(1) + rw1 = self.P.getcrw()[-1] + self.P.setdata(2) + rw2 = self.P.getcrw()[-1] + self.assertAlmostEqual(rwtot**2, rw1**2 + rw2**2, self.places) + return + + # def test_getpar(self): + # """check PdfFit.getpar() + # """ + # return + + def test_fixpar(self): + """check PdfFit.fixpar()""" + self.P.fixpar("all") + self.assertRaises(TypeError, self.P.fixpar, "x") + return + + def test_freepar(self): + """check PdfFit.freepar()""" + self.P.freepar("all") + self.assertRaises(TypeError, self.P.freepar, "x") + return + + # def test_setphase(self): + # """check PdfFit.setphase() + # """ + # return + # + # def test_setdata(self): + # """check PdfFit.setdata() + # """ + # return + # + def test_psel(self): + """check PdfFit.psel()""" + + def doalloc(): + self.P.alloc("X", 30.0, 0.05, 2, 10, 100) + return + + self.assertRaises(pdffit2.unassignedError, self.P.psel, 0) + self.assertRaises(pdffit2.unassignedError, self.P.psel, 1) + self.P.read_struct(datafile("Ni.stru")) + doalloc() + self.P.calc() + G1 = self.P.getpdf_fit() + self.P.reset() + self.P.read_struct(datafile("PbScW25TiO3.stru")) + doalloc() + self.P.calc() + G2 = self.P.getpdf_fit() + self.P.reset() + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + doalloc() + self.P.pdesel("ALL") + self.P.psel(1) + self.P.calc() + self.assertEqual(G1, self.P.getpdf_fit()) + self.P.pdesel("ALL") + self.P.psel(2) + self.P.calc() + self.assertEqual(G2, self.P.getpdf_fit()) + self.P.psel("ALL") + self.P.calc() + Gall = self.P.getpdf_fit() + dGmax = max([abs(g1 + g2 - gall) for g1, g2, gall in zip(G1, G2, Gall)]) + self.assertAlmostEqual(0, dGmax, self.places) + self.assertRaises(pdffit2.unassignedError, self.P.psel, 10) + self.assertRaises(pdffit2.unassignedError, self.P.psel, 0) + self.assertRaises(pdffit2.unassignedError, self.P.psel, -100) + return + + def test_pdesel(self): + """check PdfFit.pdesel()""" + + def doalloc(): + self.P.alloc("X", 30.0, 0.05, 2, 10, 100) + return + + self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 0) + self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 1) + self.P.read_struct(datafile("Ni.stru")) + doalloc() + self.P.calc() + G1 = self.P.getpdf_fit() + self.P.reset() + self.P.read_struct(datafile("PbScW25TiO3.stru")) + doalloc() + self.P.calc() + G2 = self.P.getpdf_fit() + self.P.reset() + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + doalloc() + self.P.psel("ALL") + self.P.pdesel(2) + self.P.calc() + self.assertEqual(G1, self.P.getpdf_fit()) + self.P.psel("ALL") + self.P.pdesel(1) + self.P.calc() + self.assertEqual(G2, self.P.getpdf_fit()) + self.P.pdesel("ALL") + self.P.calc() + G0 = self.P.getpdf_fit() + self.assertEqual([0.0] * len(G0), G0) + self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 10) + self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 0) + self.assertRaises(pdffit2.unassignedError, self.P.pdesel, -100) + return + + # + # def test_selectAtomType(self): + # """check PdfFit.selectAtomType() + # """ + # return + # + # def test_selectAtomIndex(self): + # """check PdfFit.selectAtomIndex() + # """ + # return + # + # def test_selectAll(self): + # """check PdfFit.selectAll() + # """ + # return + # + # def test_selectNone(self): + # """check PdfFit.selectNone() + # """ + # return + + def test_bond_angle(self): + """check PdfFit.bond_angle()""" + self.P.read_struct(datafile("Ni.stru")) + a, e = self.P.bond_angle(1, 2, 3) + self.assertAlmostEqual(60.0, a, self.places) + self.assertRaises(ValueError, self.P.bond_angle, 0, 1, 2) + self.assertRaises(ValueError, self.P.bond_angle, 1, 2, 7) + return + + def test_bang(self): + "check PdfFit.bang() function" + self.P.read_struct(datafile("Ni.stru")) + out = capture_output(self.P.bang, 1, 2, 3).strip() + self.assertTrue(out.endswith("60 degrees")) + self.assertTrue(out.startswith("NI (#1) - NI (#2) - NI (#3)")) + return + + def test_bond_length_atoms(self): + """check PdfFit.bond_length_atoms()""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + dij, ddij = self.P.bond_length_atoms(1, 5) + self.assertAlmostEqual(4.03635, dij, self.places) + self.P.setphase(1) + self.assertRaises(ValueError, self.P.bond_length_atoms, 1, 5) + return + + def test_bond_length_types(self): + """check PdfFit.bond_length_types()""" + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + dPbO = self.P.bond_length_types("Pb", "O", 0.1, 3.0) + # check if keys are present + self.assertTrue("dij" in dPbO) + self.assertTrue("ddij" in dPbO) + self.assertTrue("ij0" in dPbO) + self.assertTrue("ij1" in dPbO) + # check if they have the same length + npts = len(dPbO["dij"]) + self.assertEqual(npts, len(dPbO["ddij"])) + self.assertEqual(npts, len(dPbO["ij0"])) + self.assertEqual(npts, len(dPbO["ij1"])) + # 8 Pb atoms have coordination 12 in perovskite structure + self.assertEqual(8 * 12, len(dPbO["dij"])) + self.P.setphase(1) + dfcc = self.P.bond_length_types("ALL", "ALL", 0.1, 2.6) + # 4 Ni atoms with coordination 12 + self.assertEqual(4 * 12, len(dfcc["dij"])) + # invalid element + self.assertRaises(ValueError, self.P.bond_length_types, "Ni", "Nix", 0.1, 5.0) + # check indices ij0 + allij0 = sum(dfcc["ij0"], tuple()) + self.assertEqual(0, min(allij0)) + self.assertEqual(3, max(allij0)) + # check indices ij1 + allij1 = sum(dfcc["ij1"], tuple()) + self.assertEqual(1, min(allij1)) + self.assertEqual(4, max(allij1)) + # check index values + ij0check = [(i1 - 1, j1 - 1) for i1, j1 in dfcc["ij1"]] + self.assertEqual(ij0check, dfcc["ij0"]) + # test valid element which is not present in the structure + dnone = self.P.bond_length_types("Ni", "Au", 0.1, 5.0) + self.assertEqual(0, len(dnone["dij"])) + self.assertEqual(0, len(dnone["ddij"])) + self.assertEqual(0, len(dnone["ij0"])) + self.assertEqual(0, len(dnone["ij1"])) + return + + def test_blen(self): + """check PdfFit.blen()""" + self.P.read_struct(datafile("PbScW25TiO3.stru")) + blen = self.P.blen + o = capture_output(blen, 1, 5).strip() + self.assertTrue(o.endswith("4.03635 A")) + self.assertTrue("PB (#1)" in o) + self.assertTrue("PB (#5)" in o) + self.assertRaises(ValueError, blen, 1, 99) + self.assertRaises(ValueError, blen, 0, 1) + o1 = capture_output(blen, 1, 1, 0.1, 1) + self.assertTrue("No pairs found" in o1) + o2 = capture_output(blen, 1, 50, 0.1, 1) + self.assertEqual("", o2) + o3 = capture_output(blen, "Sc", "O", 0.5, 2.3).strip() + self.assertEqual(1 + 48, len(o3.split("\n"))) + self.assertEqual(6, o3.count("SC (#33)")) + self.assertEqual(2, o3.count("O (#9)")) + self.assertRaises(TypeError, blen, "Sc", "O", 0.5) + return + + # def test_show_scat(self): + # """check PdfFit.show_scat() + # """ + # return + # + # def test_get_scat_string(self): + # """check PdfFit.get_scat_string() + # """ + # return + + def test_get_scat(self): + """check PdfFit.get_scat()""" + # x-ray scattering factors + fPb = self.P.get_scat("X", "Pb") + self.assertEqual(82.0, fPb) + fTi = self.P.get_scat("X", "tI") + self.assertEqual(22.0, fTi) + # neutron scattering lengths + bPb = self.P.get_scat("N", "PB") + self.assertAlmostEqual(9.401, bPb, 3) + bTi = self.P.get_scat("N", "ti") + self.assertAlmostEqual(-3.370, bTi, 3) + # exceptions + self.assertRaises(ValueError, self.P.get_scat, "N", "zz") + self.assertRaises(ValueError, self.P.get_scat, "Z", "Ti") + return + + def test_set_scat(self): + """check PdfFit.set_scat()""" + # raises exception when no phase exists + self.assertRaises(pdffit2.unassignedError, self.P.set_scat, "N", "Ti", -11) + # check if it is local to phase + fPb = self.P.get_scat("X", "Pb") + bPb = self.P.get_scat("N", "Pb") + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.set_scat("X", "Pb", 142) + self.assertEqual(142, self.P.get_scat("X", "Pb")) + self.assertEqual(bPb, self.P.get_scat("N", "Pb")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.assertEqual(fPb, self.P.get_scat("X", "Pb")) + self.P.setphase(1) + self.assertEqual(142, self.P.get_scat("X", "Pb")) + self.P.setphase(2) + self.assertEqual(fPb, self.P.get_scat("X", "Pb")) + # check exception for invalid inputs + self.assertRaises(ValueError, self.P.set_scat, "Z", "C", 123) + self.assertRaises(ValueError, self.P.set_scat, "X", "ZZ", 123) + return + + def test_reset_scat(self): + """check PdfFit.reset_scat()""" + # raises exception when no phase exists + self.assertRaises(pdffit2.unassignedError, self.P.reset_scat, "Ti") + # check if it is local to phase + fPb = self.P.get_scat("X", "Pb") + bPb = self.P.get_scat("N", "Pb") + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.set_scat("X", "Pb", 142) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.set_scat("N", "Pb", -17) + self.P.setphase(1) + self.assertNotEqual(fPb, self.P.get_scat("X", "Pb")) + self.P.reset_scat("Pb") + self.assertEqual(fPb, self.P.get_scat("X", "Pb")) + self.P.setphase(2) + self.assertNotEqual(bPb, self.P.get_scat("N", "Pb")) + self.P.reset_scat("Pb") + self.assertEqual(bPb, self.P.get_scat("N", "Pb")) + # check exception for invalid inputs + self.assertRaises(ValueError, self.P.reset_scat, "Zz") + return + + def test_num_atoms(self): + """check PdfFit.num_atoms()""" + self.P.read_struct(datafile("Ni.stru")) + self.assertEqual(4, self.P.num_atoms()) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.assertEqual(56, self.P.num_atoms()) + self.P.setphase(1) + self.assertEqual(4, self.P.num_atoms()) + self.P.setphase(2) + self.assertEqual(56, self.P.num_atoms()) + return + + def test_lat(self): + """check PdfFit.lat()""" + pf = self.P + pf.read_struct(datafile("Ni.stru")) + for i in ("a", "b", "c", 1, 2, 3): + self.assertEqual(3.52, pf.getvar(pf.lat(i))) + for i in ("alpha", "beta", "gamma", 4, 5, 6): + self.assertEqual(90, pf.getvar(pf.lat(i))) + return + + def test_xyz(self): + """check PdfFit.x() PdfFit.y(), PdfFit.z()""" + pf = self.P + pf.read_struct(datafile("Ni.stru")) + self.assertEqual(0.5, pf.getvar(pf.x(3))) + self.assertEqual(0, pf.getvar(pf.y(3))) + self.assertEqual(0.5, pf.getvar(pf.z(3))) + return + + def test_uij(self): + """check PdfFit.uij()""" + ni = loadStructure(datafile("Ni.stru")) + ni[2].anisotropy = True + ni[2].U11, ni[2].U22, ni[2].U33 = 1, 2, 3 + ni[2].U12, ni[2].U13, ni[2].U23 = 4, 5, 6 + pf = self.P + pf.add_structure(ni) + self.assertEqual(1, pf.getvar(pf.u11(3))) + self.assertEqual(2, pf.getvar(pf.u22(3))) + self.assertEqual(3, pf.getvar(pf.u33(3))) + self.assertEqual(4, pf.getvar(pf.u12(3))) + self.assertEqual(5, pf.getvar(pf.u13(3))) + self.assertEqual(6, pf.getvar(pf.u23(3))) + return + + def test_occ(self): + """check PdfFit.occ()""" + pf = self.P + pf.read_struct(datafile("Ni.stru")) + for i in range(1, 5): + self.assertEqual(1, pf.getvar(pf.occ(i))) + return + + +# def test_pscale(self): +# """check PdfFit.pscale() +# """ +# return +# +# def test_pscale(self): +# """check PdfFit.pscale() +# """ +# return +# +# def test_sratio(self): +# """check PdfFit.sratio() +# """ +# return +# +# def test_delta1(self): +# """check PdfFit.delta1() +# """ +# return +# +# def test_delta2(self): +# """check PdfFit.delta2() +# """ +# return +# +# def test_dscale(self): +# """check PdfFit.dscale() +# """ +# return +# +# def test_qdamp(self): +# """check PdfFit.qdamp() +# """ +# return +# +# def test_qbroad(self): +# """check PdfFit.qbroad() +# """ +# return +# +# def test_rcut(self): +# """check PdfFit.rcut() +# """ +# return +# +# def test___init__(self): +# """check PdfFit.__init__() +# """ +# return +# +# def test__PdfFit__getRef(self): +# """check PdfFit._PdfFit__getRef() +# """ +# return + +# End of class TestPdfFit + +if __name__ == "__main__": + unittest.main() + +# End of file diff --git a/src/diffpy/pdffit2/tests/TestPhaseFractions.py b/src/diffpy/pdffit2/tests/TestPhaseFractions.py new file mode 100644 index 00000000..afc57c06 --- /dev/null +++ b/src/diffpy/pdffit2/tests/TestPhaseFractions.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python + +"""Unit tests for phase fraction calculations. +""" + +import unittest + +from diffpy.pdffit2 import PdfFit +from diffpy.pdffit2.tests.pdffit2testutils import datafile + + +############################################################################## +class TestPhaseFractions(unittest.TestCase): + places = 4 + + def setUp(self): + self.P = PdfFit() + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.alloc("N", 0.0, 0.05, 0.1, 10, 200) + return + + def tearDown(self): + del self.P + return + + def test_xray_fractions(self): + """test_xray_fractions -- check phase fractions in x-ray dataset.""" + self.P.setdata(1) + ph = self.P.phase_fractions() + bb1 = 28**2 + bb2 = ((8 * 82 + 24 * 8 + 4 * 21 + 2 * 74 + 2 * 22) / 40.0) ** 2 + self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) + self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) + self.assertAlmostEqual(1.0, sum(ph["mass"]), self.places) + self.assertAlmostEqual(bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places) + self.assertAlmostEqual(bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places) + mavg1 = 58.69 + mavg2 = (8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90) / 40.0 + self.assertAlmostEqual(bb2 / bb1 * mavg1 / mavg2, ph["mass"][0] / ph["mass"][1], self.places) + self.assertEqual(0.0, sum(ph["stdatom"])) + self.assertEqual(0.0, sum(ph["stdcell"])) + self.assertEqual(0.0, sum(ph["stdmass"])) + self.P.setphase(1) + self.P.setvar("pscale", 2.0) + ph2 = self.P.phase_fractions() + self.assertAlmostEqual(1.0, sum(ph2["atom"]), self.places) + self.assertAlmostEqual(1.0, sum(ph2["cell"]), self.places) + self.assertAlmostEqual(1.0, sum(ph2["mass"]), self.places) + self.assertAlmostEqual(2.0, ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), self.places) + self.assertAlmostEqual(2.0, ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), self.places) + self.assertAlmostEqual(2.0, ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), self.places) + return + + def test_neutron_fractions(self): + """test_neutron_fractions -- check phase fractions in neutron dataset.""" + self.P.setdata(2) + ph = self.P.phase_fractions() + bb1 = 10.31**2 + bPb = 9.4012 + bO = 5.8054 + bSc = 12.11 + bW = 4.75518 + bTi = -3.37013 + bb2 = ((8 * bPb + 24 * bO + 4 * bSc + 2 * bW + 2 * bTi) / 40.0) ** 2 + self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) + self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) + self.assertAlmostEqual(1.0, sum(ph["mass"]), self.places) + self.assertAlmostEqual(bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places) + self.assertAlmostEqual(bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places) + mavg1 = 58.69 + mavg2 = (8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90) / 40.0 + self.assertAlmostEqual(bb2 / bb1 * mavg1 / mavg2, ph["mass"][0] / ph["mass"][1], self.places) + self.assertEqual(0.0, sum(ph["stdatom"])) + self.assertEqual(0.0, sum(ph["stdcell"])) + self.assertEqual(0.0, sum(ph["stdmass"])) + self.P.setphase(1) + self.P.setvar("pscale", 2.0) + ph2 = self.P.phase_fractions() + self.assertAlmostEqual(1.0, sum(ph2["atom"]), self.places) + self.assertAlmostEqual(1.0, sum(ph2["cell"]), self.places) + self.assertAlmostEqual(1.0, sum(ph2["mass"]), self.places) + self.assertAlmostEqual(2.0, ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), self.places) + self.assertAlmostEqual(2.0, ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), self.places) + self.assertAlmostEqual(2.0, ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), self.places) + return + + +# End of class TestSphereEnvelope + +if __name__ == "__main__": + unittest.main() + +# End of file diff --git a/src/diffpy/pdffit2/tests/TestShapeFactors.py b/src/diffpy/pdffit2/tests/TestShapeFactors.py new file mode 100644 index 00000000..1eaa9711 --- /dev/null +++ b/src/diffpy/pdffit2/tests/TestShapeFactors.py @@ -0,0 +1,274 @@ +#!/usr/bin/env python + +"""Unit tests for particle shape envelope factors. +""" + + +import unittest + +import numpy + +from diffpy.pdffit2 import PdfFit, pdffit2 +from diffpy.pdffit2.tests.pdffit2testutils import datafile + + +def spherefactor(r, d): + """Calculate spherical envelope correction + + r -- PDF radius + d -- diameter of spherical particle + + Return numpy array of shape correction envelope. + """ + r1 = numpy.array(r) + fsph = 1.0 - 1.5 * r1 / d + 0.5 * (r1 / d) ** 3 + fsph[r1 > d] = 0.0 + return fsph + + +############################################################################## +class TestSphereEnvelope(unittest.TestCase): + + places = 6 + + def setUp(self): + self.P = PdfFit() + return + + def tearDown(self): + self.P = None + return + + def test_calculation(self): + """check calculation of sphere envelope factor""" + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.calc() + d = 8.0 + r = numpy.array(self.P.getR()) + G0 = numpy.array(self.P.getpdf_fit()) + self.P.setvar("spdiameter", d) + self.P.calc() + G1 = numpy.array(self.P.getpdf_fit()) + dG = G0 * spherefactor(r, d) - G1 + msd = numpy.dot(dG, dG) / len(r) + self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) + return + + def test_refinement(self): + """check refinement of sphere envelope factor""" + dcheck = 8.0 + dstart = 12.0 + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("spdiameter", dcheck) + self.P.calc() + r = numpy.array(self.P.getR()) + Gd8 = numpy.array(self.P.getpdf_fit()) + Gd8noise = Gd8 + Gd8noise[::2] += 0.01 + Gd8noise[1::2] -= 0.01 + self.P.reset() + self.P.read_struct(datafile("Ni.stru")) + self.P.read_data_lists("X", 0.0, 0.05, list(r), list(Gd8noise)) + self.P.constrain("spdiameter", "@8") + self.P.setpar(8, dstart) + self.P.refine() + dfinal = self.P.getvar("spdiameter") + self.assertAlmostEqual(dcheck, dfinal, 3) + return + + def test_twophase_calculation(self): + """check PDF calculation for 2 phases with different spdiameters""" + d1 = 6 + d2 = 9 + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("spdiameter", d1) + self.P.calc() + G1 = numpy.array(self.P.getpdf_fit()) + self.P.reset() + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("spdiameter", d2) + self.P.calc() + G2 = numpy.array(self.P.getpdf_fit()) + self.P.reset() + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setphase(1) + self.P.setvar("spdiameter", d1) + self.P.setphase(2) + self.P.setvar("spdiameter", d2) + self.P.calc() + Gtot = numpy.array(self.P.getpdf_fit()) + dG = G1 + G2 - Gtot + r = numpy.array(self.P.getR()) + msd = numpy.dot(dG, dG) / len(r) + self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) + return + + def test_twophase_refinement(self): + """check PDF refinement of 2 phases that have different spdiameter.""" + dcheck1 = 8.0 + dstart1 = 8.2 + dcheck2 = 6.0 + dstart2 = 5.5 + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("spdiameter", dcheck1) + self.P.calc() + G1 = numpy.array(self.P.getpdf_fit()) + self.P.reset() + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("spdiameter", dcheck2) + self.P.calc() + G2 = numpy.array(self.P.getpdf_fit()) + r = numpy.array(self.P.getR()) + Gnoise = G1 + G2 + Gnoise[::2] += 0.01 + Gnoise[1::2] -= 0.01 + self.P.reset() + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_data_lists("X", 0.0, 0.05, list(r), list(Gnoise)) + self.P.setphase(1) + self.P.constrain("spdiameter", "@11") + self.P.setphase(2) + self.P.constrain("spdiameter", "@12") + self.P.setpar(11, dstart1) + self.P.setpar(12, dstart2) + self.P.refine() + dfinal2 = self.P.getvar("spdiameter") + self.P.setphase(1) + dfinal1 = self.P.getvar("spdiameter") + self.assertAlmostEqual(dcheck1, dfinal1, 3) + self.assertAlmostEqual(dcheck2, dfinal2, 3) + return + + def test_spdiameter_io(self): + """Check reading and writing of spdiameter from structure file.""" + import re + + self.P.read_struct(datafile("Ni.stru")) + self.assertEqual(0.0, self.P.getvar("spdiameter")) + # engine should not write shape factor when not defined + spdnone = self.P.save_struct_string(1) + self.assertTrue(not re.search("(?m)^shape +sphere,", spdnone)) + self.P.setvar("spdiameter", 7) + spd7 = self.P.save_struct_string(1) + # spd7 should contain shape factor data + self.assertTrue(re.search("(?m)^shape +sphere,", spd7)) + self.P.reset() + self.P.read_struct_string(spd7) + self.assertEqual(7.0, self.P.getvar("spdiameter")) + # try to read without comma + spd14 = re.sub("(?m)^shape +sphere.*$", "shape sphere 14.00", spd7) + self.P.read_struct_string(spd14) + self.assertEqual(14.0, self.P.getvar("spdiameter")) + # try to read invalid shape data + sinvalid = re.sub("(?m)^shape .*", "shape invalid, 1", spd7) + self.assertRaises(pdffit2.structureError, self.P.read_struct_string, sinvalid) + return + + +# End of class TestSphereEnvelope + + +############################################################################## +class TestStepCutEnvelope(unittest.TestCase): + + places = 6 + + def setUp(self): + self.P = PdfFit() + return + + def tearDown(self): + self.P = None + return + + def test_stepcut_calculation(self): + """check calculation of sphere envelope factor""" + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.calc() + stepcut = 8.0 + r = numpy.array(self.P.getR()) + G0 = numpy.array(self.P.getpdf_fit()) + G0[r > stepcut] = 0.0 + self.P.setvar("stepcut", stepcut) + self.P.calc() + G1 = numpy.array(self.P.getpdf_fit()) + dG = G0 - G1 + msd = numpy.dot(dG, dG) / len(r) + self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) + return + + def test_twophase_stepcut_calculation(self): + """check PDF calculation for 2 phases with different spdiameters""" + d1 = 6 + d2 = 9 + self.P.read_struct(datafile("Ni.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("stepcut", d1) + self.P.calc() + G1 = numpy.array(self.P.getpdf_fit()) + self.P.reset() + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setvar("stepcut", d2) + self.P.calc() + G2 = numpy.array(self.P.getpdf_fit()) + self.P.reset() + self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) + self.P.setphase(1) + self.P.setvar("stepcut", d1) + self.P.setphase(2) + self.P.setvar("stepcut", d2) + self.P.calc() + Gtot = numpy.array(self.P.getpdf_fit()) + dG = G1 + G2 - Gtot + r = numpy.array(self.P.getR()) + msd = numpy.dot(dG, dG) / len(r) + self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) + # G after step should be zero + self.assertTrue(numpy.all(0 == Gtot[r > max(d1, d2)])) + return + + def test_stepcut_io(self): + """Check reading and writing of stepcut from structure file.""" + import re + + self.P.read_struct(datafile("Ni.stru")) + self.assertEqual(0.0, self.P.getvar("stepcut")) + # engine should not write shape factor when not defined + sscnone = self.P.save_struct_string(1) + self.assertTrue(not re.search("(?m)^shape +stepcut,", sscnone)) + self.P.setvar("stepcut", 7) + ssc7 = self.P.save_struct_string(1) + # ssc7 should contain shape factor data + self.assertTrue(re.search("(?m)^shape +stepcut,", ssc7)) + self.P.reset() + self.P.read_struct_string(ssc7) + self.assertEqual(7.0, self.P.getvar("stepcut")) + # try to read without comma + ssc14 = re.sub("(?m)^shape +stepcut.*$", "shape stepcut 14.00", ssc7) + self.P.read_struct_string(ssc14) + self.assertEqual(14.0, self.P.getvar("stepcut")) + # try to read invalid shape data + sinvalid = re.sub("(?m)^shape .*", "shape invalid, 1", ssc7) + self.assertRaises(pdffit2.structureError, self.P.read_struct_string, sinvalid) + return + + +# End of class TestStepCutEnvelope + +if __name__ == "__main__": + unittest.main() + +# End of file diff --git a/src/diffpy/pdffit2/tests/__init__.py b/src/diffpy/pdffit2/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/diffpy/pdffit2/tests/conftest.py b/src/diffpy/pdffit2/tests/conftest.py new file mode 100644 index 00000000..e3b63139 --- /dev/null +++ b/src/diffpy/pdffit2/tests/conftest.py @@ -0,0 +1,19 @@ +import json +from pathlib import Path + +import pytest + + +@pytest.fixture +def user_filesystem(tmp_path): + base_dir = Path(tmp_path) + home_dir = base_dir / "home_dir" + home_dir.mkdir(parents=True, exist_ok=True) + cwd_dir = base_dir / "cwd_dir" + cwd_dir.mkdir(parents=True, exist_ok=True) + + home_config_data = {"username": "home_username", "email": "home@email.com"} + with open(home_dir / "diffpyconfig.json", "w") as f: + json.dump(home_config_data, f) + + yield tmp_path diff --git a/src/diffpy/pdffit2/tests/debug.py b/src/diffpy/pdffit2/tests/debug.py new file mode 100644 index 00000000..3e30239f --- /dev/null +++ b/src/diffpy/pdffit2/tests/debug.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +############################################################################## +# +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. +# +# File coded by: Billinge Group members and community contributors. +# +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors +# +# See LICENSE.rst for license information. +# +############################################################################## + +""" +Convenience module for debugging the unit tests using + +python -m diffpy.pdffit2.tests.debug + +Exceptions raised by failed tests or other errors are not caught. +""" + + +if __name__ == "__main__": + import sys + + from diffpy.pdffit2.tests import testsuite + + pattern = sys.argv[1] if len(sys.argv) > 1 else "" + suite = testsuite(pattern) + suite.debug() + + +# End of file diff --git a/src/diffpy/pdffit2/tests/pdffit2testutils.py b/src/diffpy/pdffit2/tests/pdffit2testutils.py new file mode 100644 index 00000000..ce61aa16 --- /dev/null +++ b/src/diffpy/pdffit2/tests/pdffit2testutils.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +############################################################################## +# +# diffpy.srreal by DANSE Diffraction group +# Simon J. L. Billinge +# (c) 2010 Trustees of the Columbia University +# in the City of New York. All rights reserved. +# +# File coded by: Pavol Juhas +# +# See AUTHORS.txt for a list of people who contributed. +# See LICENSE.txt for license information. +# +############################################################################## + +"""Helper routines for running other unit tests. +Import of this module suppresses the chatty output from the C++ extension. +""" + + +import os.path + +import six + +import diffpy.pdffit2 + +# silence the C++ engine output +diffpy.pdffit2.redirect_stdout(open(os.path.devnull, "w")) + +# path variables +thisfile = locals().get("__file__", "file.py") +tests_dir = os.path.dirname(os.path.abspath(thisfile)) +testdata_dir = os.path.join(tests_dir, "testdata") + + +def datafile(filename): + """prepend testdata_dir to filename.""" + return os.path.join(testdata_dir, filename) + + +def capture_output(f, *args, **kwargs): + """Capture output from pdffit2 engine produced in function call.""" + savestdout = diffpy.pdffit2.output.stdout + fp = six.StringIO() + diffpy.pdffit2.redirect_stdout(fp) + try: + f(*args, **kwargs) + finally: + diffpy.pdffit2.redirect_stdout(savestdout) + return fp.getvalue() + + +# End of file diff --git a/src/diffpy/pdffit2/tests/run.py b/src/diffpy/pdffit2/tests/run.py new file mode 100644 index 00000000..463f010e --- /dev/null +++ b/src/diffpy/pdffit2/tests/run.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +############################################################################## +# +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. +# +# File coded by: Billinge Group members and community contributors. +# +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors +# +# See LICENSE.rst for license information. +# +############################################################################## +"""Convenience module for executing all unit tests with +python -m diffpy.pdffit2.tests.run +""" + +import sys + +import pytest + +if __name__ == "__main__": + # show output results from every test function + args = ["-v"] + # show the message output for skipped and expected failure tests + if len(sys.argv) > 1: + args.extend(sys.argv[1:]) + print("pytest arguments: {}".format(args)) + # call pytest and exit with the return code from pytest + exit_res = pytest.main(args) + sys.exit(exit_res) + +# End of file diff --git a/src/diffpy/pdffit2/tests/rundeps.py b/src/diffpy/pdffit2/tests/rundeps.py new file mode 100644 index 00000000..038475ae --- /dev/null +++ b/src/diffpy/pdffit2/tests/rundeps.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python +############################################################################## +# +# diffpy.pdffit2 by DANSE Diffraction group +# Simon J. L. Billinge +# (c) 2012 Trustees of the Columbia University +# in the City of New York. All rights reserved. +# +# File coded by: Pavol Juhas +# +# See AUTHORS.txt for a list of people who contributed. +# See LICENSE.txt for license information. +# +############################################################################## + +"""Convenience module for executing unit tests for all pdffit2 dependencies + +python -m diffpy.pdffit2.tests.rundeps +""" + + +if __name__ == "__main__": + import sys + + from diffpy.pdffit2.tests import testdeps + + # produce zero exit code for a successful test + sys.exit(not testdeps().wasSuccessful()) + +# End of file diff --git a/src/diffpy/pdffit2/tests/testdata/300K.gr b/src/diffpy/pdffit2/tests/testdata/300K.gr new file mode 100644 index 00000000..15578911 --- /dev/null +++ b/src/diffpy/pdffit2/tests/testdata/300K.gr @@ -0,0 +1,2062 @@ +History written: Fri Apr 30 13:05:36 2004 +produced by +##### Run Information runCorrection=T +prep=gsas machine=npdf +run=300K background=npdf_00907 +smooth=2 smoothParam=32 32 0 backKillThresh=-1.0 +in beam: radius=0.635 height=2.54 +temp=308 runTitle=Run 1018: LMO - RT (before), HIPPO-furnace + +##### Vanadium runCorrection=T +run=npdf_00709 background=npdf_00710 +smooth=2 smoothParam=32 32 0 vanKillThresh=4.0 vBackKillThresh=-1.0 +in beam: radius=0.635 height=2.54 + +##### Container runCorrection=T +run=npdf_00917 background=npdf_00907 +smooth=2 smoothParam=32 32 0 cBackKillThresh=-1.0 +wallThick=0.023 atomDensity=0.072110 +atomic information: scattCS=5.100 absorpCS=5.080 + +##### Sample Material numElements=3 NormLaue=0.47445 +Element relAtomNum atomMass atomCoherCS atomIncoherCS atomAbsorpCS + O 0.6000 15.999 4.2320 0.0008 0.00019 + Mn 0.2000 54.931 -1.7500 0.4000 13.30000 + La 0.2000 138.905 8.5300 1.1300 8.97000 +density= effDensity=3.4138 + +##### Banks=6 deltaQ=0.01 matchRef=0 matchScal=T matchOffset=T +bank angle blendQmin blendQmax (0.0 means no info) + 1 90.0 1.62 29.42 + 2 -90.0 1.62 29.42 + 3 119.0 1.97 35.85 + 4 -119.0 1.97 35.85 + 5 148.0 2.20 40.00 + 6 -148.0 2.20 40.00 + +##### Program Specific Information +## Ft calcError=1 (1 for true, 0 for false) +numRpoints=2000 maxR=20.0 numDensity=0.0 intMaxR=1.5 +## Damp Qmin=2.0 Qmax=32 startDampQ=32 QAveMin=0.6 +dampFuncType=0 modEqn=1.0000*S(Q) +0.0000 +0.0000*Q dampExtraToZero=0 +## Blend numBanks=6 banks=1,2,3,4,5,6 +## Soqd minProcOut=0 +samPlazcek=0 vanPlazcek=0 smoothData=0 modifyData=1 +## Corps minProcOut=0 numBanksMiss=0 + +##### prepgsas prepOutput=1 numBanksMiss=0 fileExt=gsa +instParamFile=npdf_displex_757.iparm +numBanksAdd=0 +numBanksMult=6 +Bank# mulData mulBack + 1 1.0230 1.0000 + 2 1.0300 1.0000 + 3 1.0200 1.0000 + 4 0.9800 1.0000 + 5 0.9930 1.0000 + 6 0.9750 1.0000 +##### start data +#O0 rg_int sig_rg_int low_int sig_low_int rmax rhofit +#S 1 - PDF from PDFgetN +#P0 -4.09986 0.44295 0.11702 0.01370 1.50 0.0731 +#L r G(r) dr dG(r) + 0.010 0.086 0.0 0.0441 + 0.020 0.149 0.0 0.0849 + 0.030 0.169 0.0 0.1193 + 0.040 0.130 0.0 0.1448 + 0.050 0.021 0.0 0.1598 + 0.060 -0.160 0.0 0.1637 + 0.070 -0.410 0.0 0.1568 + 0.080 -0.717 0.0 0.1411 + 0.090 -1.064 0.0 0.1196 + 0.100 -1.428 0.0 0.0979 + 0.110 -1.782 0.0 0.0842 + 0.120 -2.101 0.0 0.0854 + 0.130 -2.359 0.0 0.0992 + 0.140 -2.535 0.0 0.1166 + 0.150 -2.612 0.0 0.1311 + 0.160 -2.581 0.0 0.1392 + 0.170 -2.440 0.0 0.1400 + 0.180 -2.196 0.0 0.1341 + 0.190 -1.863 0.0 0.1238 + 0.200 -1.462 0.0 0.1126 + 0.210 -1.017 0.0 0.1050 + 0.220 -0.556 0.0 0.1044 + 0.230 -0.109 0.0 0.1107 + 0.240 0.299 0.0 0.1202 + 0.250 0.643 0.0 0.1290 + 0.260 0.906 0.0 0.1341 + 0.270 1.077 0.0 0.1343 + 0.280 1.152 0.0 0.1298 + 0.290 1.134 0.0 0.1222 + 0.300 1.035 0.0 0.1143 + 0.310 0.870 0.0 0.1091 + 0.320 0.660 0.0 0.1090 + 0.330 0.426 0.0 0.1137 + 0.340 0.193 0.0 0.1209 + 0.350 -0.019 0.0 0.1275 + 0.360 -0.192 0.0 0.1313 + 0.370 -0.313 0.0 0.1313 + 0.380 -0.373 0.0 0.1276 + 0.390 -0.372 0.0 0.1217 + 0.400 -0.314 0.0 0.1156 + 0.410 -0.207 0.0 0.1119 + 0.420 -0.065 0.0 0.1121 + 0.430 0.095 0.0 0.1159 + 0.440 0.257 0.0 0.1215 + 0.450 0.404 0.0 0.1267 + 0.460 0.523 0.0 0.1295 + 0.470 0.601 0.0 0.1292 + 0.480 0.632 0.0 0.1259 + 0.490 0.614 0.0 0.1210 + 0.500 0.548 0.0 0.1163 + 0.510 0.443 0.0 0.1136 + 0.520 0.307 0.0 0.1141 + 0.530 0.152 0.0 0.1175 + 0.540 -0.007 0.0 0.1222 + 0.550 -0.158 0.0 0.1263 + 0.560 -0.290 0.0 0.1283 + 0.570 -0.393 0.0 0.1277 + 0.580 -0.461 0.0 0.1248 + 0.590 -0.493 0.0 0.1205 + 0.600 -0.490 0.0 0.1166 + 0.610 -0.458 0.0 0.1146 + 0.620 -0.404 0.0 0.1153 + 0.630 -0.338 0.0 0.1184 + 0.640 -0.271 0.0 0.1225 + 0.650 -0.214 0.0 0.1259 + 0.660 -0.176 0.0 0.1275 + 0.670 -0.163 0.0 0.1268 + 0.680 -0.180 0.0 0.1240 + 0.690 -0.228 0.0 0.1203 + 0.700 -0.306 0.0 0.1171 + 0.710 -0.409 0.0 0.1156 + 0.720 -0.529 0.0 0.1164 + 0.730 -0.659 0.0 0.1192 + 0.740 -0.789 0.0 0.1226 + 0.750 -0.910 0.0 0.1254 + 0.760 -1.015 0.0 0.1265 + 0.770 -1.097 0.0 0.1257 + 0.780 -1.153 0.0 0.1232 + 0.790 -1.181 0.0 0.1200 + 0.800 -1.185 0.0 0.1173 + 0.810 -1.166 0.0 0.1163 + 0.820 -1.132 0.0 0.1173 + 0.830 -1.088 0.0 0.1198 + 0.840 -1.043 0.0 0.1228 + 0.850 -1.002 0.0 0.1251 + 0.860 -0.973 0.0 0.1259 + 0.870 -0.958 0.0 0.1249 + 0.880 -0.961 0.0 0.1226 + 0.890 -0.982 0.0 0.1198 + 0.900 -1.018 0.0 0.1177 + 0.910 -1.066 0.0 0.1170 + 0.920 -1.122 0.0 0.1181 + 0.930 -1.179 0.0 0.1204 + 0.940 -1.232 0.0 0.1229 + 0.950 -1.277 0.0 0.1247 + 0.960 -1.308 0.0 0.1251 + 0.970 -1.324 0.0 0.1240 + 0.980 -1.325 0.0 0.1219 + 0.990 -1.311 0.0 0.1195 + 1.000 -1.287 0.0 0.1178 + 1.010 -1.255 0.0 0.1175 + 1.020 -1.222 0.0 0.1187 + 1.030 -1.192 0.0 0.1208 + 1.040 -1.170 0.0 0.1231 + 1.050 -1.161 0.0 0.1245 + 1.060 -1.165 0.0 0.1246 + 1.070 -1.185 0.0 0.1234 + 1.080 -1.217 0.0 0.1214 + 1.090 -1.260 0.0 0.1193 + 1.100 -1.309 0.0 0.1180 + 1.110 -1.358 0.0 0.1180 + 1.120 -1.401 0.0 0.1193 + 1.130 -1.432 0.0 0.1212 + 1.140 -1.448 0.0 0.1231 + 1.150 -1.443 0.0 0.1242 + 1.160 -1.417 0.0 0.1241 + 1.170 -1.371 0.0 0.1228 + 1.180 -1.307 0.0 0.1209 + 1.190 -1.230 0.0 0.1191 + 1.200 -1.147 0.0 0.1182 + 1.210 -1.065 0.0 0.1184 + 1.220 -0.992 0.0 0.1198 + 1.230 -0.934 0.0 0.1217 + 1.240 -0.898 0.0 0.1233 + 1.250 -0.888 0.0 0.1241 + 1.260 -0.905 0.0 0.1237 + 1.270 -0.950 0.0 0.1224 + 1.280 -1.019 0.0 0.1206 + 1.290 -1.106 0.0 0.1191 + 1.300 -1.205 0.0 0.1184 + 1.310 -1.306 0.0 0.1188 + 1.320 -1.400 0.0 0.1202 + 1.330 -1.479 0.0 0.1220 + 1.340 -1.534 0.0 0.1234 + 1.350 -1.562 0.0 0.1239 + 1.360 -1.557 0.0 0.1234 + 1.370 -1.519 0.0 0.1220 + 1.380 -1.452 0.0 0.1204 + 1.390 -1.360 0.0 0.1190 + 1.400 -1.251 0.0 0.1186 + 1.410 -1.133 0.0 0.1193 + 1.420 -1.017 0.0 0.1207 + 1.430 -0.913 0.0 0.1224 + 1.440 -0.830 0.0 0.1236 + 1.450 -0.775 0.0 0.1239 + 1.460 -0.755 0.0 0.1232 + 1.470 -0.770 0.0 0.1217 + 1.480 -0.822 0.0 0.1201 + 1.490 -0.906 0.0 0.1190 + 1.500 -1.017 0.0 0.1188 + 1.510 -1.147 0.0 0.1196 + 1.520 -1.285 0.0 0.1210 + 1.530 -1.422 0.0 0.1226 + 1.540 -1.548 0.0 0.1236 + 1.550 -1.653 0.0 0.1238 + 1.560 -1.730 0.0 0.1230 + 1.570 -1.774 0.0 0.1216 + 1.580 -1.781 0.0 0.1201 + 1.590 -1.753 0.0 0.1191 + 1.600 -1.691 0.0 0.1190 + 1.610 -1.600 0.0 0.1198 + 1.620 -1.487 0.0 0.1213 + 1.630 -1.360 0.0 0.1227 + 1.640 -1.227 0.0 0.1236 + 1.650 -1.097 0.0 0.1236 + 1.660 -0.977 0.0 0.1227 + 1.670 -0.876 0.0 0.1213 + 1.680 -0.797 0.0 0.1200 + 1.690 -0.747 0.0 0.1191 + 1.700 -0.727 0.0 0.1191 + 1.710 -0.739 0.0 0.1200 + 1.720 -0.782 0.0 0.1214 + 1.730 -0.858 0.0 0.1227 + 1.740 -0.964 0.0 0.1234 + 1.750 -1.099 0.0 0.1234 + 1.760 -1.262 0.0 0.1225 + 1.770 -1.452 0.0 0.1212 + 1.780 -1.668 0.0 0.1200 + 1.790 -1.908 0.0 0.1193 + 1.800 -2.171 0.0 0.1195 + 1.810 -2.456 0.0 0.1204 + 1.820 -2.758 0.0 0.1216 + 1.830 -3.075 0.0 0.1227 + 1.840 -3.401 0.0 0.1233 + 1.850 -3.730 0.0 0.1230 + 1.860 -4.053 0.0 0.1221 + 1.870 -4.362 0.0 0.1209 + 1.880 -4.647 0.0 0.1198 + 1.890 -4.897 0.0 0.1194 + 1.900 -5.103 0.0 0.1197 + 1.910 -5.256 0.0 0.1206 + 1.920 -5.349 0.0 0.1218 + 1.930 -5.378 0.0 0.1227 + 1.940 -5.342 0.0 0.1231 + 1.950 -5.241 0.0 0.1227 + 1.960 -5.081 0.0 0.1218 + 1.970 -4.869 0.0 0.1207 + 1.980 -4.618 0.0 0.1198 + 1.990 -4.340 0.0 0.1196 + 2.000 -4.050 0.0 0.1200 + 2.010 -3.762 0.0 0.1210 + 2.020 -3.493 0.0 0.1221 + 2.030 -3.253 0.0 0.1229 + 2.040 -3.056 0.0 0.1231 + 2.050 -2.907 0.0 0.1226 + 2.060 -2.811 0.0 0.1215 + 2.070 -2.769 0.0 0.1204 + 2.080 -2.778 0.0 0.1197 + 2.090 -2.831 0.0 0.1196 + 2.100 -2.918 0.0 0.1201 + 2.110 -3.029 0.0 0.1211 + 2.120 -3.150 0.0 0.1222 + 2.130 -3.270 0.0 0.1229 + 2.140 -3.377 0.0 0.1229 + 2.150 -3.460 0.0 0.1223 + 2.160 -3.511 0.0 0.1213 + 2.170 -3.525 0.0 0.1202 + 2.180 -3.499 0.0 0.1196 + 2.190 -3.432 0.0 0.1196 + 2.200 -3.327 0.0 0.1202 + 2.210 -3.188 0.0 0.1213 + 2.220 -3.019 0.0 0.1223 + 2.230 -2.825 0.0 0.1229 + 2.240 -2.613 0.0 0.1229 + 2.250 -2.385 0.0 0.1222 + 2.260 -2.145 0.0 0.1212 + 2.270 -1.895 0.0 0.1202 + 2.280 -1.633 0.0 0.1197 + 2.290 -1.359 0.0 0.1197 + 2.300 -1.069 0.0 0.1204 + 2.310 -0.761 0.0 0.1214 + 2.320 -0.431 0.0 0.1223 + 2.330 -0.077 0.0 0.1228 + 2.340 0.303 0.0 0.1227 + 2.350 0.706 0.0 0.1221 + 2.360 1.131 0.0 0.1211 + 2.370 1.571 0.0 0.1203 + 2.380 2.020 0.0 0.1198 + 2.390 2.466 0.0 0.1199 + 2.400 2.899 0.0 0.1206 + 2.410 3.309 0.0 0.1215 + 2.420 3.682 0.0 0.1223 + 2.430 4.010 0.0 0.1227 + 2.440 4.285 0.0 0.1225 + 2.450 4.501 0.0 0.1218 + 2.460 4.656 0.0 0.1210 + 2.470 4.751 0.0 0.1203 + 2.480 4.792 0.0 0.1200 + 2.490 4.788 0.0 0.1203 + 2.500 4.749 0.0 0.1210 + 2.510 4.688 0.0 0.1218 + 2.520 4.620 0.0 0.1225 + 2.530 4.558 0.0 0.1226 + 2.540 4.518 0.0 0.1223 + 2.550 4.508 0.0 0.1215 + 2.560 4.539 0.0 0.1207 + 2.570 4.615 0.0 0.1201 + 2.580 4.738 0.0 0.1200 + 2.590 4.907 0.0 0.1204 + 2.600 5.115 0.0 0.1212 + 2.610 5.354 0.0 0.1220 + 2.620 5.613 0.0 0.1226 + 2.630 5.882 0.0 0.1226 + 2.640 6.146 0.0 0.1222 + 2.650 6.395 0.0 0.1213 + 2.660 6.619 0.0 0.1205 + 2.670 6.808 0.0 0.1200 + 2.680 6.957 0.0 0.1200 + 2.690 7.063 0.0 0.1205 + 2.700 7.126 0.0 0.1214 + 2.710 7.148 0.0 0.1222 + 2.720 7.134 0.0 0.1227 + 2.730 7.090 0.0 0.1226 + 2.740 7.023 0.0 0.1221 + 2.750 6.941 0.0 0.1212 + 2.760 6.849 0.0 0.1204 + 2.770 6.754 0.0 0.1200 + 2.780 6.659 0.0 0.1201 + 2.790 6.567 0.0 0.1206 + 2.800 6.477 0.0 0.1215 + 2.810 6.388 0.0 0.1222 + 2.820 6.297 0.0 0.1226 + 2.830 6.201 0.0 0.1225 + 2.840 6.094 0.0 0.1219 + 2.850 5.972 0.0 0.1211 + 2.860 5.832 0.0 0.1204 + 2.870 5.671 0.0 0.1200 + 2.880 5.487 0.0 0.1202 + 2.890 5.281 0.0 0.1209 + 2.900 5.053 0.0 0.1217 + 2.910 4.807 0.0 0.1224 + 2.920 4.548 0.0 0.1227 + 2.930 4.279 0.0 0.1225 + 2.940 4.006 0.0 0.1218 + 2.950 3.734 0.0 0.1210 + 2.960 3.467 0.0 0.1203 + 2.970 3.208 0.0 0.1200 + 2.980 2.958 0.0 0.1202 + 2.990 2.720 0.0 0.1209 + 3.000 2.491 0.0 0.1218 + 3.010 2.269 0.0 0.1224 + 3.020 2.053 0.0 0.1227 + 3.030 1.838 0.0 0.1224 + 3.040 1.622 0.0 0.1217 + 3.050 1.402 0.0 0.1209 + 3.060 1.176 0.0 0.1202 + 3.070 0.942 0.0 0.1200 + 3.080 0.703 0.0 0.1203 + 3.090 0.459 0.0 0.1210 + 3.100 0.213 0.0 0.1218 + 3.110 -0.029 0.0 0.1224 + 3.120 -0.263 0.0 0.1226 + 3.130 -0.484 0.0 0.1223 + 3.140 -0.688 0.0 0.1216 + 3.150 -0.868 0.0 0.1208 + 3.160 -1.024 0.0 0.1202 + 3.170 -1.152 0.0 0.1201 + 3.180 -1.254 0.0 0.1204 + 3.190 -1.330 0.0 0.1211 + 3.200 -1.385 0.0 0.1218 + 3.210 -1.423 0.0 0.1223 + 3.220 -1.450 0.0 0.1224 + 3.230 -1.472 0.0 0.1220 + 3.240 -1.495 0.0 0.1214 + 3.250 -1.526 0.0 0.1206 + 3.260 -1.568 0.0 0.1202 + 3.270 -1.625 0.0 0.1201 + 3.280 -1.698 0.0 0.1205 + 3.290 -1.787 0.0 0.1212 + 3.300 -1.888 0.0 0.1220 + 3.310 -1.998 0.0 0.1224 + 3.320 -2.111 0.0 0.1224 + 3.330 -2.220 0.0 0.1219 + 3.340 -2.319 0.0 0.1212 + 3.350 -2.401 0.0 0.1205 + 3.360 -2.460 0.0 0.1201 + 3.370 -2.492 0.0 0.1201 + 3.380 -2.495 0.0 0.1206 + 3.390 -2.467 0.0 0.1213 + 3.400 -2.411 0.0 0.1220 + 3.410 -2.329 0.0 0.1224 + 3.420 -2.229 0.0 0.1223 + 3.430 -2.116 0.0 0.1219 + 3.440 -1.998 0.0 0.1212 + 3.450 -1.885 0.0 0.1205 + 3.460 -1.785 0.0 0.1202 + 3.470 -1.705 0.0 0.1202 + 3.480 -1.652 0.0 0.1207 + 3.490 -1.631 0.0 0.1214 + 3.500 -1.645 0.0 0.1220 + 3.510 -1.696 0.0 0.1223 + 3.520 -1.782 0.0 0.1222 + 3.530 -1.901 0.0 0.1217 + 3.540 -2.049 0.0 0.1211 + 3.550 -2.219 0.0 0.1205 + 3.560 -2.405 0.0 0.1203 + 3.570 -2.600 0.0 0.1204 + 3.580 -2.797 0.0 0.1209 + 3.590 -2.990 0.0 0.1215 + 3.600 -3.171 0.0 0.1220 + 3.610 -3.337 0.0 0.1223 + 3.620 -3.483 0.0 0.1221 + 3.630 -3.605 0.0 0.1216 + 3.640 -3.702 0.0 0.1210 + 3.650 -3.771 0.0 0.1205 + 3.660 -3.813 0.0 0.1204 + 3.670 -3.826 0.0 0.1206 + 3.680 -3.810 0.0 0.1211 + 3.690 -3.765 0.0 0.1217 + 3.700 -3.691 0.0 0.1221 + 3.710 -3.589 0.0 0.1222 + 3.720 -3.456 0.0 0.1219 + 3.730 -3.294 0.0 0.1214 + 3.740 -3.101 0.0 0.1209 + 3.750 -2.880 0.0 0.1205 + 3.760 -2.629 0.0 0.1205 + 3.770 -2.351 0.0 0.1208 + 3.780 -2.049 0.0 0.1213 + 3.790 -1.726 0.0 0.1219 + 3.800 -1.387 0.0 0.1222 + 3.810 -1.038 0.0 0.1222 + 3.820 -0.686 0.0 0.1219 + 3.830 -0.338 0.0 0.1213 + 3.840 -0.003 0.0 0.1208 + 3.850 0.312 0.0 0.1205 + 3.860 0.598 0.0 0.1205 + 3.870 0.848 0.0 0.1209 + 3.880 1.056 0.0 0.1215 + 3.890 1.215 0.0 0.1220 + 3.900 1.323 0.0 0.1223 + 3.910 1.377 0.0 0.1222 + 3.920 1.376 0.0 0.1218 + 3.930 1.322 0.0 0.1212 + 3.940 1.217 0.0 0.1206 + 3.950 1.065 0.0 0.1204 + 3.960 0.871 0.0 0.1205 + 3.970 0.640 0.0 0.1210 + 3.980 0.378 0.0 0.1216 + 3.990 0.091 0.0 0.1221 + 4.000 -0.215 0.0 0.1223 + 4.010 -0.536 0.0 0.1222 + 4.020 -0.866 0.0 0.1217 + 4.030 -1.203 0.0 0.1211 + 4.040 -1.543 0.0 0.1206 + 4.050 -1.884 0.0 0.1204 + 4.060 -2.224 0.0 0.1206 + 4.070 -2.562 0.0 0.1211 + 4.080 -2.896 0.0 0.1217 + 4.090 -3.225 0.0 0.1222 + 4.100 -3.547 0.0 0.1223 + 4.110 -3.859 0.0 0.1221 + 4.120 -4.159 0.0 0.1216 + 4.130 -4.443 0.0 0.1210 + 4.140 -4.707 0.0 0.1205 + 4.150 -4.946 0.0 0.1203 + 4.160 -5.155 0.0 0.1205 + 4.170 -5.329 0.0 0.1211 + 4.180 -5.463 0.0 0.1217 + 4.190 -5.552 0.0 0.1222 + 4.200 -5.595 0.0 0.1224 + 4.210 -5.588 0.0 0.1221 + 4.220 -5.529 0.0 0.1216 + 4.230 -5.421 0.0 0.1210 + 4.240 -5.265 0.0 0.1205 + 4.250 -5.064 0.0 0.1204 + 4.260 -4.824 0.0 0.1206 + 4.270 -4.551 0.0 0.1211 + 4.280 -4.251 0.0 0.1217 + 4.290 -3.932 0.0 0.1221 + 4.300 -3.602 0.0 0.1222 + 4.310 -3.268 0.0 0.1219 + 4.320 -2.936 0.0 0.1214 + 4.330 -2.613 0.0 0.1209 + 4.340 -2.302 0.0 0.1205 + 4.350 -2.007 0.0 0.1204 + 4.360 -1.729 0.0 0.1207 + 4.370 -1.469 0.0 0.1212 + 4.380 -1.226 0.0 0.1218 + 4.390 -0.996 0.0 0.1221 + 4.400 -0.779 0.0 0.1222 + 4.410 -0.569 0.0 0.1219 + 4.420 -0.365 0.0 0.1213 + 4.430 -0.162 0.0 0.1208 + 4.440 0.042 0.0 0.1205 + 4.450 0.248 0.0 0.1205 + 4.460 0.456 0.0 0.1208 + 4.470 0.667 0.0 0.1213 + 4.480 0.878 0.0 0.1218 + 4.490 1.086 0.0 0.1221 + 4.500 1.288 0.0 0.1220 + 4.510 1.481 0.0 0.1217 + 4.520 1.658 0.0 0.1212 + 4.530 1.818 0.0 0.1207 + 4.540 1.955 0.0 0.1204 + 4.550 2.067 0.0 0.1205 + 4.560 2.153 0.0 0.1208 + 4.570 2.213 0.0 0.1214 + 4.580 2.249 0.0 0.1218 + 4.590 2.262 0.0 0.1221 + 4.600 2.258 0.0 0.1220 + 4.610 2.241 0.0 0.1216 + 4.620 2.219 0.0 0.1211 + 4.630 2.198 0.0 0.1207 + 4.640 2.185 0.0 0.1204 + 4.650 2.185 0.0 0.1206 + 4.660 2.205 0.0 0.1209 + 4.670 2.249 0.0 0.1214 + 4.680 2.319 0.0 0.1219 + 4.690 2.416 0.0 0.1220 + 4.700 2.540 0.0 0.1219 + 4.710 2.688 0.0 0.1215 + 4.720 2.856 0.0 0.1210 + 4.730 3.037 0.0 0.1206 + 4.740 3.226 0.0 0.1204 + 4.750 3.413 0.0 0.1206 + 4.760 3.592 0.0 0.1210 + 4.770 3.755 0.0 0.1215 + 4.780 3.896 0.0 0.1219 + 4.790 4.007 0.0 0.1220 + 4.800 4.084 0.0 0.1219 + 4.810 4.125 0.0 0.1215 + 4.820 4.129 0.0 0.1210 + 4.830 4.094 0.0 0.1207 + 4.840 4.025 0.0 0.1206 + 4.850 3.923 0.0 0.1208 + 4.860 3.794 0.0 0.1212 + 4.870 3.642 0.0 0.1216 + 4.880 3.474 0.0 0.1219 + 4.890 3.295 0.0 0.1220 + 4.900 3.112 0.0 0.1218 + 4.910 2.928 0.0 0.1214 + 4.920 2.748 0.0 0.1210 + 4.930 2.576 0.0 0.1207 + 4.940 2.412 0.0 0.1207 + 4.950 2.258 0.0 0.1210 + 4.960 2.113 0.0 0.1214 + 4.970 1.977 0.0 0.1218 + 4.980 1.847 0.0 0.1220 + 4.990 1.720 0.0 0.1220 + 5.000 1.594 0.0 0.1217 + 5.010 1.467 0.0 0.1213 + 5.020 1.336 0.0 0.1209 + 5.030 1.199 0.0 0.1207 + 5.040 1.057 0.0 0.1208 + 5.050 0.908 0.0 0.1211 + 5.060 0.754 0.0 0.1215 + 5.070 0.597 0.0 0.1219 + 5.080 0.440 0.0 0.1220 + 5.090 0.286 0.0 0.1219 + 5.100 0.140 0.0 0.1216 + 5.110 0.005 0.0 0.1211 + 5.120 -0.113 0.0 0.1208 + 5.130 -0.212 0.0 0.1206 + 5.140 -0.288 0.0 0.1207 + 5.150 -0.338 0.0 0.1211 + 5.160 -0.360 0.0 0.1216 + 5.170 -0.356 0.0 0.1220 + 5.180 -0.325 0.0 0.1221 + 5.190 -0.270 0.0 0.1220 + 5.200 -0.195 0.0 0.1216 + 5.210 -0.104 0.0 0.1211 + 5.220 -0.003 0.0 0.1208 + 5.230 0.102 0.0 0.1207 + 5.240 0.205 0.0 0.1208 + 5.250 0.299 0.0 0.1212 + 5.260 0.378 0.0 0.1217 + 5.270 0.439 0.0 0.1220 + 5.280 0.476 0.0 0.1221 + 5.290 0.487 0.0 0.1219 + 5.300 0.472 0.0 0.1215 + 5.310 0.432 0.0 0.1210 + 5.320 0.368 0.0 0.1207 + 5.330 0.285 0.0 0.1206 + 5.340 0.188 0.0 0.1208 + 5.350 0.084 0.0 0.1212 + 5.360 -0.020 0.0 0.1217 + 5.370 -0.116 0.0 0.1220 + 5.380 -0.197 0.0 0.1220 + 5.390 -0.256 0.0 0.1218 + 5.400 -0.287 0.0 0.1214 + 5.410 -0.287 0.0 0.1209 + 5.420 -0.250 0.0 0.1206 + 5.430 -0.178 0.0 0.1206 + 5.440 -0.070 0.0 0.1208 + 5.450 0.070 0.0 0.1212 + 5.460 0.240 0.0 0.1217 + 5.470 0.433 0.0 0.1219 + 5.480 0.643 0.0 0.1219 + 5.490 0.863 0.0 0.1217 + 5.500 1.086 0.0 0.1212 + 5.510 1.306 0.0 0.1208 + 5.520 1.515 0.0 0.1206 + 5.530 1.711 0.0 0.1206 + 5.540 1.889 0.0 0.1209 + 5.550 2.048 0.0 0.1214 + 5.560 2.187 0.0 0.1218 + 5.570 2.307 0.0 0.1221 + 5.580 2.412 0.0 0.1220 + 5.590 2.504 0.0 0.1217 + 5.600 2.587 0.0 0.1213 + 5.610 2.664 0.0 0.1209 + 5.620 2.740 0.0 0.1206 + 5.630 2.817 0.0 0.1207 + 5.640 2.897 0.0 0.1210 + 5.650 2.979 0.0 0.1214 + 5.660 3.062 0.0 0.1218 + 5.670 3.144 0.0 0.1220 + 5.680 3.221 0.0 0.1219 + 5.690 3.287 0.0 0.1216 + 5.700 3.338 0.0 0.1212 + 5.710 3.366 0.0 0.1208 + 5.720 3.366 0.0 0.1206 + 5.730 3.333 0.0 0.1207 + 5.740 3.264 0.0 0.1210 + 5.750 3.156 0.0 0.1214 + 5.760 3.009 0.0 0.1218 + 5.770 2.825 0.0 0.1219 + 5.780 2.606 0.0 0.1218 + 5.790 2.357 0.0 0.1215 + 5.800 2.087 0.0 0.1211 + 5.810 1.802 0.0 0.1207 + 5.820 1.511 0.0 0.1206 + 5.830 1.222 0.0 0.1207 + 5.840 0.944 0.0 0.1210 + 5.850 0.684 0.0 0.1214 + 5.860 0.447 0.0 0.1218 + 5.870 0.238 0.0 0.1219 + 5.880 0.059 0.0 0.1217 + 5.890 -0.089 0.0 0.1214 + 5.900 -0.208 0.0 0.1210 + 5.910 -0.301 0.0 0.1207 + 5.920 -0.374 0.0 0.1206 + 5.930 -0.430 0.0 0.1208 + 5.940 -0.477 0.0 0.1212 + 5.950 -0.520 0.0 0.1216 + 5.960 -0.566 0.0 0.1219 + 5.970 -0.619 0.0 0.1219 + 5.980 -0.684 0.0 0.1217 + 5.990 -0.763 0.0 0.1214 + 6.000 -0.859 0.0 0.1210 + 6.010 -0.971 0.0 0.1207 + 6.020 -1.098 0.0 0.1207 + 6.030 -1.238 0.0 0.1209 + 6.040 -1.388 0.0 0.1212 + 6.050 -1.545 0.0 0.1216 + 6.060 -1.705 0.0 0.1219 + 6.070 -1.865 0.0 0.1220 + 6.080 -2.021 0.0 0.1217 + 6.090 -2.172 0.0 0.1214 + 6.100 -2.315 0.0 0.1210 + 6.110 -2.449 0.0 0.1207 + 6.120 -2.575 0.0 0.1207 + 6.130 -2.694 0.0 0.1209 + 6.140 -2.805 0.0 0.1213 + 6.150 -2.912 0.0 0.1217 + 6.160 -3.016 0.0 0.1219 + 6.170 -3.119 0.0 0.1219 + 6.180 -3.223 0.0 0.1217 + 6.190 -3.329 0.0 0.1213 + 6.200 -3.439 0.0 0.1210 + 6.210 -3.552 0.0 0.1208 + 6.220 -3.669 0.0 0.1208 + 6.230 -3.789 0.0 0.1211 + 6.240 -3.911 0.0 0.1214 + 6.250 -4.033 0.0 0.1217 + 6.260 -4.153 0.0 0.1219 + 6.270 -4.269 0.0 0.1218 + 6.280 -4.378 0.0 0.1216 + 6.290 -4.478 0.0 0.1213 + 6.300 -4.567 0.0 0.1210 + 6.310 -4.640 0.0 0.1208 + 6.320 -4.697 0.0 0.1209 + 6.330 -4.734 0.0 0.1212 + 6.340 -4.751 0.0 0.1215 + 6.350 -4.745 0.0 0.1218 + 6.360 -4.714 0.0 0.1219 + 6.370 -4.659 0.0 0.1218 + 6.380 -4.578 0.0 0.1215 + 6.390 -4.473 0.0 0.1211 + 6.400 -4.344 0.0 0.1209 + 6.410 -4.194 0.0 0.1208 + 6.420 -4.025 0.0 0.1209 + 6.430 -3.840 0.0 0.1212 + 6.440 -3.645 0.0 0.1215 + 6.450 -3.443 0.0 0.1218 + 6.460 -3.241 0.0 0.1219 + 6.470 -3.045 0.0 0.1217 + 6.480 -2.860 0.0 0.1214 + 6.490 -2.691 0.0 0.1211 + 6.500 -2.545 0.0 0.1208 + 6.510 -2.424 0.0 0.1208 + 6.520 -2.333 0.0 0.1210 + 6.530 -2.272 0.0 0.1213 + 6.540 -2.241 0.0 0.1217 + 6.550 -2.239 0.0 0.1219 + 6.560 -2.262 0.0 0.1219 + 6.570 -2.305 0.0 0.1216 + 6.580 -2.361 0.0 0.1213 + 6.590 -2.425 0.0 0.1209 + 6.600 -2.488 0.0 0.1207 + 6.610 -2.541 0.0 0.1207 + 6.620 -2.578 0.0 0.1209 + 6.630 -2.592 0.0 0.1213 + 6.640 -2.577 0.0 0.1216 + 6.650 -2.530 0.0 0.1219 + 6.660 -2.449 0.0 0.1218 + 6.670 -2.334 0.0 0.1216 + 6.680 -2.187 0.0 0.1213 + 6.690 -2.012 0.0 0.1209 + 6.700 -1.815 0.0 0.1207 + 6.710 -1.601 0.0 0.1207 + 6.720 -1.380 0.0 0.1209 + 6.730 -1.158 0.0 0.1213 + 6.740 -0.944 0.0 0.1216 + 6.750 -0.743 0.0 0.1218 + 6.760 -0.562 0.0 0.1218 + 6.770 -0.404 0.0 0.1216 + 6.780 -0.272 0.0 0.1212 + 6.790 -0.166 0.0 0.1209 + 6.800 -0.083 0.0 0.1208 + 6.810 -0.022 0.0 0.1208 + 6.820 0.023 0.0 0.1211 + 6.830 0.057 0.0 0.1214 + 6.840 0.088 0.0 0.1217 + 6.850 0.122 0.0 0.1218 + 6.860 0.164 0.0 0.1217 + 6.870 0.222 0.0 0.1214 + 6.880 0.299 0.0 0.1211 + 6.890 0.398 0.0 0.1208 + 6.900 0.521 0.0 0.1207 + 6.910 0.667 0.0 0.1208 + 6.920 0.835 0.0 0.1211 + 6.930 1.021 0.0 0.1215 + 6.940 1.221 0.0 0.1217 + 6.950 1.428 0.0 0.1218 + 6.960 1.636 0.0 0.1217 + 6.970 1.839 0.0 0.1214 + 6.980 2.030 0.0 0.1211 + 6.990 2.203 0.0 0.1209 + 7.000 2.353 0.0 0.1208 + 7.010 2.476 0.0 0.1209 + 7.020 2.569 0.0 0.1212 + 7.030 2.630 0.0 0.1215 + 7.040 2.660 0.0 0.1217 + 7.050 2.658 0.0 0.1217 + 7.060 2.627 0.0 0.1216 + 7.070 2.571 0.0 0.1213 + 7.080 2.493 0.0 0.1210 + 7.090 2.397 0.0 0.1207 + 7.100 2.289 0.0 0.1207 + 7.110 2.173 0.0 0.1209 + 7.120 2.053 0.0 0.1213 + 7.130 1.933 0.0 0.1216 + 7.140 1.819 0.0 0.1218 + 7.150 1.712 0.0 0.1218 + 7.160 1.615 0.0 0.1216 + 7.170 1.531 0.0 0.1213 + 7.180 1.461 0.0 0.1210 + 7.190 1.405 0.0 0.1209 + 7.200 1.366 0.0 0.1209 + 7.210 1.342 0.0 0.1211 + 7.220 1.333 0.0 0.1214 + 7.230 1.340 0.0 0.1217 + 7.240 1.363 0.0 0.1218 + 7.250 1.401 0.0 0.1218 + 7.260 1.455 0.0 0.1216 + 7.270 1.524 0.0 0.1213 + 7.280 1.608 0.0 0.1210 + 7.290 1.707 0.0 0.1208 + 7.300 1.823 0.0 0.1209 + 7.310 1.954 0.0 0.1211 + 7.320 2.099 0.0 0.1215 + 7.330 2.260 0.0 0.1217 + 7.340 2.434 0.0 0.1219 + 7.350 2.620 0.0 0.1218 + 7.360 2.816 0.0 0.1216 + 7.370 3.018 0.0 0.1213 + 7.380 3.224 0.0 0.1210 + 7.390 3.430 0.0 0.1209 + 7.400 3.631 0.0 0.1210 + 7.410 3.823 0.0 0.1213 + 7.420 4.001 0.0 0.1216 + 7.430 4.160 0.0 0.1218 + 7.440 4.297 0.0 0.1219 + 7.450 4.406 0.0 0.1218 + 7.460 4.486 0.0 0.1215 + 7.470 4.534 0.0 0.1212 + 7.480 4.550 0.0 0.1209 + 7.490 4.533 0.0 0.1208 + 7.500 4.485 0.0 0.1210 + 7.510 4.408 0.0 0.1212 + 7.520 4.306 0.0 0.1216 + 7.530 4.183 0.0 0.1218 + 7.540 4.044 0.0 0.1218 + 7.550 3.892 0.0 0.1217 + 7.560 3.733 0.0 0.1214 + 7.570 3.571 0.0 0.1211 + 7.580 3.409 0.0 0.1209 + 7.590 3.251 0.0 0.1208 + 7.600 3.097 0.0 0.1210 + 7.610 2.949 0.0 0.1213 + 7.620 2.804 0.0 0.1216 + 7.630 2.663 0.0 0.1218 + 7.640 2.523 0.0 0.1218 + 7.650 2.380 0.0 0.1216 + 7.660 2.233 0.0 0.1213 + 7.670 2.077 0.0 0.1210 + 7.680 1.911 0.0 0.1208 + 7.690 1.734 0.0 0.1208 + 7.700 1.543 0.0 0.1210 + 7.710 1.341 0.0 0.1213 + 7.720 1.128 0.0 0.1216 + 7.730 0.906 0.0 0.1218 + 7.740 0.681 0.0 0.1218 + 7.750 0.455 0.0 0.1216 + 7.760 0.234 0.0 0.1213 + 7.770 0.022 0.0 0.1209 + 7.780 -0.176 0.0 0.1208 + 7.790 -0.356 0.0 0.1208 + 7.800 -0.514 0.0 0.1210 + 7.810 -0.650 0.0 0.1213 + 7.820 -0.761 0.0 0.1216 + 7.830 -0.848 0.0 0.1218 + 7.840 -0.912 0.0 0.1217 + 7.850 -0.957 0.0 0.1215 + 7.860 -0.984 0.0 0.1212 + 7.870 -0.997 0.0 0.1209 + 7.880 -1.000 0.0 0.1208 + 7.890 -0.996 0.0 0.1208 + 7.900 -0.988 0.0 0.1210 + 7.910 -0.978 0.0 0.1213 + 7.920 -0.968 0.0 0.1216 + 7.930 -0.958 0.0 0.1217 + 7.940 -0.949 0.0 0.1217 + 7.950 -0.939 0.0 0.1214 + 7.960 -0.928 0.0 0.1211 + 7.970 -0.914 0.0 0.1209 + 7.980 -0.897 0.0 0.1207 + 7.990 -0.876 0.0 0.1208 + 8.000 -0.850 0.0 0.1211 + 8.010 -0.821 0.0 0.1214 + 8.020 -0.791 0.0 0.1217 + 8.030 -0.761 0.0 0.1218 + 8.040 -0.736 0.0 0.1217 + 8.050 -0.718 0.0 0.1215 + 8.060 -0.711 0.0 0.1211 + 8.070 -0.718 0.0 0.1209 + 8.080 -0.742 0.0 0.1208 + 8.090 -0.784 0.0 0.1209 + 8.100 -0.845 0.0 0.1211 + 8.110 -0.922 0.0 0.1214 + 8.120 -1.014 0.0 0.1217 + 8.130 -1.115 0.0 0.1218 + 8.140 -1.220 0.0 0.1216 + 8.150 -1.322 0.0 0.1214 + 8.160 -1.415 0.0 0.1211 + 8.170 -1.489 0.0 0.1208 + 8.180 -1.540 0.0 0.1208 + 8.190 -1.561 0.0 0.1209 + 8.200 -1.549 0.0 0.1212 + 8.210 -1.501 0.0 0.1215 + 8.220 -1.417 0.0 0.1217 + 8.230 -1.300 0.0 0.1218 + 8.240 -1.155 0.0 0.1217 + 8.250 -0.988 0.0 0.1214 + 8.260 -0.808 0.0 0.1211 + 8.270 -0.624 0.0 0.1209 + 8.280 -0.445 0.0 0.1209 + 8.290 -0.282 0.0 0.1210 + 8.300 -0.144 0.0 0.1213 + 8.310 -0.038 0.0 0.1216 + 8.320 0.030 0.0 0.1218 + 8.330 0.056 0.0 0.1218 + 8.340 0.039 0.0 0.1216 + 8.350 -0.020 0.0 0.1214 + 8.360 -0.119 0.0 0.1211 + 8.370 -0.253 0.0 0.1210 + 8.380 -0.415 0.0 0.1209 + 8.390 -0.598 0.0 0.1211 + 8.400 -0.794 0.0 0.1214 + 8.410 -0.996 0.0 0.1216 + 8.420 -1.195 0.0 0.1217 + 8.430 -1.387 0.0 0.1217 + 8.440 -1.565 0.0 0.1216 + 8.450 -1.725 0.0 0.1213 + 8.460 -1.864 0.0 0.1211 + 8.470 -1.980 0.0 0.1210 + 8.480 -2.073 0.0 0.1210 + 8.490 -2.143 0.0 0.1211 + 8.500 -2.189 0.0 0.1214 + 8.510 -2.213 0.0 0.1216 + 8.520 -2.215 0.0 0.1217 + 8.530 -2.196 0.0 0.1217 + 8.540 -2.156 0.0 0.1215 + 8.550 -2.096 0.0 0.1213 + 8.560 -2.016 0.0 0.1210 + 8.570 -1.916 0.0 0.1210 + 8.580 -1.798 0.0 0.1210 + 8.590 -1.664 0.0 0.1212 + 8.600 -1.516 0.0 0.1214 + 8.610 -1.358 0.0 0.1216 + 8.620 -1.194 0.0 0.1217 + 8.630 -1.030 0.0 0.1216 + 8.640 -0.872 0.0 0.1214 + 8.650 -0.728 0.0 0.1212 + 8.660 -0.604 0.0 0.1210 + 8.670 -0.508 0.0 0.1210 + 8.680 -0.446 0.0 0.1211 + 8.690 -0.423 0.0 0.1213 + 8.700 -0.442 0.0 0.1215 + 8.710 -0.505 0.0 0.1217 + 8.720 -0.611 0.0 0.1217 + 8.730 -0.758 0.0 0.1216 + 8.740 -0.941 0.0 0.1214 + 8.750 -1.154 0.0 0.1211 + 8.760 -1.387 0.0 0.1210 + 8.770 -1.633 0.0 0.1210 + 8.780 -1.883 0.0 0.1211 + 8.790 -2.127 0.0 0.1213 + 8.800 -2.357 0.0 0.1215 + 8.810 -2.568 0.0 0.1216 + 8.820 -2.753 0.0 0.1216 + 8.830 -2.911 0.0 0.1215 + 8.840 -3.041 0.0 0.1212 + 8.850 -3.144 0.0 0.1210 + 8.860 -3.222 0.0 0.1209 + 8.870 -3.280 0.0 0.1210 + 8.880 -3.323 0.0 0.1212 + 8.890 -3.357 0.0 0.1214 + 8.900 -3.384 0.0 0.1216 + 8.910 -3.411 0.0 0.1217 + 8.920 -3.438 0.0 0.1216 + 8.930 -3.467 0.0 0.1214 + 8.940 -3.498 0.0 0.1212 + 8.950 -3.529 0.0 0.1209 + 8.960 -3.554 0.0 0.1208 + 8.970 -3.571 0.0 0.1209 + 8.980 -3.574 0.0 0.1211 + 8.990 -3.556 0.0 0.1214 + 9.000 -3.515 0.0 0.1216 + 9.010 -3.445 0.0 0.1217 + 9.020 -3.346 0.0 0.1216 + 9.030 -3.215 0.0 0.1214 + 9.040 -3.055 0.0 0.1211 + 9.050 -2.869 0.0 0.1209 + 9.060 -2.661 0.0 0.1208 + 9.070 -2.438 0.0 0.1209 + 9.080 -2.207 0.0 0.1212 + 9.090 -1.976 0.0 0.1214 + 9.100 -1.752 0.0 0.1216 + 9.110 -1.542 0.0 0.1217 + 9.120 -1.351 0.0 0.1216 + 9.130 -1.183 0.0 0.1214 + 9.140 -1.041 0.0 0.1211 + 9.150 -0.925 0.0 0.1209 + 9.160 -0.835 0.0 0.1209 + 9.170 -0.768 0.0 0.1210 + 9.180 -0.720 0.0 0.1212 + 9.190 -0.688 0.0 0.1215 + 9.200 -0.666 0.0 0.1217 + 9.210 -0.651 0.0 0.1217 + 9.220 -0.638 0.0 0.1216 + 9.230 -0.626 0.0 0.1214 + 9.240 -0.611 0.0 0.1211 + 9.250 -0.593 0.0 0.1209 + 9.260 -0.572 0.0 0.1209 + 9.270 -0.546 0.0 0.1210 + 9.280 -0.518 0.0 0.1212 + 9.290 -0.487 0.0 0.1215 + 9.300 -0.453 0.0 0.1217 + 9.310 -0.416 0.0 0.1217 + 9.320 -0.372 0.0 0.1216 + 9.330 -0.320 0.0 0.1213 + 9.340 -0.255 0.0 0.1211 + 9.350 -0.172 0.0 0.1209 + 9.360 -0.066 0.0 0.1209 + 9.370 0.070 0.0 0.1211 + 9.380 0.241 0.0 0.1213 + 9.390 0.451 0.0 0.1215 + 9.400 0.704 0.0 0.1217 + 9.410 1.001 0.0 0.1217 + 9.420 1.341 0.0 0.1215 + 9.430 1.721 0.0 0.1213 + 9.440 2.135 0.0 0.1211 + 9.450 2.576 0.0 0.1210 + 9.460 3.035 0.0 0.1210 + 9.470 3.500 0.0 0.1211 + 9.480 3.959 0.0 0.1214 + 9.490 4.403 0.0 0.1216 + 9.500 4.819 0.0 0.1217 + 9.510 5.199 0.0 0.1217 + 9.520 5.536 0.0 0.1215 + 9.530 5.823 0.0 0.1213 + 9.540 6.060 0.0 0.1210 + 9.550 6.246 0.0 0.1209 + 9.560 6.384 0.0 0.1210 + 9.570 6.477 0.0 0.1211 + 9.580 6.533 0.0 0.1214 + 9.590 6.558 0.0 0.1216 + 9.600 6.558 0.0 0.1217 + 9.610 6.541 0.0 0.1216 + 9.620 6.512 0.0 0.1215 + 9.630 6.474 0.0 0.1212 + 9.640 6.430 0.0 0.1210 + 9.650 6.379 0.0 0.1210 + 9.660 6.321 0.0 0.1210 + 9.670 6.251 0.0 0.1212 + 9.680 6.166 0.0 0.1215 + 9.690 6.060 0.0 0.1216 + 9.700 5.929 0.0 0.1217 + 9.710 5.768 0.0 0.1216 + 9.720 5.574 0.0 0.1214 + 9.730 5.346 0.0 0.1212 + 9.740 5.085 0.0 0.1210 + 9.750 4.792 0.0 0.1210 + 9.760 4.472 0.0 0.1211 + 9.770 4.132 0.0 0.1213 + 9.780 3.778 0.0 0.1215 + 9.790 3.420 0.0 0.1216 + 9.800 3.065 0.0 0.1217 + 9.810 2.722 0.0 0.1216 + 9.820 2.398 0.0 0.1214 + 9.830 2.098 0.0 0.1211 + 9.840 1.826 0.0 0.1210 + 9.850 1.584 0.0 0.1210 + 9.860 1.371 0.0 0.1211 + 9.870 1.185 0.0 0.1213 + 9.880 1.021 0.0 0.1215 + 9.890 0.875 0.0 0.1217 + 9.900 0.741 0.0 0.1216 + 9.910 0.613 0.0 0.1215 + 9.920 0.485 0.0 0.1213 + 9.930 0.354 0.0 0.1211 + 9.940 0.216 0.0 0.1210 + 9.950 0.070 0.0 0.1210 + 9.960 -0.084 0.0 0.1211 + 9.970 -0.244 0.0 0.1213 + 9.980 -0.408 0.0 0.1215 + 9.990 -0.570 0.0 0.1217 + 10.000 -0.727 0.0 0.1216 + 10.010 -0.872 0.0 0.1215 + 10.020 -1.002 0.0 0.1212 + 10.030 -1.112 0.0 0.1210 + 10.040 -1.200 0.0 0.1209 + 10.050 -1.262 0.0 0.1210 + 10.060 -1.299 0.0 0.1212 + 10.070 -1.312 0.0 0.1214 + 10.080 -1.300 0.0 0.1216 + 10.090 -1.268 0.0 0.1217 + 10.100 -1.216 0.0 0.1216 + 10.110 -1.148 0.0 0.1214 + 10.120 -1.065 0.0 0.1212 + 10.130 -0.970 0.0 0.1210 + 10.140 -0.863 0.0 0.1209 + 10.150 -0.744 0.0 0.1210 + 10.160 -0.612 0.0 0.1212 + 10.170 -0.465 0.0 0.1214 + 10.180 -0.303 0.0 0.1216 + 10.190 -0.123 0.0 0.1217 + 10.200 0.075 0.0 0.1216 + 10.210 0.293 0.0 0.1214 + 10.220 0.529 0.0 0.1212 + 10.230 0.781 0.0 0.1210 + 10.240 1.044 0.0 0.1209 + 10.250 1.314 0.0 0.1210 + 10.260 1.582 0.0 0.1212 + 10.270 1.841 0.0 0.1214 + 10.280 2.081 0.0 0.1216 + 10.290 2.293 0.0 0.1217 + 10.300 2.466 0.0 0.1216 + 10.310 2.593 0.0 0.1213 + 10.320 2.666 0.0 0.1211 + 10.330 2.679 0.0 0.1209 + 10.340 2.630 0.0 0.1209 + 10.350 2.518 0.0 0.1210 + 10.360 2.343 0.0 0.1212 + 10.370 2.109 0.0 0.1215 + 10.380 1.822 0.0 0.1216 + 10.390 1.489 0.0 0.1217 + 10.400 1.119 0.0 0.1215 + 10.410 0.718 0.0 0.1213 + 10.420 0.298 0.0 0.1211 + 10.430 -0.135 0.0 0.1209 + 10.440 -0.574 0.0 0.1209 + 10.450 -1.012 0.0 0.1210 + 10.460 -1.444 0.0 0.1212 + 10.470 -1.868 0.0 0.1214 + 10.480 -2.282 0.0 0.1216 + 10.490 -2.685 0.0 0.1216 + 10.500 -3.077 0.0 0.1215 + 10.510 -3.458 0.0 0.1213 + 10.520 -3.829 0.0 0.1211 + 10.530 -4.190 0.0 0.1210 + 10.540 -4.541 0.0 0.1210 + 10.550 -4.879 0.0 0.1211 + 10.560 -5.204 0.0 0.1213 + 10.570 -5.511 0.0 0.1215 + 10.580 -5.797 0.0 0.1217 + 10.590 -6.059 0.0 0.1216 + 10.600 -6.290 0.0 0.1215 + 10.610 -6.489 0.0 0.1213 + 10.620 -6.650 0.0 0.1211 + 10.630 -6.771 0.0 0.1210 + 10.640 -6.850 0.0 0.1210 + 10.650 -6.888 0.0 0.1211 + 10.660 -6.886 0.0 0.1214 + 10.670 -6.845 0.0 0.1216 + 10.680 -6.769 0.0 0.1217 + 10.690 -6.663 0.0 0.1216 + 10.700 -6.532 0.0 0.1215 + 10.710 -6.380 0.0 0.1213 + 10.720 -6.212 0.0 0.1211 + 10.730 -6.032 0.0 0.1210 + 10.740 -5.844 0.0 0.1211 + 10.750 -5.648 0.0 0.1212 + 10.760 -5.445 0.0 0.1214 + 10.770 -5.234 0.0 0.1216 + 10.780 -5.013 0.0 0.1217 + 10.790 -4.780 0.0 0.1216 + 10.800 -4.529 0.0 0.1214 + 10.810 -4.257 0.0 0.1212 + 10.820 -3.959 0.0 0.1211 + 10.830 -3.633 0.0 0.1210 + 10.840 -3.274 0.0 0.1211 + 10.850 -2.880 0.0 0.1213 + 10.860 -2.452 0.0 0.1215 + 10.870 -1.989 0.0 0.1216 + 10.880 -1.494 0.0 0.1217 + 10.890 -0.970 0.0 0.1215 + 10.900 -0.421 0.0 0.1214 + 10.910 0.147 0.0 0.1211 + 10.920 0.727 0.0 0.1210 + 10.930 1.315 0.0 0.1210 + 10.940 1.901 0.0 0.1211 + 10.950 2.481 0.0 0.1213 + 10.960 3.047 0.0 0.1215 + 10.970 3.594 0.0 0.1217 + 10.980 4.115 0.0 0.1217 + 10.990 4.605 0.0 0.1216 + 11.000 5.060 0.0 0.1214 + 11.010 5.475 0.0 0.1212 + 11.020 5.846 0.0 0.1210 + 11.030 6.169 0.0 0.1210 + 11.040 6.441 0.0 0.1211 + 11.050 6.658 0.0 0.1213 + 11.060 6.817 0.0 0.1215 + 11.070 6.915 0.0 0.1216 + 11.080 6.950 0.0 0.1216 + 11.090 6.919 0.0 0.1215 + 11.100 6.823 0.0 0.1213 + 11.110 6.661 0.0 0.1211 + 11.120 6.434 0.0 0.1210 + 11.130 6.144 0.0 0.1210 + 11.140 5.793 0.0 0.1212 + 11.150 5.386 0.0 0.1214 + 11.160 4.929 0.0 0.1215 + 11.170 4.427 0.0 0.1216 + 11.180 3.888 0.0 0.1216 + 11.190 3.318 0.0 0.1214 + 11.200 2.725 0.0 0.1212 + 11.210 2.117 0.0 0.1211 + 11.220 1.502 0.0 0.1210 + 11.230 0.885 0.0 0.1210 + 11.240 0.272 0.0 0.1212 + 11.250 -0.330 0.0 0.1213 + 11.260 -0.918 0.0 0.1215 + 11.270 -1.488 0.0 0.1215 + 11.280 -2.037 0.0 0.1215 + 11.290 -2.563 0.0 0.1213 + 11.300 -3.065 0.0 0.1211 + 11.310 -3.539 0.0 0.1210 + 11.320 -3.986 0.0 0.1209 + 11.330 -4.404 0.0 0.1210 + 11.340 -4.791 0.0 0.1212 + 11.350 -5.146 0.0 0.1214 + 11.360 -5.467 0.0 0.1216 + 11.370 -5.752 0.0 0.1216 + 11.380 -5.999 0.0 0.1215 + 11.390 -6.206 0.0 0.1213 + 11.400 -6.371 0.0 0.1211 + 11.410 -6.493 0.0 0.1210 + 11.420 -6.571 0.0 0.1209 + 11.430 -6.605 0.0 0.1210 + 11.440 -6.595 0.0 0.1212 + 11.450 -6.543 0.0 0.1214 + 11.460 -6.450 0.0 0.1216 + 11.470 -6.319 0.0 0.1216 + 11.480 -6.154 0.0 0.1215 + 11.490 -5.958 0.0 0.1213 + 11.500 -5.735 0.0 0.1211 + 11.510 -5.488 0.0 0.1210 + 11.520 -5.222 0.0 0.1210 + 11.530 -4.940 0.0 0.1211 + 11.540 -4.646 0.0 0.1213 + 11.550 -4.342 0.0 0.1215 + 11.560 -4.031 0.0 0.1216 + 11.570 -3.713 0.0 0.1216 + 11.580 -3.391 0.0 0.1215 + 11.590 -3.064 0.0 0.1213 + 11.600 -2.734 0.0 0.1211 + 11.610 -2.399 0.0 0.1210 + 11.620 -2.062 0.0 0.1210 + 11.630 -1.720 0.0 0.1211 + 11.640 -1.375 0.0 0.1213 + 11.650 -1.026 0.0 0.1215 + 11.660 -0.673 0.0 0.1216 + 11.670 -0.319 0.0 0.1216 + 11.680 0.038 0.0 0.1215 + 11.690 0.395 0.0 0.1212 + 11.700 0.752 0.0 0.1210 + 11.710 1.106 0.0 0.1210 + 11.720 1.456 0.0 0.1210 + 11.730 1.800 0.0 0.1212 + 11.740 2.136 0.0 0.1214 + 11.750 2.461 0.0 0.1216 + 11.760 2.774 0.0 0.1217 + 11.770 3.071 0.0 0.1216 + 11.780 3.351 0.0 0.1215 + 11.790 3.611 0.0 0.1213 + 11.800 3.849 0.0 0.1211 + 11.810 4.063 0.0 0.1210 + 11.820 4.251 0.0 0.1210 + 11.830 4.411 0.0 0.1212 + 11.840 4.542 0.0 0.1214 + 11.850 4.644 0.0 0.1216 + 11.860 4.718 0.0 0.1216 + 11.870 4.763 0.0 0.1215 + 11.880 4.782 0.0 0.1214 + 11.890 4.776 0.0 0.1212 + 11.900 4.749 0.0 0.1210 + 11.910 4.704 0.0 0.1210 + 11.920 4.644 0.0 0.1211 + 11.930 4.574 0.0 0.1213 + 11.940 4.496 0.0 0.1215 + 11.950 4.416 0.0 0.1217 + 11.960 4.334 0.0 0.1217 + 11.970 4.254 0.0 0.1216 + 11.980 4.177 0.0 0.1214 + 11.990 4.102 0.0 0.1212 + 12.000 4.030 0.0 0.1211 + 12.010 3.959 0.0 0.1210 + 12.020 3.886 0.0 0.1211 + 12.030 3.809 0.0 0.1213 + 12.040 3.725 0.0 0.1215 + 12.050 3.631 0.0 0.1216 + 12.060 3.524 0.0 0.1217 + 12.070 3.403 0.0 0.1216 + 12.080 3.266 0.0 0.1214 + 12.090 3.115 0.0 0.1212 + 12.100 2.950 0.0 0.1211 + 12.110 2.775 0.0 0.1211 + 12.120 2.593 0.0 0.1212 + 12.130 2.411 0.0 0.1214 + 12.140 2.233 0.0 0.1215 + 12.150 2.066 0.0 0.1216 + 12.160 1.916 0.0 0.1216 + 12.170 1.789 0.0 0.1215 + 12.180 1.690 0.0 0.1213 + 12.190 1.622 0.0 0.1211 + 12.200 1.587 0.0 0.1210 + 12.210 1.587 0.0 0.1210 + 12.220 1.620 0.0 0.1211 + 12.230 1.684 0.0 0.1213 + 12.240 1.774 0.0 0.1215 + 12.250 1.886 0.0 0.1216 + 12.260 2.013 0.0 0.1216 + 12.270 2.150 0.0 0.1215 + 12.280 2.290 0.0 0.1213 + 12.290 2.427 0.0 0.1211 + 12.300 2.556 0.0 0.1210 + 12.310 2.673 0.0 0.1210 + 12.320 2.775 0.0 0.1212 + 12.330 2.860 0.0 0.1213 + 12.340 2.928 0.0 0.1215 + 12.350 2.979 0.0 0.1215 + 12.360 3.015 0.0 0.1215 + 12.370 3.036 0.0 0.1214 + 12.380 3.046 0.0 0.1212 + 12.390 3.045 0.0 0.1211 + 12.400 3.035 0.0 0.1210 + 12.410 3.016 0.0 0.1211 + 12.420 2.987 0.0 0.1212 + 12.430 2.947 0.0 0.1214 + 12.440 2.894 0.0 0.1215 + 12.450 2.825 0.0 0.1216 + 12.460 2.736 0.0 0.1215 + 12.470 2.625 0.0 0.1213 + 12.480 2.488 0.0 0.1211 + 12.490 2.322 0.0 0.1210 + 12.500 2.127 0.0 0.1209 + 12.510 1.901 0.0 0.1210 + 12.520 1.647 0.0 0.1212 + 12.530 1.367 0.0 0.1214 + 12.540 1.064 0.0 0.1215 + 12.550 0.745 0.0 0.1215 + 12.560 0.416 0.0 0.1214 + 12.570 0.083 0.0 0.1213 + 12.580 -0.245 0.0 0.1211 + 12.590 -0.561 0.0 0.1210 + 12.600 -0.858 0.0 0.1210 + 12.610 -1.131 0.0 0.1211 + 12.620 -1.376 0.0 0.1213 + 12.630 -1.588 0.0 0.1215 + 12.640 -1.767 0.0 0.1216 + 12.650 -1.912 0.0 0.1216 + 12.660 -2.026 0.0 0.1214 + 12.670 -2.111 0.0 0.1212 + 12.680 -2.172 0.0 0.1210 + 12.690 -2.212 0.0 0.1209 + 12.700 -2.237 0.0 0.1210 + 12.710 -2.251 0.0 0.1211 + 12.720 -2.259 0.0 0.1213 + 12.730 -2.264 0.0 0.1215 + 12.740 -2.269 0.0 0.1216 + 12.750 -2.276 0.0 0.1216 + 12.760 -2.285 0.0 0.1215 + 12.770 -2.297 0.0 0.1213 + 12.780 -2.310 0.0 0.1211 + 12.790 -2.324 0.0 0.1210 + 12.800 -2.336 0.0 0.1210 + 12.810 -2.345 0.0 0.1212 + 12.820 -2.350 0.0 0.1214 + 12.830 -2.349 0.0 0.1216 + 12.840 -2.343 0.0 0.1216 + 12.850 -2.333 0.0 0.1216 + 12.860 -2.319 0.0 0.1214 + 12.870 -2.303 0.0 0.1212 + 12.880 -2.289 0.0 0.1211 + 12.890 -2.279 0.0 0.1210 + 12.900 -2.275 0.0 0.1210 + 12.910 -2.282 0.0 0.1212 + 12.920 -2.301 0.0 0.1214 + 12.930 -2.333 0.0 0.1216 + 12.940 -2.381 0.0 0.1217 + 12.950 -2.444 0.0 0.1216 + 12.960 -2.521 0.0 0.1215 + 12.970 -2.612 0.0 0.1212 + 12.980 -2.712 0.0 0.1210 + 12.990 -2.820 0.0 0.1210 + 13.000 -2.931 0.0 0.1210 + 13.010 -3.043 0.0 0.1212 + 13.020 -3.150 0.0 0.1214 + 13.030 -3.251 0.0 0.1216 + 13.040 -3.342 0.0 0.1217 + 13.050 -3.420 0.0 0.1216 + 13.060 -3.485 0.0 0.1215 + 13.070 -3.535 0.0 0.1213 + 13.080 -3.570 0.0 0.1211 + 13.090 -3.592 0.0 0.1210 + 13.100 -3.601 0.0 0.1211 + 13.110 -3.599 0.0 0.1212 + 13.120 -3.589 0.0 0.1214 + 13.130 -3.571 0.0 0.1216 + 13.140 -3.549 0.0 0.1216 + 13.150 -3.524 0.0 0.1216 + 13.160 -3.497 0.0 0.1214 + 13.170 -3.469 0.0 0.1212 + 13.180 -3.441 0.0 0.1211 + 13.190 -3.412 0.0 0.1210 + 13.200 -3.381 0.0 0.1211 + 13.210 -3.349 0.0 0.1213 + 13.220 -3.314 0.0 0.1215 + 13.230 -3.273 0.0 0.1216 + 13.240 -3.226 0.0 0.1216 + 13.250 -3.170 0.0 0.1216 + 13.260 -3.105 0.0 0.1214 + 13.270 -3.028 0.0 0.1212 + 13.280 -2.939 0.0 0.1211 + 13.290 -2.836 0.0 0.1210 + 13.300 -2.719 0.0 0.1211 + 13.310 -2.587 0.0 0.1213 + 13.320 -2.440 0.0 0.1214 + 13.330 -2.277 0.0 0.1215 + 13.340 -2.100 0.0 0.1216 + 13.350 -1.907 0.0 0.1215 + 13.360 -1.701 0.0 0.1213 + 13.370 -1.483 0.0 0.1212 + 13.380 -1.252 0.0 0.1211 + 13.390 -1.012 0.0 0.1211 + 13.400 -0.763 0.0 0.1212 + 13.410 -0.508 0.0 0.1213 + 13.420 -0.251 0.0 0.1215 + 13.430 0.007 0.0 0.1216 + 13.440 0.261 0.0 0.1215 + 13.450 0.507 0.0 0.1214 + 13.460 0.743 0.0 0.1212 + 13.470 0.962 0.0 0.1211 + 13.480 1.162 0.0 0.1210 + 13.490 1.338 0.0 0.1210 + 13.500 1.486 0.0 0.1212 + 13.510 1.604 0.0 0.1213 + 13.520 1.689 0.0 0.1215 + 13.530 1.739 0.0 0.1216 + 13.540 1.755 0.0 0.1215 + 13.550 1.735 0.0 0.1214 + 13.560 1.682 0.0 0.1213 + 13.570 1.599 0.0 0.1212 + 13.580 1.489 0.0 0.1211 + 13.590 1.357 0.0 0.1211 + 13.600 1.208 0.0 0.1212 + 13.610 1.047 0.0 0.1213 + 13.620 0.882 0.0 0.1214 + 13.630 0.717 0.0 0.1215 + 13.640 0.559 0.0 0.1214 + 13.650 0.412 0.0 0.1213 + 13.660 0.282 0.0 0.1211 + 13.670 0.171 0.0 0.1211 + 13.680 0.081 0.0 0.1210 + 13.690 0.014 0.0 0.1211 + 13.700 -0.031 0.0 0.1213 + 13.710 -0.054 0.0 0.1214 + 13.720 -0.059 0.0 0.1215 + 13.730 -0.048 0.0 0.1215 + 13.740 -0.025 0.0 0.1214 + 13.750 0.006 0.0 0.1213 + 13.760 0.041 0.0 0.1211 + 13.770 0.075 0.0 0.1210 + 13.780 0.105 0.0 0.1210 + 13.790 0.128 0.0 0.1211 + 13.800 0.141 0.0 0.1213 + 13.810 0.143 0.0 0.1215 + 13.820 0.131 0.0 0.1216 + 13.830 0.107 0.0 0.1215 + 13.840 0.070 0.0 0.1214 + 13.850 0.021 0.0 0.1213 + 13.860 -0.039 0.0 0.1212 + 13.870 -0.109 0.0 0.1211 + 13.880 -0.187 0.0 0.1211 + 13.890 -0.273 0.0 0.1212 + 13.900 -0.364 0.0 0.1214 + 13.910 -0.461 0.0 0.1215 + 13.920 -0.564 0.0 0.1216 + 13.930 -0.671 0.0 0.1215 + 13.940 -0.782 0.0 0.1214 + 13.950 -0.897 0.0 0.1212 + 13.960 -1.017 0.0 0.1210 + 13.970 -1.138 0.0 0.1210 + 13.980 -1.261 0.0 0.1210 + 13.990 -1.381 0.0 0.1212 + 14.000 -1.497 0.0 0.1214 + 14.010 -1.605 0.0 0.1215 + 14.020 -1.699 0.0 0.1216 + 14.030 -1.774 0.0 0.1216 + 14.040 -1.825 0.0 0.1214 + 14.050 -1.846 0.0 0.1212 + 14.060 -1.830 0.0 0.1211 + 14.070 -1.775 0.0 0.1210 + 14.080 -1.674 0.0 0.1211 + 14.090 -1.526 0.0 0.1212 + 14.100 -1.330 0.0 0.1214 + 14.110 -1.085 0.0 0.1215 + 14.120 -0.795 0.0 0.1216 + 14.130 -0.463 0.0 0.1215 + 14.140 -0.094 0.0 0.1214 + 14.150 0.302 0.0 0.1212 + 14.160 0.720 0.0 0.1211 + 14.170 1.148 0.0 0.1211 + 14.180 1.579 0.0 0.1212 + 14.190 2.002 0.0 0.1213 + 14.200 2.410 0.0 0.1215 + 14.210 2.795 0.0 0.1216 + 14.220 3.150 0.0 0.1216 + 14.230 3.470 0.0 0.1215 + 14.240 3.753 0.0 0.1214 + 14.250 3.998 0.0 0.1212 + 14.260 4.203 0.0 0.1211 + 14.270 4.370 0.0 0.1211 + 14.280 4.503 0.0 0.1212 + 14.290 4.603 0.0 0.1213 + 14.300 4.674 0.0 0.1215 + 14.310 4.722 0.0 0.1216 + 14.320 4.748 0.0 0.1216 + 14.330 4.756 0.0 0.1215 + 14.340 4.750 0.0 0.1214 + 14.350 4.732 0.0 0.1212 + 14.360 4.703 0.0 0.1211 + 14.370 4.666 0.0 0.1211 + 14.380 4.622 0.0 0.1212 + 14.390 4.572 0.0 0.1213 + 14.400 4.519 0.0 0.1215 + 14.410 4.464 0.0 0.1215 + 14.420 4.410 0.0 0.1215 + 14.430 4.361 0.0 0.1215 + 14.440 4.320 0.0 0.1213 + 14.450 4.290 0.0 0.1212 + 14.460 4.276 0.0 0.1211 + 14.470 4.282 0.0 0.1211 + 14.480 4.310 0.0 0.1212 + 14.490 4.363 0.0 0.1214 + 14.500 4.442 0.0 0.1215 + 14.510 4.546 0.0 0.1216 + 14.520 4.674 0.0 0.1216 + 14.530 4.820 0.0 0.1215 + 14.540 4.980 0.0 0.1213 + 14.550 5.145 0.0 0.1211 + 14.560 5.308 0.0 0.1211 + 14.570 5.460 0.0 0.1211 + 14.580 5.591 0.0 0.1212 + 14.590 5.691 0.0 0.1213 + 14.600 5.752 0.0 0.1214 + 14.610 5.768 0.0 0.1215 + 14.620 5.734 0.0 0.1214 + 14.630 5.646 0.0 0.1213 + 14.640 5.503 0.0 0.1212 + 14.650 5.307 0.0 0.1211 + 14.660 5.063 0.0 0.1210 + 14.670 4.775 0.0 0.1211 + 14.680 4.451 0.0 0.1212 + 14.690 4.098 0.0 0.1214 + 14.700 3.724 0.0 0.1215 + 14.710 3.337 0.0 0.1215 + 14.720 2.945 0.0 0.1215 + 14.730 2.554 0.0 0.1213 + 14.740 2.166 0.0 0.1212 + 14.750 1.786 0.0 0.1211 + 14.760 1.414 0.0 0.1211 + 14.770 1.049 0.0 0.1211 + 14.780 0.689 0.0 0.1213 + 14.790 0.333 0.0 0.1214 + 14.800 -0.023 0.0 0.1215 + 14.810 -0.383 0.0 0.1215 + 14.820 -0.746 0.0 0.1215 + 14.830 -1.116 0.0 0.1213 + 14.840 -1.491 0.0 0.1212 + 14.850 -1.869 0.0 0.1211 + 14.860 -2.248 0.0 0.1211 + 14.870 -2.622 0.0 0.1211 + 14.880 -2.986 0.0 0.1213 + 14.890 -3.333 0.0 0.1214 + 14.900 -3.657 0.0 0.1215 + 14.910 -3.952 0.0 0.1215 + 14.920 -4.213 0.0 0.1214 + 14.930 -4.434 0.0 0.1213 + 14.940 -4.615 0.0 0.1212 + 14.950 -4.754 0.0 0.1211 + 14.960 -4.852 0.0 0.1211 + 14.970 -4.914 0.0 0.1212 + 14.980 -4.942 0.0 0.1213 + 14.990 -4.942 0.0 0.1215 + 15.000 -4.921 0.0 0.1215 + 15.010 -4.884 0.0 0.1215 + 15.020 -4.837 0.0 0.1214 + 15.030 -4.785 0.0 0.1213 + 15.040 -4.730 0.0 0.1211 + 15.050 -4.676 0.0 0.1211 + 15.060 -4.622 0.0 0.1211 + 15.070 -4.568 0.0 0.1212 + 15.080 -4.511 0.0 0.1213 + 15.090 -4.449 0.0 0.1215 + 15.100 -4.380 0.0 0.1215 + 15.110 -4.299 0.0 0.1215 + 15.120 -4.204 0.0 0.1214 + 15.130 -4.096 0.0 0.1212 + 15.140 -3.973 0.0 0.1211 + 15.150 -3.838 0.0 0.1211 + 15.160 -3.693 0.0 0.1211 + 15.170 -3.544 0.0 0.1213 + 15.180 -3.397 0.0 0.1214 + 15.190 -3.257 0.0 0.1215 + 15.200 -3.131 0.0 0.1215 + 15.210 -3.025 0.0 0.1215 + 15.220 -2.943 0.0 0.1213 + 15.230 -2.888 0.0 0.1212 + 15.240 -2.862 0.0 0.1211 + 15.250 -2.863 0.0 0.1211 + 15.260 -2.888 0.0 0.1212 + 15.270 -2.931 0.0 0.1213 + 15.280 -2.986 0.0 0.1215 + 15.290 -3.044 0.0 0.1216 + 15.300 -3.097 0.0 0.1216 + 15.310 -3.137 0.0 0.1215 + 15.320 -3.155 0.0 0.1213 + 15.330 -3.146 0.0 0.1212 + 15.340 -3.106 0.0 0.1211 + 15.350 -3.035 0.0 0.1211 + 15.360 -2.932 0.0 0.1212 + 15.370 -2.804 0.0 0.1213 + 15.380 -2.654 0.0 0.1215 + 15.390 -2.492 0.0 0.1216 + 15.400 -2.326 0.0 0.1216 + 15.410 -2.165 0.0 0.1215 + 15.420 -2.018 0.0 0.1213 + 15.430 -1.892 0.0 0.1212 + 15.440 -1.793 0.0 0.1211 + 15.450 -1.725 0.0 0.1211 + 15.460 -1.687 0.0 0.1212 + 15.470 -1.677 0.0 0.1214 + 15.480 -1.690 0.0 0.1215 + 15.490 -1.720 0.0 0.1216 + 15.500 -1.757 0.0 0.1216 + 15.510 -1.793 0.0 0.1215 + 15.520 -1.819 0.0 0.1213 + 15.530 -1.825 0.0 0.1212 + 15.540 -1.806 0.0 0.1211 + 15.550 -1.757 0.0 0.1211 + 15.560 -1.677 0.0 0.1212 + 15.570 -1.566 0.0 0.1214 + 15.580 -1.430 0.0 0.1215 + 15.590 -1.273 0.0 0.1216 + 15.600 -1.106 0.0 0.1215 + 15.610 -0.939 0.0 0.1214 + 15.620 -0.782 0.0 0.1213 + 15.630 -0.645 0.0 0.1211 + 15.640 -0.537 0.0 0.1211 + 15.650 -0.467 0.0 0.1211 + 15.660 -0.437 0.0 0.1212 + 15.670 -0.450 0.0 0.1214 + 15.680 -0.505 0.0 0.1215 + 15.690 -0.596 0.0 0.1216 + 15.700 -0.716 0.0 0.1215 + 15.710 -0.857 0.0 0.1214 + 15.720 -1.006 0.0 0.1212 + 15.730 -1.152 0.0 0.1211 + 15.740 -1.284 0.0 0.1210 + 15.750 -1.392 0.0 0.1211 + 15.760 -1.465 0.0 0.1212 + 15.770 -1.498 0.0 0.1214 + 15.780 -1.486 0.0 0.1215 + 15.790 -1.428 0.0 0.1215 + 15.800 -1.325 0.0 0.1215 + 15.810 -1.181 0.0 0.1213 + 15.820 -1.001 0.0 0.1212 + 15.830 -0.793 0.0 0.1211 + 15.840 -0.564 0.0 0.1210 + 15.850 -0.323 0.0 0.1211 + 15.860 -0.078 0.0 0.1212 + 15.870 0.164 0.0 0.1214 + 15.880 0.398 0.0 0.1215 + 15.890 0.619 0.0 0.1215 + 15.900 0.824 0.0 0.1214 + 15.910 1.010 0.0 0.1213 + 15.920 1.178 0.0 0.1211 + 15.930 1.328 0.0 0.1210 + 15.940 1.459 0.0 0.1210 + 15.950 1.574 0.0 0.1211 + 15.960 1.671 0.0 0.1212 + 15.970 1.752 0.0 0.1214 + 15.980 1.815 0.0 0.1215 + 15.990 1.860 0.0 0.1215 + 16.000 1.884 0.0 0.1214 + 16.010 1.885 0.0 0.1213 + 16.020 1.861 0.0 0.1212 + 16.030 1.810 0.0 0.1211 + 16.040 1.731 0.0 0.1211 + 16.050 1.623 0.0 0.1212 + 16.060 1.488 0.0 0.1213 + 16.070 1.326 0.0 0.1214 + 16.080 1.143 0.0 0.1215 + 16.090 0.942 0.0 0.1215 + 16.100 0.731 0.0 0.1214 + 16.110 0.516 0.0 0.1213 + 16.120 0.305 0.0 0.1211 + 16.130 0.106 0.0 0.1211 + 16.140 -0.075 0.0 0.1211 + 16.150 -0.230 0.0 0.1212 + 16.160 -0.355 0.0 0.1213 + 16.170 -0.444 0.0 0.1215 + 16.180 -0.496 0.0 0.1215 + 16.190 -0.510 0.0 0.1215 + 16.200 -0.484 0.0 0.1214 + 16.210 -0.421 0.0 0.1212 + 16.220 -0.323 0.0 0.1211 + 16.230 -0.192 0.0 0.1211 + 16.240 -0.032 0.0 0.1211 + 16.250 0.155 0.0 0.1212 + 16.260 0.366 0.0 0.1213 + 16.270 0.599 0.0 0.1215 + 16.280 0.852 0.0 0.1215 + 16.290 1.124 0.0 0.1215 + 16.300 1.413 0.0 0.1214 + 16.310 1.720 0.0 0.1212 + 16.320 2.042 0.0 0.1211 + 16.330 2.378 0.0 0.1211 + 16.340 2.725 0.0 0.1212 + 16.350 3.079 0.0 0.1213 + 16.360 3.437 0.0 0.1215 + 16.370 3.793 0.0 0.1216 + 16.380 4.141 0.0 0.1216 + 16.390 4.475 0.0 0.1215 + 16.400 4.786 0.0 0.1214 + 16.410 5.070 0.0 0.1212 + 16.420 5.319 0.0 0.1211 + 16.430 5.529 0.0 0.1211 + 16.440 5.696 0.0 0.1212 + 16.450 5.818 0.0 0.1213 + 16.460 5.897 0.0 0.1214 + 16.470 5.932 0.0 0.1215 + 16.480 5.929 0.0 0.1215 + 16.490 5.891 0.0 0.1215 + 16.500 5.825 0.0 0.1213 + 16.510 5.736 0.0 0.1212 + 16.520 5.630 0.0 0.1211 + 16.530 5.513 0.0 0.1211 + 16.540 5.388 0.0 0.1212 + 16.550 5.258 0.0 0.1213 + 16.560 5.123 0.0 0.1215 + 16.570 4.982 0.0 0.1215 + 16.580 4.832 0.0 0.1215 + 16.590 4.669 0.0 0.1214 + 16.600 4.487 0.0 0.1213 + 16.610 4.280 0.0 0.1212 + 16.620 4.045 0.0 0.1211 + 16.630 3.776 0.0 0.1211 + 16.640 3.472 0.0 0.1212 + 16.650 3.131 0.0 0.1214 + 16.660 2.757 0.0 0.1215 + 16.670 2.352 0.0 0.1216 + 16.680 1.925 0.0 0.1215 + 16.690 1.484 0.0 0.1214 + 16.700 1.040 0.0 0.1213 + 16.710 0.603 0.0 0.1212 + 16.720 0.185 0.0 0.1211 + 16.730 -0.203 0.0 0.1211 + 16.740 -0.553 0.0 0.1212 + 16.750 -0.856 0.0 0.1213 + 16.760 -1.110 0.0 0.1215 + 16.770 -1.313 0.0 0.1215 + 16.780 -1.465 0.0 0.1215 + 16.790 -1.573 0.0 0.1214 + 16.800 -1.643 0.0 0.1212 + 16.810 -1.684 0.0 0.1211 + 16.820 -1.705 0.0 0.1211 + 16.830 -1.716 0.0 0.1212 + 16.840 -1.727 0.0 0.1213 + 16.850 -1.746 0.0 0.1214 + 16.860 -1.778 0.0 0.1215 + 16.870 -1.826 0.0 0.1215 + 16.880 -1.892 0.0 0.1214 + 16.890 -1.972 0.0 0.1213 + 16.900 -2.062 0.0 0.1212 + 16.910 -2.154 0.0 0.1211 + 16.920 -2.241 0.0 0.1211 + 16.930 -2.313 0.0 0.1211 + 16.940 -2.362 0.0 0.1213 + 16.950 -2.379 0.0 0.1214 + 16.960 -2.360 0.0 0.1215 + 16.970 -2.299 0.0 0.1215 + 16.980 -2.197 0.0 0.1214 + 16.990 -2.055 0.0 0.1213 + 17.000 -1.878 0.0 0.1212 + 17.010 -1.673 0.0 0.1211 + 17.020 -1.449 0.0 0.1211 + 17.030 -1.216 0.0 0.1212 + 17.040 -0.985 0.0 0.1213 + 17.050 -0.766 0.0 0.1214 + 17.060 -0.568 0.0 0.1215 + 17.070 -0.398 0.0 0.1215 + 17.080 -0.261 0.0 0.1214 + 17.090 -0.159 0.0 0.1212 + 17.100 -0.093 0.0 0.1211 + 17.110 -0.060 0.0 0.1210 + 17.120 -0.056 0.0 0.1211 + 17.130 -0.073 0.0 0.1212 + 17.140 -0.105 0.0 0.1213 + 17.150 -0.146 0.0 0.1215 + 17.160 -0.187 0.0 0.1215 + 17.170 -0.223 0.0 0.1215 + 17.180 -0.250 0.0 0.1214 + 17.190 -0.266 0.0 0.1213 + 17.200 -0.270 0.0 0.1211 + 17.210 -0.264 0.0 0.1211 + 17.220 -0.252 0.0 0.1211 + 17.230 -0.237 0.0 0.1212 + 17.240 -0.226 0.0 0.1213 + 17.250 -0.225 0.0 0.1215 + 17.260 -0.238 0.0 0.1215 + 17.270 -0.270 0.0 0.1215 + 17.280 -0.325 0.0 0.1214 + 17.290 -0.405 0.0 0.1212 + 17.300 -0.509 0.0 0.1211 + 17.310 -0.636 0.0 0.1211 + 17.320 -0.782 0.0 0.1211 + 17.330 -0.943 0.0 0.1213 + 17.340 -1.114 0.0 0.1214 + 17.350 -1.289 0.0 0.1215 + 17.360 -1.462 0.0 0.1216 + 17.370 -1.629 0.0 0.1215 + 17.380 -1.783 0.0 0.1214 + 17.390 -1.923 0.0 0.1212 + 17.400 -2.046 0.0 0.1211 + 17.410 -2.151 0.0 0.1211 + 17.420 -2.237 0.0 0.1211 + 17.430 -2.307 0.0 0.1213 + 17.440 -2.360 0.0 0.1214 + 17.450 -2.399 0.0 0.1215 + 17.460 -2.425 0.0 0.1216 + 17.470 -2.439 0.0 0.1215 + 17.480 -2.441 0.0 0.1214 + 17.490 -2.431 0.0 0.1213 + 17.500 -2.407 0.0 0.1211 + 17.510 -2.369 0.0 0.1211 + 17.520 -2.313 0.0 0.1212 + 17.530 -2.239 0.0 0.1213 + 17.540 -2.145 0.0 0.1214 + 17.550 -2.031 0.0 0.1215 + 17.560 -1.896 0.0 0.1215 + 17.570 -1.743 0.0 0.1215 + 17.580 -1.575 0.0 0.1213 + 17.590 -1.397 0.0 0.1212 + 17.600 -1.216 0.0 0.1211 + 17.610 -1.038 0.0 0.1211 + 17.620 -0.873 0.0 0.1212 + 17.630 -0.727 0.0 0.1213 + 17.640 -0.610 0.0 0.1215 + 17.650 -0.528 0.0 0.1216 + 17.660 -0.486 0.0 0.1216 + 17.670 -0.488 0.0 0.1215 + 17.680 -0.536 0.0 0.1214 + 17.690 -0.628 0.0 0.1212 + 17.700 -0.761 0.0 0.1211 + 17.710 -0.930 0.0 0.1211 + 17.720 -1.127 0.0 0.1212 + 17.730 -1.343 0.0 0.1213 + 17.740 -1.570 0.0 0.1215 + 17.750 -1.797 0.0 0.1215 + 17.760 -2.015 0.0 0.1215 + 17.770 -2.217 0.0 0.1214 + 17.780 -2.396 0.0 0.1213 + 17.790 -2.547 0.0 0.1211 + 17.800 -2.666 0.0 0.1211 + 17.810 -2.754 0.0 0.1211 + 17.820 -2.810 0.0 0.1212 + 17.830 -2.837 0.0 0.1214 + 17.840 -2.839 0.0 0.1215 + 17.850 -2.819 0.0 0.1216 + 17.860 -2.781 0.0 0.1215 + 17.870 -2.730 0.0 0.1214 + 17.880 -2.668 0.0 0.1213 + 17.890 -2.599 0.0 0.1211 + 17.900 -2.522 0.0 0.1210 + 17.910 -2.438 0.0 0.1211 + 17.920 -2.346 0.0 0.1212 + 17.930 -2.244 0.0 0.1213 + 17.940 -2.130 0.0 0.1214 + 17.950 -2.001 0.0 0.1215 + 17.960 -1.855 0.0 0.1215 + 17.970 -1.690 0.0 0.1214 + 17.980 -1.505 0.0 0.1213 + 17.990 -1.302 0.0 0.1211 + 18.000 -1.080 0.0 0.1211 + 18.010 -0.845 0.0 0.1211 + 18.020 -0.598 0.0 0.1212 + 18.030 -0.344 0.0 0.1213 + 18.040 -0.090 0.0 0.1215 + 18.050 0.161 0.0 0.1215 + 18.060 0.404 0.0 0.1215 + 18.070 0.635 0.0 0.1214 + 18.080 0.849 0.0 0.1212 + 18.090 1.047 0.0 0.1211 + 18.100 1.226 0.0 0.1211 + 18.110 1.387 0.0 0.1211 + 18.120 1.532 0.0 0.1212 + 18.130 1.662 0.0 0.1214 + 18.140 1.779 0.0 0.1215 + 18.150 1.887 0.0 0.1215 + 18.160 1.987 0.0 0.1214 + 18.170 2.081 0.0 0.1213 + 18.180 2.170 0.0 0.1212 + 18.190 2.251 0.0 0.1211 + 18.200 2.325 0.0 0.1211 + 18.210 2.388 0.0 0.1212 + 18.220 2.437 0.0 0.1213 + 18.230 2.467 0.0 0.1214 + 18.240 2.475 0.0 0.1214 + 18.250 2.457 0.0 0.1215 + 18.260 2.410 0.0 0.1214 + 18.270 2.332 0.0 0.1213 + 18.280 2.224 0.0 0.1212 + 18.290 2.086 0.0 0.1211 + 18.300 1.922 0.0 0.1211 + 18.310 1.736 0.0 0.1212 + 18.320 1.534 0.0 0.1213 + 18.330 1.324 0.0 0.1214 + 18.340 1.113 0.0 0.1215 + 18.350 0.909 0.0 0.1215 + 18.360 0.719 0.0 0.1214 + 18.370 0.550 0.0 0.1213 + 18.380 0.406 0.0 0.1212 + 18.390 0.291 0.0 0.1211 + 18.400 0.207 0.0 0.1211 + 18.410 0.153 0.0 0.1212 + 18.420 0.127 0.0 0.1213 + 18.430 0.126 0.0 0.1214 + 18.440 0.145 0.0 0.1215 + 18.450 0.180 0.0 0.1215 + 18.460 0.224 0.0 0.1214 + 18.470 0.273 0.0 0.1213 + 18.480 0.323 0.0 0.1212 + 18.490 0.370 0.0 0.1212 + 18.500 0.413 0.0 0.1212 + 18.510 0.452 0.0 0.1213 + 18.520 0.486 0.0 0.1214 + 18.530 0.519 0.0 0.1215 + 18.540 0.553 0.0 0.1215 + 18.550 0.592 0.0 0.1214 + 18.560 0.640 0.0 0.1213 + 18.570 0.700 0.0 0.1212 + 18.580 0.775 0.0 0.1212 + 18.590 0.866 0.0 0.1212 + 18.600 0.973 0.0 0.1212 + 18.610 1.097 0.0 0.1213 + 18.620 1.233 0.0 0.1214 + 18.630 1.379 0.0 0.1215 + 18.640 1.530 0.0 0.1215 + 18.650 1.681 0.0 0.1215 + 18.660 1.827 0.0 0.1213 + 18.670 1.963 0.0 0.1212 + 18.680 2.085 0.0 0.1212 + 18.690 2.188 0.0 0.1212 + 18.700 2.271 0.0 0.1212 + 18.710 2.333 0.0 0.1213 + 18.720 2.374 0.0 0.1215 + 18.730 2.396 0.0 0.1215 + 18.740 2.402 0.0 0.1215 + 18.750 2.394 0.0 0.1214 + 18.760 2.376 0.0 0.1213 + 18.770 2.351 0.0 0.1212 + 18.780 2.323 0.0 0.1211 + 18.790 2.292 0.0 0.1211 + 18.800 2.261 0.0 0.1212 + 18.810 2.228 0.0 0.1214 + 18.820 2.193 0.0 0.1215 + 18.830 2.154 0.0 0.1215 + 18.840 2.106 0.0 0.1215 + 18.850 2.047 0.0 0.1214 + 18.860 1.973 0.0 0.1213 + 18.870 1.880 0.0 0.1211 + 18.880 1.767 0.0 0.1211 + 18.890 1.631 0.0 0.1211 + 18.900 1.474 0.0 0.1212 + 18.910 1.296 0.0 0.1213 + 18.920 1.100 0.0 0.1214 + 18.930 0.892 0.0 0.1215 + 18.940 0.678 0.0 0.1215 + 18.950 0.462 0.0 0.1214 + 18.960 0.254 0.0 0.1213 + 18.970 0.060 0.0 0.1212 + 18.980 -0.114 0.0 0.1211 + 18.990 -0.262 0.0 0.1212 + 19.000 -0.380 0.0 0.1213 + 19.010 -0.465 0.0 0.1214 + 19.020 -0.517 0.0 0.1215 + 19.030 -0.536 0.0 0.1215 + 19.040 -0.526 0.0 0.1214 + 19.050 -0.490 0.0 0.1213 + 19.060 -0.434 0.0 0.1212 + 19.070 -0.363 0.0 0.1211 + 19.080 -0.284 0.0 0.1211 + 19.090 -0.203 0.0 0.1211 + 19.100 -0.125 0.0 0.1212 + 19.110 -0.055 0.0 0.1214 + 19.120 0.005 0.0 0.1215 + 19.130 0.054 0.0 0.1215 + 19.140 0.090 0.0 0.1214 + 19.150 0.114 0.0 0.1213 + 19.160 0.130 0.0 0.1212 + 19.170 0.139 0.0 0.1211 + 19.180 0.146 0.0 0.1211 + 19.190 0.152 0.0 0.1212 + 19.200 0.161 0.0 0.1213 + 19.210 0.175 0.0 0.1214 + 19.220 0.195 0.0 0.1215 + 19.230 0.221 0.0 0.1215 + 19.240 0.253 0.0 0.1214 + 19.250 0.287 0.0 0.1213 + 19.260 0.321 0.0 0.1212 + 19.270 0.351 0.0 0.1211 + 19.280 0.373 0.0 0.1211 + 19.290 0.383 0.0 0.1212 + 19.300 0.377 0.0 0.1213 + 19.310 0.354 0.0 0.1214 + 19.320 0.310 0.0 0.1215 + 19.330 0.245 0.0 0.1215 + 19.340 0.160 0.0 0.1214 + 19.350 0.057 0.0 0.1213 + 19.360 -0.060 0.0 0.1212 + 19.370 -0.187 0.0 0.1211 + 19.380 -0.320 0.0 0.1211 + 19.390 -0.453 0.0 0.1212 + 19.400 -0.580 0.0 0.1213 + 19.410 -0.696 0.0 0.1214 + 19.420 -0.798 0.0 0.1215 + 19.430 -0.880 0.0 0.1215 + 19.440 -0.942 0.0 0.1214 + 19.450 -0.981 0.0 0.1213 + 19.460 -0.999 0.0 0.1211 + 19.470 -0.996 0.0 0.1211 + 19.480 -0.976 0.0 0.1211 + 19.490 -0.941 0.0 0.1212 + 19.500 -0.896 0.0 0.1213 + 19.510 -0.845 0.0 0.1214 + 19.520 -0.793 0.0 0.1215 + 19.530 -0.743 0.0 0.1215 + 19.540 -0.699 0.0 0.1214 + 19.550 -0.664 0.0 0.1213 + 19.560 -0.641 0.0 0.1212 + 19.570 -0.631 0.0 0.1211 + 19.580 -0.634 0.0 0.1211 + 19.590 -0.650 0.0 0.1212 + 19.600 -0.678 0.0 0.1214 + 19.610 -0.718 0.0 0.1215 + 19.620 -0.767 0.0 0.1215 + 19.630 -0.825 0.0 0.1215 + 19.640 -0.888 0.0 0.1214 + 19.650 -0.957 0.0 0.1213 + 19.660 -1.028 0.0 0.1212 + 19.670 -1.102 0.0 0.1211 + 19.680 -1.176 0.0 0.1212 + 19.690 -1.250 0.0 0.1213 + 19.700 -1.323 0.0 0.1214 + 19.710 -1.395 0.0 0.1215 + 19.720 -1.463 0.0 0.1215 + 19.730 -1.529 0.0 0.1215 + 19.740 -1.589 0.0 0.1214 + 19.750 -1.643 0.0 0.1213 + 19.760 -1.690 0.0 0.1212 + 19.770 -1.727 0.0 0.1212 + 19.780 -1.754 0.0 0.1212 + 19.790 -1.767 0.0 0.1213 + 19.800 -1.767 0.0 0.1214 + 19.810 -1.751 0.0 0.1215 + 19.820 -1.720 0.0 0.1215 + 19.830 -1.672 0.0 0.1215 + 19.840 -1.609 0.0 0.1213 + 19.850 -1.530 0.0 0.1212 + 19.860 -1.438 0.0 0.1211 + 19.870 -1.334 0.0 0.1211 + 19.880 -1.219 0.0 0.1212 + 19.890 -1.097 0.0 0.1213 + 19.900 -0.969 0.0 0.1214 + 19.910 -0.837 0.0 0.1215 + 19.920 -0.703 0.0 0.1215 + 19.930 -0.568 0.0 0.1214 + 19.940 -0.432 0.0 0.1213 + 19.950 -0.298 0.0 0.1212 + 19.960 -0.163 0.0 0.1211 + 19.970 -0.028 0.0 0.1211 + 19.980 0.108 0.0 0.1212 + 19.990 0.245 0.0 0.1213 + 20.000 0.384 0.0 0.1214 diff --git a/src/diffpy/pdffit2/tests/testdata/Ni.dat b/src/diffpy/pdffit2/tests/testdata/Ni.dat new file mode 100644 index 00000000..360a4d6b --- /dev/null +++ b/src/diffpy/pdffit2/tests/testdata/Ni.dat @@ -0,0 +1,1001 @@ + 1.50000 -0.539443 0.00000 1.00000 0.539443 + 1.51850 -1.03098 0.00000 1.00000 1.03098 + 1.53700 -1.43712 0.00000 1.00000 1.43712 + 1.55550 -1.73810 0.00000 1.00000 1.73810 + 1.57400 -1.93402 0.00000 1.00000 1.93402 + 1.59250 -2.04145 0.00000 1.00000 2.04145 + 1.61100 -2.08593 0.00000 1.00000 2.08593 + 1.62950 -2.09295 0.00000 1.00000 2.09295 + 1.64800 -2.08072 0.00000 1.00000 2.08072 + 1.66650 -2.05688 0.00000 1.00000 2.05688 + 1.68500 -2.02006 0.00000 1.00000 2.02006 + 1.70350 -1.96554 0.00000 1.00000 1.96554 + 1.72200 -1.89239 0.00000 1.00000 1.89239 + 1.74050 -1.80936 0.00000 1.00000 1.80936 + 1.75900 -1.73670 0.00000 1.00000 1.73670 + 1.77750 -1.70255 0.00000 1.00000 1.70255 + 1.79600 -1.73461 0.00000 1.00000 1.73461 + 1.81450 -1.84946 0.00000 1.00000 1.84946 + 1.83300 -2.04300 0.00000 1.00000 2.04300 + 1.85150 -2.28566 0.00000 1.00000 2.28566 + 1.87000 -2.52486 0.00000 1.00000 2.52486 + 1.88850 -2.69615 0.00000 1.00000 2.69615 + 1.90700 -2.74180 0.00000 1.00000 2.74180 + 1.92550 -2.63223 0.00000 1.00000 2.63223 + 1.94400 -2.38239 0.00000 1.00000 2.38239 + 1.96250 -2.05565 0.00000 1.00000 2.05565 + 1.98100 -1.75092 0.00000 1.00000 1.75092 + 1.99950 -1.57518 0.00000 1.00000 1.57518 + 2.01800 -1.60914 0.00000 1.00000 1.60914 + 2.03650 -1.87687 0.00000 1.00000 1.87687 + 2.05500 -2.33004 0.00000 1.00000 2.33004 + 2.07350 -2.85357 0.00000 1.00000 2.85357 + 2.09200 -3.29353 0.00000 1.00000 3.29353 + 2.11050 -3.50124 0.00000 1.00000 3.50124 + 2.12900 -3.38172 0.00000 1.00000 3.38172 + 2.14750 -2.93205 0.00000 1.00000 2.93205 + 2.16600 -2.25629 0.00000 1.00000 2.25629 + 2.18450 -1.54918 0.00000 1.00000 1.54918 + 2.20300 -1.04888 0.00000 1.00000 1.04888 + 2.22150 -0.968136 0.00000 1.00000 0.968136 + 2.24000 -1.42070 0.00000 1.00000 1.42070 + 2.25850 -2.36300 0.00000 1.00000 2.36300 + 2.27700 -3.56960 0.00000 1.00000 3.56960 + 2.29550 -4.65416 0.00000 1.00000 4.65416 + 2.31400 -5.13684 0.00000 1.00000 5.13684 + 2.33250 -4.54696 0.00000 1.00000 4.54696 + 2.35100 -2.53890 0.00000 1.00000 2.53890 + 2.36950 1.00656 0.00000 1.00000 -1.00656 + 2.38800 5.92223 0.00000 1.00000 -5.92223 + 2.40650 11.7527 0.00000 1.00000 -11.7527 + 2.42500 17.8143 0.00000 1.00000 -17.8143 + 2.44350 23.3057 0.00000 1.00000 -23.3057 + 2.46200 27.4478 0.00000 1.00000 -27.4478 + 2.48050 29.6246 0.00000 1.00000 -29.6246 + 2.49900 29.4986 0.00000 1.00000 -29.4986 + 2.51750 27.0749 0.00000 1.00000 -27.0749 + 2.53600 22.7028 0.00000 1.00000 -22.7028 + 2.55450 17.0112 0.00000 1.00000 -17.0112 + 2.57300 10.7932 0.00000 1.00000 -10.7932 + 2.59150 4.86134 0.00000 1.00000 -4.86134 + 2.61000 -0.0945224 0.00000 1.00000 0.0945224 + 2.62850 -3.61858 0.00000 1.00000 3.61858 + 2.64700 -5.54803 0.00000 1.00000 5.54803 + 2.66550 -6.01016 0.00000 1.00000 6.01016 + 2.68400 -5.36293 0.00000 1.00000 5.36293 + 2.70250 -4.09596 0.00000 1.00000 4.09596 + 2.72100 -2.71625 0.00000 1.00000 2.71625 + 2.73950 -1.64382 0.00000 1.00000 1.64382 + 2.75800 -1.13791 0.00000 1.00000 1.13791 + 2.77650 -1.26649 0.00000 1.00000 1.26649 + 2.79500 -1.92103 0.00000 1.00000 1.92103 + 2.81350 -2.86890 0.00000 1.00000 2.86890 + 2.83200 -3.82782 0.00000 1.00000 3.82782 + 2.85050 -4.54328 0.00000 1.00000 4.54328 + 2.86900 -4.85054 0.00000 1.00000 4.85054 + 2.88750 -4.70809 0.00000 1.00000 4.70809 + 2.90600 -4.19687 0.00000 1.00000 4.19687 + 2.92450 -3.48841 0.00000 1.00000 3.48841 + 2.94300 -2.79256 0.00000 1.00000 2.79256 + 2.96150 -2.29993 0.00000 1.00000 2.29993 + 2.98000 -2.13422 0.00000 1.00000 2.13422 + 2.99850 -2.32552 0.00000 1.00000 2.32552 + 3.01700 -2.80931 0.00000 1.00000 2.80931 + 3.03550 -3.44928 0.00000 1.00000 3.44928 + 3.05400 -4.07624 0.00000 1.00000 4.07624 + 3.07250 -4.53264 0.00000 1.00000 4.53264 + 3.09100 -4.71141 0.00000 1.00000 4.71141 + 3.10950 -4.58013 0.00000 1.00000 4.58013 + 3.12800 -4.18572 0.00000 1.00000 4.18572 + 3.14650 -3.63955 0.00000 1.00000 3.63955 + 3.16500 -3.08796 0.00000 1.00000 3.08796 + 3.18350 -2.67579 0.00000 1.00000 2.67579 + 3.20200 -2.51194 0.00000 1.00000 2.51194 + 3.22050 -2.64475 0.00000 1.00000 2.64475 + 3.23900 -3.05186 0.00000 1.00000 3.05186 + 3.25750 -3.64576 0.00000 1.00000 3.64576 + 3.27600 -4.29257 0.00000 1.00000 4.29257 + 3.29450 -4.83876 0.00000 1.00000 4.83876 + 3.31300 -5.14008 0.00000 1.00000 5.14008 + 3.33150 -5.08721 0.00000 1.00000 5.08721 + 3.35000 -4.62391 0.00000 1.00000 4.62391 + 3.36850 -3.75470 0.00000 1.00000 3.75470 + 3.38700 -2.54063 0.00000 1.00000 2.54063 + 3.40550 -1.08396 0.00000 1.00000 1.08396 + 3.42400 0.493223 0.00000 1.00000 -0.493223 + 3.44250 2.06874 0.00000 1.00000 -2.06874 + 3.46100 3.53152 0.00000 1.00000 -3.53152 + 3.47950 4.78254 0.00000 1.00000 -4.78254 + 3.49800 5.72969 0.00000 1.00000 -5.72969 + 3.51650 6.28423 0.00000 1.00000 -6.28423 + 3.53500 6.36504 0.00000 1.00000 -6.36504 + 3.55350 5.91247 0.00000 1.00000 -5.91247 + 3.57200 4.90861 0.00000 1.00000 -4.90861 + 3.59050 3.39740 0.00000 1.00000 -3.39740 + 3.60900 1.49612 0.00000 1.00000 -1.49612 + 3.62750 -0.608193 0.00000 1.00000 0.608193 + 3.64600 -2.68019 0.00000 1.00000 2.68019 + 3.66450 -4.47243 0.00000 1.00000 4.47243 + 3.68300 -5.76925 0.00000 1.00000 5.76925 + 3.70150 -6.42920 0.00000 1.00000 6.42920 + 3.72000 -6.41719 0.00000 1.00000 6.41719 + 3.73850 -5.81875 0.00000 1.00000 5.81875 + 3.75700 -4.83074 0.00000 1.00000 4.83074 + 3.77550 -3.72667 0.00000 1.00000 3.72667 + 3.79400 -2.80071 0.00000 1.00000 2.80071 + 3.81250 -2.30147 0.00000 1.00000 2.30147 + 3.83100 -2.37126 0.00000 1.00000 2.37126 + 3.84950 -3.00713 0.00000 1.00000 3.00713 + 3.86800 -4.05566 0.00000 1.00000 4.05566 + 3.88650 -5.24604 0.00000 1.00000 5.24604 + 3.90500 -6.25585 0.00000 1.00000 6.25585 + 3.92350 -6.79521 0.00000 1.00000 6.79521 + 3.94200 -6.68830 0.00000 1.00000 6.68830 + 3.96050 -5.93010 0.00000 1.00000 5.93010 + 3.97900 -4.70113 0.00000 1.00000 4.70113 + 3.99750 -3.33259 0.00000 1.00000 3.33259 + 4.01600 -2.22683 0.00000 1.00000 2.22683 + 4.03450 -1.75037 0.00000 1.00000 1.75037 + 4.05300 -2.12498 0.00000 1.00000 2.12498 + 4.07150 -3.34471 0.00000 1.00000 3.34471 + 4.09000 -5.14253 0.00000 1.00000 5.14253 + 4.10850 -7.01935 0.00000 1.00000 7.01935 + 4.12700 -8.33391 0.00000 1.00000 8.33391 + 4.14550 -8.43660 0.00000 1.00000 8.43660 + 4.16400 -6.81920 0.00000 1.00000 6.81920 + 4.18250 -3.24667 0.00000 1.00000 3.24667 + 4.20100 2.16009 0.00000 1.00000 -2.16009 + 4.21950 8.91152 0.00000 1.00000 -8.91152 + 4.23800 16.2134 0.00000 1.00000 -16.2134 + 4.25650 23.0973 0.00000 1.00000 -23.0973 + 4.27500 28.5935 0.00000 1.00000 -28.5935 + 4.29350 31.9106 0.00000 1.00000 -31.9106 + 4.31200 32.5842 0.00000 1.00000 -32.5842 + 4.33050 30.5617 0.00000 1.00000 -30.5617 + 4.34900 26.2027 0.00000 1.00000 -26.2027 + 4.36750 20.1990 0.00000 1.00000 -20.1990 + 4.38600 13.4320 0.00000 1.00000 -13.4320 + 4.40450 6.80337 0.00000 1.00000 -6.80337 + 4.42300 1.07527 0.00000 1.00000 -1.07527 + 4.44150 -3.24700 0.00000 1.00000 3.24700 + 4.46000 -5.96945 0.00000 1.00000 5.96945 + 4.47850 -7.19581 0.00000 1.00000 7.19581 + 4.49700 -7.25613 0.00000 1.00000 7.25613 + 4.51550 -6.59972 0.00000 1.00000 6.59972 + 4.53400 -5.68054 0.00000 1.00000 5.68054 + 4.55250 -4.86170 0.00000 1.00000 4.86170 + 4.57100 -4.35835 0.00000 1.00000 4.35835 + 4.58950 -4.22677 0.00000 1.00000 4.22677 + 4.60800 -4.39508 0.00000 1.00000 4.39508 + 4.62650 -4.72130 0.00000 1.00000 4.72130 + 4.64500 -5.05871 0.00000 1.00000 5.05871 + 4.66350 -5.30848 0.00000 1.00000 5.30848 + 4.68200 -5.44197 0.00000 1.00000 5.44197 + 4.70050 -5.50097 0.00000 1.00000 5.50097 + 4.71900 -5.56456 0.00000 1.00000 5.56456 + 4.73750 -5.69659 0.00000 1.00000 5.69659 + 4.75600 -5.90806 0.00000 1.00000 5.90806 + 4.77450 -6.13525 0.00000 1.00000 6.13525 + 4.79300 -6.24364 0.00000 1.00000 6.24364 + 4.81150 -6.05670 0.00000 1.00000 6.05670 + 4.83000 -5.40165 0.00000 1.00000 5.40165 + 4.84850 -4.16022 0.00000 1.00000 4.16022 + 4.86700 -2.31100 0.00000 1.00000 2.31100 + 4.88550 0.0479985 0.00000 1.00000 -0.0479985 + 4.90400 2.70271 0.00000 1.00000 -2.70271 + 4.92250 5.35252 0.00000 1.00000 -5.35252 + 4.94100 7.65960 0.00000 1.00000 -7.65960 + 4.95950 9.30734 0.00000 1.00000 -9.30734 + 4.97800 10.0558 0.00000 1.00000 -10.0558 + 4.99650 9.78268 0.00000 1.00000 -9.78268 + 5.01500 8.50309 0.00000 1.00000 -8.50309 + 5.03350 6.36470 0.00000 1.00000 -6.36470 + 5.05200 3.62252 0.00000 1.00000 -3.62252 + 5.07050 0.599290 0.00000 1.00000 -0.599290 + 5.08900 -2.36086 0.00000 1.00000 2.36086 + 5.10750 -4.93870 0.00000 1.00000 4.93870 + 5.12600 -6.88149 0.00000 1.00000 6.88149 + 5.14450 -8.03565 0.00000 1.00000 8.03565 + 5.16300 -8.36668 0.00000 1.00000 8.36668 + 5.18150 -7.96304 0.00000 1.00000 7.96304 + 5.20000 -7.02207 0.00000 1.00000 7.02207 + 5.21850 -5.81895 0.00000 1.00000 5.81895 + 5.23700 -4.66171 0.00000 1.00000 4.66171 + 5.25550 -3.83844 0.00000 1.00000 3.83844 + 5.27400 -3.56410 0.00000 1.00000 3.56410 + 5.29250 -3.93573 0.00000 1.00000 3.93573 + 5.31100 -4.90467 0.00000 1.00000 4.90467 + 5.32950 -6.27267 0.00000 1.00000 6.27267 + 5.34800 -7.71536 0.00000 1.00000 7.71536 + 5.36650 -8.83203 0.00000 1.00000 8.83203 + 5.38500 -9.21516 0.00000 1.00000 9.21516 + 5.40350 -8.52808 0.00000 1.00000 8.52808 + 5.42200 -6.57611 0.00000 1.00000 6.57611 + 5.44050 -3.35625 0.00000 1.00000 3.35625 + 5.45900 0.925287 0.00000 1.00000 -0.925287 + 5.47750 5.87209 0.00000 1.00000 -5.87209 + 5.49600 10.9500 0.00000 1.00000 -10.9500 + 5.51450 15.5640 0.00000 1.00000 -15.5640 + 5.53300 19.1477 0.00000 1.00000 -19.1477 + 5.55150 21.2490 0.00000 1.00000 -21.2490 + 5.57000 21.6003 0.00000 1.00000 -21.6003 + 5.58850 20.1588 0.00000 1.00000 -20.1588 + 5.60700 17.1124 0.00000 1.00000 -17.1124 + 5.62550 12.8494 0.00000 1.00000 -12.8494 + 5.64400 7.89927 0.00000 1.00000 -7.89927 + 5.66250 2.85190 0.00000 1.00000 -2.85190 + 5.68100 -1.72997 0.00000 1.00000 1.72997 + 5.69950 -5.39381 0.00000 1.00000 5.39381 + 5.71800 -7.86162 0.00000 1.00000 7.86162 + 5.73650 -9.06420 0.00000 1.00000 9.06420 + 5.75500 -9.13837 0.00000 1.00000 9.13837 + 5.77350 -8.38683 0.00000 1.00000 8.38683 + 5.79200 -7.20818 0.00000 1.00000 7.20818 + 5.81050 -6.01172 0.00000 1.00000 6.01172 + 5.82900 -5.13567 0.00000 1.00000 5.13567 + 5.84750 -4.78662 0.00000 1.00000 4.78662 + 5.86600 -5.01125 0.00000 1.00000 5.01125 + 5.88450 -5.70222 0.00000 1.00000 5.70222 + 5.90300 -6.63275 0.00000 1.00000 6.63275 + 5.92150 -7.51031 0.00000 1.00000 7.51031 + 5.94000 -8.03914 0.00000 1.00000 8.03914 + 5.95850 -7.98163 0.00000 1.00000 7.98163 + 5.97700 -7.20897 0.00000 1.00000 7.20897 + 5.99550 -5.73309 0.00000 1.00000 5.73309 + 6.01400 -3.71335 0.00000 1.00000 3.71335 + 6.03250 -1.43572 0.00000 1.00000 1.43572 + 6.05100 0.734316 0.00000 1.00000 -0.734316 + 6.06950 2.41816 0.00000 1.00000 -2.41816 + 6.08800 3.29880 0.00000 1.00000 -3.29880 + 6.10650 3.18922 0.00000 1.00000 -3.18922 + 6.12500 2.07961 0.00000 1.00000 -2.07961 + 6.14350 0.150522 0.00000 1.00000 -0.150522 + 6.16200 -2.25436 0.00000 1.00000 2.25436 + 6.18050 -4.69426 0.00000 1.00000 4.69426 + 6.19900 -6.72460 0.00000 1.00000 6.72460 + 6.21750 -7.99834 0.00000 1.00000 7.99834 + 6.23600 -8.35142 0.00000 1.00000 8.35142 + 6.25450 -7.84948 0.00000 1.00000 7.84948 + 6.27300 -6.78013 0.00000 1.00000 6.78013 + 6.29150 -5.58671 0.00000 1.00000 5.58671 + 6.31000 -4.75441 0.00000 1.00000 4.75441 + 6.32850 -4.67266 0.00000 1.00000 4.67266 + 6.34700 -5.50714 0.00000 1.00000 5.50714 + 6.36550 -7.11590 0.00000 1.00000 7.11590 + 6.38400 -9.03699 0.00000 1.00000 9.03699 + 6.40250 -10.5592 0.00000 1.00000 10.5592 + 6.42100 -10.8676 0.00000 1.00000 10.8676 + 6.43950 -9.23379 0.00000 1.00000 9.23379 + 6.45800 -5.20861 0.00000 1.00000 5.20861 + 6.47650 1.23011 0.00000 1.00000 -1.23011 + 6.49500 9.61241 0.00000 1.00000 -9.61241 + 6.51350 19.0142 0.00000 1.00000 -19.0142 + 6.53200 28.1967 0.00000 1.00000 -28.1967 + 6.55050 35.8243 0.00000 1.00000 -35.8243 + 6.56900 40.7166 0.00000 1.00000 -40.7166 + 6.58750 42.0833 0.00000 1.00000 -42.0833 + 6.60600 39.6873 0.00000 1.00000 -39.6873 + 6.62450 33.8989 0.00000 1.00000 -33.8989 + 6.64300 25.6256 0.00000 1.00000 -25.6256 + 6.66150 16.1324 0.00000 1.00000 -16.1324 + 6.68000 6.79125 0.00000 1.00000 -6.79125 + 6.69850 -1.18411 0.00000 1.00000 1.18411 + 6.71700 -6.95910 0.00000 1.00000 6.95910 + 6.73550 -10.2079 0.00000 1.00000 10.2079 + 6.75400 -11.1248 0.00000 1.00000 11.1248 + 6.77250 -10.3198 0.00000 1.00000 10.3198 + 6.79100 -8.62815 0.00000 1.00000 8.62815 + 6.80950 -6.88571 0.00000 1.00000 6.88571 + 6.82800 -5.72660 0.00000 1.00000 5.72660 + 6.84650 -5.45332 0.00000 1.00000 5.45332 + 6.86500 -6.00649 0.00000 1.00000 6.00649 + 6.88350 -7.03437 0.00000 1.00000 7.03437 + 6.90200 -8.03570 0.00000 1.00000 8.03570 + 6.92050 -8.53209 0.00000 1.00000 8.53209 + 6.93900 -8.22002 0.00000 1.00000 8.22002 + 6.95750 -7.06140 0.00000 1.00000 7.06140 + 6.97600 -5.29017 0.00000 1.00000 5.29017 + 6.99450 -3.33754 0.00000 1.00000 3.33754 + 7.01300 -1.70148 0.00000 1.00000 1.70148 + 7.03150 -0.800760 0.00000 1.00000 0.800760 + 7.05000 -0.856664 0.00000 1.00000 0.856664 + 7.06850 -1.83505 0.00000 1.00000 1.83505 + 7.08700 -3.46358 0.00000 1.00000 3.46358 + 7.10550 -5.31731 0.00000 1.00000 5.31731 + 7.12400 -6.94715 0.00000 1.00000 6.94715 + 7.14250 -8.01332 0.00000 1.00000 8.01332 + 7.16100 -8.38320 0.00000 1.00000 8.38320 + 7.17950 -8.16268 0.00000 1.00000 8.16268 + 7.19800 -7.64952 0.00000 1.00000 7.64952 + 7.21650 -7.22129 0.00000 1.00000 7.22129 + 7.23500 -7.19206 0.00000 1.00000 7.19206 + 7.25350 -7.68220 0.00000 1.00000 7.68220 + 7.27200 -8.54371 0.00000 1.00000 8.54371 + 7.29050 -9.36819 0.00000 1.00000 9.36819 + 7.30900 -9.58072 0.00000 1.00000 9.58072 + 7.32750 -8.59790 0.00000 1.00000 8.59790 + 7.34600 -6.00785 0.00000 1.00000 6.00785 + 7.36450 -1.72106 0.00000 1.00000 1.72106 + 7.38300 3.95269 0.00000 1.00000 -3.95269 + 7.40150 10.3276 0.00000 1.00000 -10.3276 + 7.42000 16.4640 0.00000 1.00000 -16.4640 + 7.43850 21.3618 0.00000 1.00000 -21.3618 + 7.45700 24.1782 0.00000 1.00000 -24.1782 + 7.47550 24.4162 0.00000 1.00000 -24.4162 + 7.49400 22.0356 0.00000 1.00000 -22.0356 + 7.51250 17.4573 0.00000 1.00000 -17.4573 + 7.53100 11.4623 0.00000 1.00000 -11.4623 + 7.54950 5.01118 0.00000 1.00000 -5.01118 + 7.56800 -0.965076 0.00000 1.00000 0.965076 + 7.58650 -5.75153 0.00000 1.00000 5.75153 + 7.60500 -8.96799 0.00000 1.00000 8.96799 + 7.62350 -10.5969 0.00000 1.00000 10.5969 + 7.64200 -10.9206 0.00000 1.00000 10.9206 + 7.66050 -10.3893 0.00000 1.00000 10.3893 + 7.67900 -9.46200 0.00000 1.00000 9.46200 + 7.69750 -8.46444 0.00000 1.00000 8.46444 + 7.71600 -7.50854 0.00000 1.00000 7.50854 + 7.73450 -6.49304 0.00000 1.00000 6.49304 + 7.75300 -5.18168 0.00000 1.00000 5.18168 + 7.77150 -3.32911 0.00000 1.00000 3.32911 + 7.79000 -0.811546 0.00000 1.00000 0.811546 + 7.80850 2.28073 0.00000 1.00000 -2.28073 + 7.82700 5.61902 0.00000 1.00000 -5.61902 + 7.84550 8.68909 0.00000 1.00000 -8.68909 + 7.86400 10.9073 0.00000 1.00000 -10.9073 + 7.88250 11.7676 0.00000 1.00000 -11.7676 + 7.90100 10.9777 0.00000 1.00000 -10.9777 + 7.91950 8.54633 0.00000 1.00000 -8.54633 + 7.93800 4.79627 0.00000 1.00000 -4.79627 + 7.95650 0.300695 0.00000 1.00000 -0.300695 + 7.97500 -4.24152 0.00000 1.00000 4.24152 + 7.99350 -8.15787 0.00000 1.00000 8.15787 + 8.01200 -10.9420 0.00000 1.00000 10.9420 + 8.03050 -12.3456 0.00000 1.00000 12.3456 + 8.04900 -12.4001 0.00000 1.00000 12.4001 + 8.06750 -11.3663 0.00000 1.00000 11.3663 + 8.08600 -9.63181 0.00000 1.00000 9.63181 + 8.10450 -7.58723 0.00000 1.00000 7.58723 + 8.12300 -5.52117 0.00000 1.00000 5.52117 + 8.14150 -3.56353 0.00000 1.00000 3.56353 + 8.16000 -1.69260 0.00000 1.00000 1.69260 + 8.17850 0.199827 0.00000 1.00000 -0.199827 + 8.19700 2.21044 0.00000 1.00000 -2.21044 + 8.21550 4.33057 0.00000 1.00000 -4.33057 + 8.23400 6.39218 0.00000 1.00000 -6.39218 + 8.25250 8.07555 0.00000 1.00000 -8.07555 + 8.27100 8.97896 0.00000 1.00000 -8.97896 + 8.28950 8.73073 0.00000 1.00000 -8.73073 + 8.30800 7.11016 0.00000 1.00000 -7.11016 + 8.32650 4.14151 0.00000 1.00000 -4.14151 + 8.34500 0.130936 0.00000 1.00000 -0.130936 + 8.36350 -4.36837 0.00000 1.00000 4.36837 + 8.38200 -8.65854 0.00000 1.00000 8.65854 + 8.40050 -12.0433 0.00000 1.00000 12.0433 + 8.41900 -13.9807 0.00000 1.00000 13.9807 + 8.43750 -14.2030 0.00000 1.00000 14.2030 + 8.45600 -12.7704 0.00000 1.00000 12.7704 + 8.47450 -10.0445 0.00000 1.00000 10.0445 + 8.49300 -6.58938 0.00000 1.00000 6.58938 + 8.51150 -3.02663 0.00000 1.00000 3.02663 + 8.53000 0.112114 0.00000 1.00000 -0.112114 + 8.54850 2.49566 0.00000 1.00000 -2.49566 + 8.56700 4.03580 0.00000 1.00000 -4.03580 + 8.58550 4.85377 0.00000 1.00000 -4.85377 + 8.60400 5.18537 0.00000 1.00000 -5.18537 + 8.62250 5.25808 0.00000 1.00000 -5.25808 + 8.64100 5.18193 0.00000 1.00000 -5.18193 + 8.65950 4.89182 0.00000 1.00000 -4.89182 + 8.67800 4.16349 0.00000 1.00000 -4.16349 + 8.69650 2.70252 0.00000 1.00000 -2.70252 + 8.71500 0.282220 0.00000 1.00000 -0.282220 + 8.73350 -3.11124 0.00000 1.00000 3.11124 + 8.75200 -7.17490 0.00000 1.00000 7.17490 + 8.77050 -11.2672 0.00000 1.00000 11.2672 + 8.78900 -14.4886 0.00000 1.00000 14.4886 + 8.80750 -15.8559 0.00000 1.00000 15.8559 + 8.82600 -14.5328 0.00000 1.00000 14.5328 + 8.84450 -10.0609 0.00000 1.00000 10.0609 + 8.86300 -2.52773 0.00000 1.00000 2.52773 + 8.88150 7.37428 0.00000 1.00000 -7.37428 + 8.90000 18.4240 0.00000 1.00000 -18.4240 + 8.91850 29.0726 0.00000 1.00000 -29.0726 + 8.93700 37.7295 0.00000 1.00000 -37.7295 + 8.95550 43.0717 0.00000 1.00000 -43.0717 + 8.97400 44.3044 0.00000 1.00000 -44.3044 + 8.99250 41.3154 0.00000 1.00000 -41.3154 + 9.01100 34.6857 0.00000 1.00000 -34.6857 + 9.02950 25.5570 0.00000 1.00000 -25.5570 + 9.04800 15.3859 0.00000 1.00000 -15.3859 + 9.06650 5.64529 0.00000 1.00000 -5.64529 + 9.08500 -2.45985 0.00000 1.00000 2.45985 + 9.10350 -8.19758 0.00000 1.00000 8.19758 + 9.12200 -11.3936 0.00000 1.00000 11.3936 + 9.14050 -12.3840 0.00000 1.00000 12.3840 + 9.15900 -11.8591 0.00000 1.00000 11.8591 + 9.17750 -10.6446 0.00000 1.00000 10.6446 + 9.19600 -9.48212 0.00000 1.00000 9.48212 + 9.21450 -8.86286 0.00000 1.00000 8.86286 + 9.23300 -8.95166 0.00000 1.00000 8.95166 + 9.25150 -9.60978 0.00000 1.00000 9.60978 + 9.27000 -10.4985 0.00000 1.00000 10.4985 + 9.28850 -11.2264 0.00000 1.00000 11.2264 + 9.30700 -11.4956 0.00000 1.00000 11.4956 + 9.32550 -11.2056 0.00000 1.00000 11.2056 + 9.34400 -10.4851 0.00000 1.00000 10.4851 + 9.36250 -9.64367 0.00000 1.00000 9.64367 + 9.38100 -9.05839 0.00000 1.00000 9.05839 + 9.39950 -9.03059 0.00000 1.00000 9.03059 + 9.41800 -9.65891 0.00000 1.00000 9.65891 + 9.43650 -10.7695 0.00000 1.00000 10.7695 + 9.45500 -11.9282 0.00000 1.00000 11.9282 + 9.47350 -12.5352 0.00000 1.00000 12.5352 + 9.49200 -11.9793 0.00000 1.00000 11.9793 + 9.51050 -9.80968 0.00000 1.00000 9.80968 + 9.52900 -5.88098 0.00000 1.00000 5.88098 + 9.54750 -0.429865 0.00000 1.00000 0.429865 + 9.56600 5.93738 0.00000 1.00000 -5.93738 + 9.58450 12.3467 0.00000 1.00000 -12.3467 + 9.60300 17.8253 0.00000 1.00000 -17.8253 + 9.62150 21.4983 0.00000 1.00000 -21.4983 + 9.64000 22.7684 0.00000 1.00000 -22.7684 + 9.65850 21.4353 0.00000 1.00000 -21.4353 + 9.67700 17.7297 0.00000 1.00000 -17.7297 + 9.69550 12.2556 0.00000 1.00000 -12.2556 + 9.71400 5.85940 0.00000 1.00000 -5.85940 + 9.73250 -0.539853 0.00000 1.00000 0.539853 + 9.75100 -6.11696 0.00000 1.00000 6.11696 + 9.76950 -10.2704 0.00000 1.00000 10.2704 + 9.78800 -12.6954 0.00000 1.00000 12.6954 + 9.80650 -13.3941 0.00000 1.00000 13.3941 + 9.82500 -12.6315 0.00000 1.00000 12.6315 + 9.84350 -10.8487 0.00000 1.00000 10.8487 + 9.86200 -8.55755 0.00000 1.00000 8.55755 + 9.88050 -6.24003 0.00000 1.00000 6.24003 + 9.89900 -4.27478 0.00000 1.00000 4.27478 + 9.91750 -2.90328 0.00000 1.00000 2.90328 + 9.93600 -2.23386 0.00000 1.00000 2.23386 + 9.95450 -2.27104 0.00000 1.00000 2.27104 + 9.97300 -2.95175 0.00000 1.00000 2.95175 + 9.99150 -4.17209 0.00000 1.00000 4.17209 + 10.0100 -5.79607 0.00000 1.00000 5.79607 + 10.0285 -7.64859 0.00000 1.00000 7.64859 + 10.0470 -9.50283 0.00000 1.00000 9.50283 + 10.0655 -11.0757 0.00000 1.00000 11.0757 + 10.0840 -12.0425 0.00000 1.00000 12.0425 + 10.1025 -12.0751 0.00000 1.00000 12.0751 + 10.1210 -10.9017 0.00000 1.00000 10.9017 + 10.1395 -8.37613 0.00000 1.00000 8.37613 + 10.1580 -4.54026 0.00000 1.00000 4.54026 + 10.1765 0.338357 0.00000 1.00000 -0.338357 + 10.1950 5.76996 0.00000 1.00000 -5.76996 + 10.2135 11.0939 0.00000 1.00000 -11.0939 + 10.2320 15.5741 0.00000 1.00000 -15.5741 + 10.2505 18.5225 0.00000 1.00000 -18.5225 + 10.2690 19.4270 0.00000 1.00000 -19.4270 + 10.2875 18.0567 0.00000 1.00000 -18.0567 + 10.3060 14.5227 0.00000 1.00000 -14.5227 + 10.3245 9.27796 0.00000 1.00000 -9.27796 + 10.3430 3.05599 0.00000 1.00000 -3.05599 + 10.3615 -3.24345 0.00000 1.00000 3.24345 + 10.3800 -8.70145 0.00000 1.00000 8.70145 + 10.3985 -12.5330 0.00000 1.00000 12.5330 + 10.4170 -14.2182 0.00000 1.00000 14.2182 + 10.4355 -13.5885 0.00000 1.00000 13.5885 + 10.4540 -10.8525 0.00000 1.00000 10.8525 + 10.4725 -6.55772 0.00000 1.00000 6.55772 + 10.4910 -1.49640 0.00000 1.00000 1.49640 + 10.5095 3.42852 0.00000 1.00000 -3.42852 + 10.5280 7.35363 0.00000 1.00000 -7.35363 + 10.5465 9.59717 0.00000 1.00000 -9.59717 + 10.5650 9.77054 0.00000 1.00000 -9.77054 + 10.5835 7.84234 0.00000 1.00000 -7.84234 + 10.6020 4.14584 0.00000 1.00000 -4.14584 + 10.6205 -0.671143 0.00000 1.00000 0.671143 + 10.6390 -5.74603 0.00000 1.00000 5.74603 + 10.6575 -10.1361 0.00000 1.00000 10.1361 + 10.6760 -12.9671 0.00000 1.00000 12.9671 + 10.6945 -13.5738 0.00000 1.00000 13.5738 + 10.7130 -11.6108 0.00000 1.00000 11.6108 + 10.7315 -7.11852 0.00000 1.00000 7.11852 + 10.7500 -0.532582 0.00000 1.00000 0.532582 + 10.7685 7.36496 0.00000 1.00000 -7.36496 + 10.7870 15.5502 0.00000 1.00000 -15.5502 + 10.8055 22.9046 0.00000 1.00000 -22.9046 + 10.8240 28.3836 0.00000 1.00000 -28.3836 + 10.8425 31.1819 0.00000 1.00000 -31.1819 + 10.8610 30.8667 0.00000 1.00000 -30.8667 + 10.8795 27.4544 0.00000 1.00000 -27.4544 + 10.8980 21.4174 0.00000 1.00000 -21.4174 + 10.9165 13.6149 0.00000 1.00000 -13.6149 + 10.9350 5.15717 0.00000 1.00000 -5.15717 + 10.9535 -2.77403 0.00000 1.00000 2.77403 + 10.9720 -9.11963 0.00000 1.00000 9.11963 + 10.9905 -13.1166 0.00000 1.00000 13.1166 + 11.0090 -14.4189 0.00000 1.00000 14.4189 + 11.0275 -13.1446 0.00000 1.00000 13.1446 + 11.0460 -9.84069 0.00000 1.00000 9.84069 + 11.0645 -5.37361 0.00000 1.00000 5.37361 + 11.0830 -0.766336 0.00000 1.00000 0.766336 + 11.1015 2.99059 0.00000 1.00000 -2.99059 + 11.1200 5.12102 0.00000 1.00000 -5.12102 + 11.1385 5.20555 0.00000 1.00000 -5.20555 + 11.1570 3.25580 0.00000 1.00000 -3.25580 + 11.1755 -0.295787 0.00000 1.00000 0.295787 + 11.1940 -4.68917 0.00000 1.00000 4.68917 + 11.2125 -8.99252 0.00000 1.00000 8.99252 + 11.2310 -12.2872 0.00000 1.00000 12.2872 + 11.2495 -13.8447 0.00000 1.00000 13.8447 + 11.2680 -13.2610 0.00000 1.00000 13.2610 + 11.2865 -10.5280 0.00000 1.00000 10.5280 + 11.3050 -6.02790 0.00000 1.00000 6.02790 + 11.3235 -0.457428 0.00000 1.00000 0.457428 + 11.3420 5.30272 0.00000 1.00000 -5.30272 + 11.3605 10.3468 0.00000 1.00000 -10.3468 + 11.3790 13.9003 0.00000 1.00000 -13.9003 + 11.3975 15.4459 0.00000 1.00000 -15.4459 + 11.4160 14.7993 0.00000 1.00000 -14.7993 + 11.4345 12.1251 0.00000 1.00000 -12.1251 + 11.4530 7.89515 0.00000 1.00000 -7.89515 + 11.4715 2.79743 0.00000 1.00000 -2.79743 + 11.4900 -2.38402 0.00000 1.00000 2.38402 + 11.5085 -6.89848 0.00000 1.00000 6.89848 + 11.5270 -10.1446 0.00000 1.00000 10.1446 + 11.5455 -11.7562 0.00000 1.00000 11.7562 + 11.5640 -11.6477 0.00000 1.00000 11.6477 + 11.5825 -10.0156 0.00000 1.00000 10.0156 + 11.6010 -7.29778 0.00000 1.00000 7.29778 + 11.6195 -4.09885 0.00000 1.00000 4.09885 + 11.6380 -1.08810 0.00000 1.00000 1.08810 + 11.6565 1.11439 0.00000 1.00000 -1.11439 + 11.6750 2.04788 0.00000 1.00000 -2.04788 + 11.6935 1.49867 0.00000 1.00000 -1.49867 + 11.7120 -0.451611 0.00000 1.00000 0.451611 + 11.7305 -3.42848 0.00000 1.00000 3.42848 + 11.7490 -6.82125 0.00000 1.00000 6.82125 + 11.7675 -9.88740 0.00000 1.00000 9.88740 + 11.7860 -11.8896 0.00000 1.00000 11.8896 + 11.8045 -12.2430 0.00000 1.00000 12.2430 + 11.8230 -10.6446 0.00000 1.00000 10.6446 + 11.8415 -7.15722 0.00000 1.00000 7.15722 + 11.8600 -2.22583 0.00000 1.00000 2.22583 + 11.8785 3.38458 0.00000 1.00000 -3.38458 + 11.8970 8.72108 0.00000 1.00000 -8.72108 + 11.9155 12.8213 0.00000 1.00000 -12.8213 + 11.9340 14.9032 0.00000 1.00000 -14.9032 + 11.9525 14.5281 0.00000 1.00000 -14.5281 + 11.9710 11.6999 0.00000 1.00000 -11.6999 + 11.9895 6.87776 0.00000 1.00000 -6.87776 + 12.0080 0.891504 0.00000 1.00000 -0.891504 + 12.0265 -5.22565 0.00000 1.00000 5.22565 + 12.0450 -10.4522 0.00000 1.00000 10.4522 + 12.0635 -13.9931 0.00000 1.00000 13.9931 + 12.0820 -15.4435 0.00000 1.00000 15.4435 + 12.1005 -14.8644 0.00000 1.00000 14.8644 + 12.1190 -12.7520 0.00000 1.00000 12.7520 + 12.1375 -9.90845 0.00000 1.00000 9.90845 + 12.1560 -7.24453 0.00000 1.00000 7.24453 + 12.1745 -5.56166 0.00000 1.00000 5.56166 + 12.1930 -5.36161 0.00000 1.00000 5.36161 + 12.2115 -6.72586 0.00000 1.00000 6.72586 + 12.2300 -9.28835 0.00000 1.00000 9.28835 + 12.2485 -12.3067 0.00000 1.00000 12.3067 + 12.2670 -14.8178 0.00000 1.00000 14.8178 + 12.2855 -15.8476 0.00000 1.00000 15.8476 + 12.3040 -14.6332 0.00000 1.00000 14.6332 + 12.3225 -10.8097 0.00000 1.00000 10.8097 + 12.3410 -4.52145 0.00000 1.00000 4.52145 + 12.3595 3.57058 0.00000 1.00000 -3.57058 + 12.3780 12.3893 0.00000 1.00000 -12.3893 + 12.3965 20.6314 0.00000 1.00000 -20.6314 + 12.4150 27.0092 0.00000 1.00000 -27.0092 + 12.4335 30.4959 0.00000 1.00000 -30.4959 + 12.4520 30.5247 0.00000 1.00000 -30.5247 + 12.4705 27.1034 0.00000 1.00000 -27.1034 + 12.4890 20.8197 0.00000 1.00000 -20.8197 + 12.5075 12.7348 0.00000 1.00000 -12.7348 + 12.5260 4.18409 0.00000 1.00000 -4.18409 + 12.5445 -3.47600 0.00000 1.00000 3.47600 + 12.5630 -9.12640 0.00000 1.00000 9.12640 + 12.5815 -12.0958 0.00000 1.00000 12.0958 + 12.6000 -12.2803 0.00000 1.00000 12.2803 + 12.6185 -10.1467 0.00000 1.00000 10.1467 + 12.6370 -6.61573 0.00000 1.00000 6.61573 + 12.6555 -2.84816 0.00000 1.00000 2.84816 + 12.6740 0.0234471 0.00000 1.00000 -0.0234471 + 12.6925 1.16051 0.00000 1.00000 -1.16051 + 12.7110 0.222329 0.00000 1.00000 -0.222329 + 12.7295 -2.53923 0.00000 1.00000 2.53923 + 12.7480 -6.31966 0.00000 1.00000 6.31966 + 12.7665 -9.93250 0.00000 1.00000 9.93250 + 12.7850 -12.0782 0.00000 1.00000 12.0782 + 12.8035 -11.6556 0.00000 1.00000 11.6556 + 12.8220 -8.04822 0.00000 1.00000 8.04822 + 12.8405 -1.31753 0.00000 1.00000 1.31753 + 12.8590 7.74657 0.00000 1.00000 -7.74657 + 12.8775 17.7420 0.00000 1.00000 -17.7420 + 12.8960 26.9214 0.00000 1.00000 -26.9214 + 12.9145 33.5578 0.00000 1.00000 -33.5578 + 12.9330 36.3277 0.00000 1.00000 -36.3277 + 12.9515 34.6234 0.00000 1.00000 -34.6234 + 12.9700 28.7156 0.00000 1.00000 -28.7156 + 12.9885 19.7233 0.00000 1.00000 -19.7233 + 13.0070 9.38804 0.00000 1.00000 -9.38804 + 13.0255 -0.297908 0.00000 1.00000 0.297908 + 13.0440 -7.52791 0.00000 1.00000 7.52791 + 13.0625 -11.0794 0.00000 1.00000 11.0794 + 13.0810 -10.5807 0.00000 1.00000 10.5807 + 13.0995 -6.58087 0.00000 1.00000 6.58087 + 13.1180 -0.404585 0.00000 1.00000 0.404585 + 13.1365 6.17556 0.00000 1.00000 -6.17556 + 13.1550 11.3708 0.00000 1.00000 -11.3708 + 13.1735 13.8053 0.00000 1.00000 -13.8053 + 13.1920 12.8357 0.00000 1.00000 -12.8357 + 13.2105 8.68336 0.00000 1.00000 -8.68336 + 13.2290 2.34908 0.00000 1.00000 -2.34908 + 13.2475 -4.66287 0.00000 1.00000 4.66287 + 13.2660 -10.7379 0.00000 1.00000 10.7379 + 13.2845 -14.5602 0.00000 1.00000 14.5602 + 13.3030 -15.4343 0.00000 1.00000 15.4343 + 13.3215 -13.4393 0.00000 1.00000 13.4393 + 13.3400 -9.37967 0.00000 1.00000 9.37967 + 13.3585 -4.55053 0.00000 1.00000 4.55053 + 13.3770 -0.382431 0.00000 1.00000 0.382431 + 13.3955 1.93839 0.00000 1.00000 -1.93839 + 13.4140 1.77366 0.00000 1.00000 -1.77366 + 13.4325 -0.818874 0.00000 1.00000 0.818874 + 13.4510 -5.13072 0.00000 1.00000 5.13072 + 13.4695 -10.0255 0.00000 1.00000 10.0255 + 13.4880 -14.2744 0.00000 1.00000 14.2744 + 13.5065 -16.9060 0.00000 1.00000 16.9060 + 13.5250 -17.4714 0.00000 1.00000 17.4714 + 13.5435 -16.1512 0.00000 1.00000 16.1512 + 13.5620 -13.6784 0.00000 1.00000 13.6784 + 13.5805 -11.1043 0.00000 1.00000 11.1043 + 13.5990 -9.47288 0.00000 1.00000 9.47288 + 13.6175 -9.49567 0.00000 1.00000 9.49567 + 13.6360 -11.3153 0.00000 1.00000 11.3153 + 13.6545 -14.4268 0.00000 1.00000 14.4268 + 13.6730 -17.7824 0.00000 1.00000 17.7824 + 13.6915 -20.0552 0.00000 1.00000 20.0552 + 13.7100 -19.9965 0.00000 1.00000 19.9965 + 13.7285 -16.7898 0.00000 1.00000 16.7898 + 13.7470 -10.3089 0.00000 1.00000 10.3089 + 13.7655 -1.20781 0.00000 1.00000 1.20781 + 13.7840 9.18567 0.00000 1.00000 -9.18567 + 13.8025 19.1488 0.00000 1.00000 -19.1488 + 13.8210 26.9489 0.00000 1.00000 -26.9489 + 13.8395 31.2366 0.00000 1.00000 -31.2366 + 13.8580 31.3496 0.00000 1.00000 -31.3496 + 13.8765 27.4511 0.00000 1.00000 -27.4511 + 13.8950 20.4697 0.00000 1.00000 -20.4697 + 13.9135 11.8582 0.00000 1.00000 -11.8582 + 13.9320 3.23523 0.00000 1.00000 -3.23523 + 13.9505 -3.99882 0.00000 1.00000 3.99882 + 13.9690 -8.96984 0.00000 1.00000 8.96984 + 13.9875 -11.4848 0.00000 1.00000 11.4848 + 14.0060 -11.9967 0.00000 1.00000 11.9967 + 14.0245 -11.3970 0.00000 1.00000 11.3970 + 14.0430 -10.7008 0.00000 1.00000 10.7008 + 14.0615 -10.7168 0.00000 1.00000 10.7168 + 14.0800 -11.7936 0.00000 1.00000 11.7936 + 14.0985 -13.7115 0.00000 1.00000 13.7115 + 14.1170 -15.7457 0.00000 1.00000 15.7457 + 14.1355 -16.8835 0.00000 1.00000 16.8835 + 14.1540 -16.1342 0.00000 1.00000 16.1342 + 14.1725 -12.8466 0.00000 1.00000 12.8466 + 14.1910 -6.94542 0.00000 1.00000 6.94542 + 14.2095 0.982134 0.00000 1.00000 -0.982134 + 14.2280 9.77953 0.00000 1.00000 -9.77953 + 14.2465 17.9729 0.00000 1.00000 -17.9729 + 14.2650 24.1178 0.00000 1.00000 -24.1178 + 14.2835 27.1485 0.00000 1.00000 -27.1485 + 14.3020 26.6355 0.00000 1.00000 -26.6355 + 14.3205 22.8839 0.00000 1.00000 -22.8839 + 14.3390 16.8479 0.00000 1.00000 -16.8479 + 14.3575 9.88786 0.00000 1.00000 -9.88786 + 14.3760 3.43554 0.00000 1.00000 -3.43554 + 14.3945 -1.34253 0.00000 1.00000 1.34253 + 14.4130 -3.79922 0.00000 1.00000 3.79922 + 14.4315 -3.91650 0.00000 1.00000 3.91650 + 14.4500 -2.25034 0.00000 1.00000 2.25034 + 14.4685 0.265934 0.00000 1.00000 -0.265934 + 14.4870 2.60091 0.00000 1.00000 -2.60091 + 14.5055 3.90902 0.00000 1.00000 -3.90902 + 14.5240 3.74411 0.00000 1.00000 -3.74411 + 14.5425 2.15013 0.00000 1.00000 -2.15013 + 14.5610 -0.388481 0.00000 1.00000 0.388481 + 14.5795 -3.11515 0.00000 1.00000 3.11515 + 14.5980 -5.23631 0.00000 1.00000 5.23631 + 14.6165 -6.15513 0.00000 1.00000 6.15513 + 14.6350 -5.63898 0.00000 1.00000 5.63898 + 14.6535 -3.87566 0.00000 1.00000 3.87566 + 14.6720 -1.40645 0.00000 1.00000 1.40645 + 14.6905 1.04029 0.00000 1.00000 -1.04029 + 14.7090 2.76304 0.00000 1.00000 -2.76304 + 14.7275 3.28473 0.00000 1.00000 -3.28473 + 14.7460 2.47788 0.00000 1.00000 -2.47788 + 14.7645 0.584519 0.00000 1.00000 -0.584519 + 14.7830 -1.87052 0.00000 1.00000 1.87052 + 14.8015 -4.24417 0.00000 1.00000 4.24417 + 14.8200 -5.96765 0.00000 1.00000 5.96765 + 14.8385 -6.70965 0.00000 1.00000 6.70965 + 14.8570 -6.46211 0.00000 1.00000 6.46211 + 14.8755 -5.52356 0.00000 1.00000 5.52356 + 14.8940 -4.38544 0.00000 1.00000 4.38544 + 14.9125 -3.55512 0.00000 1.00000 3.55512 + 14.9310 -3.36898 0.00000 1.00000 3.36898 + 14.9495 -3.85281 0.00000 1.00000 3.85281 + 14.9680 -4.67590 0.00000 1.00000 4.67590 + 14.9865 -5.21922 0.00000 1.00000 5.21922 + 15.0050 -4.74479 0.00000 1.00000 4.74479 + 15.0235 -2.62144 0.00000 1.00000 2.62144 + 15.0420 1.45687 0.00000 1.00000 -1.45687 + 15.0605 7.32500 0.00000 1.00000 -7.32500 + 15.0790 14.3193 0.00000 1.00000 -14.3193 + 15.0975 21.3835 0.00000 1.00000 -21.3835 + 15.1160 27.2852 0.00000 1.00000 -27.2852 + 15.1345 30.8902 0.00000 1.00000 -30.8902 + 15.1530 31.4245 0.00000 1.00000 -31.4245 + 15.1715 28.6588 0.00000 1.00000 -28.6588 + 15.1900 22.9682 0.00000 1.00000 -22.9682 + 15.2085 15.2541 0.00000 1.00000 -15.2541 + 15.2270 6.74712 0.00000 1.00000 -6.74712 + 15.2455 -1.25964 0.00000 1.00000 1.25964 + 15.2640 -7.68049 0.00000 1.00000 7.68049 + 15.2825 -11.8442 0.00000 1.00000 11.8442 + 15.3010 -13.5919 0.00000 1.00000 13.5919 + 15.3195 -13.2493 0.00000 1.00000 13.2493 + 15.3380 -11.4916 0.00000 1.00000 11.4916 + 15.3565 -9.14144 0.00000 1.00000 9.14144 + 15.3750 -6.95504 0.00000 1.00000 6.95504 + 15.3935 -5.44896 0.00000 1.00000 5.44896 + 15.4120 -4.80772 0.00000 1.00000 4.80772 + 15.4305 -4.88897 0.00000 1.00000 4.88897 + 15.4490 -5.31706 0.00000 1.00000 5.31706 + 15.4675 -5.63285 0.00000 1.00000 5.63285 + 15.4860 -5.45462 0.00000 1.00000 5.45462 + 15.5045 -4.60459 0.00000 1.00000 4.60459 + 15.5230 -3.16776 0.00000 1.00000 3.16776 + 15.5415 -1.46992 0.00000 1.00000 1.46992 + 15.5600 0.0157586 0.00000 1.00000 -0.0157586 + 15.5785 0.806047 0.00000 1.00000 -0.806047 + 15.5970 0.550242 0.00000 1.00000 -0.550242 + 15.6155 -0.861348 0.00000 1.00000 0.861348 + 15.6340 -3.25430 0.00000 1.00000 3.25430 + 15.6525 -6.20584 0.00000 1.00000 6.20584 + 15.6710 -9.14992 0.00000 1.00000 9.14992 + 15.6895 -11.5204 0.00000 1.00000 11.5204 + 15.7080 -12.8909 0.00000 1.00000 12.8909 + 15.7265 -13.0717 0.00000 1.00000 13.0717 + 15.7450 -12.1417 0.00000 1.00000 12.1417 + 15.7635 -10.4097 0.00000 1.00000 10.4097 + 15.7820 -8.32011 0.00000 1.00000 8.32011 + 15.8005 -6.33136 0.00000 1.00000 6.33136 + 15.8190 -4.80087 0.00000 1.00000 4.80087 + 15.8375 -3.90675 0.00000 1.00000 3.90675 + 15.8560 -3.62474 0.00000 1.00000 3.62474 + 15.8745 -3.76225 0.00000 1.00000 3.76225 + 15.8930 -4.03596 0.00000 1.00000 4.03596 + 15.9115 -4.16761 0.00000 1.00000 4.16761 + 15.9300 -3.96959 0.00000 1.00000 3.96959 + 15.9485 -3.39629 0.00000 1.00000 3.39629 + 15.9670 -2.54969 0.00000 1.00000 2.54969 + 15.9855 -1.64188 0.00000 1.00000 1.64188 + 16.0040 -0.928772 0.00000 1.00000 0.928772 + 16.0225 -0.634845 0.00000 1.00000 0.634845 + 16.0410 -0.888145 0.00000 1.00000 0.888145 + 16.0595 -1.67980 0.00000 1.00000 1.67980 + 16.0780 -2.85514 0.00000 1.00000 2.85514 + 16.0965 -4.13661 0.00000 1.00000 4.13661 + 16.1150 -5.17310 0.00000 1.00000 5.17310 + 16.1335 -5.60636 0.00000 1.00000 5.60636 + 16.1520 -5.14159 0.00000 1.00000 5.14159 + 16.1705 -3.60734 0.00000 1.00000 3.60734 + 16.1890 -0.992023 0.00000 1.00000 0.992023 + 16.2075 2.54958 0.00000 1.00000 -2.54958 + 16.2260 6.71807 0.00000 1.00000 -6.71807 + 16.2445 11.1120 0.00000 1.00000 -11.1120 + 16.2630 15.2812 0.00000 1.00000 -15.2812 + 16.2815 18.7822 0.00000 1.00000 -18.7822 + 16.3000 21.2269 0.00000 1.00000 -21.2269 + 16.3185 22.3212 0.00000 1.00000 -22.3212 + 16.3370 21.8912 0.00000 1.00000 -21.8912 + 16.3555 19.8991 0.00000 1.00000 -19.8991 + 16.3740 16.4493 0.00000 1.00000 -16.4493 + 16.3925 11.7863 0.00000 1.00000 -11.7863 + 16.4110 6.28331 0.00000 1.00000 -6.28331 + 16.4295 0.418687 0.00000 1.00000 -0.418687 + 16.4480 -5.25963 0.00000 1.00000 5.25963 + 16.4665 -10.1842 0.00000 1.00000 10.1842 + 16.4850 -13.8295 0.00000 1.00000 13.8295 + 16.5035 -15.7785 0.00000 1.00000 15.7785 + 16.5220 -15.7830 0.00000 1.00000 15.7830 + 16.5405 -13.8070 0.00000 1.00000 13.8070 + 16.5590 -10.0391 0.00000 1.00000 10.0391 + 16.5775 -4.87264 0.00000 1.00000 4.87264 + 16.5960 1.14589 0.00000 1.00000 -1.14589 + 16.6145 7.38649 0.00000 1.00000 -7.38649 + 16.6330 13.2091 0.00000 1.00000 -13.2091 + 16.6515 18.0296 0.00000 1.00000 -18.0296 + 16.6700 21.3708 0.00000 1.00000 -21.3708 + 16.6885 22.8991 0.00000 1.00000 -22.8991 + 16.7070 22.4456 0.00000 1.00000 -22.4456 + 16.7255 20.0158 0.00000 1.00000 -20.0158 + 16.7440 15.7881 0.00000 1.00000 -15.7881 + 16.7625 10.1035 0.00000 1.00000 -10.1035 + 16.7810 3.44424 0.00000 1.00000 -3.44424 + 16.7995 -3.59847 0.00000 1.00000 3.59847 + 16.8180 -10.3717 0.00000 1.00000 10.3717 + 16.8365 -16.2205 0.00000 1.00000 16.2205 + 16.8550 -20.5580 0.00000 1.00000 20.5580 + 16.8735 -22.9372 0.00000 1.00000 22.9372 + 16.8920 -23.1129 0.00000 1.00000 23.1129 + 16.9105 -21.0837 0.00000 1.00000 21.0837 + 16.9290 -17.1032 0.00000 1.00000 17.1032 + 16.9475 -11.6563 0.00000 1.00000 11.6563 + 16.9660 -5.39998 0.00000 1.00000 5.39998 + 16.9845 0.923758 0.00000 1.00000 -0.923758 + 17.0030 6.59122 0.00000 1.00000 -6.59122 + 17.0215 10.9979 0.00000 1.00000 -10.9979 + 17.0400 13.7383 0.00000 1.00000 -13.7383 + 17.0585 14.6477 0.00000 1.00000 -14.6477 + 17.0770 13.7998 0.00000 1.00000 -13.7998 + 17.0955 11.4638 0.00000 1.00000 -11.4638 + 17.1140 8.03578 0.00000 1.00000 -8.03578 + 17.1325 3.96378 0.00000 1.00000 -3.96378 + 17.1510 -0.316698 0.00000 1.00000 0.316698 + 17.1695 -4.42438 0.00000 1.00000 4.42438 + 17.1880 -8.04681 0.00000 1.00000 8.04681 + 17.2065 -10.9324 0.00000 1.00000 10.9324 + 17.2250 -12.8725 0.00000 1.00000 12.8725 + 17.2435 -13.6898 0.00000 1.00000 13.6898 + 17.2620 -13.2456 0.00000 1.00000 13.2456 + 17.2805 -11.4675 0.00000 1.00000 11.4675 + 17.2990 -8.39144 0.00000 1.00000 8.39144 + 17.3175 -4.20001 0.00000 1.00000 4.20001 + 17.3360 0.758004 0.00000 1.00000 -0.758004 + 17.3545 5.98116 0.00000 1.00000 -5.98116 + 17.3730 10.8661 0.00000 1.00000 -10.8661 + 17.3915 14.7906 0.00000 1.00000 -14.7906 + 17.4100 17.2137 0.00000 1.00000 -17.2137 + 17.4285 17.7745 0.00000 1.00000 -17.7745 + 17.4470 16.3661 0.00000 1.00000 -16.3661 + 17.4655 13.1690 0.00000 1.00000 -13.1690 + 17.4840 8.63053 0.00000 1.00000 -8.63053 + 17.5025 3.39246 0.00000 1.00000 -3.39246 + 17.5210 -1.82203 0.00000 1.00000 1.82203 + 17.5395 -6.33848 0.00000 1.00000 6.33848 + 17.5580 -9.64981 0.00000 1.00000 9.64981 + 17.5765 -11.4978 0.00000 1.00000 11.4978 + 17.5950 -11.9009 0.00000 1.00000 11.9009 + 17.6135 -11.1239 0.00000 1.00000 11.1239 + 17.6320 -9.59944 0.00000 1.00000 9.59944 + 17.6505 -7.81972 0.00000 1.00000 7.81972 + 17.6690 -6.22442 0.00000 1.00000 6.22442 + 17.6875 -5.11122 0.00000 1.00000 5.11122 + 17.7060 -4.58875 0.00000 1.00000 4.58875 + 17.7245 -4.58029 0.00000 1.00000 4.58029 + 17.7430 -4.87225 0.00000 1.00000 4.87225 + 17.7615 -5.18968 0.00000 1.00000 5.18968 + 17.7800 -5.27616 0.00000 1.00000 5.27616 + 17.7985 -4.95771 0.00000 1.00000 4.95771 + 17.8170 -4.17763 0.00000 1.00000 4.17763 + 17.8355 -2.99861 0.00000 1.00000 2.99861 + 17.8540 -1.57655 0.00000 1.00000 1.57655 + 17.8725 -0.115674 0.00000 1.00000 0.115674 + 17.8910 1.18232 0.00000 1.00000 -1.18232 + 17.9095 2.16253 0.00000 1.00000 -2.16253 + 17.9280 2.74507 0.00000 1.00000 -2.74507 + 17.9465 2.93310 0.00000 1.00000 -2.93310 + 17.9650 2.80225 0.00000 1.00000 -2.80225 + 17.9835 2.47685 0.00000 1.00000 -2.47685 + 18.0020 2.09940 0.00000 1.00000 -2.09940 + 18.0205 1.79907 0.00000 1.00000 -1.79907 + 18.0390 1.66403 0.00000 1.00000 -1.66403 + 18.0575 1.72260 0.00000 1.00000 -1.72260 + 18.0760 1.93703 0.00000 1.00000 -1.93703 + 18.0945 2.21113 0.00000 1.00000 -2.21113 + 18.1130 2.40837 0.00000 1.00000 -2.40837 + 18.1315 2.37442 0.00000 1.00000 -2.37442 + 18.1500 1.95988 0.00000 1.00000 -1.95988 + 18.1685 1.04724 0.00000 1.00000 -1.04724 + 18.1870 -0.426523 0.00000 1.00000 0.426523 + 18.2055 -2.45315 0.00000 1.00000 2.45315 + 18.2240 -4.90773 0.00000 1.00000 4.90773 + 18.2425 -7.52944 0.00000 1.00000 7.52944 + 18.2610 -9.92715 0.00000 1.00000 9.92715 + 18.2795 -11.6174 0.00000 1.00000 11.6174 + 18.2980 -12.0956 0.00000 1.00000 12.0956 + 18.3165 -10.9327 0.00000 1.00000 10.9327 + 18.3350 -7.88331 0.00000 1.00000 7.88331 + 18.3535 -2.98071 0.00000 1.00000 2.98071 + 18.3720 3.40650 0.00000 1.00000 -3.40650 + 18.3905 10.5811 0.00000 1.00000 -10.5811 + 18.4090 17.5968 0.00000 1.00000 -17.5968 + 18.4275 23.4036 0.00000 1.00000 -23.4036 + 18.4460 27.0310 0.00000 1.00000 -27.0310 + 18.4645 27.7731 0.00000 1.00000 -27.7731 + 18.4830 25.3345 0.00000 1.00000 -25.3345 + 18.5015 19.9052 0.00000 1.00000 -19.9052 + 18.5200 12.1472 0.00000 1.00000 -12.1472 + 18.5385 3.09099 0.00000 1.00000 -3.09099 + 18.5570 -6.03798 0.00000 1.00000 6.03798 + 18.5755 -14.0281 0.00000 1.00000 14.0281 + 18.5940 -19.8843 0.00000 1.00000 19.8843 + 18.6125 -22.9844 0.00000 1.00000 22.9844 + 18.6310 -23.1597 0.00000 1.00000 23.1597 + 18.6495 -20.6881 0.00000 1.00000 20.6881 + 18.6680 -16.2075 0.00000 1.00000 16.2075 + 18.6865 -10.5714 0.00000 1.00000 10.5714 + 18.7050 -4.68098 0.00000 1.00000 4.68098 + 18.7235 0.671251 0.00000 1.00000 -0.671251 + 18.7420 4.91529 0.00000 1.00000 -4.91529 + 18.7605 7.75797 0.00000 1.00000 -7.75797 + 18.7790 9.17588 0.00000 1.00000 -9.17588 + 18.7975 9.35965 0.00000 1.00000 -9.35965 + 18.8160 8.63035 0.00000 1.00000 -8.63035 + 18.8345 7.35145 0.00000 1.00000 -7.35145 + 18.8530 5.85510 0.00000 1.00000 -5.85510 + 18.8715 4.39513 0.00000 1.00000 -4.39513 + 18.8900 3.13002 0.00000 1.00000 -3.13002 + 18.9085 2.13168 0.00000 1.00000 -2.13168 + 18.9270 1.40976 0.00000 1.00000 -1.40976 + 18.9455 0.939913 0.00000 1.00000 -0.939913 + 18.9640 0.686429 0.00000 1.00000 -0.686429 + 18.9825 0.614229 0.00000 1.00000 -0.614229 + 19.0010 0.690570 0.00000 1.00000 -0.690570 + 19.0195 0.880032 0.00000 1.00000 -0.880032 + 19.0380 1.13788 0.00000 1.00000 -1.13788 + 19.0565 1.40627 0.00000 1.00000 -1.40627 + 19.0750 1.61604 0.00000 1.00000 -1.61604 + 19.0935 1.69418 0.00000 1.00000 -1.69418 + 19.1120 1.57467 0.00000 1.00000 -1.57467 + 19.1305 1.20912 0.00000 1.00000 -1.20912 + 19.1490 0.574418 0.00000 1.00000 -0.574418 + 19.1675 -0.322868 0.00000 1.00000 0.322868 + 19.1860 -1.44364 0.00000 1.00000 1.44364 + 19.2045 -2.71278 0.00000 1.00000 2.71278 + 19.2230 -4.01492 0.00000 1.00000 4.01492 + 19.2415 -5.19189 0.00000 1.00000 5.19189 + 19.2600 -6.04623 0.00000 1.00000 6.04623 + 19.2785 -6.35560 0.00000 1.00000 6.35560 + 19.2970 -5.90135 0.00000 1.00000 5.90135 + 19.3155 -4.51168 0.00000 1.00000 4.51168 + 19.3340 -2.11474 0.00000 1.00000 2.11474 + 19.3525 1.20914 0.00000 1.00000 -1.20914 + 19.3710 5.19105 0.00000 1.00000 -5.19105 + 19.3895 9.36912 0.00000 1.00000 -9.36912 + 19.4080 13.1271 0.00000 1.00000 -13.1271 + 19.4265 15.7779 0.00000 1.00000 -15.7779 + 19.4450 16.6827 0.00000 1.00000 -16.6827 + 19.4635 15.3867 0.00000 1.00000 -15.3867 + 19.4820 11.7418 0.00000 1.00000 -11.7418 + 19.5005 5.98757 0.00000 1.00000 -5.98757 + 19.5190 -1.23710 0.00000 1.00000 1.23710 + 19.5375 -8.96359 0.00000 1.00000 8.96359 + 19.5560 -16.0382 0.00000 1.00000 16.0382 + 19.5745 -21.3164 0.00000 1.00000 21.3164 + 19.5930 -23.8699 0.00000 1.00000 23.8699 + 19.6115 -23.1644 0.00000 1.00000 23.1644 + 19.6300 -19.1740 0.00000 1.00000 19.1740 + 19.6485 -12.4057 0.00000 1.00000 12.4057 + 19.6670 -3.82669 0.00000 1.00000 3.82669 + 19.6855 5.29471 0.00000 1.00000 -5.29471 + 19.7040 13.6058 0.00000 1.00000 -13.6058 + 19.7225 19.9014 0.00000 1.00000 -19.9014 + 19.7410 23.3260 0.00000 1.00000 -23.3260 + 19.7595 23.5068 0.00000 1.00000 -23.5068 + 19.7780 20.5929 0.00000 1.00000 -20.5929 + 19.7965 15.1973 0.00000 1.00000 -15.1973 + 19.8150 8.25741 0.00000 1.00000 -8.25741 + 19.8335 0.846490 0.00000 1.00000 -0.846490 + 19.8520 -6.02165 0.00000 1.00000 6.02165 + 19.8705 -11.5565 0.00000 1.00000 11.5565 + 19.8890 -15.2939 0.00000 1.00000 15.2939 + 19.9075 -17.1257 0.00000 1.00000 17.1257 + 19.9260 -17.2573 0.00000 1.00000 17.2573 + 19.9445 -16.1119 0.00000 1.00000 16.1119 + 19.9630 -14.2055 0.00000 1.00000 14.2055 + 19.9815 -12.0275 0.00000 1.00000 12.0275 + 20.0000 -9.95383 0.00000 1.00000 9.95383 diff --git a/src/diffpy/pdffit2/tests/testdata/Ni.stru b/src/diffpy/pdffit2/tests/testdata/Ni.stru new file mode 100644 index 00000000..b4da517c --- /dev/null +++ b/src/diffpy/pdffit2/tests/testdata/Ni.stru @@ -0,0 +1,33 @@ +title structure Ni FCC +format pdffit +scale 1.000000 +sharp 0.000000, 1.000000, 0.000000 +spcgr Fm-3m +cell 3.520000, 3.520000, 3.520000, 90.000000, 90.000000, 90.000000 +dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 +ncell 1, 1, 1, 4 +atoms +NI 0.00000000 0.00000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.00000000 0.50000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.50000000 0.00000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.50000000 0.50000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 diff --git a/src/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru b/src/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru new file mode 100644 index 00000000..71ba3651 --- /dev/null +++ b/src/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru @@ -0,0 +1,345 @@ +title Pb8 (Sc16/3 W8/3)0.75 (Ti8)0.25 O24, B factors from BNL2 +format pdffit +scale 1.000000 +sharp 0.000000, 1.000000, 0.000000 +spcgr Fm-3m +cell 8.072700, 8.072700, 8.072700, 90.000000, 90.000000, 90.000000 +dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 +ncell 1, 1, 1, 56 +atoms +PB 0.25000000 0.25000000 0.25000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.04795025 0.04795025 0.04795025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +PB 0.25000000 0.75000000 0.75000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.04795025 0.04795025 0.04795025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +PB 0.75000000 0.25000000 0.75000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.04795025 0.04795025 0.04795025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +PB 0.75000000 0.75000000 0.25000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.04795025 0.04795025 0.04795025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +PB 0.25000000 0.25000000 0.75000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.04795025 0.04795025 0.04795025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +PB 0.75000000 0.25000000 0.25000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.04795025 0.04795025 0.04795025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +PB 0.25000000 0.75000000 0.25000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.04795025 0.04795025 0.04795025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +PB 0.75000000 0.75000000 0.75000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.04795025 0.04795025 0.04795025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.00000000 0.00000000 0.25735000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.00000000 0.50000000 0.75735003 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.50000000 0.00000000 0.75735003 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.50000000 0.50000000 0.25735000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.00000000 0.00000000 0.74264997 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.00000000 0.50000000 0.24265000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.50000000 0.00000000 0.24265000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.50000000 0.50000000 0.74264997 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.25735000 0.00000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.75735003 0.00000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.75735003 0.50000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.25735000 0.50000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.74264997 0.00000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.24265000 0.00000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.24265000 0.50000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.74264997 0.50000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.00000000 0.25735000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.50000000 0.75735003 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.00000000 0.75735003 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.50000000 0.25735000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.00000000 0.74264997 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.50000000 0.24265000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.00000000 0.24265000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +O 0.50000000 0.74264997 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.02293025 0.02293025 0.02293025 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +SC 0.00000000 0.00000000 0.00000000 0.9739 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +SC 0.00000000 0.50000000 0.50000000 0.9739 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +SC 0.50000000 0.00000000 0.50000000 0.9739 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +SC 0.50000000 0.50000000 0.00000000 0.9739 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +SC 0.50000000 0.50000000 0.50000000 0.0261 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +SC 0.50000000 0.00000000 0.00000000 0.0261 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +SC 0.00000000 0.50000000 0.00000000 0.0261 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +SC 0.00000000 0.00000000 0.50000000 0.0261 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +W 0.00000000 0.00000000 0.00000000 0.0131 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +W 0.00000000 0.50000000 0.50000000 0.0131 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +W 0.50000000 0.00000000 0.50000000 0.0131 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +W 0.50000000 0.50000000 0.00000000 0.0131 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +W 0.50000000 0.50000000 0.50000000 0.4869 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +W 0.50000000 0.00000000 0.00000000 0.4869 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +W 0.00000000 0.50000000 0.00000000 0.4869 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +W 0.00000000 0.00000000 0.50000000 0.4869 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +TI 0.00000000 0.00000000 0.00000000 0.0131 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +TI 0.00000000 0.50000000 0.50000000 0.0131 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +TI 0.50000000 0.00000000 0.50000000 0.0131 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +TI 0.50000000 0.50000000 0.00000000 0.0131 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +TI 0.50000000 0.50000000 0.50000000 0.4869 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +TI 0.50000000 0.00000000 0.00000000 0.4869 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +TI 0.00000000 0.50000000 0.00000000 0.4869 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +TI 0.00000000 0.00000000 0.50000000 0.4869 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00809050 0.00809050 0.00809050 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 diff --git a/src/diffpy/pdffit2/tests/testdata/badNi.dat b/src/diffpy/pdffit2/tests/testdata/badNi.dat new file mode 100644 index 00000000..ef5b7007 --- /dev/null +++ b/src/diffpy/pdffit2/tests/testdata/badNi.dat @@ -0,0 +1,1001 @@ + 1.50000 -0.539443 0.00000 1.00000 0.539443 + 1.51850 -1.03098 0.00000 1.00000 1.03098 + 1.53700 -1.43712 0.00000 1.00000 1.43712 + 1.55550 -1.73810 0.00000 1.00000 1.73810 + 1.57400 -1.93402 0.00000 1.00000 1.93402 + 1.59250 -2.04145 0.00000 1.00000 2.04145 + 1.61100 -2.08593 0.00000 1.00000 2.08593 + 1.62950 -2.09295 0.00000 1.00000 2.09295 + 1.64800 -2.08072 0.00000 1.00000 2.08072 + 1.66650 -2.05688 0.00000 1.00000 2.05688 + 1.68500 -2.02006 0.00000 1.00000 2.02006 + 1.70350 -1.96554 0.00000 1.00000 1.96554 + 1.72200 -1.89239 0.00000 1.00000 1.89239 + 1.74050 -1.80936 0.00000 1.00000 1.80936 + 1.75900 -1.73670 0.00000 1.00000 1.73670 + 1.77750 -1.70255 0.00000 1.00000 1.70255 + 1.79600 -1.73461 0.00000 1.00000 1.73461 + 1.81450 -1.84946 0.00000 1.00000 1.84946 + 1.83300 -2.04300 0.00000 1.00000 2.04300 + 1.85150 -2.28566 0.00000 1.00000 2.28566 + 1.87000 -2.52486 0.00000 1.00000 2.52486 + 1.88850 -2.69615 0.00000 1.00000 2.69615 + 1.92700 -2.74180 0.00000 1.00000 2.74180 + 1.92550 -2.63223 0.00000 1.00000 2.63223 + 1.94400 -2.38239 0.00000 1.00000 2.38239 + 1.96250 -2.05565 0.00000 1.00000 2.05565 + 1.98100 -1.75092 0.00000 1.00000 1.75092 + 1.99950 -1.57518 0.00000 1.00000 1.57518 + 2.01800 -1.60914 0.00000 1.00000 1.60914 + 2.03650 -1.87687 0.00000 1.00000 1.87687 + 2.05500 -2.33004 0.00000 1.00000 2.33004 + 2.07350 -2.85357 0.00000 1.00000 2.85357 + 2.09200 -3.29353 0.00000 1.00000 3.29353 + 2.11050 -3.50124 0.00000 1.00000 3.50124 + 2.12900 -3.38172 0.00000 1.00000 3.38172 + 2.14750 -2.93205 0.00000 1.00000 2.93205 + 2.16600 -2.25629 0.00000 1.00000 2.25629 + 2.18450 -1.54918 0.00000 1.00000 1.54918 + 2.20300 -1.04888 0.00000 1.00000 1.04888 + 2.22150 -0.968136 0.00000 1.00000 0.968136 + 2.24000 -1.42070 0.00000 1.00000 1.42070 + 2.25850 -2.36300 0.00000 1.00000 2.36300 + 2.27700 -3.56960 0.00000 1.00000 3.56960 + 2.29550 -4.65416 0.00000 1.00000 4.65416 + 2.31400 -5.13684 0.00000 1.00000 5.13684 + 2.33250 -4.54696 0.00000 1.00000 4.54696 + 2.35100 -2.53890 0.00000 1.00000 2.53890 + 2.36950 1.00656 0.00000 1.00000 -1.00656 + 2.38800 5.92223 0.00000 1.00000 -5.92223 + 2.40650 11.7527 0.00000 1.00000 -11.7527 + 2.42500 17.8143 0.00000 1.00000 -17.8143 + 2.44350 23.3057 0.00000 1.00000 -23.3057 + 2.46200 27.4478 0.00000 1.00000 -27.4478 + 2.48050 29.6246 0.00000 1.00000 -29.6246 + 2.49900 29.4986 0.00000 1.00000 -29.4986 + 2.51750 27.0749 0.00000 1.00000 -27.0749 + 2.53600 22.7028 0.00000 1.00000 -22.7028 + 2.55450 17.0112 0.00000 1.00000 -17.0112 + 2.57300 10.7932 0.00000 1.00000 -10.7932 + 2.59150 4.86134 0.00000 1.00000 -4.86134 + 2.61000 -0.0945224 0.00000 1.00000 0.0945224 + 2.62850 -3.61858 0.00000 1.00000 3.61858 + 2.64700 -5.54803 0.00000 1.00000 5.54803 + 2.66550 -6.01016 0.00000 1.00000 6.01016 + 2.68400 -5.36293 0.00000 1.00000 5.36293 + 2.70250 -4.09596 0.00000 1.00000 4.09596 + 2.72100 -2.71625 0.00000 1.00000 2.71625 + 2.73950 -1.64382 0.00000 1.00000 1.64382 + 2.75800 -1.13791 0.00000 1.00000 1.13791 + 2.77650 -1.26649 0.00000 1.00000 1.26649 + 2.79500 -1.92103 0.00000 1.00000 1.92103 + 2.81350 -2.86890 0.00000 1.00000 2.86890 + 2.83200 -3.82782 0.00000 1.00000 3.82782 + 2.85050 -4.54328 0.00000 1.00000 4.54328 + 2.86900 -4.85054 0.00000 1.00000 4.85054 + 2.88750 -4.70809 0.00000 1.00000 4.70809 + 2.90600 -4.19687 0.00000 1.00000 4.19687 + 2.92450 -3.48841 0.00000 1.00000 3.48841 + 2.94300 -2.79256 0.00000 1.00000 2.79256 + 2.96150 -2.29993 0.00000 1.00000 2.29993 + 2.98000 -2.13422 0.00000 1.00000 2.13422 + 2.99850 -2.32552 0.00000 1.00000 2.32552 + 3.01700 -2.80931 0.00000 1.00000 2.80931 + 3.03550 -3.44928 0.00000 1.00000 3.44928 + 3.05400 -4.07624 0.00000 1.00000 4.07624 + 3.07250 -4.53264 0.00000 1.00000 4.53264 + 3.09100 -4.71141 0.00000 1.00000 4.71141 + 3.10950 -4.58013 0.00000 1.00000 4.58013 + 3.12800 -4.18572 0.00000 1.00000 4.18572 + 3.14650 -3.63955 0.00000 1.00000 3.63955 + 3.16500 -3.08796 0.00000 1.00000 3.08796 + 3.18350 -2.67579 0.00000 1.00000 2.67579 + 3.20200 -2.51194 0.00000 1.00000 2.51194 + 3.22050 -2.64475 0.00000 1.00000 2.64475 + 3.23900 -3.05186 0.00000 1.00000 3.05186 + 3.25750 -3.64576 0.00000 1.00000 3.64576 + 3.27600 -4.29257 0.00000 1.00000 4.29257 + 3.29450 -4.83876 0.00000 1.00000 4.83876 + 3.31300 -5.14008 0.00000 1.00000 5.14008 + 3.33150 -5.08721 0.00000 1.00000 5.08721 + 3.35000 -4.62391 0.00000 1.00000 4.62391 + 3.36850 -3.75470 0.00000 1.00000 3.75470 + 3.38700 -2.54063 0.00000 1.00000 2.54063 + 3.40550 -1.08396 0.00000 1.00000 1.08396 + 3.42400 0.493223 0.00000 1.00000 -0.493223 + 3.44250 2.06874 0.00000 1.00000 -2.06874 + 3.46100 3.53152 0.00000 1.00000 -3.53152 + 3.47950 4.78254 0.00000 1.00000 -4.78254 + 3.49800 5.72969 0.00000 1.00000 -5.72969 + 3.51650 6.28423 0.00000 1.00000 -6.28423 + 3.53500 6.36504 0.00000 1.00000 -6.36504 + 3.55350 5.91247 0.00000 1.00000 -5.91247 + 3.57200 4.90861 0.00000 1.00000 -4.90861 + 3.59050 3.39740 0.00000 1.00000 -3.39740 + 3.60900 1.49612 0.00000 1.00000 -1.49612 + 3.62750 -0.608193 0.00000 1.00000 0.608193 + 3.64600 -2.68019 0.00000 1.00000 2.68019 + 3.66450 -4.47243 0.00000 1.00000 4.47243 + 3.68300 -5.76925 0.00000 1.00000 5.76925 + 3.70150 -6.42920 0.00000 1.00000 6.42920 + 3.72000 -6.41719 0.00000 1.00000 6.41719 + 3.73850 -5.81875 0.00000 1.00000 5.81875 + 3.75700 -4.83074 0.00000 1.00000 4.83074 + 3.77550 -3.72667 0.00000 1.00000 3.72667 + 3.79400 -2.80071 0.00000 1.00000 2.80071 + 3.81250 -2.30147 0.00000 1.00000 2.30147 + 3.83100 -2.37126 0.00000 1.00000 2.37126 + 3.84950 -3.00713 0.00000 1.00000 3.00713 + 3.86800 -4.05566 0.00000 1.00000 4.05566 + 3.88650 -5.24604 0.00000 1.00000 5.24604 + 3.90500 -6.25585 0.00000 1.00000 6.25585 + 3.92350 -6.79521 0.00000 1.00000 6.79521 + 3.94200 -6.68830 0.00000 1.00000 6.68830 + 3.96050 -5.93010 0.00000 1.00000 5.93010 + 3.97900 -4.70113 0.00000 1.00000 4.70113 + 3.99750 -3.33259 0.00000 1.00000 3.33259 + 4.01600 -2.22683 0.00000 1.00000 2.22683 + 4.03450 -1.75037 0.00000 1.00000 1.75037 + 4.05300 -2.12498 0.00000 1.00000 2.12498 + 4.07150 -3.34471 0.00000 1.00000 3.34471 + 4.09000 -5.14253 0.00000 1.00000 5.14253 + 4.10850 -7.01935 0.00000 1.00000 7.01935 + 4.12700 -8.33391 0.00000 1.00000 8.33391 + 4.14550 -8.43660 0.00000 1.00000 8.43660 + 4.16400 -6.81920 0.00000 1.00000 6.81920 + 4.18250 -3.24667 0.00000 1.00000 3.24667 + 4.20100 2.16009 0.00000 1.00000 -2.16009 + 4.21950 8.91152 0.00000 1.00000 -8.91152 + 4.23800 16.2134 0.00000 1.00000 -16.2134 + 4.25650 23.0973 0.00000 1.00000 -23.0973 + 4.27500 28.5935 0.00000 1.00000 -28.5935 + 4.29350 31.9106 0.00000 1.00000 -31.9106 + 4.31200 32.5842 0.00000 1.00000 -32.5842 + 4.33050 30.5617 0.00000 1.00000 -30.5617 + 4.34900 26.2027 0.00000 1.00000 -26.2027 + 4.36750 20.1990 0.00000 1.00000 -20.1990 + 4.38600 13.4320 0.00000 1.00000 -13.4320 + 4.40450 6.80337 0.00000 1.00000 -6.80337 + 4.42300 1.07527 0.00000 1.00000 -1.07527 + 4.44150 -3.24700 0.00000 1.00000 3.24700 + 4.46000 -5.96945 0.00000 1.00000 5.96945 + 4.47850 -7.19581 0.00000 1.00000 7.19581 + 4.49700 -7.25613 0.00000 1.00000 7.25613 + 4.51550 -6.59972 0.00000 1.00000 6.59972 + 4.53400 -5.68054 0.00000 1.00000 5.68054 + 4.55250 -4.86170 0.00000 1.00000 4.86170 + 4.57100 -4.35835 0.00000 1.00000 4.35835 + 4.58950 -4.22677 0.00000 1.00000 4.22677 + 4.60800 -4.39508 0.00000 1.00000 4.39508 + 4.62650 -4.72130 0.00000 1.00000 4.72130 + 4.64500 -5.05871 0.00000 1.00000 5.05871 + 4.66350 -5.30848 0.00000 1.00000 5.30848 + 4.68200 -5.44197 0.00000 1.00000 5.44197 + 4.70050 -5.50097 0.00000 1.00000 5.50097 + 4.71900 -5.56456 0.00000 1.00000 5.56456 + 4.73750 -5.69659 0.00000 1.00000 5.69659 + 4.75600 -5.90806 0.00000 1.00000 5.90806 + 4.77450 -6.13525 0.00000 1.00000 6.13525 + 4.79300 -6.24364 0.00000 1.00000 6.24364 + 4.81150 -6.05670 0.00000 1.00000 6.05670 + 4.83000 -5.40165 0.00000 1.00000 5.40165 + 4.84850 -4.16022 0.00000 1.00000 4.16022 + 4.86700 -2.31100 0.00000 1.00000 2.31100 + 4.88550 0.0479985 0.00000 1.00000 -0.0479985 + 4.90400 2.70271 0.00000 1.00000 -2.70271 + 4.92250 5.35252 0.00000 1.00000 -5.35252 + 4.94100 7.65960 0.00000 1.00000 -7.65960 + 4.95950 9.30734 0.00000 1.00000 -9.30734 + 4.97800 10.0558 0.00000 1.00000 -10.0558 + 4.99650 9.78268 0.00000 1.00000 -9.78268 + 5.01500 8.50309 0.00000 1.00000 -8.50309 + 5.03350 6.36470 0.00000 1.00000 -6.36470 + 5.05200 3.62252 0.00000 1.00000 -3.62252 + 5.07050 0.599290 0.00000 1.00000 -0.599290 + 5.08900 -2.36086 0.00000 1.00000 2.36086 + 5.10750 -4.93870 0.00000 1.00000 4.93870 + 5.12600 -6.88149 0.00000 1.00000 6.88149 + 5.14450 -8.03565 0.00000 1.00000 8.03565 + 5.16300 -8.36668 0.00000 1.00000 8.36668 + 5.18150 -7.96304 0.00000 1.00000 7.96304 + 5.20000 -7.02207 0.00000 1.00000 7.02207 + 5.21850 -5.81895 0.00000 1.00000 5.81895 + 5.23700 -4.66171 0.00000 1.00000 4.66171 + 5.25550 -3.83844 0.00000 1.00000 3.83844 + 5.27400 -3.56410 0.00000 1.00000 3.56410 + 5.29250 -3.93573 0.00000 1.00000 3.93573 + 5.31100 -4.90467 0.00000 1.00000 4.90467 + 5.32950 -6.27267 0.00000 1.00000 6.27267 + 5.34800 -7.71536 0.00000 1.00000 7.71536 + 5.36650 -8.83203 0.00000 1.00000 8.83203 + 5.38500 -9.21516 0.00000 1.00000 9.21516 + 5.40350 -8.52808 0.00000 1.00000 8.52808 + 5.42200 -6.57611 0.00000 1.00000 6.57611 + 5.44050 -3.35625 0.00000 1.00000 3.35625 + 5.45900 0.925287 0.00000 1.00000 -0.925287 + 5.47750 5.87209 0.00000 1.00000 -5.87209 + 5.49600 10.9500 0.00000 1.00000 -10.9500 + 5.51450 15.5640 0.00000 1.00000 -15.5640 + 5.53300 19.1477 0.00000 1.00000 -19.1477 + 5.55150 21.2490 0.00000 1.00000 -21.2490 + 5.57000 21.6003 0.00000 1.00000 -21.6003 + 5.58850 20.1588 0.00000 1.00000 -20.1588 + 5.60700 17.1124 0.00000 1.00000 -17.1124 + 5.62550 12.8494 0.00000 1.00000 -12.8494 + 5.64400 7.89927 0.00000 1.00000 -7.89927 + 5.66250 2.85190 0.00000 1.00000 -2.85190 + 5.68100 -1.72997 0.00000 1.00000 1.72997 + 5.69950 -5.39381 0.00000 1.00000 5.39381 + 5.71800 -7.86162 0.00000 1.00000 7.86162 + 5.73650 -9.06420 0.00000 1.00000 9.06420 + 5.75500 -9.13837 0.00000 1.00000 9.13837 + 5.77350 -8.38683 0.00000 1.00000 8.38683 + 5.79200 -7.20818 0.00000 1.00000 7.20818 + 5.81050 -6.01172 0.00000 1.00000 6.01172 + 5.82900 -5.13567 0.00000 1.00000 5.13567 + 5.84750 -4.78662 0.00000 1.00000 4.78662 + 5.86600 -5.01125 0.00000 1.00000 5.01125 + 5.88450 -5.70222 0.00000 1.00000 5.70222 + 5.90300 -6.63275 0.00000 1.00000 6.63275 + 5.92150 -7.51031 0.00000 1.00000 7.51031 + 5.94000 -8.03914 0.00000 1.00000 8.03914 + 5.95850 -7.98163 0.00000 1.00000 7.98163 + 5.97700 -7.20897 0.00000 1.00000 7.20897 + 5.99550 -5.73309 0.00000 1.00000 5.73309 + 6.01400 -3.71335 0.00000 1.00000 3.71335 + 6.03250 -1.43572 0.00000 1.00000 1.43572 + 6.05100 0.734316 0.00000 1.00000 -0.734316 + 6.06950 2.41816 0.00000 1.00000 -2.41816 + 6.08800 3.29880 0.00000 1.00000 -3.29880 + 6.10650 3.18922 0.00000 1.00000 -3.18922 + 6.12500 2.07961 0.00000 1.00000 -2.07961 + 6.14350 0.150522 0.00000 1.00000 -0.150522 + 6.16200 -2.25436 0.00000 1.00000 2.25436 + 6.18050 -4.69426 0.00000 1.00000 4.69426 + 6.19900 -6.72460 0.00000 1.00000 6.72460 + 6.21750 -7.99834 0.00000 1.00000 7.99834 + 6.23600 -8.35142 0.00000 1.00000 8.35142 + 6.25450 -7.84948 0.00000 1.00000 7.84948 + 6.27300 -6.78013 0.00000 1.00000 6.78013 + 6.29150 -5.58671 0.00000 1.00000 5.58671 + 6.31000 -4.75441 0.00000 1.00000 4.75441 + 6.32850 -4.67266 0.00000 1.00000 4.67266 + 6.34700 -5.50714 0.00000 1.00000 5.50714 + 6.36550 -7.11590 0.00000 1.00000 7.11590 + 6.38400 -9.03699 0.00000 1.00000 9.03699 + 6.40250 -10.5592 0.00000 1.00000 10.5592 + 6.42100 -10.8676 0.00000 1.00000 10.8676 + 6.43950 -9.23379 0.00000 1.00000 9.23379 + 6.45800 -5.20861 0.00000 1.00000 5.20861 + 6.47650 1.23011 0.00000 1.00000 -1.23011 + 6.49500 9.61241 0.00000 1.00000 -9.61241 + 6.51350 19.0142 0.00000 1.00000 -19.0142 + 6.53200 28.1967 0.00000 1.00000 -28.1967 + 6.55050 35.8243 0.00000 1.00000 -35.8243 + 6.56900 40.7166 0.00000 1.00000 -40.7166 + 6.58750 42.0833 0.00000 1.00000 -42.0833 + 6.60600 39.6873 0.00000 1.00000 -39.6873 + 6.62450 33.8989 0.00000 1.00000 -33.8989 + 6.64300 25.6256 0.00000 1.00000 -25.6256 + 6.66150 16.1324 0.00000 1.00000 -16.1324 + 6.68000 6.79125 0.00000 1.00000 -6.79125 + 6.69850 -1.18411 0.00000 1.00000 1.18411 + 6.71700 -6.95910 0.00000 1.00000 6.95910 + 6.73550 -10.2079 0.00000 1.00000 10.2079 + 6.75400 -11.1248 0.00000 1.00000 11.1248 + 6.77250 -10.3198 0.00000 1.00000 10.3198 + 6.79100 -8.62815 0.00000 1.00000 8.62815 + 6.80950 -6.88571 0.00000 1.00000 6.88571 + 6.82800 -5.72660 0.00000 1.00000 5.72660 + 6.84650 -5.45332 0.00000 1.00000 5.45332 + 6.86500 -6.00649 0.00000 1.00000 6.00649 + 6.88350 -7.03437 0.00000 1.00000 7.03437 + 6.90200 -8.03570 0.00000 1.00000 8.03570 + 6.92050 -8.53209 0.00000 1.00000 8.53209 + 6.93900 -8.22002 0.00000 1.00000 8.22002 + 6.95750 -7.06140 0.00000 1.00000 7.06140 + 6.97600 -5.29017 0.00000 1.00000 5.29017 + 6.99450 -3.33754 0.00000 1.00000 3.33754 + 7.01300 -1.70148 0.00000 1.00000 1.70148 + 7.03150 -0.800760 0.00000 1.00000 0.800760 + 7.05000 -0.856664 0.00000 1.00000 0.856664 + 7.06850 -1.83505 0.00000 1.00000 1.83505 + 7.08700 -3.46358 0.00000 1.00000 3.46358 + 7.10550 -5.31731 0.00000 1.00000 5.31731 + 7.12400 -6.94715 0.00000 1.00000 6.94715 + 7.14250 -8.01332 0.00000 1.00000 8.01332 + 7.16100 -8.38320 0.00000 1.00000 8.38320 + 7.17950 -8.16268 0.00000 1.00000 8.16268 + 7.19800 -7.64952 0.00000 1.00000 7.64952 + 7.21650 -7.22129 0.00000 1.00000 7.22129 + 7.23500 -7.19206 0.00000 1.00000 7.19206 + 7.25350 -7.68220 0.00000 1.00000 7.68220 + 7.27200 -8.54371 0.00000 1.00000 8.54371 + 7.29050 -9.36819 0.00000 1.00000 9.36819 + 7.30900 -9.58072 0.00000 1.00000 9.58072 + 7.32750 -8.59790 0.00000 1.00000 8.59790 + 7.34600 -6.00785 0.00000 1.00000 6.00785 + 7.36450 -1.72106 0.00000 1.00000 1.72106 + 7.38300 3.95269 0.00000 1.00000 -3.95269 + 7.40150 10.3276 0.00000 1.00000 -10.3276 + 7.42000 16.4640 0.00000 1.00000 -16.4640 + 7.43850 21.3618 0.00000 1.00000 -21.3618 + 7.45700 24.1782 0.00000 1.00000 -24.1782 + 7.47550 24.4162 0.00000 1.00000 -24.4162 + 7.49400 22.0356 0.00000 1.00000 -22.0356 + 7.51250 17.4573 0.00000 1.00000 -17.4573 + 7.53100 11.4623 0.00000 1.00000 -11.4623 + 7.54950 5.01118 0.00000 1.00000 -5.01118 + 7.56800 -0.965076 0.00000 1.00000 0.965076 + 7.58650 -5.75153 0.00000 1.00000 5.75153 + 7.60500 -8.96799 0.00000 1.00000 8.96799 + 7.62350 -10.5969 0.00000 1.00000 10.5969 + 7.64200 -10.9206 0.00000 1.00000 10.9206 + 7.66050 -10.3893 0.00000 1.00000 10.3893 + 7.67900 -9.46200 0.00000 1.00000 9.46200 + 7.69750 -8.46444 0.00000 1.00000 8.46444 + 7.71600 -7.50854 0.00000 1.00000 7.50854 + 7.73450 -6.49304 0.00000 1.00000 6.49304 + 7.75300 -5.18168 0.00000 1.00000 5.18168 + 7.77150 -3.32911 0.00000 1.00000 3.32911 + 7.79000 -0.811546 0.00000 1.00000 0.811546 + 7.80850 2.28073 0.00000 1.00000 -2.28073 + 7.82700 5.61902 0.00000 1.00000 -5.61902 + 7.84550 8.68909 0.00000 1.00000 -8.68909 + 7.86400 10.9073 0.00000 1.00000 -10.9073 + 7.88250 11.7676 0.00000 1.00000 -11.7676 + 7.90100 10.9777 0.00000 1.00000 -10.9777 + 7.91950 8.54633 0.00000 1.00000 -8.54633 + 7.93800 4.79627 0.00000 1.00000 -4.79627 + 7.95650 0.300695 0.00000 1.00000 -0.300695 + 7.97500 -4.24152 0.00000 1.00000 4.24152 + 7.99350 -8.15787 0.00000 1.00000 8.15787 + 8.01200 -10.9420 0.00000 1.00000 10.9420 + 8.03050 -12.3456 0.00000 1.00000 12.3456 + 8.04900 -12.4001 0.00000 1.00000 12.4001 + 8.06750 -11.3663 0.00000 1.00000 11.3663 + 8.08600 -9.63181 0.00000 1.00000 9.63181 + 8.10450 -7.58723 0.00000 1.00000 7.58723 + 8.12300 -5.52117 0.00000 1.00000 5.52117 + 8.14150 -3.56353 0.00000 1.00000 3.56353 + 8.16000 -1.69260 0.00000 1.00000 1.69260 + 8.17850 0.199827 0.00000 1.00000 -0.199827 + 8.19700 2.21044 0.00000 1.00000 -2.21044 + 8.21550 4.33057 0.00000 1.00000 -4.33057 + 8.23400 6.39218 0.00000 1.00000 -6.39218 + 8.25250 8.07555 0.00000 1.00000 -8.07555 + 8.27100 8.97896 0.00000 1.00000 -8.97896 + 8.28950 8.73073 0.00000 1.00000 -8.73073 + 8.30800 7.11016 0.00000 1.00000 -7.11016 + 8.32650 4.14151 0.00000 1.00000 -4.14151 + 8.34500 0.130936 0.00000 1.00000 -0.130936 + 8.36350 -4.36837 0.00000 1.00000 4.36837 + 8.38200 -8.65854 0.00000 1.00000 8.65854 + 8.40050 -12.0433 0.00000 1.00000 12.0433 + 8.41900 -13.9807 0.00000 1.00000 13.9807 + 8.43750 -14.2030 0.00000 1.00000 14.2030 + 8.45600 -12.7704 0.00000 1.00000 12.7704 + 8.47450 -10.0445 0.00000 1.00000 10.0445 + 8.49300 -6.58938 0.00000 1.00000 6.58938 + 8.51150 -3.02663 0.00000 1.00000 3.02663 + 8.53000 0.112114 0.00000 1.00000 -0.112114 + 8.54850 2.49566 0.00000 1.00000 -2.49566 + 8.56700 4.03580 0.00000 1.00000 -4.03580 + 8.58550 4.85377 0.00000 1.00000 -4.85377 + 8.60400 5.18537 0.00000 1.00000 -5.18537 + 8.62250 5.25808 0.00000 1.00000 -5.25808 + 8.64100 5.18193 0.00000 1.00000 -5.18193 + 8.65950 4.89182 0.00000 1.00000 -4.89182 + 8.67800 4.16349 0.00000 1.00000 -4.16349 + 8.69650 2.70252 0.00000 1.00000 -2.70252 + 8.71500 0.282220 0.00000 1.00000 -0.282220 + 8.73350 -3.11124 0.00000 1.00000 3.11124 + 8.75200 -7.17490 0.00000 1.00000 7.17490 + 8.77050 -11.2672 0.00000 1.00000 11.2672 + 8.78900 -14.4886 0.00000 1.00000 14.4886 + 8.80750 -15.8559 0.00000 1.00000 15.8559 + 8.82600 -14.5328 0.00000 1.00000 14.5328 + 8.84450 -10.0609 0.00000 1.00000 10.0609 + 8.86300 -2.52773 0.00000 1.00000 2.52773 + 8.88150 7.37428 0.00000 1.00000 -7.37428 + 8.90000 18.4240 0.00000 1.00000 -18.4240 + 8.91850 29.0726 0.00000 1.00000 -29.0726 + 8.93700 37.7295 0.00000 1.00000 -37.7295 + 8.95550 43.0717 0.00000 1.00000 -43.0717 + 8.97400 44.3044 0.00000 1.00000 -44.3044 + 8.99250 41.3154 0.00000 1.00000 -41.3154 + 9.01100 34.6857 0.00000 1.00000 -34.6857 + 9.02950 25.5570 0.00000 1.00000 -25.5570 + 9.04800 15.3859 0.00000 1.00000 -15.3859 + 9.06650 5.64529 0.00000 1.00000 -5.64529 + 9.08500 -2.45985 0.00000 1.00000 2.45985 + 9.10350 -8.19758 0.00000 1.00000 8.19758 + 9.12200 -11.3936 0.00000 1.00000 11.3936 + 9.14050 -12.3840 0.00000 1.00000 12.3840 + 9.15900 -11.8591 0.00000 1.00000 11.8591 + 9.17750 -10.6446 0.00000 1.00000 10.6446 + 9.19600 -9.48212 0.00000 1.00000 9.48212 + 9.21450 -8.86286 0.00000 1.00000 8.86286 + 9.23300 -8.95166 0.00000 1.00000 8.95166 + 9.25150 -9.60978 0.00000 1.00000 9.60978 + 9.27000 -10.4985 0.00000 1.00000 10.4985 + 9.28850 -11.2264 0.00000 1.00000 11.2264 + 9.30700 -11.4956 0.00000 1.00000 11.4956 + 9.32550 -11.2056 0.00000 1.00000 11.2056 + 9.34400 -10.4851 0.00000 1.00000 10.4851 + 9.36250 -9.64367 0.00000 1.00000 9.64367 + 9.38100 -9.05839 0.00000 1.00000 9.05839 + 9.39950 -9.03059 0.00000 1.00000 9.03059 + 9.41800 -9.65891 0.00000 1.00000 9.65891 + 9.43650 -10.7695 0.00000 1.00000 10.7695 + 9.45500 -11.9282 0.00000 1.00000 11.9282 + 9.47350 -12.5352 0.00000 1.00000 12.5352 + 9.49200 -11.9793 0.00000 1.00000 11.9793 + 9.51050 -9.80968 0.00000 1.00000 9.80968 + 9.52900 -5.88098 0.00000 1.00000 5.88098 + 9.54750 -0.429865 0.00000 1.00000 0.429865 + 9.56600 5.93738 0.00000 1.00000 -5.93738 + 9.58450 12.3467 0.00000 1.00000 -12.3467 + 9.60300 17.8253 0.00000 1.00000 -17.8253 + 9.62150 21.4983 0.00000 1.00000 -21.4983 + 9.64000 22.7684 0.00000 1.00000 -22.7684 + 9.65850 21.4353 0.00000 1.00000 -21.4353 + 9.67700 17.7297 0.00000 1.00000 -17.7297 + 9.69550 12.2556 0.00000 1.00000 -12.2556 + 9.71400 5.85940 0.00000 1.00000 -5.85940 + 9.73250 -0.539853 0.00000 1.00000 0.539853 + 9.75100 -6.11696 0.00000 1.00000 6.11696 + 9.76950 -10.2704 0.00000 1.00000 10.2704 + 9.78800 -12.6954 0.00000 1.00000 12.6954 + 9.80650 -13.3941 0.00000 1.00000 13.3941 + 9.82500 -12.6315 0.00000 1.00000 12.6315 + 9.84350 -10.8487 0.00000 1.00000 10.8487 + 9.86200 -8.55755 0.00000 1.00000 8.55755 + 9.88050 -6.24003 0.00000 1.00000 6.24003 + 9.89900 -4.27478 0.00000 1.00000 4.27478 + 9.91750 -2.90328 0.00000 1.00000 2.90328 + 9.93600 -2.23386 0.00000 1.00000 2.23386 + 9.95450 -2.27104 0.00000 1.00000 2.27104 + 9.97300 -2.95175 0.00000 1.00000 2.95175 + 9.99150 -4.17209 0.00000 1.00000 4.17209 + 10.0100 -5.79607 0.00000 1.00000 5.79607 + 10.0285 -7.64859 0.00000 1.00000 7.64859 + 10.0470 -9.50283 0.00000 1.00000 9.50283 + 10.0655 -11.0757 0.00000 1.00000 11.0757 + 10.0840 -12.0425 0.00000 1.00000 12.0425 + 10.1025 -12.0751 0.00000 1.00000 12.0751 + 10.1210 -10.9017 0.00000 1.00000 10.9017 + 10.1395 -8.37613 0.00000 1.00000 8.37613 + 10.1580 -4.54026 0.00000 1.00000 4.54026 + 10.1765 0.338357 0.00000 1.00000 -0.338357 + 10.1950 5.76996 0.00000 1.00000 -5.76996 + 10.2135 11.0939 0.00000 1.00000 -11.0939 + 10.2320 15.5741 0.00000 1.00000 -15.5741 + 10.2505 18.5225 0.00000 1.00000 -18.5225 + 10.2690 19.4270 0.00000 1.00000 -19.4270 + 10.2875 18.0567 0.00000 1.00000 -18.0567 + 10.3060 14.5227 0.00000 1.00000 -14.5227 + 10.3245 9.27796 0.00000 1.00000 -9.27796 + 10.3430 3.05599 0.00000 1.00000 -3.05599 + 10.3615 -3.24345 0.00000 1.00000 3.24345 + 10.3800 -8.70145 0.00000 1.00000 8.70145 + 10.3985 -12.5330 0.00000 1.00000 12.5330 + 10.4170 -14.2182 0.00000 1.00000 14.2182 + 10.4355 -13.5885 0.00000 1.00000 13.5885 + 10.4540 -10.8525 0.00000 1.00000 10.8525 + 10.4725 -6.55772 0.00000 1.00000 6.55772 + 10.4910 -1.49640 0.00000 1.00000 1.49640 + 10.5095 3.42852 0.00000 1.00000 -3.42852 + 10.5280 7.35363 0.00000 1.00000 -7.35363 + 10.5465 9.59717 0.00000 1.00000 -9.59717 + 10.5650 9.77054 0.00000 1.00000 -9.77054 + 10.5835 7.84234 0.00000 1.00000 -7.84234 + 10.6020 4.14584 0.00000 1.00000 -4.14584 + 10.6205 -0.671143 0.00000 1.00000 0.671143 + 10.6390 -5.74603 0.00000 1.00000 5.74603 + 10.6575 -10.1361 0.00000 1.00000 10.1361 + 10.6760 -12.9671 0.00000 1.00000 12.9671 + 10.6945 -13.5738 0.00000 1.00000 13.5738 + 10.7130 -11.6108 0.00000 1.00000 11.6108 + 10.7315 -7.11852 0.00000 1.00000 7.11852 + 10.7500 -0.532582 0.00000 1.00000 0.532582 + 10.7685 7.36496 0.00000 1.00000 -7.36496 + 10.7870 15.5502 0.00000 1.00000 -15.5502 + 10.8055 22.9046 0.00000 1.00000 -22.9046 + 10.8240 28.3836 0.00000 1.00000 -28.3836 + 10.8425 31.1819 0.00000 1.00000 -31.1819 + 10.8610 30.8667 0.00000 1.00000 -30.8667 + 10.8795 27.4544 0.00000 1.00000 -27.4544 + 10.8980 21.4174 0.00000 1.00000 -21.4174 + 10.9165 13.6149 0.00000 1.00000 -13.6149 + 10.9350 5.15717 0.00000 1.00000 -5.15717 + 10.9535 -2.77403 0.00000 1.00000 2.77403 + 10.9720 -9.11963 0.00000 1.00000 9.11963 + 10.9905 -13.1166 0.00000 1.00000 13.1166 + 11.0090 -14.4189 0.00000 1.00000 14.4189 + 11.0275 -13.1446 0.00000 1.00000 13.1446 + 11.0460 -9.84069 0.00000 1.00000 9.84069 + 11.0645 -5.37361 0.00000 1.00000 5.37361 + 11.0830 -0.766336 0.00000 1.00000 0.766336 + 11.1015 2.99059 0.00000 1.00000 -2.99059 + 11.1200 5.12102 0.00000 1.00000 -5.12102 + 11.1385 5.20555 0.00000 1.00000 -5.20555 + 11.1570 3.25580 0.00000 1.00000 -3.25580 + 11.1755 -0.295787 0.00000 1.00000 0.295787 + 11.1940 -4.68917 0.00000 1.00000 4.68917 + 11.2125 -8.99252 0.00000 1.00000 8.99252 + 11.2310 -12.2872 0.00000 1.00000 12.2872 + 11.2495 -13.8447 0.00000 1.00000 13.8447 + 11.2680 -13.2610 0.00000 1.00000 13.2610 + 11.2865 -10.5280 0.00000 1.00000 10.5280 + 11.3050 -6.02790 0.00000 1.00000 6.02790 + 11.3235 -0.457428 0.00000 1.00000 0.457428 + 11.3420 5.30272 0.00000 1.00000 -5.30272 + 11.3605 10.3468 0.00000 1.00000 -10.3468 + 11.3790 13.9003 0.00000 1.00000 -13.9003 + 11.3975 15.4459 0.00000 1.00000 -15.4459 + 11.4160 14.7993 0.00000 1.00000 -14.7993 + 11.4345 12.1251 0.00000 1.00000 -12.1251 + 11.4530 7.89515 0.00000 1.00000 -7.89515 + 11.4715 2.79743 0.00000 1.00000 -2.79743 + 11.4900 -2.38402 0.00000 1.00000 2.38402 + 11.5085 -6.89848 0.00000 1.00000 6.89848 + 11.5270 -10.1446 0.00000 1.00000 10.1446 + 11.5455 -11.7562 0.00000 1.00000 11.7562 + 11.5640 -11.6477 0.00000 1.00000 11.6477 + 11.5825 -10.0156 0.00000 1.00000 10.0156 + 11.6010 -7.29778 0.00000 1.00000 7.29778 + 11.6195 -4.09885 0.00000 1.00000 4.09885 + 11.6380 -1.08810 0.00000 1.00000 1.08810 + 11.6565 1.11439 0.00000 1.00000 -1.11439 + 11.6750 2.04788 0.00000 1.00000 -2.04788 + 11.6935 1.49867 0.00000 1.00000 -1.49867 + 11.7120 -0.451611 0.00000 1.00000 0.451611 + 11.7305 -3.42848 0.00000 1.00000 3.42848 + 11.7490 -6.82125 0.00000 1.00000 6.82125 + 11.7675 -9.88740 0.00000 1.00000 9.88740 + 11.7860 -11.8896 0.00000 1.00000 11.8896 + 11.8045 -12.2430 0.00000 1.00000 12.2430 + 11.8230 -10.6446 0.00000 1.00000 10.6446 + 11.8415 -7.15722 0.00000 1.00000 7.15722 + 11.8600 -2.22583 0.00000 1.00000 2.22583 + 11.8785 3.38458 0.00000 1.00000 -3.38458 + 11.8970 8.72108 0.00000 1.00000 -8.72108 + 11.9155 12.8213 0.00000 1.00000 -12.8213 + 11.9340 14.9032 0.00000 1.00000 -14.9032 + 11.9525 14.5281 0.00000 1.00000 -14.5281 + 11.9710 11.6999 0.00000 1.00000 -11.6999 + 11.9895 6.87776 0.00000 1.00000 -6.87776 + 12.0080 0.891504 0.00000 1.00000 -0.891504 + 12.0265 -5.22565 0.00000 1.00000 5.22565 + 12.0450 -10.4522 0.00000 1.00000 10.4522 + 12.0635 -13.9931 0.00000 1.00000 13.9931 + 12.0820 -15.4435 0.00000 1.00000 15.4435 + 12.1005 -14.8644 0.00000 1.00000 14.8644 + 12.1190 -12.7520 0.00000 1.00000 12.7520 + 12.1375 -9.90845 0.00000 1.00000 9.90845 + 12.1560 -7.24453 0.00000 1.00000 7.24453 + 12.1745 -5.56166 0.00000 1.00000 5.56166 + 12.1930 -5.36161 0.00000 1.00000 5.36161 + 12.2115 -6.72586 0.00000 1.00000 6.72586 + 12.2300 -9.28835 0.00000 1.00000 9.28835 + 12.2485 -12.3067 0.00000 1.00000 12.3067 + 12.2670 -14.8178 0.00000 1.00000 14.8178 + 12.2855 -15.8476 0.00000 1.00000 15.8476 + 12.3040 -14.6332 0.00000 1.00000 14.6332 + 12.3225 -10.8097 0.00000 1.00000 10.8097 + 12.3410 -4.52145 0.00000 1.00000 4.52145 + 12.3595 3.57058 0.00000 1.00000 -3.57058 + 12.3780 12.3893 0.00000 1.00000 -12.3893 + 12.3965 20.6314 0.00000 1.00000 -20.6314 + 12.4150 27.0092 0.00000 1.00000 -27.0092 + 12.4335 30.4959 0.00000 1.00000 -30.4959 + 12.4520 30.5247 0.00000 1.00000 -30.5247 + 12.4705 27.1034 0.00000 1.00000 -27.1034 + 12.4890 20.8197 0.00000 1.00000 -20.8197 + 12.5075 12.7348 0.00000 1.00000 -12.7348 + 12.5260 4.18409 0.00000 1.00000 -4.18409 + 12.5445 -3.47600 0.00000 1.00000 3.47600 + 12.5630 -9.12640 0.00000 1.00000 9.12640 + 12.5815 -12.0958 0.00000 1.00000 12.0958 + 12.6000 -12.2803 0.00000 1.00000 12.2803 + 12.6185 -10.1467 0.00000 1.00000 10.1467 + 12.6370 -6.61573 0.00000 1.00000 6.61573 + 12.6555 -2.84816 0.00000 1.00000 2.84816 + 12.6740 0.0234471 0.00000 1.00000 -0.0234471 + 12.6925 1.16051 0.00000 1.00000 -1.16051 + 12.7110 0.222329 0.00000 1.00000 -0.222329 + 12.7295 -2.53923 0.00000 1.00000 2.53923 + 12.7480 -6.31966 0.00000 1.00000 6.31966 + 12.7665 -9.93250 0.00000 1.00000 9.93250 + 12.7850 -12.0782 0.00000 1.00000 12.0782 + 12.8035 -11.6556 0.00000 1.00000 11.6556 + 12.8220 -8.04822 0.00000 1.00000 8.04822 + 12.8405 -1.31753 0.00000 1.00000 1.31753 + 12.8590 7.74657 0.00000 1.00000 -7.74657 + 12.8775 17.7420 0.00000 1.00000 -17.7420 + 12.8960 26.9214 0.00000 1.00000 -26.9214 + 12.9145 33.5578 0.00000 1.00000 -33.5578 + 12.9330 36.3277 0.00000 1.00000 -36.3277 + 12.9515 34.6234 0.00000 1.00000 -34.6234 + 12.9700 28.7156 0.00000 1.00000 -28.7156 + 12.9885 19.7233 0.00000 1.00000 -19.7233 + 13.0070 9.38804 0.00000 1.00000 -9.38804 + 13.0255 -0.297908 0.00000 1.00000 0.297908 + 13.0440 -7.52791 0.00000 1.00000 7.52791 + 13.0625 -11.0794 0.00000 1.00000 11.0794 + 13.0810 -10.5807 0.00000 1.00000 10.5807 + 13.0995 -6.58087 0.00000 1.00000 6.58087 + 13.1180 -0.404585 0.00000 1.00000 0.404585 + 13.1365 6.17556 0.00000 1.00000 -6.17556 + 13.1550 11.3708 0.00000 1.00000 -11.3708 + 13.1735 13.8053 0.00000 1.00000 -13.8053 + 13.1920 12.8357 0.00000 1.00000 -12.8357 + 13.2105 8.68336 0.00000 1.00000 -8.68336 + 13.2290 2.34908 0.00000 1.00000 -2.34908 + 13.2475 -4.66287 0.00000 1.00000 4.66287 + 13.2660 -10.7379 0.00000 1.00000 10.7379 + 13.2845 -14.5602 0.00000 1.00000 14.5602 + 13.3030 -15.4343 0.00000 1.00000 15.4343 + 13.3215 -13.4393 0.00000 1.00000 13.4393 + 13.3400 -9.37967 0.00000 1.00000 9.37967 + 13.3585 -4.55053 0.00000 1.00000 4.55053 + 13.3770 -0.382431 0.00000 1.00000 0.382431 + 13.3955 1.93839 0.00000 1.00000 -1.93839 + 13.4140 1.77366 0.00000 1.00000 -1.77366 + 13.4325 -0.818874 0.00000 1.00000 0.818874 + 13.4510 -5.13072 0.00000 1.00000 5.13072 + 13.4695 -10.0255 0.00000 1.00000 10.0255 + 13.4880 -14.2744 0.00000 1.00000 14.2744 + 13.5065 -16.9060 0.00000 1.00000 16.9060 + 13.5250 -17.4714 0.00000 1.00000 17.4714 + 13.5435 -16.1512 0.00000 1.00000 16.1512 + 13.5620 -13.6784 0.00000 1.00000 13.6784 + 13.5805 -11.1043 0.00000 1.00000 11.1043 + 13.5990 -9.47288 0.00000 1.00000 9.47288 + 13.6175 -9.49567 0.00000 1.00000 9.49567 + 13.6360 -11.3153 0.00000 1.00000 11.3153 + 13.6545 -14.4268 0.00000 1.00000 14.4268 + 13.6730 -17.7824 0.00000 1.00000 17.7824 + 13.6915 -20.0552 0.00000 1.00000 20.0552 + 13.7100 -19.9965 0.00000 1.00000 19.9965 + 13.7285 -16.7898 0.00000 1.00000 16.7898 + 13.7470 -10.3089 0.00000 1.00000 10.3089 + 13.7655 -1.20781 0.00000 1.00000 1.20781 + 13.7840 9.18567 0.00000 1.00000 -9.18567 + 13.8025 19.1488 0.00000 1.00000 -19.1488 + 13.8210 26.9489 0.00000 1.00000 -26.9489 + 13.8395 31.2366 0.00000 1.00000 -31.2366 + 13.8580 31.3496 0.00000 1.00000 -31.3496 + 13.8765 27.4511 0.00000 1.00000 -27.4511 + 13.8950 20.4697 0.00000 1.00000 -20.4697 + 13.9135 11.8582 0.00000 1.00000 -11.8582 + 13.9320 3.23523 0.00000 1.00000 -3.23523 + 13.9505 -3.99882 0.00000 1.00000 3.99882 + 13.9690 -8.96984 0.00000 1.00000 8.96984 + 13.9875 -11.4848 0.00000 1.00000 11.4848 + 14.0060 -11.9967 0.00000 1.00000 11.9967 + 14.0245 -11.3970 0.00000 1.00000 11.3970 + 14.0430 -10.7008 0.00000 1.00000 10.7008 + 14.0615 -10.7168 0.00000 1.00000 10.7168 + 14.0800 -11.7936 0.00000 1.00000 11.7936 + 14.0985 -13.7115 0.00000 1.00000 13.7115 + 14.1170 -15.7457 0.00000 1.00000 15.7457 + 14.1355 -16.8835 0.00000 1.00000 16.8835 + 14.1540 -16.1342 0.00000 1.00000 16.1342 + 14.1725 -12.8466 0.00000 1.00000 12.8466 + 14.1910 -6.94542 0.00000 1.00000 6.94542 + 14.2095 0.982134 0.00000 1.00000 -0.982134 + 14.2280 9.77953 0.00000 1.00000 -9.77953 + 14.2465 17.9729 0.00000 1.00000 -17.9729 + 14.2650 24.1178 0.00000 1.00000 -24.1178 + 14.2835 27.1485 0.00000 1.00000 -27.1485 + 14.3020 26.6355 0.00000 1.00000 -26.6355 + 14.3205 22.8839 0.00000 1.00000 -22.8839 + 14.3390 16.8479 0.00000 1.00000 -16.8479 + 14.3575 9.88786 0.00000 1.00000 -9.88786 + 14.3760 3.43554 0.00000 1.00000 -3.43554 + 14.3945 -1.34253 0.00000 1.00000 1.34253 + 14.4130 -3.79922 0.00000 1.00000 3.79922 + 14.4315 -3.91650 0.00000 1.00000 3.91650 + 14.4500 -2.25034 0.00000 1.00000 2.25034 + 14.4685 0.265934 0.00000 1.00000 -0.265934 + 14.4870 2.60091 0.00000 1.00000 -2.60091 + 14.5055 3.90902 0.00000 1.00000 -3.90902 + 14.5240 3.74411 0.00000 1.00000 -3.74411 + 14.5425 2.15013 0.00000 1.00000 -2.15013 + 14.5610 -0.388481 0.00000 1.00000 0.388481 + 14.5795 -3.11515 0.00000 1.00000 3.11515 + 14.5980 -5.23631 0.00000 1.00000 5.23631 + 14.6165 -6.15513 0.00000 1.00000 6.15513 + 14.6350 -5.63898 0.00000 1.00000 5.63898 + 14.6535 -3.87566 0.00000 1.00000 3.87566 + 14.6720 -1.40645 0.00000 1.00000 1.40645 + 14.6905 1.04029 0.00000 1.00000 -1.04029 + 14.7090 2.76304 0.00000 1.00000 -2.76304 + 14.7275 3.28473 0.00000 1.00000 -3.28473 + 14.7460 2.47788 0.00000 1.00000 -2.47788 + 14.7645 0.584519 0.00000 1.00000 -0.584519 + 14.7830 -1.87052 0.00000 1.00000 1.87052 + 14.8015 -4.24417 0.00000 1.00000 4.24417 + 14.8200 -5.96765 0.00000 1.00000 5.96765 + 14.8385 -6.70965 0.00000 1.00000 6.70965 + 14.8570 -6.46211 0.00000 1.00000 6.46211 + 14.8755 -5.52356 0.00000 1.00000 5.52356 + 14.8940 -4.38544 0.00000 1.00000 4.38544 + 14.9125 -3.55512 0.00000 1.00000 3.55512 + 14.9310 -3.36898 0.00000 1.00000 3.36898 + 14.9495 -3.85281 0.00000 1.00000 3.85281 + 14.9680 -4.67590 0.00000 1.00000 4.67590 + 14.9865 -5.21922 0.00000 1.00000 5.21922 + 15.0050 -4.74479 0.00000 1.00000 4.74479 + 15.0235 -2.62144 0.00000 1.00000 2.62144 + 15.0420 1.45687 0.00000 1.00000 -1.45687 + 15.0605 7.32500 0.00000 1.00000 -7.32500 + 15.0790 14.3193 0.00000 1.00000 -14.3193 + 15.0975 21.3835 0.00000 1.00000 -21.3835 + 15.1160 27.2852 0.00000 1.00000 -27.2852 + 15.1345 30.8902 0.00000 1.00000 -30.8902 + 15.1530 31.4245 0.00000 1.00000 -31.4245 + 15.1715 28.6588 0.00000 1.00000 -28.6588 + 15.1900 22.9682 0.00000 1.00000 -22.9682 + 15.2085 15.2541 0.00000 1.00000 -15.2541 + 15.2270 6.74712 0.00000 1.00000 -6.74712 + 15.2455 -1.25964 0.00000 1.00000 1.25964 + 15.2640 -7.68049 0.00000 1.00000 7.68049 + 15.2825 -11.8442 0.00000 1.00000 11.8442 + 15.3010 -13.5919 0.00000 1.00000 13.5919 + 15.3195 -13.2493 0.00000 1.00000 13.2493 + 15.3380 -11.4916 0.00000 1.00000 11.4916 + 15.3565 -9.14144 0.00000 1.00000 9.14144 + 15.3750 -6.95504 0.00000 1.00000 6.95504 + 15.3935 -5.44896 0.00000 1.00000 5.44896 + 15.4120 -4.80772 0.00000 1.00000 4.80772 + 15.4305 -4.88897 0.00000 1.00000 4.88897 + 15.4490 -5.31706 0.00000 1.00000 5.31706 + 15.4675 -5.63285 0.00000 1.00000 5.63285 + 15.4860 -5.45462 0.00000 1.00000 5.45462 + 15.5045 -4.60459 0.00000 1.00000 4.60459 + 15.5230 -3.16776 0.00000 1.00000 3.16776 + 15.5415 -1.46992 0.00000 1.00000 1.46992 + 15.5600 0.0157586 0.00000 1.00000 -0.0157586 + 15.5785 0.806047 0.00000 1.00000 -0.806047 + 15.5970 0.550242 0.00000 1.00000 -0.550242 + 15.6155 -0.861348 0.00000 1.00000 0.861348 + 15.6340 -3.25430 0.00000 1.00000 3.25430 + 15.6525 -6.20584 0.00000 1.00000 6.20584 + 15.6710 -9.14992 0.00000 1.00000 9.14992 + 15.6895 -11.5204 0.00000 1.00000 11.5204 + 15.7080 -12.8909 0.00000 1.00000 12.8909 + 15.7265 -13.0717 0.00000 1.00000 13.0717 + 15.7450 -12.1417 0.00000 1.00000 12.1417 + 15.7635 -10.4097 0.00000 1.00000 10.4097 + 15.7820 -8.32011 0.00000 1.00000 8.32011 + 15.8005 -6.33136 0.00000 1.00000 6.33136 + 15.8190 -4.80087 0.00000 1.00000 4.80087 + 15.8375 -3.90675 0.00000 1.00000 3.90675 + 15.8560 -3.62474 0.00000 1.00000 3.62474 + 15.8745 -3.76225 0.00000 1.00000 3.76225 + 15.8930 -4.03596 0.00000 1.00000 4.03596 + 15.9115 -4.16761 0.00000 1.00000 4.16761 + 15.9300 -3.96959 0.00000 1.00000 3.96959 + 15.9485 -3.39629 0.00000 1.00000 3.39629 + 15.9670 -2.54969 0.00000 1.00000 2.54969 + 15.9855 -1.64188 0.00000 1.00000 1.64188 + 16.0040 -0.928772 0.00000 1.00000 0.928772 + 16.0225 -0.634845 0.00000 1.00000 0.634845 + 16.0410 -0.888145 0.00000 1.00000 0.888145 + 16.0595 -1.67980 0.00000 1.00000 1.67980 + 16.0780 -2.85514 0.00000 1.00000 2.85514 + 16.0965 -4.13661 0.00000 1.00000 4.13661 + 16.1150 -5.17310 0.00000 1.00000 5.17310 + 16.1335 -5.60636 0.00000 1.00000 5.60636 + 16.1520 -5.14159 0.00000 1.00000 5.14159 + 16.1705 -3.60734 0.00000 1.00000 3.60734 + 16.1890 -0.992023 0.00000 1.00000 0.992023 + 16.2075 2.54958 0.00000 1.00000 -2.54958 + 16.2260 6.71807 0.00000 1.00000 -6.71807 + 16.2445 11.1120 0.00000 1.00000 -11.1120 + 16.2630 15.2812 0.00000 1.00000 -15.2812 + 16.2815 18.7822 0.00000 1.00000 -18.7822 + 16.3000 21.2269 0.00000 1.00000 -21.2269 + 16.3185 22.3212 0.00000 1.00000 -22.3212 + 16.3370 21.8912 0.00000 1.00000 -21.8912 + 16.3555 19.8991 0.00000 1.00000 -19.8991 + 16.3740 16.4493 0.00000 1.00000 -16.4493 + 16.3925 11.7863 0.00000 1.00000 -11.7863 + 16.4110 6.28331 0.00000 1.00000 -6.28331 + 16.4295 0.418687 0.00000 1.00000 -0.418687 + 16.4480 -5.25963 0.00000 1.00000 5.25963 + 16.4665 -10.1842 0.00000 1.00000 10.1842 + 16.4850 -13.8295 0.00000 1.00000 13.8295 + 16.5035 -15.7785 0.00000 1.00000 15.7785 + 16.5220 -15.7830 0.00000 1.00000 15.7830 + 16.5405 -13.8070 0.00000 1.00000 13.8070 + 16.5590 -10.0391 0.00000 1.00000 10.0391 + 16.5775 -4.87264 0.00000 1.00000 4.87264 + 16.5960 1.14589 0.00000 1.00000 -1.14589 + 16.6145 7.38649 0.00000 1.00000 -7.38649 + 16.6330 13.2091 0.00000 1.00000 -13.2091 + 16.6515 18.0296 0.00000 1.00000 -18.0296 + 16.6700 21.3708 0.00000 1.00000 -21.3708 + 16.6885 22.8991 0.00000 1.00000 -22.8991 + 16.7070 22.4456 0.00000 1.00000 -22.4456 + 16.7255 20.0158 0.00000 1.00000 -20.0158 + 16.7440 15.7881 0.00000 1.00000 -15.7881 + 16.7625 10.1035 0.00000 1.00000 -10.1035 + 16.7810 3.44424 0.00000 1.00000 -3.44424 + 16.7995 -3.59847 0.00000 1.00000 3.59847 + 16.8180 -10.3717 0.00000 1.00000 10.3717 + 16.8365 -16.2205 0.00000 1.00000 16.2205 + 16.8550 -20.5580 0.00000 1.00000 20.5580 + 16.8735 -22.9372 0.00000 1.00000 22.9372 + 16.8920 -23.1129 0.00000 1.00000 23.1129 + 16.9105 -21.0837 0.00000 1.00000 21.0837 + 16.9290 -17.1032 0.00000 1.00000 17.1032 + 16.9475 -11.6563 0.00000 1.00000 11.6563 + 16.9660 -5.39998 0.00000 1.00000 5.39998 + 16.9845 0.923758 0.00000 1.00000 -0.923758 + 17.0030 6.59122 0.00000 1.00000 -6.59122 + 17.0215 10.9979 0.00000 1.00000 -10.9979 + 17.0400 13.7383 0.00000 1.00000 -13.7383 + 17.0585 14.6477 0.00000 1.00000 -14.6477 + 17.0770 13.7998 0.00000 1.00000 -13.7998 + 17.0955 11.4638 0.00000 1.00000 -11.4638 + 17.1140 8.03578 0.00000 1.00000 -8.03578 + 17.1325 3.96378 0.00000 1.00000 -3.96378 + 17.1510 -0.316698 0.00000 1.00000 0.316698 + 17.1695 -4.42438 0.00000 1.00000 4.42438 + 17.1880 -8.04681 0.00000 1.00000 8.04681 + 17.2065 -10.9324 0.00000 1.00000 10.9324 + 17.2250 -12.8725 0.00000 1.00000 12.8725 + 17.2435 -13.6898 0.00000 1.00000 13.6898 + 17.2620 -13.2456 0.00000 1.00000 13.2456 + 17.2805 -11.4675 0.00000 1.00000 11.4675 + 17.2990 -8.39144 0.00000 1.00000 8.39144 + 17.3175 -4.20001 0.00000 1.00000 4.20001 + 17.3360 0.758004 0.00000 1.00000 -0.758004 + 17.3545 5.98116 0.00000 1.00000 -5.98116 + 17.3730 10.8661 0.00000 1.00000 -10.8661 + 17.3915 14.7906 0.00000 1.00000 -14.7906 + 17.4100 17.2137 0.00000 1.00000 -17.2137 + 17.4285 17.7745 0.00000 1.00000 -17.7745 + 17.4470 16.3661 0.00000 1.00000 -16.3661 + 17.4655 13.1690 0.00000 1.00000 -13.1690 + 17.4840 8.63053 0.00000 1.00000 -8.63053 + 17.5025 3.39246 0.00000 1.00000 -3.39246 + 17.5210 -1.82203 0.00000 1.00000 1.82203 + 17.5395 -6.33848 0.00000 1.00000 6.33848 + 17.5580 -9.64981 0.00000 1.00000 9.64981 + 17.5765 -11.4978 0.00000 1.00000 11.4978 + 17.5950 -11.9009 0.00000 1.00000 11.9009 + 17.6135 -11.1239 0.00000 1.00000 11.1239 + 17.6320 -9.59944 0.00000 1.00000 9.59944 + 17.6505 -7.81972 0.00000 1.00000 7.81972 + 17.6690 -6.22442 0.00000 1.00000 6.22442 + 17.6875 -5.11122 0.00000 1.00000 5.11122 + 17.7060 -4.58875 0.00000 1.00000 4.58875 + 17.7245 -4.58029 0.00000 1.00000 4.58029 + 17.7430 -4.87225 0.00000 1.00000 4.87225 + 17.7615 -5.18968 0.00000 1.00000 5.18968 + 17.7800 -5.27616 0.00000 1.00000 5.27616 + 17.7985 -4.95771 0.00000 1.00000 4.95771 + 17.8170 -4.17763 0.00000 1.00000 4.17763 + 17.8355 -2.99861 0.00000 1.00000 2.99861 + 17.8540 -1.57655 0.00000 1.00000 1.57655 + 17.8725 -0.115674 0.00000 1.00000 0.115674 + 17.8910 1.18232 0.00000 1.00000 -1.18232 + 17.9095 2.16253 0.00000 1.00000 -2.16253 + 17.9280 2.74507 0.00000 1.00000 -2.74507 + 17.9465 2.93310 0.00000 1.00000 -2.93310 + 17.9650 2.80225 0.00000 1.00000 -2.80225 + 17.9835 2.47685 0.00000 1.00000 -2.47685 + 18.0020 2.09940 0.00000 1.00000 -2.09940 + 18.0205 1.79907 0.00000 1.00000 -1.79907 + 18.0390 1.66403 0.00000 1.00000 -1.66403 + 18.0575 1.72260 0.00000 1.00000 -1.72260 + 18.0760 1.93703 0.00000 1.00000 -1.93703 + 18.0945 2.21113 0.00000 1.00000 -2.21113 + 18.1130 2.40837 0.00000 1.00000 -2.40837 + 18.1315 2.37442 0.00000 1.00000 -2.37442 + 18.1500 1.95988 0.00000 1.00000 -1.95988 + 18.1685 1.04724 0.00000 1.00000 -1.04724 + 18.1870 -0.426523 0.00000 1.00000 0.426523 + 18.2055 -2.45315 0.00000 1.00000 2.45315 + 18.2240 -4.90773 0.00000 1.00000 4.90773 + 18.2425 -7.52944 0.00000 1.00000 7.52944 + 18.2610 -9.92715 0.00000 1.00000 9.92715 + 18.2795 -11.6174 0.00000 1.00000 11.6174 + 18.2980 -12.0956 0.00000 1.00000 12.0956 + 18.3165 -10.9327 0.00000 1.00000 10.9327 + 18.3350 -7.88331 0.00000 1.00000 7.88331 + 18.3535 -2.98071 0.00000 1.00000 2.98071 + 18.3720 3.40650 0.00000 1.00000 -3.40650 + 18.3905 10.5811 0.00000 1.00000 -10.5811 + 18.4090 17.5968 0.00000 1.00000 -17.5968 + 18.4275 23.4036 0.00000 1.00000 -23.4036 + 18.4460 27.0310 0.00000 1.00000 -27.0310 + 18.4645 27.7731 0.00000 1.00000 -27.7731 + 18.4830 25.3345 0.00000 1.00000 -25.3345 + 18.5015 19.9052 0.00000 1.00000 -19.9052 + 18.5200 12.1472 0.00000 1.00000 -12.1472 + 18.5385 3.09099 0.00000 1.00000 -3.09099 + 18.5570 -6.03798 0.00000 1.00000 6.03798 + 18.5755 -14.0281 0.00000 1.00000 14.0281 + 18.5940 -19.8843 0.00000 1.00000 19.8843 + 18.6125 -22.9844 0.00000 1.00000 22.9844 + 18.6310 -23.1597 0.00000 1.00000 23.1597 + 18.6495 -20.6881 0.00000 1.00000 20.6881 + 18.6680 -16.2075 0.00000 1.00000 16.2075 + 18.6865 -10.5714 0.00000 1.00000 10.5714 + 18.7050 -4.68098 0.00000 1.00000 4.68098 + 18.7235 0.671251 0.00000 1.00000 -0.671251 + 18.7420 4.91529 0.00000 1.00000 -4.91529 + 18.7605 7.75797 0.00000 1.00000 -7.75797 + 18.7790 9.17588 0.00000 1.00000 -9.17588 + 18.7975 9.35965 0.00000 1.00000 -9.35965 + 18.8160 8.63035 0.00000 1.00000 -8.63035 + 18.8345 7.35145 0.00000 1.00000 -7.35145 + 18.8530 5.85510 0.00000 1.00000 -5.85510 + 18.8715 4.39513 0.00000 1.00000 -4.39513 + 18.8900 3.13002 0.00000 1.00000 -3.13002 + 18.9085 2.13168 0.00000 1.00000 -2.13168 + 18.9270 1.40976 0.00000 1.00000 -1.40976 + 18.9455 0.939913 0.00000 1.00000 -0.939913 + 18.9640 0.686429 0.00000 1.00000 -0.686429 + 18.9825 0.614229 0.00000 1.00000 -0.614229 + 19.0010 0.690570 0.00000 1.00000 -0.690570 + 19.0195 0.880032 0.00000 1.00000 -0.880032 + 19.0380 1.13788 0.00000 1.00000 -1.13788 + 19.0565 1.40627 0.00000 1.00000 -1.40627 + 19.0750 1.61604 0.00000 1.00000 -1.61604 + 19.0935 1.69418 0.00000 1.00000 -1.69418 + 19.1120 1.57467 0.00000 1.00000 -1.57467 + 19.1305 1.20912 0.00000 1.00000 -1.20912 + 19.1490 0.574418 0.00000 1.00000 -0.574418 + 19.1675 -0.322868 0.00000 1.00000 0.322868 + 19.1860 -1.44364 0.00000 1.00000 1.44364 + 19.2045 -2.71278 0.00000 1.00000 2.71278 + 19.2230 -4.01492 0.00000 1.00000 4.01492 + 19.2415 -5.19189 0.00000 1.00000 5.19189 + 19.2600 -6.04623 0.00000 1.00000 6.04623 + 19.2785 -6.35560 0.00000 1.00000 6.35560 + 19.2970 -5.90135 0.00000 1.00000 5.90135 + 19.3155 -4.51168 0.00000 1.00000 4.51168 + 19.3340 -2.11474 0.00000 1.00000 2.11474 + 19.3525 1.20914 0.00000 1.00000 -1.20914 + 19.3710 5.19105 0.00000 1.00000 -5.19105 + 19.3895 9.36912 0.00000 1.00000 -9.36912 + 19.4080 13.1271 0.00000 1.00000 -13.1271 + 19.4265 15.7779 0.00000 1.00000 -15.7779 + 19.4450 16.6827 0.00000 1.00000 -16.6827 + 19.4635 15.3867 0.00000 1.00000 -15.3867 + 19.4820 11.7418 0.00000 1.00000 -11.7418 + 19.5005 5.98757 0.00000 1.00000 -5.98757 + 19.5190 -1.23710 0.00000 1.00000 1.23710 + 19.5375 -8.96359 0.00000 1.00000 8.96359 + 19.5560 -16.0382 0.00000 1.00000 16.0382 + 19.5745 -21.3164 0.00000 1.00000 21.3164 + 19.5930 -23.8699 0.00000 1.00000 23.8699 + 19.6115 -23.1644 0.00000 1.00000 23.1644 + 19.6300 -19.1740 0.00000 1.00000 19.1740 + 19.6485 -12.4057 0.00000 1.00000 12.4057 + 19.6670 -3.82669 0.00000 1.00000 3.82669 + 19.6855 5.29471 0.00000 1.00000 -5.29471 + 19.7040 13.6058 0.00000 1.00000 -13.6058 + 19.7225 19.9014 0.00000 1.00000 -19.9014 + 19.7410 23.3260 0.00000 1.00000 -23.3260 + 19.7595 23.5068 0.00000 1.00000 -23.5068 + 19.7780 20.5929 0.00000 1.00000 -20.5929 + 19.7965 15.1973 0.00000 1.00000 -15.1973 + 19.8150 8.25741 0.00000 1.00000 -8.25741 + 19.8335 0.846490 0.00000 1.00000 -0.846490 + 19.8520 -6.02165 0.00000 1.00000 6.02165 + 19.8705 -11.5565 0.00000 1.00000 11.5565 + 19.8890 -15.2939 0.00000 1.00000 15.2939 + 19.9075 -17.1257 0.00000 1.00000 17.1257 + 19.9260 -17.2573 0.00000 1.00000 17.2573 + 19.9445 -16.1119 0.00000 1.00000 16.1119 + 19.9630 -14.2055 0.00000 1.00000 14.2055 + 19.9815 -12.0275 0.00000 1.00000 12.0275 + 20.0000 -9.95383 0.00000 1.00000 9.95383 diff --git a/src/diffpy/pdffit2/tests/testdata/badNi.stru b/src/diffpy/pdffit2/tests/testdata/badNi.stru new file mode 100644 index 00000000..d0b980cb --- /dev/null +++ b/src/diffpy/pdffit2/tests/testdata/badNi.stru @@ -0,0 +1,32 @@ +title structure Ni FCC +format pdffit +scale 1.000000 +sharp 0.000000, 1.000000, 0.000000 +spcgr Fm-3m +cell 3.520000, 3.520000, 3.520000, 90.000000, 90.000000, 90.000000 +dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 +ncell 1, 1, 1, 4 +atoms +NI 0.00000000 0.00000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.00000000 0.50000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.50000000 0.00000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.50000000 0.50000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 diff --git a/src/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru b/src/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru new file mode 100644 index 00000000..089db0da --- /dev/null +++ b/src/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru @@ -0,0 +1,33 @@ +title structure Ni FCC +format pdffit +scale 1.000000 +sharp 0.000000, 1.000000, 0.000000 +spcgr Fm-3m +cell 3.520000, 3.520000, 3.520000, 90.000000, 90.000000, 0.000000 +dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 +ncell 1, 1, 1, 4 +atoms +NI 0.00000000 0.00000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.00000000 0.50000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.50000000 0.00000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.50000000 0.50000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 diff --git a/src/diffpy/pdffit2/tests/testdata/noLattice.stru b/src/diffpy/pdffit2/tests/testdata/noLattice.stru new file mode 100644 index 00000000..4f8e7212 --- /dev/null +++ b/src/diffpy/pdffit2/tests/testdata/noLattice.stru @@ -0,0 +1,32 @@ +title structure Ni FCC +format pdffit +scale 1.000000 +sharp 0.000000, 1.000000, 0.000000 +spcgr Fm-3m +cell 3.520000, 3.520000, -3.520000, 90.000000, 90.000000, 90.000000 +dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 +ncell 1, 1, 1, 4 +atoms +NI 0.00000000 0.00000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.50000000 0.50000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.50000000 0.00000000 0.50000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 +NI 0.50000000 0.50000000 0.00000000 1.0000 + 0.00000000 0.00000000 0.00000000 0.0000 + 0.00126651 0.00126651 0.00126651 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 + 0.00000000 0.00000000 0.00000000 diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py new file mode 100644 index 00000000..69e4d1b2 --- /dev/null +++ b/src/diffpy/pdffit2/version.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +############################################################################## +# +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. +# +# File coded by: Billinge Group members and community contributors. +# +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors +# +# See LICENSE.rst for license information. +# +############################################################################## + +"""Definition of __version__.""" + +# We do not use the other three variables, but can be added back if needed. +# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] + +# obtain version information +from importlib.metadata import version + +__version__ = version("diffpy.pdffit2") + +# End of file From af811e88935b07aa6574624e429e104cc14c8d4d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:52:36 +0000 Subject: [PATCH 022/294] [pre-commit.ci] auto fixes from pre-commit hooks --- src/diffpy/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 71428827..5b3af482 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -21,4 +21,3 @@ __path__ = extend_path(__path__, __name__) # End of file - From 1181ff6d6dd925bb3459bc2c25aa30a3b36488e0 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Mon, 22 Jul 2024 12:03:56 -0400 Subject: [PATCH 023/294] Added C++ extensions libpdffit2 and pdffit2module --- src/extensions/libpdffit2/Atom.cc | 104 + src/extensions/libpdffit2/Atom.h | 70 + src/extensions/libpdffit2/AtomType.h | 76 + .../libpdffit2/LocalPeriodicTable.cc | 147 + .../libpdffit2/LocalPeriodicTable.h | 63 + src/extensions/libpdffit2/MathUtils.h | 94 + src/extensions/libpdffit2/OutputStreams.cc | 24 + src/extensions/libpdffit2/OutputStreams.h | 31 + src/extensions/libpdffit2/PairDistance.h | 42 + src/extensions/libpdffit2/PeriodicTable.cc | 3459 +++++++++++++++++ src/extensions/libpdffit2/PeriodicTable.h | 75 + src/extensions/libpdffit2/PointsInSphere.cc | 243 ++ src/extensions/libpdffit2/PointsInSphere.h | 182 + src/extensions/libpdffit2/ShapeFactors.h | 43 + src/extensions/libpdffit2/StringUtils.cc | 58 + src/extensions/libpdffit2/StringUtils.h | 71 + src/extensions/libpdffit2/exceptions.h | 95 + src/extensions/libpdffit2/fit.cc | 836 ++++ src/extensions/libpdffit2/gaussj.cc | 114 + src/extensions/libpdffit2/matrix.h | 239 ++ src/extensions/libpdffit2/metric.cc | 341 ++ src/extensions/libpdffit2/nrutil.cc | 122 + src/extensions/libpdffit2/nrutil.h | 34 + src/extensions/libpdffit2/output.cc | 350 ++ src/extensions/libpdffit2/parser.cc | 402 ++ src/extensions/libpdffit2/pdf.cc | 1776 +++++++++ src/extensions/libpdffit2/pdffit.cc | 372 ++ src/extensions/libpdffit2/pdffit.h | 611 +++ src/extensions/libpdffit2/pdflsmin.cc | 326 ++ src/extensions/libpdffit2/scatlen.cc | 114 + src/extensions/libpdffit2/stru.cc | 837 ++++ src/extensions/libpdffit2/support_msvc9.h | 13 + src/extensions/libpdffit2/tests/Makefile | 32 + .../libpdffit2/tests/TestPointsInSphere.cc | 228 ++ src/extensions/libpdffit2/tests/alltests.cc | 46 + .../pdffit2module/PyFileStreambuf.h | 97 + src/extensions/pdffit2module/bindings.cc | 341 ++ src/extensions/pdffit2module/bindings.h | 27 + src/extensions/pdffit2module/misc.cc | 2219 +++++++++++ src/extensions/pdffit2module/misc.h | 486 +++ src/extensions/pdffit2module/pdffit2module.cc | 150 + src/extensions/pdffit2module/pyexceptions.cc | 30 + src/extensions/pdffit2module/pyexceptions.h | 33 + 43 files changed, 15053 insertions(+) create mode 100644 src/extensions/libpdffit2/Atom.cc create mode 100644 src/extensions/libpdffit2/Atom.h create mode 100644 src/extensions/libpdffit2/AtomType.h create mode 100644 src/extensions/libpdffit2/LocalPeriodicTable.cc create mode 100644 src/extensions/libpdffit2/LocalPeriodicTable.h create mode 100644 src/extensions/libpdffit2/MathUtils.h create mode 100644 src/extensions/libpdffit2/OutputStreams.cc create mode 100644 src/extensions/libpdffit2/OutputStreams.h create mode 100644 src/extensions/libpdffit2/PairDistance.h create mode 100644 src/extensions/libpdffit2/PeriodicTable.cc create mode 100644 src/extensions/libpdffit2/PeriodicTable.h create mode 100644 src/extensions/libpdffit2/PointsInSphere.cc create mode 100644 src/extensions/libpdffit2/PointsInSphere.h create mode 100644 src/extensions/libpdffit2/ShapeFactors.h create mode 100644 src/extensions/libpdffit2/StringUtils.cc create mode 100644 src/extensions/libpdffit2/StringUtils.h create mode 100644 src/extensions/libpdffit2/exceptions.h create mode 100644 src/extensions/libpdffit2/fit.cc create mode 100644 src/extensions/libpdffit2/gaussj.cc create mode 100644 src/extensions/libpdffit2/matrix.h create mode 100644 src/extensions/libpdffit2/metric.cc create mode 100644 src/extensions/libpdffit2/nrutil.cc create mode 100644 src/extensions/libpdffit2/nrutil.h create mode 100644 src/extensions/libpdffit2/output.cc create mode 100644 src/extensions/libpdffit2/parser.cc create mode 100644 src/extensions/libpdffit2/pdf.cc create mode 100644 src/extensions/libpdffit2/pdffit.cc create mode 100644 src/extensions/libpdffit2/pdffit.h create mode 100644 src/extensions/libpdffit2/pdflsmin.cc create mode 100644 src/extensions/libpdffit2/scatlen.cc create mode 100644 src/extensions/libpdffit2/stru.cc create mode 100644 src/extensions/libpdffit2/support_msvc9.h create mode 100644 src/extensions/libpdffit2/tests/Makefile create mode 100644 src/extensions/libpdffit2/tests/TestPointsInSphere.cc create mode 100644 src/extensions/libpdffit2/tests/alltests.cc create mode 100644 src/extensions/pdffit2module/PyFileStreambuf.h create mode 100644 src/extensions/pdffit2module/bindings.cc create mode 100644 src/extensions/pdffit2module/bindings.h create mode 100644 src/extensions/pdffit2module/misc.cc create mode 100644 src/extensions/pdffit2module/misc.h create mode 100644 src/extensions/pdffit2module/pdffit2module.cc create mode 100644 src/extensions/pdffit2module/pyexceptions.cc create mode 100644 src/extensions/pdffit2module/pyexceptions.h diff --git a/src/extensions/libpdffit2/Atom.cc b/src/extensions/libpdffit2/Atom.cc new file mode 100644 index 00000000..aa2e66f2 --- /dev/null +++ b/src/extensions/libpdffit2/Atom.cc @@ -0,0 +1,104 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* class Atom +* +* Comments: +* +***********************************************************************/ + +#include + +#include "Atom.h" +#include "MathUtils.h" +#include "LocalPeriodicTable.h" + +using namespace std; + +// class data - private + + +Atom::AtomFormat Atom::streamformat = Atom::DISCUS; + + +// public class methods + + +void Atom::setDiscusFormat() +{ + Atom::streamformat = DISCUS; +} + + +void Atom::setPdffitFormat() +{ + Atom::streamformat = PDFFIT; +} + + +// private methods + + +istream& Atom::read_discus_atom(istream& in) +{ + double B; + string symbol; + const double fac = 1.0 / (8.0*M_PI*M_PI); + in >> symbol >> pos[0] >> pos[1] >> pos[2] >> B; + if (!in) return in; + // here we read successfully + const LocalPeriodicTable* lpt = LocalPeriodicTable::instance(); + atom_type = lpt->lookup(symbol); + fill_n(u, 3, fac*B); + fill_n(u+3, 3, 0.0); + occ = 1.0; + docc = 0.0; + fill_n(dpos, 3, 0.0); + fill_n(du, 6, 0.0); + return in; +} + + +istream& Atom::read_pdffit_atom(istream& in) +{ + string symbol; + in >> symbol >> pos[0] >> pos[1] >> pos[2] >> occ >> + dpos[0] >> dpos[1] >> dpos[2] >> docc >> + u[0] >> u[1] >> u[2] >> + du[0] >> du[1] >> du[2] >> + u[3] >> u[4] >> u[5] >> + du[3] >> du[4] >> du[5]; + if (!in) return in; + // here we read successfully + const LocalPeriodicTable* lpt = LocalPeriodicTable::instance(); + atom_type = lpt->lookup(symbol); + return in; +} + + +// non-member operators + + +istream& operator>>(istream& in, Atom& a) +{ + switch (Atom::streamformat) + { + case Atom::DISCUS: return a.read_discus_atom(in); + case Atom::PDFFIT: return a.read_pdffit_atom(in); + }; + return in; +} + + +// End of file diff --git a/src/extensions/libpdffit2/Atom.h b/src/extensions/libpdffit2/Atom.h new file mode 100644 index 00000000..11955036 --- /dev/null +++ b/src/extensions/libpdffit2/Atom.h @@ -0,0 +1,70 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* class Atom +* +* Comments: +* +***********************************************************************/ + +#ifndef ATOM_H_INCLUDED +#define ATOM_H_INCLUDED + +#include +#include "AtomType.h" + +class PdfFit; +class DataSet; +class Phase; + +class Atom +{ + // friends who need to touch offset + friend class PdfFit; + friend class DataSet; + friend class Phase; + friend std::istream& operator>>(std::istream& in, Atom& a); + + public: + + // class methods + static void setDiscusFormat(); + static void setPdffitFormat(); + + // data + const AtomType* atom_type; + double weight; // normalized scattering factor + double pos[3], dpos[3]; + double u[6], du[6]; + double occ, docc; + + private: + + // types and class data + enum AtomFormat { DISCUS, PDFFIT }; + static AtomFormat streamformat; + + // data + int offset; + + // methods + std::istream& read_discus_atom(std::istream& in); + std::istream& read_pdffit_atom(std::istream& in); +}; + +// non-member operators + +std::istream& operator>>(std::istream& in, Atom& a); + +#endif // ATOM_H_INCLUDED diff --git a/src/extensions/libpdffit2/AtomType.h b/src/extensions/libpdffit2/AtomType.h new file mode 100644 index 00000000..4c002e8d --- /dev/null +++ b/src/extensions/libpdffit2/AtomType.h @@ -0,0 +1,76 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* class AtomType +* +* Comments: storage of element properties like name, symbol, +* atomic mass or scattering power +* +***********************************************************************/ + +#ifndef ATOMTYPE_H_INCLUDED +#define ATOMTYPE_H_INCLUDED + +#include +#include +#include + +class AtomType +{ + public: + // Data + std::string symbol; // element symbol + std::string name; // element name + bool isotope; // flag for isotopes + int z; // atomic number + double M; // atomic mass + int charge; // total charge in e + double radius; // ionic radius + double xsf; // x-ray scattering factor + double nsf; // neutron scattering factor + + // Constructor + AtomType() + { + z = 0; + M = 0.0; + isotope = false; + charge = 0; + radius = 0.0; + xsf = 0.0; + nsf = 0.0; + } + + // Methods + double sf(char scattering_type) const + { + switch (scattering_type) + { + case 'x': + case 'X': + return xsf; + case 'n': + case 'N': + return nsf; + default: + std::ostringstream emsg; + emsg << "Invalid scattering type '" << + scattering_type << "'"; + throw std::runtime_error(emsg.str()); + } + return 0.0; + } +}; + +#endif // ATOMTYPE_H_INCLUDED diff --git a/src/extensions/libpdffit2/LocalPeriodicTable.cc b/src/extensions/libpdffit2/LocalPeriodicTable.cc new file mode 100644 index 00000000..482f2f10 --- /dev/null +++ b/src/extensions/libpdffit2/LocalPeriodicTable.cc @@ -0,0 +1,147 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2008 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* class LocalPeriodicTable +* +* Comments: Light-weight class which allows redefinitions of scattering +* factors. This class throws ValueError for unknown elements. +* +***********************************************************************/ + +#include +#include "LocalPeriodicTable.h" +#include "exceptions.h" + +using namespace std; + + +// public class methods + + +const LocalPeriodicTable* LocalPeriodicTable::instance() +{ + static unique_ptr the_table(new LocalPeriodicTable()); + return the_table.get(); +} + + +// constructor + + +LocalPeriodicTable::LocalPeriodicTable() +{ + // private data + this->_periodic_table = PeriodicTable::instance(); +} + + +// public methods + + +const AtomType* LocalPeriodicTable::name(const string& nm) const +{ + const AtomType* atp0; + try { + atp0 = this->_periodic_table->name(nm); + } + catch (runtime_error e) { + throw ValueError(e.what()); + } + const AtomType* atp = local_symbol(atp0->symbol); + return atp; +} + + +const AtomType* LocalPeriodicTable::symbol(const string& smbl) const +{ + const AtomType* atp = local_symbol(smbl); + return atp; +} + + +const AtomType* LocalPeriodicTable::lookup(const string& pat) const +{ + const AtomType* atp0; + try { + atp0 = this->_periodic_table->lookup(pat); + } + catch (runtime_error e) { + throw ValueError(e.what()); + } + const AtomType* atp = local_symbol(atp0->symbol); + return atp; +} + + +bool LocalPeriodicTable::has(const string& pat) const +{ + return this->_periodic_table->has(pat); +} + + +void LocalPeriodicTable::reset(const string& smbl) +{ + const AtomType* atp0; + try { + atp0 = this->_periodic_table->symbol(smbl); + } + catch (runtime_error e) { + throw ValueError(e.what()); + } + // overwrite with default only when smbl is in the local table + if (this->_local_table.count(smbl)) + { + this->_local_table[smbl] = *atp0; + } +} + + +void LocalPeriodicTable::setXsf(const string& smbl, double xsf) +{ + AtomType* atp = this->local_symbol(smbl); + atp->xsf = xsf; +} + + +void LocalPeriodicTable::setNsf(const string& smbl, double nsf) +{ + AtomType* atp = this->local_symbol(smbl); + atp->nsf = nsf; +} + + +// private methods + + +AtomType* LocalPeriodicTable::local_symbol(const string& smbl) const +{ + map::iterator atplocal; + atplocal = this->_local_table.find(smbl); + if (atplocal == this->_local_table.end()) + { + const AtomType* atp0; + try { + atp0 = this->_periodic_table->symbol(smbl); + } + catch (runtime_error e) { + throw ValueError(e.what()); + } + atplocal = this->_local_table.insert(make_pair(smbl, *atp0)).first; + } + AtomType* atp = &(atplocal->second); + return atp; +} + + +// End of file diff --git a/src/extensions/libpdffit2/LocalPeriodicTable.h b/src/extensions/libpdffit2/LocalPeriodicTable.h new file mode 100644 index 00000000..551faee5 --- /dev/null +++ b/src/extensions/libpdffit2/LocalPeriodicTable.h @@ -0,0 +1,63 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2008 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* class LocalPeriodicTable +* +* Comments: Light-weight class which allows redefinitions of scattering +* factors. It keeps a local copy of each looked up species, +* which can be redefined. +* This class also throws ValueError for unknown elements. +* +***********************************************************************/ + +#ifndef LOCALPERIODICTABLE_H_INCLUDED +#define LOCALPERIODICTABLE_H_INCLUDED + +#include +#include +#include "PeriodicTable.h" + +class LocalPeriodicTable +{ + public: + + // class methods + + // common instance for clients that do not need to own one + static const LocalPeriodicTable* instance(); + + // constructor + LocalPeriodicTable(); + + // methods + const AtomType* name(const std::string& nm) const; + const AtomType* symbol(const std::string& smbl) const; + const AtomType* lookup(const std::string& pat) const; + bool has(const std::string& pat) const; + void reset(const std::string& smbl); + void setXsf(const std::string& smbl, double xsf); + void setNsf(const std::string& smbl, double nsf); + + private: + + // data + PeriodicTable* _periodic_table; + mutable std::map _local_table; + + // methods + AtomType* local_symbol(const std::string& smbl) const; + +}; + +#endif // LOCALPERIODICTABLE_H_INCLUDED diff --git a/src/extensions/libpdffit2/MathUtils.h b/src/extensions/libpdffit2/MathUtils.h new file mode 100644 index 00000000..21240276 --- /dev/null +++ b/src/extensions/libpdffit2/MathUtils.h @@ -0,0 +1,94 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2007 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch, Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Math functions and numerical constants for pdffit2 and formula parser. +* +* Comments: +* +***********************************************************************/ + +#ifndef MATHUTILS_H_INCLUDED +#define MATHUTILS_H_INCLUDED + +#include +#include + +// numerical constants +const double rad = M_PI/180.0; +const double double_eps = (1.0 + sqrt(std::numeric_limits().epsilon())) - 1.0; +const double double_max = std::numeric_limits().max(); +const double deltar_tol = 1.0e-3; + +// MS compatibility fix - define functions not provided by MSVC cmath +#ifdef _MSC_VER +#include + +#if _MSC_VER < 1800 // log2 has been available since MSVC 2013 +inline double log2(double x) { return log(x)/log(2.0); } +#endif + +inline int isnan(double x) { return _isnan(x); } +inline double round(double x) { return (x < 0) ? ceil(x - 0.5) : floor(x + 0.5); } + +#endif // _MSC_VER + +// nearest integer +inline int nint(const double x) +{ + return (int) round(x); +} + +// math functions and derivatives used in formula parser + +inline double neg(double x) { return -x; } +inline double dneg(double x) { return -1.0; } + +inline double sqr(double x) { return x*x; } +inline double dsqr(double x) { return 2.0*x; } + +inline double cube(double x) { return x*x*x; } +inline double dcube(double x) { return 3.0*sqr(x); } + +inline double dsqrt(double x) { return 0.5/sqrt(x); } + +inline double dexp(double x) { return exp(x); } +inline double dlog(double x) { return 1.0/x; } + +inline double sind(double x) { return sin(rad*x); } +inline double dsind(double x) { return rad*cos(rad*x); } + +inline double cosd(double x) { return cos(rad*x); } +inline double dcosd(double x) { return -rad*sin(rad*x); } + +inline double tand(double x) { return tan(rad*x); } +inline double dtand(double x) { return rad/sqr(cosd(x)); } + +inline double dsin(double x) { return cos(x); } +inline double dcos(double x) { return -sin(x); } +inline double dtan(double x) { return 1.0/sqr(cos(x)); } + +inline double dasin(double x) { return 1.0/sqrt(1.0 - x*x); } +inline double dacos(double x) { return -1.0/sqrt(1.0 - x*x); } +inline double datan(double x) { return 1/(1+sqr(x)); } + +inline double asind(double x) { return asin(x)/rad; } +inline double dasind(double x) { return dasin(x)/rad; } + +inline double acosd(double x) { return acos(x)/rad; } +inline double dacosd(double x) { return dacos(x)/rad; } + +inline double atand(double x) { return atan(x)/rad; } +inline double datand(double x) { return datan(x)/rad; } + +#endif // MATHUTILS_H_INCLUDED diff --git a/src/extensions/libpdffit2/OutputStreams.cc b/src/extensions/libpdffit2/OutputStreams.cc new file mode 100644 index 00000000..6bacc8c1 --- /dev/null +++ b/src/extensions/libpdffit2/OutputStreams.cc @@ -0,0 +1,24 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Custom output and error streams. +* +***********************************************************************/ + +#include "OutputStreams.h" + +std::ostream* NS_PDFFIT2::pout = &std::cout; +std::ostream* NS_PDFFIT2::perr = &std::cerr; + +// End of file diff --git a/src/extensions/libpdffit2/OutputStreams.h b/src/extensions/libpdffit2/OutputStreams.h new file mode 100644 index 00000000..d269b6b3 --- /dev/null +++ b/src/extensions/libpdffit2/OutputStreams.h @@ -0,0 +1,31 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Custom output and error streams. +* +***********************************************************************/ + +#ifndef OUTPUTSTREAMS_H_INCLUDED +#define OUTPUTSTREAMS_H_INCLUDED + +#include + +namespace NS_PDFFIT2 { + +extern std::ostream* pout; +extern std::ostream* perr; + +} + +#endif // OUTPUTSTREAMS_H_INCLUDED diff --git a/src/extensions/libpdffit2/PairDistance.h b/src/extensions/libpdffit2/PairDistance.h new file mode 100644 index 00000000..92c375f3 --- /dev/null +++ b/src/extensions/libpdffit2/PairDistance.h @@ -0,0 +1,42 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Simple struct for pair distance and indices of atoms in the pair +* +***********************************************************************/ + +#ifndef PAIRDISTANCE_H_INCLUDED +#define PAIRDISTANCE_H_INCLUDED + +struct PairDistance +{ + // Data members + double dij; // distance + double ddij; // standard deviation + int i; // first index based from 1 + int j; // second index based from 1 + + // Constructor + PairDistance() : dij(0.0), ddij(0.0), i(0), j(0) + { } + +}; + +// Comparison operator +inline bool operator<(const PairDistance& pd0, const PairDistance& pd1) +{ + return (pd0.dij < pd1.dij); +} + +#endif // PAIRDISTANCE_H_INCLUDED diff --git a/src/extensions/libpdffit2/PeriodicTable.cc b/src/extensions/libpdffit2/PeriodicTable.cc new file mode 100644 index 00000000..dd1b4481 --- /dev/null +++ b/src/extensions/libpdffit2/PeriodicTable.cc @@ -0,0 +1,3459 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* class PeriodicTable +* +* Comments: singleton class, use PeriodicTable::instance() +* for its pointer +* +***********************************************************************/ + +#include +#include +#include + +// MS compatibility fix +#include + +#include "PeriodicTable.h" + +using namespace std; + +//////////////////////////////////////////////////////////////////////// +// helper function +//////////////////////////////////////////////////////////////////////// +namespace { + +inline bool isalphachar(const char& c) +{ + return isalpha(c); +} + +} // namespace + +//////////////////////////////////////////////////////////////////////// +// PeriodicTable definitions +//////////////////////////////////////////////////////////////////////// + +PeriodicTable::PeriodicTable() +{ + init(); +} + +PeriodicTable::~PeriodicTable() +{ + clear(); +} + +AtomType* PeriodicTable::name(const string& s) +{ + map::iterator ii; + ii = name_index.find(s); + if (ii == name_index.end()) + { + ostringstream emsg; + emsg << "Element or isotope '" << s << "' is not defined."; + throw runtime_error(emsg.str()); + } + return ii->second; +} + +AtomType* PeriodicTable::symbol(const string& s) +{ + map::iterator ii; + ii = symbol_index.find(s); + if (ii == symbol_index.end()) + { + ostringstream emsg; + emsg << "Element or isotope '" << s << "' is not defined."; + throw runtime_error(emsg.str()); + } + return ii->second; +} + +AtomType* PeriodicTable::lookup(string s) +{ + // force standard case + string::iterator sii = find_if(s.begin(), s.end(), isalphachar); + if (sii != s.end()) + { + *sii = toupper(*sii); + for (sii++; sii != s.end(); ++sii) *sii = tolower(*sii); + } + map::iterator ii; + ii = symbol_index.find(s); + if ( ii == symbol_index.end() && + (ii = name_index.find(s)) == name_index.end() ) + { + ostringstream emsg; + emsg << "Element or isotope '" << s << "' is not defined."; + throw runtime_error(emsg.str()); + } + return ii->second; +} + +bool PeriodicTable::has(const std::string& s) +{ + bool rv; + try + { + lookup(s); + rv = true; + } + catch(runtime_error) + { + rv = false; + } + return rv; +} + +void PeriodicTable::defAtomType(const AtomType& atp) +{ + // check if already defined + if (symbol_index.count(atp.symbol)) + { + ostringstream emsg; + emsg << "Element symbol '" << atp.symbol + << "' already defined."; + throw runtime_error(emsg.str()); + } + if (name_index.count(atp.name)) + { + ostringstream emsg; + emsg << "Element name '" << atp.name + << "' already defined."; + throw runtime_error(emsg.str()); + } + // all should be fine here + pt_backup.push_back(new AtomType(atp)); + AtomType* newatp = new AtomType(atp); + pt_public.push_back(newatp); + symbol_index[newatp->symbol] = newatp; + name_index[newatp->name] = newatp; +} + +void PeriodicTable::deleteAtomType(const AtomType* atp) +{ + deque::iterator ii; + ii = find(pt_public.begin(), pt_public.end(), atp); + if (ii == pt_public.end()) return; + // here we need to free and remove atp related data + symbol_index.erase(atp->symbol); + name_index.erase(atp->name); + size_t idx = ii - pt_public.begin(); + delete pt_public[idx]; pt_public.erase(pt_public.begin() + idx); + delete pt_backup[idx]; pt_backup.erase(pt_backup.begin() + idx); +} + +void PeriodicTable::reset(AtomType* atp) +{ + deque::iterator ii; + if (!count(pt_backup.begin(), pt_backup.end(), atp)) + { + ostringstream emsg; + emsg << "Element '" << atp->symbol << "' is not defined."; + throw runtime_error(emsg.str()); + } + size_t idx = ii - pt_backup.begin(); + *(pt_public[idx]) = *(pt_backup[idx]); +} + +void PeriodicTable::resetAll() +{ + deque::iterator iipub = pt_public.begin(); + deque::iterator iibak = pt_backup.begin(); + for ( ; iipub != pt_public.end(); ++iipub, ++iibak) + { + **iipub = **iibak; + } +} + +void PeriodicTable::init() +{ + // load element data to pt_backup + fill_pt_backup(); + // make public copy and initialize lookup maps + pt_public.resize(pt_backup.size()); + // fill in lookup map + deque::iterator iipub = pt_public.begin(); + deque::iterator iibak = pt_backup.begin(); + for ( ; iipub != pt_public.end(); ++iipub, ++iibak) + { + *iipub = new AtomType(**iibak); + symbol_index[(*iipub)->symbol] = *iipub; + name_index[(*iipub)->name] = *iipub; + } + // add standard symbols for deuterium and tritium + symbol_index["2-H"] = lookup("D"); + symbol_index["3-H"] = lookup("T"); +} + +void PeriodicTable::clear() +{ + deque::iterator iipub = pt_public.begin(); + deque::iterator iibak = pt_backup.begin(); + for ( ; iipub != pt_public.end(); ++iipub, ++iibak) + { + delete *iipub; *iipub = NULL; + delete *iibak; *iibak = NULL; + } + pt_public.clear(); + pt_backup.clear(); +} + +void PeriodicTable::fill_pt_backup() +{ + // Refs: + // 1. Albert-Jose Dianoux, Gerry Lander, Neutron Data Booklet, + // Second Edition, ILL 2003 + // 2. ionic radii: http://www.fhi-berlin.mpg.de/th/balsac/balm.47.html + AtomType* atp; + AtomType* itp; + // hydrogen + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "H"; + atp->name = "Hydrogen"; + atp->z = 1; + atp->M = 1.007947; + atp->radius = 0.4350; + atp->xsf = 1.0; + atp->nsf = -3.7409; + // isotopes + // 1-hydrogen + itp = new AtomType(*atp); + itp->symbol = "1-H"; + itp->name = "1-Hydrogen"; + itp->isotope = true; + itp->M = 1.0078250321; + itp->nsf = -3.7423; + pt_backup.push_back(itp); + // deuterium + itp = new AtomType(*atp); + itp->symbol = "D"; + itp->name = "Deuterium"; + itp->isotope = true; + itp->M = 2.0141017780; + itp->nsf = 6.674; + pt_backup.push_back(itp); + // tritium + itp = new AtomType(*atp); + itp->symbol = "T"; + itp->name = "Tritium"; + itp->isotope = true; + itp->M = 3.0160492675; + itp->nsf = 4.792; + pt_backup.push_back(itp); + } + // helium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "He"; + atp->name = "Helium"; + atp->z = 2; + atp->M = 4.0026022; + atp->radius = 1.4000; + atp->xsf = 2.0; + atp->nsf = 3.263; + // isotopes + // 3-helium + itp = new AtomType(*atp); + itp->symbol = "3-He"; + itp->name = "3-Helium"; + itp->isotope = true; + itp->M = 3.0160293097; + itp->nsf = 5.74; + pt_backup.push_back(itp); + // 4-helium + itp = new AtomType(*atp); + itp->symbol = "4-He"; + itp->name = "4-Helium"; + itp->isotope = true; + itp->M = 4.0026032497; + itp->nsf = 3.26; + pt_backup.push_back(itp); + } + // lithium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Li"; + atp->name = "Lithium"; + atp->z = 3; + atp->M = 6.9412; + atp->radius = 1.5199; + atp->xsf = 3.0; + atp->nsf = -1.903; + // isotopes + // 6-lithium + itp = new AtomType(*atp); + itp->symbol = "6-Li"; + itp->name = "6-Lithium"; + itp->isotope = true; + itp->M = 6.0151223; + itp->nsf = 2.0; + pt_backup.push_back(itp); + // 7-lithium + itp = new AtomType(*atp); + itp->symbol = "7-Li"; + itp->name = "7-Lithium"; + itp->isotope = true; + itp->M = 7.0160040; + itp->nsf = -2.22; + pt_backup.push_back(itp); + } + // beryllium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Be"; + atp->name = "Beryllium"; + atp->z = 4; + atp->M = 9.0121823; + atp->radius = 1.1430; + atp->xsf = 4.0; + atp->nsf = 7.791; + } + // boron + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "B"; + atp->name = "Boron"; + atp->z = 5; + atp->M = 10.8117; + atp->radius = 0.9750; + atp->xsf = 5.0; + atp->nsf = 5.304; + // isotopes + // 10-boron + itp = new AtomType(*atp); + itp->symbol = "10-B"; + itp->name = "10-Boron"; + itp->isotope = true; + itp->M = 10.0129370; + itp->nsf = -0.2; + pt_backup.push_back(itp); + // 11-boron + itp = new AtomType(*atp); + itp->symbol = "11-B"; + itp->name = "11-Boron"; + itp->isotope = true; + itp->M = 11.0093055; + itp->nsf = 6.65; + pt_backup.push_back(itp); + } + // carbon + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "C"; + atp->name = "Carbon"; + atp->z = 6; + atp->M = 12.01078; + atp->radius = 0.6550; + atp->xsf = 6.0; + atp->nsf = 6.648413; + // isotopes + // 12-carbon + itp = new AtomType(*atp); + itp->symbol = "12-C"; + itp->name = "12-Carbon"; + itp->isotope = true; + itp->M = 12.0; + itp->nsf = 6.6535; + pt_backup.push_back(itp); + // 13-carbon + itp = new AtomType(*atp); + itp->symbol = "13-C"; + itp->name = "13-Carbon"; + itp->isotope = true; + itp->M = 13.0033548378; + itp->nsf = 6.19; + pt_backup.push_back(itp); + } + // nitrogen + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "N"; + atp->name = "Nitrogen"; + atp->z = 7; + atp->M = 14.00672; + atp->radius = 0.7500; + atp->xsf = 7.0; + atp->nsf = 9.36; + // isotopes + // 14-nitrogen + itp = new AtomType(*atp); + itp->symbol = "14-N"; + itp->name = "14-Nitrogen"; + itp->isotope = true; + itp->M = 14.0030740052; + itp->nsf = 9.37; + pt_backup.push_back(itp); + // 15-nitrogen + itp = new AtomType(*atp); + itp->symbol = "15-N"; + itp->name = "15-Nitrogen"; + itp->isotope = true; + itp->M = 15.0001088984; + itp->nsf = 6.44; + pt_backup.push_back(itp); + } + // oxygen + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "O"; + atp->name = "Oxygen"; + atp->z = 8; + atp->M = 15.99943; + atp->radius = 0.7300; + atp->xsf = 8.0; + atp->nsf = 5.8054; + // isotopes + // 16-oxygen + itp = new AtomType(*atp); + itp->symbol = "16-O"; + itp->name = "16-Oxygen"; + itp->isotope = true; + itp->M = 15.9949146221; + itp->nsf = 5.805; + pt_backup.push_back(itp); + // 17-oxygen + itp = new AtomType(*atp); + itp->symbol = "17-O"; + itp->name = "17-Oxygen"; + itp->isotope = true; + itp->M = 16.99913150; + itp->nsf = 5.6; + pt_backup.push_back(itp); + // 18-oxygen + itp = new AtomType(*atp); + itp->symbol = "18-O"; + itp->name = "18-Oxygen"; + itp->isotope = true; + itp->M = 17.9991604; + itp->nsf = 5.84; + pt_backup.push_back(itp); + } + // fluorine + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "F"; + atp->name = "Fluorine"; + atp->z = 9; + atp->M = 18.99840325; + atp->radius = 0.7200; + atp->xsf = 9.0; + atp->nsf = 5.65412; + } + // neon + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ne"; + atp->name = "Neon"; + atp->z = 10; + atp->M = 20.17976; + atp->radius = 1.6000; + atp->xsf = 10.0; + atp->nsf = 4.5666; + // isotopes + // 20-neon + itp = new AtomType(*atp); + itp->symbol = "20-Ne"; + itp->name = "20-Neon"; + itp->isotope = true; + itp->M = 19.9924401759; + itp->nsf = 4.631; + pt_backup.push_back(itp); + // 21-neon + itp = new AtomType(*atp); + itp->symbol = "21-Ne"; + itp->name = "21-Neon"; + itp->isotope = true; + itp->M = 20.99384674; + itp->nsf = 6.66; + pt_backup.push_back(itp); + // 22-neon + itp = new AtomType(*atp); + itp->symbol = "22-Ne"; + itp->name = "22-Neon"; + itp->isotope = true; + itp->M = 21.99138551; + itp->nsf = 3.87; + pt_backup.push_back(itp); + } + // sodium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Na"; + atp->name = "Sodium"; + atp->z = 11; + atp->M = 22.9897702; + atp->radius = 1.8579; + atp->xsf = 11.0; + atp->nsf = 3.632; + } + // magnesium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Mg"; + atp->name = "Magnesium"; + atp->z = 12; + atp->M = 24.30506; + atp->radius = 1.6047; + atp->xsf = 12.0; + atp->nsf = 5.3754; + // isotopes + // 24-magnesium + itp = new AtomType(*atp); + itp->symbol = "24-Mg"; + itp->name = "24-Magnesium"; + itp->isotope = true; + itp->M = 23.98504190; + itp->nsf = 5.49; + pt_backup.push_back(itp); + // 25-magnesium + itp = new AtomType(*atp); + itp->symbol = "25-Mg"; + itp->name = "25-Magnesium"; + itp->isotope = true; + itp->M = 24.98583702; + itp->nsf = 3.62; + pt_backup.push_back(itp); + // 26-magnesium + itp = new AtomType(*atp); + itp->symbol = "26-Mg"; + itp->name = "26-Magnesium"; + itp->isotope = true; + itp->M = 25.98259304; + itp->nsf = 4.89; + pt_backup.push_back(itp); + } + // aluminium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Al"; + atp->name = "Aluminium"; + atp->z = 13; + atp->M = 26.9815382; + atp->radius = 1.4318; + atp->xsf = 13.0; + atp->nsf = 3.4495; + } + // silicon + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Si"; + atp->name = "Silicon"; + atp->z = 14; + atp->M = 28.08553; + atp->radius = 1.1758; + atp->xsf = 14.0; + atp->nsf = 4.15071; + // isotopes + // 28-silicon + itp = new AtomType(*atp); + itp->symbol = "28-Si"; + itp->name = "28-Silicon"; + itp->isotope = true; + itp->M = 27.9769265327; + itp->nsf = 4.106; + pt_backup.push_back(itp); + // 29-silicon + itp = new AtomType(*atp); + itp->symbol = "29-Si"; + itp->name = "29-Silicon"; + itp->isotope = true; + itp->M = 28.97649472; + itp->nsf = 4.7; + pt_backup.push_back(itp); + // 30-silicon + itp = new AtomType(*atp); + itp->symbol = "30-Si"; + itp->name = "30-Silicon"; + itp->isotope = true; + itp->M = 29.97377022; + itp->nsf = 4.58; + pt_backup.push_back(itp); + } + // phosphorus + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "P"; + atp->name = "Phosphorus"; + atp->z = 15; + atp->M = 30.9737612; + atp->radius = 1.0600; + atp->xsf = 15.0; + atp->nsf = 5.131; + } + // sulfur + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "S"; + atp->name = "Sulfur"; + atp->z = 16; + atp->M = 32.0655; + atp->radius = 1.0200; + atp->xsf = 16.0; + atp->nsf = 2.8471; + // isotopes + // 32-sulfur + itp = new AtomType(*atp); + itp->symbol = "32-S"; + itp->name = "32-Sulfur"; + itp->isotope = true; + itp->M = 31.97207069; + itp->nsf = 2.804; + pt_backup.push_back(itp); + // 33-sulfur + itp = new AtomType(*atp); + itp->symbol = "33-S"; + itp->name = "33-Sulfur"; + itp->isotope = true; + itp->M = 32.97145850; + itp->nsf = 4.74; + pt_backup.push_back(itp); + // 34-sulfur + itp = new AtomType(*atp); + itp->symbol = "34-S"; + itp->name = "34-Sulfur"; + itp->isotope = true; + itp->M = 33.96786683; + itp->nsf = 3.48; + pt_backup.push_back(itp); + // 36-sulfur + itp = new AtomType(*atp); + itp->symbol = "36-S"; + itp->name = "36-Sulfur"; + itp->isotope = true; + itp->M = 35.96708088; + itp->nsf = 3.0; + pt_backup.push_back(itp); + } + // chlorine + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Cl"; + atp->name = "Chlorine"; + atp->z = 17; + atp->M = 35.4532; + atp->radius = 0.9900; + atp->xsf = 17.0; + atp->nsf = 9.57928; + // isotopes + // 35-chlorine + itp = new AtomType(*atp); + itp->symbol = "35-Cl"; + itp->name = "35-Chlorine"; + itp->isotope = true; + itp->M = 34.96885271; + itp->nsf = 11.7; + pt_backup.push_back(itp); + // 37-chlorine + itp = new AtomType(*atp); + itp->symbol = "37-Cl"; + itp->name = "37-Chlorine"; + itp->isotope = true; + itp->M = 36.96590260; + itp->nsf = 3.08; + pt_backup.push_back(itp); + } + // argon + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ar"; + atp->name = "Argon"; + atp->z = 18; + atp->M = 39.9481; + atp->radius = 1.9000; + atp->xsf = 18.0; + atp->nsf = 1.9096; + // isotopes + // 36-argon + itp = new AtomType(*atp); + itp->symbol = "36-Ar"; + itp->name = "36-Argon"; + itp->isotope = true; + itp->M = 35.96754628; + itp->nsf = 24.9; + pt_backup.push_back(itp); + // 38-argon + itp = new AtomType(*atp); + itp->symbol = "38-Ar"; + itp->name = "38-Argon"; + itp->isotope = true; + itp->M = 37.9627322; + itp->nsf = 3.5; + pt_backup.push_back(itp); + // 40-argon + itp = new AtomType(*atp); + itp->symbol = "40-Ar"; + itp->name = "40-Argon"; + itp->isotope = true; + itp->M = 39.962383123; + itp->nsf = 1.7; + pt_backup.push_back(itp); + } + // potassium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "K"; + atp->name = "Potassium"; + atp->z = 19; + atp->M = 39.09831; + atp->radius = 2.2620; + atp->xsf = 19.0; + atp->nsf = 3.672; + // isotopes + // 39-potassium + itp = new AtomType(*atp); + itp->symbol = "39-K"; + itp->name = "39-Potassium"; + itp->isotope = true; + itp->M = 38.9637069; + itp->nsf = 3.79; + pt_backup.push_back(itp); + // 40-potassium + itp = new AtomType(*atp); + itp->symbol = "40-K"; + itp->name = "40-Potassium"; + itp->isotope = true; + itp->M = 39.96399867; + itp->nsf = 3.1; + pt_backup.push_back(itp); + // 41-potassium + itp = new AtomType(*atp); + itp->symbol = "41-K"; + itp->name = "41-Potassium"; + itp->isotope = true; + itp->M = 40.96182597; + itp->nsf = 2.69; + pt_backup.push_back(itp); + } + // calcium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ca"; + atp->name = "Calcium"; + atp->z = 20; + atp->M = 40.0784; + atp->radius = 1.9758; + atp->xsf = 20.0; + atp->nsf = 4.702; + // isotopes + // 40-calcium + itp = new AtomType(*atp); + itp->symbol = "40-Ca"; + itp->name = "40-Calcium"; + itp->isotope = true; + itp->M = 39.9625912; + itp->nsf = 4.78; + pt_backup.push_back(itp); + // 42-calcium + itp = new AtomType(*atp); + itp->symbol = "42-Ca"; + itp->name = "42-Calcium"; + itp->isotope = true; + itp->M = 41.9586183; + itp->nsf = 3.36; + pt_backup.push_back(itp); + // 43-calcium + itp = new AtomType(*atp); + itp->symbol = "43-Ca"; + itp->name = "43-Calcium"; + itp->isotope = true; + itp->M = 42.9587668; + itp->nsf = -1.56; + pt_backup.push_back(itp); + // 44-calcium + itp = new AtomType(*atp); + itp->symbol = "44-Ca"; + itp->name = "44-Calcium"; + itp->isotope = true; + itp->M = 43.9554811; + itp->nsf = 1.42; + pt_backup.push_back(itp); + // 46-calcium + itp = new AtomType(*atp); + itp->symbol = "46-Ca"; + itp->name = "46-Calcium"; + itp->isotope = true; + itp->M = 45.9536928; + itp->nsf = 3.55; + pt_backup.push_back(itp); + // 48-calcium + itp = new AtomType(*atp); + itp->symbol = "48-Ca"; + itp->name = "48-Calcium"; + itp->isotope = true; + itp->M = 47.952534; + itp->nsf = 0.39; + pt_backup.push_back(itp); + } + // scandium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Sc"; + atp->name = "Scandium"; + atp->z = 21; + atp->M = 44.9559108; + atp->radius = 1.6545; + atp->xsf = 21.0; + atp->nsf = 12.11; + } + // titanium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ti"; + atp->name = "Titanium"; + atp->z = 22; + atp->M = 47.8671; + atp->radius = 1.4755; + atp->xsf = 22.0; + atp->nsf = -3.37013; + // isotopes + // 46-titanium + itp = new AtomType(*atp); + itp->symbol = "46-Ti"; + itp->name = "46-Titanium"; + itp->isotope = true; + itp->M = 45.9526295; + itp->nsf = 4.72; + pt_backup.push_back(itp); + // 47-titanium + itp = new AtomType(*atp); + itp->symbol = "47-Ti"; + itp->name = "47-Titanium"; + itp->isotope = true; + itp->M = 46.9517638; + itp->nsf = 3.53; + pt_backup.push_back(itp); + // 48-titanium + itp = new AtomType(*atp); + itp->symbol = "48-Ti"; + itp->name = "48-Titanium"; + itp->isotope = true; + itp->M = 47.9479471; + itp->nsf = -5.86; + pt_backup.push_back(itp); + // 49-titanium + itp = new AtomType(*atp); + itp->symbol = "49-Ti"; + itp->name = "49-Titanium"; + itp->isotope = true; + itp->M = 48.9478708; + itp->nsf = 0.98; + pt_backup.push_back(itp); + // 50-titanium + itp = new AtomType(*atp); + itp->symbol = "50-Ti"; + itp->name = "50-Titanium"; + itp->isotope = true; + itp->M = 49.9447921; + itp->nsf = 5.88; + pt_backup.push_back(itp); + } + // vanadium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "V"; + atp->name = "Vanadium"; + atp->z = 23; + atp->M = 50.94151; + atp->radius = 1.3090; + atp->xsf = 23.0; + atp->nsf = -0.44314; + // isotopes + // 50-vanadium + itp = new AtomType(*atp); + itp->symbol = "50-V"; + itp->name = "50-Vanadium"; + itp->isotope = true; + itp->M = 49.9471628; + itp->nsf = 7.6; + pt_backup.push_back(itp); + // 51-vanadium + itp = new AtomType(*atp); + itp->symbol = "51-V"; + itp->name = "51-Vanadium"; + itp->isotope = true; + itp->M = 50.9439637; + itp->nsf = -0.402; + pt_backup.push_back(itp); + } + // chromium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Cr"; + atp->name = "Chromium"; + atp->z = 24; + atp->M = 51.99616; + atp->radius = 1.2490; + atp->xsf = 24.0; + atp->nsf = 3.6357; + // isotopes + // 50-chromium + itp = new AtomType(*atp); + itp->symbol = "50-Cr"; + itp->name = "50-Chromium"; + itp->isotope = true; + itp->M = 49.9460496; + itp->nsf = -4.50; + pt_backup.push_back(itp); + // 52-chromium + itp = new AtomType(*atp); + itp->symbol = "52-Cr"; + itp->name = "52-Chromium"; + itp->isotope = true; + itp->M = 51.9405119; + itp->nsf = 4.914; + pt_backup.push_back(itp); + // 0-chromium + itp = new AtomType(*atp); + itp->symbol = "53-Cr"; + itp->name = "53-Chromium"; + itp->isotope = true; + itp->M = 52.9406538; + itp->nsf = -4.20; + pt_backup.push_back(itp); + // 54-chromium + itp = new AtomType(*atp); + itp->symbol = "54-Cr"; + itp->name = "54-Chromium"; + itp->isotope = true; + itp->M = 53.9388849; + itp->nsf = 4.55; + pt_backup.push_back(itp); + } + // manganese + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Mn"; + atp->name = "Manganese"; + atp->z = 25; + atp->M = 54.9380499; + atp->radius = 1.3500; + atp->xsf = 25.0; + atp->nsf = -3.75018; + } + // iron + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Fe"; + atp->name = "Iron"; + atp->z = 26; + atp->M = 55.8452; + atp->radius = 1.2411; + atp->xsf = 26.0; + atp->nsf = 9.452; + // isotopes + // 54-iron + itp = new AtomType(*atp); + itp->symbol = "54-Fe"; + itp->name = "54-Iron"; + itp->isotope = true; + itp->M = 53.9396148; + itp->nsf = 4.2; + pt_backup.push_back(itp); + // 56-iron + itp = new AtomType(*atp); + itp->symbol = "56-Fe"; + itp->name = "56-Iron"; + itp->isotope = true; + itp->M = 55.9349421; + itp->nsf = 10.1; + pt_backup.push_back(itp); + // 57-iron + itp = new AtomType(*atp); + itp->symbol = "57-Fe"; + itp->name = "57-Iron"; + itp->isotope = true; + itp->M = 56.9353987; + itp->nsf = 2.3; + pt_backup.push_back(itp); + // 58-iron + itp = new AtomType(*atp); + itp->symbol = "58-Fe"; + itp->name = "58-Iron"; + itp->isotope = true; + itp->M = 57.9332805; + itp->nsf = 15; + pt_backup.push_back(itp); + } + // cobalt + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Co"; + atp->name = "Cobalt"; + atp->z = 27; + atp->M = 58.9332009; + atp->radius = 1.2535; + atp->xsf = 27.0; + atp->nsf = 2.492; + } + // nickel + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ni"; + atp->name = "Nickel"; + atp->z = 28; + atp->M = 58.69342; + atp->radius = 1.2460; + atp->xsf = 28.0; + atp->nsf = 10.31; + // isotopes + // 58-nickel + itp = new AtomType(*atp); + itp->symbol = "58-Ni"; + itp->name = "58-Nickel"; + itp->isotope = true; + itp->M = 57.9353479; + itp->nsf = 14.4; + pt_backup.push_back(itp); + // 60-nickel + itp = new AtomType(*atp); + itp->symbol = "60-Ni"; + itp->name = "60-Nickel"; + itp->isotope = true; + itp->M = 59.9307906; + itp->nsf = 2.8; + pt_backup.push_back(itp); + // 61-nickel + itp = new AtomType(*atp); + itp->symbol = "61-Ni"; + itp->name = "61-Nickel"; + itp->isotope = true; + itp->M = 60.9310604; + itp->nsf = 7.60; + pt_backup.push_back(itp); + // 62-nickel + itp = new AtomType(*atp); + itp->symbol = "62-Ni"; + itp->name = "62-Nickel"; + itp->isotope = true; + itp->M = 61.9283488; + itp->nsf = -8.7; + pt_backup.push_back(itp); + // 64-nickel + itp = new AtomType(*atp); + itp->symbol = "64-Ni"; + itp->name = "64-Nickel"; + itp->isotope = true; + itp->M = 63.9279696; + itp->nsf = -0.37; + pt_backup.push_back(itp); + } + // copper + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Cu"; + atp->name = "Copper"; + atp->z = 29; + atp->M = 63.5463; + atp->radius = 1.2780; + atp->xsf = 29.0; + atp->nsf = 7.7184; + // isotopes + // 63-copper + itp = new AtomType(*atp); + itp->symbol = "63-Cu"; + itp->name = "63-Copper"; + itp->isotope = true; + itp->M = 62.9296011; + itp->nsf = 6.477; + pt_backup.push_back(itp); + // 65-copper + itp = new AtomType(*atp); + itp->symbol = "65-Cu"; + itp->name = "65-Copper"; + itp->isotope = true; + itp->M = 64.9277937; + itp->nsf = 10.204; + pt_backup.push_back(itp); + } + // zinc + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Zn"; + atp->name = "Zinc"; + atp->z = 30; + atp->M = 65.4094; + atp->radius = 1.3325; + atp->xsf = 30.0; + atp->nsf = 5.6805; + // isotopes + // 64-zinc + itp = new AtomType(*atp); + itp->symbol = "64-Zn"; + itp->name = "64-Zinc"; + itp->isotope = true; + itp->M = 63.9291466; + itp->nsf = 5.23; + pt_backup.push_back(itp); + // 66-zinc + itp = new AtomType(*atp); + itp->symbol = "66-Zn"; + itp->name = "66-Zinc"; + itp->isotope = true; + itp->M = 65.9260368; + itp->nsf = 5.98; + pt_backup.push_back(itp); + // 67-zinc + itp = new AtomType(*atp); + itp->symbol = "67-Zn"; + itp->name = "67-Zinc"; + itp->isotope = true; + itp->M = 66.9271309; + itp->nsf = 7.58; + pt_backup.push_back(itp); + // 68-zinc + itp = new AtomType(*atp); + itp->symbol = "68-Zn"; + itp->name = "68-Zinc"; + itp->isotope = true; + itp->M = 67.9248476; + itp->nsf = 6.04; + pt_backup.push_back(itp); + // 70-zinc + itp = new AtomType(*atp); + itp->symbol = "70-Zn"; + itp->name = "70-Zinc"; + itp->isotope = true; + itp->M = 69.925325; + itp->nsf = 6.9; + pt_backup.push_back(itp); + } + // gallium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ga"; + atp->name = "Gallium"; + atp->z = 31; + atp->M = 69.7231; + atp->radius = 1.3501; + atp->xsf = 31.0; + atp->nsf = 7.2882; + // isotopes + // 69-gallium + itp = new AtomType(*atp); + itp->symbol = "69-Ga"; + itp->name = "69-Gallium"; + itp->isotope = true; + itp->M = 68.925581; + itp->nsf = 8.043; + pt_backup.push_back(itp); + // 71-gallium + itp = new AtomType(*atp); + itp->symbol = "71-Ga"; + itp->name = "71-Gallium"; + itp->isotope = true; + itp->M = 70.9247050; + itp->nsf = 6.170; + pt_backup.push_back(itp); + } + // germanium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ge"; + atp->name = "Germanium"; + atp->z = 32; + atp->M = 72.641; + atp->radius = 1.2248; + atp->xsf = 32.0; + atp->nsf = 8.18520; + // isotopes + // 70-germanium + itp = new AtomType(*atp); + itp->symbol = "70-Ge"; + itp->name = "70-Germanium"; + itp->isotope = true; + itp->M = 69.9242504; + itp->nsf = 10.0; + pt_backup.push_back(itp); + // 72-germanium + itp = new AtomType(*atp); + itp->symbol = "72-Ge"; + itp->name = "72-Germanium"; + itp->isotope = true; + itp->M = 71.9220762; + itp->nsf = 8.51; + pt_backup.push_back(itp); + // 73-germanium + itp = new AtomType(*atp); + itp->symbol = "73-Ge"; + itp->name = "73-Germanium"; + itp->isotope = true; + itp->M = 72.9234594; + itp->nsf = 5.02; + pt_backup.push_back(itp); + // 74-germanium + itp = new AtomType(*atp); + itp->symbol = "74-Ge"; + itp->name = "74-Germanium"; + itp->isotope = true; + itp->M = 73.9211782; + itp->nsf = 7.58; + pt_backup.push_back(itp); + // 76-germanium + itp = new AtomType(*atp); + itp->symbol = "76-Ge"; + itp->name = "76-Germanium"; + itp->isotope = true; + itp->M = 75.9214027; + itp->nsf = 8.2; + pt_backup.push_back(itp); + } + // arsenic + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "As"; + atp->name = "Arsenic"; + atp->z = 33; + atp->M = 74.921602; + atp->radius = 1.2000; + atp->xsf = 33.0; + atp->nsf = 6.581; + } + // selenium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Se"; + atp->name = "Selenium"; + atp->z = 34; + atp->M = 78.963; + atp->radius = 1.1600; + atp->xsf = 34.0; + atp->nsf = 7.9709; + // isotopes + // 74-selenium + itp = new AtomType(*atp); + itp->symbol = "74-Se"; + itp->name = "74-Selenium"; + itp->isotope = true; + itp->M = 73.9224766; + itp->nsf = 0.8; + pt_backup.push_back(itp); + // 76-selenium + itp = new AtomType(*atp); + itp->symbol = "76-Se"; + itp->name = "76-Selenium"; + itp->isotope = true; + itp->M = 75.9192141; + itp->nsf = 12.2; + pt_backup.push_back(itp); + // 77-selenium + itp = new AtomType(*atp); + itp->symbol = "77-Se"; + itp->name = "77-Selenium"; + itp->isotope = true; + itp->M = 76.9199146; + itp->nsf = 8.25; + pt_backup.push_back(itp); + // 78-selenium + itp = new AtomType(*atp); + itp->symbol = "78-Se"; + itp->name = "78-Selenium"; + itp->isotope = true; + itp->M = 77.9173095; + itp->nsf = 8.24; + pt_backup.push_back(itp); + // 80-selenium + itp = new AtomType(*atp); + itp->symbol = "80-Se"; + itp->name = "80-Selenium"; + itp->isotope = true; + itp->M = 79.9165218; + itp->nsf = 7.48; + pt_backup.push_back(itp); + // 82-selenium + itp = new AtomType(*atp); + itp->symbol = "82-Se"; + itp->name = "82-Selenium"; + itp->isotope = true; + itp->M = 81.9167000; + itp->nsf = 6.34; + pt_backup.push_back(itp); + } + // bromine + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Br"; + atp->name = "Bromine"; + atp->z = 35; + atp->M = 79.9041; + atp->radius = 1.1400; + atp->xsf = 35.0; + atp->nsf = 6.792; + // isotopes + // 79-bromine + itp = new AtomType(*atp); + itp->symbol = "79-Br"; + itp->name = "79-Bromine"; + itp->isotope = true; + itp->M = 78.9183376; + itp->nsf = 6.79; + pt_backup.push_back(itp); + // 81-bromine + itp = new AtomType(*atp); + itp->symbol = "81-Br"; + itp->name = "81-Bromine"; + itp->isotope = true; + itp->M = 80.916291; + itp->nsf = 6.78; + pt_backup.push_back(itp); + } + // krypton + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Kr"; + atp->name = "Krypton"; + atp->z = 36; + atp->M = 83.7982; + atp->radius = 2.0000; + atp->xsf = 36.0; + atp->nsf = 7.812; + // isotopes + // 86-krypton + itp = new AtomType(*atp); + itp->symbol = "86-Kr"; + itp->name = "86-Krypton"; + itp->isotope = true; + itp->M = 85.9106103; + itp->nsf = 8.07; + pt_backup.push_back(itp); + } + // rubidium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Rb"; + atp->name = "Rubidium"; + atp->z = 37; + atp->M = 85.46783; + atp->radius = 2.4700; + atp->xsf = 37.0; + atp->nsf = 7.082; + // isotopes + // 85-rubidium + itp = new AtomType(*atp); + itp->symbol = "85-Rb"; + itp->name = "85-Rubidium"; + itp->isotope = true; + itp->M = 84.9117893; + itp->nsf = 7.07; + pt_backup.push_back(itp); + // 87-rubidium + itp = new AtomType(*atp); + itp->symbol = "87-Rb"; + itp->name = "87-Rubidium"; + itp->isotope = true; + itp->M = 86.9091835; + itp->nsf = 7.27; + pt_backup.push_back(itp); + } + // strontium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Sr"; + atp->name = "Strontium"; + atp->z = 38; + atp->M = 87.621; + atp->radius = 2.1513; + atp->xsf = 38.0; + atp->nsf = 7.022; + // isotopes + // 84-strontium + itp = new AtomType(*atp); + itp->symbol = "84-Sr"; + itp->name = "84-Strontium"; + itp->isotope = true; + itp->M = 83.913425; + itp->nsf = 5.0; + pt_backup.push_back(itp); + // 86-strontium + itp = new AtomType(*atp); + itp->symbol = "86-Sr"; + itp->name = "86-Strontium"; + itp->isotope = true; + itp->M = 85.9092624; + itp->nsf = 5.68; + pt_backup.push_back(itp); + // 87-strontium + itp = new AtomType(*atp); + itp->symbol = "87-Sr"; + itp->name = "87-Strontium"; + itp->isotope = true; + itp->M = 86.9088793; + itp->nsf = 7.41; + pt_backup.push_back(itp); + // 88-strontium + itp = new AtomType(*atp); + itp->symbol = "88-Sr"; + itp->name = "88-Strontium"; + itp->isotope = true; + itp->M = 87.9056143; + itp->nsf = 7.16; + pt_backup.push_back(itp); + } + // yttrium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Y"; + atp->name = "Yttrium"; + atp->z = 39; + atp->M = 88.905852; + atp->radius = 1.8237; + atp->xsf = 39.0; + atp->nsf = 7.752; + } + // zirconium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Zr"; + atp->name = "Zirconium"; + atp->z = 40; + atp->M = 91.2242; + atp->radius = 1.6156; + atp->xsf = 40.0; + atp->nsf = 7.163; + // isotopes + // 90-zirconium + itp = new AtomType(*atp); + itp->symbol = "90-Zr"; + itp->name = "90-Zirconium"; + itp->isotope = true; + itp->M = 89.9047037; + itp->nsf = 6.5; + pt_backup.push_back(itp); + // 91-zirconium + itp = new AtomType(*atp); + itp->symbol = "91-Zr"; + itp->name = "91-Zirconium"; + itp->isotope = true; + itp->M = 90.9056450; + itp->nsf = 8.8; + pt_backup.push_back(itp); + // 92-zirconium + itp = new AtomType(*atp); + itp->symbol = "92-Zr"; + itp->name = "92-Zirconium"; + itp->isotope = true; + itp->M = 91.9050401; + itp->nsf = 7.5; + pt_backup.push_back(itp); + // 94-zirconium + itp = new AtomType(*atp); + itp->symbol = "94-Zr"; + itp->name = "94-Zirconium"; + itp->isotope = true; + itp->M = 93.9063158; + itp->nsf = 8.3; + pt_backup.push_back(itp); + // 96-zirconium + itp = new AtomType(*atp); + itp->symbol = "96-Zr"; + itp->name = "96-Zirconium"; + itp->isotope = true; + itp->M = 95.908276; + itp->nsf = 5.5; + pt_backup.push_back(itp); + } + // niobium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Nb"; + atp->name = "Niobium"; + atp->z = 41; + atp->M = 92.906382; + atp->radius = 1.4318; + atp->xsf = 41.0; + atp->nsf = 7.0543; + } + // molybdenum + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Mo"; + atp->name = "Molybdenum"; + atp->z = 42; + atp->M = 95.942; + atp->radius = 1.3626; + atp->xsf = 42.0; + atp->nsf = 6.71520; + // isotopes + // 92-molybdenum + itp = new AtomType(*atp); + itp->symbol = "92-Mo"; + itp->name = "92-Molybdenum"; + itp->isotope = true; + itp->M = 91.906810; + itp->nsf = 6.93; + pt_backup.push_back(itp); + // 94-molybdenum + itp = new AtomType(*atp); + itp->symbol = "94-Mo"; + itp->name = "94-Molybdenum"; + itp->isotope = true; + itp->M = 93.9050876; + itp->nsf = 6.82; + pt_backup.push_back(itp); + // 95-molybdenum + itp = new AtomType(*atp); + itp->symbol = "95-Mo"; + itp->name = "95-Molybdenum"; + itp->isotope = true; + itp->M = 94.9058415; + itp->nsf = 6.93; + pt_backup.push_back(itp); + // 96-molybdenum + itp = new AtomType(*atp); + itp->symbol = "96-Mo"; + itp->name = "96-Molybdenum"; + itp->isotope = true; + itp->M = 95.9046789; + itp->nsf = 6.22; + pt_backup.push_back(itp); + // 97-molybdenum + itp = new AtomType(*atp); + itp->symbol = "97-Mo"; + itp->name = "97-Molybdenum"; + itp->isotope = true; + itp->M = 96.9060210; + itp->nsf = 7.26; + pt_backup.push_back(itp); + // 98-molybdenum + itp = new AtomType(*atp); + itp->symbol = "98-Mo"; + itp->name = "98-Molybdenum"; + itp->isotope = true; + itp->M = 97.9054078; + itp->nsf = 6.60; + pt_backup.push_back(itp); + // 100-molybdenum + itp = new AtomType(*atp); + itp->symbol = "100-Mo"; + itp->name = "100-Molybdenum"; + itp->isotope = true; + itp->M = 99.907477; + itp->nsf = 6.75; + pt_backup.push_back(itp); + } + // technetium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Tc"; + atp->name = "Technetium"; + atp->z = 43; + atp->M = 98.0; + atp->radius = 1.3675; + atp->xsf = 43.0; + atp->nsf = 6.83; + } + // ruthenium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ru"; + atp->name = "Ruthenium"; + atp->z = 44; + atp->M = 101.072; + atp->radius = 1.3529; + atp->xsf = 44.0; + atp->nsf = 7.022; + } + // rhodium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Rh"; + atp->name = "Rhodium"; + atp->z = 45; + atp->M = 102.905502; + atp->radius = 1.3450; + atp->xsf = 45.0; + atp->nsf = 5.904; + } + // palladium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Pd"; + atp->name = "Palladium"; + atp->z = 46; + atp->M = 106.421; + atp->radius = 1.3755; + atp->xsf = 46.0; + atp->nsf = 5.916; + // isotopes + // 102-palladium + itp = new AtomType(*atp); + itp->symbol = "102-Pd"; + itp->name = "102-Palladium"; + itp->isotope = true; + itp->M = 101.905608; + itp->nsf = 7.7; + pt_backup.push_back(itp); + // 104-palladium + itp = new AtomType(*atp); + itp->symbol = "104-Pd"; + itp->name = "104-Palladium"; + itp->isotope = true; + itp->M = 103.904035; + itp->nsf = 7.7; + pt_backup.push_back(itp); + // 105-palladium + itp = new AtomType(*atp); + itp->symbol = "105-Pd"; + itp->name = "105-Palladium"; + itp->isotope = true; + itp->M = 104.905084; + itp->nsf = 5.5; + pt_backup.push_back(itp); + // 106-palladium + itp = new AtomType(*atp); + itp->symbol = "106-Pd"; + itp->name = "106-Palladium"; + itp->isotope = true; + itp->M = 105.903483; + itp->nsf = 6.4; + pt_backup.push_back(itp); + // 108-palladium + itp = new AtomType(*atp); + itp->symbol = "108-Pd"; + itp->name = "108-Palladium"; + itp->isotope = true; + itp->M = 107.903894; + itp->nsf = 4.1; + pt_backup.push_back(itp); + // 110-palladium + itp = new AtomType(*atp); + itp->symbol = "110-Pd"; + itp->name = "110-Palladium"; + itp->isotope = true; + itp->M = 109.905152; + itp->nsf = 7.7; + pt_backup.push_back(itp); + } + // silver + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ag"; + atp->name = "Silver"; + atp->z = 47; + atp->M = 107.86822; + atp->radius = 1.4447; + atp->xsf = 47.0; + atp->nsf = 5.9227; + // isotopes + // 107-silver + itp = new AtomType(*atp); + itp->symbol = "107-Ag"; + itp->name = "107-Silver"; + itp->isotope = true; + itp->M = 106.905093; + itp->nsf = 7.555; + pt_backup.push_back(itp); + // 109-silver + itp = new AtomType(*atp); + itp->symbol = "109-Ag"; + itp->name = "109-Silver"; + itp->isotope = true; + itp->M = 108.904756; + itp->nsf = 4.165; + pt_backup.push_back(itp); + } + // cadmium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Cd"; + atp->name = "Cadmium"; + atp->z = 48; + atp->M = 112.4118; + atp->radius = 1.4894; + atp->xsf = 48.0; + atp->nsf = 4.835; + // isotopes + // 106-cadmium + itp = new AtomType(*atp); + itp->symbol = "106-Cd"; + itp->name = "106-Cadmium"; + itp->isotope = true; + itp->M = 105.906458; + itp->nsf = 5.0; + pt_backup.push_back(itp); + // 108-cadmium + itp = new AtomType(*atp); + itp->symbol = "108-Cd"; + itp->name = "108-Cadmium"; + itp->isotope = true; + itp->M = 107.904183; + itp->nsf = 5.31; + pt_backup.push_back(itp); + // 110-cadmium + itp = new AtomType(*atp); + itp->symbol = "110-Cd"; + itp->name = "110-Cadmium"; + itp->isotope = true; + itp->M = 109.903006; + itp->nsf = 5.78; + pt_backup.push_back(itp); + // 111-cadmium + itp = new AtomType(*atp); + itp->symbol = "111-Cd"; + itp->name = "111-Cadmium"; + itp->isotope = true; + itp->M = 110.904182; + itp->nsf = 6.47; + pt_backup.push_back(itp); + // 112-cadmium + itp = new AtomType(*atp); + itp->symbol = "112-Cd"; + itp->name = "112-Cadmium"; + itp->isotope = true; + itp->M = 111.9027572; + itp->nsf = 6.34; + pt_backup.push_back(itp); + // 113-cadmium + itp = new AtomType(*atp); + itp->symbol = "113-Cd"; + itp->name = "113-Cadmium"; + itp->isotope = true; + itp->M = 112.9044009; + itp->nsf = -8.0; + pt_backup.push_back(itp); + // 114-cadmium + itp = new AtomType(*atp); + itp->symbol = "114-Cd"; + itp->name = "114-Cadmium"; + itp->isotope = true; + itp->M = 113.9033581; + itp->nsf = 7.48; + pt_backup.push_back(itp); + // 116-cadmium + itp = new AtomType(*atp); + itp->symbol = "116-Cd"; + itp->name = "116-Cadmium"; + itp->isotope = true; + itp->M = 115.904755; + itp->nsf = 6.26; + pt_backup.push_back(itp); + } + // indium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "In"; + atp->name = "Indium"; + atp->z = 49; + atp->M = 114.8183; + atp->radius = 1.6662; + atp->xsf = 49.0; + atp->nsf = 4.0652; + // isotopes + // 113-indium + itp = new AtomType(*atp); + itp->symbol = "113-In"; + itp->name = "113-Indium"; + itp->isotope = true; + itp->M = 112.904061; + itp->nsf = 5.39; + pt_backup.push_back(itp); + // 115-indium + itp = new AtomType(*atp); + itp->symbol = "115-In"; + itp->name = "115-Indium"; + itp->isotope = true; + itp->M = 114.903878; + itp->nsf = 4.00; + pt_backup.push_back(itp); + } + // tin + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Sn"; + atp->name = "Tin"; + atp->z = 50; + atp->M = 118.7107; + atp->radius = 1.5375; + atp->xsf = 50.0; + atp->nsf = 6.2252; + // isotopes + // 112-tin + itp = new AtomType(*atp); + itp->symbol = "112-Sn"; + itp->name = "112-Tin"; + itp->isotope = true; + itp->M = 111.904821; + itp->nsf = 6.0; + pt_backup.push_back(itp); + // 114-tin + itp = new AtomType(*atp); + itp->symbol = "114-Sn"; + itp->name = "114-Tin"; + itp->isotope = true; + itp->M = 113.902782; + itp->nsf = 6.0; + pt_backup.push_back(itp); + // 115-tin + itp = new AtomType(*atp); + itp->symbol = "115-Sn"; + itp->name = "115-Tin"; + itp->isotope = true; + itp->M = 114.903346; + itp->nsf = 6.0; + pt_backup.push_back(itp); + // 116-tin + itp = new AtomType(*atp); + itp->symbol = "116-Sn"; + itp->name = "116-Tin"; + itp->isotope = true; + itp->M = 115.901744; + itp->nsf = 6.1; + pt_backup.push_back(itp); + // 117-tin + itp = new AtomType(*atp); + itp->symbol = "117-Sn"; + itp->name = "117-Tin"; + itp->isotope = true; + itp->M = 116.902954; + itp->nsf = 6.59; + pt_backup.push_back(itp); + // 118-tin + itp = new AtomType(*atp); + itp->symbol = "118-Sn"; + itp->name = "118-Tin"; + itp->isotope = true; + itp->M = 117.901606; + itp->nsf = 6.23; + pt_backup.push_back(itp); + // 119-tin + itp = new AtomType(*atp); + itp->symbol = "119-Sn"; + itp->name = "119-Tin"; + itp->isotope = true; + itp->M = 118.903309; + itp->nsf = 6.28; + pt_backup.push_back(itp); + // 120-tin + itp = new AtomType(*atp); + itp->symbol = "120-Sn"; + itp->name = "120-Tin"; + itp->isotope = true; + itp->M = 119.9021966; + itp->nsf = 6.67; + pt_backup.push_back(itp); + // 122-tin + itp = new AtomType(*atp); + itp->symbol = "122-Sn"; + itp->name = "122-Tin"; + itp->isotope = true; + itp->M = 121.9034401; + itp->nsf = 5.93; + pt_backup.push_back(itp); + // 124-tin + itp = new AtomType(*atp); + itp->symbol = "124-Sn"; + itp->name = "124-Tin"; + itp->isotope = true; + itp->M = 123.9052746; + itp->nsf = 6.15; + pt_backup.push_back(itp); + } + // antimony + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Sb"; + atp->name = "Antimony"; + atp->z = 51; + atp->M = 121.7601; + atp->radius = 1.4000; + atp->xsf = 51.0; + atp->nsf = 5.573; + // isotopes + // 121-antimony + itp = new AtomType(*atp); + itp->symbol = "121-Sb"; + itp->name = "121-Antimony"; + itp->isotope = true; + itp->M = 120.9038180; + itp->nsf = 5.71; + pt_backup.push_back(itp); + // 123-antimony + itp = new AtomType(*atp); + itp->symbol = "123-Sb"; + itp->name = "123-Antimony"; + itp->isotope = true; + itp->M = 122.9042157; + itp->nsf = 5.38; + pt_backup.push_back(itp); + } + // tellurium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Te"; + atp->name = "Tellurium"; + atp->z = 52; + atp->M = 127.603; + atp->radius = 1.3600; + atp->xsf = 52.0; + atp->nsf = 5.682; + // isotopes + // 120-tellurium + itp = new AtomType(*atp); + itp->symbol = "120-Te"; + itp->name = "120-Tellurium"; + itp->isotope = true; + itp->M = 119.904020; + itp->nsf = 5.3; + pt_backup.push_back(itp); + // 122-tellurium + itp = new AtomType(*atp); + itp->symbol = "122-Te"; + itp->name = "122-Tellurium"; + itp->isotope = true; + itp->M = 121.9030471; + itp->nsf = 3.8; + pt_backup.push_back(itp); + // 123-tellurium + itp = new AtomType(*atp); + itp->symbol = "123-Te"; + itp->name = "123-Tellurium"; + itp->isotope = true; + itp->M = 122.9042730; + itp->nsf = -0.05; + pt_backup.push_back(itp); + // 124-tellurium + itp = new AtomType(*atp); + itp->symbol = "124-Te"; + itp->name = "124-Tellurium"; + itp->isotope = true; + itp->M = 123.9028195; + itp->nsf = 7.95; + pt_backup.push_back(itp); + // 125-tellurium + itp = new AtomType(*atp); + itp->symbol = "125-Te"; + itp->name = "125-Tellurium"; + itp->isotope = true; + itp->M = 124.9044247; + itp->nsf = 5.01; + pt_backup.push_back(itp); + // 126-tellurium + itp = new AtomType(*atp); + itp->symbol = "126-Te"; + itp->name = "126-Tellurium"; + itp->isotope = true; + itp->M = 125.9033055; + itp->nsf = 5.55; + pt_backup.push_back(itp); + // 128-tellurium + itp = new AtomType(*atp); + itp->symbol = "128-Te"; + itp->name = "128-Tellurium"; + itp->isotope = true; + itp->M = 127.9044614; + itp->nsf = 5.88; + pt_backup.push_back(itp); + // 130-tellurium + itp = new AtomType(*atp); + itp->symbol = "130-Te"; + itp->name = "130-Tellurium"; + itp->isotope = true; + itp->M = 129.9062228; + itp->nsf = 6.01; + pt_backup.push_back(itp); + } + // iodine + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "I"; + atp->name = "Iodine"; + atp->z = 53; + atp->M = 126.904473; + atp->radius = 1.3300; + atp->xsf = 53.0; + atp->nsf = 5.282; + } + // xenon + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Xe"; + atp->name = "Xenon"; + atp->z = 54; + atp->M = 131.2936; + atp->radius = 2.2000; + atp->xsf = 54.0; + atp->nsf = 4.694; + } + // cesium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Cs"; + atp->name = "Cesium"; + atp->z = 55; + atp->M = 132.905452; + atp->radius = 2.6325; + atp->xsf = 55.0; + atp->nsf = 5.422; + } + // barium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ba"; + atp->name = "Barium"; + atp->z = 56; + atp->M = 137.3277; + atp->radius = 2.1705; + atp->xsf = 56.0; + atp->nsf = 5.073; + // isotopes + // 130-barium + itp = new AtomType(*atp); + itp->symbol = "130-Ba"; + itp->name = "130-Barium"; + itp->isotope = true; + itp->M = 129.906310; + itp->nsf = -3.6; + pt_backup.push_back(itp); + // 132-barium + itp = new AtomType(*atp); + itp->symbol = "132-Ba"; + itp->name = "132-Barium"; + itp->isotope = true; + itp->M = 131.905056; + itp->nsf = 7.8; + pt_backup.push_back(itp); + // 134-barium + itp = new AtomType(*atp); + itp->symbol = "134-Ba"; + itp->name = "134-Barium"; + itp->isotope = true; + itp->M = 133.904503; + itp->nsf = 5.7; + pt_backup.push_back(itp); + // 135-barium + itp = new AtomType(*atp); + itp->symbol = "135-Ba"; + itp->name = "135-Barium"; + itp->isotope = true; + itp->M = 134.905683; + itp->nsf = 4.66; + pt_backup.push_back(itp); + // 136-barium + itp = new AtomType(*atp); + itp->symbol = "136-Ba"; + itp->name = "136-Barium"; + itp->isotope = true; + itp->M = 135.904570; + itp->nsf = 4.90; + pt_backup.push_back(itp); + // 137-barium + itp = new AtomType(*atp); + itp->symbol = "137-Ba"; + itp->name = "137-Barium"; + itp->isotope = true; + itp->M = 136.905821; + itp->nsf = 6.82; + pt_backup.push_back(itp); + // 138-barium + itp = new AtomType(*atp); + itp->symbol = "138-Ba"; + itp->name = "138-Barium"; + itp->isotope = true; + itp->M = 137.905241; + itp->nsf = 4.83; + pt_backup.push_back(itp); + } + // lanthanum + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "La"; + atp->name = "Lanthanum"; + atp->z = 57; + atp->M = 138.90552; + atp->radius = 1.8725; + atp->xsf = 57.0; + atp->nsf = 8.244; + // isotopes + // 138-lanthanum + itp = new AtomType(*atp); + itp->symbol = "138-La"; + itp->name = "138-Lanthanum"; + itp->isotope = true; + itp->M = 137.907107; + itp->nsf = 8.0; + pt_backup.push_back(itp); + // 139-lanthanum + itp = new AtomType(*atp); + itp->symbol = "139-La"; + itp->name = "139-Lanthanum"; + itp->isotope = true; + itp->M = 138.906348; + itp->nsf = 8.24; + pt_backup.push_back(itp); + } + // cerium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ce"; + atp->name = "Cerium"; + atp->z = 58; + atp->M = 140.1161; + atp->radius = 1.8243; + atp->xsf = 58.0; + atp->nsf = 4.842; + // isotopes + // 136-cerium + itp = new AtomType(*atp); + itp->symbol = "136-Ce"; + itp->name = "136-Cerium"; + itp->isotope = true; + itp->M = 135.907140; + itp->nsf = 5.76; + pt_backup.push_back(itp); + // 138-cerium + itp = new AtomType(*atp); + itp->symbol = "138-Ce"; + itp->name = "138-Cerium"; + itp->isotope = true; + itp->M = 137.905986; + itp->nsf = 6.65; + pt_backup.push_back(itp); + // 140-cerium + itp = new AtomType(*atp); + itp->symbol = "140-Ce"; + itp->name = "140-Cerium"; + itp->isotope = true; + itp->M = 139.905434; + itp->nsf = 4.81; + pt_backup.push_back(itp); + // 142-cerium + itp = new AtomType(*atp); + itp->symbol = "142-Ce"; + itp->name = "142-Cerium"; + itp->isotope = true; + itp->M = 141.909240; + itp->nsf = 4.72; + pt_backup.push_back(itp); + } + // praseodymium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Pr"; + atp->name = "Praseodymium"; + atp->z = 59; + atp->M = 140.907652; + atp->radius = 1.8362; + atp->xsf = 59.0; + atp->nsf = 4.585; + } + // neodymium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Nd"; + atp->name = "Neodymium"; + atp->z = 60; + atp->M = 144.243; + atp->radius = 1.8295; + atp->xsf = 60.0; + atp->nsf = 7.695; + // isotopes + // 142-neodymium + itp = new AtomType(*atp); + itp->symbol = "142-Nd"; + itp->name = "142-Neodymium"; + itp->isotope = true; + itp->M = 141.907719; + itp->nsf = 7.7; + pt_backup.push_back(itp); + // 143-neodymium + itp = new AtomType(*atp); + itp->symbol = "143-Nd"; + itp->name = "143-Neodymium"; + itp->isotope = true; + itp->M = 142.909810; + itp->nsf = 14.0; + pt_backup.push_back(itp); + // 144-neodymium + itp = new AtomType(*atp); + itp->symbol = "144-Nd"; + itp->name = "144-Neodymium"; + itp->isotope = true; + itp->M = 143.910083; + itp->nsf = 2.8; + pt_backup.push_back(itp); + // 145-neodymium + itp = new AtomType(*atp); + itp->symbol = "145-Nd"; + itp->name = "145-Neodymium"; + itp->isotope = true; + itp->M = 144.912569; + itp->nsf = 14.0; + pt_backup.push_back(itp); + // 146-neodymium + itp = new AtomType(*atp); + itp->symbol = "146-Nd"; + itp->name = "146-Neodymium"; + itp->isotope = true; + itp->M = 145.913112; + itp->nsf = 8.7; + pt_backup.push_back(itp); + // 148-neodymium + itp = new AtomType(*atp); + itp->symbol = "148-Nd"; + itp->name = "148-Neodymium"; + itp->isotope = true; + itp->M = 147.916889; + itp->nsf = 5.7; + pt_backup.push_back(itp); + // 150-neodymium + itp = new AtomType(*atp); + itp->symbol = "150-Nd"; + itp->name = "150-Neodymium"; + itp->isotope = true; + itp->M = 149.920887; + itp->nsf = 5.28; + pt_backup.push_back(itp); + } + // promethium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Pm"; + atp->name = "Promethium"; + atp->z = 61; + atp->M = 145.0; + atp->radius = 1.8090; + atp->xsf = 61.0; + atp->nsf = 12.64; + } + // samarium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Sm"; + atp->name = "Samarium"; + atp->z = 62; + atp->M = 150.363; + atp->radius = 1.8040; + atp->xsf = 62.0; + atp->nsf = 0.005; + // isotopes + // 144-samarium + itp = new AtomType(*atp); + itp->symbol = "144-Sm"; + itp->name = "144-Samarium"; + itp->isotope = true; + itp->M = 143.911995; + itp->nsf = -3.0; + pt_backup.push_back(itp); + // 147-samarium + itp = new AtomType(*atp); + itp->symbol = "147-Sm"; + itp->name = "147-Samarium"; + itp->isotope = true; + itp->M = 146.914893; + itp->nsf = 14.0; + pt_backup.push_back(itp); + // 148-samarium + itp = new AtomType(*atp); + itp->symbol = "148-Sm"; + itp->name = "148-Samarium"; + itp->isotope = true; + itp->M = 147.914818; + itp->nsf = -3.0; + pt_backup.push_back(itp); + // 149-samarium + itp = new AtomType(*atp); + itp->symbol = "149-Sm"; + itp->name = "149-Samarium"; + itp->isotope = true; + itp->M = 148.917180; + itp->nsf = 18.7; + pt_backup.push_back(itp); + // 150-samarium + itp = new AtomType(*atp); + itp->symbol = "150-Sm"; + itp->name = "150-Samarium"; + itp->isotope = true; + itp->M = 149.917271; + itp->nsf = 14.0; + pt_backup.push_back(itp); + // 152-samarium + itp = new AtomType(*atp); + itp->symbol = "152-Sm"; + itp->name = "152-Samarium"; + itp->isotope = true; + itp->M = 151.919728; + itp->nsf = -5.0; + pt_backup.push_back(itp); + // 154-samarium + itp = new AtomType(*atp); + itp->symbol = "154-Sm"; + itp->name = "154-Samarium"; + itp->isotope = true; + itp->M = 153.922205; + itp->nsf = 8.0; + pt_backup.push_back(itp); + } + // europium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Eu"; + atp->name = "Europium"; + atp->z = 63; + atp->M = 151.9641; + atp->radius = 1.9840; + atp->xsf = 63.0; + atp->nsf = 5.33; + // isotopes + // 153-europium + itp = new AtomType(*atp); + itp->symbol = "153-Eu"; + itp->name = "153-Europium"; + itp->isotope = true; + itp->M = 152.921226; + itp->nsf = 8.22; + pt_backup.push_back(itp); + } + // gadolinium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Gd"; + atp->name = "Gadolinium"; + atp->z = 64; + atp->M = 157.253; + atp->radius = 1.8180; + atp->xsf = 64.0; + atp->nsf = 9.52; + // isotopes + // 152-gadolinium + itp = new AtomType(*atp); + itp->symbol = "152-Gd"; + itp->name = "152-Gadolinium"; + itp->isotope = true; + itp->M = 151.919788; + itp->nsf = 10.0; + pt_backup.push_back(itp); + // 154-gadolinium + itp = new AtomType(*atp); + itp->symbol = "154-Gd"; + itp->name = "154-Gadolinium"; + itp->isotope = true; + itp->M = 153.920862; + itp->nsf = 10.0; + pt_backup.push_back(itp); + // 155-gadolinium + itp = new AtomType(*atp); + itp->symbol = "155-Gd"; + itp->name = "155-Gadolinium"; + itp->isotope = true; + itp->M = 154.922619; + itp->nsf = 13.8; + pt_backup.push_back(itp); + // 156-gadolinium + itp = new AtomType(*atp); + itp->symbol = "156-Gd"; + itp->name = "156-Gadolinium"; + itp->isotope = true; + itp->M = 155.922120; + itp->nsf = 6.3; + pt_backup.push_back(itp); + // 157-gadolinium + itp = new AtomType(*atp); + itp->symbol = "157-Gd"; + itp->name = "157-Gadolinium"; + itp->isotope = true; + itp->M = 156.923957; + itp->nsf = 4.0; + pt_backup.push_back(itp); + // 158-gadolinium + itp = new AtomType(*atp); + itp->symbol = "158-Gd"; + itp->name = "158-Gadolinium"; + itp->isotope = true; + itp->M = 157.924101; + itp->nsf = 9.0; + pt_backup.push_back(itp); + // 160-gadolinium + itp = new AtomType(*atp); + itp->symbol = "160-Gd"; + itp->name = "160-Gadolinium"; + itp->isotope = true; + itp->M = 159.927051; + itp->nsf = 9.15; + pt_backup.push_back(itp); + } + // terbium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Tb"; + atp->name = "Terbium"; + atp->z = 65; + atp->M = 158.925342; + atp->radius = 1.8005; + atp->xsf = 65.0; + atp->nsf = 7.342; + } + // dysprosium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Dy"; + atp->name = "Dysprosium"; + atp->z = 66; + atp->M = 162.5001; + atp->radius = 1.7951; + atp->xsf = 66.0; + atp->nsf = 16.93; + // isotopes + // 156-dysprosium + itp = new AtomType(*atp); + itp->symbol = "156-Dy"; + itp->name = "156-Dysprosium"; + itp->isotope = true; + itp->M = 155.924278; + itp->nsf = 6.1; + pt_backup.push_back(itp); + // 158-dysprosium + itp = new AtomType(*atp); + itp->symbol = "158-Dy"; + itp->name = "158-Dysprosium"; + itp->isotope = true; + itp->M = 157.924405; + itp->nsf = 6.0; + pt_backup.push_back(itp); + // 160-dysprosium + itp = new AtomType(*atp); + itp->symbol = "160-Dy"; + itp->name = "160-Dysprosium"; + itp->isotope = true; + itp->M = 159.925194; + itp->nsf = 6.7; + pt_backup.push_back(itp); + // 161-dysprosium + itp = new AtomType(*atp); + itp->symbol = "161-Dy"; + itp->name = "161-Dysprosium"; + itp->isotope = true; + itp->M = 160.926930; + itp->nsf = 10.3; + pt_backup.push_back(itp); + // 162-dysprosium + itp = new AtomType(*atp); + itp->symbol = "162-Dy"; + itp->name = "162-Dysprosium"; + itp->isotope = true; + itp->M = 161.926795; + itp->nsf = -1.4; + pt_backup.push_back(itp); + // 163-dysprosium + itp = new AtomType(*atp); + itp->symbol = "163-Dy"; + itp->name = "163-Dysprosium"; + itp->isotope = true; + itp->M = 162.928728; + itp->nsf = 5.0; + pt_backup.push_back(itp); + // 164-dysprosium + itp = new AtomType(*atp); + itp->symbol = "164-Dy"; + itp->name = "164-Dysprosium"; + itp->isotope = true; + itp->M = 163.929171; + itp->nsf = 49.4; + pt_backup.push_back(itp); + } + // holmium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ho"; + atp->name = "Holmium"; + atp->z = 67; + atp->M = 164.930322; + atp->radius = 1.7886; + atp->xsf = 67.0; + atp->nsf = 8.443; + } + // erbium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Er"; + atp->name = "Erbium"; + atp->z = 68; + atp->M = 167.2593; + atp->radius = 1.7794; + atp->xsf = 68.0; + atp->nsf = 7.792; + // isotopes + // 162-erbium + itp = new AtomType(*atp); + itp->symbol = "162-Er"; + itp->name = "162-Erbium"; + itp->isotope = true; + itp->M = 161.928775; + itp->nsf = 9.01; + pt_backup.push_back(itp); + // 164-erbium + itp = new AtomType(*atp); + itp->symbol = "164-Er"; + itp->name = "164-Erbium"; + itp->isotope = true; + itp->M = 163.929197; + itp->nsf = 7.95; + pt_backup.push_back(itp); + // 166-erbium + itp = new AtomType(*atp); + itp->symbol = "166-Er"; + itp->name = "166-Erbium"; + itp->isotope = true; + itp->M = 165.930290; + itp->nsf = 10.51; + pt_backup.push_back(itp); + // 167-erbium + itp = new AtomType(*atp); + itp->symbol = "167-Er"; + itp->name = "167-Erbium"; + itp->isotope = true; + itp->M = 166.932045; + itp->nsf = 3.06; + pt_backup.push_back(itp); + // 168-erbium + itp = new AtomType(*atp); + itp->symbol = "168-Er"; + itp->name = "168-Erbium"; + itp->isotope = true; + itp->M = 167.932368; + itp->nsf = 7.43; + pt_backup.push_back(itp); + // 170-erbium + itp = new AtomType(*atp); + itp->symbol = "170-Er"; + itp->name = "170-Erbium"; + itp->isotope = true; + itp->M = 169.935460; + itp->nsf = 9.61; + pt_backup.push_back(itp); + } + // thulium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Tm"; + atp->name = "Thulium"; + atp->z = 69; + atp->M = 168.934212; + atp->radius = 1.7687; + atp->xsf = 69.0; + atp->nsf = 7.073; + } + // ytterbium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Yb"; + atp->name = "Ytterbium"; + atp->z = 70; + atp->M = 173.043; + atp->radius = 1.9396; + atp->xsf = 70.0; + atp->nsf = 12.413; + // isotopes + // 168-ytterbium + itp = new AtomType(*atp); + itp->symbol = "168-Yb"; + itp->name = "168-Ytterbium"; + itp->isotope = true; + itp->M = 167.933894; + itp->nsf = -4.07; + pt_backup.push_back(itp); + // 170-ytterbium + itp = new AtomType(*atp); + itp->symbol = "170-Yb"; + itp->name = "170-Ytterbium"; + itp->isotope = true; + itp->M = 169.934759; + itp->nsf = 6.8; + pt_backup.push_back(itp); + // 171-ytterbium + itp = new AtomType(*atp); + itp->symbol = "171-Yb"; + itp->name = "171-Ytterbium"; + itp->isotope = true; + itp->M = 170.936322; + itp->nsf = 9.7; + pt_backup.push_back(itp); + // 172-ytterbium + itp = new AtomType(*atp); + itp->symbol = "172-Yb"; + itp->name = "172-Ytterbium"; + itp->isotope = true; + itp->M = 171.9363777; + itp->nsf = 9.5; + pt_backup.push_back(itp); + // 173-ytterbium + itp = new AtomType(*atp); + itp->symbol = "173-Yb"; + itp->name = "173-Ytterbium"; + itp->isotope = true; + itp->M = 172.9382068; + itp->nsf = 9.56; + pt_backup.push_back(itp); + // 174-ytterbium + itp = new AtomType(*atp); + itp->symbol = "174-Yb"; + itp->name = "174-Ytterbium"; + itp->isotope = true; + itp->M = 173.9388581; + itp->nsf = 19.2; + pt_backup.push_back(itp); + // 176-ytterbium + itp = new AtomType(*atp); + itp->symbol = "176-Yb"; + itp->name = "176-Ytterbium"; + itp->isotope = true; + itp->M = 175.942568; + itp->nsf = 8.7; + pt_backup.push_back(itp); + } + // lutetium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Lu"; + atp->name = "Lutetium"; + atp->z = 71; + atp->M = 174.9671; + atp->radius = 1.7515; + atp->xsf = 71.0; + atp->nsf = 7.213; + // isotopes + // 175-lutetium + itp = new AtomType(*atp); + itp->symbol = "175-Lu"; + itp->name = "175-Lutetium"; + itp->isotope = true; + itp->M = 174.9407679; + itp->nsf = 7.28; + pt_backup.push_back(itp); + // 176-lutetium + itp = new AtomType(*atp); + itp->symbol = "176-Lu"; + itp->name = "176-Lutetium"; + itp->isotope = true; + itp->M = 175.9426824; + itp->nsf = 6.1; + pt_backup.push_back(itp); + } + // hafnium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Hf"; + atp->name = "Hafnium"; + atp->z = 72; + atp->M = 178.492; + atp->radius = 1.5973; + atp->xsf = 72.0; + atp->nsf = 7.7714; + // isotopes + // 174-hafnium + itp = new AtomType(*atp); + itp->symbol = "174-Hf"; + itp->name = "174-Hafnium"; + itp->isotope = true; + itp->M = 173.940040; + itp->nsf = 10.9; + pt_backup.push_back(itp); + // 176-hafnium + itp = new AtomType(*atp); + itp->symbol = "176-Hf"; + itp->name = "176-Hafnium"; + itp->isotope = true; + itp->M = 175.9414018; + itp->nsf = 6.61; + pt_backup.push_back(itp); + // 177-hafnium + itp = new AtomType(*atp); + itp->symbol = "177-Hf"; + itp->name = "177-Hafnium"; + itp->isotope = true; + itp->M = 176.9432200; + itp->nsf = 0.8; + pt_backup.push_back(itp); + // 178-hafnium + itp = new AtomType(*atp); + itp->symbol = "178-Hf"; + itp->name = "178-Hafnium"; + itp->isotope = true; + itp->M = 177.9436977; + itp->nsf = 5.9; + pt_backup.push_back(itp); + // 179-hafnium + itp = new AtomType(*atp); + itp->symbol = "179-Hf"; + itp->name = "179-Hafnium"; + itp->isotope = true; + itp->M = 178.9458151; + itp->nsf = 7.46; + pt_backup.push_back(itp); + // 180-hafnium + itp = new AtomType(*atp); + itp->symbol = "180-Hf"; + itp->name = "180-Hafnium"; + itp->isotope = true; + itp->M = 179.9465488; + itp->nsf = 13.2; + pt_backup.push_back(itp); + } + // tantalum + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ta"; + atp->name = "Tantalum"; + atp->z = 73; + atp->M = 180.94791; + atp->radius = 1.4280; + atp->xsf = 73.0; + atp->nsf = 6.917; + // isotopes + // 180-tantalum + itp = new AtomType(*atp); + itp->symbol = "180-Ta"; + itp->name = "180-Tantalum"; + itp->isotope = true; + itp->M = 179.947466; + itp->nsf = 7.0; + pt_backup.push_back(itp); + // 181-tantalum + itp = new AtomType(*atp); + itp->symbol = "181-Ta"; + itp->name = "181-Tantalum"; + itp->isotope = true; + itp->M = 180.947996; + itp->nsf = 6.91; + pt_backup.push_back(itp); + } + // tungsten + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "W"; + atp->name = "Tungsten"; + atp->z = 74; + atp->M = 183.841; + atp->radius = 1.3705; + atp->xsf = 74.0; + atp->nsf = 4.75518; + // isotopes + // 180-tungsten + itp = new AtomType(*atp); + itp->symbol = "180-W"; + itp->name = "180-Tungsten"; + itp->isotope = true; + itp->M = 179.946706; + itp->nsf = 5.0; + pt_backup.push_back(itp); + // 182-tungsten + itp = new AtomType(*atp); + itp->symbol = "182-W"; + itp->name = "182-Tungsten"; + itp->isotope = true; + itp->M = 181.948206; + itp->nsf = 7.04; + pt_backup.push_back(itp); + // 183-tungsten + itp = new AtomType(*atp); + itp->symbol = "183-W"; + itp->name = "183-Tungsten"; + itp->isotope = true; + itp->M = 182.9502245; + itp->nsf = 6.59; + pt_backup.push_back(itp); + // 184-tungsten + itp = new AtomType(*atp); + itp->symbol = "184-W"; + itp->name = "184-Tungsten"; + itp->isotope = true; + itp->M = 183.9509326; + itp->nsf = 7.55; + pt_backup.push_back(itp); + // 186-tungsten + itp = new AtomType(*atp); + itp->symbol = "186-W"; + itp->name = "186-Tungsten"; + itp->isotope = true; + itp->M = 185.954362; + itp->nsf = -0.73; + pt_backup.push_back(itp); + } + // rhenium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Re"; + atp->name = "Rhenium"; + atp->z = 75; + atp->M = 186.2071; + atp->radius = 1.3800; + atp->xsf = 75.0; + atp->nsf = 9.22; + // isotopes + // 185-rhenium + itp = new AtomType(*atp); + itp->symbol = "185-Re"; + itp->name = "185-Rhenium"; + itp->isotope = true; + itp->M = 184.9529557; + itp->nsf = 9.0; + pt_backup.push_back(itp); + // 187-rhenium + itp = new AtomType(*atp); + itp->symbol = "187-Re"; + itp->name = "187-Rhenium"; + itp->isotope = true; + itp->M = 186.9557508; + itp->nsf = 9.3; + pt_backup.push_back(itp); + } + // osmium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Os"; + atp->name = "Osmium"; + atp->z = 76; + atp->M = 190.233; + atp->radius = 1.3676; + atp->xsf = 76.0; + atp->nsf = 10.72; + // isotopes + // 184-osmium + itp = new AtomType(*atp); + itp->symbol = "184-Os"; + itp->name = "184-Osmium"; + itp->isotope = true; + itp->M = 183.952491; + itp->nsf = 10.0; + pt_backup.push_back(itp); + // 186-osmium + itp = new AtomType(*atp); + itp->symbol = "186-Os"; + itp->name = "186-Osmium"; + itp->isotope = true; + itp->M = 185.953838; + itp->nsf = 12.0; + pt_backup.push_back(itp); + // 187-osmium + itp = new AtomType(*atp); + itp->symbol = "187-Os"; + itp->name = "187-Osmium"; + itp->isotope = true; + itp->M = 186.9557479; + itp->nsf = 10.0; + pt_backup.push_back(itp); + // 188-osmium + itp = new AtomType(*atp); + itp->symbol = "188-Os"; + itp->name = "188-Osmium"; + itp->isotope = true; + itp->M = 187.9558360; + itp->nsf = 7.8; + pt_backup.push_back(itp); + // 189-osmium + itp = new AtomType(*atp); + itp->symbol = "189-Os"; + itp->name = "189-Osmium"; + itp->isotope = true; + itp->M = 188.9581449; + itp->nsf = 11.0; + pt_backup.push_back(itp); + // 190-osmium + itp = new AtomType(*atp); + itp->symbol = "190-Os"; + itp->name = "190-Osmium"; + itp->isotope = true; + itp->M = 189.958445; + itp->nsf = 11.4; + pt_backup.push_back(itp); + // 192-osmium + itp = new AtomType(*atp); + itp->symbol = "192-Os"; + itp->name = "192-Osmium"; + itp->isotope = true; + itp->M = 191.961479; + itp->nsf = 11.9; + pt_backup.push_back(itp); + } + // iridium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ir"; + atp->name = "Iridium"; + atp->z = 77; + atp->M = 192.2173; + atp->radius = 1.3573; + atp->xsf = 77.0; + atp->nsf = 10.63; + } + // platinum + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Pt"; + atp->name = "Platinum"; + atp->z = 78; + atp->M = 195.0782; + atp->radius = 1.3873; + atp->xsf = 78.0; + atp->nsf = 9.601; + // isotopes + // 190-platinum + itp = new AtomType(*atp); + itp->symbol = "190-Pt"; + itp->name = "190-Platinum"; + itp->isotope = true; + itp->M = 189.959930; + itp->nsf = 9.0; + pt_backup.push_back(itp); + // 192-platinum + itp = new AtomType(*atp); + itp->symbol = "192-Pt"; + itp->name = "192-Platinum"; + itp->isotope = true; + itp->M = 191.961035; + itp->nsf = 9.9; + pt_backup.push_back(itp); + // 194-platinum + itp = new AtomType(*atp); + itp->symbol = "194-Pt"; + itp->name = "194-Platinum"; + itp->isotope = true; + itp->M = 193.962664; + itp->nsf = 10.55; + pt_backup.push_back(itp); + // 195-platinum + itp = new AtomType(*atp); + itp->symbol = "195-Pt"; + itp->name = "195-Platinum"; + itp->isotope = true; + itp->M = 194.964774; + itp->nsf = 8.91; + pt_backup.push_back(itp); + // 196-platinum + itp = new AtomType(*atp); + itp->symbol = "196-Pt"; + itp->name = "196-Platinum"; + itp->isotope = true; + itp->M = 195.964935; + itp->nsf = 9.89; + pt_backup.push_back(itp); + // 198-platinum + itp = new AtomType(*atp); + itp->symbol = "198-Pt"; + itp->name = "198-Platinum"; + itp->isotope = true; + itp->M = 197.967876; + itp->nsf = 7.8; + pt_backup.push_back(itp); + } + // gold + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Au"; + atp->name = "Gold"; + atp->z = 79; + atp->M = 196.966552; + atp->radius = 1.4419; + atp->xsf = 79.0; + atp->nsf = 7.907; + } + // mercury + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Hg"; + atp->name = "Mercury"; + atp->z = 80; + atp->M = 200.592; + atp->radius = 1.5025; + atp->xsf = 80.0; + atp->nsf = 12.59545; + // isotopes + // 196-mercury + itp = new AtomType(*atp); + itp->symbol = "196-Hg"; + itp->name = "196-Mercury"; + itp->isotope = true; + itp->M = 195.965815; + itp->nsf = 30.3; + pt_backup.push_back(itp); + // 199-mercury + itp = new AtomType(*atp); + itp->symbol = "199-Hg"; + itp->name = "199-Mercury"; + itp->isotope = true; + itp->M = 198.968262; + itp->nsf = 16.9; + pt_backup.push_back(itp); + // 202-mercury + itp = new AtomType(*atp); + itp->symbol = "202-Hg"; + itp->name = "202-Mercury"; + itp->isotope = true; + itp->M = 201.970626; + itp->nsf = 11.002; + pt_backup.push_back(itp); + } + // thallium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Tl"; + atp->name = "Thallium"; + atp->z = 81; + atp->M = 204.38332; + atp->radius = 1.7283; + atp->xsf = 81.0; + atp->nsf = 8.7765; + // isotopes + // 203-thalium + itp = new AtomType(*atp); + itp->symbol = "203-Tl"; + itp->name = "203-Thallium"; + itp->isotope = true; + itp->M = 202.972329; + itp->nsf = 8.51; + pt_backup.push_back(itp); + // 205-thalium + itp = new AtomType(*atp); + itp->symbol = "205-Tl"; + itp->name = "205-Thallium"; + itp->isotope = true; + itp->M = 204.974412; + itp->nsf = 8.87; + pt_backup.push_back(itp); + } + // lead + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Pb"; + atp->name = "Lead"; + atp->z = 82; + atp->M = 207.21; + atp->radius = 1.7501; + atp->xsf = 82.0; + atp->nsf = 9.4012; + // isotopes + // 204-lead + itp = new AtomType(*atp); + itp->symbol = "204-Pb"; + itp->name = "204-Lead"; + itp->isotope = true; + itp->M = 203.973029; + itp->nsf = 10.893; + pt_backup.push_back(itp); + // 206-lead + itp = new AtomType(*atp); + itp->symbol = "206-Pb"; + itp->name = "206-Lead"; + itp->isotope = true; + itp->M = 205.974449; + itp->nsf = 9.2221; + pt_backup.push_back(itp); + // 207-lead + itp = new AtomType(*atp); + itp->symbol = "207-Pb"; + itp->name = "207-Lead"; + itp->isotope = true; + itp->M = 206.975881; + itp->nsf = 9.286; + pt_backup.push_back(itp); + // 208-lead + itp = new AtomType(*atp); + itp->symbol = "208-Pb"; + itp->name = "208-Lead"; + itp->isotope = true; + itp->M = 207.976636; + itp->nsf = 9.494; + pt_backup.push_back(itp); + } + // bismuth + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Bi"; + atp->name = "Bismuth"; + atp->z = 83; + atp->M = 208.980382; + atp->radius = 1.4600; + atp->xsf = 83.0; + atp->nsf = 8.5322; + } + // polonium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Po"; + atp->name = "Polonium"; + atp->z = 84; + atp->M = 209.0; + atp->radius = 1.4600; + atp->xsf = 84.0; + atp->nsf = 0.0; + } + // astatine + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "At"; + atp->name = "Astatine"; + atp->z = 85; + atp->M = 210.0; + atp->radius = 1.4500; + atp->xsf = 85.0; + atp->nsf = 0.0; + } + // radon + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Rn"; + atp->name = "Radon"; + atp->z = 86; + atp->M = 222.0; + atp->radius = 1.4300; + atp->xsf = 86.0; + atp->nsf = 0.0; + } + // francium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Fr"; + atp->name = "Francium"; + atp->z = 87; + atp->M = 223.0; + atp->radius = 2.5000; + atp->xsf = 87.0; + atp->nsf = 0.0; + } + // radium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ra"; + atp->name = "Radium"; + atp->z = 88; + atp->M = 226.0; + atp->radius = 2.1400; + atp->xsf = 88.0; + atp->nsf = 10.0; + } + // actinium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ac"; + atp->name = "Actinium"; + atp->z = 89; + atp->M = 227.0; + atp->radius = 1.8775; + atp->xsf = 89.0; + atp->nsf = 0.0; + } + // thorium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Th"; + atp->name = "Thorium"; + atp->z = 90; + atp->M = 232.03811; + atp->radius = 1.7975; + atp->xsf = 90.0; + atp->nsf = 10.31; + } + // protactinium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Pa"; + atp->name = "Protactinium"; + atp->z = 91; + atp->M = 231.035882; + atp->radius = 1.6086; + atp->xsf = 91.0; + atp->nsf = 9.13; + } + // uranium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "U"; + atp->name = "Uranium"; + atp->z = 92; + atp->M = 238.028913; + atp->radius = 1.5683; + atp->xsf = 92.0; + atp->nsf = 8.417; + // isotopes + // 233-uranium + itp = new AtomType(*atp); + itp->symbol = "233-U"; + itp->name = "233-Uranium"; + itp->isotope = true; + itp->M = 233.039628; + itp->nsf = 10.1; + pt_backup.push_back(itp); + // 234-uranium + itp = new AtomType(*atp); + itp->symbol = "234-U"; + itp->name = "234-Uranium"; + itp->isotope = true; + itp->M = 234.0409456; + itp->nsf = 12.4; + pt_backup.push_back(itp); + // 235-uranium + itp = new AtomType(*atp); + itp->symbol = "235-U"; + itp->name = "235-Uranium"; + itp->isotope = true; + itp->M = 235.0439231; + itp->nsf = 10.50; + pt_backup.push_back(itp); + // 238-uranium + itp = new AtomType(*atp); + itp->symbol = "238-U"; + itp->name = "238-Uranium"; + itp->isotope = true; + itp->M = 238.0507826; + itp->nsf = 8.407; + pt_backup.push_back(itp); + } + // neptunium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Np"; + atp->name = "Neptunium"; + atp->z = 93; + atp->M = 237.0; + atp->radius = 1.0000; + atp->xsf = 93.0; + atp->nsf = 10.55; + } + // plutonium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Pu"; + atp->name = "Plutonium"; + atp->z = 94; + atp->M = 244.0; + atp->radius = 1.0000; + atp->xsf = 94.0; + atp->nsf = 7.71; + // isotopes + // 240-plutonium + itp = new AtomType(*atp); + itp->symbol = "240-Pu"; + itp->name = "240-Plutonium"; + itp->isotope = true; + itp->M = 240.0538075; + itp->nsf = 3.5; + pt_backup.push_back(itp); + // 242-plutonium + itp = new AtomType(*atp); + itp->symbol = "242-Pu"; + itp->name = "242-Plutonium"; + itp->isotope = true; + itp->M = 242.0587368; + itp->nsf = 8.1; + pt_backup.push_back(itp); + } + // americium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Am"; + atp->name = "Americium"; + atp->z = 95; + atp->M = 243.0; + atp->radius = 1.0000; + atp->xsf = 95.0; + atp->nsf = 8.32; + } + // curium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Cm"; + atp->name = "Curium"; + atp->z = 96; + atp->M = 247.0; + atp->radius = 1.0000; + atp->xsf = 96.0; + atp->nsf = 9.53; + // isotopes + // 246-curium + itp = new AtomType(*atp); + itp->symbol = "246-Cm"; + itp->name = "246-Curium"; + itp->isotope = true; + itp->M = 246.0672176; + itp->nsf = 9.3; + pt_backup.push_back(itp); + // 248-curium + itp = new AtomType(*atp); + itp->symbol = "248-Cm"; + itp->name = "248-Curium"; + itp->isotope = true; + itp->M = 248.072342; + itp->nsf = 7.7; + pt_backup.push_back(itp); + } + // berkelium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Bk"; + atp->name = "Berkelium"; + atp->z = 97; + atp->M = 247.0; + atp->radius = 1.0000; + atp->xsf = 97.0; + atp->nsf = 0.0; + } + // californium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Cf"; + atp->name = "Californium"; + atp->z = 98; + atp->M = 251.0; + atp->radius = 1.0000; + atp->xsf = 98.0; + atp->nsf = 0.0; + } + // einsteinium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Es"; + atp->name = "Einsteinium"; + atp->z = 99; + atp->M = 252.0; + atp->radius = 1.0000; + atp->xsf = 99.0; + atp->nsf = 0.0; + } + // fermium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Fm"; + atp->name = "Fermium"; + atp->z = 100; + atp->M = 257.0; + atp->radius = 1.0000; + atp->xsf = 100.0; + atp->nsf = 0.0; + } + // mendelevium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Md"; + atp->name = "Mendelevium"; + atp->z = 101; + atp->M = 258.0; + atp->radius = 1.0000; + atp->xsf = 101.0; + atp->nsf = 0.0; + } + // nobelium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "No"; + atp->name = "Nobelium"; + atp->z = 102; + atp->M = 259.0; + atp->radius = 1.0000; + atp->xsf = 102.0; + atp->nsf = 0.0; + } + // lawrencium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Lr"; + atp->name = "Lawrencium"; + atp->z = 103; + atp->M = 262.0; + atp->radius = 1.0000; + atp->xsf = 103.0; + atp->nsf = 0.0; + } + // rutherfordium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Rf"; + atp->name = "Rutherfordium"; + atp->z = 104; + atp->M = 261.0; + atp->radius = 1.0000; + atp->xsf = 104.0; + atp->nsf = 0.0; + } + // dubnium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Db"; + atp->name = "Dubnium"; + atp->z = 105; + atp->M = 262.0; + atp->radius = 1.0000; + atp->xsf = 105.0; + atp->nsf = 0.0; + } + // seaborgium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Sg"; + atp->name = "Seaborgium"; + atp->z = 106; + atp->M = 266.0; + atp->radius = 1.0000; + atp->xsf = 106.0; + atp->nsf = 0.0; + } + // bohrium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Bh"; + atp->name = "Bohrium"; + atp->z = 107; + atp->M = 264.0; + atp->radius = 1.0000; + atp->xsf = 107.0; + atp->nsf = 0.0; + } + // hassium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Hs"; + atp->name = "Hassium"; + atp->z = 108; + atp->M = 277.0; + atp->radius = 1.0000; + atp->xsf = 108.0; + atp->nsf = 0.0; + } + // meitnerium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Mt"; + atp->name = "Meitnerium"; + atp->z = 109; + atp->M = 268.0; + atp->radius = 1.0000; + atp->xsf = 109.0; + atp->nsf = 0.0; + } + // darmstadtium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Ds"; + atp->name = "Darmstadtium"; + atp->z = 110; + atp->M = 281.0; + atp->radius = 1.0000; + atp->xsf = 110.0; + atp->nsf = 0.0; + } + // roentgenium + atp = *pt_backup.insert(pt_backup.end(), new AtomType()); + { + atp->symbol = "Rg"; + atp->name = "Roentgenium"; + atp->z = 111; + atp->M = 272.0; + atp->radius = 1.0000; + atp->xsf = 111.0; + atp->nsf = 0.0; + } +} + +// End of file diff --git a/src/extensions/libpdffit2/PeriodicTable.h b/src/extensions/libpdffit2/PeriodicTable.h new file mode 100644 index 00000000..99949031 --- /dev/null +++ b/src/extensions/libpdffit2/PeriodicTable.h @@ -0,0 +1,75 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* class PeriodicTable +* +* Comments: singleton class, use PeriodicTable::instance() +* for its pointer +* +***********************************************************************/ + +#ifndef PERIODICTABLE_H_INCLUDED +#define PERIODICTABLE_H_INCLUDED + +#include +#include +#include +#include +#include "AtomType.h" +#include "support_msvc9.h" + +// PeriodicTable +class PeriodicTable +{ + private: + + // PeriodicTable is a singleton class + PeriodicTable(); + + public: + + // Access to singleton instance + static PeriodicTable* instance() + { + static std::unique_ptr the_table(new PeriodicTable()); + return the_table.get(); + } + // Destructor + ~PeriodicTable(); + + // Methods + AtomType* name(const std::string& s); + AtomType* symbol(const std::string& s); + AtomType* lookup(std::string s); // icase lookup + bool has(const std::string& s); + void defAtomType(const AtomType& atp); + void deleteAtomType(const AtomType* atp); + void reset(AtomType* atp); // retrieve atp from pt_backup + void resetAll(); // reset all elements + + private: + + // Data Members + std::map name_index; + std::map symbol_index; + std::deque pt_public; + std::deque pt_backup; + + // Methods + void init(); + void clear(); + void fill_pt_backup(); +}; + +#endif // PERIODICTABLE_H_INCLUDED diff --git a/src/extensions/libpdffit2/PointsInSphere.cc b/src/extensions/libpdffit2/PointsInSphere.cc new file mode 100644 index 00000000..8e51c575 --- /dev/null +++ b/src/extensions/libpdffit2/PointsInSphere.cc @@ -0,0 +1,243 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* classes PointsInSphere, ReflectionsInQminQmax, ReflectionsInDmaxDmin +* +* Comments: sequencers for lattice points insided 3D sphere +* +***********************************************************************/ + +#include +#include "PointsInSphere.h" + +using namespace NS_POINTSINSPHERE; + +//////////////////////////////////////////////////////////////////////// +// LatticeParameters +//////////////////////////////////////////////////////////////////////// + +LatticeParameters::LatticeParameters( double _a, double _b, double _c, + double _alpha, double _beta, double _gamma ) : + a(_a), b(_b), c(_c), + alpha(_alpha), beta(_beta), gamma(_gamma) +{ + update(); +} + +LatticeParameters& LatticeParameters::update() +{ + ca = cosd(alpha); cb = cosd(beta); cg = cosd(gamma); + sa = sind(alpha); sb = sind(beta); sg = sind(gamma); + // Vunit is a volume of unit cell with a=b=c=1 + const double Vunit = sqrt(1.0 + 2.0*ca*cb*cg - ca*ca - cb*cb - cg*cg); + ar = sa/(a*Vunit); + br = sb/(b*Vunit); + cr = sg/(c*Vunit); + car = (cb*cg - ca)/(sb*sg); sar = sqrt(1.0 - car*car); + cbr = (ca*cg - cb)/(sa*sg); sbr = sqrt(1.0 - cbr*cbr); + cgr = (ca*cb - cg)/(sa*sb); sgr = sqrt(1.0 - cgr*cgr); + alphar = 180.0/M_PI*acos(car); + betar = 180.0/M_PI*acos(cbr); + gammar = 180.0/M_PI*acos(cgr); + return *this; +} + +LatticeParameters LatticeParameters::reciprocal() const +{ + using namespace std; + LatticeParameters rec(*this); + swap(rec.a, rec.ar); + swap(rec.b, rec.br); + swap(rec.c, rec.cr); + swap(rec.alpha, rec.alphar); + swap(rec.beta, rec.betar); + swap(rec.gamma, rec.gammar); + swap(rec.ca, rec.car); + swap(rec.cb, rec.cbr); + swap(rec.cg, rec.cgr); + swap(rec.sa, rec.sar); + swap(rec.sb, rec.sbr); + swap(rec.sg, rec.sgr); + return rec; +} + + +//////////////////////////////////////////////////////////////////////// +// PointsInSphere +//////////////////////////////////////////////////////////////////////// + +PointsInSphere::PointsInSphere( double _Rmin, double _Rmax, + const LatticeParameters& _latpar ) : + m(mno[0]), n(mno[1]), o(mno[2]), + Rmin(_Rmin), Rmax(_Rmax), latpar(_latpar) +{ + init(); + rewind(); +} + +PointsInSphere::PointsInSphere( double _Rmin, double _Rmax, + double _a, double _b, double _c, + double _alpha, double _beta, double _gamma ) : + m(mno[0]), n(mno[1]), o(mno[2]), + Rmin(_Rmin), Rmax(_Rmax), + latpar(_a, _b, _c, _alpha, _beta, _gamma) +{ + init(); + rewind(); +} + +void PointsInSphere::init() +{ + RminSquare = (Rmin < 0.0) ? -(Rmin*Rmin) : Rmin*Rmin; + RmaxSquare = (Rmax < 0.0) ? -(Rmax*Rmax) : Rmax*Rmax; + dn0dm = latpar.cgr*latpar.br/latpar.ar; + do0dm = latpar.cbr*latpar.cr/latpar.ar; + // 2D reciprocal parameters in bc plane + b2r = 1.0/(latpar.b*latpar.sa); + c2r = 1.0/(latpar.c*latpar.sa); + ca2r = -latpar.ca; + do0dn = ca2r*c2r/b2r; + // 1D reciprocal along c axis + c1r = 1.0/latpar.c; +} + +void PointsInSphere::rewind() +{ + mHalfSpan = Rmax*latpar.ar; + hi_m = int(ceil(mHalfSpan)); + m = -hi_m; + // make indices n, o invalid, reset the neares point + n = hi_n = 0; + o = hi_o = outside_o = 0; + n0plane = o0plane = o0line = 0.0; + // unset excluded zone + oExclHalfSpan = 0.0; + // get the first inside point + next_o(); +} + +void PointsInSphere::next_o() +{ + do + { + o++; + if (o < hi_o) + { + return; + } + if (hi_o != outside_o) + { + hi_o = outside_o; + o = int( ceil(o0line+oExclHalfSpan) ) - 1; + continue; + } + next_n(); + } + while (!finished()); +} + +void PointsInSphere::next_n() +{ + do + { + n++; + if (n < hi_n) + { + o0line = o0plane + (n-n0plane)*do0dn; + double RlineSquare = RplaneSquare - pow((n-n0plane)/b2r,2); + oHalfSpan = RlineSquare > 0.0 ? sqrt(RlineSquare)*c1r : 0.0; + // parentheses improve round-off errors around [0,0,0] + double RExclSquare = RminSquare + (RlineSquare - RmaxSquare); + oExclHalfSpan = RExclSquare > 0.0 ? sqrt(RExclSquare)*c1r : 0.0; + o = int(floor(o0line - oHalfSpan)); + outside_o = int(ceil(o0line + oHalfSpan)); + hi_o = outside_o; + if (oExclHalfSpan) + { + int hole_o = int(ceil(o0line - oExclHalfSpan)); + if (fabs(hole_o-o0line) < oExclHalfSpan) hi_o = hole_o; + } + return; + } + next_m(); + } + while (!finished()); +} + +void PointsInSphere::next_m() +{ + m++; + if (finished()) + { + return; + } + // not finished here + n0plane = m*dn0dm; + o0plane = m*do0dm; + RplaneSquare = RmaxSquare - pow(m/latpar.ar,2); + nHalfSpan = RplaneSquare > 0.0 ? sqrt(RplaneSquare)*b2r : 0.0; + n = int(floor(n0plane - nHalfSpan)); + hi_n = int(ceil(n0plane + nHalfSpan)); +} + +double PointsInSphere::r() const +{ + const double &a = latpar.a, &b = latpar.b, &c = latpar.c; + const double &ca = latpar.ca, &cb = latpar.cb, &cg = latpar.cg; + return sqrt( m*m*a*a + n*n*b*b + o*o*c*c + + 2*m*n*a*b*cg + 2*m*o*a*c*cb + 2*n*o*b*c*ca ); +} + + +//////////////////////////////////////////////////////////////////////// +// ReflectionsInQminQmax +//////////////////////////////////////////////////////////////////////// + +ReflectionsInQminQmax::ReflectionsInQminQmax( double _Qmin, double _Qmax, + const LatticeParameters& _latpar ) : + Qmin(_Qmin), Qmax(_Qmax), + latpar(_latpar), + sph(Qmin*M_1_PI/2.0, Qmax*M_1_PI/2.0, latpar.reciprocal()), + hkl(sph.mno), h(hkl[0]), k(hkl[1]), l(hkl[2]) +{ } + +ReflectionsInQminQmax::ReflectionsInQminQmax( double _Qmin, double _Qmax, + double _a, double _b, double _c, + double _alpha, double _beta, double _gamma ) : + Qmin(_Qmin), Qmax(_Qmax), + latpar(_a, _b, _c, _alpha, _beta, _gamma), + sph(Qmin*M_1_PI/2.0, Qmax*M_1_PI/2.0, latpar.reciprocal()), + hkl(sph.mno), h(hkl[0]), k(hkl[1]), l(hkl[2]) +{ } + + +//////////////////////////////////////////////////////////////////////// +// ReflectionsInDmaxDmin +//////////////////////////////////////////////////////////////////////// + +ReflectionsInDmaxDmin::ReflectionsInDmaxDmin( double _Dmax, double _Dmin, + const LatticeParameters& _latpar ) : + ReflectionsInQminQmax(2.0*M_PI/_Dmax, 2.0*M_PI/_Dmin, _latpar), + Dmax(_Dmax), Dmin(_Dmin) +{ } + +ReflectionsInDmaxDmin::ReflectionsInDmaxDmin( double _Dmax, double _Dmin, + double _a, double _b, double _c, + double _alpha, double _beta, double _gamma ) : + ReflectionsInQminQmax( 2.0*M_PI/_Dmax, 2.0*M_PI/_Dmin, + _a, _b, _c, _alpha, _beta, _gamma ), + Dmax(_Dmax), Dmin(_Dmin) +{ } + +// End of file diff --git a/src/extensions/libpdffit2/PointsInSphere.h b/src/extensions/libpdffit2/PointsInSphere.h new file mode 100644 index 00000000..2c3b5d45 --- /dev/null +++ b/src/extensions/libpdffit2/PointsInSphere.h @@ -0,0 +1,182 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* classes PointsInSphere, ReflectionsInQminQmax, ReflectionsInDmaxDmin +* +* Constructors: +* +* PointsInSphere(Rmin, Rmax, a, b, c, alpha, beta, gamma) +* ReflectionsInQminQmax(Qmin, Qmax, a, b, c, alpha, beta, gamma) +* ReflectionsInDmaxDmin(Dmax, Dmin, a, b, c, alpha, beta, gamma) +* +* Examples: +* +* PointsInSphere sph(Rmin, Rmax, a, b, c, alpha, beta, gamma) +* for (sph.rewind(); !sph.finished(); sph.next()) +* { +* // lattice indices are in sph.m, sph.n, sph.o or sph.mno[3] +* // sph.r() is distance from origin, +* // where Rmin < sph.r() < Rmax +* } +* +* ReflectionsInQminQmax refl(Qmin, Qmax, a, b, c, alpha, beta, gamma) +* for (ReflectionsInQminQmax ref(Qmin, Qmax, a, b, c, alpha, beta, gamma); +* !ref.finished(); ref.next() ) +* { +* // Miller indices are in ref.h, ref.k, ref.l or ref.hkl[3] +* // ref.Q() is magnitude of Q vector +* // ref.d() is lattice plane spacing +* } +* +* Tip: add epsilon to Rmax to avoid roundoff issues +* +***********************************************************************/ + +#ifndef POINTSINSPHERE_H_INCLUDED +#define POINTSINSPHERE_H_INCLUDED + +#include + + +namespace NS_POINTSINSPHERE { + +class LatticeParameters +{ +public: + LatticeParameters( double _a, double _b, double _c, + double _alpha, double _beta, double _gamma ); + // calculate all properties from current lattice parameters + LatticeParameters& update(); + // return a reciprocal of this lattice + LatticeParameters reciprocal() const; + // input arguments + double a, b, c, alpha, beta, gamma; + // cosines and sines of direct lattice angles + double ca, cb, cg, sa, sb, sg; + // reciprocal lattice and its cosines and sines + double ar, br, cr, alphar, betar, gammar; + double car, cbr, cgr, sar, sbr, sgr; +private: + // helper functions + inline double cosd(double x) { return cos(M_PI/180.0*x); } + inline double sind(double x) { return sin(M_PI/180.0*x); } +}; + +class PointsInSphere +{ +public: + PointsInSphere( double _Rmin, double _Rmax, + const LatticeParameters& _latpar ); + PointsInSphere( double _Rmin, double _Rmax, + double _a, double _b, double _c, + double _alpha, double _beta, double _gamma ); + void rewind(); + inline void next() + { + next_o(); + } + inline bool finished() + { + return !(m < hi_m); + } + // mno array and m, n, o aliases are supposed to be read only + int mno[3]; + int &m, &n, &o; + double r() const; + // input arguments + const double Rmin, Rmax; + const LatticeParameters latpar; +private: + // loop advance functions + void next_m(); + void next_n(); + void next_o(); + void init(); + // calculated constants set by init() + double RminSquare, RmaxSquare; + // 2D reciprocal parameters and cosine in bc plane + double b2r, c2r, ca2r; + // reciprocal c + double c1r; + // offset of the nearest point to [0,0,0] + double dn0dm, do0dm, do0dn; + // loop variables + double n0plane, o0plane, o0line; + double mHalfSpan, nHalfSpan, oHalfSpan; + // o indices excluded due to Rmin + double oExclHalfSpan; + int hi_m, hi_n, hi_o, outside_o; + double RplaneSquare; +}; + +class ReflectionsInQminQmax +{ +public: + ReflectionsInQminQmax( double _Qmin, double _Qmax, + const LatticeParameters& _latpar ); + ReflectionsInQminQmax( double _Qmin, double _Qmax, + double _a, double _b, double _c, + double _alpha, double _beta, double _gamma ); + inline void rewind() + { + sph.rewind(); + } + inline void next() + { + sph.next(); + } + inline bool finished() + { + return sph.finished(); + } + // input arguments + const double Qmin, Qmax; + const LatticeParameters latpar; +private: + // sph must be initialized before hkl and h, k, l + PointsInSphere sph; +public: + // hkl array and h, k, l aliases are supposed to be read only + int *hkl; + int &h, &k, &l; + inline double Q() const + { + return 2.0*M_PI*sph.r(); + } + inline double d() const + { + return 1.0/sph.r(); + } +}; + +class ReflectionsInDmaxDmin : ReflectionsInQminQmax +{ +public: + ReflectionsInDmaxDmin( double _Dmax, double _Dmin, + const LatticeParameters& _latpar ); + ReflectionsInDmaxDmin( double _Dmax, double _Dmin, + double _a, double _b, double _c, + double _alpha, double _beta, double _gamma ); + // input arguments + const double Dmax, Dmin; +}; + + +} // namespace NS_POINTSINSPHERE + +using NS_POINTSINSPHERE::PointsInSphere; +using NS_POINTSINSPHERE::ReflectionsInQminQmax; +using NS_POINTSINSPHERE::ReflectionsInDmaxDmin; + +#endif // POINTSINSPHERE_H_INCLUDED diff --git a/src/extensions/libpdffit2/ShapeFactors.h b/src/extensions/libpdffit2/ShapeFactors.h new file mode 100644 index 00000000..031efe66 --- /dev/null +++ b/src/extensions/libpdffit2/ShapeFactors.h @@ -0,0 +1,43 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2007 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* PDF corrections due to particle shape. +* +* Comments: +* PDF correction for spherical particles obtained from +* R.C. Howell et al, Phys. Rev. B 73, 094107 (2006) +* http://link.aps.org/abstract/PRB/v73/e094107 +* +***********************************************************************/ + +#ifndef SHAPEFACTORS_H_INCLUDED +#define SHAPEFACTORS_H_INCLUDED + +#include + +// envelope function for spherical nanoparticle with diameter d +inline double sphereEnvelope(double r, double d) +{ + double rdratio = r/d; + return (rdratio < 1.0) ? (1.0 - 1.5*rdratio + 0.5*pow(rdratio, 3)) : 0.0; +} + +// derivative of sphereEnvelope by diameter d +inline double dsphereEnvelope(double r, double d) +{ + double rdratio = r/d; + return (rdratio < 1.0) ? (1.5*rdratio/d - 1.5*pow(rdratio, 3)/d) : 0.0; +} + +#endif // SHAPEFACTORS_H_INCLUDED diff --git a/src/extensions/libpdffit2/StringUtils.cc b/src/extensions/libpdffit2/StringUtils.cc new file mode 100644 index 00000000..73fc04da --- /dev/null +++ b/src/extensions/libpdffit2/StringUtils.cc @@ -0,0 +1,58 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch, Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Utilities for string formatting. +* +***********************************************************************/ + +#include +#include + +#include "StringUtils.h" +#include "MathUtils.h" + +using namespace std; + +// return an uppercase copy of string s +string toupper(string s) +{ + for (string::iterator ii = s.begin(); ii != s.end(); ++ii) + { + *ii = toupper(*ii); + } + return s; +} + +// class FormatValueWithStd +string FormatValueWithStd::operator() (double x, double dx) +{ + ostringstream out(f_leading_blank ? " " : "", ios_base::app); + out << x << setprecision(f_std_precision); + // do not write dx when it is too small + if (dx > fabs(x)*1e-8) out << " (" << dx << ')'; + else if (std::isnan(dx)) out << " (NaN)"; + // left-pad string to the width + string rv = out.str(); + int rvlen = rv.size(); + // pad or prepend blanks as necessary + if (rvlen < f_width) + { + size_t nblanks = f_width - rvlen; + if (f_left) rv.append(nblanks, ' '); + else rv.insert(0, nblanks, ' '); + } + return rv; +} + +// End of file diff --git a/src/extensions/libpdffit2/StringUtils.h b/src/extensions/libpdffit2/StringUtils.h new file mode 100644 index 00000000..edb74a96 --- /dev/null +++ b/src/extensions/libpdffit2/StringUtils.h @@ -0,0 +1,71 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Utilities for string formatting. +* +***********************************************************************/ + +#ifndef STRINGUTILS_H_INCLUDED +#define STRINGUTILS_H_INCLUDED + +#include + +std::string toupper(std::string s); + +class FormatValueWithStd +{ + private: + + // Data members + int f_width; + bool f_left; + bool f_leading_blank; + int f_std_precision; + + public: + + // Constructor: + FormatValueWithStd() + { + f_width = 0; + f_left = false; + f_leading_blank = false; + f_std_precision = 2; + } + + // Methods: + std::string operator() (double x, double dx); + inline FormatValueWithStd& width(int w) + { + f_width = w; + return *this; + } + inline FormatValueWithStd& left() + { + f_left = true; + return *this; + } + inline FormatValueWithStd& right() + { + f_left = false; + return *this; + } + inline FormatValueWithStd& leading_blank(bool flag) + { + f_leading_blank = flag; + return *this; + } +}; + +#endif // STRINGUTILS_H_INCLUDED diff --git a/src/extensions/libpdffit2/exceptions.h b/src/extensions/libpdffit2/exceptions.h new file mode 100644 index 00000000..738ce1a6 --- /dev/null +++ b/src/extensions/libpdffit2/exceptions.h @@ -0,0 +1,95 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Chris Farrow, Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Exceptions used in pdffit2. +* +* Comments: +* +***********************************************************************/ + +#ifndef EXCEPTIONS_H_INCLUDED +#define EXCEPTIONS_H_INCLUDED + +#include +#include + +class Exception +{ + private: + std::string msg; + public: + Exception(std::string _msg) : msg(_msg) {} + std::string GetMsg() + { + return msg; + } +}; + +//specific exceptions - mimic python names +class ValueError : public Exception +{ + public: + ValueError(std::string _msg) : Exception(_msg) {} +}; + +class unassignedError : public Exception +{ + public: + unassignedError(std::string _msg) : Exception(_msg) {} +}; + +class IOError : public Exception +{ + public: + IOError(std::string _msg) : Exception(_msg) {} +}; + +class dataError : public Exception +{ + public: + dataError(std::string _msg) : Exception(_msg) {} +}; + +class structureError : public Exception +{ + public: + structureError(std::string _msg) : Exception(_msg) {} +}; + +class constraintError : public Exception +{ + public: + constraintError(std::string _msg) : Exception(_msg) {} +}; + +class calculationError : public Exception +{ + public: + calculationError(std::string _msg) : Exception(_msg) {} +}; + +class parseError : public Exception +{ + public: + parseError(std::string _msg) : Exception(_msg) {} +}; + +//This one is used internally, and should not make it to the python layer. +class vgetException : public Exception +{ + public: + vgetException(std::string _msg) : Exception(_msg) {} +}; + +#endif // EXCEPTIONS_H_INCLUDED diff --git a/src/extensions/libpdffit2/fit.cc b/src/extensions/libpdffit2/fit.cc new file mode 100644 index 00000000..4426aa29 --- /dev/null +++ b/src/extensions/libpdffit2/fit.cc @@ -0,0 +1,836 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch, Chris Farrow +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Mixed definitions of several DataSet, Fit and PdfFit methods +* +* Comments: Up to date with 1.3.10 Fortran version. +* What a spagetti. +* +***********************************************************************/ + +#include +#include +#include +#include +#include + +#include "MathUtils.h" +#include "ShapeFactors.h" +#include "pdffit.h" + +using NS_PDFFIT2::pout; + +/************************* + Main fit routine +**************************/ +// Command called in Fortran +// Now called + +int PdfFit::refine(bool deriv, double toler) { + int finished = 0; + while( !finished ) + { + finished = refine_step(deriv, toler); + } + return 1; +} + + +// CLF Wed May 25 2005 +// Added one-step refinement so that the progress can be checked after each +// refinement step. Many parameters made into public data members of Fit. This +// function is for use in higher level refinement routines. +int PdfFit::refine_step(bool deriv, double toler) +{ + static bool fit_running = false; + const int NSTAG = 3, MINITER = 3, MAXITER = 100; + + fit_running = fit_running && (fit.iter != 0); + // If fit_running flag is down, this is the first iteration. + // If so, then set up the fit. + if(!fit_running) + { + fit.iter = 0; + fit.alambda = -1; + fit.stagnating = 0; + fit.chisq = double_max; + fit_running = true; + + *pout << + "*******************\n" << + "Starting refinement\n" << + "*******************\n"; + + for (int is=0; isiset << " Phase: "; + for (unsigned int ip=0; ippsel.size(); ip++) + if (datasets[is]->psel[ip]) *pout << phase[ip]->iphase << " "; + *pout << endl; + + } + + fit_setup(); + } + + + //------ Here starts the fitting + + // setting the offset for all refinable variables + + if( (fit.iter order = this->order_by_id(); + vector::iterator i; + int j; + for (i = order.begin(), j = 0; i != order.end(); ++i) + { + if (ip[*i]) + { + *pout << setw(4) << id[*i] << ": " << setw(9) << fixed << p[*i]; + j++; + if (j % 4) *pout << " "; + else *pout << endl; + } + } + if (j % 4) *pout << endl; + *pout << endl; + (*pout).unsetf(ios_base::fixed); +} + +/********************************************************** + Setting the offset for all refinable variables +**********************************************************/ +void PdfFit::fit_setup() +{ + // initialize the array with the addresses of refinable variable + // and initialize the offset pointers to be used in derivative routines + // also makes a vector containing the address of the error of each + // refinable variable + //int ip, ia, is, j; + int j; + + // First we make an initial fill of all constrained equations + // to detect missing parameters but mainly to detect the fixed constraints, + // i.e. constraints without parameters or with only fixed parameters + + fit.fill_variables(); + + // for each refinable variable detect the corresponding constraint + + fit.refvar.clear(); + fit.sdptr.clear(); + + for (int ip=0; ipphase[ip]; + + phase.offset = fit.refvar.size(); + + for (j=0;j<3;j++) + { + fit.refvar.push_back(fit.vfind(phase.a0[j])); + fit.sdptr.push_back(&phase.da0[j]); + } + for (j=0;j<3;j++) + { + fit.refvar.push_back(fit.vfind(phase.win[j])); + fit.sdptr.push_back(&phase.dwin[j]); + + } + fit.refvar.push_back(fit.vfind(phase.delta2)); + fit.sdptr.push_back(&phase.ddelta2); + + fit.refvar.push_back(fit.vfind(phase.delta1)); + fit.sdptr.push_back(&phase.ddelta1); + + fit.refvar.push_back(fit.vfind(phase.pscale)); + fit.sdptr.push_back(&phase.dpscale); + + fit.refvar.push_back(fit.vfind(phase.spdiameter)); + fit.sdptr.push_back(&phase.dspdiameter); + + fit.refvar.push_back(fit.vfind(phase.sratio)); + fit.sdptr.push_back(&phase.dsratio); + + for (int ia=0; iadatasets[is]; + + ds.offset = fit.refvar.size(); + + fit.refvar.push_back(fit.vfind(ds.dscale)); + fit.sdptr.push_back(&ds.ddscale); + + fit.refvar.push_back(fit.vfind(ds.qdamp)); + fit.sdptr.push_back(&ds.dqdamp); + + fit.refvar.push_back(fit.vfind(ds.qbroad)); + fit.sdptr.push_back(&ds.dqbroad); + } + + // maximum number of refinable variables + int maxvar = fit.refvar.size(); + + // fill the vector pointing from available refinable variables to + // actual constrained variables + + if (maxvar != getnpar() ) + { + throw constraintError("Parameter set but not constrained."); + } + + fit.ndof = 0; + + for (int i=0; idatasets.empty()) + { + throw unassignedError("Space for calculation must be alloc'ed first"); + } + fit_theory(false, true); + *pout << "\n================================== DONE =================================\n"; + return; +} + +/*********************************************************** + Here we calculate PDF and derivatives during LS fit + (previously known as fit_theory) +************************************************************/ +void PdfFit::fit_theory(bool ldiff, bool lout) +{ + int is, ip, ia, i; + + +// ------ First we compute all constrained equations and the PDF + + fit.fill_variables(); + + // reposition atoms in the elementary unit cells + // Check if this is the correct wayto do things + for (ip=0; ipnatoms; ia++) + { + for(i=0; i<3; i++) + { + phase[ip]->atom[ia].pos[i] = fmod(phase[ip]->atom[ia].pos[i], phase[ip]->icc[i]); + } + } + } + + for (ip=0; iplattice(); + + // determine pdf for each dataset + fit.ntot = 0; + fit.wnorm = 0.0; + + for (is=0; isdatasets[is]; + + ds.determine(ldiff, lout, fit); + + // compute variables for reduced chi-squared and Rw + fit.ntot += ds.nfmax - ds.nfmin + 1; + fit.wnorm += ds.weighedSquareObs(); + } +} + + +double PdfFit::totalWeighedSquareObs() const +{ + return fit.wnorm; +} + + +int PdfFit::totalReducedObservations() const +{ + return fit.ntot - fit.ndof; +} + + +/*********************************************************************** + This routine sets up the matrix A with the derivatives d(PDF)/dx +************************************************************************/ + +void DataSet::fit_setup_derivatives(Fit &fit) +{ + int i, j, ia, ipar, offset; + unsigned int ip; + double fac, facs, facp, ddrho; + double r, bk; + fac = facs = facp = ddrho = r = bk = 0; + + DataSet& ds = *this; + + //------ Loop over all data points + + for (i = ds.ncmin; i <= ds.ncmax; i++) + { + // --- Some common variables + + r = i*ds.deltar + ds.rmin; + + // background envelope due to Q resolution + bk = (ds.qdamp > 0.0) ? exp(-sqr(r*ds.qdamp)/2.0) : 1.0; + + + //------ ---------------------------------------------------------------- + //------ Derivatives per atom : x,y,z,u,o + //------ ---------------------------------------------------------------- + + for (ip=0; ip 0.0 && r > phase.stepcut) + { + shape_env = 0.0; + } + + facp = phase.pscale * shape_env * ds.dscale * bk; + facs = 1.0 / (phase.np*r); + fac = facs*facp; + + for (ia=0; ia, so every contribution to + // the pdf contributes to the derivatives + ds.fit_a[i][ipar] += phase.pscale * ds.dscale * + (1.0 - 2.0 * atom.weight) / phase.np * + (calc[i][ip] + + 4.0*M_PI * r * phase.rho0 * phase.dnorm * bk * shape_env); + } + } + + //------ ---------------------------------------------------------------- + //------ Derivatives per phase : lat, delta2, pscale, spdiameter, sratio + //------ ---------------------------------------------------------------- + + // ----- ----- d/d(lat[j] for j=1,2,3) + + offset = phase.offset; + + for (j=0;j<3;j++) + { + if ( (ipar=fit.refvar[offset++]) != -1) + ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + + 4.0*M_PI*r*phase.dnorm*phase.rho0/phase.a0[j]); + } + + // ----- ----- d/d(lat[4]) + + if ( (ipar=fit.refvar[offset++]) != -1) + { + ddrho = sqr(phase.a0[0]*phase.a0[1]*phase.a0[2]/phase.v)* + rad*phase.sina*(phase.cosa - phase.cosb*phase.cosg); + ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + + 4.0*M_PI*r*phase.dnorm*phase.rho0*ddrho); + } + + // ----- ----- d/d(lat[5]) + + if ( (ipar=fit.refvar[offset++]) != -1) + { + ddrho = sqr(phase.a0[0]*phase.a0[1]*phase.a0[2]/phase.v)* + rad*phase.sinb*(phase.cosb - phase.cosa*phase.cosg); + ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + + 4.0*M_PI*r*phase.dnorm*phase.rho0*ddrho); + } + + // ----- ----- d/d(lat[6]) + + if ( (ipar=fit.refvar[offset++]) != -1) + { + ddrho = sqr(phase.a0[0]*phase.a0[1]*phase.a0[2]/phase.v)* + rad*phase.sing*(phase.cosg - phase.cosa*phase.cosb); + ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + + 4.0*M_PI*r*phase.dnorm*phase.rho0*ddrho); + } + + // ----- ----- d/d(delta2[ip]) + + if ( (ipar=fit.refvar[offset++]) != -1) + ds.fit_a[i][ipar] *= fac; + + + // ----- ----- d/d(delta1[ip]) + + if ( (ipar=fit.refvar[offset++]) != -1) + ds.fit_a[i][ipar] *= fac; + + //----- ----- d/d(pscale[ip]) + + if ( (ipar=fit.refvar[offset++]) != -1) + ds.fit_a[i][ipar] = ds.calc[i][ip] * ds.dscale; + + // ----- --- d/d(spdiameter) + if ( (ipar=fit.refvar[offset++]) != -1) + { + ds.fit_a[i][ipar] = (phase.spdiameter <= 0.0) ? 0.0 : + ds.calc[i][ip] * ds.dscale * phase.pscale * + dsphereEnvelope(r, phase.spdiameter) / + ((shape_env > 0.0) ? shape_env : 1.0); + } + + // ----- ----- d/d(sratio[ip]) + + if ( (ipar=fit.refvar[offset++]) != -1) + ds.fit_a[i][ipar] *= fac; + } + + //------ ---------------------------------------------------------------- + //------ Derivatives per dataset : dscale, qdamp, qbroad + //------ ---------------------------------------------------------------- + + offset = ds.offset; + + // ----- --- d/d(dscale[is]) + + if ( (ipar=fit.refvar[offset++]) != -1) + ds.fit_a[i][ipar] = ds.pdftot[i] / ds.dscale; + + // ----- --- d/d(qdamp[is]) + + if ( (ipar=fit.refvar[offset++]) != -1) + { + if (ds.qdamp > 0.0) + ds.fit_a[i][ipar] = -r*r * ds.qdamp * ds.pdftot[i]; + else + ds.fit_a[i][ipar] = 0; + } + + // ----- --- d/d(qbroad[ip]) + + if ( (ipar=fit.refvar[offset++]) != -1) + ds.fit_a[i][ipar] *= fac; + + } + +//------ Finally we need to apply Qmax cutoff on the derivatives + + if (ds.qmax > 0.0) + { + int nclen = ds.ncmax + 1 - ds.ncmin; + // matrix column is not a continuous data block, a copy is required + valarray col_ip_array(nclen); + double* col_ip = &(col_ip_array[0]); + for(ip=0; ip::iterator apos; + apos = find(var.begin(), var.end(), &a); + if (apos == var.end()) return -1; + // variable is found here, now check if it is refinable + int idx = apos - var.begin(); + return vref[idx] ? idx : -1; +} + + +void Fit::constrain(double &a, string inpform, fcon f, int ipar, FCON type) +{ + int ivar; + if ( (ivar=vfind(a)) != -1) + { + form[ivar] = inpform; + fconstraint[ivar] = f; + idef[ivar] = ipar; + ctype[ivar] = type; + vref[ivar] = true; + *pout << "Warning: replacing existing constraint\n\n"; + } + else + { + var.push_back(&a); + form.push_back(inpform); + fconstraint.push_back(f); + idef.push_back(ipar); + ctype.push_back(type); + vref.push_back(true); + } +} + + +void Fit::constrain(double &a, string inpform) +{ + constrain(a, inpform, NULL, -1, USER); +} + +void Fit::constrain(double &a, fcon f ) +{ + constrain(a, string(), f, -1, USER); +} + +// if a # is passed instead of a function, then the default function will be used +// which is just var = p[ipar] +void Fit::constrain(double &a, int ipar) +{ + constrain(a, ipar, IDENT); +} + +// if a # and the FCOMP-type are passed instead of a function, then the +// complement function will be used: +// which is just var = 1-p[ipar] +void Fit::constrain(double &a, int ipar, FCON type) +{ + if ( (type == IDENT) || (type == FCOMP) || (type == FSQR) ) + constrain(a, string(), NULL, ipar, type); + else + throw constraintError("Unknown constraint"); +} + +void Fit::fill_variables() +{ + dvdp.resize(var.size(),p.size()); + + for (unsigned int i=0; i dnumdp; + + *var[i] = parse(form[i],dnumdp); + + // store numerical derivatives + for(unsigned int iu=0; iuip[ip]; + + // calculate derivative wrt to p[ip] if parameter is free + if (this->ip[ip]) + { + dvdp[i][ip] = dnumdp[iu]; + } + } + } + else if (f) + { + //try + //{ + vector dvdp_i(dvdp.rowVector(i)); + *var[i] = f(p, dvdp_i); + copy(dvdp_i.begin(), dvdp_i.end(), dvdp[i]); + for(int ipar=0; iparip[ipar]); + } + } + else + { + int ipar = parfind(idef[i]); + + if (ipar == -1) + { + ostringstream msg; + msg << "parameter " << idef[i] << " undefined"; + throw constraintError( msg.str() ); + } + + // constraint is fixed if parameter ipar is fixed + vref[i] = this->ip[ipar]; + + if (ctype[i] == IDENT) + { + *var[i] = p[ipar]; + dvdp[i][ipar] = 1.0; + } + else if (ctype[i] == FCOMP) + { + *var[i] = 1.0 - p[ipar]; + dvdp[i][ipar] = -1.0; + } + else if (ctype[i] == FSQR) + { + *var[i] = sqr(p[ipar]); + dvdp[i][ipar] = 2.0*p[ipar]; + } + } + } +} + +int Fit::parfind(unsigned int pidx) +{ + // find the position of pidx in parameter indices vector id + // return -1 if not found + vector::iterator pos; + pos = find(id.begin(), id.end(), pidx); + if (pos == id.end()) + { + return -1; + } + return int(pos - id.begin()); +} + +void Fit::setpar(unsigned int pidx, double val) +{ + int ipar = parfind(pidx); + if (ipar != -1) + { + p[ipar] = val; + } + else + { + p.push_back(val); + ip.push_back(1); // select refinement "ON" when par gets defined + id.push_back(pidx); // store the parameter identifier + } +} + +double Fit::getpar(unsigned int pidx) +{ + int ipar = parfind(pidx); + if (ipar < 0) + { + ostringstream msg; + msg << "Parameter " << pidx << " does not exist"; + throw unassignedError( msg.str() ); + } + return p[ipar]; +} + +void Fit::fixpar(int pidx) +{ + if (pidx == ALL) + { + fill(ip.begin(), ip.end(), false); + return; + } + int ipar = parfind(pidx); + if (ipar == -1) + { + ostringstream emsg; + emsg << "Parameter " << pidx << " not defined."; + throw unassignedError(emsg.str()); + } + ip[ipar] = false; +} + +void Fit::freepar(int pidx) +{ + if (pidx == ALL) + { + fill(ip.begin(), ip.end(), true); + return; + } + int ipar = parfind(pidx); + if (ipar == -1) + { + ostringstream emsg; + emsg << "Parameter " << pidx << " not defined."; + throw unassignedError(emsg.str()); + } + ip[ipar] = true; +} + +/************************************************************************** + This routine calculates errors dx from dp ... + + The covariance of the constrained variables is given by the left and right + matrix multiplication of the dvdp matrix with the covariance matrix + (based on a Taylor expansion of each constraint around the mean parameter values). + The old Fortran program had a sqrt(sum of squares) as error. This + does not take into account parameter correlations, and implicitly considers + the parameters uncorrelated, which is an under-estimation of the parameters. +****************************************************************************/ +void PdfFit::fit_errors() +{ + int ip; + matrix dvdpt = fit.dvdp.transposed(); + + // compute the errors on the parameters as sqrt of diagonal elements of + // covariance matrix + fit.dp = fit.covar.sd(); + + // compute errors on refined variables: left and right matrix multiplication + // of covariance matrix with dvdp + fit.vcovar = fit.dvdp * fit.covar * dvdpt; + + fit.dvar = fit.vcovar.sd(); + + //for(int i=0;ilattice(); +} + +/*********************************************************************** + This routine converts the errors on the constraints to + errors on the actual pdf-paramters +************************************************************************/ + +void Fit::fill_errors() +{ + // transfers the errors on the constrained variables to the corresponding + // pdf error-variables + + int icon; + + // loop over all refinable variables and transfer the sd on any constrained + // variable into the sd on the refinable variable + for (unsigned int i=0; i= big) + { + big=fabs(a[j][k]); + irow=j; + icol=k; + } + } + } + } + } + ++(ipiv[icol]); + /*We now have the pivot element, so we interchange rows, if needed, to put the pivot + element on the diagonal. The columns are not physically interchanged, only relabeled: + indxc[i], the column of the ith pivot element, is the ith column that is reduced, while + indxr[i] is the row in which that pivot element was originally located. If indxr[i] + != indxc[i] there is an implied column interchange. With this form of bookkeeping, the + solution b's will end up in the correct order, and the inverse matrix will be scrambled + by columns.*/ + if (irow != icol) { + for (l=1;l<=n;l++) swap(a[irow][l],a[icol][l]); + for (l=1;l<=m;l++) swap(b[irow][l],b[icol][l]); + } + indxr[i]=irow; // We are now ready to divide the pivot row by the + // pivot element, located at irow and icol. + indxc[i]=icol; + + // Indices of a start at 1, make sure we don't reference invalid + // index of a. When icol is 0, all checked elements of the matrix + // a were zero and it is probably singular as well. + if (icol == 0 || a[icol][icol] == 0.0) + { + throw calculationError("Singular matrix during minimization"); + } + pivinv=1.0/a[icol][icol]; + a[icol][icol]=1.0; + for (l=1;l<=n;l++) a[icol][l] *= pivinv; + for (l=1;l<=m;l++) b[icol][l] *= pivinv; + for (ll=1;ll<=n;ll++) // Next, we reduce the rows... + if (ll != icol) { // ...except for the pivot one, of course. + dum=a[ll][icol]; + a[ll][icol]=0.0; + for (l=1;l<=n;l++) a[ll][l] -= a[icol][l]*dum; + for (l=1;l<=m;l++) b[ll][l] -= b[icol][l]*dum; + } + } + /*This is the end of the main loop over columns of the reduction. It only remains to unscram- + ble the solution in view of the column interchanges. We do this by interchanging pairs of + columns in the reverse order that the permutation was built up.*/ + for (l=n;l>=1;l--) + { + if (indxr[l] == indxc[l]) continue; + for (k=1;k<=n;k++) swap(a[k][indxr[l]],a[k][indxc[l]]); + } // And we are done. + free_ivector(ipiv,1,n); + free_ivector(indxr,1,n); + free_ivector(indxc,1,n); +} + +// End of file diff --git a/src/extensions/libpdffit2/matrix.h b/src/extensions/libpdffit2/matrix.h new file mode 100644 index 00000000..bc80b8ca --- /dev/null +++ b/src/extensions/libpdffit2/matrix.h @@ -0,0 +1,239 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* template class matrix +* +* Comments: optimized from original vector of vectors +* +***********************************************************************/ + +#ifndef MATRIX_H_INCLUDED +#define MATRIX_H_INCLUDED + +#include +#include +#include + +#include "OutputStreams.h" +using NS_PDFFIT2::pout; + +template class matrix +{ + private: + + // Data Methods + T* mdata; + size_t mrows; + size_t mcols; + size_t msize; + + public: + + // Constructors + matrix() : + mdata(NULL), mrows(0), mcols(0), msize(0) + { } + matrix(const matrix& src) : + mdata(new T[src.mrows*src.mcols]), + mrows(src.mrows), mcols(src.mcols), msize(src.msize) + { + std::copy(src.mdata, src.mdata + src.msize, mdata); + } + matrix(size_t m, size_t n) : + mrows(m), mcols(n), msize(mrows*mcols) + { + mdata = new T[mrows*mcols]; + std::fill(mdata, mdata + msize, T(0)); + } + // Destructor + ~matrix() + { + delete[] mdata; + } + // Methods + matrix& operator=(const matrix& src) + { + if (this == &src) return *this; + delete[] mdata; + mdata = new T[src.msize]; + std::copy(src.mdata, src.mdata + src.msize, mdata); + mrows = src.mrows; + mcols = src.mcols; + msize = src.msize; + return *this; + } + matrix& operator=(T value) + { + std::fill_n(mdata, msize, value); + return *this; + } + void resize(size_t m, size_t n, T value=T(0)) + { + if (m == mrows && n == mcols) return; + T* resized = new T[m*n]; + std::fill(resized, resized + m*n, value); + for ( size_t i = 0, offset = 0; + i != std::min(m, mrows); ++i, offset += n ) + { + for (size_t j = 0; j != std::min(n, mcols); ++j) + { + resized[offset+j] = (*this)(i, j); + } + } + delete[] mdata; + mdata = resized; + mrows = m; + mcols = n; + msize = m*n; + } + void clear() + { + delete[] mdata; + mdata = NULL; + mrows = mcols = msize = 0; + } + std::vector rowVector(size_t i) + { + return std::vector(mdata + mcols*i, mdata + mcols*(i+1)); + } + std::vector colVector(size_t j) + { + std::vector column(mrows); + typename std::vector::iterator vii; + vii = column.begin(); + T* pt = mdata + j; + for (; vii != column.end(); ++vii, pt += mcols) *vii = *pt; + return column; + } + inline size_t getrows() + { + return mrows; + } + inline size_t getcols() + { + return mcols; + } + inline T* operator[](size_t i) + { + return mdata + mcols*i; + } + inline T& operator()(size_t i, size_t j) + { + return *(mdata + i*mcols + j); + } + matrix transposed() + { + matrix mxt(mcols, mrows); + T* pt = mxt.mdata; + for (size_t j = 0; j != mcols; ++j) + { + for (size_t i = 0; i != mrows; ++i, ++pt) + { + *pt = (*this)(i, j); + } + } + return mxt; + } + // returns standard deviation vector from covariance matrix + std::vector sd() + { + std::vector v(mcols); + if (mcols != mrows) + { + const char* emsg = "Matrix not square in "; + throw emsg; + } + typename std::vector::iterator vii; + vii = v.begin(); + for (T* pii = mdata; pii < mdata + msize; pii += mcols + 1, ++vii) + { + *vii = sqrt(*pii); + } + return v; + } + matrix operator*(matrix& B) + { + matrix& A = *this; + matrix C(A.mrows, B.mcols); + if (A.mcols != B.mrows) + { + const char* emsg = "Inconsistent matrix multiplication"; + throw emsg; + } + for (size_t i = 0; i != A.mrows; ++i) + { + for (size_t j = 0; j != B.mcols; ++j) + { + T& Cij = C(i,j); + Cij = 0; + for (size_t k = 0; k != A.mcols; ++k) + { + Cij += A(i,k)*B(k,j); + } + } + } + return C; + } + template + friend std::ostream& operator<<(std::ostream &out, matrix &mx); + void print() + { + using namespace std; + for (size_t i = 0; i != mrows; ++i) + { + *pout << i << ": "; + for (size_t j = 0; j != mcols; ++j) + { + *pout << (*this)(i,j) << " "; + } + *pout << endl; + } + } +}; + +template +std::ostream &operator<<(std::ostream &out, std::vector &v) +{ + using namespace std; + out << "("; + for (size_t i=0; i != v.size(); ++i) + { + out << v[i]; + if (i != (v.size()-1)) out << ", "; + else out << ")\n"; + } + return out; +} + +template +std::ostream& operator<<(std::ostream &out, matrix &mx) +{ + using namespace std; + out << "( "; + for (size_t i = 0; i != mx.mrows; ++i) + { + out << "("; + for (size_t j = 0; j != mx.mcols; ++j) + { + *pout << mx(i,j); + if (j != (mx.mcols-1)) *pout << ", "; + else *pout << ")"; + } + if (i != (mx.mrows-1)) *pout << ", "; + else *pout << " )\n"; + } + return out; +} + +#endif // MATRIX_H_INCLUDED diff --git a/src/extensions/libpdffit2/metric.cc b/src/extensions/libpdffit2/metric.cc new file mode 100644 index 00000000..5f696495 --- /dev/null +++ b/src/extensions/libpdffit2/metric.cc @@ -0,0 +1,341 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Definitions of several Phase methods +* +* Comments: +* +***********************************************************************/ + +#include + +#include "MathUtils.h" +#include "StringUtils.h" +#include "pdffit.h" +using NS_PDFFIT2::pout; + +/********************************************************************* + Calculates lattice constants, metric and reciprocal metric + tensor, permutation tensors and unit cell volume. + It's done quite some old fashioned way, rather than calculating + the direct metric tensor and its inverse. + + This extended version calculates standard deviations as well + **********************************************************************/ +void Phase::lattice() +{ + double abscosa, abscosb, abscosg, arg, darg; + double dcosa, dcosb, dcosg, voll, dvoll; + double cos1, cos2, cosi, sin1, sin2, sini; + double dcos1, dcos2, dcosi, dsin1, dsin2, dsini; + int i, i1, i2, j, k, ncc; + + cosa = cosd(win[0]); + cosb = cosd(win[1]); + cosg = cosd(win[2]); + + sina = sind(win[0]); + sinb = sind(win[1]); + sing = sind(win[2]); + + abscosa = fabs(cosa); + abscosb = fabs(cosb); + abscosg = fabs(cosg); + + dcosa = fabs(sina*rad*dwin[0]); + dcosb = fabs(sinb*rad*dwin[1]); + dcosg = fabs(sing*rad*dwin[2]); + + voll = 1.0 - sqr(cosa) - sqr(cosb) - sqr(cosg) + 2.0*cosa*cosb*cosg; + + if (voll <= double_eps) + { + throw structureError("Unit cell volume is not positive."); + } + v = sqrt(voll)*a0[0]*a0[1]*a0[2]; + + dvoll = 2.0*(abscosa*dcosa + abscosb*dcosb + abscosg*dcosg + + dcosa*abscosb*abscosg + abscosa*dcosb*abscosg + abscosa*abscosb*dcosg); + dv = 0.5/sqrt(voll)*dvoll*a0[0]*a0[1]*a0[2] + + sqrt(voll)*(da0[0]*a0[1]*a0[2] + a0[0]*da0[1]*a0[2] + a0[0]*a0[1]*da0[2]); + + vr = 1.0/v; + dvr = 1.0/(v*v)*dv; + + //------ - calculate direct metric tensor + + tensor(gten,a0,win); + dtensor(a0,win,dgten,da0,dwin); + + //------ - calculate reciprocal lattice constants + + // WHY ARE THERE NO ABSOLUTE VALUES IN THE FOLLOWING FORMULAE FOR THE STANDARD + // DEVIATIONS?? + for (i=0; i<3; i++) // i = 0,1,2 + { + i1 = (i+1) % 3; // i1 = 1,2,0 + i2 = (i+2) % 3; // i2 = 2,0,1 + + cos1 = cosd(win[i1]); + cos2 = cosd(win[i2]); + cosi = cosd(win[i]); + sin1 = sind(win[i1]); + sin2 = sind(win[i2]); + sini = sind(win[i]); + + ar[i] = a0[i1]*a0[i2]*sini/v; + arg = (cos1*cos2-cosi)/(sin1*sin2); + wrez[i] = acosd(arg); + + dcos1 = sin1*rad*dwin[i1]; + dcos2 = sin2*rad*dwin[i2]; + dcosi = sini*rad*dwin[i]; + dsin1 = cos1*rad*dwin[i1]; + dsin2 = cos2*rad*dwin[i2]; + dsini = cosi*rad*dwin[i]; + + dar[i] = ( (da0[i1]*a0[i2] + a0[i1]*da0[i2])*sini + + a0[i1]*a0[i2]*dsini) /v + a0[i1]*a0[i2]*sini/(v*v)*dv; + darg = (dcos1*cos2 + cos1*dcos2 + dcosi)/(sin1*sin2) + + arg/sin1*dsin1 + arg/sin2*dsin2; + dwrez[i] = 1./sqrt(1-arg*arg)*darg/rad; + } + + //------ - calculate reciprocal tensor + + tensor(rten,ar,wrez); + dtensor(ar,wrez,drten,dar,dwrez); + + //------ - calculate permutation tensors + + for (i=0; i<3; i++) + { + for (j=0; j<3; j++) + { + for (k=0; k<3; k++) + { + eps(i,j,k) = 0.0; + reps(i,j,k) = 0.0; + deps(i,j,k) = 0.0; + dreps(i,j,k) = 0.0; + } + } + } + + eps(0,1,2) = v; + eps(1,2,0) = v; + eps(2,0,1) = v; + eps(0,2,1) = -v; + eps(2,1,0) = -v; + eps(1,0,2) = -v; + reps(0,1,2) = vr; + reps(1,2,0) = vr; + reps(2,0,1) = vr; + reps(0,2,1) = -vr; + reps(2,1,0) = -vr; + reps(1,0,2) = -vr; + + deps(0,1,2) = dv; + deps(1,2,0) = dv; + deps(2,0,1) = dv; + deps(0,2,1) = -dv; + deps(2,1,0) = -dv; + deps(1,0,2) = -dv; + dreps(0,1,2) = dvr; + dreps(1,2,0) = dvr; + dreps(2,0,1) = dvr; + dreps(0,2,1) = -dvr; + dreps(2,1,0) = -dvr; + dreps(1,0,2) = -dvr; + + //------ - Calculate number density + + np = 0.0; + dnp = 0.0; + + for (i=0; i +#include + +const int getNR_END() +{ + return 1; +} + +static void nrerror(char error_text[]) + /* Numerical Recipes standard error handler */ +{ + fprintf(stderr,"Numerical Recipes run-time error...\n"); + fprintf(stderr,"%s\n",error_text); + fprintf(stderr,"...now exiting to system...\n"); + exit(1); +} + +template T *_vector(long nl, long nh) + /* allocate a vector with subscript range v[nl..nh] */ +{ + T *v = NULL; + if (nl > nh) return v; + v=(T *)malloc((size_t) ((nh-nl+1+getNR_END())*sizeof(T))); + if (!v) nrerror("allocation failure in _vector()"); + return v-nl+getNR_END(); +} + +double *dvector(long nl, long nh) + /* allocate a double vector with subscript range v[nl..nh] */ +{ + return _vector(nl, nh); +} + +int *ivector(long nl, long nh) + /* allocate an int vector with subscript range v[nl..nh] */ +{ + return _vector(nl, nh); +} + +template void _free_vector(T *v, long nl, long nh) + /* free a vector allocated with vector() */ +{ + if (nl > nh) return; + free((T*) (v+nl-getNR_END())); +} + +void free_dvector(double *v, long nl, long nh) + /* free a double vector allocated with vector() */ +{ + _free_vector(v, nl, nh); +} + + +void free_ivector(int *v, long nl, long nh) + /* free an int vector allocated with ivector() */ +{ + _free_vector(v, nl, nh); +} + +template T **_matrix(long nrl, long nrh, long ncl, long nch) + /* allocate a matrix with subscript range m[nrl..nrh][ncl..nch] */ +{ + long i, nrow=nrh-nrl+1,ncol=nch-ncl+1; + T **m = NULL; + if (nrl > nrh || ncl > nch) return m; + + /* allocate pointers to rows */ + m=(T **) malloc((size_t)((nrow+getNR_END())*sizeof(T*))); + if (!m) nrerror("allocation failure 1 in matrix()"); + m += getNR_END(); + m -= nrl; + /* allocate rows and set pointers to them */ + m[nrl]=(T *) malloc((size_t)((nrow*ncol+getNR_END())*sizeof(T))); + if (!m[nrl]) nrerror("allocation failure 2 in matrix()"); + m[nrl] += getNR_END(); + m[nrl] -= ncl; + for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol; + /* return pointer to array of pointers to rows */ + return m; +} + +double **dmatrix(long nrl, long nrh, long ncl, long nch) + /* allocate a double matrix with subscript range m[nrl..nrh][ncl..nch] */ +{ + return _matrix(nrl, nrh, ncl, nch); +} + +template void _free_matrix(T **m, long nrl, long nrh, long ncl, long nch) + /* free a double matrix allocated by matrix() */ +{ + if (nrl > nrh || ncl > nch) return; + free((T*) (m[nrl]+ncl-getNR_END())); + free((T**) (m+nrl-getNR_END())); +} + +void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch) + /* free a double matrix allocated by matrix() */ +{ + _free_matrix(m, nrl, nrh, ncl, nch); +} + +// End of file diff --git a/src/extensions/libpdffit2/nrutil.h b/src/extensions/libpdffit2/nrutil.h new file mode 100644 index 00000000..ee1bd4cb --- /dev/null +++ b/src/extensions/libpdffit2/nrutil.h @@ -0,0 +1,34 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Utilities from numerical recipies. +* +* Comments: +* +***********************************************************************/ + +#ifndef NRUTIL_H_INCLUDED +#define NRUTIL_H_INCLUDED + +#include + +void nrerror(char error_text[]); +int *ivector(long nl, long nh); +double *dvector(long nl, long nh); +double **dmatrix(long nrl, long nrh, long ncl, long nch); +void free_ivector(int *v, long nl, long nh); +void free_dvector(double *v, long nl, long nh); +void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch); + +#endif // NRUTIL_H_INCLUDED diff --git a/src/extensions/libpdffit2/output.cc b/src/extensions/libpdffit2/output.cc new file mode 100644 index 00000000..36928794 --- /dev/null +++ b/src/extensions/libpdffit2/output.cc @@ -0,0 +1,350 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Output methods for Phase, DataSet and Fit classes +* +* Comments: +* +***********************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "pdffit.h" +#include "StringUtils.h" + +/************************************************************ + * Outputs phase information for phase 'ipha' on file 'id' + * Thu Oct 13 2005 - CLF Modified code to handle + * general types of streams. + *************************************************************/ +void Phase::output(ostream &fout) +{ + FormatValueWithStd value_std; + value_std.left(); + + fout << " " << string(78,'-') << '\n' + << " PHASE " << iphase << " : " << name << '\n' + << " " << string(78,'-') << endl; + + fout << " Scale factor : " << + value_std(pscale, dpscale) << endl; + + fout << " Particle diameter : "; + if (spdiameter <= 0.0) fout << "not applied\n"; + else fout << value_std(spdiameter, dspdiameter) << " A\n"; + + fout << " Step cutoff : "; + if (stepcut <= 0.0) fout << "not applied\n"; + else fout << value_std(stepcut, 0.0) << " A\n"; + + if (corr_max > 0.0) + { + fout << " Correlation limit [A] : " << corr_max << endl; + } + + fout << " Quad. corr. factor : " + << value_std(delta2, ddelta2) << endl; + + fout << " Lin. corr. factor : " + << value_std(delta1, ddelta1) << endl; + + fout << " Low r sigma ratio : " << value_std(sratio, dsratio) << '\n' + << " R cutoff [A] : " << value_std(rcut, 0.0) << endl; + + value_std.leading_blank(true).left(); + fout << " Lattice parameters :" + << value_std.width(20)(a0[0], da0[0]) + << value_std.width(20)(a0[1], da0[1]) + << value_std.width(0)(a0[2], da0[2]) << '\n'; + + fout << " & angles :" + << value_std.width(20)(win[0], dwin[0]) + << value_std.width(20)(win[1], dwin[1]) + << value_std.width(0)(win[2], dwin[2]) << '\n'; + + fout << endl; + + fout << " Atom positions & occupancies :" << endl; + for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) + { + fout << " " + << setw(4) << left << toupper(ai->atom_type->symbol) << setw(0); + value_std.width(20); + for (int i = 0; i < 3; i++) + { + fout << value_std(ai->pos[i], ai->dpos[i]); + } + fout << value_std.width(0)(ai->occ,ai->docc) << endl; + } + fout << endl; + + fout << " Anisotropic temperature factors :" << endl; + for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) + { + fout << " " << setw(4) << toupper(ai->atom_type->symbol); + for (int i = 0; i < 3; i++) + { + fout << value_std.width(i == 2 ? 0 : 20)(ai->u[i], ai->du[i]); + } + fout << endl; + if ( ai->u[3] || ai->u[4] || ai->u[5]) + { + fout << " "; + for (int i = 3; i < 6; i++) + { + fout << value_std.width(i == 5 ? 0 : 20)(ai->u[i], ai->du[i]); + } + fout << endl; + } + } +} + +string DataSet::selectedAtomsString(int ip, char ijchar) +{ + if (!psel[ip]) return string(""); + if (ijchar != 'i' && ijchar != 'j') + { + ostringstream emsg; + emsg << "Invalid value of ijchar '" << ijchar << "'"; + throw ValueError(emsg.str()); + } + // build string of selected indices per each atom type + // also check if any type is selected and ignored at the same time + map selidxstr; + set ignored_types; + Phase* ph = psel[ip]; + set& ignored = ijchar == 'i' ? phase_ignore_i[ph] : phase_ignore_j[ph]; + for (int aidx = 0; aidx < ph->natoms; ++aidx) + { + const AtomType* atp = ph->atom[aidx].atom_type; + if (ignored.count(aidx)) ignored_types.insert(atp); + else + { + ostringstream sidx; + sidx << ' ' << aidx + 1; + selidxstr[atp] += sidx.str(); + } + } + ostringstream ssel; + for ( vector::iterator atp = ph->atom_types.begin(); + atp != ph->atom_types.end(); ++atp ) + { + if (!selidxstr.count(*atp)) continue; + ssel << " " << toupper((*atp)->symbol); + if (ignored_types.count(*atp)) ssel << selidxstr[*atp]; + } + return ssel.str(); +} + +/*********************************************************** + Outputs information about this data set + Thu Oct 13 2005 - CLF + Modified code to handle general types of + streams. +************************************************************/ +void DataSet::output(ostream& fout) +{ + FormatValueWithStd value_std; + + fout << " " << string(78,'-') << '\n' + << " DATA SET : " << iset << " (" << name << ")" << '\n' + << " " << string(78,'-') << endl; + + fout << " Data range in r [A] : " << setw(8) << left << rmin << " -> " + << setw(8) << rmax << " Step dr : " << setw(0) << deltar << endl; + + fout << " Calculated range : " << setw(8) << rcmin << " -> " + << setw(0) << rcmax << endl; + + fout << " Refinement r range : " << setw(8) << rfmin << " -> " + << setw(8) << rfmax + << " Data pts : " << setw(5) << nfmin << " -> " + << setw(0) << nfmax << endl; + + fout << + " Reduced chi squared : " << this->getdsredchisq() << '\n' << + " Rw - value : " << this->getdsrw() << '\n' << endl; + + fout << endl << " Experimental settings :" << endl; + + if (scattering_type == 'X') + fout << " Radiation : X-Rays\n"; + else + fout << " Radiation : Neutrons\n"; + + if (qmax <= 0.0) + fout << " Termination at Qmax : not applied\n"; + else + fout << " Termination at Qmax : " << qmax << " A**-1\n"; + + if (qdamp <= 0.0) + fout << " DQ dampening Qdamp : not applied\n"; + else + fout << " DQ dampening Qdamp : " << value_std(qdamp, dqdamp) << " A**-1\n"; + + if (qbroad <= 0.0) + fout << " DQ broadening Qbroad : not applied\n"; + else + fout << " DQ broadening Qbroad : " << value_std(qbroad, dqbroad) << " A**-1\n"; + + fout << " Scale factor : " << value_std(dscale, ddscale) << endl; + + fout << endl; + + fout << " Selected phases and atoms for this data set :\n"; + + for(size_t ip = 0; ip != psel.size(); ip++) + { + if (!psel[ip]) continue; + fout << " Phase " << ip+1 << " :\n"; + + fout << " Atoms (i) :"; + fout << selectedAtomsString(ip, 'i') << '\n'; + fout << " Atoms (j) :"; + fout << selectedAtomsString(ip, 'j') << '\n'; + } + fout << '\n'; + + fout << " Relative phase content in terms of\n"; + fout << " atoms unit cells mass\n"; + vector< pair > atomfractions; + vector< pair > cellfractions; + vector< pair > massfractions; + atomfractions = getAtomPhaseFractions(); + cellfractions = getCellPhaseFractions(); + massfractions = getMassPhaseFractions(); + for(size_t ip = 0; ip != psel.size(); ip++) + { + fout << " Phase " << ip + 1 << " :"; + value_std.left().width(24).leading_blank(true); + fout << value_std(atomfractions[ip].first, atomfractions[ip].second); + fout << value_std(cellfractions[ip].first, cellfractions[ip].second); + value_std.width(0); + fout << value_std(massfractions[ip].first, massfractions[ip].second); + fout << '\n'; + } + fout << endl; +} + +/************************************************* + Outputs parameter information + Thu Oct 13 2005 - CLF + Modified code to handle general types of + streams. +**************************************************/ +void Fit::output(ostream &fout) +{ + fout << " " << string(78,'-') << '\n' + << " PARAMETER INFORMATION :" << '\n' + << " " << string(78,'-') << endl; + + int npar = 0; + + for (int i=0; i order = this->order_by_id(); + vector::iterator i; + for (i = order.begin(); i != order.end(); ++i) + { + int nword = i - order.begin(); + bool lastword = (nword + 1) % 3 == 0 || nword + 1 == psize(); + double dpi = ip[*i] ? dp[*i] : 0.0; + fout << right << ' ' << setw(3) << id[*i] << setw(0) << ":" + << value_std.width(lastword ? 0 : 20)(p[*i], dpi); + fout << (lastword ? "\n" : " "); + } + + fout << " " << string(78,'-') << '\n' + << " REFINEMENT INFORMATION:\n" + << " " << string(78,'-') << endl; + + fout << " Number of iterations : " << iter << endl; + + fout << " Reduced chi squared : " << redchisq << '\n' + << " Rw - value : " << fit_rw << '\n' << endl; + + fout << " Correlations greater than 0.8 :\n\n"; + + bool lkor = false; + + for (i = order.begin(); i != order.end(); ++i) + { + if (!ip[*i]) continue; + + vector::iterator j; + for (j = i + 1; j != order.end(); ++j) + { + if (!ip[*j]) continue; + + double corr = covar[*i][*j]/dp[*i]/dp[*j]; + + if (fabs(corr) > 0.8) + { + fout << " Corr(p[" << id[*i] << "], p[" << id[*j] << "]) = " << corr << endl; + lkor = true; + } + } + } + if (!lkor) + fout << " *** none ***\n"; + } +} + + +// Parameter indices in the vector id are not ordered by default. +// Return a proper order indices for id. This method is used +// for parameters printout. +vector Fit::order_by_id() const +{ + assert(this->psize() == int(this->id.size())); + typedef pair IdIndex; + vector id_with_idx; + for (size_t i = 0; i < id.size(); ++i) + { + id_with_idx.push_back(IdIndex(id[i], i)); + } + sort(id_with_idx.begin(), id_with_idx.end()); + // build return value + vector rv; + rv.reserve(id_with_idx.size()); + vector::iterator ii; + for (ii = id_with_idx.begin(); ii != id_with_idx.end(); ++ii) + { + rv.push_back(ii->second); + } + return rv; +} + + +// End of file diff --git a/src/extensions/libpdffit2/parser.cc b/src/extensions/libpdffit2/parser.cc new file mode 100644 index 00000000..46a5157c --- /dev/null +++ b/src/extensions/libpdffit2/parser.cc @@ -0,0 +1,402 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Formula parser implemented as methods of Fit class +* +* Comments: +* +***********************************************************************/ + +#include +#include +#include +#include +#include + +#include "MathUtils.h" +#include "pdffit.h" + +static vector vstack; +static vector > dstack; // stack with derivative vectors +static bool deriv; + +string stackvar(int i) +{ + ostringstream expr; + expr << '#' << i; + return(expr.str()); +} + +/***************************************************************************************** + Searches for all parameters in the expression and replace them by stack pointers + *****************************************************************************************/ +string Fit::substitute_pars(string &expr) +{ + int ipos=-1, bopen, bclose; + unsigned int i; + string idexpr; + + // search the expression for the next @-sign + while((bopen=expr.find('@',ipos+1)) != (int) string::npos) + { + int id; + + istringstream inexpr(expr); + inexpr.seekg(bopen+1); + + inexpr >> id; + + if (!inexpr) + throw parseError(expr); + + bclose = inexpr.tellg(); + + // expression must be a valid parameter id + int ipar = parfind(id); + + if (ipar == -1) + { + ostringstream msg; + msg << "parameter " << id << " undefined"; + throw constraintError(msg.str()); + } + + // check if same parameter already occurred in this formula + for (i=0; i dnumdp(used.size()); + for (i=0; i()); + } + } + + return expr; // okay +} + +// get next number from expression +// only fill derivatives if that number has derivatives +double Fit::getnum(istringstream &inexpr, vector &dnumdp) +{ + double num; + char c; + int id; + map::iterator iter; + + // Various possibilities when reading the next value inside the + // unbracketted expression + + if (deriv) dnumdp.clear(); + + inexpr >> c; + + if (inexpr.eof()) + throw parseError("Error while reading value"); + + // if first character is a minus sign, call getnum again with expression stripped + // from its minus sign + if ((c=='-') || (c=='+')) + { + num = getnum(inexpr, dnumdp); + if (deriv && !dnumdp.empty() && (c=='-')) + { + for (unsigned int i=0; i check for built-in function + // read-up to next # + else if ((c>='a') && (c<='z')) + { + int start=inexpr.tellg(); + start--; + string::size_type end; + end = inexpr.str().find('#', start); + if (end == string::npos) + { + throw parseError("Error while reading builtin function arguments"); + } + + string sbuiltin = inexpr.str().substr(start,end-start); + if ((iter=builtin.find(sbuiltin)) == builtin.end()) + { + throw parseError("Unknown builtin function"); + } + + // set read pointer behind #-sign + inexpr.seekg(end+1); + + // read argument number + inexpr >> id; + if (!inexpr) + throw parseError(inexpr.str()); + num = iter->second.func(vstack[id]); + + // fill the partial derivatives if function argument had derivatives + if (deriv && !dstack[id].empty()) + { + double fder=iter->second.deriv(vstack[id]); + dnumdp = vector(used.size()); + for(unsigned int i=0; i> id; + if (!inexpr) + throw parseError(inexpr.str()); + num = vstack[id]; + if (deriv && !dstack[id].empty()) dnumdp = dstack[id]; + } + else + { + inexpr.unget(); + inexpr >> num; + + if (!inexpr) + throw parseError("Error while reading value"); + } + return num; +} + +/********************************************** + computes a basic expression without brackets + ***********************************************/ +double Fit::compute(string &expr, vector &dnumdp) +{ + ostringstream ostreamexpr; + string opstring="*/+-"; + double num1, num2, num; + vector dnum1dp, dnum2dp; + char op; // operator + + // transform string to string stream to read numbers more easily + istringstream inexpr(expr); + + // Two parsing passes are performed to ensure correct precedence of + // operators: first for * and /, then for + and - + int pass = 1; + + while(1) + { + int pos, end; + + if (deriv) dnumdp.clear(); + + pos = inexpr.tellg(); + + num1 = getnum(inexpr, dnum1dp); + + inexpr >> op; + + // check if this ends the expression + // if pass==2: expression completely parsed + // if pass==1: go to pass 2 + if (inexpr.eof()) + { + if (pass==2) + { + num = num1; + if (deriv && !dnum1dp.empty()) + dnumdp = dnum1dp; + break; + } + else + { + pass = 2; + inexpr.clear(); + inexpr.str(expr); + continue; + } + } + + if (!inexpr) + throw parseError(expr); + + if (opstring.find(op) == string::npos) + throw parseError(expr); + + // if a + or - operation is encountered in pass 1 -> look for next operation + if ( (pass==1) && ((op == '+') || op == '-') ) + { + continue; + } + + num2 = getnum(inexpr,dnum2dp); + + if (!dnum1dp.empty() || !dnum2dp.empty()) + dnumdp = vector(used.size()); + + switch (op) + { + case '+': + num = num1+num2; + + if (deriv) + { + if (!dnum1dp.empty()) dnumdp = dnum1dp; + if (!dnum2dp.empty()) + for (unsigned int i=0; i< used.size(); i++) + dnumdp[i] += dnum2dp[i]; + } + break; + + case '-': + num = num1-num2; + + if (deriv) + { + if (!dnum1dp.empty()) dnumdp = dnum1dp; + if (!dnum2dp.empty()) + for (unsigned int i=0; i< used.size(); i++) + dnumdp[i] -= dnum2dp[i]; + } + break; + + case '*': + num = num1*num2; + + if (deriv) + { + if (!dnum1dp.empty()) + for (unsigned int i=0; i< used.size(); i++) + dnumdp[i] += dnum1dp[i]*num2; + if (!dnum2dp.empty()) + for (unsigned int i=0; i< used.size(); i++) + dnumdp[i] += num1*dnum2dp[i]; + } + break; + + case '/': + num = num1/num2; + + if (deriv) + { + if (!dnum1dp.empty()) + for (unsigned int i=0; i< used.size(); i++) + dnumdp[i] += dnum1dp[i]/num2; + if (!dnum2dp.empty()) + for (unsigned int i=0; i< used.size(); i++) + dnumdp[i] -= num1*dnum2dp[i]/sqr(num2); + } + break; + } + + end = inexpr.tellg(); + + // replace computed substring by stack pointer, and push value on the stack + expr.replace(pos,end-pos,stackvar(vstack.size())); + vstack.push_back(num); + + // store the derivatives as well. Note that the derivative vector may be empty + // if no derivatives was non-zero. + if (deriv) + dstack.push_back(dnumdp); + + inexpr.clear(); + inexpr.str(expr); + inexpr.seekg(pos); + } + + // the expression has been reduced to just one number + return num; +} + +/*************************************************************************************** + Searches the formula for bracketted expressions replace them by their numerical values + ****************************************************************************************/ + +double Fit::parse(string line, vector &dnumdp) +{ + int bopen, bclose; + string expression; + double num; + + if (line.find('#') != string::npos) + throw parseError("Illegal character in formula"); + + // the first elements on the stack will be the used parameter values + vstack.clear(); + used.clear(); + + // Search for parameters, check their existence and put on the stack + line = substitute_pars(line); + + // look for first closing bracket + while( (bclose=line.find(')')) != (int) string::npos) + { + // look for closest opening bracket in front of closing bracket + if ( (bopen=line.rfind('(',bclose-1)) == (int) string::npos) + throw parseError("Unmatched brackets in formula"); + + // isolate expression within the brackets + expression = line.substr(bopen+1,bclose-bopen-1); + + // compute isolated expression + num = compute(expression, dnumdp); + + // put the bracket-value on the stack and replace substring by stack pointer, + // and push new value on the stack + line.replace(bopen,bclose-bopen+1,stackvar(vstack.size())); + vstack.push_back(num); + + if (deriv) + dstack.push_back(dnumdp); + + } + + // After all brackets have been worked out, the final expression is evaluated + num = compute(line, dnumdp); + + return num; // okay +} + +// End of file diff --git a/src/extensions/libpdffit2/pdf.cc b/src/extensions/libpdffit2/pdf.cc new file mode 100644 index 00000000..0ab857b6 --- /dev/null +++ b/src/extensions/libpdffit2/pdf.cc @@ -0,0 +1,1776 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch, Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Mixed methods for PDF calculation from PdfFit, DataSet and Phase +* +* Comments: Up to date with 1.3.10 Fortran version. +* What a spagetti. +* +***********************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "PointsInSphere.h" +#include "StringUtils.h" +#include "LocalPeriodicTable.h" +#include "MathUtils.h" +#include "ShapeFactors.h" + +#include "pdffit.h" + +using NS_PDFFIT2::pout; + +#define NEW_SHARP + +/***************************************************************** + Allocating space for dummy dataset when calculating PDF + without data +******************************************************************/ +void PdfFit::alloc(char tp, double qmax, double qdamp, double rmin, double rmax, int bin) +{ + + DataSet* pds = new DataSet(this); + int i; + if (rmax < rmin || rmin < 0 || rmax < 0) + { + throw ValueError("Check rmin, rmax"); + } + if (bin <= 1) + { + throw ValueError("bin must be > 1"); + } + if( qmax < 0.0 ) + { + throw ValueError("qmax must be >= 0"); + } + if( qdamp < 0 ) + { + throw ValueError("qdamp must be >= 0"); + } + + // 2009-03-11 PJ: Removed check if a structure has been loaded before. + // It can be now loaded after calling alloc. + + pds->iset = nset+1; + + pds->scattering_type = tp; + + pds->qmax = qmax; + pds->qdamp = qdamp; + pds->rmin = pds->rfmin = rmin; + pds->rmax = pds->rfmax = rmax; + pds->bin = bin; + pds->deltar = (rmax-rmin)/double(bin-1); + pds->name = "Dummy set"; + + pds->obs.resize(bin); + pds->wic.resize(bin); + + for (i=0; iobs[i] = 0.0; + pds->wic[i] = 1.0; + } + + *pout << " Allocated PDF data set " << pds->iset << " (r = " + << rmin << " to " << rmax << " A, " << bin << " points) ..." << endl; + + // automatically select existing phases and its atoms for the new dataset + for (int ip=0; ipselphase(ip, this->phase[ip]); + + this->datasets.push_back(pds); + nset++; + setdata(nset); +} + +// cut-away high Q harmonics using fast Fourier transformation +void DataSet::applyQmaxCutoff(double* y, size_t len) +{ + // pad y with the same number of zeros up to the next power of 2 + size_t padlen = 2*len; + // MS compatibility fix + padlen = (size_t) pow(2.0, ceil(log2(padlen))) ; + // ycpad is complex, so it needs to be twice as long + valarray ycpad_array(2*padlen); + double* ycpad = &(ycpad_array[0]); + fill_n(ycpad, 2*padlen, 0.0); + // copy y to real components of ycpad + for (size_t i = 0; i != len; ++i) ycpad[2*i] = y[i]; + // apply fft + int status; + status = gsl_fft_complex_radix2_forward(ycpad, 1, padlen); + if (status != GSL_SUCCESS) + { + throw calculationError("Fourier Transformation failed."); + } + // Q step for ycpad + double dQ = 2*M_PI/((padlen-1)*deltar); + // loQidx, hiQidx correspond to Qmax and -Qmax frequencies + // they need to be integer to catch cases with huge qmax/dQ + int loQidx = int( ceil(qmax/dQ) ); + int hiQidx = padlen + 1 - loQidx; + // zero high Q components in ycpad + for (int i = loQidx; i < hiQidx; ++i) + { + ycpad[2*i] = ycpad[2*i+1] = 0.0; + } + // transform back + status = gsl_fft_complex_radix2_inverse(ycpad, 1, padlen); + if (status != GSL_SUCCESS) + { + throw calculationError("Fourier Transformation failed."); + } + // copy real components + for (size_t i = 0; i != len; ++i) y[i] = ycpad[2*i]; +} + + +/***************************************************** + Calculate PDF for dataset with current structure + + In initial version: one phase +******************************************************/ + +void DataSet::determine(bool ldiff, bool lout, Fit &fit) +{ + //int kk, ibin, ip; + int ib, ie, ig; + double rmax2, rmin2, gaus, rk, rb,re, rtot, ract; + vector ppp; + double dd[3], d[3], dist2, dist, rg, r; + double sigmap, sigma, gnorm, ampl; + long totcalc=0; + + if (lout) *pout << " Calculating PDF ...\n"; + + // total # points to be fitted + nfmin = nint((rfmin-rmin)/deltar); + nfmax = nint((rfmax-rmin)/deltar); + + // extend calculation range before applying Qmax cutoff + extendCalculationRange(lout); + + rmax2 = sqr(rcmax+1.0); + rmin2 = sqr(rcmin-1.0) * ((rcmin-1.0) < 0.0 ? -1.0 : 1.0); + rmin2 = max(0.01,rmin2); + + pdftot.resize(ncmax+1); + fill(pdftot.begin(), pdftot.end(), 0.0); + calc.resize(ncmax+1,psel.size()); + ppp.resize(ncmax+1); + + if (ldiff) + { + fit_a.resize(ncmax+1, fit.varsize()); + fit_a = 0.0; + } + + // ------ Loop over all phases + + for (unsigned ip=0; ip ignore_i(phase.natoms); + valarray ignore_j(phase.natoms); + for (int aidx = 0; aidx < phase.natoms; ++aidx) + { + ignore_i[aidx] = phase_ignore_i[&phase].count(aidx); + ignore_j[aidx] = phase_ignore_j[&phase].count(aidx); + } + + // ------ Get the ratio total pairs/selected weight in structure + + rtot = 0.0; + ract = 0.0; + for (int iidx = 0; iidx < phase.natoms; ++iidx) + { + Atom& ai = phase.atom[iidx]; + for (int jidx = iidx; jidx < phase.natoms; ++jidx) + { + Atom& aj = phase.atom[jidx]; + double halfloopscale = (iidx == jidx) ? 1.0 : 2.0; + rtot += halfloopscale * ai.weight * aj.weight; + // skip ignored pair + bool skip = (ignore_i[iidx] || ignore_j[jidx]) && + (ignore_i[jidx] || ignore_j[iidx]); + if (skip) continue; + ract += halfloopscale * ai.weight * aj.weight; + } + } + phase.dnorm = ract/rtot; + + //-------------------------------------------------------------- + + fill(ppp.begin() + ncmin, ppp.begin() + ncmax + 1, 0.0); + + // calculate range for PointsInSphere sequencer + // (negative rsphmin is no problem) + double buffzone = phase.circum_diameter(); + double rsphmin = sqrt(rmin2) - buffzone; + double rsphmax = sqrt(rmax2) + buffzone; + // limit rsphmax, when stepcut has been set for the phase + if (phase.stepcut > 0.0) + { + rsphmax = min(rsphmax, phase.stepcut + buffzone); + } + PointsInSphere sph( rsphmin, rsphmax, phase.a0[0]*phase.icc[0], + phase.a0[1]*phase.icc[1], phase.a0[2]*phase.icc[2], + phase.win[0], phase.win[1], phase.win[2] ); + + // loop only over selected atom indexes + for (int iidx = 0; iidx < phase.natoms; ++iidx) + { + Atom& ai = phase.atom[iidx]; + for (int jidx = iidx; jidx < phase.natoms; ++jidx) + { + Atom& aj = phase.atom[jidx]; + + // skip ignored pair + bool skip = (ignore_i[iidx] || ignore_j[jidx]) && + (ignore_i[jidx] || ignore_j[iidx]); + if (skip) continue; + + for (sph.rewind(); !sph.finished(); sph.next()) + { + for (int i=0; i<3; i++) + { + dd[i] = ai.pos[i] - aj.pos[i] - + sph.mno[i]*phase.icc[i]; + d[i] = dd[i] * phase.a0[i]; + } + dist2 = phase.skalpro(dd,dd); + + // check if pair distance is within dataset r limits + if ((dist2 < rmin2) || (dist2 > rmax2)) continue; + + // dist is distance r_ij + dist = sqrt(dist2); + + //------ Setting up 'thermal' Gaussian + sigmap = sqrt(phase.msdAtoms(ai, aj, dd)); + // neglect unphysical summed square displacements + if (sigmap <= 0.0) continue; + + //- PDF peak width modifications - new 07/2003 + +#if defined(NEW_SHARP) + // Computation of peak sharpening sigma + // sigma = sigmap* sqrt(1 - delta2/r_ij^2 - delta1/r_ij + qbroad*r_ij^2) + double corfact; + corfact = 1 - phase.delta2/dist2 + - phase.delta1/dist + sqr(qbroad)*dist2; + + // if sigma negative: set it back to 1e-5 just for this point + // note: derivative will be incorrect in this case + if (corfact <= 0) + { + continue; // neglect contribution + } + else + { + sigma = sigmap * sqrt(corfact); + } +#else + // Computation of peak sharpening sigma + // sigma = sqrt(sqr(sigmap) - delta2/r_ij^2 - delta1/r_ij + qbroad*r_ij^2) + double sigma2; + sigma2 = sqr(sigmap) - phase.delta2/dist2 + - phase.delta1/dist + sqr(qbroad)*dist2; + + // if sigma2 negative: set it back to 1e-5 just for this point + // note: derivative will be incorrect in this case + if (sigma2 <= 1e-10) + { + sigma = 1e-5; // neglect contribution + } + else + { + sigma = sqrt(sigma2); + } +#endif + // apply rcut if requested + if (dist < phase.rcut) + { + sigma *= phase.sratio; + } + + // The gaus curve is computed up to distance of 5 sigma + gnorm = 1.0/(sqrt(2.0*M_PI)*sigma); + ampl = ai.occ * ai.weight * aj.occ * aj.weight; + + if (iidx != jidx) ampl += ampl; + + rb = max(rcmin, dist - 5.0*sigma); + re = min(rcmax, dist + 5.0*sigma); + if (phase.stepcut > 0.0) + { + re = min(re, phase.stepcut); + } + + ib = nint((rb-rmin)/deltar); + ie = nint((re-rmin)/deltar); + + for(ig=ib; ig<=ie; ig++) + { + totcalc++; + rk = rmin + ig*deltar; + rg = rk-dist; + gaus = gnorm * exp(-0.5*sqr(rg/sigma)); + ppp[ig] += ampl*gaus; + + // if derivative are needed + if (ldiff) + { + pdf_derivative(phase, ai, aj, rk, + sigma, sigmap, dist, d, ampl, gaus, + fit, fit_a[ig]); + } + } + } + } + } + + //------ - Convert to proper G(r) and add to total PDF + + for (int i = ncmin; i<=ncmax; i++) + { + r = i*deltar + rmin; + + calc[i][ip] = ppp[i]/phase.np/r - 4.0*M_PI*r*phase.rho0*phase.dnorm; + + // Q-resolution envelope + if (qdamp > 0.0) + { + calc[i][ip] *= exp(-sqr(r*qdamp)/2.0); + } + + // PDF envelope for spherical nano particles + if (phase.spdiameter > 0.0) + { + calc[i][ip] *= sphereEnvelope(r, phase.spdiameter); + } + + // Empirical shape step cutoff of the PDF + if (phase.stepcut > 0.0) + { + double stepfactor = (r <= phase.stepcut) ? 1.0 : 0.0; + calc[i][ip] *= stepfactor; + } + + //if ( (r <= phase.corr_max) || (phase.corr_max <= 0.0) ) + pdftot[i] += this->dscale * phase.pscale * calc[i][ip]; + } + } + + // finalize computation of derivatives if required + // this HAS to happen before the multiplication by deltar/pi and before + // the convolution to avoid "double operations" on the derivatives, + // as this will be taken care of in the derivatives. + if (ldiff) + { + fit_setup_derivatives(fit); // computes matrix dpdf/dvar + } + + //for (i=ncmin;i<=ncmax;i++) + // *pout << i << " " << pdftot[i] << endl; + + // From here on we can restrict ourselves to the range [nfmin,nfmax] + // for the outerloop + + // Apply Qmax cutoff + if (qmax > 0.0) + { + applyQmaxCutoff(&pdftot[ncmin], ncmax-ncmin+1); + } +} + +/***************************************************************** + This routine calculates the sums over 'ij' needed for the + derivatives - this is faster than doing the complete loop + in 'pdf_determine' again .. + gaus: gaus[igaus+kk] from +******************************************************************/ +void DataSet::pdf_derivative (Phase &phase, + const Atom& atomi, const Atom& atomj, double rk, double sigma, + double sigmap, double dist, double d[3], double ampl,double gaus, + Fit &fit, double* fit_a_i) +{ + double rd,dg; + rd = dg = 0.0; + double s11,s22,s33,s12,s13,s23; + double drdx, drda, phi, dsdphi, dspdx, dspda; + int ipar, i, ioffset, joffset; + + //------ Some common calculations + + s11 = atomi.u[0] + atomj.u[0]; + s22 = atomi.u[1] + atomj.u[1]; + s33 = atomi.u[2] + atomj.u[2]; + s12 = atomi.u[3] + atomj.u[3]; + s13 = atomi.u[4] + atomj.u[4]; + s23 = atomi.u[5] + atomj.u[5]; + + rd = (rk-dist)/sigma; + + if (dist < phase.rcut) + { + phi = phase.sratio; + dsdphi = sigma/phi; + } + else + { + phi = 1.0; + dsdphi = 0.0; + } + + // derivative of T_ij wrt sigma + double T = ampl*gaus; + double dTds = T/sigma*(rd*rd-1); + double dTdr = (rk-dist)/sqr(sigma)*T; + +#if defined(NEW_SHARP) + // define s2 = sp**2 - delta2/sqr(rij) - delta1/rij + alpha*sqr(rij) + // then s = phi*sqrt(s2) + double dsds2 = sqr(phi*sigmap)/(2.0*sigma); + double dsdsp = sigma/sigmap; + double dsdr = dsds2*(2.0*phase.delta2/cube(dist) + + phase.delta1/sqr(dist) + 2.0*sqr(qbroad)*dist); +#else + // define s2 = sp**2 - delta2/sqr(rij) - delta1/rij + alpha*sqr(rij) + // then s = phi*sqrt(s2) + double dsds2 = sqr(phi)/(2.0*sigma); + if (sigma==1e-5) dsds2 = 0; + + double dsdsp = 2.0*sigmap*dsds2; + double dsdr = dsds2*(2.0*phase.delta2/cube(dist) + + phase.delta1/sqr(dist) + 2.0*sqr(qbroad)*dist); +#endif + double dspdr = - sigmap/dist; + + + + /*---------------------------------------------------------------- + //------ Derivatives per atom : x,y,z,u,o + //- ------------------------------------------------------------- + + dTdx = dTds.(dsdsp.(dspdr.drdx+dspdx) + dsdr.drdx) + dTdr.drdx + */ + + ioffset = atomi.offset; + joffset = atomj.offset; + + // ----- d/dx[ip,ia] + + if ( (fit.refvar[ioffset] != -1) || (fit.refvar[joffset] != -1) ) + { + drdx = phase.a0[0]/dist*(d[0] + phase.cosg*d[1] + phase.cosb*d[2]); + dspdx = phase.a0[0]*(d[0]*s11 + d[1]*s12 + d[2]*s13)/sqr(dist)/sigmap; + + dg = dTds*(dsdsp*(dspdr*drdx+dspdx) + dsdr*drdx) + dTdr*drdx; + } + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + + if ( (ipar=fit.refvar[joffset++]) != -1) + { + fit_a_i[ipar] -= dg; + } + + + // ----- d/dy[ip,ia] + + if ( (fit.refvar[ioffset] != -1) || (fit.refvar[joffset] != -1) ) + { + drdx = phase.a0[1]/dist*(phase.cosg*d[0] + d[1] + phase.cosa*d[2]); + dspdx = phase.a0[1]*(d[0]*s12 + d[1]*s22 + d[2]*s23)/sqr(dist)/sigmap; + + dg = dTds*(dsdsp*(dspdr*drdx+dspdx) + dsdr*drdx) + dTdr*drdx; + } + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + + if ( (ipar=fit.refvar[joffset++]) != -1) + { + fit_a_i[ipar] -= dg; + } + + + // ----- d/dz[ip,ia] + + if ( (fit.refvar[ioffset] != -1) || (fit.refvar[joffset] != -1) ) + { + drdx = phase.a0[2]/dist*(phase.cosb*d[0] + phase.cosa*d[1] + d[2]); + dspdx = phase.a0[2]*(d[0]*s13 + d[1]*s23 + d[2]*s33)/sqr(dist)/sigmap; + + dg = dTds*(dsdsp*(dspdr*drdx+dspdx) + dsdr*drdx) + dTdr*drdx; + } + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + + if ( (ipar=fit.refvar[joffset++]) != -1) + { + fit_a_i[ipar] -= dg; + } + + + // ----- d/du[j,ip,ia] (j=11,22,33,12,13,23) + + /* + dTdu = dTds.dsdsp.dspdu + */ + + // u[0], u[1], u[2] + + double dspdu = 1/(2.0*sigmap*sqr(dist)); + + double fsimp = dTds*dsdsp*dspdu; + + for (i=0; i<3; i++) + { + dg = fsimp*sqr(d[i]); + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + //*pout << phase.a0[i] << " " << d[i] << " " << ig << " " << i << " " << fit_a_i[ipar] << endl; + + if ( (ipar=fit.refvar[joffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + } + + // u[3] + + dg = 2.0*fsimp*d[0]*d[1]; + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + + if ( (ipar=fit.refvar[joffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + + // u[4] + + dg = 2.0*fsimp*d[0]*d[2]; + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + + if ( (ipar=fit.refvar[joffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + + // u[5] + + dg = 2.0*fsimp*d[1]*d[2]; + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + + if ( (ipar=fit.refvar[joffset++]) != -1) + { + fit_a_i[ipar] += dg; + } + + + // ----- d/d occ[ip,ia], d/d occ[ip,ja] + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + fit_a_i[ipar] += T/atomi.occ; + } + + if ( (ipar=fit.refvar[joffset++]) != -1) + { + fit_a_i[ipar] += T/atomj.occ; + } + + //------ ---------------------------------------------------------------- + //------ Derivatives per phase : lat,delta2,delta1 + //------ ---------------------------------------------------------------- + + // ----- d/d(lattice parameter a) + + ioffset = phase.offset; + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + drda = (d[0] + phase.cosg*d[1] + phase.cosb*d[2])*d[0]/phase.a0[0]/dist; + dspda = (d[0]*s11 + d[1]*s12 + d[2]*s13)*d[0]/phase.a0[0]/sqr(dist)/sigmap; + + dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda + dTds*dsdsp*dspda; + + fit_a_i[ipar] += dg; + } + + // ----- d/d(lattice parameter b) + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + drda = (phase.cosg*d[0] + d[1] + phase.cosa*d[2])*d[1]/phase.a0[1]/dist; + dspda = (d[0]*s12 + d[1]*s22 + d[2]*s23)*d[1]/phase.a0[1]/sqr(dist)/sigmap; + + dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda + dTds*dsdsp*dspda; + + fit_a_i[ipar] += dg; + } + + // ----- d/d(lattice parameter c) + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + drda = (phase.cosb*d[0] + phase.cosa*d[1] + d[2])*d[2]/phase.a0[2]/dist; + dspda = (d[0]*s13 + d[1]*s23 + d[2]*s33)*d[2]/phase.a0[2]/sqr(dist)/sigmap; + + dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda + dTds*dsdsp*dspda; + + fit_a_i[ipar] += dg; + } + + + // ----- d/d(lattice angle alpha) + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + drda = - rad*phase.sina*d[1]*d[2]/dist; + + dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda; + + fit_a_i[ipar] += dg; + } + + // ----- d/d(lattice angle beta) + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + drda = - rad*phase.sinb*d[0]*d[2]/dist; + + dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda; + + fit_a_i[ipar] += dg; + } + + // ----- d/d(lattice angle gamma) + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + drda = - rad*phase.sing*d[0]*d[1]/dist; + + dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda; + + fit_a_i[ipar] += dg; + } + + // Derivatives wrt the peak sharpening parameters + + // ----- d/d(delta2) + + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + dg = -dTds*dsds2/sqr(dist); + fit_a_i[ipar] += dg; + } + + // ----- d/d(delta1) + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + dg = -dTds*dsds2/dist; + fit_a_i[ipar] += dg; + } + + // ----- d/d(pscale) + + ioffset++; + + // ----- d/d(spdiameter) + + ioffset++; + + // ----- d/d(sratio) + + if ( (ipar=fit.refvar[ioffset++]) != -1) + { + dg = dTds*dsdphi; + fit_a_i[ipar] += dg; + } + + + //------ ---------------------------------------------------------------- + //------ Derivatives per data set : dscale, qdamp, qbroad + //------ ---------------------------------------------------------------- + + ioffset = this->offset; + + // ----- d/d(dscale[is]) + + ioffset++; + + // ----- d/d(qdamp[is]) + + ioffset++; + + // ----- d/d(qbroad[ip]) + + if( (ipar=fit.refvar[ioffset++]) != -1) + { + dg = dTds*dsds2*(2.0*qbroad*sqr(dist)); + fit_a_i[ipar] += dg; + } + +} + + +/**************************************************************** +* Calculated average atom mass in this phase +*****************************************************************/ +double Phase::averageAtomicMass() +{ + double mavg = 0.0; + for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) + { + mavg += ai->occ * ai->atom_type->M; + } + mavg /= np; + return mavg; +} + +/**************************************************************** +* Calculated average scattering factor for given radiation type +*****************************************************************/ +double Phase::averageScatteringFactor(char tp) +{ + double bavg = 0.0; + for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) + { + bavg += ai->occ * ai->atom_type->sf(tp); + } + bavg /= np; + return bavg; +} + +/**************************************************************** +* Update atom weights for given scattering type +*****************************************************************/ +void Phase::setup_weights(char tp) +{ + // calculate average scattering factor + double bavg = averageScatteringFactor(tp); + // get normalized weight of each atom + for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) + { + ai->weight = ai->atom_type->sf(tp) / bavg; + } +} + +/************************************************************************ +* Extend r-range by 6 ripples of sinc before applying Qmax cutoff. +* Contributions from peaks outside should be less than 1.5%. +* +* todo: should also extend by the 5*max(sigma) +************************************************************************/ +void DataSet::extendCalculationRange(bool lout) +{ + const int nripples = 6; + // initialize calculation range to fitting range + rcmin = rfmin; + rcmax = rfmax; + ncmin = nint((rcmin - rmin)/deltar); + ncmax = nint((rcmax - rmin)/deltar); + // check if Qmax cutoff is applied + if (!(0.0 < qmax)) return; + // get extension width + double rext = nripples*2*M_PI/qmax; + // FIXME - it should be possible to have rcmin smaller than rmin, + // but there is too much spaghetti that depends on it. + rcmin = max(rmin, rfmin - rext); + rcmax = rfmax + rext; + ncmin = nint((rcmin - rmin)/deltar); + ncmax = nint((rcmax - rmin)/deltar); + if (lout) + { + *pout << " Extending PDF search distance to " << + rcmin << " -> " << rcmax << " A ...\n"; + } +} + +/************************************************************************ + * Diameter of sphere that can enclose primitive cell. + * This is equal to the longest unit cell diagonal. + ************************************************************************/ +double Phase::circum_diameter() +{ + if (atom.empty()) return 0.0; + // array of all 4 diagonals + const size_t numdiags = 4; + static double ucdiagonals[numdiags][3] = { + {+1.0, +1.0, +1.0}, + {-1.0, +1.0, +1.0}, + {+1.0, -1.0, +1.0}, + {+1.0, +1.0, -1.0} + }; + double maxnorm = -1; + for (size_t idx = 0; idx != numdiags; ++idx) + { + const double* ucd = ucdiagonals[idx]; + double normucd = sqrt(skalpro(ucd, ucd)); + if (normucd > maxnorm) + { + maxnorm = normucd; + } + } + // adjust to round-off errors + const double epsilond = sqrt(numeric_limits().epsilon()); + maxnorm = maxnorm*(1.0+epsilond) + epsilond; + return maxnorm; +} + +/************************************************************************ + * combined mean square displacements of 2 atoms along lattice vector + ************************************************************************/ +double Phase::msdAtoms(const Atom& ai, const Atom& aj, double* vl) +{ + // msd = transpose(gten*vln) * ar[i]*U[i,j]*ar[j] * gten*vln + // normalize vl + double vlnorm = sqrt(skalpro(vl,vl)); + double vln[3] = { vl[0]/vlnorm, vl[1]/vlnorm, vl[2]/vlnorm }; + // combine squared atom displacements + double U[6]; + for (size_t i = 0; i != 6; ++i) + { + U[i] = ai.u[i] + aj.u[i]; + } + // Un = ar[i]*U[i,j]*ar[j] + double Un[6] = { U[0]*ar[0]*ar[0], U[1]*ar[1]*ar[1], U[2]*ar[2]*ar[2], + U[3]*ar[0]*ar[1], U[4]*ar[0]*ar[2], U[5]*ar[1]*ar[2] }; + // rhs = gten*vln + double rhs[3] = { 0.0, 0.0, 0.0 }; + for (size_t i = 0; i != 3; ++i) + { + for (size_t j = 0; j != 3; ++j) + { + rhs[i] += gten[i][j] * vln[j]; + } + } + // msd = transpose(rhs) * Un * rhs + double msd; + msd = Un[0]*rhs[0]*rhs[0] + Un[1]*rhs[1]*rhs[1] + Un[2]*rhs[2]*rhs[2] + + 2*Un[3]*rhs[0]*rhs[1] + 2*Un[4]*rhs[0]*rhs[2] + 2*Un[5]*rhs[1]*rhs[2]; + return msd; +} + +/********************************* +------ - Save fit results + Thu Oct 13 2005 - CLF + Changed code to return a string of the + saved file. Actually saving the file is + optional. +*********************************/ +string PdfFit::save_res(string fname) +{ + //check to see if a refinement has even been done. + //after a refinement is finished, fit.iter = -1 + if(fit.iter == 0) + { + throw unassignedError("Refinement must be performed first"); + } + ofstream fout; + stringstream outfilestream; + string outfilestring = ""; + + outfilestream << " " << string(78,'=') << endl + << " PDF REFINEMENT\n" + << " Using PDFFIT version : " << PdfFit::version() << endl + << " " << string(78,'=') << endl; + + for(int ip=0; ipoutput(outfilestream); + + fit.output(outfilestream); + + outfilestream << " " << string(78,'=') << endl; + + if( fname != "" ) + { + fout.open(fname.c_str()); + + if (!fout) + { + throw IOError("Cannot create output file"); + } + + *pout << " Saving fit results to file : " << fname << endl; + + fout << outfilestream.str(); + //fout.setf(ios::showpoint); + + fout.close(); + } + + return outfilestream.str(); +} + +/************************************************* + ------- Save PDF, structure or complete result + Thu Oct 13 2005 - CLF + Changed code to return a string of the + saved file. Actually saving the file is + optional. +**************************************************/ +string PdfFit::save_pdf(int iset, string fname) +{ + string outfilestring = ""; + + //------ - Save PDF (G(r)) + + if ( (iset < 1) || (iset > nset) ) + { + throw unassignedError("data set does not exist"); + } + else if( fname != "" ) + { + ofstream fout; + fout.open(fname.c_str()); + + if (!fout) + { + throw IOError("cannot create output file"); + } + + *pout << " Saving PDF data set " << iset << " to file : " << fname << endl; + + outfilestring = datasets[iset-1]->build_pdf_file(); + + fout << outfilestring; + fout.close(); + } + else + { + outfilestring = datasets[iset-1]->build_pdf_file(); + } + + return outfilestring; +} + + +/* + Thu Oct 13 2005 - CLF + Changed code to return a string of the + saved file. +*/ +string DataSet::build_pdf_file() +{ + string blank=string(4,' '); + stringstream outfilestream; + outfilestream.setf(ios::showpoint); + + for (int i=nfmin;i<=nfmax;i++) + { + double r = i*deltar + rmin; + outfilestream << setw(12) << r << blank << setw(12) << pdftot[i] << blank << setw(12) << 0.0 + << blank << setw(12) << 1.0/sqrt(wic[i]) << blank << setw(12) + << obs[i]-pdftot[i] << endl; + } + + return outfilestream.str(); +} + +//------ - Save DIF file (Gobs-G(r)) +/* + Thu Oct 13 2005 - CLF + Changed code to return a string of the + saved file. Actually saving the file + is optional. +*/ + +string PdfFit::save_dif(int iset, string fname) +{ + + ofstream fout; + string outfilestring = ""; + + if ( (iset < 1) || (iset > nset) ) + { + throw unassignedError("Data set does not exist"); + } + else if (fname != "" ) + { + fout.open(fname.c_str()); + + if (!fout) + { + throw IOError("Cannot create output file"); + } + + *pout << " Saving difference data set " << iset << " to file : " << fname << endl; + + outfilestring = datasets[iset-1]->build_dif_file(); + + fout << outfilestring; + fout.close(); + } + else + { + outfilestring = datasets[iset-1]->build_dif_file(); + } + + return outfilestring; +} + +/* + Thu Oct 13 2005 - CLF + Changed code to return a string of the saved file. +*/ +string DataSet::build_dif_file() +{ + string blank=string(4,' '); + stringstream outfilestream; + outfilestream.setf(ios::showpoint); + + for (int i=nfmin;i<=nfmax;i++) + { + double r = i*deltar + rmin; + outfilestream << setw(12) << r << blank << setw(12) << obs[i]-pdftot[i] << endl; + } + + return outfilestream.str(); +} + +void PdfFit::selphase(int ip) +{ + if (!curset) + { + throw unassignedError("No data set selected"); + } + assert(nphase == (int)phase.size()); + if (ip == ALL) + { + curset->psel = phase; + } + else + { + // check if one-based index ip is out of bounds + if (ip < 1 || ip > nphase) + { + stringstream eout; + eout << "Phase " << ip << " undefined"; + throw unassignedError(eout.str()); + } + curset->selphase(ip - 1, phase[ip - 1]); + } +} + +void DataSet::selphase(int ip, Phase *phase) +{ + if (int(psel.size()) <= ip) + { + psel.resize(ip+1); + } + psel[ip] = phase; +} + + +vector DataSet::getcrw() const +{ + assert(mowner); + double wsqobs = mowner->totalWeighedSquareObs(); + // Get reciprocal value of wsqobs. + // Do not normalize when wsqobs is zero. + double recwsqobs = (wsqobs > 0) ? (1.0 / wsqobs) : 1.0; + vector rv = this->cumchisq; + vector::iterator xi; + for (xi = rv.begin(); xi != rv.end(); ++xi) + { + *xi = sqrt(*xi * recwsqobs); + } + return rv; +} + + +double DataSet::weighedSquareObs() const +{ + double rv = 0; + for (int i = nfmin; i <= nfmax; i++) + { + rv += wic[i] * obs[i] * obs[i]; + } + return rv; +} + + +double DataSet::getdsrw() const +{ + vector crw = this->getcrw(); + double rv = crw.empty() ? 0.0 : crw.back(); + return rv; +} + + +double DataSet::getdsredchisq() const +{ + assert(mowner); + int nredobs = mowner->totalReducedObservations(); + double c2 = this->cumchisq.empty() ? 0.0 : this->cumchisq.back(); + double rv = (nredobs > 0) ? (c2 / nredobs) : 0.0; + return rv; +} + + +void PdfFit::pdesel(int ip) +{ + if (!curset) + { + throw unassignedError("No data set selected"); + } + assert(nphase == (int)curset->psel.size()); + if (ip == ALL) + { + fill(curset->psel.begin(), curset->psel.end(), + static_cast(NULL)); + } + else + { + // check if one-based index ip is out of bounds + if (ip < 1 || ip > nphase) + { + stringstream eout; + eout << "phase " << ip << " undefined"; + throw unassignedError(eout.str()); + } + curset->psel[ip - 1] = NULL; + } +} + +// phase[ip-1] or curphase for ip == 0 +Phase* PdfFit::getphase(int ip) +{ + Phase* ph = (0 < ip && ip <= nphase) ? phase[ip-1] : curphase; + if (!ph || ip < 0 || ip > nphase) + { + throw unassignedError("Phase does not exist."); + } + return ph; +} + +void PdfFit::check_sel_args(int ip, char ijchar, int aidx1) +{ + ostringstream emsg; + if (!curset) + { + throw unassignedError("No data set selected"); + } + if (ip < 1 || ip > int(curset->psel.size())) + { + emsg << "phase " << ip << " undefined or not selected\n"; + throw unassignedError(emsg.str()); + } + if (ijchar != 'i' && ijchar != 'j') + { + ostringstream emsg; + emsg << "Invalid value of ijchar '" << ijchar << "'"; + throw ValueError(emsg.str()); + } + if (aidx1 < 1 || aidx1 > (curset->psel[ip - 1]->natoms)) + { + emsg << "invalid atom index " << aidx1 << ".\n"; + throw ValueError(emsg.str()); + } +} + +void PdfFit::selphaseForEachDataSet(Phase* ph) +{ + // find 0-based index of ph in PdfFit::phase vector + assert(count(this->phase.begin(), this->phase.end(), ph) > 0); + int phidx0 = find(this->phase.begin(), this->phase.end(), ph) - + this->phase.begin(); + vector::iterator dsi; + for (dsi = this->datasets.begin(); dsi != this->datasets.end(); ++dsi) + { + DataSet* pds = *dsi; + pds->selphase(phidx0, ph); + } +} + +void PdfFit::selectAtomType(int ip, char ijchar, char* symbol, bool select) +{ + check_sel_args(ip, ijchar); + Phase* ph = curset->psel[ip - 1]; + const LocalPeriodicTable* lpt = ph->getPeriodicTable(); + const AtomType* atp = lpt->lookup(symbol); + set& ignored = ijchar == 'i' ? + curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; + for (int aidx = 0; aidx < ph->natoms; ++aidx) + { + if (atp != ph->atom[aidx].atom_type) continue; + if (select) ignored.erase(aidx); + else ignored.insert(aidx); + } +} + +void PdfFit::selectAtomIndex(int ip, char ijchar, int aidx1, bool select) +{ + check_sel_args(ip, ijchar, aidx1); + Phase* ph = curset->psel[ip - 1]; + set& ignored = ijchar == 'i' ? + curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; + int aidx = aidx1 - 1; + if (select) ignored.erase(aidx); + else ignored.insert(aidx); +} + +void PdfFit::selectAll(int ip, char ijchar) +{ + check_sel_args(ip, ijchar); + Phase* ph = curset->psel[ip - 1]; + set& ignored = ijchar == 'i' ? + curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; + ignored.clear(); +} + +void PdfFit::selectNone(int ip, char ijchar) +{ + check_sel_args(ip, ijchar); + Phase* ph = curset->psel[ip - 1]; + set& ignored = ijchar == 'i' ? + curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; + for (int aidx = 0; aidx < ph->natoms; ++aidx) ignored.insert(aidx); +} + +/***************************************** + Wed Oct 12 2005 - CLF + Reads observed PDF from arrays. +******************************************/ +int PdfFit::read_data_arrays(char tp, double qmax, double qdamp, + int length, double * r_data, double * Gr_data, double * dGr_data, string _name) +{ + DataSet* pds = new DataSet(this); + + try { + pds->read_data_arrays(nset+1, tp, qmax, qdamp, length, + r_data, Gr_data, dGr_data, _name); + } + catch(Exception e) { + delete pds; + throw; + } + + // automatically select existing phases and its atoms for the new dataset + for (int ip=0; ipselphase(ip, this->phase[ip]); + + this->datasets.push_back(pds); + nset++; + setdata(nset); + + return 1; +} + +/***************************************** + Wed Oct 12 2005 - CLF + Reads observed PDF from a c-style string. +******************************************/ + +int PdfFit::read_data_string(string& buffer, char tp, double qmax, double qdamp, string _name) +{ + DataSet* pds = new DataSet(this); + try { + pds->read_data_string(nset+1, buffer, tp, qmax, qdamp); + } + catch(Exception e) { + delete pds; + throw; + } + // automatically select existing phases and its atoms for the new dataset + for (int ip = 0; ip < nphase; ip++) pds->selphase(ip, this->phase[ip]); + + this->datasets.push_back(pds); + nset++; + setdata(nset); + + return 1; +} + +/***************************************** + Reads observed PDF as xy ASCII file. +******************************************/ + +int PdfFit::read_data(string datafile, char tp, double qmax, double qdamp) +{ + DataSet* pds = new DataSet(this); + try { + pds->read_data(nset+1, datafile, tp, qmax, qdamp); + } + catch(Exception e) { + delete pds; + throw; + } + + // automatically select existing phases and its atoms for the new dataset + for (int ip=0; ipselphase(ip, this->phase[ip]); + + this->datasets.push_back(pds); + nset++; + setdata(nset); + + return 1; +} + +// local helper to check for regular spacing in sequence +namespace { + +template +bool isRegular(Iterator first, Iterator last) +{ + if (last - first < 2) return true; + double dx = double( *(last-1) - *first ) / double(last - first - 1); + for (Iterator p0 = first, p1 = first + 1; p1 != last; ++p0, ++p1) + { + if (fabs(*p1 - *p0 - dx) > deltar_tol) return false; + } + return true; +} + +} // local namespace + + +/* Wed Oct 12 2005 - CLF + * Using read_data_arrays adds functionality + * to pdffit2, allowing one to read data that is alread stored as arrays. + */ +void DataSet::read_data_arrays(int _iset, char tp, double _qmax, double _qdamp, + int length, double * r_data, double * Gr_data, + double * dGr_data, string _name ) +{ + iset = _iset; + + //------ Now analyse given parameters + + //------ - get exp. method (neutron/x-ray) + + scattering_type = tp; + + //------ - get QMAX and Qdamp + + qmax = _qmax; + qdamp = _qdamp; + + //------ Finally we actually read the data + + bool lwei = true; + + /* Only really care about G(r) and dG(r), the uncertainty */ + for( int i = 0; i < length; i++ ) + { + double wic; + + if( dGr_data == NULL ) + { + wic = 1.0; + lwei = false; + } + else + { + wic = 1.0/sqrt( dGr_data[i] ); + } + + this->obs.push_back( Gr_data[i] ); + this->wic.push_back(wic); + + } + + *pout << " Reading data from arrays...\n"; + + rmin = rfmin = r_data[0]; + rmax = rfmax = r_data[length - 1]; + bin = length; + deltar = (rmax - rmin)/double(bin-1); + // check if r has equidistant spacing + if (!isRegular(r_data, r_data + length)) + { + throw dataError("Irregular spacing of r values."); + } + name = _name; + + *pout << " Read PDF data set " << iset << + " (r = " << rmin << " to " << rmax << " A, " << + bin << " points) ...\n"; + if (!lwei) this->warningOnMissingWeights(); + *pout << endl; + + return; +} + +void DataSet::read_data_stream(int _iset, istream& fdata, + char tp, double _qmax, double _qdamp, string _name) +{ + string line; + + iset = _iset; + + //------ - get exp. method (neutron/x-ray) + + scattering_type = tp; + + //------ - get QMAX and Qdamp + + qmax = _qmax; + qdamp = _qdamp; + + //------ Ignore header lines + getline(fdata, line); + if (line.compare(0, 7, "History") == 0) + { + for ( ; !fdata.eof(); getline(fdata,line)) + { + if (line[0] != '#') continue; + // get 3 words from line + string w0, w1, w2; + istringstream fline(line); + fline >> w0 >> w1 >> w2; + if ( w0.find_first_not_of('#') == string::npos && + w1 == "start" && w2 == "data" ) break; + } + } + //------ Any other header lines starting with # ? + while (line[0] == '#') getline(fdata,line); + + //------ Finally we actually read the data + + // find number of columns + int ncol = 0; + if (!line.empty()) + { + double x; + istringstream sline(line); + while (sline >> x) ++ncol; + } + + vector r_data; + bool lwei = (ncol > 2); // flag for weights defined by dGr + + while (true) + { + double ri, obs; + double val, wic; + istringstream sline(line); + + sline >> ri >> obs; + if (!sline) break; + + // Obtain weights from dGr. Use dGr values only when they are all + // positive, otherwise set all weights to 1. + wic = 1.0; + switch (ncol) + { + case 3: + if (sline >> val && val > 0.0) + { + wic = 1.0/sqr(val); + } + else + { + lwei = false; + } + break; + case 4: + // skip one value + if (sline >> val >> val && val > 0.0) + { + wic = 1.0/sqr(val); + } + else + { + lwei = false; + } + break; + } + + // copy values to data arrays + r_data.push_back(ri); + this->obs.push_back(obs); + this->wic.push_back(wic); + + if (!getline(fdata, line)) break; + } + + // make sure all wic values are one when lwei is false, because + // lwei could be reset due to zero dGr value + if (!lwei) + { + fill(this->wic.begin(), this->wic.end(), 1.0); + } + + *pout << " Reading " << ncol << " columns ...\n"; + + if (!isRegular(r_data.begin(), r_data.end())) + { + throw dataError("Irregular spacing of r values."); + } + if (this->obs.size() < 2) + { + throw dataError("Incredibly short data set."); + } + bin = this->obs.size(); + this->rmin = this->rfmin = r_data.front(); + this->rmax = this->rfmax = r_data.back(); + this->nfmin = 0; + this->nfmax = bin - 1; + this->deltar = (rmax - rmin)/double(bin-1); + this->name = _name; + + *pout << " Read PDF data set " << iset << " (r = " << rmin + << " to " << rmax << " A, " << bin << " points) ...\n"; + + if (!lwei) this->warningOnMissingWeights(); + + *pout << endl; + + return; +} + +/* Wed Oct 12 2005 - CLF + * Using read_data_string adds functionality + * to pdffit2, allowing one to read data that has already been loaded. + * + * + * Thu Nov 3 2005 - CLF + * Need to add some data checking routines! + */ +void DataSet::read_data_string(int _iset, string& buffer, char tp, double _qmax, + double _qdamp, string _name) +{ + istringstream fdata(buffer); + read_data_stream(_iset, fdata, tp, _qmax, _qdamp, _name); + return; +} + +/* Wed Oct 12 2005 - CLF + * Using read_data and the above read_data_string adds functionality + * to pdffit2, allowing one to read data that has already been loaded. + */ +void DataSet::read_data(int _iset, string pfile, char tp, double _qmax, + double _qdamp) +{ + // open and check pfile + ifstream fdata(pfile.c_str()); + if (!fdata) throw IOError("File does not exist"); + // read the data + read_data_stream(_iset, fdata, tp, _qmax, _qdamp, pfile); + return; +} + +/********************************* + Sets R-range for fitting +**********************************/ +void PdfFit::range(int is, double rmin, double rmax) +{ + if( rmin >= rmax ) + { + throw ValueError("rmin must be < rmax"); + } + if (is == ALL) + { + for(is = 0; is < nset; is++) datasets[is]->range(rmin,rmax); + } + else + { + if ( (is >= 1) && (is <= nset) ) + { + datasets[is-1]->range(rmin,rmax); + } + else + { + throw ValueError("Invalid data set number"); + } + } +} + +void DataSet::range(double rmin, double rmax) +{ + if ( (rmin >= this->rmin) && (rmin <= this->rmax) + && (rmax <= this->rmax) && (rmin < rmax) ) + { + this->rfmin = rmin; + this->rfmax = rmax; + } + else + { + throw ValueError("Range outside data set limits"); + } +} + +vector< pair > DataSet::getAtomPhaseFractions() +{ + size_t nphase = psel.size(); + valarray xi(nphase); + valarray dxi(nphase); + for (size_t ip = 0; ip < nphase; ip++) + { + Phase* ph = psel[ip]; + if (!ph) + { + xi[ip] = 0.0; + dxi[ip] = 0.0; + } + else + { + double bavg = ph->averageScatteringFactor(scattering_type); + xi[ip] = ph->pscale / (bavg*bavg); + dxi[ip] = ph->dpscale / (bavg*bavg); + } + } + double xtot = xi.sum(); + vector< pair > rv(nphase, make_pair(0.0, 0.0)); + double dx2tot = (dxi * dxi).sum(); + // get normalized phase fractions fi, do this only when xtot > 0 + for (size_t ip = 0; ip < nphase && 0.0 < xtot; ip++) + { + double fi = xi[ip] / xtot; + double dfi2 = ( dxi[ip]*dxi[ip] * (xtot*xtot - 2*xtot*xi[ip]) + + xi[ip]*xi[ip]*dx2tot ) / pow(xtot, 4); + double dfi = sqrt(dfi2); + rv[ip].first = fi; + rv[ip].second = dfi; + } + return rv; +} + +vector< pair > DataSet::getCellPhaseFractions() +{ + size_t nphase = psel.size(); + valarray xi(nphase); + valarray dxi(nphase); + for (size_t ip = 0; ip < nphase; ip++) + { + Phase* ph = psel[ip]; + if (!ph) + { + xi[ip] = 0.0; + dxi[ip] = 0.0; + } + else + { + double bavg = ph->averageScatteringFactor(scattering_type); + xi[ip] = ph->pscale / (bavg*bavg * ph->np); + dxi[ip] = ph->dpscale / (bavg*bavg * ph->np); + } + } + double xtot = xi.sum(); + vector< pair > rv(nphase, make_pair(0.0, 0.0)); + double dx2tot = (dxi * dxi).sum(); + // get normalized phase fractions fi, do this only when xtot > 0 + for (size_t ip = 0; ip < nphase && 0.0 < xtot; ip++) + { + double fi = xi[ip] / xtot; + double dfi2 = ( dxi[ip]*dxi[ip] * (xtot*xtot - 2*xtot*xi[ip]) + + xi[ip]*xi[ip]*dx2tot ) / pow(xtot, 4); + double dfi = sqrt(dfi2); + rv[ip].first = fi; + rv[ip].second = dfi; + } + return rv; +} + +vector< pair > DataSet::getMassPhaseFractions() +{ + size_t nphase = psel.size(); + valarray xi(nphase); + valarray dxi(nphase); + for (size_t ip = 0; ip < nphase; ip++) + { + Phase* ph = psel[ip]; + if (!ph) + { + xi[ip] = 0.0; + dxi[ip] = 0.0; + } + else + { + double bavg = ph->averageScatteringFactor(scattering_type); + double mavg = ph->averageAtomicMass(); + xi[ip] = ph->pscale * mavg / (bavg*bavg); + dxi[ip] = ph->dpscale * mavg / (bavg*bavg); + } + } + double xtot = xi.sum(); + vector< pair > rv(nphase, make_pair(0.0, 0.0)); + double dx2tot = (dxi * dxi).sum(); + // get normalized phase fractions fi, do this only when xtot > 0 + for (size_t ip = 0; ip < nphase && 0.0 < xtot; ip++) + { + double fi = xi[ip] / xtot; + double dfi2 = ( dxi[ip]*dxi[ip] * (xtot*xtot - 2*xtot*xi[ip]) + + xi[ip]*xi[ip]*dx2tot ) / pow(xtot, 4); + double dfi = sqrt(dfi2); + rv[ip].first = fi; + rv[ip].second = dfi; + } + return rv; +} + + +void DataSet::warningOnMissingWeights() const +{ + *pout << + " ****WARN****\n" << + " Uncertainties on G(r) were absent or unreadable in your input\n" << + " data. The program reset these uncertainties to unity. This\n" << + " does not affect at all the refined parameter values. However,\n" << + " the values of the estimated uncertainties on these refined\n" << + " parameter values are not reliable.\n" << + " ****WARN****\n"; +} + +// End of file diff --git a/src/extensions/libpdffit2/pdffit.cc b/src/extensions/libpdffit2/pdffit.cc new file mode 100644 index 00000000..7eaa5f49 --- /dev/null +++ b/src/extensions/libpdffit2/pdffit.cc @@ -0,0 +1,372 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch, Chris Farrow +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* PdfFit and Fit methods for implementing PDFFIT1 interpreter commands. +* +* Comments: +* +***********************************************************************/ + +#include +#include +#include +#include +#include + +#include "MathUtils.h" +#include "pdffit.h" + + +// class methods + +const string& PdfFit::version(const char* ver) +{ + static unique_ptr vervalue; + static const string undefined_version = "1.0?"; + // definition of the version value. This should be only called once, + // when the pdffit2 module is initialized. We allow redefinition + // with the same version as this may happen when pdffit2 gets reloaded. + if (ver) + { + if (!vervalue.get()) + { + vervalue.reset(new string(ver)); + } + else if (*vervalue != ver) + { + ostringstream emsg; + emsg << "Invalid redefinition of PdfFit::version."; + throw invalid_argument(emsg.str()); + } + } + // take care of return value rv. + const string& rv = vervalue.get() ? *vervalue : undefined_version; + return rv; +} + + +// constructor and destructor + + +PdfFit::PdfFit() +{ + reset(); + init(); +} + + +PdfFit::~PdfFit() +{ + reset(); +} + + +/********************************************************** + resets the data sets and crystal structures to empty +***********************************************************/ + +void PdfFit::reset() +{ + //------ Data sets + + vector::iterator dsi = this->datasets.begin(); + for (; dsi != this->datasets.end(); ++dsi) delete *dsi; + this->datasets.clear(); + this->nset = 0; + this->curset = NULL; + + //------ Structure + + vector::iterator phi = this->phase.begin(); + for (; phi != this->phase.end(); ++phi) delete *phi; + this->phase.clear(); + this->nphase = 0; + this->curphase = NULL; + this->total = 0; + + // ------ Fit + + this->fit.reset(); +} + +void Fit::reset() +{ + // reset all data members to initial values + alambda = chisq = ochisq = fit_rw = redchisq = wnorm = 1.0; + stagnating = ntot = ndof = 1; + iter = 0; + // clean all arrays + p.clear(); + dp.clear(); + id.clear(); + ip.clear(); + covar.clear(); + alpha.clear(); + var.clear(); + dvar.clear(); + vref.clear(); + vcovar.clear(); + fconstraint.clear(); + form.clear(); + idef.clear(); + ctype.clear(); + used.clear(); + dvdp.clear(); + sdptr.clear(); + refvar.clear(); +} + + +void Fit::init_builtins() +{ + typedef pair entry; + builtin.insert(entry("-",Builtin(neg,dneg))); + builtin.insert(entry("sin",Builtin(sin,dsin))); + builtin.insert(entry("cos",Builtin(cos,dcos))); + builtin.insert(entry("tan",Builtin(tan,dtan))); + builtin.insert(entry("sind",Builtin(sind,dsind))); + builtin.insert(entry("cosd",Builtin(cosd,dcosd))); + builtin.insert(entry("tand",Builtin(tand,dtand))); + builtin.insert(entry("asin",Builtin(asin,dasin))); + builtin.insert(entry("acos",Builtin(acos,dacos))); + builtin.insert(entry("atan",Builtin(atan,datan))); + builtin.insert(entry("asind",Builtin(asind,dasind))); + builtin.insert(entry("acosd",Builtin(acosd,dacosd))); + builtin.insert(entry("atand",Builtin(atand,datand))); + builtin.insert(entry("exp",Builtin(exp,dexp))); + builtin.insert(entry("log",Builtin(log,dlog))); + builtin.insert(entry("sqr",Builtin(sqr,dsqr))); + builtin.insert(entry("cube",Builtin(cube,dcube))); + builtin.insert(entry("sqrt",Builtin(sqrt,dsqrt))); +} + +/* + Initialization routine +*/ +void PdfFit::init() // called setup in Fortran program +{ + fit.init_builtins(); +} + +void PdfFit::setphase(int ip) +{ + if ((ip<1) || (ip > nphase)) + { + stringstream eout; + eout << "Warning: phase " << ip << " undefined"; + throw unassignedError(eout.str()); + } + + Phase &phase=*this->phase[ip-1]; + + curphase = &phase; + + lat.resize(6); + lat[0].setptr(&phase.a0[0]); + lat[1].setptr(&phase.a0[1]); + lat[2].setptr(&phase.a0[2]); + lat[3].setptr(&phase.win[0]); + lat[4].setptr(&phase.win[1]); + lat[5].setptr(&phase.win[2]); + + pscale.setptr(&phase.pscale); + spdiameter.setptr(&phase.spdiameter); + stepcut.setptr(&phase.stepcut); + delta2.setptr(&phase.delta2); + delta1.setptr(&phase.delta1); + sratio.setptr(&phase.sratio); + rcut.setptr(&phase.rcut); + + x.resize(phase.natoms); + y.resize(phase.natoms); + z.resize(phase.natoms); + u11.resize(phase.natoms); + u22.resize(phase.natoms); + u33.resize(phase.natoms); + u12.resize(phase.natoms); + u13.resize(phase.natoms); + u23.resize(phase.natoms); + occ.resize(phase.natoms); + + for(int ia=0; ia nset)) + { + stringstream eout; + eout << "Warning: set " << is << " undefined"; + throw unassignedError(eout.str()); + } + + DataSet* pds = this->datasets[is-1]; + + curset = pds; + + dscale.setptr( &(pds->dscale) ); + qdamp.setptr( &(pds->qdamp) ); + qbroad.setptr( &(pds->qbroad) ); +} + + +const vector& DataSet::getpdf_obs() +{ + return this->obs; +} + + +const vector& DataSet::getpdf_fit() +{ + if (this->pdftot.empty()) + { + size_t n = this->obs.size(); + this->pdftot.assign(n, 0.0); + } + return this->pdftot; +} + + +vector PdfFit::getpdf_obs() +{ + if (!curset) + { + throw unassignedError("No data loaded"); + } + return curset->getpdf_obs(); +} + +vector PdfFit::getpdf_fit() +{ + if (!curset) + { + throw unassignedError("No fit data"); + } + return curset->getpdf_fit(); +} + +int PdfFit::getnfmin() +{ + if (!curset) + { + throw unassignedError("No data loaded"); + } + return curset->nfmin; +} + +int PdfFit::getnfmax() +{ + if (!curset) + { + throw unassignedError("No data loaded"); + } + return curset->nfmax; +} + +double PdfFit::getdeltar() +{ + if (!curset) + { + throw unassignedError("No data loaded"); + } + return curset->deltar; +} + +double PdfFit::getrmin() +{ + if (!curset) + { + throw unassignedError("No data loaded"); + } + return curset->rmin; +} + +double PdfFit::getrmax() +{ + if (!curset) + { + throw unassignedError("No data loaded"); + } + return curset->rmax; +} + +vector PdfFit::getcrw() const +{ + if (!curset) + { + throw unassignedError("No data loaded"); + } + return curset->getcrw(); +} + +map > PdfFit::getPhaseFractions() +{ + if (!curset) + { + const char* emsg = "Dataset not defined, unknown scattering type"; + throw unassignedError(emsg); + } + map > rv; + vector< pair > atomfractions; + vector< pair > cellfractions; + vector< pair > massfractions; + atomfractions = curset->getAtomPhaseFractions(); + cellfractions = curset->getCellPhaseFractions(); + massfractions = curset->getMassPhaseFractions(); + size_t n = atomfractions.size(); + for (size_t i = 0; i != n; ++i) + { + rv["atom"].push_back(atomfractions[i].first); + rv["stdatom"].push_back(atomfractions[i].second); + rv["cell"].push_back(cellfractions[i].first); + rv["stdcell"].push_back(cellfractions[i].second); + rv["mass"].push_back(massfractions[i].first); + rv["stdmass"].push_back(massfractions[i].second); + } + return rv; +} + +double PdfFit::get_scat(char tp, string smbpat) +{ + double rv; + const LocalPeriodicTable* lpt = this->curphase ? + this->curphase->getPeriodicTable() : + LocalPeriodicTable::instance(); + const AtomType* atp = lpt->lookup(smbpat); + try { + rv = atp->sf(tp); + } + catch (runtime_error e) { + throw ValueError(e.what()); + } + return rv; +} + +// End of file diff --git a/src/extensions/libpdffit2/pdffit.h b/src/extensions/libpdffit2/pdffit.h new file mode 100644 index 00000000..a4b030ac --- /dev/null +++ b/src/extensions/libpdffit2/pdffit.h @@ -0,0 +1,611 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* classes Phase, DataSet, Fit, Pdf, PdfFit, RefVar, NonRefVar, Builtin +* +* Comments: Main header file included by all others. Big mess. +* +***********************************************************************/ + +#ifndef PDFFIT_H_INCLUDED +#define PDFFIT_H_INCLUDED + +#include +#include +#include +#include +#include +#include + +#include "AtomType.h" +#include "Atom.h" +#include "PairDistance.h" +#include "matrix.h" +#include "exceptions.h" +#include "LocalPeriodicTable.h" +#include "OutputStreams.h" + +using namespace std; + +/*********************************************************************** + * Here are constants for the parameter coding - DO NOT CHANGE + * unless you are rewriting the program !!!!!!!!!!!!!!!!!!!!!! + *********************************************************************** + * + * n_st : Number of global structural parameters per phase + * n_at : Number of parameters for each atom + * n_ex : Number of experimental parameters per dataset + * + ***********************************************************************/ + +const int n_st = 11; +const int n_at = 10; +const int n_ex = 3; + +const int ALL = -1; +typedef vector::iterator VAIT; + +enum FCON { USER, IDENT, FCOMP, FSQR }; + +typedef double (*fbuiltin)(double); + +class Fit; +class PdfFit; +class DataSet; +class Phase; +class NonRefVar; +class RefVar; + + +// non-refinable variables accessible to the users +class NonRefVar +{ + friend class PdfFit; + double *a; + + public: + NonRefVar() : a(NULL) + { + mtype = "NonRefVar"; + } + bool isAssigned() { return (a != NULL); } + void setptr(double* a) { this->a = a; } + void setval(double a) { *this->a = a; } + double get() { + double rv = (a) ? *a : 0.0; + return rv; + } + const string& type() const + { + return mtype; + } + + protected: + string mtype; +}; + +// Refinable variables accessible to the users +class RefVar: public NonRefVar +{ + friend class PdfFit; + public: + RefVar() : NonRefVar() + { + mtype = "RefVar"; + } +}; + + +typedef double (*fcon)(vector&, vector&); +typedef double (*fbuiltin) (double); + +// TK commented out 03/31/05 +// class Builtin { fbuiltin func, deriv; +// public: +// Builtin(fbuiltin func, fbuiltin deriv): func(func), deriv(deriv) {} +// }; + +// TK 03/31/05 replaced above with +class Builtin { + public: + fbuiltin func, deriv; // made these public. + // Really should just be a struct, or provide + // const pointers. + Builtin(fbuiltin func, fbuiltin deriv): func(func), deriv(deriv) {} +}; + +// contains the address of the variable, and the current value of the parameter +class Fit +{ + friend class PdfFit; + + map builtin; + + double parse(string line, vector &dnumdp); + double compute(string &expr, vector &dnumdp); + string substitute_pars(string &expr); + double getnum(istringstream &inexpr, vector &dnumdp); + void init_builtins(); + void reset(); + + public: + Fit() + { + reset(); + } + + // CLF Wed May 25 2005 + // Made these members of fit. Were local variables to + // refine function. + double alambda, chisq, ochisq; + int stagnating; + // CLF + + int iter; + double fit_rw; + double redchisq; // reduced chi-squared + double wnorm; // sum of weighted squared datapoints + int ntot, ndof; // total # of points, number of degrees of freedom + // parameter related variables + vector p; // fit-parameters + vector dp; // errors on the refined parameters; + vector id; // parameter identification number (arbitrary integer) + vector ip; // parameter selection + matrix covar, alpha; // covariance matrix and curvature + + // constraint related variables + vector var; // constrained variables + vector dvar; // errors on the constrained variables + vector vref; // true if variable contains free parameters + matrix vcovar; // covariance matrix on constrained variables + vector fconstraint; // constraint equations + vector form; // constraint formula + vector idef; // default parameter if no explicit constraint + vector ctype; // type of constraint + + vector used; // vector of used parameter indices (not ids) in the current constraint + + // variables relating constraint-parameter + matrix dvdp; // derivative of var wrt p + + // variables relating to refinable variables + vector sdptr; // pointer to standard deviation of refinable variable + + vector refvar; // integer pointer from refinable variable to actual constraint # + + void fixpar(int pidx); + void freepar(int pidx); + void setpar(unsigned int pidx, double val); + double getpar(unsigned int pidx); + void constrain(double &a, string form); + void constrain(double &a, double f(vector&, vector&) ); + void constrain(double &a, int ipar ); + void constrain(double &a, int ipar, FCON type); + void constrain(double &a, string inpform, fcon f, int idef, FCON type); + int vfind(double &a); // look for variable in list of constraints + int parfind(unsigned int j); + void fill_variables(); + void fill_errors(); + int varsize() const { return var.size(); } + int psize() const { return p.size(); } + //Thu Oct 13 2005 - CLF + void output(ostream &fout); + void out(); + + private: + vector order_by_id() const; + +}; + +class PdfFit +{ + // class methods + + public: + static const string& version(const char* ver=NULL); + + private: + + //Struct cr; + int nphase; + int total; // total # of atoms + vector phase; + + Fit fit; + + // Dataset parameters + int nset; + vector datasets; + DataSet *curset; + + void init(); + + public: + + void fit_setup(); + void fit_errors(); + void fit_theory(bool ldiff, bool lout); + double totalWeighedSquareObs() const; + int totalReducedObservations() const; + + private: + + void initarrays(); + + void mrqmin(vector &a, vector &ia, matrix &covar, + matrix &alpha, double &chisq, double &alamda, + bool deriv); + void mrqmin(double a[], int ia[], int ma, double **covar, + double **alpha, double *chisq, double *alamda, bool deriv); + void mrqcof(double*, int*, int, double**, double*, double*, bool deriv); + void fill_variables(vector a); + int getnpar() { return nset*n_ex + nphase*n_st + total*n_at; } + + public: + + Phase* curphase; + PdfFit(); + ~PdfFit(); + + void alloc(char tp, double qmax, double qdamp, + double rmin, double rmax, int bin); + void calc(); + int read_struct(string fname); // returns 1:OK, 0:Error + int read_data(string fname, char tp, double qmax, double qdamp); + //Wed Oct 12 2005 - CLF + int read_struct_string(char * buffer); // returns 1:OK, 0:Error + int read_data_string(string& buffer, char tp, double qmax, double + qdamp, string name = "string"); + int read_data_arrays(char tp, double qmax, double qdamp, int length, + double * r_data, double * Gr_data, double * dGr_data = NULL, + string name = "array"); + void reset(); + //Thu Oct 13 2005 - CLF + string save_pdf(int iset, string fname = ""); + string save_dif(int iset, string fname = ""); + string save_res(string fname = ""); + string save_struct(int ip, string strucfile = ""); + string show_struct(int ip); + // + int refine(bool deriv, double toler = 0.00000001); + int refine_step(bool deriv, double toler = 0.00000001); + double getrw(void) + { + return fit.fit_rw; + } + void setpar(unsigned int pidx, double val) + { + fit.setpar(pidx, val); + } + void setpar(unsigned int pidx, RefVar v) + { + fit.setpar(pidx, *v.a); + } + double getpar(unsigned int pidx) + { + return fit.getpar(pidx); + } + void fixpar(int pidx) + { + fit.fixpar(pidx); + } + void freepar(int pidx) + { + fit.freepar(pidx); + } + void range(int iset, double rmin, double rmax); + + void constrain(RefVar v, double f(vector&, vector&)) + { + fit.constrain(*v.a,f); + } + void constrain(RefVar v, string form) + { + fit.constrain(*v.a,form); + } + void constrain(RefVar v, int ipar) + { + fit.constrain(*v.a,ipar); + } + void constrain(RefVar v, int ipar, FCON type) + { + fit.constrain(*v.a,ipar,type); + } + void setphase(int ip); + void setdata(int is); + void setvar(RefVar v, double a) { v.setval(a); } + double getvar(RefVar v) { return v.get(); } + void setvar(NonRefVar v, double a) { v.setval(a); } + double getvar(NonRefVar v) { return v.get(); } + + void selphase(int ip); + void pdesel(int ip); + Phase* getphase(int ip); + int num_phases() { return this->nphase; } + int num_datasets() { return this->nset; } + + private: + + void check_sel_args(int ip, char ijchar, int aidx1=1); + void selphaseForEachDataSet(Phase*); + + public: + + void selectAtomType(int ip, char ijchar, char* symbol, bool select); + void selectAtomIndex(int ip, char ijchar, int aidx1, bool select); + void selectAll(int ip, char ijchar); + void selectNone(int ip, char ijchar); + + pair bond_angle(int ia, int ja, int ka); + PairDistance bond_length_atoms(int ia, int ja); + vector bond_length_types(string symi, string symj, + double bmin, double bmax); + + vector getpdf_obs(); + vector getpdf_fit(); + + // current phase and set refinable variable pointers + vector lat, x, y, z, u11, u22, u33, u12, u13, u23, occ; + RefVar pscale; + RefVar spdiameter; + NonRefVar stepcut; + RefVar sratio; + RefVar delta2, delta1; + RefVar dscale, qdamp, qbroad; + NonRefVar rcut; + int getnfmin(); + int getnfmax(); + double getdeltar(); + double getrmin(); + double getrmax(); + vector getcrw() const; + map > getPhaseFractions(); + double get_scat(char tp, string smbpat); +}; + +class Pdf +{ + public: + + int nfmin, nfmax, ncmin, ncmax; + double qmax, qdamp, rmin, rmax, deltar; + double rfmin, rfmax; // fit range + double rcmin, rcmax; // extended calculation range + double dscale, ddscale, qbroad, dqbroad, dqdamp; + + Pdf() + { + nfmin = nfmax = ncmin = ncmax = 0; + qmax = qdamp = rmin = rmax = deltar = 0.0; + rfmin = rfmax = rcmin = rcmax = 0.0; + dscale = 0.0; ddscale = 0.0; + qbroad = dqbroad = dqdamp = 0.0; + } + + vector pdftot; // total pdf + matrix calc; // ?? pdf for each phase and each point in the dataset +}; + +class DataSet: public Pdf +{ + + private: + int offset; + const PdfFit* mowner; + void applyQmaxCutoff(double* y, size_t len); + void extendCalculationRange(bool lout); + string selectedAtomsString(int ip, char ijchar); + void read_data_stream(int iset, istream& fdata, + char tp, double qmax, double qdamp, string name); + void warningOnMissingWeights() const; + + public: + + int iset; // Dataset index + char scattering_type; + string name; + + DataSet(const PdfFit* owner) : Pdf(), mowner(owner) + { + dscale = 1.0; ddscale = 0; + qbroad = dqbroad = 0.0; + }; + // pdf-related + void determine(bool ldiff, bool lout, Fit &par); + void pdf_derivative (Phase& phase, + const Atom& atomi, const Atom& atomj, double rk, double sigma, + double sigmap, double dist, double d[3], double ampl, + double gaus, Fit &fit, double* fit_a_i); + + const vector& getpdf_fit(); + const vector& getpdf_obs(); + //Thu Oct 13 2005 - CLF + string build_pdf_file(); + string build_dif_file(); + // + void read_data(int iset, string fname, char tp, double qmax, double qdamp); + //Wed Oct 12 2005 - CLF + void read_data_string(int iset, string& buffer, char tp, double qmax, double qdamp, + string name = "string"); + void read_data_arrays(int iset, char tp, double qmax, double qdamp, + int length, double * r_data, double * Gr_data, double * dGr_data = NULL, string name = "array"); + // + //Thu Oct 13 2005 - CLF + void output(ostream &fout); + void range(double rmin, double rmax); + + void fit_setup_derivatives(Fit &par); + void selphase(int ip, Phase *phase); + + vector getcrw() const; + double weighedSquareObs() const; + double getdsrw() const; + double getdsredchisq() const; + + // phase fraction calculations + vector< pair > getAtomPhaseFractions(); + vector< pair > getCellPhaseFractions(); + vector< pair > getMassPhaseFractions(); + + // fit related + matrix fit_a, fit_b; // nbin*npar + + int bin; + vector obs, wic; + + // phase specific information this dataset: selected, allowed atoms + vector psel; // phase selection + // i and j indices to be ignored when calculating PDF + map > phase_ignore_i; + map > phase_ignore_j; + vector cumchisq; + friend void PdfFit::fit_setup(); + +}; + +class Phase { + + private: + + // data + string spcgr, name; + int offset; + LocalPeriodicTable _local_periodic_table; + + double ar[3], wrez[3], dar[3], dwrez[3]; + double gten[3][3], dgten[3][3]; // tensor and sd + double rten[3][3], drten[3][3]; // tensor and sd + double _eps[3][3][3], _reps[3][3][3], _deps[3][3][3], _dreps[3][3][3]; + double &eps(int i, int j, int k) { return _eps[i][j][k]; } + double &reps(int i, int j, int k) { return _reps[i][j][k]; } + double &deps(int i, int j, int k) { return _deps[i][j][k]; } + double &dreps(int i, int j, int k) { return _dreps[i][j][k]; } + + // methods + + set selectAtomsOf(string symbol); + + // Added a return value + string get_scat_string(char tp, const AtomType* atp); + + // shift to equivalent lattice position nearest to the origin + void make_nearest(double xyz[3]); + + public: + + vector atom_types; + int iphase; + double cosa, cosb, cosg, sina, sinb, sing; + double v, dv, vr, dvr; + int icc[3]; + // Phase has a number of public elements as it is often cross-referenced + + int natoms; // total number of atoms in multicell icc0 x icc1 x icc2 + int ncatoms; // number of atoms in one cell + + // IMPORTANT: atom[i].atom_type must be a pointer to AtomType + // from _local_periodic_table. Insertion of a new entry to + // vector atom must be followed by reassign_atom_type(entry); + vector atom; + + double pscale, dpscale; + double a0[3], win[3], da0[3], dwin[3]; + double np, dnp, rho0, drho0; // np: total occupance, rho0: number density + + // pdf-related + double delta2, sratio, rcut; + double ddelta2, dsratio, delta1, ddelta1; + double spdiameter, dspdiameter; // spherical particle diameter + double stepcut; + double dnorm, corr_max; + + + Phase() + { + pscale = 1.0; dpscale = 0.0; + sratio=1.0; + a0[0] = a0[1] = a0[2] = da0[0] = da0[1] = da0[2] = + win[0] = win[1] = win[2] = dwin[0] = dwin[1] = dwin[2] = + delta2 = ddelta2 = dsratio = rcut = 0.0; + delta1 = ddelta1 = corr_max = 0.0; + spdiameter = dspdiameter = 0.0; + stepcut = 0.0; + icc[0] = icc[1] = icc[2] = ncatoms = natoms = 0; + spcgr = "P1"; + name = "UNNAMED"; + } + inline size_t nscat() + { + return atom_types.size(); + } + void read_struct(int iphase, string fname); + void read_struct_string(int iphase, char * buffer); + private: + void read_struct_stream(int _iphase, istream& fstruct); + void read_header(istream &fstruct, bool &ldiscus); + void read_atoms(istream &fstruct); + // Reset atom_type to point to an entry from _local_periodic_table + void reassign_atom_type(Atom* ap); + + public: + //Thu Oct 13 2005 - CLF + void output(ostream &fout); + template void save_struct(Stream &fout); + + void lattice(); + void show_lattice(); + void tensor(double ten[3][3], double vec[3], double win[3]); + void dtensor(double vec[3], double win[3], double dten[3][3], double dvec[3], double dwin[3]); + + double skalpro(const double h[3], const double k[3]); + double dskalpro(double h[3], double k[3], double dh[3], double dk[3]); + + double circum_diameter(); // diameter of a sphere enclosing unit cell + // mean square displacement of 2 atoms + double msdAtoms(const Atom& ai, const Atom& aj, double* vl); + // reference to the local periodic table + LocalPeriodicTable* getPeriodicTable(); + + // pdf-related + + double averageAtomicMass(); + double averageScatteringFactor(char tp); + void setup_weights(char tp); + + pair bond_angle(int ia, int ja, int ka); + PairDistance bond_length_atoms(int ia, int ja); + vector bond_length_types(string symi, string symj, + double bmin, double bmax); + // Fri Oct 28 2005 - CLF + // Added a return value + void show_scat(char tp); + string get_scat_string(char tp); + string get_scat_string(char tp, string smbpat); + void set_scat(char tp, const string& smbpat, double value); + void reset_scat(const string& smbpat); + + friend class Atom; + friend class DataSet; + friend void PdfFit::fit_setup(); + friend void DataSet::fit_setup_derivatives(Fit &par); + friend void DataSet::determine(bool ldiff, bool lout, Fit &par); + friend void DataSet::pdf_derivative (Phase& phase, + const Atom& atomi, const Atom& atomj, double rk, double sigma, + double sigmap, double dist, double d[3], double ampl, + double gaus, Fit &fit, double* fit_a_i); + friend void PdfFit::fit_theory(bool ldiff, bool lout); +}; + + +#endif // PDFFIT_H_INCLUDED diff --git a/src/extensions/libpdffit2/pdflsmin.cc b/src/extensions/libpdffit2/pdflsmin.cc new file mode 100644 index 00000000..078d2754 --- /dev/null +++ b/src/extensions/libpdffit2/pdflsmin.cc @@ -0,0 +1,326 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* PdfFit methods for Levenberg-Marquardt least-squares minimization. +* +* Comments: +* +***********************************************************************/ + +//#define CHECK_DERIVATIVES + +#include +#include +#include +#include +#include + +#include "MathUtils.h" +#include "matrix.h" +#include "nrutil.h" +#include "pdffit.h" + +using NS_PDFFIT2::pout; + +void PdfFit::mrqmin(vector &a, vector &ia, matrix &covar, + matrix &alpha, double &chisq, double &alamda, bool deriv) +{ + using std::copy; + + int ma = a.size(); + double** _covar = new double*[ma]; + double** _alpha = new double*[ma]; + double* _a = new double[ma]; + + copy(a.begin(), a.end(), _a); + + for (int i = 0; i < ma; i++) + { + _covar[i] = &covar[i][0]-1; + _alpha[i] = &alpha[i][0]-1; + } + + int* iaptr = ia.size() ? &(ia[0]) - 1 : NULL; + mrqmin(_a-1, iaptr, ma, _covar-1, _alpha-1, &chisq, &alamda, deriv); + + copy(_a, _a + ma, a.begin()); + + delete [] _a; + delete [] _alpha; + delete [] _covar; +} + + +// Levenberg-Marquardt method, attempting to reduce the value Chi2 of a fit +// between a set of data points x[1..ndata], y[1..ndata] with individual +// standard deviations sig[1..ndata], and a nonlinear function dependent on ma +// coeffcients a[1..ma]. The input array ia[1..ma] indicates by nonzero +// entries those components of a that should be fitted for, and by zero entries +// those components that should be held fixed at their input values. The +// program re- turns current best-fit values for the parameters a[1..ma], and +// Chi2=chisq. The arrays covar[1..ma][1..ma], alpha[1..ma][1..ma] are used as +// working space during most iterations. Supply a routine +// funcs(x,a,yfit,dyda,ma) that evaluates the fitting function yfit, and its +// derivatives dyda[1..ma] with respect to the fitting parameters a at x. On +// the first call provide an initial guess for the parameters a, and set +// alamda<0 for initialization (which then sets alamda=.001). If a step +// succeeds chisq becomes smaller and alamda de- creases by a factor of 10. If +// a step fails alamda grows by a factor of 10. You must call this routine +// repeatedly until convergence is achieved. Then, make one final call with +// alamda=0, so that covar[1..ma][1..ma] returns the covariance matrix, and +// alpha the curvature matrix. (Parameters held fixed will return zero +// covariances.) +void PdfFit::mrqmin(double a[], int ia[], int ma, double **covar, double **alpha, double *chisq, double *alamda, bool deriv) +{ + void covsrt(double **covar, int ma, int ia[], int mfit); + void gaussj(double **a, int n, double **b, int m); + + int j, k, l; + static int mfit; + static double ochisq, *atry, *beta, *da, **oneda; + + if (*alamda < 0.0) + { + // Initialization. + atry = dvector(1, ma); + beta = dvector(1, ma); + da = dvector(1, ma); + + for (mfit = 0, j = 1; j <= ma; j++) + if (ia[j]) mfit++; + + oneda = dmatrix(1, mfit, 1, 1); + *alamda = 0.001; + mrqcof(a, ia, ma, alpha, beta, chisq, deriv); + ochisq=(*chisq); + for (j = 1; j <= ma; j++) atry[j]=a[j]; + + *pout << "\n******************************** ITER: " << fit.iter << " ********************************\n"; + fit.fit_rw = sqrt(ochisq/fit.wnorm); + fit.redchisq = ochisq/(fit.ntot-fit.ndof); + fit.out(); + *pout << " chisq.: " << ochisq << " red.chisq.: " << fit.redchisq << " Rw: " << fit.fit_rw << endl; + } + // Alter linearized fitting matrix, by augmenting diagonal elements. + for (j = 1; j <= mfit; j++) + { + for (k = 1; k <= mfit; k++) covar[j][k]=alpha[j][k]; + covar[j][j]=alpha[j][j]*(1.0+(*alamda)); + oneda[j][1]=beta[j]; + } + + //=================================================================== +#if defined(TEST) + print(covar, mfit); double **save = dmatrix(1, mfit, 1, mfit); + for(int i = 1; i <= mfit; i++) for(j = 1; j <= mfit; j++) save[i][j] = covar[i][j]; + for(int i = 1; i <= mfit; i++) printf("%lg ", oneda[i][1]); printf("\n"); +#endif + //=================================================================== + + gaussj(covar, mfit, oneda, 1); // Matrix solution. + + //=================================================================== +#if defined(TEST) + double res; + for(int i = 1; i <= mfit; i++) + { + res = 0; + for(j = 1; j <= mfit; j++) + res += save[i][j]*oneda[j][1]; printf("%lg ", res); + } + printf("\n"); +#endif + //================================================================= + + for (j = 1; j <= mfit; j++) da[j]=oneda[j][1]; + if (*alamda == 0.0) { // Once converged, evaluate covariance matrix. + covsrt(covar, ma, ia, mfit); + covsrt(alpha, ma, ia, mfit); // Spread out alpha to its full size too. + free_dmatrix(oneda, 1, mfit, 1, 1); + free_dvector(da, 1, ma); + free_dvector(beta, 1, ma); + free_dvector(atry, 1, ma); + return; + } + for (j = 0, l = 1; l <= ma; l++) // Did the trial succeed? + if (ia[l]) atry[l]=a[l]+da[++j]; + mrqcof(atry, ia, ma, covar, da, chisq, deriv); + if (*chisq < ochisq) { // Success, accept the new solution. + *alamda *= 0.1; + ochisq=(*chisq); + for (j = 1; j <= mfit; j++) { + for (k = 1; k <= mfit; k++) alpha[j][k]=covar[j][k]; + beta[j]=da[j]; + } + for (l = 1; l <= ma; l++) a[l]=atry[l]; + } else { // Failure, increase alamda and return. + *alamda *= 10.0; + *chisq = ochisq; + } +} + +// Used by mrqmin to evaluate the linearized fitting matrix alpha, and +// vector beta as in (15.5.8), and calculate Chi2. +void PdfFit::mrqcof(double a[], int ia[], int ma, double **alpha, double beta[], double *chisq, bool deriv) +{ + int i, j, k, l, m, mfit = 0; + double wt, sig2i, dy, *dyda; + //double ymod; + + dyda = dvector(1, ma); + for (j = 1; j <= ma; j++) + if (ia[j]) mfit++; + for (j = 1; j <= mfit; j++) { // Initialize (symmetric) alpha, beta. + for (k = 1; k <= j; k++) alpha[j][k]=0.0; + beta[j]=0.0; + } + + // careful: a of mrqcof is in fact atry of mrqmin! + for (j = 1; j <= ma; j++) + fit.p[j-1] = a[j]; + + // printf("a=%.12lg %.12lg %.12lg\n", a[1], a[2], a[3]); + + fit_theory(deriv, false); // yields pdftot and derivatives wrt parameters + + //============================================================================= +#if !defined(CHECK_DERIVATIVES) + // deriv: true for analytic derivatives, false for numerical ones + if (!deriv) +#endif + { +#if defined(CHECK_DERIVATIVES) + matrix dersave = datasets[0]->fit_b; +#endif + + // numerical derivative + vector > pdfsave; + for (int is = 0; is < nset; is++) + { + pdfsave.push_back(datasets[is]->pdftot); + + // fit_b used both in numerical and analytical derivative case + datasets[is]->fit_b.clear(); + datasets[is]->fit_b.resize(datasets[is]->ncmax+1, fit.psize()); + } + + double psave; + + if (fit.psize() != ma) { + throw constraintError("Inconsistent number of parameters"); + } + + for (int ip = 0; ip < fit.psize(); ip++) + { + if (!fit.ip[ip]) continue; + + double delta = double_eps*fit.p[ip]; + if (fabs(delta) < double_eps/100) delta = double_eps; + psave = fit.p[ip]; + fit.p[ip] += delta; + fit_theory(false, false); // yields pdftot and derivatives wrt parameters + fit.p[ip] = psave; + + for (int is = 0; is < nset; is++) + { + DataSet* pds = this->datasets[is]; + + for (i = pds->nfmin; i <= pds->nfmax; i++) + { + pds->fit_b[i][ip] = (pds->pdftot[i]-pdfsave[is][i])/delta; + } + } + +#if defined(CHECK_DERIVATIVES) + i = 200; + { + *pout << "DERIVATIVES:: ANALYTIC : " << dersave[i][ip] << endl; + *pout << " NUMERICAL: " << (datasets[0]->pdftot[i]-pdfsave[0][i])/delta + << " (delta[" << fit.id[ip] << "]=" << delta << ")" << endl << endl; + } +#endif + } + for (int is = 0; is < nset; is++) datasets[is]->pdftot = pdfsave[is]; + +#if defined(CHECK_DERIVATIVES) + exit(0); +#endif + } + //============================================================================= + + *chisq = 0.0; + + for (int is = 0; is < nset; is++) + { + DataSet* pds = this->datasets[is]; + pds->cumchisq.clear(); + + for (i = pds->nfmin; i <= pds->nfmax; i++) + { // Summation loop over all data. + + //(*funcs)(x[i], a, &ymod, dyda, ma); + sig2i = pds->wic[i]; + dy = pds->obs[i] - pds->pdftot[i]; + + for (j = 1; j <= ma; j++) + dyda[j] = pds->fit_b[i][j-1]; // of course use fit_b, NOT fit_a + + //if (i==0) printf("dyda=%.12lg %.12lg %.12lg\n", dyda[1], dyda[2], dyda[3]); + + for (j = 0, l = 1; l <= ma; l++) { + if (ia[l]) { + wt = dyda[l]*sig2i; + for (j++, k = 0, m = 1; m <= l; m++) + if (ia[m]) alpha[j][++k] += wt*dyda[m]; + beta[j] += dy*wt; + } + } + double prev = pds->cumchisq.empty() ? 0.0 : pds->cumchisq.back(); + double chisq_contribution = dy * dy * sig2i; + pds->cumchisq.push_back(prev + chisq_contribution); + } + *chisq += pds->cumchisq.empty() ? 0.0 : pds->cumchisq.back(); + } + for (j = 2; j <= mfit; j++) // Fill in the symmetric side. + for (k = 1; k < j; k++) alpha[k][j]=alpha[j][k]; + free_dvector(dyda, 1, ma); + //print(alpha, ma); +} + + +// Expand in storage the covariance matrix covar, so as to take into account +// parameters that are being held fixed. (For the latter, return zero +// covariances.) +void covsrt(double **covar, int ma, int ia[], int mfit) +{ + int i, j, k; + for (i = mfit+1; i <= ma; i++) + { + for (j = 1; j <= i; j++) + { + covar[i][j]=covar[j][i]=0.0; + } + } + k = mfit; + for (j = ma; j >= 1; j--) { + if (ia[j]) + { + for (i = 1; i <= ma; i++) swap(covar[i][k], covar[i][j]); + for (i = 1; i <= ma; i++) swap(covar[k][i], covar[j][i]); + k--; + } + } +} + +// End of file diff --git a/src/extensions/libpdffit2/scatlen.cc b/src/extensions/libpdffit2/scatlen.cc new file mode 100644 index 00000000..81beee03 --- /dev/null +++ b/src/extensions/libpdffit2/scatlen.cc @@ -0,0 +1,114 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Phase methods for accessing scattering factors. +* +* Comments: Up to date with 1.3.10 Fortran version. +* In Fortran this was fourier.f +* +***********************************************************************/ + +#include +#include + +#include "LocalPeriodicTable.h" +#include "StringUtils.h" +#include "pdffit.h" + +using NS_PDFFIT2::pout; + +void Phase::show_scat(char tp) +{ + *pout << get_scat_string(tp); +} + +string Phase::get_scat_string(char tp) +{ + stringstream sout; + vector::iterator atp; + for (atp = atom_types.begin(); atp != atom_types.end(); ++atp) + { + sout << get_scat_string(tp, *atp); + } + return sout.str(); +} + +string Phase::get_scat_string(char tp, string smbpat) +{ + const LocalPeriodicTable* lpt = getPeriodicTable(); + const AtomType* atp = lpt->lookup(smbpat); + return get_scat_string(tp, atp); +} + +string Phase::get_scat_string(char tp, const AtomType* atp) +{ + stringstream sout; + string usymbol = toupper(atp->symbol); + switch(tp) + { + case 'n': + case 'N': + sout << "Neutron scattering length for " << usymbol << " : "; + break; + case 'x': + case 'X': + sout << "X-ray scattering factor for " << usymbol << " : "; + break; + } + // this also throws runtime_error for invalid tp value + sout << atp->sf(tp); + return sout.str(); +} + +void Phase::set_scat(char tp, const string& smbpat, double value) +{ + LocalPeriodicTable* lpt = getPeriodicTable(); + const string& stdsmbl = lpt->lookup(smbpat)->symbol; + switch (tp) + { + case 'n': + case 'N': + lpt->setNsf(stdsmbl, value); + break; + case 'x': + case 'X': + lpt->setXsf(stdsmbl, value); + break; + default: + ostringstream emsg; + emsg << "Invalid scattering type '" << tp << "'"; + throw runtime_error(emsg.str()); + } + const AtomType* atp = lpt->symbol(stdsmbl); + *pout << get_scat_string(tp, atp); +} + +void Phase::reset_scat(const string& smbpat) +{ + LocalPeriodicTable* lpt = getPeriodicTable(); + const AtomType* atp = lpt->lookup(smbpat); + const string& stdsmbl = atp->symbol; + lpt->reset(stdsmbl); + *pout << get_scat_string('N', stdsmbl); + *pout << get_scat_string('X', stdsmbl); +} + + +LocalPeriodicTable* Phase::getPeriodicTable() +{ + return &this->_local_periodic_table; +} + + +// End of file diff --git a/src/extensions/libpdffit2/stru.cc b/src/extensions/libpdffit2/stru.cc new file mode 100644 index 00000000..f9022f23 --- /dev/null +++ b/src/extensions/libpdffit2/stru.cc @@ -0,0 +1,837 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Jacques Bloch +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* PdfFit and Phase methods for reading and saving the structure, +* and for calculating bond lengths and angles. +* +* Comments: +* +***********************************************************************/ + +// Up to date with 1.3.10 Fortran version + +#include +#include +#include +#include + +#include "PointsInSphere.h" +#include "LocalPeriodicTable.h" +#include "Atom.h" +#include "StringUtils.h" +#include "PairDistance.h" +#include "MathUtils.h" +#include "pdffit.h" + +using NS_PDFFIT2::pout; + + +/*********************************************************************** +* local helper routines +***********************************************************************/ + +namespace { + +// Read a number and an eventual comma delimiter or EOF +template Type vget(istringstream &fin, char delim) +{ + char c; + Type val; + + fin >> val; + + // Return if reading error + if (!fin) { + string line; + fin.clear(); + fin >> line; + throw vgetException(line); + } + if (!fin) return 0; + + // check on end of file before looking for delimiter + if (fin.eof()) return val; + + // read eventual delimiter + fin >> c; + + // if a character c has been read and it is not the expected + // delimiter: put back for next reading + if (fin && c != delim) fin.unget(); + + // clear any error in case no delimiter could be read + if (!fin) fin.clear(); + + return val; +} + +// read space delimited value +template Type vget(istringstream &fin) +{ + Type val; + fin >> val; + return val; +} + +// read space or comma delimited double +double dget(istringstream &fin) +{ + return vget(fin, ','); +} + +// read space or comma delimited integer +int iget(istringstream &fin) +{ + return vget(fin, ','); +} + + +// strip leading spaces +string lstrip(const string &line) +{ + string naked; + string::size_type i = line.find_first_not_of(" \t"); + if (i != string::npos) naked = line.substr(i); + return naked; +} + +// substitute all occurences of literal pattern with new string +void substitute(string& s, const string& pat, const string& sub) +{ + string::size_type p; + string::size_type start = 0; + for (p = s.find(pat, start); p != string::npos; p = s.find(pat, start)) + { + s = s.replace(p, pat.size(), sub); + start = p + sub.size(); + } +} + + +} // local namespace + + +/*********************************************************************** +* Read a structure file. +***********************************************************************/ +int PdfFit::read_struct(string structfile) +{ + Phase* ph = new Phase(); + try { + ph->read_struct(nphase+1, structfile); + } + catch(Exception e) { + delete ph; + // Moved error catching to python bindings. + throw; + } + this->phase.push_back(ph); + this->total += ph->natoms; + this->nphase++; + this->selphaseForEachDataSet(ph); + this->setphase(this->nphase); + ph->show_lattice(); + return 1; +} + +/*********************************************************************** + Wed Oct 12 2005 - CLF + Read a structure from a storage string. +*************************************************************************/ +int PdfFit::read_struct_string(char * buffer) +{ + Phase* ph = new Phase(); + try { + ph->read_struct_string(nphase+1, buffer); + } + catch(Exception e) { + delete ph; + throw; + } + this->phase.push_back(ph); + this->total += ph->natoms; + this->nphase++; + this->selphaseForEachDataSet(ph); + this->setphase(this->nphase); + ph->show_lattice(); + return 1; +} + +void Phase::read_struct(int _iphase, string structfile) +{ + ifstream fstruct; + + fstruct.open(structfile.c_str()); + if (!fstruct) throw IOError("File does not exist"); + + read_struct_stream(_iphase, fstruct); +} + +void Phase::read_struct_string(int _iphase, char * buffer) +{ + istringstream fstruct(buffer); + read_struct_stream(_iphase, fstruct); +} + +void Phase::read_struct_stream(int _iphase, istream& fstruct) +{ + double tot; + bool ldiscus; + + iphase = _iphase; + natoms = 0; + + read_header(fstruct, ldiscus); + + if (ldiscus) + { + *pout << " Structure file format : DISCUS (converting B -> Uij) \n"; + Atom::streamformat = Atom::DISCUS; + } + else + { + *pout << " Structure file format : PDFFIT\n"; + Atom::streamformat = Atom::PDFFIT; + } + + read_atoms(fstruct); + // update atom_types + atom_types.clear(); + for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) + { + if (!count(atom_types.begin(), atom_types.end(), ai->atom_type)) + { + atom_types.push_back(ai->atom_type); + } + } + + lattice(); + + tot = icc[0]*icc[1]*icc[2]*ncatoms; + + if (tot != natoms) + { + throw structureError("Inconsistent # of atoms in structure"); + } +} + + +/****************************************************************** + This subroutine reads the header of a structure file + Wed Oct 12 2005 - CLF + Changed ifstream to istream to accomodate stringstreams + as well. +********************************************************************/ + +void Phase::read_header(istream &fstruct, bool &ldiscus) +{ + string ier_msg; + string befehl, line; + + + // initialize format type to discuss format + ldiscus = true; + + /* parse structure file header and fill phase variables */ + + while (getline(fstruct, line)) + { + istringstream sline(line); + string action; + + // try to read a command from structure file + // if an error occurs, an exception will be caught + try{ + sline >> befehl; + + // get out if we get to atom positions + if (befehl == "atoms") break; + + // skip comments, i.e., when befehl starts with '#' + else if (befehl.find('#') == 0) continue; + + // format + else if (befehl == "format") + { + string format; + sline >> format; + ldiscus = (format != "pdffit"); + } + + // scale factor (PDFFIT) + else if (befehl == "scale") + { + action = "Reading scale factor"; + this->pscale = dget(sline); + this->dpscale = 0.0; + if (!sline) + { + throw structureError(action); + } + } + + // peak sharpening factors (PDFFIT) + else if (befehl == "sharp") + { + action = "reading sharpening parameters"; + double v0 = 0.0, v1 = 0.0, v2 = 0.0, v3 = 0.0; + // at least 3-parameters must be read without error + v0 = dget(sline); + v1 = dget(sline); + v2 = dget(sline); + // we have new format if we can read the 4th parameter + try { + v3 = dget(sline); + delta2 = v0; + delta1 = v1; + sratio = v2; + rcut = v3; + } + // if reading of 4th parameter fails, assume old format + catch(vgetException) { + delta2 = v0; + delta1 = 0.0; + sratio = v1; + rcut = v2; + } + ddelta2 = 0.0; + dsratio = 0.0; + ddelta1 = 0.0; + } + + // space group symbol (only to save it later for DISCUS use) + else if (befehl == "spcgr") + { + sline >> spcgr; + } + + // particle shape corrections + else if (befehl == "shape") + { + action = "reading particle shape correction data"; + string shapedata; + getline(sline, shapedata); + substitute(shapedata, ",", " "); + istringstream shapestream(shapedata); + string w; + shapestream >> w; + if (w == "sphere") + { + this->spdiameter = dget(shapestream); + } + else if (w == "stepcut") + { + this->stepcut = dget(shapestream); + } + else + { + ostringstream emsg; + emsg << " Unknown shape correction: " << w; + throw structureError(emsg.str()); + } + } + + // title / name for structure + else if (befehl == "title") + { + getline(sline, name); + // getline keeps leading whitespace + name = lstrip(name); + } + + // cell constants + else if (befehl == "cell") + { + action = "reading unit cell parameters"; + a0[0] = dget(sline); + a0[1] = dget(sline); + a0[2] = dget(sline); + win[0] = dget(sline); + win[1] = dget(sline); + win[2] = dget(sline); + } + + // standard deviation of cell constants + else if (befehl == "dcell") + { + action = "reading standard deviation of unit cell parameters"; + da0[0] = dget(sline); + da0[1] = dget(sline); + da0[2] = dget(sline); + dwin[0] = dget(sline); + dwin[1] = dget(sline); + dwin[2] = dget(sline); + } + + // crystal dimensions and number of atoms per unit cell 'ncell' + else if (befehl == "ncell") + { + action = "reading # atoms/unit cell"; + icc[0] = iget(sline); + icc[1] = iget(sline); + icc[2] = iget(sline); + ncatoms = iget(sline); + } + + // show warning message otherwise + else + { + *pout << " ****WARN**** Unknown keyword: " << + befehl << " (ignored) ****\n"; + } + } // end of try + // catch vget-exception and throw the specific exception + catch(vgetException e) { throw structureError(action+e.GetMsg()); } + } +} + +void Phase::read_atoms(istream& fstruct) +{ + Atom a; + while (fstruct >> a) + { + reassign_atom_type(&a); + this->atom.push_back(a); + natoms++; + } + return; +} + + +void Phase::reassign_atom_type(Atom* ap) +{ + LocalPeriodicTable* lpt = getPeriodicTable(); + const string& smbl = ap->atom_type->symbol; + ap->atom_type = lpt->symbol(smbl); +} + + + +/******************************************* +c------ - Save structure for given phase + Thu Oct 13 2005 - CLF + Changed code to return a string of the + saved file. Actually saving the file is + optional. +*******************************************/ +string PdfFit::show_struct(int ip) +{ + string filestring = save_struct(ip,""); + return filestring; +} + +string PdfFit::save_struct(int ip, string strucfile) +{ + + stringstream outfilestream; + + if ( (ip < 1) || (ip > nphase) ) + { + throw unassignedError("phase does not exist"); + } + else + { + bool ldiscus=false; + ofstream fout; + + if (!strucfile.empty()) + { + if (ldiscus) + *pout << " Saving structure (DISCUS format) phase " << ip + << " to file : " << strucfile << endl; + else + *pout << " Saving structure phase " << ip << " to file : " + << strucfile << endl; + + phase[ip-1]->save_struct(outfilestream); + + fout.open(strucfile.c_str()); + if (!fout) { + throw IOError("cannot create output file"); + } + fout << outfilestream.str(); + fout.close(); + } + else + { + phase[ip-1]->save_struct(outfilestream); + } + } + + return outfilestream.str(); +} + +/*************************************************************** +c This subroutine saves the structure and/or the unit cell +c onto a file. The format uses keyword description. +****************************************************************/ +template void Phase::save_struct(Stream &fout) +{ + const double fac = 8.0*M_PI*M_PI /3.0; + bool ldis=false; + + // -- Write new type of structure file + + fout << "title " << name << endl; + + fout << setprecision(6) << fixed; + + if (!ldis) + { + fout << "format pdffit" << endl; + fout << "scale " << setw(9) << pscale << endl; + fout << "sharp " << setw(9) << delta2 << ", " << setw(9) << delta1 << ", " + << setw(9) << sratio << ", " << setw(9) << rcut << endl; + } + + fout << "spcgr " << spcgr << endl; + + if (spdiameter > 0.0) + { + fout << "shape sphere, " << spdiameter << endl; + } + + if (stepcut > 0.0) + { + fout << "shape stepcut, " << stepcut << endl; + } + + fout << "cell "; + for (int i=0; i<3; i++) + fout << setw(9) << a0[i] << ", "; + + for (int i=0; i<3; i++) + { + fout << setw(9) << win[i]; + if (i!=2) + fout << ", "; + else + fout << endl; + } + + if (!ldis) + { + fout << "dcell "; + for (int i=0; i<3; i++) + fout << setw(9) << da0[i] << ", "; + + for (int i=0; i<3; i++) + { + fout << setw(9) << dwin[i]; + if (i!=2) + fout << ", "; + else + fout << endl; + } + } + + fout << "ncell "; + for (int i=0; i<3; i++) + fout << setw(9) << icc[i] << ", "; + fout << setw(9) << ncatoms << endl; + + fout << "atoms" << endl; + for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) + { + + if (ldis) + { + double dw = fac*(ai->u[1]+ai->u[2]+ai->u[3]); + fout << setw(4) << left << ai->atom_type->symbol; + fout << right << setprecision(8); + for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->pos[i]; + fout << ' ' << setw(12) << dw << endl; + } + else + { + fout << setw(4) << left << ai->atom_type->symbol; + fout << right << setprecision(8); + for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->pos[i]; + fout << ' ' << setw(12) << setprecision(4) << ai->occ << endl; + + fout << " "; + fout << setprecision(8); + for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->dpos[i]; + fout << ' ' << setw(12) << setprecision(4) << ai->docc << endl; + + fout << " "; + fout << setprecision(8); + for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->u[i]; + fout << endl; + + fout << " "; + for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->du[i]; + fout << endl; + + fout << " "; + for (int i=3; i<6; i++) fout << ' ' << setw(17) << ai->u[i]; + fout << endl; + + fout << " "; + for (int i=3; i<6; i++) fout << ' ' << setw(17) << ai->du[i]; + fout << endl; + } + } +} + + +/*************************************** +c Calculate bond angles with errors +****************************************/ +pair PdfFit::bond_angle(int ia, int ja, int ka) +{ + if (!curphase) + { + throw unassignedError("Must read structure first"); + } + return curphase->bond_angle(ia, ja, ka); +} + +/*********************************************************************** +* shift to equivalent lattice position that is nearest to the origin +***********************************************************************/ +void Phase::make_nearest(double xyz[3]) +{ + // first shift to the first unit cell + for (int i = 0; i !=3; ++i) + { + // MS compatibility - use fmod instead of remainder + xyz[i] = fmod(xyz[i], icc[i]); + } + // that is all in orthogonal cell or if we get to the origin + if ( (xyz[0] == 0.0 && xyz[1] == 0.0 && xyz[2] == 0.0) || + (win[0] == 90.0 && win[1] == 90.0 && win[2] == 90.0) ) + { + return; + } + // otherwise we need to check all cells around + // first, let us shift to octant with xyz[i] <= 0.0 + for (int i = 0; i != 3; ++i) + { + if (xyz[i] > 0.0) xyz[i] -= icc[i]; + } + double nearest[3] = { xyz[0], xyz[1], xyz[2] }; + double mindsquare = skalpro(nearest, nearest); + double test[3]; + for (test[0] = xyz[0]; test[0] < icc[0]; test[0] += icc[0]) + { + for (test[1] = xyz[1]; test[1] < icc[1]; test[1] += icc[1]) + { + for (test[2] = xyz[2]; test[2] < icc[2]; test[2] += icc[2]) + { + double dsquare = skalpro(test,test); + if (dsquare < mindsquare) + { + copy(test, test+3, nearest); + dsquare = mindsquare; + } + } + } + } + copy(nearest, nearest+3, xyz); +} + +pair Phase::bond_angle(int ia, int ja, int ka) +{ + double x[3], y[3], dx[3], dy[3], xx, yy, xy, dxx, dyy, dxy, arg, darg, ang, dang; + + + if ( (ia < 1) || (ia > natoms) || (ja < 1) || (ja > natoms) + || (ka < 1) || (ka > natoms)) + { + stringstream eout; + eout << "Incorrect atom number(s): " << ia << ", " << ja << ", " << ka; + throw ValueError(eout.str()); + } + if ( ia == ja || ia == ka || ja == ka ) + { + stringstream eout; + eout << "All atoms must be different: " << ia << ", "; + eout << ja << ", " << ka; + throw ValueError(eout.str()); + } + + Atom& ai = atom[ia - 1]; + Atom& aj = atom[ja - 1]; + Atom& ak = atom[ka - 1]; + + for (int i=0; i<3; i++) + { + x[i] = aj.pos[i] - ai.pos[i]; + y[i] = aj.pos[i] - ak.pos[i]; + dx[i] = aj.dpos[i] + ai.dpos[i]; + dy[i] = aj.dpos[i] + ak.dpos[i]; + } + + make_nearest(x); + make_nearest(y); + xx = sqrt(skalpro(x,x)); + yy = sqrt(skalpro(y,y)); + xy = skalpro(x,y); + + dxx = 0.5/xx*dskalpro(x,x,dx,dx); + dyy = 0.5/yy*dskalpro(y,y,dy,dy); + dxy = dskalpro(x,y,dx,dy); + arg = xy/(xx*yy); + ang = acosd(arg); + darg = (1.0/(xx*yy)*dxy + arg/xx*dxx +arg/yy*dyy); + if (arg != 1.0) + dang = fabs(1.0/sqrt(1.0-arg*arg)/rad*darg); + else + dang = 0.0; + + pair rv(ang, dang); + + return rv; +} + +/*************************************** +c Calculate bond lengths with errors +****************************************/ +PairDistance PdfFit::bond_length_atoms(int ia, int ja) +{ + if (!curphase) + { + throw unassignedError("Must read structure first"); + } + return curphase->bond_length_atoms(ia, ja); +} + +PairDistance Phase::bond_length_atoms(int ia, int ja) +{ + double d[3], dd[3], dist, ddist; + + // -- Simple distance between given atoms + + if ( (ia < 1) || (ia > natoms) || (ja < 1) || (ja > natoms) ) + { + + stringstream eout; + eout << "Incorrect atom number(s): " << ia << ", " << ja; + throw ValueError(eout.str()); + } + + Atom& ai = atom[ia-1]; + Atom& aj = atom[ja-1]; + + for (int jj=0; jj<3; jj++) + { + d[jj] = ai.pos[jj] - aj.pos[jj]; + dd[jj] = ai.dpos[jj] + aj.dpos[jj]; + } + make_nearest(d); + dist = sqrt(skalpro(d,d)); + ddist = (dist > 0) ? 0.5/dist * dskalpro(d,d,dd,dd) : 0.0; + + PairDistance pd; + pd.dij = dist; + pd.ddij = ddist; + pd.i = ia; + pd.j = ja; + + return pd; +} + + +vector PdfFit::bond_length_types(string symi, string symj, + double bmin, double bmax) +{ + if (!curphase) + { + throw unassignedError("Must read structure first"); + } + return curphase->bond_length_types(symi, symj, bmin, bmax); +} + +vector Phase::bond_length_types(string symi, string symj, + double bmin, double bmax) +{ + double d[3], dd[3], dist, ddist; + set iselection, jselection; + iselection = selectAtomsOf(symi); + jselection = selectAtomsOf(symj); + + // ---- Get all bonds in specified range + + // calculate range for PointsInSphere sequencer + // (negative rsphmin is no problem) + double buffzone = circum_diameter(); + double rsphmin = bmin - buffzone; + double rsphmax = bmax + buffzone; + PointsInSphere sph( rsphmin, rsphmax, a0[0]*icc[0], + a0[1]*icc[1], a0[2]*icc[2], + win[0], win[1], win[2] ); + + // -- Loop over all atoms within the crystal + vector rv; + set::iterator ia, ja; + for (ia = iselection.begin(); ia != iselection.end(); ++ia) + { + for (ja = jselection.begin(); ja != jselection.end(); ++ja) + { + for (sph.rewind(); !sph.finished(); sph.next()) + { + for (int jj=0; jj<3; jj++) + { + d[jj] = atom[*ia].pos[jj] - atom[*ja].pos[jj] - + sph.mno[jj]*icc[jj]; + dd[jj] = atom[*ia].dpos[jj] + atom[*ja].dpos[jj]; + } + dist = sqrt(skalpro(d,d)); + if ( (dist >= bmin) && (dist <= bmax) ) + { + ddist = (dist > 0) ? 0.5/dist * dskalpro(d,d,dd,dd) : 0.0; + PairDistance pd; + pd.dij = dist; + pd.ddij = ddist; + pd.i = *ia + 1; + pd.j = *ja + 1; + rv.push_back(pd); + } + } + } + } + stable_sort(rv.begin(), rv.end()); + return rv; +} + +set Phase::selectAtomsOf(string symbol) +{ + set selection; + if (toupper(symbol) == "ALL") + { + for (size_t i = 0; i != size_t(natoms); ++i) selection.insert(i); + return selection; + } + // here we need to find AtomType + LocalPeriodicTable* lpt = getPeriodicTable(); + const AtomType* atp; + try + { + atp = lpt->lookup(symbol); + } + catch (ValueError e) + { + ostringstream emsg; + emsg << "Incorrect atom type '" << symbol << "'"; + throw ValueError(emsg.str()); + } + for (size_t i = 0; i != size_t(natoms); ++i) + { + if (atom[i].atom_type == atp) selection.insert(i); + } + return selection; +} + +// End of file diff --git a/src/extensions/libpdffit2/support_msvc9.h b/src/extensions/libpdffit2/support_msvc9.h new file mode 100644 index 00000000..cb4bbf70 --- /dev/null +++ b/src/extensions/libpdffit2/support_msvc9.h @@ -0,0 +1,13 @@ +/*********************************************************************** +* Python 2.7 needs MSVC 9.0 which does not have unique_ptr. +* Work around by substituting auto_ptr instead. +***********************************************************************/ + +#ifdef _MSC_VER + +// workarounds for MSVC 9.0 -------------------------------------------- +#if _MSC_VER <= 1500 +#define unique_ptr auto_ptr +#endif + +#endif // _MSC_VER diff --git a/src/extensions/libpdffit2/tests/Makefile b/src/extensions/libpdffit2/tests/Makefile new file mode 100644 index 00000000..f6bfe566 --- /dev/null +++ b/src/extensions/libpdffit2/tests/Makefile @@ -0,0 +1,32 @@ +######################################################################## +# Targets: alltests unittests +# +# Comments: This Makefile is for building and running C++ unit tests +# on the libpdffit2 sources. Intended for developers, not for the end +# users who just want to build pdffit2 from sources. +# +######################################################################## + + +# compiler options +CPPFLAGS += -I../ $(shell cppunit-config --cflags) +LDLIBS += $(shell cppunit-config --libs) + + +# default target +all: unittest + + +# build unit test driver +alltests: alltests.cc \ + TestPointsInSphere.cc ../PointsInSphere.cc + + +# execute unit tests +unittest: alltests + ./alltests + + +# clean up any generated files +clean: + rm -f alltests diff --git a/src/extensions/libpdffit2/tests/TestPointsInSphere.cc b/src/extensions/libpdffit2/tests/TestPointsInSphere.cc new file mode 100644 index 00000000..b82fcb31 --- /dev/null +++ b/src/extensions/libpdffit2/tests/TestPointsInSphere.cc @@ -0,0 +1,228 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Unit tests for PointsInSphere module +* +* Comments: +* +***********************************************************************/ + +#include +#include +#include +#include + +#include "PointsInSphere.h" + +using namespace std; +using namespace NS_POINTSINSPHERE; + +namespace { + +const double eps = 1.0e-12; + +struct vidxgroup +{ + double vijk[4]; + vidxgroup(double v, int* ijk) + { + vijk[0] = v; + for (size_t i = 0; i != 3; ++i) { vijk[i+1] = ijk[i]; } + } + vidxgroup(double v, int i, int j, int k) + { + vijk[0] = v; vijk[1] = i; vijk[2] = j; vijk[3] = k; + } +}; + +bool operator<(const vidxgroup &x, const vidxgroup &y) +{ + return (x.vijk[0] < y.vijk[0] - eps) || + lexicographical_compare(x.vijk+1, x.vijk+4, y.vijk+1, y.vijk+4); +} + +bool operator==(const vidxgroup &x, const vidxgroup &y) +{ + bool eq = (fabs(x.vijk[0] - y.vijk[0]) < eps) && + equal(x.vijk+1, x.vijk+4, y.vijk+1); + return eq; +} + +ostream& operator<<(ostream &s, const vidxgroup &x) +{ + return s << "<" << x.vijk[0] << ";" << int(x.vijk[1]) + << ',' << int(x.vijk[2]) << ',' << int(x.vijk[3]) << '>'; +} + +} // namespace + +//////////////////////////////////////////////////////////////////////// +// TestPointsInSphere +//////////////////////////////////////////////////////////////////////// + +class TestPointsInSphere : public CppUnit::TestFixture +{ + + CPPUNIT_TEST_SUITE(TestPointsInSphere); + CPPUNIT_TEST(test_Cubic); + CPPUNIT_TEST(test_Orthorombic); + CPPUNIT_TEST(test_Hexagonal); + CPPUNIT_TEST(test_FCC); + CPPUNIT_TEST_SUITE_END(); + +private: + + LatticeParameters* latpar; + +public: + + void setUp() + { + latpar = new LatticeParameters(1, 1, 1, 90, 90, 90); + } + + void tearDown() + { + delete latpar; + } + +private: + + int count(double Rmin, double Rmax) + { + int c = 0; + for ( PointsInSphere sph(Rmin, Rmax, *latpar); + not sph.finished(); sph.next(), ++c ) + { } + return c; + } + + vector sortedPoints(double Rmin, double Rmax) + { + vector ridx; + for ( PointsInSphere sph(Rmin, Rmax, *latpar); + not sph.finished(); sph.next() ) + { + ridx.push_back(vidxgroup(sph.r(), sph.mno)); + } + sort(ridx.begin(), ridx.end()); + return ridx; + } + +public: + + void test_Cubic() + { + latpar->a = latpar->b = latpar->c = 1.0; + latpar->alpha = latpar->beta = latpar->gamma = 90.0; + latpar->update(); + CPPUNIT_ASSERT_EQUAL(0, count(0.0, 0.0)); + CPPUNIT_ASSERT_EQUAL(0, count(eps, 0.5)); + CPPUNIT_ASSERT_EQUAL(0, count(1.0 + eps, 1.1)); + CPPUNIT_ASSERT_EQUAL(1, count(0.0, eps)); + CPPUNIT_ASSERT_EQUAL(7, count(0.0, 1 + eps)); + CPPUNIT_ASSERT_EQUAL(19, count(0.0, sqrt(2.0) + eps)); + CPPUNIT_ASSERT_EQUAL(12, count(1.0 + eps, sqrt(2.0) + eps)); + } + + void test_Orthorombic() + { + latpar->a = 1.0; latpar->b = 2.0; latpar->c = 3.0; + latpar->alpha = latpar->beta = latpar->gamma = 90.0; + latpar->update(); + CPPUNIT_ASSERT_EQUAL(3, count(0.0, 1.1)); + CPPUNIT_ASSERT_EQUAL(4, count(1.9, 2.1)); + vidxgroup ep[] = { + vidxgroup(0, 0, 0, 0), + vidxgroup(1, -1, 0, 0), + vidxgroup(1, 1, 0, 0), + vidxgroup(2, -2, 0, 0), + vidxgroup(2, 0, -1, 0), + vidxgroup(2, 0, 1, 0), + vidxgroup(2, 2, 0, 0), + vidxgroup(sqrt(5.0), -1, -1, 0), + vidxgroup(sqrt(5.0), -1, 1, 0), + vidxgroup(sqrt(5.0), 1, -1, 0), + vidxgroup(sqrt(5.0), 1, 1, 0), + vidxgroup(sqrt(8.0), -2, -1, 0), + vidxgroup(sqrt(8.0), -2, 1, 0), + vidxgroup(sqrt(8.0), 2, -1, 0), + vidxgroup(sqrt(8.0), 2, 1, 0), + vidxgroup(3, -3, 0, 0), + vidxgroup(3, 0, 0, -1), + vidxgroup(3, 0, 0, 1), + vidxgroup(3, 3, 0, 0), + }; + vector exp_pts(ep, ep + sizeof(ep)/sizeof(vidxgroup)); + vector act_pts = sortedPoints(0.0, 3.0+eps); + CPPUNIT_ASSERT_EQUAL(exp_pts.size(), act_pts.size()); + for (size_t i = 0; i != exp_pts.size(); ++i) + { + CPPUNIT_ASSERT_EQUAL(exp_pts[i], act_pts[i]); + } + } + + void test_Hexagonal() + { + latpar->a = 1.0; latpar->b = 1.0; latpar->c = 2.0; + latpar->alpha = latpar->beta = 90.0; latpar->gamma = 120.0; + latpar->update(); + CPPUNIT_ASSERT_EQUAL(7, count(0.0, 1+eps)); + vidxgroup ep[] = { + vidxgroup(0, 0, 0, 0), + vidxgroup(1, -1, -1, 0), + vidxgroup(1, -1, 0, 0), + vidxgroup(1, 0, -1, 0), + vidxgroup(1, 0, 1, 0), + vidxgroup(1, 1, 0, 0), + vidxgroup(1, 1, 1, 0), + vidxgroup(sqrt(3.0), -2, -1, 0), + vidxgroup(sqrt(3.0), -1, -2, 0), + vidxgroup(sqrt(3.0), -1, 1, 0), + vidxgroup(sqrt(3.0), 1, -1, 0), + vidxgroup(sqrt(3.0), 1, 2, 0), + vidxgroup(sqrt(3.0), 2, 1, 0), + vidxgroup(2, -2, -2, 0), + vidxgroup(2, -2, 0, 0), + vidxgroup(2, 0, -2, 0), + vidxgroup(2, 0, 0, -1), + vidxgroup(2, 0, 0, 1), + vidxgroup(2, 0, 2, 0), + vidxgroup(2, 2, 0, 0), + vidxgroup(2, 2, 2, 0), + }; + vector exp_pts(ep, ep + sizeof(ep)/sizeof(vidxgroup)); + vector act_pts = sortedPoints(0.0, 2.0+eps); + CPPUNIT_ASSERT_EQUAL(exp_pts.size(), act_pts.size()); + for (size_t i = 0; i != exp_pts.size(); ++i) + { + CPPUNIT_ASSERT_EQUAL(exp_pts[i], act_pts[i]); + } + } + + void test_FCC() + { + latpar->a = latpar->b = latpar->c = sqrt(0.5); + latpar->alpha = latpar->beta = latpar->gamma = 60.0; + latpar->update(); + CPPUNIT_ASSERT_EQUAL(13, count(0.0, sqrt(0.5)+eps)); + CPPUNIT_ASSERT_EQUAL(19, count(0.0, 1.0+eps)); + } + +}; + +// Registers the fixture into the 'registry' +CPPUNIT_TEST_SUITE_REGISTRATION(TestPointsInSphere); + +// End of file diff --git a/src/extensions/libpdffit2/tests/alltests.cc b/src/extensions/libpdffit2/tests/alltests.cc new file mode 100644 index 00000000..318cb4b3 --- /dev/null +++ b/src/extensions/libpdffit2/tests/alltests.cc @@ -0,0 +1,46 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Unit tests driver +* +***********************************************************************/ + +#include +#include +#include +#include +#include + +using namespace std; +using namespace CppUnit; + +int main() +{ + // Get the top level suite from the registry + Test *suite = TestFactoryRegistry::getRegistry().makeTest(); + + // Adds the test to the list of test to run + TextUi::TestRunner runner; + runner.addTest( suite ); + + // Change the default outputter to a compiler error format outputter + runner.setOutputter( new CompilerOutputter(&runner.result(), cerr) ); + // Run the tests. + bool wasSucessful = runner.run(); + + // Return error code 1 if the one of test failed. + return wasSucessful ? EXIT_SUCCESS : EXIT_FAILURE; +} + +// End of file diff --git a/src/extensions/pdffit2module/PyFileStreambuf.h b/src/extensions/pdffit2module/PyFileStreambuf.h new file mode 100644 index 00000000..3a2bc383 --- /dev/null +++ b/src/extensions/pdffit2module/PyFileStreambuf.h @@ -0,0 +1,97 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2007 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Pavol Juhas +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* class PyFileStreambuf +* +* Comments: PyFileStreambuf is a C++ streambuf which writes to a python +* file-like object. The python file can be changed anytime by +* calling the redirect() method. +* +* Examples: // redirect std::cout +* std::cout.rdbuf( PyFileStreambuf(PyObject* python_file) ); +* +***********************************************************************/ + +#ifndef PYFILESTREAMBUF_H_INCLUDED +#define PYFILESTREAMBUF_H_INCLUDED +#define PY_SSIZE_T_CLEAN + +#include +#include + +// MS compatibility fix +#include + +class PyFileStreambuf : public std::streambuf +{ + private: + + // Data members + PyObject* py_file; + + public: + + // Constructor + PyFileStreambuf(PyObject* f) : py_file(f) + { + Py_INCREF(py_file); + } + + // Destructor + ~PyFileStreambuf() + { + Py_DECREF(py_file); + } + + // Methods + PyObject* redirect(PyObject* f) + { + Py_INCREF(f); + Py_DECREF(py_file); + py_file = f; + return py_file; + } + + protected: + + virtual int_type overflow( int_type c) + { + PyObject* rv; + rv = PyObject_CallMethod(py_file, "write", "(s#)", &c, 1); + if (rv) { Py_DECREF(rv); } + return c; + } + + virtual std::streamsize xsputn(const char_type* s, std::streamsize n) + { + PyObject* rv; + rv = PyObject_CallMethod(py_file, "write", "(s#)", s, n); + if (rv) { Py_DECREF(rv); } + return n; + } + + virtual int sync() + { + if (PyObject_HasAttrString(py_file, "flush")) + { + PyObject* rv; + rv = PyObject_CallMethod(py_file, "flush", NULL); + if (rv) { Py_DECREF(rv); } + } + return 0; + } + +}; + +#endif // PYFILESTREAMBUF_H_INCLUDED diff --git a/src/extensions/pdffit2module/bindings.cc b/src/extensions/pdffit2module/bindings.cc new file mode 100644 index 00000000..568e1dd1 --- /dev/null +++ b/src/extensions/pdffit2module/bindings.cc @@ -0,0 +1,341 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Chris Farrow +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Method table for python module bindings. +* +* Comments: +* +***********************************************************************/ +#define PY_SSIZE_T_CLEAN +#include + +#include "bindings.h" +#include "misc.h" + +// the method table +struct PyMethodDef pypdffit2_methods[] = { + + //copyright + {pypdffit2_copyright__name__, pypdffit2_copyright, + METH_VARARGS, pypdffit2_copyright__doc__}, + + //create + {pypdffit2_create__name__, pypdffit2_create, + METH_VARARGS, pypdffit2_create__doc__}, + + //read_struct + {pypdffit2_read_struct__name__, pypdffit2_read_struct, + METH_VARARGS, pypdffit2_read_struct__doc__}, + + //read_struct_string + {pypdffit2_read_struct_string__name__, pypdffit2_read_struct_string, + METH_VARARGS, pypdffit2_read_struct_string__doc__}, + + //read_data + {pypdffit2_read_data__name__, pypdffit2_read_data, + METH_VARARGS, pypdffit2_read_data__doc__}, + + //read_data_string + {pypdffit2_read_data_string__name__, pypdffit2_read_data_string, + METH_VARARGS, pypdffit2_read_data_string__doc__}, + + //read_data_arrays + {pypdffit2_read_data_arrays__name__, pypdffit2_read_data_arrays, + METH_VARARGS, pypdffit2_read_data_arrays__doc__}, + + //pdfrange + {pypdffit2_pdfrange__name__, pypdffit2_pdfrange, + METH_VARARGS, pypdffit2_pdfrange__doc__}, + + //reset + {pypdffit2_reset__name__, pypdffit2_reset, + METH_VARARGS, pypdffit2_reset__doc__}, + + //alloc + {pypdffit2_alloc__name__, pypdffit2_alloc, + METH_VARARGS, pypdffit2_alloc__doc__}, + + //calc + {pypdffit2_calc__name__, pypdffit2_calc, + METH_VARARGS, pypdffit2_calc__doc__}, + + //refine + {pypdffit2_refine__name__, pypdffit2_refine, + METH_VARARGS, pypdffit2_refine__doc__}, + + //refine_step + {pypdffit2_refine_step__name__, pypdffit2_refine_step, + METH_VARARGS, pypdffit2_refine_step__doc__}, + + //save_pdf + {pypdffit2_save_pdf__name__, pypdffit2_save_pdf, + METH_VARARGS, pypdffit2_save_pdf__doc__}, + + //save_dif + {pypdffit2_save_dif__name__, pypdffit2_save_dif, + METH_VARARGS, pypdffit2_save_dif__doc__}, + + //save_res + {pypdffit2_save_res__name__, pypdffit2_save_res, + METH_VARARGS, pypdffit2_save_res__doc__}, + + //save_struct + {pypdffit2_save_struct__name__, pypdffit2_save_struct, + METH_VARARGS, pypdffit2_save_struct__doc__}, + + //show_struct + {pypdffit2_show_struct__name__, pypdffit2_show_struct, + METH_VARARGS, pypdffit2_show_struct__doc__}, + + //constrain_int + {pypdffit2_constrain_int__name__, pypdffit2_constrain_int, + METH_VARARGS, pypdffit2_constrain_int__doc__}, + + //constrain_str + {pypdffit2_constrain_str__name__, pypdffit2_constrain_str, + METH_VARARGS, pypdffit2_constrain_str__doc__}, + + //setpar_dbl + {pypdffit2_setpar_dbl__name__, pypdffit2_setpar_dbl, + METH_VARARGS, pypdffit2_setpar_dbl__doc__}, + + //setpar_RV + {pypdffit2_setpar_RV__name__, pypdffit2_setpar_RV, + METH_VARARGS, pypdffit2_setpar_RV__doc__}, + + //setvar + {pypdffit2_setvar__name__, pypdffit2_setvar, + METH_VARARGS, pypdffit2_setvar__doc__}, + + //getvar + {pypdffit2_getvar__name__, pypdffit2_getvar, + METH_VARARGS, pypdffit2_getvar__doc__}, + + //getR + {pypdffit2_getR__name__, pypdffit2_getR, + METH_VARARGS, pypdffit2_getR__doc__}, + + //getpdf_fit + {pypdffit2_getpdf_fit__name__, pypdffit2_getpdf_fit, + METH_VARARGS, pypdffit2_getpdf_fit__doc__}, + + //getpdf_obs + {pypdffit2_getpdf_obs__name__, pypdffit2_getpdf_obs, + METH_VARARGS, pypdffit2_getpdf_obs__doc__}, + + //getpdf_diff + {pypdffit2_getpdf_diff__name__, pypdffit2_getpdf_diff, + METH_VARARGS, pypdffit2_getpdf_diff__doc__}, + + //getcrw + {pypdffit2_getcrw__name__, pypdffit2_getcrw, + METH_VARARGS, pypdffit2_getcrw__doc__}, + + //getrw + {pypdffit2_getrw__name__, pypdffit2_getrw, + METH_VARARGS, pypdffit2_getrw__doc__}, + + //getpar + {pypdffit2_getpar__name__, pypdffit2_getpar, + METH_VARARGS, pypdffit2_getpar__doc__}, + + //fixpar + {pypdffit2_fixpar__name__, pypdffit2_fixpar, + METH_VARARGS, pypdffit2_fixpar__doc__}, + + //freepar + {pypdffit2_freepar__name__, pypdffit2_freepar, + METH_VARARGS, pypdffit2_freepar__doc__}, + + //setphase + {pypdffit2_setphase__name__, pypdffit2_setphase, + METH_VARARGS, pypdffit2_setphase__doc__}, + + //setdata + {pypdffit2_setdata__name__, pypdffit2_setdata, + METH_VARARGS, pypdffit2_setdata__doc__}, + + //psel + {pypdffit2_psel__name__, pypdffit2_psel, + METH_VARARGS, pypdffit2_psel__doc__}, + + //pdesel + {pypdffit2_pdesel__name__, pypdffit2_pdesel, + METH_VARARGS, pypdffit2_pdesel__doc__}, + + //selectAtomType + {pypdffit2_selectAtomType__name__, pypdffit2_selectAtomType, + METH_VARARGS, pypdffit2_selectAtomType__doc__}, + + //selectAtomIndex + {pypdffit2_selectAtomIndex__name__, pypdffit2_selectAtomIndex, + METH_VARARGS, pypdffit2_selectAtomIndex__doc__}, + + //selectAll + {pypdffit2_selectAll__name__, pypdffit2_selectAll, + METH_VARARGS, pypdffit2_selectAll__doc__}, + + //selectNone + {pypdffit2_selectNone__name__, pypdffit2_selectNone, + METH_VARARGS, pypdffit2_selectNone__doc__}, + + //bond_angle + {pypdffit2_bond_angle__name__, pypdffit2_bond_angle, + METH_VARARGS, pypdffit2_bond_angle__doc__}, + + //bond_length_atoms + {pypdffit2_bond_length_atoms__name__, pypdffit2_bond_length_atoms, + METH_VARARGS, pypdffit2_bond_length_atoms__doc__}, + + //bond_length_types + {pypdffit2_bond_length_types__name__, pypdffit2_bond_length_types, + METH_VARARGS, pypdffit2_bond_length_types__doc__}, + + //get_scat_string + {pypdffit2_get_scat_string__name__, pypdffit2_get_scat_string, + METH_VARARGS, pypdffit2_get_scat_string__doc__}, + + //get_scat + {pypdffit2_get_scat__name__, pypdffit2_get_scat, + METH_VARARGS, pypdffit2_get_scat__doc__}, + + //set_scat + {pypdffit2_set_scat__name__, pypdffit2_set_scat, + METH_VARARGS, pypdffit2_set_scat__doc__}, + + //reset_scat + {pypdffit2_reset_scat__name__, pypdffit2_reset_scat, + METH_VARARGS, pypdffit2_reset_scat__doc__}, + + //lat + {pypdffit2_lat__name__, pypdffit2_lat, + METH_VARARGS, pypdffit2_lat__doc__}, + + //x + {pypdffit2_x__name__, pypdffit2_x, + METH_VARARGS, pypdffit2_x__doc__}, + + //y + {pypdffit2_y__name__, pypdffit2_y, + METH_VARARGS, pypdffit2_y__doc__}, + + //z + {pypdffit2_z__name__, pypdffit2_z, + METH_VARARGS, pypdffit2_z__doc__}, + + //u11 + {pypdffit2_u11__name__, pypdffit2_u11, + METH_VARARGS, pypdffit2_u11__doc__}, + + //u22 + {pypdffit2_u22__name__, pypdffit2_u22, + METH_VARARGS, pypdffit2_u22__doc__}, + + //u33 + {pypdffit2_u33__name__, pypdffit2_u33, + METH_VARARGS, pypdffit2_u33__doc__}, + + //u12 + {pypdffit2_u12__name__, pypdffit2_u12, + METH_VARARGS, pypdffit2_u12__doc__}, + + //u13 + {pypdffit2_u13__name__, pypdffit2_u13, + METH_VARARGS, pypdffit2_u13__doc__}, + + //u23 + {pypdffit2_u23__name__, pypdffit2_u23, + METH_VARARGS, pypdffit2_u23__doc__}, + + //occ + {pypdffit2_occ__name__, pypdffit2_occ, + METH_VARARGS, pypdffit2_occ__doc__}, + + //pscale + {pypdffit2_pscale__name__, pypdffit2_pscale, + METH_VARARGS, pypdffit2_pscale__doc__}, + + //spdiameter + {pypdffit2_spdiameter__name__, pypdffit2_spdiameter, + METH_VARARGS, pypdffit2_spdiameter__doc__}, + + //stepcut + {pypdffit2_stepcut__name__, pypdffit2_stepcut, + METH_VARARGS, pypdffit2_stepcut__doc__}, + + //sratio + {pypdffit2_sratio__name__, pypdffit2_sratio, + METH_VARARGS, pypdffit2_sratio__doc__}, + + //delta2 + {pypdffit2_delta2__name__, pypdffit2_delta2, + METH_VARARGS, pypdffit2_delta2__doc__}, + + //delta1 + {pypdffit2_delta1__name__, pypdffit2_delta1, + METH_VARARGS, pypdffit2_delta1__doc__}, + + //dscale + {pypdffit2_dscale__name__, pypdffit2_dscale, + METH_VARARGS, pypdffit2_dscale__doc__}, + + //qdamp + {pypdffit2_qdamp__name__, pypdffit2_qdamp, + METH_VARARGS, pypdffit2_qdamp__doc__}, + + //qbroad + {pypdffit2_qbroad__name__, pypdffit2_qbroad, + METH_VARARGS, pypdffit2_qbroad__doc__}, + + //rcut + {pypdffit2_rcut__name__, pypdffit2_rcut, + METH_VARARGS, pypdffit2_rcut__doc__}, + + //get_atoms + {pypdffit2_get_atoms__name__, pypdffit2_get_atoms, + METH_VARARGS, pypdffit2_get_atoms__doc__}, + + //num_atoms + {pypdffit2_num_atoms__name__, pypdffit2_num_atoms, + METH_VARARGS, pypdffit2_num_atoms__doc__}, + + //get_atom_types + {pypdffit2_get_atom_types__name__, pypdffit2_get_atom_types, + METH_VARARGS, pypdffit2_get_atom_types__doc__}, + + //num_phases + {pypdffit2_num_phases__name__, pypdffit2_num_phases, + METH_VARARGS, pypdffit2_num_phases__doc__}, + + //num_datasets + {pypdffit2_num_datasets__name__, pypdffit2_num_datasets, + METH_VARARGS, pypdffit2_num_datasets__doc__}, + + //phase_fractions + {pypdffit2_phase_fractions__name__, pypdffit2_phase_fractions, + METH_VARARGS, pypdffit2_phase_fractions__doc__}, + + //redirect_stdout + {pypdffit2_redirect_stdout__name__, pypdffit2_redirect_stdout, + METH_VARARGS, pypdffit2_redirect_stdout__doc__}, + + //is_element + {pypdffit2_is_element__name__, pypdffit2_is_element, + METH_VARARGS, pypdffit2_is_element__doc__}, + +// Sentinel + {0, 0} +}; + +// End of file diff --git a/src/extensions/pdffit2module/bindings.h b/src/extensions/pdffit2module/bindings.h new file mode 100644 index 00000000..bf1e1406 --- /dev/null +++ b/src/extensions/pdffit2module/bindings.h @@ -0,0 +1,27 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Chris Farrow +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Method table for python module bindings. +* +* Comments: +* +***********************************************************************/ + +#ifndef PYPDFFIT2_BINDINGS_H +#define PYPDFFIT2_BINDINGS_H + +// the method table +extern struct PyMethodDef pypdffit2_methods[]; + +#endif // PYPDFFIT2_BINDINGS_H diff --git a/src/extensions/pdffit2module/misc.cc b/src/extensions/pdffit2module/misc.cc new file mode 100644 index 00000000..80198049 --- /dev/null +++ b/src/extensions/pdffit2module/misc.cc @@ -0,0 +1,2219 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Chris Farrow +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Bindings from python to c++ PdfFit class. +* +* Comments: +* +***********************************************************************/ +#define PY_SSIZE_T_CLEAN +#include +#include +#include +#include +#include +#include +#include +#include + +#include "misc.h" +#include "pyexceptions.h" +#include "PyFileStreambuf.h" +#include "libpdffit2/StringUtils.h" +#include "libpdffit2/LocalPeriodicTable.h" +#include "libpdffit2/pdffit.h" + +// ostream buffer used for engine output redirection +PyFileStreambuf* py_stdout_streambuf = NULL; + +// copyright +char pypdffit2_copyright__doc__[] = ""; +char pypdffit2_copyright__name__[] = "copyright"; + +static char pypdffit2_copyright_note[] = + "pdffit2 python module: Copyright (c) 2005-2016 Simon J. L. Billinge et al."; + +// constant strings for python capsule names (cn) +static char* cnpfit = "pdffit"; +static char* cnvar = "pdfvar"; + +PyObject * pypdffit2_copyright(PyObject *, PyObject *) +{ + return Py_BuildValue("s", pypdffit2_copyright_note); +} + +//helper function to convert a pylist to a double array. +void double_array_from_pylist(PyObject *pylist, double *d_array, int const length) +{ + //length is the size of the d_array and not necessarily equal to the length + //of the pylist + PyObject *pyval = 0; + + for(int i = 0; i < length; i++) { + pyval = PyList_GetItem(pylist, i); + d_array[i] = PyFloat_AsDouble(pyval); + } +} + +// helper function to delete PdfFit object +static void deletePdfFit(PyObject* ptr) +{ + PdfFit *pdf = (PdfFit *)PyCapsule_GetPointer(ptr, cnpfit); + delete pdf; + return; +} + +// create a PdfFit instance +char pypdffit2_create__doc__[] = ""; +char pypdffit2_create__name__[] = "create"; + +PyObject * pypdffit2_create(PyObject *, PyObject *args) +{ + PdfFit *ppdf = new PdfFit(); + PyObject *py_ppdf = PyCapsule_New((void *)ppdf, cnpfit, deletePdfFit); + return py_ppdf; +} + + +// read_struct +char pypdffit2_read_struct__doc__[] = "Read structure file into memory."; +char pypdffit2_read_struct__name__[] = "read_struct"; + +PyObject * pypdffit2_read_struct(PyObject *, PyObject *args) +{ + char *fname; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &fname); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + ppdf->read_struct(fname); + } + catch(structureError e) { + PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); + return 0; + } + catch(calculationError e) { + PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); + return 0; + } + catch(IOError e) { + PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// read_struct_string +char pypdffit2_read_struct_string__doc__[] = "Read structure file into memory from a c-string."; +char pypdffit2_read_struct_string__name__[] = "read_struct_string"; + +PyObject * pypdffit2_read_struct_string(PyObject *, PyObject *args) +{ + char *buffer; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &buffer); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + ppdf->read_struct_string(buffer); + } + catch(structureError e) { + PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); + return 0; + } + catch(calculationError e) { + PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + + +// read_data +char pypdffit2_read_data__doc__[] = "Read data file into memory."; +char pypdffit2_read_data__name__[] = "read_data"; + +PyObject * pypdffit2_read_data(PyObject *, PyObject *args) +{ + char *fname; + char stype; + double qmax, qdamp; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oscdd", &py_ppdf, &fname, &stype, &qmax, &qdamp); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + ppdf->read_data(fname, stype, qmax, qdamp); + } + catch(IOError e) { + PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); + return 0; + } + catch(dataError e) { + PyErr_SetString(pypdffit2_dataError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// read_data_string +char pypdffit2_read_data_string__doc__[] = "Read data from string into memory."; +char pypdffit2_read_data_string__name__[] = "read_data_string"; + +PyObject * pypdffit2_read_data_string(PyObject *, PyObject *args) +{ + char *buffer; + char *c_name = NULL; + char stype; + double qmax, qdamp; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oscdd|s", &py_ppdf, &buffer, &stype, &qmax, &qdamp, &c_name); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + string name = c_name ? c_name : ""; + try { + string sbuffer(buffer); + ppdf->read_data_string(sbuffer, stype, qmax, qdamp, name); + } + catch(IOError e) { + PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); + return 0; + } + catch(dataError e) { + PyErr_SetString(pypdffit2_dataError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// read_data_arrays - read_data_lists in PdfFit class +char pypdffit2_read_data_arrays__doc__[] = "Read data from arrays into memory."; +char pypdffit2_read_data_arrays__name__[] = "read_data_arrays"; + +PyObject * pypdffit2_read_data_arrays(PyObject *, PyObject *args) +{ + char stype; + double qmax, qdamp; + int length; + char * c_name = NULL; + double *r_data = NULL; + double *Gr_data = NULL; + double *dGr_data = NULL; + PyObject *py_r_data = Py_None; + PyObject *py_Gr_data = Py_None; + PyObject *py_dGr_data = Py_None; + PyObject *py_ppdf = NULL; + int ok = PyArg_ParseTuple(args, "OcddOO|Os", &py_ppdf, &stype, &qmax, &qdamp, + &py_r_data, &py_Gr_data, &py_dGr_data, &c_name); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + + length = PyList_Size(py_Gr_data); + //quick check that the arrays are all the same length // + int r_len = PyList_Size(py_r_data); + int dGr_len = length; + if(py_dGr_data != Py_None) { + dGr_len = PyList_Size(py_dGr_data); + } + if(r_len != length || dGr_len != length) + { + string err_string = "Data arrays have different lengths"; + PyErr_SetString(PyExc_ValueError, err_string.c_str()); + return 0; + } + + // create data arrays + r_data = new double [length]; + double_array_from_pylist(py_r_data, r_data, length); + Gr_data = new double [length]; + double_array_from_pylist(py_Gr_data, Gr_data, length); + if(py_dGr_data != Py_None) { + dGr_data = new double [length]; + double_array_from_pylist(py_dGr_data, dGr_data, length); + } + string name = c_name; + try { + ppdf->read_data_arrays(stype, qmax, qdamp, length, + r_data, Gr_data, dGr_data, name); + } + catch(dataError e) { + PyErr_SetString(pypdffit2_dataError, e.GetMsg().c_str()); + return 0; + } + + // read_data_arrays creates its own copy of the data, so we must delete our + // copies here. + delete [] r_data; + delete [] Gr_data; + if( dGr_data != NULL ) delete [] dGr_data; + Py_INCREF(Py_None); + return Py_None; +} + +// pdfrange (range in c) +char pypdffit2_pdfrange__doc__[] = "Set r-range of pdf."; +char pypdffit2_pdfrange__name__[] = "pdfrange"; + +PyObject * pypdffit2_pdfrange(PyObject *, PyObject *args) +{ + int iset; + double rmin, rmax; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oidd", &py_ppdf, &iset, &rmin, &rmax); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + ppdf->range(iset, rmin, rmax); + } + catch (ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// reset +char pypdffit2_reset__doc__[] = "reset pdf data"; +char pypdffit2_reset__name__[] = "reset"; + +PyObject * pypdffit2_reset(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + ppdf->reset(); + Py_INCREF(Py_None); + return Py_None; +} + +// alloc +char pypdffit2_alloc__doc__[] = "Allocate space for pdf data"; +char pypdffit2_alloc__name__[] = "alloc"; + +PyObject * pypdffit2_alloc(PyObject *, PyObject *args) +{ + char stype; + double qmax, qdamp, rmin, rmax; + int bin; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Ocddddi", &py_ppdf, &stype, &qmax, &qdamp, &rmin, &rmax, &bin); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + ppdf->alloc(stype, qmax, qdamp, rmin, rmax, bin); + } + catch (ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + catch (unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// calc +char pypdffit2_calc__doc__[] = "calculate pdf from data"; +char pypdffit2_calc__name__[] = "calc"; + +PyObject * pypdffit2_calc(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + ppdf->calc(); + } + catch (calculationError e) { + PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); + return 0; + } + catch (unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch (parseError e) { + PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// refine +char pypdffit2_refine__doc__[] = "refine model to pdf data"; +char pypdffit2_refine__name__[] = "refine"; + +PyObject * pypdffit2_refine(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + double toler; + int ok = PyArg_ParseTuple(args, "Od", &py_ppdf, &toler); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + ppdf->refine(true, toler); + } + catch(constraintError e) { + PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); + return 0; + } + catch(calculationError e) { + PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// local helper class for background thread in pypdffit2_refine_step() +namespace { + +class RefineStepHelper +{ + private: + PyThreadState* thread_state; + ostringstream msgout; + + public: + // Constructor saves thread state and arranges for holding + // engine output when redirected + RefineStepHelper() + { + if (py_stdout_streambuf) + { + NS_PDFFIT2::pout->rdbuf(msgout.rdbuf()); + } + thread_state = PyEval_SaveThread(); + } + + // method for restoring thread state and writing any outstanding output + void clean() + { + PyEval_RestoreThread(thread_state); + if (py_stdout_streambuf) + { + NS_PDFFIT2::pout->rdbuf(py_stdout_streambuf); + *NS_PDFFIT2::pout << msgout.str(); + } + } +}; + +} // local namespace + +// refine_step +char pypdffit2_refine_step__doc__[] = "Make one step in the refinement process."; +char pypdffit2_refine_step__name__[] = "refine_step"; + +PyObject * pypdffit2_refine_step(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + double toler; + int ok = PyArg_ParseTuple(args, "Od", &py_ppdf, &toler); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + RefineStepHelper janitor; // takes care of thread an output issues + int finished = 1; + try { + finished = ppdf->refine_step(true, toler); + } + catch(parseError e) { + // parseError is due to invalid constraint + janitor.clean(); + PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); + return 0; + } + catch(constraintError e) { + janitor.clean(); + PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); + return 0; + } + catch(calculationError e) { + janitor.clean(); + PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); + return 0; + } + catch(unassignedError e) { + janitor.clean(); + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(...) { + janitor.clean(); + return 0; + } + janitor.clean(); + + return Py_BuildValue("i", finished); +} + +// save_pdf +char pypdffit2_save_pdf__doc__[] = "Save calculated pdf to file"; +char pypdffit2_save_pdf__name__[] = "save_pdf"; + +PyObject * pypdffit2_save_pdf(PyObject *, PyObject *args) +{ + char *fname; + int iset; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Ois", &py_ppdf, &iset, &fname); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + string outfilestring = ppdf->save_pdf(iset, fname); + return Py_BuildValue("s", outfilestring.c_str()); + } + catch(IOError e) + { + PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); + return 0; + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// save_dif +char pypdffit2_save_dif__doc__[] = "Save pdf difference to file"; +char pypdffit2_save_dif__name__[] = "save_dif"; + +PyObject * pypdffit2_save_dif(PyObject *, PyObject *args) +{ + char *fname; + int iset; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Ois", &py_ppdf, &iset, &fname); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + string outfilestring = ppdf->save_dif(iset, fname); + return Py_BuildValue("s", outfilestring.c_str()); + } + catch(IOError e) + { + PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); + return 0; + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// save_res +char pypdffit2_save_res__doc__[] = "Save residual to file"; +char pypdffit2_save_res__name__[] = "save_res"; + +PyObject * pypdffit2_save_res(PyObject *, PyObject *args) +{ + char *fname; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &fname); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + string outfilestring = ppdf->save_res(fname); + return Py_BuildValue("s", outfilestring.c_str()); + } + catch(IOError e) + { + PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); + return 0; + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// save_struct +char pypdffit2_save_struct__doc__[] = "Save refined structure to file"; +char pypdffit2_save_struct__name__[] = "save_struct"; + +PyObject * pypdffit2_save_struct(PyObject *, PyObject *args) +{ + char *fname; + int iset; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Ois", &py_ppdf, &iset, &fname); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + string outfilestring = ppdf->save_struct(iset, fname); + return Py_BuildValue("s", outfilestring.c_str()); + } + catch(IOError e) + { + PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); + return 0; + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// show_struct +char pypdffit2_show_struct__doc__[] = "Show structure."; +char pypdffit2_show_struct__name__[] = "show_struct"; + +PyObject * pypdffit2_show_struct(PyObject *, PyObject *args) +{ + int ip; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + string outfilestring = ppdf->show_struct(ip); + return Py_BuildValue("s", outfilestring.c_str()); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// constrain to string +char pypdffit2_constrain_str__doc__[] = "Constrain refined variable to string."; +char pypdffit2_constrain_str__name__[] = "constrain_str"; + +PyObject* pypdffit2_constrain_str(PyObject*, PyObject* args) +{ + PyObject* py_v = 0; + char* vname; + char* form; + PyObject* py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "OOss", &py_ppdf, &py_v, &vname, &form); + if (!ok) return 0; + PdfFit* ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + RefVar* v = (RefVar *) PyCapsule_GetPointer(py_v, cnvar); + if (v->type() != "RefVar") + { + string emsg = "cannot constrain non-refinable variable "; + emsg += vname; + PyErr_SetString(pypdffit2_constraintError, emsg.c_str()); + return 0; + } + if (v->isAssigned()) { + try { + ppdf->constrain(*v, form); + } + catch (constraintError e) { + PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); + return 0; + } + catch (unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + } + else { + ostringstream emsg; + emsg << "Variable " << vname << " was not yet assigned"; + PyErr_SetString(pypdffit2_unassignedError, emsg.str().c_str()); + } + Py_INCREF(Py_None); + return Py_None; +} + +// constrain to integer. +char pypdffit2_constrain_int__doc__[] = "Constrain refined variable to integer."; +char pypdffit2_constrain_int__name__[] = "constrain_int"; + +PyObject* pypdffit2_constrain_int(PyObject*, PyObject* args) +{ + PyObject* py_v = 0; + int ftype = 0; + char* vname; + int ipar; + PyObject* py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "OOsi|i", &py_ppdf, &py_v, &vname, &ipar, &ftype); + if (!ok) return 0; + PdfFit* ppdf = (PdfFit*) PyCapsule_GetPointer(py_ppdf, cnpfit); + RefVar* v = (RefVar*) PyCapsule_GetPointer(py_v, cnvar); + if (v->type() != "RefVar") + { + string emsg = "cannot constrain non-refinable variable "; + emsg += vname; + PyErr_SetString(pypdffit2_constraintError, emsg.c_str()); + return 0; + } + if (v->isAssigned()) { + try { + if (ftype) + { + ppdf->constrain(*v, ipar, (FCON)ftype); + } + else ppdf->constrain(*v, ipar); + } + catch (constraintError e) { + PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); + return 0; + } + catch (unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + } + else { + ostringstream emsg; + emsg << "Variable " << vname << " was not yet assigned"; + PyErr_SetString(pypdffit2_unassignedError, emsg.str().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// setpar with value of double +char pypdffit2_setpar_dbl__doc__[] = "Set parameter value."; +char pypdffit2_setpar_dbl__name__[] = "setpar_dbl"; + +PyObject * pypdffit2_setpar_dbl(PyObject *, PyObject *args) +{ + unsigned int n; + double val; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "OId", &py_ppdf, &n, &val); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->setpar(n, val); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// setpar with value of RefVar +char pypdffit2_setpar_RV__doc__[] = "Set parameter value via refined variable."; +char pypdffit2_setpar_RV__name__[] = "setpar_RV"; + +PyObject * pypdffit2_setpar_RV(PyObject *, PyObject *args) +{ + unsigned int n; + RefVar *v; + PyObject *py_v; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "OIO", &py_ppdf, &n, &py_v); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + v = (RefVar *) PyCapsule_GetPointer(py_v, cnvar); + if( v->isAssigned() ) { + try + { + ppdf->setpar(n, *v); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + } + else { + string eout = "Variable not yet assigned"; + PyErr_SetString(pypdffit2_unassignedError, eout.c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// setvar +char pypdffit2_setvar__doc__[] = "Set variable to value."; +char pypdffit2_setvar__name__[] = "setvar"; + +PyObject * pypdffit2_setvar(PyObject *, PyObject *args) +{ + double a; + NonRefVar *v; + PyObject *py_v; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "OOd", &py_ppdf, &py_v, &a); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + v = (NonRefVar *) PyCapsule_GetPointer(py_v, cnvar); + if( v->isAssigned() ) { + ppdf->setvar(*v, a); + } + else { + string eout = "Must import a structure"; + PyErr_SetString(pypdffit2_unassignedError, eout.c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// getvar +char pypdffit2_getvar__doc__[] = "Get variable value."; +char pypdffit2_getvar__name__[] = "getvar"; + +PyObject * pypdffit2_getvar(PyObject *, PyObject *args) +{ + NonRefVar *v = 0; + PyObject *py_v = 0; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "OO", &py_ppdf, &py_v); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + v = (NonRefVar *) PyCapsule_GetPointer(py_v, cnvar); + if(v->isAssigned()) { + double crval = ppdf->getvar(*v); + return Py_BuildValue("d", crval); + } + else { + string eout = "Variable not yet assigned"; + PyErr_SetString(pypdffit2_unassignedError, eout.c_str()); + return 0; + Py_INCREF(Py_None); + return Py_None; + } +} + +// getcrw +char pypdffit2_getcrw__doc__[] = "Get cumulative Rw for the current dataset."; +char pypdffit2_getcrw__name__[] = "getcrw"; + +PyObject * pypdffit2_getcrw(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + vector crw = ppdf->getcrw(); + PyObject *py_r; + py_r = PyList_New(crw.size()); + for (int i = 0; i != int(crw.size()); ++i) + { + PyList_SetItem(py_r, i, PyFloat_FromDouble(crw[i])); + } + return py_r; + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } +} + +// getrw +char pypdffit2_getrw__doc__[] = "Get rw of fit."; +char pypdffit2_getrw__name__[] = "getrw"; + +PyObject * pypdffit2_getrw(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + double crval = ppdf->getrw(); + return Py_BuildValue("d", crval); +} + +// getR +char pypdffit2_getR__doc__[] = "Get list of r-values for plotting."; +char pypdffit2_getR__name__[] = "getR"; + +PyObject * pypdffit2_getR(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + /* One should not put functionality in the bindings. However, + * this function is meant to create a python object from a + * c-object that does not actually exist. All that is stored + * in pdffit about the fitted R-range is the minimum, maximum, + * and step size. This binding turns that info into a python + * list. If the number of fit points stored in nfmax and nfmin + * have not yet been assigned, then this falls back on the + * r-points. This is crucial so that one can investigate the + * PDF before any fitting has been done. Once fit parameters + * have been established, they can be used and the r list, + * pdf-obs list, and pdf-fit list will be the same size. + * Also see getpdf_obs(). + */ + try + { + int nfmin = ppdf->getnfmin(); + int nfmax = ppdf->getnfmax(); + int len = nfmax - nfmin + 1; + double rmin = ppdf->getrmin(); + double rmax = ppdf->getrmax(); + double deltar = ppdf->getdeltar(); + PyObject *py_r; + if(len == 1) + { + nfmin = 0; + nfmax = (int) ((rmax - rmin)/deltar); + len = nfmax + 1; + } + py_r = PyList_New(len); + for (int i=nfmin;i<=nfmax;i++) + { + PyList_SetItem(py_r, i-nfmin, Py_BuildValue("d", i*deltar + rmin)); + } + + return py_r; + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } +} + + +// getpdf_fit +char pypdffit2_getpdf_fit__doc__[] = "Get list of calculated pdf points."; +char pypdffit2_getpdf_fit__name__[] = "getpdf_fit"; + +PyObject * pypdffit2_getpdf_fit(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + //Return only the data range used in the fit + try + { + int min = ppdf->getnfmin(); + int max = ppdf->getnfmax(); + int len = max - min + 1; + vector v_pdfdata = ppdf->getpdf_fit(); + PyObject *py_r; + py_r = PyList_New(len); + for (int i=min;i<=max;i++) { + PyList_SetItem(py_r, i-min, Py_BuildValue("d", v_pdfdata[i])); + } + return py_r; + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } +} + + +// getpdf_obs +char pypdffit2_getpdf_obs__doc__[] = "Get list of observed (theory) pdf points."; +char pypdffit2_getpdf_obs__name__[] = "getpdf_obs"; + +PyObject * pypdffit2_getpdf_obs(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + vector v_pdfdata = ppdf->getpdf_obs(); + int nfmin = ppdf->getnfmin(); + int nfmax = ppdf->getnfmax(); + int len = nfmax - nfmin + 1; + //Return only the data range used in the fit + PyObject *py_r; + py_r = PyList_New(len); + for (int i=nfmin;i<=nfmax;i++) { + PyList_SetItem(py_r, i-nfmin, Py_BuildValue("d", v_pdfdata[i])); + } + return py_r; + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } +} + +// getpdf_diff +char pypdffit2_getpdf_diff__doc__[] = "Get list of differences between observed and fitted PDF points."; +char pypdffit2_getpdf_diff__name__[] = "getpdf_diff"; + +PyObject * pypdffit2_getpdf_diff(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + vector Gobs = ppdf->getpdf_obs(); + vector Gfit = ppdf->getpdf_fit(); + int nfmin = ppdf->getnfmin(); + int nfmax = ppdf->getnfmax(); + int len = nfmax - nfmin + 1; + //Return only the data range used in the fit + PyObject *py_r; + py_r = PyList_New(len); + for (int i = nfmin; i <= nfmax; i++) { + double Gdiff_i = Gobs[i] - Gfit[i]; + PyList_SetItem(py_r, i-nfmin, Py_BuildValue("d", Gdiff_i)); + } + return py_r; + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } +} + + +// getpar +char pypdffit2_getpar__doc__[] = "Get value of parameter"; +char pypdffit2_getpar__name__[] = "getpar"; + +PyObject * pypdffit2_getpar(PyObject *, PyObject *args) +{ + unsigned int n; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "OI", &py_ppdf, &n); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + double crval = ppdf->getpar(n); + return Py_BuildValue("d", crval); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } +} + +// fixpar +char pypdffit2_fixpar__doc__[] = "Fix value of parameter."; +char pypdffit2_fixpar__name__[] = "fixpar"; + +PyObject * pypdffit2_fixpar(PyObject *, PyObject *args) +{ + int n; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &n); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->fixpar(n); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// freepar +char pypdffit2_freepar__doc__[] = "Free parameter."; +char pypdffit2_freepar__name__[] = "freepar"; + +PyObject * pypdffit2_freepar(PyObject *, PyObject *args) +{ + int n; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &n); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->freepar(n); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// setphase +char pypdffit2_setphase__doc__[] = "Set phase in focus."; +char pypdffit2_setphase__name__[] = "setphase"; + +PyObject * pypdffit2_setphase(PyObject *, PyObject *args) +{ + int ip; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->setphase(ip); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// setdata +char pypdffit2_setdata__doc__[] = "Set data in focus."; +char pypdffit2_setdata__name__[] = "setdata"; + +PyObject * pypdffit2_setdata(PyObject *, PyObject *args) +{ + int is; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &is); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->setdata(is); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// psel +char pypdffit2_psel__doc__[] = "Select phase in focus."; +char pypdffit2_psel__name__[] = "psel"; + +PyObject * pypdffit2_psel(PyObject *, PyObject *args) +{ + int ip; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->selphase(ip); + } + catch(unassignedError e) + { + // PyErr_Warn(PyExc_Warning, e.GetMsg().c_str()); + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// pdesel +char pypdffit2_pdesel__doc__[] = "Deselect phase in focus."; +char pypdffit2_pdesel__name__[] = "pdesel"; + +PyObject * pypdffit2_pdesel(PyObject *, PyObject *args) +{ + int ip; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->pdesel(ip); + } + catch(unassignedError e) + { + // PyErr_Warn(PyExc_Warning, e.GetMsg().c_str()); + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// selectAtomType +char pypdffit2_selectAtomType__doc__[] = "Include element in 'i' or 'j' pair of PDF calculation."; +char pypdffit2_selectAtomType__name__[] = "selectAtomType"; + +PyObject * pypdffit2_selectAtomType(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ip; + char ijchar; + char* smbpat; + bool select; + int ok = PyArg_ParseTuple(args, "Oicsb", &py_ppdf, &ip, &ijchar, &smbpat, &select); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->selectAtomType(ip, ijchar, smbpat, select); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) + { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// selectAtomIndex +char pypdffit2_selectAtomIndex__doc__[] = "Include atom of given index in 'i' or 'j' pair of PDF calculation."; +char pypdffit2_selectAtomIndex__name__[] = "selectAtomIndex"; + +PyObject * pypdffit2_selectAtomIndex(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ip; + char ijchar; + int aidx1; + bool select; + int ok = PyArg_ParseTuple(args, "Oicib", &py_ppdf, &ip, &ijchar, &aidx1, &select); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->selectAtomIndex(ip, ijchar, aidx1, select); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) + { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// selectAll +char pypdffit2_selectAll__doc__[] = "Include all atoms in 'i' or 'j' pair of PDF calculation."; +char pypdffit2_selectAll__name__[] = "selectAll"; + +PyObject * pypdffit2_selectAll(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ip; + char ijchar; + int ok = PyArg_ParseTuple(args, "Oic", &py_ppdf, &ip, &ijchar); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->selectAll(ip, ijchar); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) + { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// selectNone +char pypdffit2_selectNone__doc__[] = "Include all atoms in 'i' or 'j' pair of PDF calculation."; +char pypdffit2_selectNone__name__[] = "selectNone"; + +PyObject * pypdffit2_selectNone(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ip; + char ijchar; + int ok = PyArg_ParseTuple(args, "Oic", &py_ppdf, &ip, &ijchar); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try + { + ppdf->selectNone(ip, ijchar); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) + { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// bond_angle +char pypdffit2_bond_angle__doc__[] = "Return bond angle between three atoms."; +char pypdffit2_bond_angle__name__[] = "bond_angle"; + +PyObject * pypdffit2_bond_angle(PyObject *, PyObject *args) +{ + int ia, ja, ka; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oiii", &py_ppdf, &ia, &ja, &ka); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + pair angstd = ppdf->bond_angle(ia, ja, ka); + PyObject* py_tpl; + py_tpl = Py_BuildValue("(d,d)", angstd.first, angstd.second); + return py_tpl; + } + catch (ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + catch (unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } +} + +// bond_length_atoms (nearest bond length between two atoms) +char pypdffit2_bond_length_atoms__doc__[] = + "Return a tuple of (dij, ddij) for distance between two atoms\n" + "and its standard deviation."; +char pypdffit2_bond_length_atoms__name__[] = "bond_length_atoms"; + +PyObject * pypdffit2_bond_length_atoms(PyObject *, PyObject *args) +{ + int ia, ja; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oii", &py_ppdf, &ia, &ja); + PairDistance pd; + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + pd = ppdf->bond_length_atoms(ia, ja); + PyObject *py_tpl; + py_tpl = Py_BuildValue("(d,d)", pd.dij, pd.ddij); + return py_tpl; + } + catch (ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + catch (unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } +} + +// bond_length_types (bond lengths between two elements inside given bounds) +char pypdffit2_bond_length_types__doc__[] = + "Return bond lengths between two elements within given bounds\n" + "\n" + "a1 -- symbol of the first element in pair or 'ALL'\n" + "a2 -- symbol of the second element in pair or 'ALL'\n" + "lb -- lower bound for bond lengths\n" + "ub -- upper bound for bond lengths\n" + "\n" + "Return a dictionary of distance data containing:\n" + "\n" + "dij : list of bond lenghts within given bounds\n" + "ddij : list of bond legnth standard deviations\n" + "ij0 : list of tupled pairs of indices starting at 0\n" + "ij1 : list of tupled pairs of indices starting at 1"; +char pypdffit2_bond_length_types__name__[] = "bond_length_types"; + +PyObject * pypdffit2_bond_length_types(PyObject *, PyObject *args) +{ + char* symi; + char* symj; + double bmin = 0; + double bmax = 0; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Ossdd", &py_ppdf, &symi, &symj, &bmin, &bmax); + vector pdvec; + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + pdvec = ppdf->bond_length_types(symi, symj, bmin, bmax); + int np = pdvec.size(); + PyObject* py_dij; + PyObject* py_ddij; + PyObject* py_ij0; + PyObject* py_ij1; + py_dij = PyList_New(np); + py_ddij = PyList_New(np); + py_ij0 = PyList_New(np); + py_ij1 = PyList_New(np); + for (int i = 0; i < np; ++i) + { + PairDistance& pd = pdvec[i]; + PyObject *py_item; + py_item = PyFloat_FromDouble(pd.dij); + PyList_SetItem(py_dij, i, py_item); + py_item = PyFloat_FromDouble(pd.ddij); + PyList_SetItem(py_ddij, i, py_item); + py_item = Py_BuildValue("(i,i)", pd.i - 1, pd.j - 1); + PyList_SetItem(py_ij0, i, py_item); + py_item = Py_BuildValue("(i,i)", pd.i, pd.j); + PyList_SetItem(py_ij1, i, py_item); + } + PyObject* py_rv; + py_rv = PyDict_New(); + PyDict_SetItemString(py_rv, "dij", py_dij); + PyDict_SetItemString(py_rv, "ddij", py_ddij); + PyDict_SetItemString(py_rv, "ij0", py_ij0); + PyDict_SetItemString(py_rv, "ij1", py_ij1); + return py_rv; + } + catch (ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + catch (unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } +} + +// get_scat_string +char pypdffit2_get_scat_string__doc__[] = "Return string with scatter details."; +char pypdffit2_get_scat_string__name__[] = "get_scat_string"; + +PyObject * pypdffit2_get_scat_string(PyObject *, PyObject *args) +{ + char stype; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oc", &py_ppdf, &stype); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + string outstring; + if (!ppdf->curphase) + { + PyErr_SetString(pypdffit2_unassignedError, "No scatterers exist"); + return 0; + } + // here curphase exists, get_scat_string throws runtime error + // for invalid stype. + try { + outstring = (ppdf->curphase)->get_scat_string(stype); + } + catch (runtime_error e) { + PyErr_SetString(PyExc_ValueError, e.what()); + return 0; + } + return Py_BuildValue("s", outstring.c_str()); +} + +// get_scat +char pypdffit2_get_scat__doc__[] = "Return scattering factor for given element."; +char pypdffit2_get_scat__name__[] = "get_scat"; + +PyObject * pypdffit2_get_scat(PyObject *, PyObject *args) +{ + char stype; + char* smbpat; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Ocs", &py_ppdf, &stype, &smbpat); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + double value; + try { + value = ppdf->get_scat(stype, smbpat); + } + catch (ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + PyObject* py_rv; + py_rv = PyFloat_FromDouble(value); + return py_rv; +} + +// set_scat +char pypdffit2_set_scat__doc__[] = "Set custom scattering factor for given element."; +char pypdffit2_set_scat__name__[] = "set_scat"; + +PyObject * pypdffit2_set_scat(PyObject *, PyObject *args) +{ + char stype; + char* smbpat; + double value; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Ocsd", &py_ppdf, &stype, &smbpat, &value); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + if (!ppdf->curphase) + { + PyErr_SetString(pypdffit2_unassignedError, "phase does not exist"); + return 0; + } + // Here curphase exists. set_scat may throw + // runtime or ValueError for invalid arguments + try { + ppdf->curphase->set_scat(stype, smbpat, value); + } + catch (ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + catch (runtime_error e) { + PyErr_SetString(PyExc_ValueError, e.what()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +// reset_scat +char pypdffit2_reset_scat__doc__[] = "Reset scattering factor for given element."; +char pypdffit2_reset_scat__name__[] = "reset_scat"; + +PyObject * pypdffit2_reset_scat(PyObject *, PyObject *args) +{ + char* smbpat; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &smbpat); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + if (!ppdf->curphase) + { + PyErr_SetString(pypdffit2_unassignedError, "phase does not exist"); + return 0; + } + // Here curphase exists. reset_scat may throw + // runtime or ValueError for invalid arguments + try { + ppdf->curphase->reset_scat(smbpat); + } + catch (ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } + Py_INCREF(Py_None); + return Py_None; +} + +//throw-away variable that helps with exception handling +//RefVar *_junkRV = new RefVar(); +// utility function (not available from Python) +RefVar *getRefVar(vector &v, unsigned int i) +{ + if (v.size() == 0) + { + throw unassignedError("Variable not yet assigned"); + } + else if (i > v.size() || i < 1) + { + stringstream errstr; + errstr << "Index " << i << " out of bounds"; + throw ValueError(errstr.str()); + } + return &v[i-1]; +} + +//current phase and set refinable variable pointers + +// lat +char pypdffit2_lat__doc__[] = "Pointer to refinable variable lat."; +char pypdffit2_lat__name__[] = "lat"; + +PyObject * pypdffit2_lat(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->lat,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// x +char pypdffit2_x__doc__[] = "Pointer to refinable variable x."; +char pypdffit2_x__name__[] = "x"; + +PyObject * pypdffit2_x(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->x,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// y +char pypdffit2_y__doc__[] = "Pointer to refinable variable y."; +char pypdffit2_y__name__[] = "y"; + +PyObject * pypdffit2_y(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->y,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// z +char pypdffit2_z__doc__[] = "Pointer to refinable variable z."; +char pypdffit2_z__name__[] = "z"; + +PyObject * pypdffit2_z(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->z,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// u11 +char pypdffit2_u11__doc__[] = "Pointer to refinable variable u11."; +char pypdffit2_u11__name__[] = "u11"; + +PyObject * pypdffit2_u11(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->u11,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// u22 +char pypdffit2_u22__doc__[] = "Pointer to refinable variable u22."; +char pypdffit2_u22__name__[] = "u22"; + +PyObject * pypdffit2_u22(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->u22,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// u33 +char pypdffit2_u33__doc__[] = "Pointer to refinable variable u33."; +char pypdffit2_u33__name__[] = "u33"; + +PyObject * pypdffit2_u33(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->u33,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// u12 +char pypdffit2_u12__doc__[] = "Pointer to refinable variable u12."; +char pypdffit2_u12__name__[] = "u12"; + +PyObject * pypdffit2_u12(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->u12,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// u13 +char pypdffit2_u13__doc__[] = "Pointer to refinable variable u13."; +char pypdffit2_u13__name__[] = "u13"; + +PyObject * pypdffit2_u13(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->u13,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// u23 +char pypdffit2_u23__doc__[] = "Pointer to refinable variable u23."; +char pypdffit2_u23__name__[] = "u23"; + +PyObject * pypdffit2_u23(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->u23,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// occ +char pypdffit2_occ__doc__[] = "Pointer to refinable variable occ."; +char pypdffit2_occ__name__[] = "occ"; + +PyObject * pypdffit2_occ(PyObject *, PyObject *args) +{ + int i; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + try { + RefVar *v = getRefVar(ppdf->occ,i); + PyObject *py_v = PyCapsule_New(v, cnvar, NULL); + return py_v; + } + catch(unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + catch(ValueError e) { + PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); + return 0; + } +} + +// pscale +char pypdffit2_pscale__doc__[] = "Pointer to variable pscale."; +char pypdffit2_pscale__name__[] = "pscale"; + +PyObject * pypdffit2_pscale(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + PyObject *py_v = PyCapsule_New(&(ppdf->pscale), cnvar, NULL); + return py_v; +} + +// spdiameter +char pypdffit2_spdiameter__doc__[] = "Pointer to variable spdiameter."; +char pypdffit2_spdiameter__name__[] = "spdiameter"; + +PyObject * pypdffit2_spdiameter(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + PyObject *py_v = PyCapsule_New(&(ppdf->spdiameter), cnvar, NULL); + return py_v; +} + +// stepcut +char pypdffit2_stepcut__doc__[] = "Pointer to nonvariable stepcut."; +char pypdffit2_stepcut__name__[] = "stepcut"; + +PyObject * pypdffit2_stepcut(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + PyObject *py_v = PyCapsule_New(&(ppdf->stepcut), cnvar, NULL); + return py_v; +} + +// sratio +char pypdffit2_sratio__doc__[] = "Pointer to variable sratio."; +char pypdffit2_sratio__name__[] = "sratio"; + +PyObject * pypdffit2_sratio(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + PyObject *py_v = PyCapsule_New(&(ppdf->sratio), cnvar, NULL); + return py_v; +} + +// delta2 +char pypdffit2_delta2__doc__[] = "Pointer to variable delta2."; +char pypdffit2_delta2__name__[] = "delta2"; + +PyObject * pypdffit2_delta2(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + PyObject *py_v = PyCapsule_New(&(ppdf->delta2), cnvar, NULL); + return py_v; +} + +// delta1 +char pypdffit2_delta1__doc__[] = "Pointer to variable delta1."; +char pypdffit2_delta1__name__[] = "delta1"; + +PyObject * pypdffit2_delta1(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + PyObject *py_v = PyCapsule_New(&(ppdf->delta1), cnvar, NULL); + return py_v; +} + +// dscale +char pypdffit2_dscale__doc__[] = "Pointer to variable dscale."; +char pypdffit2_dscale__name__[] = "dscale"; + +PyObject * pypdffit2_dscale(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + PyObject *py_v = PyCapsule_New(&(ppdf->dscale), cnvar, NULL); + return py_v; +} + +// qdamp +char pypdffit2_qdamp__doc__[] = "Pointer to variable qdamp."; +char pypdffit2_qdamp__name__[] = "qdamp"; + +PyObject * pypdffit2_qdamp(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + PyObject *py_v = PyCapsule_New(&(ppdf->qdamp), cnvar, NULL); + return py_v; +} + +// qbroad +char pypdffit2_qbroad__doc__[] = "Pointer to variable qbroad."; +char pypdffit2_qbroad__name__[] = "qbroad"; + +PyObject * pypdffit2_qbroad(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + PyObject *py_v = PyCapsule_New(&(ppdf->qbroad), cnvar, NULL); + return py_v; +} + +// rcut +char pypdffit2_rcut__doc__[] = "Pointer to nonvariable rcut."; +char pypdffit2_rcut__name__[] = "rcut"; + +PyObject * pypdffit2_rcut(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + PyObject *py_v = PyCapsule_New(&(ppdf->rcut), cnvar, NULL); + return py_v; +} + +// get_atoms +char pypdffit2_get_atoms__doc__[] = "Get element symbols of atoms in the phase."; +char pypdffit2_get_atoms__name__[] = "get_atoms"; + +PyObject * pypdffit2_get_atoms(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ip = 0; + int ok = PyArg_ParseTuple(args, "O|i", &py_ppdf, &ip); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + Phase* ph; + try { + ph = ppdf->getphase(ip); + } + catch (unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + // Phase ph is defined here + PyObject *py_atoms = PyList_New(ph->natoms); + for (int i = 0; i < ph->natoms; ++i) + { + string usymbol = toupper(ph->atom[i].atom_type->symbol); + PyList_SetItem(py_atoms, i, PyUnicode_FromString(usymbol.c_str())); + } + return py_atoms; +} + +// num_atoms +char pypdffit2_num_atoms__doc__[] = "Get the number of atoms in the current phase."; +char pypdffit2_num_atoms__name__[] = "num_atoms"; + +PyObject * pypdffit2_num_atoms(PyObject *, PyObject *args) +{ + int retval = 0; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + if (ppdf->curphase) + { + retval = (ppdf->curphase)->natoms; + } + else + { + PyErr_SetString(pypdffit2_unassignedError, "No data loaded"); + return 0; + } + return Py_BuildValue("i", retval); +} + +// get_atom_types +char pypdffit2_get_atom_types__doc__[] = "Get ordered unique symbols of atoms in the phase."; +char pypdffit2_get_atom_types__name__[] = "get_atom_types"; + +PyObject * pypdffit2_get_atom_types(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ip = 0; + int ok = PyArg_ParseTuple(args, "O|i", &py_ppdf, &ip); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + Phase* ph; + try { + ph = ppdf->getphase(ip); + } + catch (unassignedError e) { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + // Phase ph is defined here + PyObject *py_atom_types = PyList_New(ph->atom_types.size()); + for (int i = 0; i < int(ph->atom_types.size()); ++i) + { + string usymbol = toupper(ph->atom_types[i]->symbol); + PyList_SetItem(py_atom_types, i, PyUnicode_FromString(usymbol.c_str())); + } + return py_atom_types; +} + + +// num_phases +char pypdffit2_num_phases__doc__[] = "Get the number of loaded phases."; +char pypdffit2_num_phases__name__[] = "num_phases"; + +PyObject * pypdffit2_num_phases(PyObject *, PyObject *args) +{ + int retval = 0; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + retval = ppdf->num_phases(); + return Py_BuildValue("i", retval); +} + + +// num_datasets +char pypdffit2_num_datasets__doc__[] = "Get the number of loaded datasets."; +char pypdffit2_num_datasets__name__[] = "num_datasets"; + +PyObject * pypdffit2_num_datasets(PyObject *, PyObject *args) +{ + int retval = 0; + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + retval = ppdf->num_datasets(); + return Py_BuildValue("i", retval); +} + + +// phase_fractions +char pypdffit2_phase_fractions__doc__[] = + "Return relative phase fractions for current dataset scattering type\n" + "\n" + "Return a dictionary of relative phase fractions:\n" + "\n" + "atom -- list of fractions normalized to atom count\n" + "stdatom -- errors of atom count fractions\n" + "cell -- list of fractions normalized to unit cell count\n" + "stdcell -- errors of unit cell count fractions\n" + "mass -- list of relative weight fractions\n" + "stdmass -- errors of relative weight fractions\n" + ; +char pypdffit2_phase_fractions__name__[] = "phase_fractions"; + +PyObject * pypdffit2_phase_fractions(PyObject *, PyObject *args) +{ + PyObject *py_ppdf = 0; + int ok = PyArg_ParseTuple(args, "O", &py_ppdf); + if (!ok) return 0; + PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); + map > fractions; + try + { + fractions = ppdf->getPhaseFractions(); + } + catch(unassignedError e) + { + PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); + return 0; + } + // convert fractions map to an equivalent python dictionary + map >::iterator ii; + PyObject* py_rv; + py_rv = PyDict_New(); + for (ii = fractions.begin(); ii != fractions.end(); ++ii) + { + int n = ii->second.size(); + PyObject* py_lst; + py_lst = PyList_New(n); + for (int i = 0; i < n; ++i) + { + PyObject* py_value; + py_value = PyFloat_FromDouble(ii->second.at(i)); + PyList_SetItem(py_lst, i, py_value); + } + PyDict_SetItemString(py_rv, ii->first.c_str(), py_lst); + } + return py_rv; +} + +// redirect_stdout +char pypdffit2_redirect_stdout__doc__[] = "Redirect engine output to a file-like object."; +char pypdffit2_redirect_stdout__name__[] = "redirect_stdout"; + +PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *args) +{ + // instance of PyFileStreambuf which takes care of redirection + PyObject *py_file = 0; + int ok = PyArg_ParseTuple(args, "O", &py_file); + if (!ok) return 0; + // check if py_file has write and flush attributes + if ( !PyObject_HasAttrString(py_file, "write") || + !PyObject_HasAttrString(py_file, "flush") ) + { + PyErr_SetString(PyExc_TypeError, "expected file-like argument"); + return 0; + } + // create py_stdout_streambuf if necessary + if (!py_stdout_streambuf) + { + py_stdout_streambuf = new PyFileStreambuf(py_file); + } + py_stdout_streambuf->redirect(py_file); + // on first redirection we need to assign new ostream to NS_PDFFIT2::pout + if (NS_PDFFIT2::pout == &std::cout) + { + NS_PDFFIT2::pout = new ostream(py_stdout_streambuf); + } + Py_INCREF(Py_None); + return Py_None; +} + +// is_element +char pypdffit2_is_element__doc__[] = "Check if element or isotope is defined in the built-in periodic table."; +char pypdffit2_is_element__name__[] = "is_element"; + +PyObject * pypdffit2_is_element(PyObject *, PyObject *args) +{ + // instance of PyFileStreambuf which takes care of redirection + char *smbpat; + int ok = PyArg_ParseTuple(args, "s", &smbpat); + if (!ok) return 0; + const LocalPeriodicTable* lpt = LocalPeriodicTable::instance(); + PyObject *rv = PyBool_FromLong(lpt->has(smbpat)); + return rv; +} + +// End of file diff --git a/src/extensions/pdffit2module/misc.h b/src/extensions/pdffit2module/misc.h new file mode 100644 index 00000000..f8782307 --- /dev/null +++ b/src/extensions/pdffit2module/misc.h @@ -0,0 +1,486 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Chris Farrow +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Bindings from python to c++ PdfFit class. +* +* Comments: +* +***********************************************************************/ + +#ifndef PYPDFFIT2_MISC_H +#define PYPDFFIT2_MISC_H + +// copyright +extern char pypdffit2_copyright__name__[]; +extern char pypdffit2_copyright__doc__[]; +extern "C" +PyObject * pypdffit2_copyright(PyObject *, PyObject *); + +// create +extern char pypdffit2_create__name__[]; +extern char pypdffit2_create__doc__[]; +extern "C" +PyObject * pypdffit2_create(PyObject *, PyObject *); + +// read_struct +extern char pypdffit2_read_struct__name__[]; +extern char pypdffit2_read_struct__doc__[]; +extern "C" +PyObject * pypdffit2_read_struct(PyObject *, PyObject *); + +// read_struct_string +extern char pypdffit2_read_struct_string__name__[]; +extern char pypdffit2_read_struct_string__doc__[]; +extern "C" +PyObject * pypdffit2_read_struct_string(PyObject *, PyObject *); + +// read_data +extern char pypdffit2_read_data__name__[]; +extern char pypdffit2_read_data__doc__[]; +extern "C" +PyObject * pypdffit2_read_data(PyObject *, PyObject *); + +// read_data_string +extern char pypdffit2_read_data_string__name__[]; +extern char pypdffit2_read_data_string__doc__[]; +extern "C" +PyObject * pypdffit2_read_data_string(PyObject *, PyObject *); + +// read_data_arrays +extern char pypdffit2_read_data_arrays__name__[]; +extern char pypdffit2_read_data_arrays__doc__[]; +extern "C" +PyObject * pypdffit2_read_data_arrays(PyObject *, PyObject *); + +// pdfrange +extern char pypdffit2_pdfrange__doc__[]; +extern char pypdffit2_pdfrange__name__[]; +extern "C" +PyObject * pypdffit2_pdfrange(PyObject *, PyObject *); + +// reset +extern char pypdffit2_reset__doc__[]; +extern char pypdffit2_reset__name__[]; +extern "C" +PyObject * pypdffit2_reset(PyObject *, PyObject *); + +// alloc +extern char pypdffit2_alloc__doc__[]; +extern char pypdffit2_alloc__name__[]; +extern "C" +PyObject * pypdffit2_alloc(PyObject *, PyObject *); + +// calc +extern char pypdffit2_calc__doc__[]; +extern char pypdffit2_calc__name__[]; +extern "C" +PyObject * pypdffit2_calc(PyObject *, PyObject *); + +// refine +extern char pypdffit2_refine__doc__[]; +extern char pypdffit2_refine__name__[]; +extern "C" +PyObject * pypdffit2_refine(PyObject *, PyObject *); + +// refine_step +extern char pypdffit2_refine_step__doc__[]; +extern char pypdffit2_refine_step__name__[]; +extern "C" +PyObject * pypdffit2_refine_step(PyObject *, PyObject *); + +// save_pdf +extern char pypdffit2_save_pdf__doc__[]; +extern char pypdffit2_save_pdf__name__[]; +extern "C" +PyObject * pypdffit2_save_pdf(PyObject *, PyObject *); + +// save_dif +extern char pypdffit2_save_dif__doc__[]; +extern char pypdffit2_save_dif__name__[]; +extern "C" +PyObject * pypdffit2_save_dif(PyObject *, PyObject *); + +// save_res +extern char pypdffit2_save_res__doc__[]; +extern char pypdffit2_save_res__name__[]; +extern "C" +PyObject * pypdffit2_save_res(PyObject *, PyObject *); + +// save_struct +extern char pypdffit2_save_struct__doc__[]; +extern char pypdffit2_save_struct__name__[]; +extern "C" +PyObject * pypdffit2_save_struct(PyObject *, PyObject *); + +// show_struct +extern char pypdffit2_show_struct__doc__[]; +extern char pypdffit2_show_struct__name__[]; +extern "C" +PyObject * pypdffit2_show_struct(PyObject *, PyObject *); + +// constrain to string +extern char pypdffit2_constrain_str__doc__[]; +extern char pypdffit2_constrain_str__name__[]; +extern "C" +PyObject * pypdffit2_constrain_str(PyObject *, PyObject *); + +// constrain_int to integer +extern char pypdffit2_constrain_int__doc__[]; +extern char pypdffit2_constrain_int__name__[]; +extern "C" +PyObject * pypdffit2_constrain_int(PyObject *, PyObject *); + +// setpar_dbl +extern char pypdffit2_setpar_dbl__doc__[]; +extern char pypdffit2_setpar_dbl__name__[]; +extern "C" +PyObject * pypdffit2_setpar_dbl(PyObject *, PyObject *); + +// setpar with RefVar +extern char pypdffit2_setpar_RV__doc__[]; +extern char pypdffit2_setpar_RV__name__[]; +extern "C" +PyObject * pypdffit2_setpar_RV(PyObject *, PyObject *); + +// setvar +extern char pypdffit2_setvar__doc__[]; +extern char pypdffit2_setvar__name__[]; +extern "C" +PyObject * pypdffit2_setvar(PyObject *, PyObject *); + +// getvar +extern char pypdffit2_getvar__doc__[]; +extern char pypdffit2_getvar__name__[]; +extern "C" +PyObject * pypdffit2_getvar(PyObject *, PyObject *); + +// getR +extern char pypdffit2_getR__doc__[]; +extern char pypdffit2_getR__name__[]; +extern "C" +PyObject * pypdffit2_getR(PyObject *, PyObject *); + +// getpdf_fit +extern char pypdffit2_getpdf_fit__doc__[]; +extern char pypdffit2_getpdf_fit__name__[]; +extern "C" +PyObject * pypdffit2_getpdf_fit(PyObject *, PyObject *); + +// getpdf_obs +extern char pypdffit2_getpdf_obs__doc__[]; +extern char pypdffit2_getpdf_obs__name__[]; +extern "C" +PyObject * pypdffit2_getpdf_obs(PyObject *, PyObject *); + +// getpdf_diff +extern char pypdffit2_getpdf_diff__doc__[]; +extern char pypdffit2_getpdf_diff__name__[]; +extern "C" +PyObject * pypdffit2_getpdf_diff(PyObject *, PyObject *); + +// getcrw +extern char pypdffit2_getcrw__doc__[]; +extern char pypdffit2_getcrw__name__[]; +extern "C" +PyObject * pypdffit2_getcrw(PyObject *, PyObject *); + +// getrw +extern char pypdffit2_getrw__doc__[]; +extern char pypdffit2_getrw__name__[]; +extern "C" +PyObject * pypdffit2_getrw(PyObject *, PyObject *); + +// getpar +extern char pypdffit2_getpar__doc__[]; +extern char pypdffit2_getpar__name__[]; +extern "C" +PyObject * pypdffit2_getpar(PyObject *, PyObject *); + +// fixpar +extern char pypdffit2_fixpar__doc__[]; +extern char pypdffit2_fixpar__name__[]; +extern "C" +PyObject * pypdffit2_fixpar(PyObject *, PyObject *); + +// freepar +extern char pypdffit2_freepar__doc__[]; +extern char pypdffit2_freepar__name__[]; +extern "C" +PyObject * pypdffit2_freepar(PyObject *, PyObject *); + +// setphase +extern char pypdffit2_setphase__doc__[]; +extern char pypdffit2_setphase__name__[]; +extern "C" +PyObject * pypdffit2_setphase(PyObject *, PyObject *); + +// setdata +extern char pypdffit2_setdata__doc__[]; +extern char pypdffit2_setdata__name__[]; +extern "C" +PyObject * pypdffit2_setdata(PyObject *, PyObject *); + +// psel +extern char pypdffit2_psel__doc__[]; +extern char pypdffit2_psel__name__[]; +extern "C" +PyObject * pypdffit2_psel(PyObject *, PyObject *); + +// pdesel +extern char pypdffit2_pdesel__doc__[]; +extern char pypdffit2_pdesel__name__[]; +extern "C" +PyObject * pypdffit2_pdesel(PyObject *, PyObject *); + +// selectAtomType +extern char pypdffit2_selectAtomType__doc__[]; +extern char pypdffit2_selectAtomType__name__[]; +extern "C" +PyObject * pypdffit2_selectAtomType(PyObject *, PyObject *); + +// selectAtomIndex +extern char pypdffit2_selectAtomIndex__doc__[]; +extern char pypdffit2_selectAtomIndex__name__[]; +extern "C" +PyObject * pypdffit2_selectAtomIndex(PyObject *, PyObject *); + +// selectAll +extern char pypdffit2_selectAll__doc__[]; +extern char pypdffit2_selectAll__name__[]; +extern "C" +PyObject * pypdffit2_selectAll(PyObject *, PyObject *); + +// selectNone +extern char pypdffit2_selectNone__doc__[]; +extern char pypdffit2_selectNone__name__[]; +extern "C" +PyObject * pypdffit2_selectNone(PyObject *, PyObject *); + +// bond_angle +extern char pypdffit2_bond_angle__doc__[]; +extern char pypdffit2_bond_angle__name__[]; +extern "C" +PyObject * pypdffit2_bond_angle(PyObject *, PyObject *); + +// bond_length_atoms +extern char pypdffit2_bond_length_atoms__doc__[]; +extern char pypdffit2_bond_length_atoms__name__[]; +extern "C" +PyObject * pypdffit2_bond_length_atoms(PyObject *, PyObject *); + +// bond_length_types +extern char pypdffit2_bond_length_types__doc__[]; +extern char pypdffit2_bond_length_types__name__[]; +extern "C" +PyObject * pypdffit2_bond_length_types(PyObject *, PyObject *); + +// get_scat_string +extern char pypdffit2_get_scat_string__doc__[]; +extern char pypdffit2_get_scat_string__name__[]; +extern "C" +PyObject * pypdffit2_get_scat_string(PyObject *, PyObject *); + +// get_scat +extern char pypdffit2_get_scat__doc__[]; +extern char pypdffit2_get_scat__name__[]; +extern "C" +PyObject * pypdffit2_get_scat(PyObject *, PyObject *); + +// set_scat +extern char pypdffit2_set_scat__doc__[]; +extern char pypdffit2_set_scat__name__[]; +extern "C" +PyObject * pypdffit2_set_scat(PyObject *, PyObject *); + +// reset_scat +extern char pypdffit2_reset_scat__doc__[]; +extern char pypdffit2_reset_scat__name__[]; +extern "C" +PyObject * pypdffit2_reset_scat(PyObject *, PyObject *); + +// lat +extern char pypdffit2_lat__doc__[]; +extern char pypdffit2_lat__name__[]; +extern "C" +PyObject * pypdffit2_lat(PyObject *, PyObject *); + +// x +extern char pypdffit2_x__doc__[]; +extern char pypdffit2_x__name__[]; +extern "C" +PyObject * pypdffit2_x(PyObject *, PyObject *); + +// y +extern char pypdffit2_y__doc__[]; +extern char pypdffit2_y__name__[]; +extern "C" +PyObject * pypdffit2_y(PyObject *, PyObject *); + +// z +extern char pypdffit2_z__doc__[]; +extern char pypdffit2_z__name__[]; +extern "C" +PyObject * pypdffit2_z(PyObject *, PyObject *); + +// u11 +extern char pypdffit2_u11__doc__[]; +extern char pypdffit2_u11__name__[]; +extern "C" +PyObject * pypdffit2_u11(PyObject *, PyObject *); + +// u22 +extern char pypdffit2_u22__doc__[]; +extern char pypdffit2_u22__name__[]; +extern "C" +PyObject * pypdffit2_u22(PyObject *, PyObject *); + +// u33 +extern char pypdffit2_u33__doc__[]; +extern char pypdffit2_u33__name__[]; +extern "C" +PyObject * pypdffit2_u33(PyObject *, PyObject *); + +// u12 +extern char pypdffit2_u12__doc__[]; +extern char pypdffit2_u12__name__[]; +extern "C" +PyObject * pypdffit2_u12(PyObject *, PyObject *); + +// u13 +extern char pypdffit2_u13__doc__[]; +extern char pypdffit2_u13__name__[]; +extern "C" +PyObject * pypdffit2_u13(PyObject *, PyObject *); + +// u23 +extern char pypdffit2_u23__doc__[]; +extern char pypdffit2_u23__name__[]; +extern "C" +PyObject * pypdffit2_u23(PyObject *, PyObject *); + +// occ +extern char pypdffit2_occ__doc__[]; +extern char pypdffit2_occ__name__[]; +extern "C" +PyObject * pypdffit2_occ(PyObject *, PyObject *); + +// pscale +extern char pypdffit2_pscale__doc__[]; +extern char pypdffit2_pscale__name__[]; +extern "C" +PyObject * pypdffit2_pscale(PyObject *, PyObject *); + +// spdiameter +extern char pypdffit2_spdiameter__doc__[]; +extern char pypdffit2_spdiameter__name__[]; +extern "C" +PyObject * pypdffit2_spdiameter(PyObject *, PyObject *); + +// stepcut +extern char pypdffit2_stepcut__doc__[]; +extern char pypdffit2_stepcut__name__[]; +extern "C" +PyObject * pypdffit2_stepcut(PyObject *, PyObject *); + +// sratio +extern char pypdffit2_sratio__doc__[]; +extern char pypdffit2_sratio__name__[]; +extern "C" +PyObject * pypdffit2_sratio(PyObject *, PyObject *); + +// delta2 +extern char pypdffit2_delta2__doc__[]; +extern char pypdffit2_delta2__name__[]; +extern "C" +PyObject * pypdffit2_delta2(PyObject *, PyObject *); + +// delta1 +extern char pypdffit2_delta1__doc__[]; +extern char pypdffit2_delta1__name__[]; +extern "C" +PyObject * pypdffit2_delta1(PyObject *, PyObject *); + +// dscale +extern char pypdffit2_dscale__doc__[]; +extern char pypdffit2_dscale__name__[]; +extern "C" +PyObject * pypdffit2_dscale(PyObject *, PyObject *); + +// qdamp +extern char pypdffit2_qdamp__doc__[]; +extern char pypdffit2_qdamp__name__[]; +extern "C" +PyObject * pypdffit2_qdamp(PyObject *, PyObject *); + +// qbroad +extern char pypdffit2_qbroad__doc__[]; +extern char pypdffit2_qbroad__name__[]; +extern "C" +PyObject * pypdffit2_qbroad(PyObject *, PyObject *); + +// rcut +extern char pypdffit2_rcut__doc__[]; +extern char pypdffit2_rcut__name__[]; +extern "C" +PyObject * pypdffit2_rcut(PyObject *, PyObject *); + +// get_atoms +extern char pypdffit2_get_atoms__doc__[]; +extern char pypdffit2_get_atoms__name__[]; +extern "C" +PyObject * pypdffit2_get_atoms(PyObject *, PyObject *); + +// num_atoms +extern char pypdffit2_num_atoms__doc__[]; +extern char pypdffit2_num_atoms__name__[]; +extern "C" +PyObject * pypdffit2_num_atoms(PyObject *, PyObject *); + +// get_atom_types +extern char pypdffit2_get_atom_types__doc__[]; +extern char pypdffit2_get_atom_types__name__[]; +extern "C" +PyObject * pypdffit2_get_atom_types(PyObject *, PyObject *); + +// num_phases +extern char pypdffit2_num_phases__doc__[]; +extern char pypdffit2_num_phases__name__[]; +extern "C" +PyObject * pypdffit2_num_phases(PyObject *, PyObject *); + +// num_datasets +extern char pypdffit2_num_datasets__doc__[]; +extern char pypdffit2_num_datasets__name__[]; +extern "C" +PyObject * pypdffit2_num_datasets(PyObject *, PyObject *); + +// phase_fractions +extern char pypdffit2_phase_fractions__doc__[]; +extern char pypdffit2_phase_fractions__name__[]; +extern "C" +PyObject * pypdffit2_phase_fractions(PyObject *, PyObject *); + +// redirect_stdout +extern char pypdffit2_redirect_stdout__doc__[]; +extern char pypdffit2_redirect_stdout__name__[]; +extern "C" +PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *); + +// is_element +extern char pypdffit2_is_element__doc__[]; +extern char pypdffit2_is_element__name__[]; +extern "C" +PyObject * pypdffit2_is_element(PyObject *, PyObject *); + +#endif // PYPDFFIT2_MISC_H diff --git a/src/extensions/pdffit2module/pdffit2module.cc b/src/extensions/pdffit2module/pdffit2module.cc new file mode 100644 index 00000000..acf89fa3 --- /dev/null +++ b/src/extensions/pdffit2module/pdffit2module.cc @@ -0,0 +1,150 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Chris Farrow +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* The python pdffit2 module. +* +* Comments: +* +***********************************************************************/ +#define PY_SSIZE_T_CLEAN +#include +#include + +#include "pyexceptions.h" +#include "bindings.h" +#include "libpdffit2/pdffit.h" + +using namespace std; + +char pypdffit2_module__doc__[] = + "pdffit2 - interface to the core calculation routines in C++"; + +// local helper for transfer version information from +// Python to C++ PdfFit class. + +namespace { + +void transfer_version() +{ + // obtain version information from the Python module + PyObject* mdiffpy_pdffit2; + mdiffpy_pdffit2 = PyImport_ImportModule("diffpy.pdffit2"); + if (!mdiffpy_pdffit2) return; + PyObject* pyversion; + pyversion = PyObject_GetAttrString(mdiffpy_pdffit2, "__version__"); + Py_DECREF(mdiffpy_pdffit2); + if (!pyversion) return; + const char* cversion; +#if PY_MAJOR_VERSION >= 3 + cversion = PyUnicode_AsUTF8(pyversion); +#else + cversion = PyString_AsString(pyversion); +#endif + // copy version information to C++ constant + if (cversion) PdfFit::version(cversion); + Py_DECREF(pyversion); +} + + +void setup_module_contents(PyObject* d) +{ + // install the module exceptions + pypdffit2_runtimeError = PyErr_NewException("pdffit2.runtime", 0, 0); + PyDict_SetItemString(d, "RuntimeException", pypdffit2_runtimeError); + + pypdffit2_unassignedError = PyErr_NewException( + "pdffit2.unassignedError", 0, 0); + PyDict_SetItemString(d, "unassignedError", pypdffit2_unassignedError); + + pypdffit2_dataError = PyErr_NewException( + "pdffit2.dataError", 0, 0); + PyDict_SetItemString(d, "dataError", pypdffit2_dataError); + + pypdffit2_structureError = PyErr_NewException( + "pdffit2.structureError", 0, 0); + PyDict_SetItemString(d, "structureError", pypdffit2_structureError); + + pypdffit2_calculationError = PyErr_NewException( + "pdffit2.calculationError", 0, 0); + PyDict_SetItemString(d, "calculationError", pypdffit2_calculationError); + + pypdffit2_constraintError = PyErr_NewException( + "pdffit2.constraintError", 0, 0); + PyDict_SetItemString(d, "constraintError", pypdffit2_constraintError); + + transfer_version(); +} + +} // namespace ------------------------------------------------------------- + +// TODO remove PY_MAJOR_VERSION blocks after ending support for Python 2.7 + +#if PY_MAJOR_VERSION == 2 + +// Initialization function for the module (*must* be called initpdffit2) +extern "C" +void +initpdffit2() +{ + // create the module and add the functions + PyObject * m = Py_InitModule4( + "pdffit2", pypdffit2_methods, + pypdffit2_module__doc__, 0, PYTHON_API_VERSION); + + // get its dictionary + PyObject * d = PyModule_GetDict(m); + + // check for errors + if (PyErr_Occurred()) { + Py_FatalError("can't initialize module pdffit2"); + } + + // install the module exceptions and version string + setup_module_contents(d); + + return; +} + +#else + +// Module initialization for Python 3 ---------------------------------------- + +static struct PyModuleDef pdffit2moduledef = { + PyModuleDef_HEAD_INIT, + // .m_name = + "pdffit2", + // .m_doc = + pypdffit2_module__doc__, + // .m_size = + -1, + // .m_methods = + pypdffit2_methods, +}; + + +PyMODINIT_FUNC +PyInit_pdffit2(void) + +{ + PyObject *module = PyModule_Create(&pdffit2moduledef); + if (module == NULL) return NULL; + + PyObject* d = PyModule_GetDict(module); + setup_module_contents(d); + return module; +} + +#endif // PY_MAJOR_VERSION == 2 + +// End of file diff --git a/src/extensions/pdffit2module/pyexceptions.cc b/src/extensions/pdffit2module/pyexceptions.cc new file mode 100644 index 00000000..e94b3d16 --- /dev/null +++ b/src/extensions/pdffit2module/pyexceptions.cc @@ -0,0 +1,30 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Chris Farrow +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Exceptions for pdffit2 python module. +* +* Comments: +* +***********************************************************************/ +#define PY_SSIZE_T_CLEAN +#include + +PyObject *pypdffit2_runtimeError = 0; +PyObject *pypdffit2_unassignedError = 0; +PyObject *pypdffit2_dataError = 0; +PyObject *pypdffit2_structureError = 0; +PyObject *pypdffit2_calculationError = 0; +PyObject *pypdffit2_constraintError = 0; + +// End of file diff --git a/src/extensions/pdffit2module/pyexceptions.h b/src/extensions/pdffit2module/pyexceptions.h new file mode 100644 index 00000000..09bd942b --- /dev/null +++ b/src/extensions/pdffit2module/pyexceptions.h @@ -0,0 +1,33 @@ +/*********************************************************************** +* +* pdffit2 by DANSE Diffraction group +* Simon J. L. Billinge +* (c) 2006 trustees of the Michigan State University +* All rights reserved. +* +* File coded by: Chris Farrow +* +* See AUTHORS.txt for a list of people who contributed. +* See LICENSE.txt for license information. +* +************************************************************************ +* +* Exceptions for pdffit2 python module. +* +* Comments: +* +***********************************************************************/ + +#ifndef PYPDFFIT2_EXCEPTIONS_H +#define PYPDFFIT2_EXCEPTIONS_H + +// exceptions + +extern PyObject *pypdffit2_runtimeError; +extern PyObject *pypdffit2_unassignedError; +extern PyObject *pypdffit2_dataError; +extern PyObject *pypdffit2_structureError; +extern PyObject *pypdffit2_constraintError; +extern PyObject *pypdffit2_calculationError; + +#endif // PYPDFFIT2_EXCEPTIONS_H From 3d438cc94c5e4d863fa2a16458b08d5bcd047101 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Mon, 22 Jul 2024 17:35:23 -0400 Subject: [PATCH 024/294] Add relevant files for building with updated requirements --- environment.yml | 6 + pyproject.toml | 50 +++++++ requirements/build.txt | 2 + requirements/docs.txt | 4 + requirements/pip.txt | 0 requirements/run.txt | 0 requirements/test.txt | 5 + setup.py | 296 ++++++++--------------------------------- 8 files changed, 123 insertions(+), 240 deletions(-) create mode 100644 environment.yml create mode 100644 requirements/build.txt create mode 100644 requirements/docs.txt create mode 100644 requirements/pip.txt create mode 100644 requirements/run.txt create mode 100644 requirements/test.txt mode change 100755 => 100644 setup.py diff --git a/environment.yml b/environment.yml new file mode 100644 index 00000000..3979d3cb --- /dev/null +++ b/environment.yml @@ -0,0 +1,6 @@ +name: diffpy.pdffit2 +channels: + - conda-forge +dependencies: + - python=3 + - pip diff --git a/pyproject.toml b/pyproject.toml index e537e24a..6945ff83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,53 @@ +[build-system] +requires = ["setuptools>=62.0", "setuptools-git-versioning<2"] +build-backend = "setuptools.build_meta" + +[project] +name = "diffpy.pdffit2" +dynamic=['version'] +authors = [ + { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, +] +maintainers = [ + { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, +] +description = "PDFfit2 - real space structure refinement program." +keywords = ['PDF structure refinement'] +readme = "README.rst" +requires-python = ">=3.10" +classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: BSD License', + 'Operating System :: MacOS :: MacOS X', + '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', + 'Topic :: Scientific/Engineering :: Chemistry', +] + +[project.urls] +Homepage = "https://github.com/diffpy/diffpy.pdffit2/" +Issues = "https://github.com/diffpy/diffpy.pdffit2/issues/" + +[tool.setuptools-git-versioning] +enabled = true +template = "{tag}" +dev_template = "{tag}" +dirty_template = "{tag}" + +[tool.setuptools.packages.find] +where = ["src"] # list of folders that contain the packages (["."] by default) +include = ["*"] # package names should match these glob patterns (["*"] by default) +exclude = ["diffpy.pdffit2.tests*"] # exclude packages matching these glob patterns (empty by default) +namespaces = false # to disable scanning PEP 420 namespaces (true by default) + [tool.black] line-length = 115 include = '\.pyi?$' diff --git a/requirements/build.txt b/requirements/build.txt new file mode 100644 index 00000000..f72d870d --- /dev/null +++ b/requirements/build.txt @@ -0,0 +1,2 @@ +python +setuptools diff --git a/requirements/docs.txt b/requirements/docs.txt new file mode 100644 index 00000000..ab17b1c8 --- /dev/null +++ b/requirements/docs.txt @@ -0,0 +1,4 @@ +sphinx +sphinx_rtd_theme +doctr +m2r diff --git a/requirements/pip.txt b/requirements/pip.txt new file mode 100644 index 00000000..e69de29b diff --git a/requirements/run.txt b/requirements/run.txt new file mode 100644 index 00000000..e69de29b diff --git a/requirements/test.txt b/requirements/test.txt new file mode 100644 index 00000000..6f9ccf84 --- /dev/null +++ b/requirements/test.txt @@ -0,0 +1,5 @@ +flake8 +pytest +codecov +coverage +pytest-env diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 index 32800328..fbedeff1 --- a/setup.py +++ b/setup.py @@ -1,257 +1,73 @@ #!/usr/bin/env python -# Installation script for diffpy.pdffit2 - -"""PDFfit2 - real space structure refinement engine - -Packages: diffpy.pdffit2 -Scripts: pdffit2 -""" +# Extensions script for diffpy.pdffit2 +import glob import os import re import sys -import warnings - -from setuptools import Extension, find_packages, setup - -# Use this version when git data are not available, like in git zip archive. -# Update when tagging a new release. -FALLBACK_VERSION = "1.4.2" - -# determine if we run with Python 3. -PY3 = sys.version_info[0] == 3 - -# versioncfgfile holds version data for git commit hash and date. -# It must reside in the same directory as version.py. -MYDIR = os.path.dirname(os.path.abspath(__file__)) -versioncfgfile = os.path.join(MYDIR, "diffpy/pdffit2/version.cfg") -gitarchivecfgfile = os.path.join(MYDIR, ".gitarchive.cfg") - - -def gitinfo(): - from subprocess import PIPE, Popen - - kw = dict(stdout=PIPE, cwd=MYDIR, universal_newlines=True) - proc = Popen(["git", "describe", "--tags", "--match=[v,V,[:digit:]]*"], **kw) - desc = proc.stdout.read() - proc = Popen(["git", "log", "-1", "--format=%H %ct %ci"], **kw) - glog = proc.stdout.read() - rv = {} - rv["commit"], rv["timestamp"], rv["date"] = glog.strip().split(None, 2) - version = ".post".join(desc.strip().split("-")[:2]).lstrip("vV") - rv["version"] = version - return rv - - -def getversioncfg(): - if PY3: - from configparser import RawConfigParser - else: - from ConfigParser import RawConfigParser - vd0 = dict(version=FALLBACK_VERSION, commit="", date="", timestamp=0) - # first fetch data from gitarchivecfgfile, ignore if it is unexpanded - g = vd0.copy() - cp0 = RawConfigParser(vd0) - cp0.read(gitarchivecfgfile) - if len(cp0.get("DEFAULT", "commit")) > 20: - g = cp0.defaults() - mx = re.search(r"\btag: [vV]?(\d[^,]*)", g.pop("refnames")) - if mx: - g["version"] = mx.group(1) - # then try to obtain version data from git. - gitdir = os.path.join(MYDIR, ".git") - if os.path.exists(gitdir) or "GIT_DIR" in os.environ: - try: - g = gitinfo() - except OSError: - pass - # finally, check and update the active version file - - cp = RawConfigParser() - cp.read(versioncfgfile) - d = cp.defaults() - rewrite = not d or (g["commit"] and (g["version"] != d.get("version") or g["commit"] != d.get("commit"))) - if rewrite: - cp.set("DEFAULT", "version", g["version"]) - cp.set("DEFAULT", "commit", g["commit"]) - cp.set("DEFAULT", "date", g["date"]) - cp.set("DEFAULT", "timestamp", g["timestamp"]) - with open(versioncfgfile, "w") as fp: - cp.write(fp) - return cp - - -versiondata = getversioncfg() - -# Helper functions ----------------------------------------------------------- +from setuptools import Extension, setup -def get_compiler_type(): - """find compiler used for building extensions.""" - cc_arg = [a for a in sys.argv if a.startswith("--compiler=")] - if cc_arg: - compiler_type = cc_arg[-1].split("=", 1)[1] - else: - from distutils.ccompiler import new_compiler +# Define extension arguments here +ext_kws = { + "libraries": [], + "extra_compile_args": [], + "extra_link_args": [], + "include_dirs": [], +} - compiler_type = new_compiler().compiler_type - return compiler_type +# Figure out the tagged name of boost_python library. +def get_boost_libraries(): + """Check for installed boost_python shared library. -def get_gsl_config(): - """Return dictionary with paths to GSL library.""" - gslcfgpaths = [os.path.join(p, "gsl-config") for p in ([MYDIR] + os.environ["PATH"].split(os.pathsep))] - gslcfgpaths = [p for p in gslcfgpaths if os.path.isfile(p)] - rv = {"include_dirs": [], "library_dirs": []} - if not gslcfgpaths: - wmsg = "Cannot find gsl-config in {!r} nor in system PATH." - warnings.warn(wmsg.format(MYDIR)) - return rv - gslcfg = gslcfgpaths[0] - with open(gslcfg) as fp: - txt = fp.read() - mprefix = re.search("(?m)^prefix=(.+)", txt) - minclude = re.search(r"(?m)^[^#]*\s-I(\S+)", txt) - mlibpath = re.search(r"(?m)^[^#]*\s-L(\S+)", txt) - if not mprefix: - emsg = "Cannot find 'prefix=' line in {}." - raise RuntimeError(emsg.format(gslcfg)) - p = mprefix.group(1) - inc = minclude.group(1) if minclude else (p + "/include") - lib = mlibpath.group(1) if mlibpath else (p + "/lib") - rv["include_dirs"] += [inc] - rv["library_dirs"] += [lib] - return rv - - -def get_gsl_config_win(): - """Return dictionary with paths to GSL library, windwows version. - This version is installed with conda. + Returns list of required boost_python shared libraries that are installed + on the system. If required libraries are not found, an Exception will be + thrown. """ - conda_prefix = os.environ["CONDA_PREFIX"] - inc = os.path.join(conda_prefix, "Library", "include") - lib = os.path.join(conda_prefix, "Library", "lib") - rv = {"include_dirs": [], "library_dirs": []} - rv["include_dirs"] += [inc] - rv["library_dirs"] += [lib] - return rv - - -# ---------------------------------------------------------------------------- - -# compile and link options -define_macros = [] -os_name = os.name -if os_name == "nt": - gcfg = get_gsl_config_win() -else: - gcfg = get_gsl_config() -include_dirs = [MYDIR] + gcfg["include_dirs"] -library_dirs = [] -libraries = [] -extra_objects = [] -extra_compile_args = [] -extra_link_args = [] - -compiler_type = get_compiler_type() -if compiler_type in ("unix", "cygwin", "mingw32"): - extra_compile_args = ["-std=c++11", "-Wall", "-Wno-write-strings", "-O3", "-funroll-loops", "-ffast-math"] - extra_objects += ((p + "/libgsl.a") for p in gcfg["library_dirs"]) -elif compiler_type == "msvc": - define_macros += [("_USE_MATH_DEFINES", None)] - extra_compile_args = ["/EHs"] - libraries += ["gsl"] - library_dirs += gcfg["library_dirs"] -# add optimization flags for other compilers if needed - - -# define extension here -pdffit2module = Extension( - "diffpy.pdffit2.pdffit2", - [ - "pdffit2module/bindings.cc", - "pdffit2module/misc.cc", - "pdffit2module/pdffit2module.cc", - "pdffit2module/pyexceptions.cc", - "libpdffit2/Atom.cc", - "libpdffit2/LocalPeriodicTable.cc", - "libpdffit2/OutputStreams.cc", - "libpdffit2/PeriodicTable.cc", - "libpdffit2/PointsInSphere.cc", - "libpdffit2/StringUtils.cc", - "libpdffit2/fit.cc", - "libpdffit2/gaussj.cc", - "libpdffit2/metric.cc", - "libpdffit2/nrutil.cc", - "libpdffit2/output.cc", - "libpdffit2/parser.cc", - "libpdffit2/pdf.cc", - "libpdffit2/pdffit.cc", - "libpdffit2/pdflsmin.cc", - "libpdffit2/scatlen.cc", - "libpdffit2/stru.cc", - ], - include_dirs=include_dirs, - libraries=libraries, - library_dirs=library_dirs, - define_macros=define_macros, - extra_compile_args=extra_compile_args, - extra_link_args=extra_link_args, - extra_objects=extra_objects, -) - - -with open(os.path.join(MYDIR, "README.rst")) as fp: - long_description = fp.read() - -# define distribution + baselib = "boost_python" + major, minor = (str(x) for x in sys.version_info[:2]) + pytags = [major + minor, major, ""] + mttags = ["", "-mt"] + boostlibtags = [(pt + mt) for mt in mttags for pt in pytags] + [""] + from ctypes.util import find_library + + for tag in boostlibtags: + lib = baselib + tag + found = find_library(lib) + if found: + break + + # Show warning when library was not detected. + if not found: + import platform + import warnings + + ldevname = "LIBRARY_PATH" + if platform.system() == "Darwin": + ldevname = "DYLD_FALLBACK_LIBRARY_PATH" + wmsg = ("Cannot detect name suffix for the %r library. " "Consider setting %s.") % (baselib, ldevname) + warnings.warn(wmsg) + + libs = [lib] + return libs + + +def create_extensions(): + "Initialize Extension objects for the setup function." + blibs = [n for n in get_boost_libraries() if not n in ext_kws["libraries"]] + ext_kws["libraries"] += blibs + ext = Extension("diffpy.pdffit2.pdffit2_ext", glob.glob("src/extensions/*.cpp"), **ext_kws) + return [ext] + + +# Extensions not included in pyproject.toml setup_args = dict( - name="diffpy.pdffit2", - version=versiondata.get("DEFAULT", "version"), - packages=find_packages(), - test_suite="diffpy.pdffit2.tests", - ext_modules=[pdffit2module], - include_package_data=True, - install_requires=[ - "six", - "diffpy.structure>=3", - ], - zip_safe=False, - author="Simon J.L. Billinge", - author_email="sb2896@columbia.edu", - maintainer="Pavol Juhas", - maintainer_email="pavol.juhas@gmail.com", - url="https://github.com/diffpy/diffpy.pdffit2", - description="PDFfit2 - real space structure refinement program.", - long_description=long_description, - long_description_content_type="text/x-rst", - license="BSD", - keywords="PDF structure refinement", - classifiers=[ - # List of possible values at - # http://pypi.python.org/pypi?:action=list_classifiers - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Operating System :: MacOS", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Programming Language :: C++", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Scientific/Engineering :: Chemistry", - "Topic :: Scientific/Engineering :: Physics", - ], + ext_modules=[], ) + if __name__ == "__main__": + setup_args["ext_modules"] = create_extensions() setup(**setup_args) - -# End of file From 7aa2db9176057c9cd7ea18cbc177d794319a2793 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Mon, 22 Jul 2024 17:38:21 -0400 Subject: [PATCH 025/294] Add C++ requirements to environment.yml --- environment.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/environment.yml b/environment.yml index 3979d3cb..0e55d589 100644 --- a/environment.yml +++ b/environment.yml @@ -4,3 +4,6 @@ channels: dependencies: - python=3 - pip + - gsl + - gcc + - gxx From c767c629d5649c8f0061c22b536ca20b94119fe2 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Mon, 22 Jul 2024 17:39:10 -0400 Subject: [PATCH 026/294] pre-commit fixes in setup.py --- setup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.py b/setup.py index fbedeff1..2d0ae795 100644 --- a/setup.py +++ b/setup.py @@ -3,8 +3,6 @@ # Extensions script for diffpy.pdffit2 import glob -import os -import re import sys from setuptools import Extension, setup @@ -56,7 +54,7 @@ def get_boost_libraries(): def create_extensions(): "Initialize Extension objects for the setup function." - blibs = [n for n in get_boost_libraries() if not n in ext_kws["libraries"]] + blibs = [n for n in get_boost_libraries() if n not in ext_kws["libraries"]] ext_kws["libraries"] += blibs ext = Extension("diffpy.pdffit2.pdffit2_ext", glob.glob("src/extensions/*.cpp"), **ext_kws) return [ext] From cb7c2efeb1a75f28d9a07ca4d1968bbb47f614da Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Mon, 22 Jul 2024 18:00:59 -0400 Subject: [PATCH 027/294] add diffpy.structure requirement --- requirements/run.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/run.txt b/requirements/run.txt index e69de29b..9cc306b0 100644 --- a/requirements/run.txt +++ b/requirements/run.txt @@ -0,0 +1 @@ +diffpy.structure From f76d0ef0ab2168f52e5af33ab2f9044329ccc29a Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Mon, 22 Jul 2024 18:53:46 -0400 Subject: [PATCH 028/294] add build files --- pyproject.toml | 3 + setup.py | 199 ++++++++++++++++++++++++++++++++++--------------- 2 files changed, 142 insertions(+), 60 deletions(-) mode change 100644 => 100755 setup.py diff --git a/pyproject.toml b/pyproject.toml index 6945ff83..665112c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,9 @@ classifiers = [ Homepage = "https://github.com/diffpy/diffpy.pdffit2/" Issues = "https://github.com/diffpy/diffpy.pdffit2/issues/" +[tools.setuptools] +package-dir = {"" = "src"} + [tool.setuptools-git-versioning] enabled = true template = "{tag}" diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 2d0ae795..d9c4a01d --- a/setup.py +++ b/setup.py @@ -1,71 +1,150 @@ #!/usr/bin/env python -# Extensions script for diffpy.pdffit2 +# Installation script for diffpy.pdffit2 -import glob -import sys - -from setuptools import Extension, setup - -# Define extension arguments here -ext_kws = { - "libraries": [], - "extra_compile_args": [], - "extra_link_args": [], - "include_dirs": [], -} +"""PDFfit2 - real space structure refinement engine +Packages: diffpy.pdffit2 +Scripts: pdffit2 +""" -# Figure out the tagged name of boost_python library. -def get_boost_libraries(): - """Check for installed boost_python shared library. - - Returns list of required boost_python shared libraries that are installed - on the system. If required libraries are not found, an Exception will be - thrown. +import os +import re +import sys +import warnings + +from setuptools import Extension, find_packages, setup + +MYDIR = os.path.dirname(os.path.abspath(__file__)) +versioncfgfile = os.path.join(MYDIR, "src/diffpy/pdffit2/version.cfg") +gitarchivecfgfile = os.path.join(MYDIR, ".gitarchive.cfg") + + +# Helper functions ----------------------------------------------------------- + + +def get_compiler_type(): + """find compiler used for building extensions.""" + cc_arg = [a for a in sys.argv if a.startswith("--compiler=")] + if cc_arg: + compiler_type = cc_arg[-1].split("=", 1)[1] + else: + from distutils.ccompiler import new_compiler + + compiler_type = new_compiler().compiler_type + return compiler_type + + +def get_gsl_config(): + """Return dictionary with paths to GSL library.""" + gslcfgpaths = [os.path.join(p, "gsl-config") for p in ([MYDIR] + os.environ["PATH"].split(os.pathsep))] + gslcfgpaths = [p for p in gslcfgpaths if os.path.isfile(p)] + rv = {"include_dirs": [], "library_dirs": []} + if not gslcfgpaths: + wmsg = "Cannot find gsl-config in {!r} nor in system PATH." + warnings.warn(wmsg.format(MYDIR)) + return rv + gslcfg = gslcfgpaths[0] + with open(gslcfg) as fp: + txt = fp.read() + mprefix = re.search("(?m)^prefix=(.+)", txt) + minclude = re.search(r"(?m)^[^#]*\s-I(\S+)", txt) + mlibpath = re.search(r"(?m)^[^#]*\s-L(\S+)", txt) + if not mprefix: + emsg = "Cannot find 'prefix=' line in {}." + raise RuntimeError(emsg.format(gslcfg)) + p = mprefix.group(1) + inc = minclude.group(1) if minclude else (p + "/include") + lib = mlibpath.group(1) if mlibpath else (p + "/lib") + rv["include_dirs"] += [inc] + rv["library_dirs"] += [lib] + return rv + + +def get_gsl_config_win(): + """Return dictionary with paths to GSL library, windwows version. + This version is installed with conda. """ - baselib = "boost_python" - major, minor = (str(x) for x in sys.version_info[:2]) - pytags = [major + minor, major, ""] - mttags = ["", "-mt"] - boostlibtags = [(pt + mt) for mt in mttags for pt in pytags] + [""] - from ctypes.util import find_library - - for tag in boostlibtags: - lib = baselib + tag - found = find_library(lib) - if found: - break - - # Show warning when library was not detected. - if not found: - import platform - import warnings - - ldevname = "LIBRARY_PATH" - if platform.system() == "Darwin": - ldevname = "DYLD_FALLBACK_LIBRARY_PATH" - wmsg = ("Cannot detect name suffix for the %r library. " "Consider setting %s.") % (baselib, ldevname) - warnings.warn(wmsg) - - libs = [lib] - return libs - - -def create_extensions(): - "Initialize Extension objects for the setup function." - blibs = [n for n in get_boost_libraries() if n not in ext_kws["libraries"]] - ext_kws["libraries"] += blibs - ext = Extension("diffpy.pdffit2.pdffit2_ext", glob.glob("src/extensions/*.cpp"), **ext_kws) - return [ext] - - -# Extensions not included in pyproject.toml -setup_args = dict( - ext_modules=[], + conda_prefix = os.environ["CONDA_PREFIX"] + inc = os.path.join(conda_prefix, "Library", "include") + lib = os.path.join(conda_prefix, "Library", "lib") + rv = {"include_dirs": [], "library_dirs": []} + rv["include_dirs"] += [inc] + rv["library_dirs"] += [lib] + return rv + + +# ---------------------------------------------------------------------------- + +# compile and link options +define_macros = [] +os_name = os.name +if os_name == "nt": + gcfg = get_gsl_config_win() +else: + gcfg = get_gsl_config() +include_dirs = [MYDIR] + gcfg["include_dirs"] +library_dirs = [] +libraries = [] +extra_objects = [] +extra_compile_args = [] +extra_link_args = [] + +compiler_type = get_compiler_type() +if compiler_type in ("unix", "cygwin", "mingw32"): + extra_compile_args = ["-std=c++11", "-Wall", "-Wno-write-strings", "-O3", "-funroll-loops", "-ffast-math"] + extra_objects += ((p + "/libgsl.a") for p in gcfg["library_dirs"]) +elif compiler_type == "msvc": + define_macros += [("_USE_MATH_DEFINES", None)] + extra_compile_args = ["/EHs"] + libraries += ["gsl"] + library_dirs += gcfg["library_dirs"] +# add optimization flags for other compilers if needed + + +# define extension here +pdffit2module = Extension( + "diffpy.pdffit2.pdffit2", + [ + "src/extensions/pdffit2module/bindings.cc", + "src/extensions/pdffit2module/misc.cc", + "src/extensions/pdffit2module/pdffit2module.cc", + "src/extensions/pdffit2module/pyexceptions.cc", + "src/extensions/libpdffit2/Atom.cc", + "src/extensions/libpdffit2/LocalPeriodicTable.cc", + "src/extensions/libpdffit2/OutputStreams.cc", + "src/extensions/libpdffit2/PeriodicTable.cc", + "src/extensions/libpdffit2/PointsInSphere.cc", + "src/extensions/libpdffit2/StringUtils.cc", + "src/extensions/libpdffit2/fit.cc", + "src/extensions/libpdffit2/gaussj.cc", + "src/extensions/libpdffit2/metric.cc", + "src/extensions/libpdffit2/nrutil.cc", + "src/extensions/libpdffit2/output.cc", + "src/extensions/libpdffit2/parser.cc", + "src/extensions/libpdffit2/pdf.cc", + "src/extensions/libpdffit2/pdffit.cc", + "src/extensions/libpdffit2/pdflsmin.cc", + "src/extensions/libpdffit2/scatlen.cc", + "src/extensions/libpdffit2/stru.cc", + ], + include_dirs=include_dirs, + libraries=libraries, + library_dirs=library_dirs, + define_macros=define_macros, + extra_compile_args=extra_compile_args, + extra_link_args=extra_link_args, + extra_objects=extra_objects, ) +setup_args = dict( + packages=find_packages(where="src"), + package_dir={"": "src"}, + ext_modules=[pdffit2module], + # scripts=[] +) if __name__ == "__main__": - setup_args["ext_modules"] = create_extensions() setup(**setup_args) + +# End of file From 0a6c179baa3559f943c9a733ea8a54975d0075f9 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Mon, 22 Jul 2024 18:54:36 -0400 Subject: [PATCH 029/294] update C++ include paths --- src/extensions/pdffit2module/misc.cc | 6 +++--- src/extensions/pdffit2module/pdffit2module.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/extensions/pdffit2module/misc.cc b/src/extensions/pdffit2module/misc.cc index 80198049..17e0833d 100644 --- a/src/extensions/pdffit2module/misc.cc +++ b/src/extensions/pdffit2module/misc.cc @@ -30,9 +30,9 @@ #include "misc.h" #include "pyexceptions.h" #include "PyFileStreambuf.h" -#include "libpdffit2/StringUtils.h" -#include "libpdffit2/LocalPeriodicTable.h" -#include "libpdffit2/pdffit.h" +#include "../libpdffit2/StringUtils.h" +#include "../libpdffit2/LocalPeriodicTable.h" +#include "../libpdffit2/pdffit.h" // ostream buffer used for engine output redirection PyFileStreambuf* py_stdout_streambuf = NULL; diff --git a/src/extensions/pdffit2module/pdffit2module.cc b/src/extensions/pdffit2module/pdffit2module.cc index acf89fa3..efde9511 100644 --- a/src/extensions/pdffit2module/pdffit2module.cc +++ b/src/extensions/pdffit2module/pdffit2module.cc @@ -23,7 +23,7 @@ #include "pyexceptions.h" #include "bindings.h" -#include "libpdffit2/pdffit.h" +#include "../libpdffit2/pdffit.h" using namespace std; From f1068f29dd2946982471f6a1c92b06c8f42a0e72 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Mon, 22 Jul 2024 19:11:14 -0400 Subject: [PATCH 030/294] comment edits --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d9c4a01d..5cac1080 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Installation script for diffpy.pdffit2 +# Extensions script for diffpy.pdffit2 """PDFfit2 - real space structure refinement engine @@ -141,7 +141,7 @@ def get_gsl_config_win(): packages=find_packages(where="src"), package_dir={"": "src"}, ext_modules=[pdffit2module], - # scripts=[] + # scripts=[] # place examples here ) if __name__ == "__main__": From d3a2283e469710428202e053a57d90f5c1e1ffb3 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 11:54:40 -0400 Subject: [PATCH 031/294] Remove duplicate code files --- diffpy/__init__.py | 28 - diffpy/pdffit2/__init__.py | 34 - diffpy/pdffit2/ipy_ext.py | 95 - diffpy/pdffit2/output.py | 41 - diffpy/pdffit2/pdffit.py | 1297 ------ diffpy/pdffit2/tests/ExceptionsTest.py | 794 ---- diffpy/pdffit2/tests/TestPdfFit.py | 761 ---- diffpy/pdffit2/tests/TestPhaseFractions.py | 95 - diffpy/pdffit2/tests/TestShapeFactors.py | 274 -- diffpy/pdffit2/tests/__init__.py | 103 - diffpy/pdffit2/tests/debug.py | 36 - diffpy/pdffit2/tests/pdffit2testutils.py | 53 - diffpy/pdffit2/tests/run.py | 38 - diffpy/pdffit2/tests/rundeps.py | 30 - diffpy/pdffit2/tests/testdata/300K.gr | 2062 ---------- diffpy/pdffit2/tests/testdata/Ni.dat | 1001 ----- diffpy/pdffit2/tests/testdata/Ni.stru | 33 - .../pdffit2/tests/testdata/PbScW25TiO3.stru | 345 -- diffpy/pdffit2/tests/testdata/badNi.dat | 1001 ----- diffpy/pdffit2/tests/testdata/badNi.stru | 32 - .../tests/testdata/badNiZeroVolume.stru | 33 - diffpy/pdffit2/tests/testdata/noLattice.stru | 32 - diffpy/pdffit2/version.py | 54 - libpdffit2/Atom.cc | 104 - libpdffit2/Atom.h | 70 - libpdffit2/AtomType.h | 76 - libpdffit2/LocalPeriodicTable.cc | 147 - libpdffit2/LocalPeriodicTable.h | 63 - libpdffit2/MathUtils.h | 94 - libpdffit2/OutputStreams.cc | 24 - libpdffit2/OutputStreams.h | 31 - libpdffit2/PairDistance.h | 42 - libpdffit2/PeriodicTable.cc | 3459 ----------------- libpdffit2/PeriodicTable.h | 75 - libpdffit2/PointsInSphere.cc | 243 -- libpdffit2/PointsInSphere.h | 182 - libpdffit2/ShapeFactors.h | 43 - libpdffit2/StringUtils.cc | 58 - libpdffit2/StringUtils.h | 71 - libpdffit2/exceptions.h | 95 - libpdffit2/fit.cc | 836 ---- libpdffit2/gaussj.cc | 114 - libpdffit2/matrix.h | 239 -- libpdffit2/metric.cc | 341 -- libpdffit2/nrutil.cc | 122 - libpdffit2/nrutil.h | 34 - libpdffit2/output.cc | 350 -- libpdffit2/parser.cc | 402 -- libpdffit2/pdf.cc | 1776 --------- libpdffit2/pdffit.cc | 372 -- libpdffit2/pdffit.h | 611 --- libpdffit2/pdflsmin.cc | 326 -- libpdffit2/scatlen.cc | 114 - libpdffit2/stru.cc | 837 ---- libpdffit2/support_msvc9.h | 13 - libpdffit2/tests/Makefile | 32 - libpdffit2/tests/TestPointsInSphere.cc | 228 -- libpdffit2/tests/alltests.cc | 46 - pdffit2module/PyFileStreambuf.h | 97 - pdffit2module/bindings.cc | 341 -- pdffit2module/bindings.h | 27 - pdffit2module/misc.cc | 2219 ----------- pdffit2module/misc.h | 486 --- pdffit2module/pdffit2module.cc | 150 - pdffit2module/pyexceptions.cc | 30 - pdffit2module/pyexceptions.h | 33 - 66 files changed, 23325 deletions(-) delete mode 100644 diffpy/__init__.py delete mode 100644 diffpy/pdffit2/__init__.py delete mode 100644 diffpy/pdffit2/ipy_ext.py delete mode 100644 diffpy/pdffit2/output.py delete mode 100644 diffpy/pdffit2/pdffit.py delete mode 100644 diffpy/pdffit2/tests/ExceptionsTest.py delete mode 100644 diffpy/pdffit2/tests/TestPdfFit.py delete mode 100644 diffpy/pdffit2/tests/TestPhaseFractions.py delete mode 100644 diffpy/pdffit2/tests/TestShapeFactors.py delete mode 100644 diffpy/pdffit2/tests/__init__.py delete mode 100644 diffpy/pdffit2/tests/debug.py delete mode 100644 diffpy/pdffit2/tests/pdffit2testutils.py delete mode 100644 diffpy/pdffit2/tests/run.py delete mode 100644 diffpy/pdffit2/tests/rundeps.py delete mode 100644 diffpy/pdffit2/tests/testdata/300K.gr delete mode 100644 diffpy/pdffit2/tests/testdata/Ni.dat delete mode 100644 diffpy/pdffit2/tests/testdata/Ni.stru delete mode 100644 diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru delete mode 100644 diffpy/pdffit2/tests/testdata/badNi.dat delete mode 100644 diffpy/pdffit2/tests/testdata/badNi.stru delete mode 100644 diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru delete mode 100644 diffpy/pdffit2/tests/testdata/noLattice.stru delete mode 100644 diffpy/pdffit2/version.py delete mode 100644 libpdffit2/Atom.cc delete mode 100644 libpdffit2/Atom.h delete mode 100644 libpdffit2/AtomType.h delete mode 100644 libpdffit2/LocalPeriodicTable.cc delete mode 100644 libpdffit2/LocalPeriodicTable.h delete mode 100644 libpdffit2/MathUtils.h delete mode 100644 libpdffit2/OutputStreams.cc delete mode 100644 libpdffit2/OutputStreams.h delete mode 100644 libpdffit2/PairDistance.h delete mode 100644 libpdffit2/PeriodicTable.cc delete mode 100644 libpdffit2/PeriodicTable.h delete mode 100644 libpdffit2/PointsInSphere.cc delete mode 100644 libpdffit2/PointsInSphere.h delete mode 100644 libpdffit2/ShapeFactors.h delete mode 100644 libpdffit2/StringUtils.cc delete mode 100644 libpdffit2/StringUtils.h delete mode 100644 libpdffit2/exceptions.h delete mode 100644 libpdffit2/fit.cc delete mode 100644 libpdffit2/gaussj.cc delete mode 100644 libpdffit2/matrix.h delete mode 100644 libpdffit2/metric.cc delete mode 100644 libpdffit2/nrutil.cc delete mode 100644 libpdffit2/nrutil.h delete mode 100644 libpdffit2/output.cc delete mode 100644 libpdffit2/parser.cc delete mode 100644 libpdffit2/pdf.cc delete mode 100644 libpdffit2/pdffit.cc delete mode 100644 libpdffit2/pdffit.h delete mode 100644 libpdffit2/pdflsmin.cc delete mode 100644 libpdffit2/scatlen.cc delete mode 100644 libpdffit2/stru.cc delete mode 100644 libpdffit2/support_msvc9.h delete mode 100644 libpdffit2/tests/Makefile delete mode 100644 libpdffit2/tests/TestPointsInSphere.cc delete mode 100644 libpdffit2/tests/alltests.cc delete mode 100644 pdffit2module/PyFileStreambuf.h delete mode 100644 pdffit2module/bindings.cc delete mode 100644 pdffit2module/bindings.h delete mode 100644 pdffit2module/misc.cc delete mode 100644 pdffit2module/misc.h delete mode 100644 pdffit2module/pdffit2module.cc delete mode 100644 pdffit2module/pyexceptions.cc delete mode 100644 pdffit2module/pyexceptions.h diff --git a/diffpy/__init__.py b/diffpy/__init__.py deleted file mode 100644 index f093b937..00000000 --- a/diffpy/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2008 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - - -"""diffpy - tools for structure analysis by diffraction. - -Blank namespace package. -""" - - -from pkgutil import extend_path - -__path__ = extend_path(__path__, __name__) - - -# End of file diff --git a/diffpy/pdffit2/__init__.py b/diffpy/pdffit2/__init__.py deleted file mode 100644 index 0f33c5c4..00000000 --- a/diffpy/pdffit2/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2006 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""PDFfit2 - real space structure refinement program. -Classes: - PdfFit -Routines: - redirect_stdout -""" - - -from diffpy.pdffit2.version import __version__, __date__ -from diffpy.pdffit2.pdffit import PdfFit -from diffpy.pdffit2.output import redirect_stdout -from diffpy.pdffit2.pdffit2 import is_element - -# silence pyflakes checker -assert __version__ or True -assert __date__ or True -assert all((PdfFit, redirect_stdout, is_element)) - -# End of file diff --git a/diffpy/pdffit2/ipy_ext.py b/diffpy/pdffit2/ipy_ext.py deleted file mode 100644 index 4546967e..00000000 --- a/diffpy/pdffit2/ipy_ext.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python - -"""This module defines functions within IPython session to simulate -the old pdffit2 interactive session. - -Usage: %load_ext diffpy.pdffit2.ipy_ext -""" - - -def load_ipython_extension(ipython): - from diffpy.pdffit2 import PdfFit - - pf = PdfFit() - pdf = EasyPDFPlotting(pf) - print(" Type help(pdffit) or help(topic) for information.\n") - ns = dict(pdffit=PdfFit, pdf=pdf) - pf._exportAll(ns) - ipython.user_ns.update(ns) - return - - -class EasyPDFPlotting(object): - """Convenience functions for accessing and plotting PDFfit2 data.""" - - def __init__(self, pdffit_instance): - self._pdffit = pdffit_instance - return - - @property - def r(self): - "R-grid for PDF simulation." - return self._asarray(self._pdffit.getR(), dtype=float) - - @property - def Gobs(self): - "Observed PDF data." - return self._asarray(self._pdffit.getpdf_obs(), dtype=float) - - @property - def Gcalc(self): - "Calculated PDF data." - return self._asarray(self._pdffit.getpdf_fit()) - - @property - def Gdiff(self): - "Difference between the observed and simulated PDF." - return self.Gobs - self.Gcalc - - def showfit(self, offset=None): - """Plot observed and simulated PDFs and the difference curve. - - offset -- offset for the difference curve. - - No return value. - """ - from math import floor - - from matplotlib.pyplot import gca - - cr = self.r - cGobs = self.Gobs - cGcalc = self.Gcalc - cGdiff = self.Gdiff - if offset is None: - offset = floor(min([min(cGobs), min(cGcalc)]) - max(cGdiff)) - ax = gca() - ax.plot(cr, cGobs, "r.", cr, cGcalc, "b-", cr, cGdiff + offset, "g-") - xl = ax.xaxis.get_label().get_text() - yl = ax.yaxis.get_label().get_text() - if xl == "": - ax.set_xlabel("r (A)") - if yl == "": - ax.set_ylabel("G (A**-2)") - return - - def showRw(self): - "Plot cumulative Rw." - from matplotlib.pyplot import gca - - cRw = self._asarray(self._pdffit.getcrw()) - ax = gca() - ax.plot(self.r, cRw) - ax.set_title("Cumulative Rw = %.4f" % cRw[-1]) - ax.set_xlabel("r") - ax.set_ylabel("Rw") - return - - @staticmethod - def _asarray(x, dtype=None): - import numpy - - return numpy.asarray(x, dtype=dtype) - - -# End of class EasyPDFPlotting diff --git a/diffpy/pdffit2/output.py b/diffpy/pdffit2/output.py deleted file mode 100644 index 6d1247cf..00000000 --- a/diffpy/pdffit2/output.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2007 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Take care of sending engine output to given file-like object. -The output file is stored in local module variable stdout. -""" - - -# create module variable stdout - -from sys import stdout as stdout - -# silence pyflakes checker -assert stdout - - -def redirect_stdout(dst): - """Redirect PDFfit2 standard output to a file-like object dst. - The dst value is stored in module variable stdout. - """ - from diffpy.pdffit2.pdffit2 import redirect_stdout - - redirect_stdout(dst) - global stdout - stdout = dst - return - - -# End of file diff --git a/diffpy/pdffit2/pdffit.py b/diffpy/pdffit2/pdffit.py deleted file mode 100644 index 255e8b0f..00000000 --- a/diffpy/pdffit2/pdffit.py +++ /dev/null @@ -1,1297 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2006 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Chris Farros, Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""PdfFit class for fitting pdf data to a model.""" - -from __future__ import print_function - -import itertools -import numbers - -import six - -# Load pdffit2 and output modules to the current namespace. -# Note that "import diffpy.pdffit2.output as output" would -# crash with AttributeError when executed during imports of -# parent packages. -from diffpy.pdffit2 import output, pdffit2 - -# helper routines - - -def _format_value_std(value, stdev): - """Convert value to a string with standard deviation in brackets. - - value -- a number - stdev -- standard deviation. Ignored when small compared to value. - - Return string. - """ - if stdev > abs(value) * 1e-8: - s = "%g (%g)" % (value, stdev) - elif str(stdev) == "nan": - s = "%g (NaN)" % value - else: - s = "%g" % value - return s - - -def _format_bond_length(dij, ddij, ij1, symij): - """Return string with formatted bond length info for a pair of atoms. - - dij -- distance between atoms i and j - ddij -- standard deviation of dij. Ignored when small relative to dij. - ij1 -- tuple of atom indices starting at 1 - symij -- tuple of atom symbols - - Return formatted string. - """ - w_smbidx = 10 - w_equals = 30 - s0 = "%s (#%i)" % (symij[0], ij1[0]) - s1 = "%s (#%i)" % (symij[1], ij1[1]) - leader0 = " " + s0.ljust(w_smbidx) + " - " + s1 + " " - leader1 = leader0.ljust(w_equals) + "= " - s = leader1 + _format_value_std(dij, ddij) + " A" - return s - - -def _convertCallable(var): - """Convert an object to the result of its call when callable. - - var -- string or callable object that returns string - - Return var or var(). - """ - if callable(var): - rv = var() - else: - rv = var - return rv - - -# constants - -__intro_message__ = """ -****************************************************************************** -* P D F F I T Version %(version)s * -* %(date)s * -* -------------------------------------------------------------------------- * -* (c) 1998-2007 Trustees of the Michigan State University. * -* (c) 2008-%(year)s Trustees of the Columbia University * -* in the city of New York. * -* * -* Authors: * -* Thomas Proffen - Email: tproffen@lanl.gov * -* Jacques Bloch - Email: bloch@pa.msu.edu * -* Christopher Farrow - Email: clf2121@columbia.edu * -* Pavol Juhas - Email: pjuhas@bnl.gov * -* Simon Billinge - Email: sb2896@columbia.edu * -****************************************************************************** -""" - - -############################################################################## - - -class PdfFit(object): - """Create PdfFit object.""" - - # constants and enumerators from pdffit.h: - # selection of all atoms - selalias = {"ALL": -1} - # constraint type identifiers - FCON = {"USER": 0, "IDENT": 1, "FCOMP": 2, "FSQR": 3} - # scattering type identifiers - Sctp = {"X": 0, "N": 1} - - def _exportAll(self, namespace): - """_exportAll(self, namespace) --> Export all 'public' class methods - into namespace. - - This function allows for a module-level PdfFit object which doesn't have - to be referenced when calling a method. This function makes old (python) - scripts compatible with this class. At the top of the script, create a - pdffit object, and then call this method. Usually, namespace = locals(). - """ - # string aliases (var = "var") - for a in itertools.chain(self.selalias, self.FCON, self.Sctp): - exec("%s = %r" % (a, a), namespace) - public = [ - a - for a in dir(self) - if "__" not in a and a not in ["_handle", "_exportAll", "selalias", "FCON", "Sctp"] - ] - for funcname in public: - namespace[funcname] = getattr(self, funcname) - return - - def intro(): - """Show introductory message.""" - import re - - from diffpy.pdffit2 import __date__, __version__ - - date = __date__[:10] - d = {"version": __version__, "date": date, "year": date[:4] or "2019"} - msg = __intro_message__ % d - - def filler(mx): - return mx.group(0).rstrip(" *").ljust(77) + "*" - - msg_ljust = re.sub("(?m)^(.{1,77}|.{79}.*)$", filler, msg) - print(msg_ljust, file=output.stdout) - return - - intro = staticmethod(intro) - - def add_structure(self, stru): - """add_structure(stru) --> Add new structure to PdfFit instance. - - stru -- instance of Structure class from diffpy.structure. - - No return value. - Raises pdffit2.structureError when stru contains unknown - atom species. - """ - s = stru.writeStr("pdffit") - self.read_struct_string(s) - return - - def read_struct(self, struct): - """read_struct(struct) --> Read structure from file into memory. - - struct -- name of file from which to read structure - - Raises: - pdffit2.calculationError when a lattice cannot be created from the - given structure - pdffit2.structureError when a structure file is malformed - IOError when the file cannot be read from the disk - """ - pdffit2.read_struct(self._handle, struct) - self.stru_files.append(struct) - return - - def read_struct_string(self, struct, name=""): - """read_struct_string(struct, name = "") --> Read structure from - a string into memory. - - struct -- string containing the contents of the structure file - name -- tag with which to label structure - - Raises: - pdffit2.calculationError when a lattice cannot be created from the - given structure - pdffit2.structureError when a structure file is malformed - """ - pdffit2.read_struct_string(self._handle, struct) - self.stru_files.append(name) - return - - def read_data(self, data, stype, qmax, qdamp): - """read_data(data, stype, qmax, qdamp) --> Read pdf data from file into - memory. - - data -- name of file from which to read data - stype -- 'X' (xray) or 'N' (neutron) - qmax -- Q-value cutoff used in PDF calculation. - Use qmax=0 to neglect termination ripples. - qdamp -- instrumental Q-resolution factor - - Raises: IOError when the file cannot be read from disk - """ - pdffit2.read_data(self._handle, data, six.b(stype), qmax, qdamp) - self.data_files.append(data) - return - - def read_data_string(self, data, stype, qmax, qdamp, name=""): - """read_data_string(data, stype, qmax, qdamp, name = "") --> Read - pdf data from a string into memory. - - data -- string containing the contents of the data file - stype -- 'X' (xray) or 'N' (neutron) - qmax -- Q-value cutoff used in PDF calculation. - Use qmax=0 to neglect termination ripples. - qdamp -- instrumental Q-resolution factor - name -- tag with which to label data - """ - pdffit2.read_data_string(self._handle, data, six.b(stype), qmax, qdamp, name) - name = data - self.data_files.append(name) - return - - def read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, name="list"): - """read_data_lists(stype, qmax, qdamp, r_data, Gr_data, dGr_data = - None, name = "list") --> Read pdf data into memory from lists. - - All lists must be of the same length. - stype -- 'X' (xray) or 'N' (neutron) - qmax -- Q-value cutoff used in PDF calculation. - Use qmax=0 to neglect termination ripples. - qdamp -- instrumental Q-resolution factor - r_data -- list of r-values - Gr_data -- list of G(r) values - dGr_data -- list of G(r) uncertainty values - name -- tag with which to label data - - Raises: ValueError when the data lists are of different length - """ - pdffit2.read_data_arrays(self._handle, six.b(stype), qmax, qdamp, r_data, Gr_data, dGr_data, name) - self.data_files.append(name) - return - - def pdfrange(self, iset, rmin, rmax): - """pdfrange(iset, rmin, rmax) --> Set the range of the fit. - - iset -- data set to consider - rmin -- minimum r-value of fit - rmax -- maximum r-value of fit - - Raises: ValueError for bad input values - """ - pdffit2.pdfrange(self._handle, iset, rmin, rmax) - return - - def reset(self): - """reset() --> Clear all stored fit, structure, and parameter data.""" - self.stru_files = [] - self.data_files = [] - pdffit2.reset(self._handle) - return - - def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): - """alloc(stype, qmax, qdamp, rmin, rmax, bin) --> Allocate space - for a PDF calculation. - - The structure from which to calculate the PDF must first be imported - with the read_struct() or read_struct_string() method. - stype -- 'X' (xray) or 'N' (neutron) - qmax -- Q-value cutoff used in PDF calculation. - Use qmax=0 to neglect termination ripples. - qdamp -- instrumental Q-resolution factor - rmin -- minimum r-value of calculation - rmax -- maximum r-value of calculation - bin -- number of data points in calculation - - Raises: - ValueError for bad input values - pdffit.unassignedError when no structure has been loaded - """ - pdffit2.alloc(self._handle, six.b(stype), qmax, qdamp, rmin, rmax, bin) - return - - def calc(self): - """calc() --> Calculate the PDF of the imported structure. - - Space for the calculation must first be allocated with the alloc() - method. - - Raises: - pdffit2.calculationError when allocated space cannot - accomodate calculation - pdffit.unassignedError when space for calculation has not been - allocated - """ - pdffit2.calc(self._handle) - return - - def refine(self, toler=0.00000001): - """refine(toler = 0.00000001) --> Fit the theory to the imported data. - - toler -- tolerance of the fit - - Raises: - pdffit2.calculationError when the model pdf cannot be calculated - pdffit2.constraintError when refinement fails due to bad - constraint - pdffit2.unassigedError when a constraint used but never initialized - using setpar() - """ - step = 0 - finished = 0 - while not finished: - finished = pdffit2.refine_step(self._handle, toler) - step += 1 - return - - def refine_step(self, toler=0.00000001): - """refine_step(toler = 0.00000001) --> Run a single step of the fit. - - toler -- tolerance of the fit - - Raises: - pdffit2.calculationError when the model pdf cannot be calculated - pdffit2.constraintError when refinement fails due to bad - constraint - pdffit2.unassigedError when a constraint used but never initialized - using setpar() - - Returns: 1 (0) if refinement is (is not) finished - """ - self.finished = pdffit2.refine_step(self._handle, toler) - return self.finished - - def save_pdf(self, iset, fname): - """save_pdf(iset, fname) --> Save calculated or fitted PDF to file. - - iset -- data set to save - - Raises: - IOError if file cannot be saved - pdffit2.unassignedError if the data set is undefined - """ - pdffit2.save_pdf(self._handle, iset, fname) - return - - def save_pdf_string(self, iset): - """save_pdf_string(iset) --> Save calculated or fitted PDF to string. - - iset -- data set to save - - Raises: - pdffit2.unassignedError if the data set is undefined - - Returns: string containing contents of save file - """ - pdffilestring = pdffit2.save_pdf(self._handle, iset, "") - return pdffilestring - - def save_dif(self, iset, fname): - """save_dif(iset, fname) --> Save data and fitted PDF difference to - file. - - iset -- data set to save - - Raises: - IOError if file cannot be saved - pdffit2.unassignedError if the data set is undefined - """ - pdffit2.save_dif(self._handle, iset, fname) - return - - def save_dif_string(self, iset): - """save_dif_string(iset) --> Save data and fitted PDF difference to - string. - - iset -- data set to save - - Raises: - pdffit2.unassignedError if the data set is undefined - - Returns: string containing contents of save file - """ - diffilestring = pdffit2.save_dif(self._handle, iset, "") - return diffilestring - - def save_res(self, fname): - """save_res(fname) --> Save fit-specific data to file. - - Raises: - IOError if file cannot be saved - pdffit2.unassignedError if there is no refinement data to save - """ - pdffit2.save_res(self._handle, fname) - return - - def save_res_string(self): - """save_res_string() --> Save fit-specific data to a string. - - Raises: - pdffit2.unassignedError if there is no refinement data to save - - Returns: string containing contents of save file - """ - resfilestring = pdffit2.save_res(self._handle, "") - return resfilestring - - def get_structure(self, ip): - """get_structure(ip) --> Get a copy of specified phase data. - - ip -- index of existing PdfFit phase starting from 1 - - Return Structure object from diffpy.structure. - Raise pdffit2.unassignedError if phase ip is undefined. - """ - from diffpy.structure import PDFFitStructure - - s = self.save_struct_string(ip) - stru = PDFFitStructure() - stru.readStr(s, "pdffit") - return stru - - def save_struct(self, ip, fname): - """save_struct(ip, fname) --> Save structure resulting from fit - to file. - - ip -- phase to save - - Raises: - IOError if file cannot be saved - pdffit2.unassignedError if the data set is undefined - """ - pdffit2.save_struct(self._handle, ip, fname) - return - - def save_struct_string(self, ip): - """save_struct(ip) --> Save structure resulting from fit to string. - - ip -- phase to save - - Raises: - pdffit2.unassignedError if phase ip is undefined. - - Returns: string containing contents of save file - """ - structfilestring = pdffit2.save_struct(self._handle, ip, "") - return structfilestring - - def show_struct(self, ip): - """show_struct(ip) --> Print structure resulting from fit. - - ip -- phase to display - - Raises: pdffit2.unassignedError if the phase is undefined - """ - pdffit2.show_struct(self._handle, ip) - return - - def constrain(self, var, par, fcon=None): - """constrain(var, par[, fcon]) --> Constrain a variable to a parameter. - - A variable can be constrained to a number or equation string. - var -- variable to constrain, such as x(1) - par -- parameter which to constrain the variable. This can be - an integer or an equation string containing a reference - to another parameter. Equation strings use standard c++ - syntax. The value of a constrained parameter is accessed - as @p in an equation string, where p is the parameter. - e.g. - >>> constrain(x(1), 1) - >>> constrain(x(2), "0.5+@1") - fcon -- 'USER', 'IDENT', 'FCOMP', or 'FSQR' - this is an optional parameter, and I don't know how it is - used! - - Raises: - pdffit2.constraintError if a constraint is bad - pdffit2.unassignedError if variable does not yet exist - ValueError if variable index does not exist (e.g. lat(7)) - """ - var_ref = self.__getRef(var) - varnc = _convertCallable(var) - if fcon: - fc = self.FCON[fcon] - pdffit2.constrain_int(self._handle, var_ref, varnc, par, fc) - elif isinstance(par, six.string_types): - pdffit2.constrain_str(self._handle, var_ref, varnc, par) - else: - pdffit2.constrain_int(self._handle, var_ref, varnc, par) - return - - def setpar(self, par, val): - """setpar(par, val) --> Set value of constrained parameter. - - val -- Either a numerical value or a reference to a variable - - Raises: - pdffit2.unassignedError when variable is yet to be assigned - """ - # people do not use parenthesis, e.g., "setpar(3, qdamp)" - # in such case val is a reference to PdfFit method - val = _convertCallable(val) - try: - val = float(val) - pdffit2.setpar_dbl(self._handle, par, val) - except ValueError: - var_ref = self.__getRef(val) - pdffit2.setpar_RV(self._handle, par, var_ref) - return - - def setvar(self, var, val): - """setvar(var, val) --> Set the value of a variable. - - Raises: - pdffit2.unassignedError if variable does not yet exist - ValueError if variable index does not exist (e.g. lat(7)) - """ - var_ref = self.__getRef(var) - pdffit2.setvar(self._handle, var_ref, val) - return - - def getvar(self, var): - """getvar(var) --> Get stored value of a variable. - - Raises: - pdffit2.unassignedError if variable does not yet exist - ValueError if variable index does not exist (e.g. lat(7)) - """ - var_ref = self.__getRef(var) - retval = pdffit2.getvar(self._handle, var_ref) - return retval - - def getrw(self): - """getrw() --> Get normalized total error of the fit rw. - - getrw calculates total fit error summed for all datasets in the fit. - - Return float. - """ - rw = pdffit2.getrw(self._handle) - return rw - - def getcrw(self): - """getcrw() --> Get cumulative Rw for the current dataset. - - Cumulative Rw is a list of Rw partial sums cost values evaluated against - observed PDF data in the error sums evaluated against - the r-points in the fit. - - Raises: pdffit2.unassignedError if no data exists - - Returns: List of crw points, equidistant in r or empty list - if the refine function has not been called yet. - """ - crw = pdffit2.getcrw(self._handle) - return crw - - def getR(self): - """getR() --> Get r-points used in the fit. - - This function should only be called after data has been loaded or - calculated. Before a refinement, the list of r-points will reflect the - data. Afterwords, they will reflect the fit range. - - Raises: pdffit2.unassignedError if no data exists - - Returns: List of equidistance r-points used in fit. - """ - R = pdffit2.getR(self._handle) - return R - - def getpdf_fit(self): - """getpdf_fit() --> Get fitted PDF. - - This function should only be called after a refinement or refinement - step has been done. - - Raises: pdffit2.unassignedError if no data exists - - Returns: List of fitted points, equidistant in r. - """ - pdfdata = pdffit2.getpdf_fit(self._handle) - return pdfdata - - def getpdf_obs(self): - """getpdf_obs() --> Get observed PDF. - - This function should only be called after data has been loaded or - calculated. Before a refinement, the list of r-points will reflect the - data. Afterwords, they will reflect the fit range. - - Raises: pdffit2.unassignedError if no data exists - - Returns: List of data points, equidistant in r. - """ - pdfdata = pdffit2.getpdf_obs(self._handle) - return pdfdata - - def getpdf_diff(self): - """Obtain difference between observed and fitted PDF. - - This function should only be called after data has been loaded or - calculated. Before a refinement, the list of r-points will reflect the - data. Afterwords, they will reflect the fit range. - - Raises: pdffit2.unassignedError if no data exists - - Returns: List of data points, equidistant in r. - """ - Gdiff = pdffit2.getpdf_diff(self._handle) - return Gdiff - - def get_atoms(self, ip=None): - """get_atoms() --> Get element symbols of all atoms in the structure. - - ip -- index of phase to get the elements from (starting from 1) - when ip is not given, use current phase - - This function should only be called after a structure has been loaded. - - Raises: pdffit2.unassignedError if no structure exists - - Returns: List of atom names in structure. - """ - if ip is None: - rv = pdffit2.get_atoms(self._handle) - else: - rv = pdffit2.get_atoms(self._handle, ip) - return rv - - def get_atom_types(self, ip=None): - """get_atom_types() --> Ordered unique element symbols in the structure. - - ip -- index of phase to get the elements from (starting from 1) - when ip is not given, use current phase - - This function should only be called after a structure has been loaded. - - Raises: - pdffit2.unassignedError if no structure exists - - Returns: List of unique atom symbols as they occur in structure. - """ - if ip is None: - rv = pdffit2.get_atom_types(self._handle) - else: - rv = pdffit2.get_atom_types(self._handle, ip) - return rv - - def getpar(self, par): - """getpar(par) --> Get value of parameter. - - Raises: ValueError if parameter does not exists - """ - return pdffit2.getpar(self._handle, par) - - def fixpar(self, par): - """fixpar(par) --> Fix a parameter. - - Fixed parameters are not fitted in a refinement. Passed parameter - can be 'ALL', in which case all parameters are fixed. - - Raises: pdffit.unassignedError when parameter has not been assigned - """ - if isinstance(par, six.string_types) and par.upper() in self.selalias: - par = self.selalias[par.upper()] - pdffit2.fixpar(self._handle, par) - return - - def freepar(self, par): - """freepar(par) --> Free a parameter. - - Freed parameters are fitted in a refinement. Passed parameter - can be 'ALL', in which case all parameters are freed. - - Raises: pdffit.unassignedError when parameter has not been assigned - """ - if isinstance(par, six.string_types) and par.upper() in self.selalias: - par = self.selalias[par.upper()] - pdffit2.freepar(self._handle, par) - return - - def setphase(self, ip): - """setphase(ip) --> Switch to phase ip. - - ip -- index of the phase starting at 1. - - All parameters assigned after this method is called refer only to the - current phase. - - Raises: pdffit.unassignedError when phase does not exist - """ - pdffit2.setphase(self._handle, ip) - return - - def setdata(self, iset): - """setdata(iset) --> Set the data set in focus. - - iset -- integer index of data set starting at 1. - - Raises: pdffit.unassignedError when data set does not exist - """ - pdffit2.setdata(self._handle, iset) - return - - def psel(self, ip): - """psel(ip) --> Include phase ip in calculation of total PDF - - psel('ALL') selects all phases for PDF calculation. - - Raises: pdffit2.unassignedError if selected phase does not exist - """ - if isinstance(ip, six.string_types) and ip.upper() in self.selalias: - ip = self.selalias[ip.upper()] - pdffit2.psel(self._handle, ip) - return - - def pdesel(self, ip): - """pdesel(ip) --> Exclude phase ip from calculation of total PDF. - - pdesel('ALL') excludes all phases from PDF calculation. - - Raises: pdffit2.unassignedError if selected phase does not exist - """ - if isinstance(ip, six.string_types) and ip.upper() in self.selalias: - ip = self.selalias[ip.upper()] - pdffit2.pdesel(self._handle, ip) - return - - def selectAtomType(self, ip, ijchar, symbol, flag): - """Configure partial PDF - mark the specified atom type in phase ip - as included or excluded as a first or second in pair for distance - evaluation. - - ip -- phase index starting at 1 - ijchar -- 'i' or 'j' for first or second in pair - symbol -- element symbol - flag -- bool flag, True for selection, False for exclusion - - Raises: - pdffit2.unassignedError if selected phase does not exist - ValueError for invalid value of ijchar - """ - pdffit2.selectAtomType(self._handle, ip, six.b(ijchar), symbol, flag) - return - - def selectAtomIndex(self, ip, ijchar, aidx, flag): - """Configure partial PDF - mark the atom of given index in phase ip - as included or excluded as a first or second in pair for distance - evaluation. - - ip -- phase index starting at 1 - ijchar -- 'i' or 'j' for first or second in pair - aidx -- integer index of atom starting at 1 - flag -- bool flag, True for selection, False for exclusion - - Raises: - pdffit2.unassignedError if selected phase does not exist - ValueError if atom index or ijchar are invalid - """ - pdffit2.selectAtomIndex(self._handle, ip, six.b(ijchar), aidx, flag) - return - - def selectAll(self, ip, ijchar): - """Configure partial PDF - include all atoms of phase ip as first or - second element in pair for distance evaluation. - - ip -- phase index starting at 1 - ijchar -- 'i' or 'j' for first or second in pair - - Raises: - pdffit2.unassignedError if selected phase does not exist - ValueError if ijchar is invalid - """ - pdffit2.selectAll(self._handle, ip, six.b(ijchar)) - return - - def selectNone(self, ip, ijchar): - """Configure partial PDF - exclude all atoms of phase ip from first - or second element of pair distance evaluation. - - ip -- phase index starting at 1 - ijchar -- 'i' or 'j' for first or second in pair - - Raises: - pdffit2.unassignedError if selected phase does not exist - ValueError if ijchar is invalid - """ - pdffit2.selectNone(self._handle, ip, six.b(ijchar)) - return - - def bang(self, i, j, k): - """bang(i, j, k) --> Show bond angle defined by atoms i, j, k. - - No return value. Use bond_angle() to get the result. - - Raises: ValueError if selected atom(s) does not exist - pdffit.unassignedError when no structure has been loaded - """ - angle, stdev = pdffit2.bond_angle(self._handle, i, j, k) - # indices should be already checked here by bond_angle - atom_symbols = self.get_atoms() - leader = " %s (#%i) - %s (#%i) - %s (#%i) = " % ( - atom_symbols[i - 1], - i, - atom_symbols[j - 1], - j, - atom_symbols[k - 1], - k, - ) - s = leader + _format_value_std(angle, stdev) + " degrees" - print(s, file=output.stdout) - return - - def bond_angle(self, i, j, k): - """bond_angle(i, j, k) --> bond angle defined by atoms i, j, k. - Angle is calculated using the shortest ji and jk lengths with - respect to periodic boundary conditions. - - i, j, k -- atom indices starting at 1 - - Return a tuple of (angle, angle_error), both values are in degrees. - - Raises: ValueError if selected atom(s) does not exist - pdffit.unassignedError when no structure has been loaded - """ - rv = pdffit2.bond_angle(self._handle, i, j, k) - return rv - - def blen(self, *args): - """blen(i, j) --> Show bond length defined by atoms i and j. - - i -- index of the first atom starting at 1 - j -- index of the second atom starting at 1 - - No return value. Use bond_length_atoms() to retrieve result. - - Second form: - - blen(a1, a2, lb, ub) --> Show sorted lengths of all a1-a2 bonds. - - a1 -- symbol of the first element in pair or "ALL" - a2 -- symbol of the second element in pair or "ALL" - lb -- lower bond length boundary - ub -- upper bond length boundary - - No return value. Use bond_length_types() to retrieve results. - - Raises: ValueError if selected atom(s) does not exist - pdffit.unassignedError when no structure has been loaded - """ - # first form - if len(args) == 2: - dij, ddij = self.bond_length_atoms(*args[0:2]) - atom_symbols = self.get_atoms() - ij = (args[0], args[1]) - # indices were already checked in bond_length_atoms call - assert (0 <= min(ij) - 1) and (max(ij) - 1 < len(atom_symbols)) - symij = (atom_symbols[ij[0] - 1].upper(), atom_symbols[ij[1] - 1].upper()) - print(_format_bond_length(dij, ddij, ij, symij), file=output.stdout) - # second form - elif len(args) == 4: - a1, a2, lb, ub = args - try: - atom_types = self.get_atom_types() - if isinstance(a1, numbers.Integral): - a1 = atom_types[a1 - 1] - if isinstance(a2, numbers.Integral): - a2 = atom_types[a2 - 1] - except IndexError: - # index of non-existant atom type - return - # arguments are OK here, get bond length dictionary - bld = pdffit2.bond_length_types(self._handle, a1, a2, lb, ub) - s = "(%s,%s) bond lengths in [%gA,%gA] for current phase :" % (a1, a2, lb, ub) - print(s, file=output.stdout) - atom_symbols = self.get_atoms() - npts = len(bld["dij"]) - for idx in range(npts): - dij = bld["dij"][idx] - ddij = bld["ddij"][idx] - ij0 = bld["ij0"][idx] - ij1 = bld["ij1"][idx] - symij = (atom_symbols[ij0[0]], atom_symbols[ij0[1]]) - s = _format_bond_length(dij, ddij, ij1, symij) - print(s, file=output.stdout) - print(file=output.stdout) - if not bld["dij"]: - print(" *** No pairs found ***", file=output.stdout) - else: - emsg = "blen() takes 2 or 4 arguments (%i given)" % len(args) - raise TypeError(emsg) - # done - return - - def bond_length_atoms(self, i, j): - """bond_length_atoms(i, j) --> shortest distance between atoms i, j. - Periodic boundary conditions are applied to find the shortest bond. - - i -- index of the first atom starting at 1 - j -- index of the second atom starting at 1 - - Return a tuple of (distance, distance_error). - - Raises: ValueError if selected atom(s) does not exist - pdffit.unassignedError when no structure has been loaded. - """ - rv = pdffit2.bond_length_atoms(self._handle, i, j) - return rv - - def bond_length_types(self, a1, a2, lb, ub): - """bond_length_types(a1, a2, lb, ub) --> get all a1-a2 distances. - - a1 -- symbol of the first element in pair or "ALL" - a2 -- symbol of the second element in pair or "ALL" - lb -- lower bond length boundary - ub -- upper bond length boundary - - Return a dictionary of distance data containing - - dij : list of bond lenghts within given bounds - ddij : list of bond legnth standard deviations - ij0 : pairs of atom indices starting from 0 - ij1 : pairs of atom indices starting from 1 - - Raises: ValueError if selected atom(s) does not exist - pdffit.unassignedError when no structure has been loaded. - """ - rv = pdffit2.bond_length_types(self._handle, a1, a2, lb, ub) - return rv - - def show_scat(self, stype): - """show_scat(stype) --> Print scattering length for all atoms in - the current phase. - - stype -- 'X' (xray) or 'N' (neutron). - - Raises: pdffit2.unassignedError if no phase exists - """ - print(self.get_scat_string(stype), file=output.stdout) - return - - def get_scat_string(self, stype): - """get_scat_string(stype) --> Get string with scattering factors - of all atoms in the current phase. - - stype -- 'X' (xray) or 'N' (neutron). - - Raises: - pdffit2.unassignedError if no phase exists - - Returns: string with all scattering factors. - """ - return pdffit2.get_scat_string(self._handle, six.b(stype)) - - def get_scat(self, stype, element): - """get_scat(stype, element) --> Get active scattering factor for - given element. If scattering factor has been changed using - set_scat the result may depend on the active phase. When no - phase has been loaded, return the standard value. - - stype -- 'X' (xray) or 'N' (neutron). - element -- case-insensitive element symbol such as "Na" or "CL" - - Return float. - - Raises: - ValueError if element is not known. - """ - rv = pdffit2.get_scat(self._handle, six.b(stype), element) - return rv - - def set_scat(self, stype, element, value): - """set_scat(stype, element, value) --> Set custom scattering factor - for given element. The new scattering factor applies only for the - current phase, in other phases it keeps its default value. - - stype -- 'X' (xray) or 'N' (neutron). - element -- case-insensitive element symbol such as "Na" or "CL" - value -- new value of scattering factor - - No return value. - - Raises: - pdffit2.unassignedError if no phase exists. - ValueError if element is not known. - - See also reset_scat, get_scat. - """ - pdffit2.set_scat(self._handle, six.b(stype), element, value) - return - - def reset_scat(self, element): - """reset_scat(stype, element) --> Reset scattering factors for - given element to their standard values. The reset_scat applies - only for the current phase. - - element -- case-insensitive element symbol such as "Na" or "CL" - Raises: - pdffit2.unassignedError if no phase exists - ValueError if element is not known. - """ - pdffit2.reset_scat(self._handle, element) - return - - def num_atoms(self): - """num_atoms() --> Get number of atoms in current phase. - - Raises: pdffit2.unassignedError if no atoms exist - """ - return pdffit2.num_atoms(self._handle) - - def num_phases(self): - """num_phases() --> Number of phases loaded in PdfFit instance. - - Use setphase to bring a specific phase in focus. - - Return integer. - """ - n = pdffit2.num_phases(self._handle) - return n - - def num_datasets(self): - """num_datasets() --> Number of datasets loaded in PdfFit instance. - - Use setdata to bring a specific dataset in focus. - - Return integer. - """ - n = pdffit2.num_datasets(self._handle) - return n - - def phase_fractions(self): - """phase_fractions() --> relative phase fractions for current dataset. - Convert phase scale factors to relative phase fractions given the - scattering type of current dataset. - - Return a dictionary of phase fractions with following keys: - - "atom" -- list of fractions normalized to atom count - "stdatom" -- errors of atom count fractions - "cell" -- list of fractions normalized to unit cell count - "stdcell" -- errors of unit cell count fractions - "mass" -- list of relative weight fractions - "stdmass" -- errors of relative weight fractions - - Raises: pdffit2.unassignedError if no dataset exists. - """ - return pdffit2.phase_fractions(self._handle) - - # Begin refinable variables. - - def lat(n): - """lat(n) --> Get reference to lattice variable n. - - n can be an integer or a string representing the lattice variable. - 1 <==> 'a' - 2 <==> 'b' - 3 <==> 'c' - 4 <==> 'alpha' - 5 <==> 'beta' - 6 <==> 'gamma' - """ - LatParams = {"a": 1, "b": 2, "c": 3, "alpha": 4, "beta": 5, "gamma": 6} - if isinstance(n, six.string_types): - n = LatParams[n] - return "lat(%i)" % n - - lat = staticmethod(lat) - - def x(i): - """x(i) --> Get reference to x-value of atom i.""" - return "x(%i)" % i - - x = staticmethod(x) - - def y(i): - """y(i) --> Get reference to y-value of atom i.""" - return "y(%i)" % i - - y = staticmethod(y) - - def z(i): - """z(i) --> Get reference to z-value of atom i.""" - return "z(%i)" % i - - z = staticmethod(z) - - def u11(i): - """u11(i) --> Get reference to U(1,1) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u11(%i)" % i - - u11 = staticmethod(u11) - - def u22(i): - """u22(i) --> Get reference to U(2,2) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u22(%i)" % i - - u22 = staticmethod(u22) - - def u33(i): - """u33(i) --> Get reference to U(3,3) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u33(%i)" % i - - u33 = staticmethod(u33) - - def u12(i): - """u12(i) --> Get reference to U(1,2) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u12(%i)" % i - - u12 = staticmethod(u12) - - def u13(i): - """u13(i) --> Get reference to U(1,3) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u13(%i)" % i - - u13 = staticmethod(u13) - - def u23(i): - """u23(i) --> Get reference to U(2,3) for atom i. - - U is the anisotropic thermal factor tensor. - """ - return "u23(%i)" % i - - u23 = staticmethod(u23) - - def occ(i): - """occ(i) --> Get reference to occupancy of atom i.""" - return "occ(%i)" % i - - occ = staticmethod(occ) - - def pscale(): - """pscale() --> Get reference to pscale. - - pscale is the fraction of the total structure that the current phase - represents. - """ - return "pscale" - - pscale = staticmethod(pscale) - - def sratio(): - """sratio() --> Get reference to sigma ratio. - - The sigma ratio determines the reduction in the Debye-Waller factor for - distances below rcut. - """ - return "sratio" - - sratio = staticmethod(sratio) - - def delta1(): - """delta1() --> Get reference to 1/R peak sharpening factor.""" - return "delta1" - - delta1 = staticmethod(delta1) - - def delta2(): - """delta2() --> Reference to (1/R^2) sharpening factor. - The phenomenological correlation constant in the Debye-Waller factor. - The (1/R^2) peak sharpening factor. - """ - return "delta2" - - delta2 = staticmethod(delta2) - - def dscale(): - """dscale() --> Get reference to dscale. - - The data scale factor. - """ - return "dscale" - - dscale = staticmethod(dscale) - - def qdamp(): - """qdamp() --> Get reference to qdamp. - - Qdamp controls PDF damping due to instrument Q-resolution. - """ - return "qdamp" - - qdamp = staticmethod(qdamp) - - def qbroad(): - """qbroad() --> Get reference to qbroad. - - Quadratic peak broadening factor. - """ - return "qbroad" - - qbroad = staticmethod(qbroad) - - def spdiameter(): - """spdiameter() --> Get reference to spdiameter (phase property). - - Diameter value for the spherical particle PDF correction. - Spherical envelope is not applied when spdiameter equals 0. - """ - return "spdiameter" - - spdiameter = staticmethod(spdiameter) - - def stepcut(): - """stepcut() --> Get reference to stepcut (phase property). - - stepcut is cutoff radius for empirical step-function PDF envelope. - stepcut can be used to approximate loss of pair correlations - in amorphous phase. stepcut cannot be refined. - - Step cutoff is not applied when stepcut equals 0. - """ - return "stepcut" - - stepcut = staticmethod(stepcut) - - def rcut(): - """rcut() --> Get reference to rcut. - - rcut is the value of r below which peak sharpening, defined by - the sigma ratio (sratio), applies. rcut cannot be refined. - """ - return "rcut" - - rcut = staticmethod(rcut) - - # End refinable variables. - - def __init__(self): - - self.stru_files = [] - self.data_files = [] - - self._handle = pdffit2.create() - self.intro() - return - - def __getRef(self, var_string): - """Return the actual reference to the variable in the var_string. - - This function must be called before trying to actually reference an - internal variable. See the constrain method for an example. - - Raises: - pdffit2.unassignedError if variable is not yet assigned - ValueError if variable index does not exist (e.g. lat(7)) - """ - var_string = _convertCallable(var_string) - arg_int = None - try: - method_string, arg_string = var_string.split("(") - method_string = method_string.strip() - arg_int = int(arg_string.strip(")").strip()) - except ValueError: # There is no arg_string - method_string = var_string.strip() - - f = getattr(pdffit2, method_string) - if arg_int is None: - retval = f(self._handle) - else: - retval = f(self._handle, arg_int) - return retval - - -# End of class PdfFit - - -# End of file diff --git a/diffpy/pdffit2/tests/ExceptionsTest.py b/diffpy/pdffit2/tests/ExceptionsTest.py deleted file mode 100644 index 5dee1b75..00000000 --- a/diffpy/pdffit2/tests/ExceptionsTest.py +++ /dev/null @@ -1,794 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2006 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Chris Farrow -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - - -import unittest - -from diffpy.pdffit2 import PdfFit, pdffit2 -from diffpy.pdffit2.tests.pdffit2testutils import datafile - - -class read_structExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when structure file does not exist""" - self.assertRaises(IOError, self.P.read_struct, "Nofile.stru") - - def test_structureError(self): - """raise pdffit2.structureError when structure is malformed""" - self.assertRaises(pdffit2.structureError, self.P.read_struct, datafile("badNi.stru")) - - def test_structureErrorZeroVolume(self): - """raise pdffit2.structureError when unit cell volume is negative""" - # I don't know how to test for this, but it's in the library code - self.assertRaises(pdffit2.structureError, self.P.read_struct, datafile("badNiZeroVolume.stru")) - - -class read_dataExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when data file does not exist""" - self.assertRaises(IOError, self.P.read_data, "Nofile.dat", "X", 25.0, 0.5) - - def test_dataError(self): - """raise pdffit2.dataError when data has improper spacing""" - self.assertRaises(pdffit2.dataError, self.P.read_data, datafile("badNi.dat"), "X", 25.0, 0.5) - - -class read_data_listsExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.r_data = [0.1, 0.2] - self.Gr_data = [1, 2, 3] - self.qmax = 10 - self.qdamp = 0.5 - - def tearDown(self): - del self.P - - def test_ValueError1(self): - """raise ValueError when lists are of different length""" - self.assertRaises( - ValueError, self.P.read_data_lists, "X", self.qmax, self.qdamp, self.r_data, self.Gr_data - ) - - def test_ValueError2(self): - """raise ValueError when qmax < 0""" - self.assertRaises( - ValueError, self.P.read_data_lists, "X", -self.qmax, self.qdamp, self.r_data, self.Gr_data - ) - - def test_ValueError3(self): - """raise ValueError when qdamp < 0""" - self.assertRaises( - ValueError, self.P.read_data_lists, "X", self.qmax, -self.qdamp, self.r_data, self.Gr_data - ) - - def test_dataError(self): - """raise pdffit2.dataError when data has improper spacing""" - r_data = [0.1, 0.52, 0.2] - self.assertRaises( - pdffit2.dataError, self.P.read_data_lists, "X", self.qmax, self.qdamp, r_data, self.Gr_data - ) - - -class pdfrangeExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.iset = 1 - self.rmin = 4.0 - self.rmax = 10.0 - - def tearDown(self): - del self.P - - def test_ValueError1(self): - """raise ValueError when iset does not exist""" - self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmin, self.rmax) - - def test_ValueError2(self): - """raise ValueError when rmax < rmin""" - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmax, self.rmin) - - def test_ValueError3(self): - """raise ValueError when range outside of data""" - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertRaises(ValueError, self.P.pdfrange, self.iset, -self.rmin, self.rmax) - - -class allocExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.qmax = 25 - self.qdamp = 0.5 - self.rmin = 4.0 - self.rmax = 10.0 - self.bin = 100 - - def tearDown(self): - del self.P - - def test_ValueError1(self): - """raise ValueError when qmax < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", -self.qmax, self.qdamp, self.rmin, self.rmax, self.bin) - - def test_ValueError2(self): - """raise ValueError when qdamp < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, -self.qdamp, self.rmin, self.rmax, self.bin) - - def test_ValueError3(self): - """raise ValueError when rmin < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, -self.rmin, self.rmax, self.bin) - - def test_ValueError4(self): - """raise ValueError when rmax < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, -self.rmax, self.bin) - - def test_ValueError5(self): - """raise ValueError when bin < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) - - def test_ValueError6(self): - """raise ValueError when rmax < rmin""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmax, self.rmin, self.bin) - - def test_ValueError7(self): - """raise ValueError when qdamp < 0""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) - - -class calcExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.P.read_struct(datafile("Ni.stru")) - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when no space has been allocated""" - self.assertRaises(pdffit2.unassignedError, self.P.calc) - - -# PJ 2006-03-06 -# -# test_calculationError raised exception, because for Qmax=0.5, rmax would -# increase to 4010A and this would throw exception when the size of bnd array -# would exceed MAXBND limit. However, bnd vector can now grow, thus rmax -# is not limited and the following test would hang indefinitely. - -# def test_calculationError(self): -# """raise pdffit2.calculationError when calculation cannot be done""" -# self.P.alloc('X', 0.01, 0.5, 2, 10, 100) -# self.assertRaises(pdffit2.calculationError, self.P.calc) - - -# class refineExceptions(unittest.TestCase): -# I'm not sure how to test these - -# def setUp(self): -# self.P = PdfFit() -# -# def test_calculationError(self): -# """raise pdffit2.calculationError when model pdf can't be calculated""" -# #self.assertRaises(pdffit2.calculationError, self.P.calc) -# -# def test_constraintError(self): -# """raise pdffit2.constraintError for bad constraint(s)""" -# #self.assertRaises(pdffit2.constraintError, self.P.calc) - - -# class refine_stepExceptions(unittest.TestCase): -# I'm not sure how to test these - -# def setUp(self): -# self.P = PdfFit() -# -# def test_calculationError(self): -# """raise pdffit2.calculationError when model pdf can't be calculated""" -# #self.assertRaises(pdffit2.calculationError, self.P.calc) -# -# def test_constraintError(self): -# """raise pdffit2.constraintError for bad constraint(s)""" -# #self.assertRaises(pdffit2.constraintError, self.P.calc) - - -class save_pdfExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.strufile = "temp.pdf" - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when structure cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 30.0, 0.05, 2, 10, 100) - self.P.calc() - self.assertRaises(IOError, self.P.save_pdf, 1, "nodir183160/" + self.strufile) - - def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_pdf, 1, self.strufile) - - -class save_difExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.strufile = "temp.dif" - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when dif cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 30.0, 0.05, 2, 10, 100) - self.P.calc() - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertRaises(IOError, self.P.save_dif, 1, "nodir183160/" + self.strufile) - - def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_dif, 1, self.strufile) - - -class save_resExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.resfile = "temp.res" - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when residual file cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 30.0, 0.0) - self.P.constrain(self.P.lat(1), 1) - self.P.setpar(1, 3.0) - self.P.pdfrange(1, 2.0, 10.0) - self.P.refine_step() - self.assertRaises(IOError, self.P.save_res, "nodir183160/" + self.resfile) - - def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_res, self.resfile) - - -class save_structExceptions(unittest.TestCase): - # Same code as show_struct - - def setUp(self): - self.P = PdfFit() - self.strufile = "temp.stru" - - def tearDown(self): - del self.P - - def test_IOError(self): - """raise IOError when structure cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(IOError, self.P.save_struct, 1, "nodir183160/" + self.strufile) - - def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.save_struct, 1, self.strufile) - - -class constrainExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.par = 1 - return - - def tearDown(self): - self.P = None - return - - def test_constraintError(self): - """raise constraintError when constraint is bad""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.constrain("x(1)", "junk+@1") - self.P.setpar(1, 0.01) - self.assertRaises(pdffit2.constraintError, self.P.calc) - self.assertRaises(pdffit2.constraintError, self.P.refine) - return - - def test_unassignedError(self): - """raise pdffit2.unassignedError when variable is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.constrain, self.P.x(1), self.par) - return - - def test_ValueError(self): - """raise ValueError when a variable index does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.constrain, self.P.x(6), self.par) - return - - def test_constrainNonRefVar(self): - "raise constraintError when attempting to constrain non-refinables" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", "@7") - self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", 13) - self.assertRaises(pdffit2.constraintError, self.P.constrain, "stepcut", "@17") - return - - -class setvarExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.val = 3.0 - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when variable is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.setvar, self.P.lat(1), self.val) - - def test_ValueError(self): - """raise ValueError when a variable index does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.setvar, self.P.lat(7), self.val) - - -class getvarExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when variable is undefined""" - self.assertRaises(pdffit2.unassignedError, self.P.getvar, self.P.pscale()) - - def test_ValueError(self): - """raise ValueError when a variable index does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.getvar, self.P.lat(7)) - - -class getRExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getR) - - -class getpdf_fitExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getpdf_fit) - - -class getpdf_obsExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getpdf_obs) - - -class getpdf_diffExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getpdf_diff) - - -class get_atomsExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.get_atoms) - - -class getparExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when parameter does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when parameter does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.constrain(self.P.lat(1), 2) - self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) - - -class pselExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.ip = 1 - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) - - -class pdeselExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.ip = 1 - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) - - -class selectAtomTypeExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.iset = 1 - self.i = 1 - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, self.iset, "i", "Ni", True) - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - # selectAtomType should pass with one phase defined - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.selectAtomType(self.iset, "i", "Ni", True) - self.P.selectAtomType(self.iset, "j", "Ni", False) - # but fail for phase 2 which is not present - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, 2, "i", "Ca", True) - - def test_ijcharValueError(self): - """raise ValueError when ijchar is neither 'i' nor 'j'""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.selectAtomType(self.iset, "i", "Ni", True) - self.P.selectAtomType(self.iset, "j", "Ni", True) - self.assertRaises(ValueError, self.P.selectAtomType, self.iset, "k", "Ni", True) - - -class selectAtomIndexExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.iset = 1 - self.i = 1 - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, self.iset, "i", self.i, True) - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - # pass for phase 1 - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.selectAtomIndex(self.iset, "i", 1, True) - self.P.selectAtomIndex(self.iset, "i", 2, False) - # fail for phase 2 - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, 2, "i", 1, True) - - def test_ValueError(self): - """raise ValueError when selected atom does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(ValueError, self.P.selectAtomIndex, self.iset, "i", 6, True) - - -class selectAllExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.iset = 1 - self.i = 1 - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - # fail when there is no dataset - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") - # pass with dataset - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.selectAll(self.iset, "i") - self.P.selectAll(self.iset, "j") - # fail for phase 2 - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, 2, "i") - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, 2, "j") - - -class selectNoneExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.iset = 1 - self.i = 1 - - def tearDown(self): - del self.P - - def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") - - def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - # fail when there is no dataset - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") - # pass with dataset - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.selectNone(self.iset, "i") - self.P.selectNone(self.iset, "j") - # fail for phase 2 - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, 2, "i") - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, 2, "j") - - -class bangExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.a1 = 1 - self.a2 = 2 - self.a3 = 3 - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.bang, self.a1, self.a2, self.a3) - - def test_ValueError1(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(ValueError, self.P.bang, 0, self.a2, self.a3) - - def test_ValueError2(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.bang, self.a1, -1, self.a3) - - def test_ValueError3(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.bang, self.a1, self.a2, 6) - - -class blenExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - self.a1 = 1 - self.a2 = 2 - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when no data exists""" - self.assertRaises(pdffit2.unassignedError, self.P.blen, self.a1, self.a2) - - def test_ValueError1(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.blen, 0, self.a2) - - def test_ValueError2(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.blen, self.a1, 6) - - def test_ValueError3(self): - """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.blen, 0, 6) - - -class show_scatExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.show_scat, "X") - - -# class set_scatExceptions(unittest.TestCase): -# I'm not sure how to use this function - -# def setUp(self): -# self.P = PdfFit() -# -# def test_unassignedError1(self): -# """raise pdffit2.unassignedError when phase does not exist""" -# #self.assertRaises(pdffit2.constraintError, self.P.calc) -# -# def test_unassignedError2(self): -# """raise pdffit2.unassignedError when phase does not exist""" -# #self.assertRaises(pdffit2.constraintError, self.P.calc) -# -# def test_ValueError(self): -# """raise pdffit2.unassignedError when selected atom does not exist""" -# #self.assertRaises(pdffit2.constraintError, self.P.calc) - - -class num_atomsExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when no atoms exist""" - self.assertRaises(pdffit2.unassignedError, self.P.num_atoms) - - -class fixparExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when parameter does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.unassignedError, self.P.fixpar, 1) - - -class freeparExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when parameter does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.unassignedError, self.P.freepar, 1) - - -class setphaseExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.unassignedError, self.P.setphase, 2) - - -class setdataExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.unassignedError, self.P.setdata, 2) - - -class getcrwExceptions(unittest.TestCase): - def setUp(self): - self.P = PdfFit() - - def tearDown(self): - del self.P - - def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" - self.assertRaises(pdffit2.unassignedError, self.P.getcrw) - - -# main -if __name__ == "__main__": - # suite = unittest.makeSuite(num_atomsExceptions) - # unittest.TextTestRunner(verbosity=3).run(suite) - # testcase = calcExceptions('test_unassignedError') - # unittest.TextTestRunner(verbosity=3).run(testcase) - unittest.main() - -# End of file diff --git a/diffpy/pdffit2/tests/TestPdfFit.py b/diffpy/pdffit2/tests/TestPdfFit.py deleted file mode 100644 index 70712356..00000000 --- a/diffpy/pdffit2/tests/TestPdfFit.py +++ /dev/null @@ -1,761 +0,0 @@ -#!/usr/bin/env python - -"""Unit tests for PdfFit.py -""" - -import unittest - -from diffpy.pdffit2 import PdfFit, pdffit2 -from diffpy.pdffit2.tests.pdffit2testutils import capture_output, datafile -from diffpy.structure import loadStructure - -# ---------------------------------------------------------------------------- - - -class TestPdfFit(unittest.TestCase): - places = 6 - - def setUp(self): - self.P = PdfFit() - return - - def tearDown(self): - del self.P - return - - def test__exportAll(self): - "check PdfFit._exportAll()" - ns = {} - self.P._exportAll(ns) - self.assertEqual("ALL", ns["ALL"]) - self.assertEqual("FSQR", ns["FSQR"]) - self.assertEqual("N", ns["N"]) - self.assertIs("N", ns["N"]) - self.assertIs(self.P.lat, ns["lat"]) - self.assertEqual(self.P.reset, ns["reset"]) - return - - # def test_intro(self): - # """check PdfFit.intro() - # """ - # return - - def test_add_structure(self): - """check PdfFit.add_structure()""" - ni = loadStructure(datafile("Ni.stru")) - self.P.add_structure(ni) - self.assertEqual(4, self.P.num_atoms()) - return - - # def test_read_struct(self): - # """check PdfFit.read_struct() - # """ - # return - # - # def test_read_struct_string(self): - # """check PdfFit.read_struct_string() - # """ - # return - # - # def test_read_data(self): - # """check PdfFit.read_data() - # """ - # return - - def test_read_data_string(self): - """check PdfFit.read_data_string()""" - pf = self.P - with open(datafile("300K.gr")) as fp: - s = fp.read() - self.assertEqual([], pf.data_files) - pf.read_data_string(s, "N", 32, 0.03, "lmo") - self.assertEqual(1, len(pf.data_files)) - gobs = pf.getpdf_obs() - self.assertEqual(2000, len(gobs)) - self.assertEqual(0.384, gobs[-1]) - self.assertEqual(0.03, pf.getvar("qdamp")) - return - - # def test_read_data_lists(self): - # """check PdfFit.read_data_lists() - # """ - # return - # - # def test_pdfrange(self): - # """check PdfFit.pdfrange() - # """ - # return - # - # def test_reset(self): - # """check PdfFit.reset() - # """ - # return - - def test_alloc(self): - """check PdfFit.alloc()""" - # alloc and read_struct can be called in any order. - self.P.alloc("X", 25, 0.0, 0.01, 10, 1000) - # without a structure calculated PDF is all zero - self.P.calc() - Gzero = self.P.getpdf_fit() - self.assertEqual(1000 * [0.0], Gzero) - self.P.read_struct(datafile("Ni.stru")) - self.P.calc() - # check r-values - r = self.P.getR() - self.assertEqual(1000, len(r)) - for i in range(1000): - self.assertAlmostEqual(0.01 * (i + 1), r[i], self.places) - Gfit_alloc_read = self.P.getpdf_fit() - # now try the other order - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 25, 0.0, 0.01, 10, 1000) - self.P.calc() - Gfit_read_alloc = self.P.getpdf_fit() - # and they should be the same - self.assertEqual(Gfit_read_alloc, Gfit_alloc_read) - return - - # def test_calc(self): - # """check PdfFit.calc() - # """ - # return - # - # def test_refine(self): - # """check PdfFit.refine() - # """ - # return - # - # def test_refine_step(self): - # """check PdfFit.refine_step() - # """ - # return - # - # def test_save_pdf(self): - # """check PdfFit.save_pdf() - # """ - # return - # - # def test_save_pdf_string(self): - # """check PdfFit.save_pdf_string() - # """ - # return - # - # def test_save_dif(self): - # """check PdfFit.save_dif() - # """ - # return - # - # def test_save_dif_string(self): - # """check PdfFit.save_dif_string() - # """ - # return - # - # def test_save_res(self): - # """check PdfFit.save_res() - # """ - # return - # - # def test_save_res_string(self): - # """check PdfFit.save_res_string() - # """ - # return - - def test_get_structure(self): - """check PdfFit.get_structure()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - stru1 = self.P.get_structure(1) - self.assertEqual(4, len(stru1)) - self.assertEqual("Ni", stru1[0].element) - stru2 = self.P.get_structure(2) - self.assertEqual(56, len(stru2)) - self.assertEqual("Ti", stru2[-1].element) - return - - # def test_save_struct(self): - # """check PdfFit.save_struct() - # """ - # return - # - # def test_save_struct_string(self): - # """check PdfFit.save_struct_string() - # """ - # return - # - # def test_show_struct(self): - # """check PdfFit.show_struct() - # """ - # return - # - # def test_constrain(self): - # """check PdfFit.constrain() - # """ - # return - - def test_setpar(self): - """check PdfFit.setpar()""" - pf = self.P - pf.read_struct(datafile("Ni.stru")) - pf.setpar(1, "lat(1)") - self.assertEqual(3.52, pf.getpar(1)) - pf.setpar(1, 4.0) - self.assertEqual(4, pf.getpar(1)) - pf.setpar(1, pf.lat("a")) - self.assertEqual(3.52, pf.getpar(1)) - return - - def test_setvar(self): - """check PdfFit.setvar()""" - pf = self.P - pf.read_struct(datafile("Ni.stru")) - pf.setvar(pf.delta1, 1.2) - self.assertEqual(1.2, pf.getvar(pf.delta1)) - pf.setvar("delta1", 1.7) - self.assertEqual(1.7, pf.getvar("delta1")) - return - - # def test_getvar(self): - # """check PdfFit.getvar() - # """ - # return - # - # def test_getrw(self): - # """check PdfFit.getrw() - # """ - # return - # - # def test_getR(self): - # """check PdfFit.getR() - # """ - # return - # - # def test_getpdf_fit(self): - # """check PdfFit.getpdf_fit() - # """ - # return - # - # def test_getpdf_obs(self): - # """check PdfFit.getpdf_obs() - # """ - # return - # - # def test_getpdf_diff(self): - # """check PdfFit.getpdf_diff() - # """ - # return - - def test_get_atoms(self): - """check PdfFit.get_atoms()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.setphase(1) - a1 = self.P.get_atoms() - a2 = self.P.get_atoms(2) - self.assertEqual(4 * ["NI"], a1) - self.assertEqual(8 * ["PB"] + 24 * ["O"] + 8 * ["SC"] + 8 * ["W"] + 8 * ["TI"], a2) - return - - def test_get_atom_types(self): - """check PdfFit.get_atom_types()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.setphase(1) - atp1 = self.P.get_atom_types() - atp2 = self.P.get_atom_types(2) - self.assertEqual(["NI"], atp1) - self.assertEqual(["PB", "O", "SC", "W", "TI"], atp2) - return - - def test_num_phases(self): - """check PdfFit.num_phases()""" - self.assertEqual(0, self.P.num_phases()) - self.P.read_struct(datafile("Ni.stru")) - self.assertEqual(1, self.P.num_phases()) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.assertEqual(2, self.P.num_phases()) - self.P.reset() - self.assertEqual(0, self.P.num_phases()) - return - - def test_num_datasets(self): - """check PdfFit.num_datasets()""" - self.assertEqual(0, self.P.num_datasets()) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertEqual(1, self.P.num_datasets()) - # failed data should not increase num_datasets - try: - self.P.read_data(datafile("badNi.dat")) - except (RuntimeError, TypeError, NameError, ValueError, IOError): - pass - self.assertEqual(1, self.P.num_datasets()) - # alloc should increase number of datasets - # alloc requires a loaded structure - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 30.0, 0.05, 2, 10, 100) - self.assertEqual(2, self.P.num_datasets()) - self.P.reset() - self.assertEqual(0, self.P.num_datasets()) - return - - def test_getcrw(self): - """check PdfFit.getcrw()""" - import numpy - - self.assertEqual(0, self.P.num_datasets()) - # Setting qmax=0 so that partial crw are not disturbed by - # termination ripples. - self.P.read_data(datafile("Ni.dat"), "X", 0.0, 0.0) - # crw is empty before data refinement - self.assertEqual([], self.P.getcrw()) - self.P.read_struct(datafile("Ni.stru")) - self.P.pdfrange(1, 2, 19) - self.P.refine() - crw19 = numpy.array(self.P.getcrw()) - self.assertTrue(numpy.all(crw19 >= 0.0)) - # check that crw19 is non decreasing - self.assertTrue(numpy.all(numpy.diff(crw19) >= 0.0)) - # check that crw19 and getrw give the same value - rw19 = crw19[-1] - self.assertAlmostEqual(self.P.getrw(), rw19, self.places) - # renormalize cumulative Rw and compare with Rw at r=15 - Gobs19 = numpy.array(self.P.getpdf_obs()) - Gnorm19 = numpy.sqrt(numpy.sum(Gobs19**2)) - r = numpy.array(self.P.getR()) - idx = numpy.nonzero(r <= 15)[0] - Gnorm15 = numpy.sqrt(numpy.sum(Gobs19[idx] ** 2)) - i15 = idx[-1] - rw15 = crw19[i15] * Gnorm19 / Gnorm15 - self.P.pdfrange(1, 2, r[i15] + 1e-5) - self.P.refine() - self.assertAlmostEqual(self.P.getrw(), rw15, self.places) - return - - def test_getcrw_two_datasets(self): - """check that getcrw() and getrw() are consistent for two datasets.""" - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) - self.P.pdfrange(1, 2, 8) - self.P.read_data(datafile("300K.gr"), "N", 32.0, 0.0) - self.P.pdfrange(2, 1, 11) - self.P.read_struct(datafile("Ni.stru")) - # mess lattice parameters to have comparable Rw contributions - self.P.setvar("lat(1)", 3) - self.P.setvar("lat(2)", 3) - self.P.setvar("lat(3)", 3) - self.P.refine() - rwtot = self.P.getrw() - self.assertTrue(rwtot > 0.0) - self.P.setdata(1) - rw1 = self.P.getcrw()[-1] - self.P.setdata(2) - rw2 = self.P.getcrw()[-1] - self.assertAlmostEqual(rwtot**2, rw1**2 + rw2**2, self.places) - return - - # def test_getpar(self): - # """check PdfFit.getpar() - # """ - # return - - def test_fixpar(self): - """check PdfFit.fixpar()""" - self.P.fixpar("all") - self.assertRaises(TypeError, self.P.fixpar, "x") - return - - def test_freepar(self): - """check PdfFit.freepar()""" - self.P.freepar("all") - self.assertRaises(TypeError, self.P.freepar, "x") - return - - # def test_setphase(self): - # """check PdfFit.setphase() - # """ - # return - # - # def test_setdata(self): - # """check PdfFit.setdata() - # """ - # return - # - def test_psel(self): - """check PdfFit.psel()""" - - def doalloc(): - self.P.alloc("X", 30.0, 0.05, 2, 10, 100) - return - - self.assertRaises(pdffit2.unassignedError, self.P.psel, 0) - self.assertRaises(pdffit2.unassignedError, self.P.psel, 1) - self.P.read_struct(datafile("Ni.stru")) - doalloc() - self.P.calc() - G1 = self.P.getpdf_fit() - self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) - doalloc() - self.P.calc() - G2 = self.P.getpdf_fit() - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - doalloc() - self.P.pdesel("ALL") - self.P.psel(1) - self.P.calc() - self.assertEqual(G1, self.P.getpdf_fit()) - self.P.pdesel("ALL") - self.P.psel(2) - self.P.calc() - self.assertEqual(G2, self.P.getpdf_fit()) - self.P.psel("ALL") - self.P.calc() - Gall = self.P.getpdf_fit() - dGmax = max([abs(g1 + g2 - gall) for g1, g2, gall in zip(G1, G2, Gall)]) - self.assertAlmostEqual(0, dGmax, self.places) - self.assertRaises(pdffit2.unassignedError, self.P.psel, 10) - self.assertRaises(pdffit2.unassignedError, self.P.psel, 0) - self.assertRaises(pdffit2.unassignedError, self.P.psel, -100) - return - - def test_pdesel(self): - """check PdfFit.pdesel()""" - - def doalloc(): - self.P.alloc("X", 30.0, 0.05, 2, 10, 100) - return - - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 0) - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 1) - self.P.read_struct(datafile("Ni.stru")) - doalloc() - self.P.calc() - G1 = self.P.getpdf_fit() - self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) - doalloc() - self.P.calc() - G2 = self.P.getpdf_fit() - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - doalloc() - self.P.psel("ALL") - self.P.pdesel(2) - self.P.calc() - self.assertEqual(G1, self.P.getpdf_fit()) - self.P.psel("ALL") - self.P.pdesel(1) - self.P.calc() - self.assertEqual(G2, self.P.getpdf_fit()) - self.P.pdesel("ALL") - self.P.calc() - G0 = self.P.getpdf_fit() - self.assertEqual([0.0] * len(G0), G0) - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 10) - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 0) - self.assertRaises(pdffit2.unassignedError, self.P.pdesel, -100) - return - - # - # def test_selectAtomType(self): - # """check PdfFit.selectAtomType() - # """ - # return - # - # def test_selectAtomIndex(self): - # """check PdfFit.selectAtomIndex() - # """ - # return - # - # def test_selectAll(self): - # """check PdfFit.selectAll() - # """ - # return - # - # def test_selectNone(self): - # """check PdfFit.selectNone() - # """ - # return - - def test_bond_angle(self): - """check PdfFit.bond_angle()""" - self.P.read_struct(datafile("Ni.stru")) - a, e = self.P.bond_angle(1, 2, 3) - self.assertAlmostEqual(60.0, a, self.places) - self.assertRaises(ValueError, self.P.bond_angle, 0, 1, 2) - self.assertRaises(ValueError, self.P.bond_angle, 1, 2, 7) - return - - def test_bang(self): - "check PdfFit.bang() function" - self.P.read_struct(datafile("Ni.stru")) - out = capture_output(self.P.bang, 1, 2, 3).strip() - self.assertTrue(out.endswith("60 degrees")) - self.assertTrue(out.startswith("NI (#1) - NI (#2) - NI (#3)")) - return - - def test_bond_length_atoms(self): - """check PdfFit.bond_length_atoms()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - dij, ddij = self.P.bond_length_atoms(1, 5) - self.assertAlmostEqual(4.03635, dij, self.places) - self.P.setphase(1) - self.assertRaises(ValueError, self.P.bond_length_atoms, 1, 5) - return - - def test_bond_length_types(self): - """check PdfFit.bond_length_types()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - dPbO = self.P.bond_length_types("Pb", "O", 0.1, 3.0) - # check if keys are present - self.assertTrue("dij" in dPbO) - self.assertTrue("ddij" in dPbO) - self.assertTrue("ij0" in dPbO) - self.assertTrue("ij1" in dPbO) - # check if they have the same length - npts = len(dPbO["dij"]) - self.assertEqual(npts, len(dPbO["ddij"])) - self.assertEqual(npts, len(dPbO["ij0"])) - self.assertEqual(npts, len(dPbO["ij1"])) - # 8 Pb atoms have coordination 12 in perovskite structure - self.assertEqual(8 * 12, len(dPbO["dij"])) - self.P.setphase(1) - dfcc = self.P.bond_length_types("ALL", "ALL", 0.1, 2.6) - # 4 Ni atoms with coordination 12 - self.assertEqual(4 * 12, len(dfcc["dij"])) - # invalid element - self.assertRaises(ValueError, self.P.bond_length_types, "Ni", "Nix", 0.1, 5.0) - # check indices ij0 - allij0 = sum(dfcc["ij0"], tuple()) - self.assertEqual(0, min(allij0)) - self.assertEqual(3, max(allij0)) - # check indices ij1 - allij1 = sum(dfcc["ij1"], tuple()) - self.assertEqual(1, min(allij1)) - self.assertEqual(4, max(allij1)) - # check index values - ij0check = [(i1 - 1, j1 - 1) for i1, j1 in dfcc["ij1"]] - self.assertEqual(ij0check, dfcc["ij0"]) - # test valid element which is not present in the structure - dnone = self.P.bond_length_types("Ni", "Au", 0.1, 5.0) - self.assertEqual(0, len(dnone["dij"])) - self.assertEqual(0, len(dnone["ddij"])) - self.assertEqual(0, len(dnone["ij0"])) - self.assertEqual(0, len(dnone["ij1"])) - return - - def test_blen(self): - """check PdfFit.blen()""" - self.P.read_struct(datafile("PbScW25TiO3.stru")) - blen = self.P.blen - o = capture_output(blen, 1, 5).strip() - self.assertTrue(o.endswith("4.03635 A")) - self.assertTrue("PB (#1)" in o) - self.assertTrue("PB (#5)" in o) - self.assertRaises(ValueError, blen, 1, 99) - self.assertRaises(ValueError, blen, 0, 1) - o1 = capture_output(blen, 1, 1, 0.1, 1) - self.assertTrue("No pairs found" in o1) - o2 = capture_output(blen, 1, 50, 0.1, 1) - self.assertEqual("", o2) - o3 = capture_output(blen, "Sc", "O", 0.5, 2.3).strip() - self.assertEqual(1 + 48, len(o3.split("\n"))) - self.assertEqual(6, o3.count("SC (#33)")) - self.assertEqual(2, o3.count("O (#9)")) - self.assertRaises(TypeError, blen, "Sc", "O", 0.5) - return - - # def test_show_scat(self): - # """check PdfFit.show_scat() - # """ - # return - # - # def test_get_scat_string(self): - # """check PdfFit.get_scat_string() - # """ - # return - - def test_get_scat(self): - """check PdfFit.get_scat()""" - # x-ray scattering factors - fPb = self.P.get_scat("X", "Pb") - self.assertEqual(82.0, fPb) - fTi = self.P.get_scat("X", "tI") - self.assertEqual(22.0, fTi) - # neutron scattering lengths - bPb = self.P.get_scat("N", "PB") - self.assertAlmostEqual(9.401, bPb, 3) - bTi = self.P.get_scat("N", "ti") - self.assertAlmostEqual(-3.370, bTi, 3) - # exceptions - self.assertRaises(ValueError, self.P.get_scat, "N", "zz") - self.assertRaises(ValueError, self.P.get_scat, "Z", "Ti") - return - - def test_set_scat(self): - """check PdfFit.set_scat()""" - # raises exception when no phase exists - self.assertRaises(pdffit2.unassignedError, self.P.set_scat, "N", "Ti", -11) - # check if it is local to phase - fPb = self.P.get_scat("X", "Pb") - bPb = self.P.get_scat("N", "Pb") - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.set_scat("X", "Pb", 142) - self.assertEqual(142, self.P.get_scat("X", "Pb")) - self.assertEqual(bPb, self.P.get_scat("N", "Pb")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.assertEqual(fPb, self.P.get_scat("X", "Pb")) - self.P.setphase(1) - self.assertEqual(142, self.P.get_scat("X", "Pb")) - self.P.setphase(2) - self.assertEqual(fPb, self.P.get_scat("X", "Pb")) - # check exception for invalid inputs - self.assertRaises(ValueError, self.P.set_scat, "Z", "C", 123) - self.assertRaises(ValueError, self.P.set_scat, "X", "ZZ", 123) - return - - def test_reset_scat(self): - """check PdfFit.reset_scat()""" - # raises exception when no phase exists - self.assertRaises(pdffit2.unassignedError, self.P.reset_scat, "Ti") - # check if it is local to phase - fPb = self.P.get_scat("X", "Pb") - bPb = self.P.get_scat("N", "Pb") - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.set_scat("X", "Pb", 142) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.set_scat("N", "Pb", -17) - self.P.setphase(1) - self.assertNotEqual(fPb, self.P.get_scat("X", "Pb")) - self.P.reset_scat("Pb") - self.assertEqual(fPb, self.P.get_scat("X", "Pb")) - self.P.setphase(2) - self.assertNotEqual(bPb, self.P.get_scat("N", "Pb")) - self.P.reset_scat("Pb") - self.assertEqual(bPb, self.P.get_scat("N", "Pb")) - # check exception for invalid inputs - self.assertRaises(ValueError, self.P.reset_scat, "Zz") - return - - def test_num_atoms(self): - """check PdfFit.num_atoms()""" - self.P.read_struct(datafile("Ni.stru")) - self.assertEqual(4, self.P.num_atoms()) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.assertEqual(56, self.P.num_atoms()) - self.P.setphase(1) - self.assertEqual(4, self.P.num_atoms()) - self.P.setphase(2) - self.assertEqual(56, self.P.num_atoms()) - return - - def test_lat(self): - """check PdfFit.lat()""" - pf = self.P - pf.read_struct(datafile("Ni.stru")) - for i in ("a", "b", "c", 1, 2, 3): - self.assertEqual(3.52, pf.getvar(pf.lat(i))) - for i in ("alpha", "beta", "gamma", 4, 5, 6): - self.assertEqual(90, pf.getvar(pf.lat(i))) - return - - def test_xyz(self): - """check PdfFit.x() PdfFit.y(), PdfFit.z()""" - pf = self.P - pf.read_struct(datafile("Ni.stru")) - self.assertEqual(0.5, pf.getvar(pf.x(3))) - self.assertEqual(0, pf.getvar(pf.y(3))) - self.assertEqual(0.5, pf.getvar(pf.z(3))) - return - - def test_uij(self): - """check PdfFit.uij()""" - ni = loadStructure(datafile("Ni.stru")) - ni[2].anisotropy = True - ni[2].U11, ni[2].U22, ni[2].U33 = 1, 2, 3 - ni[2].U12, ni[2].U13, ni[2].U23 = 4, 5, 6 - pf = self.P - pf.add_structure(ni) - self.assertEqual(1, pf.getvar(pf.u11(3))) - self.assertEqual(2, pf.getvar(pf.u22(3))) - self.assertEqual(3, pf.getvar(pf.u33(3))) - self.assertEqual(4, pf.getvar(pf.u12(3))) - self.assertEqual(5, pf.getvar(pf.u13(3))) - self.assertEqual(6, pf.getvar(pf.u23(3))) - return - - def test_occ(self): - """check PdfFit.occ()""" - pf = self.P - pf.read_struct(datafile("Ni.stru")) - for i in range(1, 5): - self.assertEqual(1, pf.getvar(pf.occ(i))) - return - - -# def test_pscale(self): -# """check PdfFit.pscale() -# """ -# return -# -# def test_pscale(self): -# """check PdfFit.pscale() -# """ -# return -# -# def test_sratio(self): -# """check PdfFit.sratio() -# """ -# return -# -# def test_delta1(self): -# """check PdfFit.delta1() -# """ -# return -# -# def test_delta2(self): -# """check PdfFit.delta2() -# """ -# return -# -# def test_dscale(self): -# """check PdfFit.dscale() -# """ -# return -# -# def test_qdamp(self): -# """check PdfFit.qdamp() -# """ -# return -# -# def test_qbroad(self): -# """check PdfFit.qbroad() -# """ -# return -# -# def test_rcut(self): -# """check PdfFit.rcut() -# """ -# return -# -# def test___init__(self): -# """check PdfFit.__init__() -# """ -# return -# -# def test__PdfFit__getRef(self): -# """check PdfFit._PdfFit__getRef() -# """ -# return - -# End of class TestPdfFit - -if __name__ == "__main__": - unittest.main() - -# End of file diff --git a/diffpy/pdffit2/tests/TestPhaseFractions.py b/diffpy/pdffit2/tests/TestPhaseFractions.py deleted file mode 100644 index afc57c06..00000000 --- a/diffpy/pdffit2/tests/TestPhaseFractions.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python - -"""Unit tests for phase fraction calculations. -""" - -import unittest - -from diffpy.pdffit2 import PdfFit -from diffpy.pdffit2.tests.pdffit2testutils import datafile - - -############################################################################## -class TestPhaseFractions(unittest.TestCase): - places = 4 - - def setUp(self): - self.P = PdfFit() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.alloc("N", 0.0, 0.05, 0.1, 10, 200) - return - - def tearDown(self): - del self.P - return - - def test_xray_fractions(self): - """test_xray_fractions -- check phase fractions in x-ray dataset.""" - self.P.setdata(1) - ph = self.P.phase_fractions() - bb1 = 28**2 - bb2 = ((8 * 82 + 24 * 8 + 4 * 21 + 2 * 74 + 2 * 22) / 40.0) ** 2 - self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) - self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) - self.assertAlmostEqual(1.0, sum(ph["mass"]), self.places) - self.assertAlmostEqual(bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places) - self.assertAlmostEqual(bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places) - mavg1 = 58.69 - mavg2 = (8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90) / 40.0 - self.assertAlmostEqual(bb2 / bb1 * mavg1 / mavg2, ph["mass"][0] / ph["mass"][1], self.places) - self.assertEqual(0.0, sum(ph["stdatom"])) - self.assertEqual(0.0, sum(ph["stdcell"])) - self.assertEqual(0.0, sum(ph["stdmass"])) - self.P.setphase(1) - self.P.setvar("pscale", 2.0) - ph2 = self.P.phase_fractions() - self.assertAlmostEqual(1.0, sum(ph2["atom"]), self.places) - self.assertAlmostEqual(1.0, sum(ph2["cell"]), self.places) - self.assertAlmostEqual(1.0, sum(ph2["mass"]), self.places) - self.assertAlmostEqual(2.0, ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), self.places) - return - - def test_neutron_fractions(self): - """test_neutron_fractions -- check phase fractions in neutron dataset.""" - self.P.setdata(2) - ph = self.P.phase_fractions() - bb1 = 10.31**2 - bPb = 9.4012 - bO = 5.8054 - bSc = 12.11 - bW = 4.75518 - bTi = -3.37013 - bb2 = ((8 * bPb + 24 * bO + 4 * bSc + 2 * bW + 2 * bTi) / 40.0) ** 2 - self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) - self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) - self.assertAlmostEqual(1.0, sum(ph["mass"]), self.places) - self.assertAlmostEqual(bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places) - self.assertAlmostEqual(bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places) - mavg1 = 58.69 - mavg2 = (8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90) / 40.0 - self.assertAlmostEqual(bb2 / bb1 * mavg1 / mavg2, ph["mass"][0] / ph["mass"][1], self.places) - self.assertEqual(0.0, sum(ph["stdatom"])) - self.assertEqual(0.0, sum(ph["stdcell"])) - self.assertEqual(0.0, sum(ph["stdmass"])) - self.P.setphase(1) - self.P.setvar("pscale", 2.0) - ph2 = self.P.phase_fractions() - self.assertAlmostEqual(1.0, sum(ph2["atom"]), self.places) - self.assertAlmostEqual(1.0, sum(ph2["cell"]), self.places) - self.assertAlmostEqual(1.0, sum(ph2["mass"]), self.places) - self.assertAlmostEqual(2.0, ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), self.places) - return - - -# End of class TestSphereEnvelope - -if __name__ == "__main__": - unittest.main() - -# End of file diff --git a/diffpy/pdffit2/tests/TestShapeFactors.py b/diffpy/pdffit2/tests/TestShapeFactors.py deleted file mode 100644 index 1eaa9711..00000000 --- a/diffpy/pdffit2/tests/TestShapeFactors.py +++ /dev/null @@ -1,274 +0,0 @@ -#!/usr/bin/env python - -"""Unit tests for particle shape envelope factors. -""" - - -import unittest - -import numpy - -from diffpy.pdffit2 import PdfFit, pdffit2 -from diffpy.pdffit2.tests.pdffit2testutils import datafile - - -def spherefactor(r, d): - """Calculate spherical envelope correction - - r -- PDF radius - d -- diameter of spherical particle - - Return numpy array of shape correction envelope. - """ - r1 = numpy.array(r) - fsph = 1.0 - 1.5 * r1 / d + 0.5 * (r1 / d) ** 3 - fsph[r1 > d] = 0.0 - return fsph - - -############################################################################## -class TestSphereEnvelope(unittest.TestCase): - - places = 6 - - def setUp(self): - self.P = PdfFit() - return - - def tearDown(self): - self.P = None - return - - def test_calculation(self): - """check calculation of sphere envelope factor""" - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.calc() - d = 8.0 - r = numpy.array(self.P.getR()) - G0 = numpy.array(self.P.getpdf_fit()) - self.P.setvar("spdiameter", d) - self.P.calc() - G1 = numpy.array(self.P.getpdf_fit()) - dG = G0 * spherefactor(r, d) - G1 - msd = numpy.dot(dG, dG) / len(r) - self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) - return - - def test_refinement(self): - """check refinement of sphere envelope factor""" - dcheck = 8.0 - dstart = 12.0 - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("spdiameter", dcheck) - self.P.calc() - r = numpy.array(self.P.getR()) - Gd8 = numpy.array(self.P.getpdf_fit()) - Gd8noise = Gd8 - Gd8noise[::2] += 0.01 - Gd8noise[1::2] -= 0.01 - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data_lists("X", 0.0, 0.05, list(r), list(Gd8noise)) - self.P.constrain("spdiameter", "@8") - self.P.setpar(8, dstart) - self.P.refine() - dfinal = self.P.getvar("spdiameter") - self.assertAlmostEqual(dcheck, dfinal, 3) - return - - def test_twophase_calculation(self): - """check PDF calculation for 2 phases with different spdiameters""" - d1 = 6 - d2 = 9 - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("spdiameter", d1) - self.P.calc() - G1 = numpy.array(self.P.getpdf_fit()) - self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("spdiameter", d2) - self.P.calc() - G2 = numpy.array(self.P.getpdf_fit()) - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setphase(1) - self.P.setvar("spdiameter", d1) - self.P.setphase(2) - self.P.setvar("spdiameter", d2) - self.P.calc() - Gtot = numpy.array(self.P.getpdf_fit()) - dG = G1 + G2 - Gtot - r = numpy.array(self.P.getR()) - msd = numpy.dot(dG, dG) / len(r) - self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) - return - - def test_twophase_refinement(self): - """check PDF refinement of 2 phases that have different spdiameter.""" - dcheck1 = 8.0 - dstart1 = 8.2 - dcheck2 = 6.0 - dstart2 = 5.5 - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("spdiameter", dcheck1) - self.P.calc() - G1 = numpy.array(self.P.getpdf_fit()) - self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("spdiameter", dcheck2) - self.P.calc() - G2 = numpy.array(self.P.getpdf_fit()) - r = numpy.array(self.P.getR()) - Gnoise = G1 + G2 - Gnoise[::2] += 0.01 - Gnoise[1::2] -= 0.01 - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.read_data_lists("X", 0.0, 0.05, list(r), list(Gnoise)) - self.P.setphase(1) - self.P.constrain("spdiameter", "@11") - self.P.setphase(2) - self.P.constrain("spdiameter", "@12") - self.P.setpar(11, dstart1) - self.P.setpar(12, dstart2) - self.P.refine() - dfinal2 = self.P.getvar("spdiameter") - self.P.setphase(1) - dfinal1 = self.P.getvar("spdiameter") - self.assertAlmostEqual(dcheck1, dfinal1, 3) - self.assertAlmostEqual(dcheck2, dfinal2, 3) - return - - def test_spdiameter_io(self): - """Check reading and writing of spdiameter from structure file.""" - import re - - self.P.read_struct(datafile("Ni.stru")) - self.assertEqual(0.0, self.P.getvar("spdiameter")) - # engine should not write shape factor when not defined - spdnone = self.P.save_struct_string(1) - self.assertTrue(not re.search("(?m)^shape +sphere,", spdnone)) - self.P.setvar("spdiameter", 7) - spd7 = self.P.save_struct_string(1) - # spd7 should contain shape factor data - self.assertTrue(re.search("(?m)^shape +sphere,", spd7)) - self.P.reset() - self.P.read_struct_string(spd7) - self.assertEqual(7.0, self.P.getvar("spdiameter")) - # try to read without comma - spd14 = re.sub("(?m)^shape +sphere.*$", "shape sphere 14.00", spd7) - self.P.read_struct_string(spd14) - self.assertEqual(14.0, self.P.getvar("spdiameter")) - # try to read invalid shape data - sinvalid = re.sub("(?m)^shape .*", "shape invalid, 1", spd7) - self.assertRaises(pdffit2.structureError, self.P.read_struct_string, sinvalid) - return - - -# End of class TestSphereEnvelope - - -############################################################################## -class TestStepCutEnvelope(unittest.TestCase): - - places = 6 - - def setUp(self): - self.P = PdfFit() - return - - def tearDown(self): - self.P = None - return - - def test_stepcut_calculation(self): - """check calculation of sphere envelope factor""" - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.calc() - stepcut = 8.0 - r = numpy.array(self.P.getR()) - G0 = numpy.array(self.P.getpdf_fit()) - G0[r > stepcut] = 0.0 - self.P.setvar("stepcut", stepcut) - self.P.calc() - G1 = numpy.array(self.P.getpdf_fit()) - dG = G0 - G1 - msd = numpy.dot(dG, dG) / len(r) - self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) - return - - def test_twophase_stepcut_calculation(self): - """check PDF calculation for 2 phases with different spdiameters""" - d1 = 6 - d2 = 9 - self.P.read_struct(datafile("Ni.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("stepcut", d1) - self.P.calc() - G1 = numpy.array(self.P.getpdf_fit()) - self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setvar("stepcut", d2) - self.P.calc() - G2 = numpy.array(self.P.getpdf_fit()) - self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) - self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) - self.P.setphase(1) - self.P.setvar("stepcut", d1) - self.P.setphase(2) - self.P.setvar("stepcut", d2) - self.P.calc() - Gtot = numpy.array(self.P.getpdf_fit()) - dG = G1 + G2 - Gtot - r = numpy.array(self.P.getR()) - msd = numpy.dot(dG, dG) / len(r) - self.assertAlmostEqual(0.0, numpy.sqrt(msd), self.places) - # G after step should be zero - self.assertTrue(numpy.all(0 == Gtot[r > max(d1, d2)])) - return - - def test_stepcut_io(self): - """Check reading and writing of stepcut from structure file.""" - import re - - self.P.read_struct(datafile("Ni.stru")) - self.assertEqual(0.0, self.P.getvar("stepcut")) - # engine should not write shape factor when not defined - sscnone = self.P.save_struct_string(1) - self.assertTrue(not re.search("(?m)^shape +stepcut,", sscnone)) - self.P.setvar("stepcut", 7) - ssc7 = self.P.save_struct_string(1) - # ssc7 should contain shape factor data - self.assertTrue(re.search("(?m)^shape +stepcut,", ssc7)) - self.P.reset() - self.P.read_struct_string(ssc7) - self.assertEqual(7.0, self.P.getvar("stepcut")) - # try to read without comma - ssc14 = re.sub("(?m)^shape +stepcut.*$", "shape stepcut 14.00", ssc7) - self.P.read_struct_string(ssc14) - self.assertEqual(14.0, self.P.getvar("stepcut")) - # try to read invalid shape data - sinvalid = re.sub("(?m)^shape .*", "shape invalid, 1", ssc7) - self.assertRaises(pdffit2.structureError, self.P.read_struct_string, sinvalid) - return - - -# End of class TestStepCutEnvelope - -if __name__ == "__main__": - unittest.main() - -# End of file diff --git a/diffpy/pdffit2/tests/__init__.py b/diffpy/pdffit2/tests/__init__.py deleted file mode 100644 index e01060cf..00000000 --- a/diffpy/pdffit2/tests/__init__.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2012 Trustees of the Columbia University -# in the City of New York. All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Unit tests for the diffpy.pdffit2 package. -""" - -import unittest - - -def testsuite(pattern=""): - """Create a unit tests suite for the diffpy.pdffit2 package. - - Parameters - ---------- - pattern : str, optional - Regular expression pattern for selecting test cases. - Select all tests when empty. Ignore the pattern when - any of unit test modules fails to import. - - Returns - ------- - suite : `unittest.TestSuite` - The TestSuite object containing the matching tests. - """ - import re - from itertools import chain - from os.path import dirname - - from pkg_resources import resource_filename - - loader = unittest.defaultTestLoader - thisdir = resource_filename(__name__, "") - depth = __name__.count(".") + 1 - topdir = thisdir - for i in range(depth): - topdir = dirname(topdir) - suite_all = loader.discover(thisdir, pattern="*Test*.py", top_level_dir=topdir) - # always filter the suite by pattern to test-cover the selection code. - suite = unittest.TestSuite() - rx = re.compile(pattern) - tsuites = list(chain.from_iterable(suite_all)) - tsok = all(isinstance(ts, unittest.TestSuite) for ts in tsuites) - if not tsok: # pragma: no cover - return suite_all - tcases = chain.from_iterable(tsuites) - for tc in tcases: - tcwords = tc.id().split(".") - shortname = ".".join(tcwords[-3:]) - if rx.search(shortname): - suite.addTest(tc) - # verify all tests are found for an empty pattern. - assert pattern or suite_all.countTestCases() == suite.countTestCases() - return suite - - -def test(): - """Execute all unit tests for the diffpy.pdffit2 package. - - Returns - ------- - result : `unittest.TestResult` - """ - suite = testsuite() - runner = unittest.TextTestRunner() - result = runner.run(suite) - return result - - -def testdeps(): - """Execute all unit tests for diffpy.pdffit2 and its dependencies. - - Returns - ------- - result : `unittest.TestResult` - """ - from importlib import import_module - - modulenames = """ - diffpy.pdffit2.tests - diffpy.structure.tests - """.split() - suite = unittest.TestSuite() - for mname in modulenames: - mod = import_module(mname) - suite.addTests(mod.testsuite()) - runner = unittest.TextTestRunner() - result = runner.run(suite) - return result - - -# End of file diff --git a/diffpy/pdffit2/tests/debug.py b/diffpy/pdffit2/tests/debug.py deleted file mode 100644 index 83074005..00000000 --- a/diffpy/pdffit2/tests/debug.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.pdffit2 Complex Modeling Initiative -# (c) 2016 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. -# -############################################################################## - - -"""\ -Convenience module for debugging the unit tests using - -python -m diffpy.pdffit2.tests.debug - -Exceptions raised by failed tests or other errors are not caught. -""" - - -if __name__ == "__main__": - import sys - - from diffpy.pdffit2.tests import testsuite - - pattern = sys.argv[1] if len(sys.argv) > 1 else "" - suite = testsuite(pattern) - suite.debug() - - -# End of file diff --git a/diffpy/pdffit2/tests/pdffit2testutils.py b/diffpy/pdffit2/tests/pdffit2testutils.py deleted file mode 100644 index ce61aa16..00000000 --- a/diffpy/pdffit2/tests/pdffit2testutils.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.srreal by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2010 Trustees of the Columbia University -# in the City of New York. All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Helper routines for running other unit tests. -Import of this module suppresses the chatty output from the C++ extension. -""" - - -import os.path - -import six - -import diffpy.pdffit2 - -# silence the C++ engine output -diffpy.pdffit2.redirect_stdout(open(os.path.devnull, "w")) - -# path variables -thisfile = locals().get("__file__", "file.py") -tests_dir = os.path.dirname(os.path.abspath(thisfile)) -testdata_dir = os.path.join(tests_dir, "testdata") - - -def datafile(filename): - """prepend testdata_dir to filename.""" - return os.path.join(testdata_dir, filename) - - -def capture_output(f, *args, **kwargs): - """Capture output from pdffit2 engine produced in function call.""" - savestdout = diffpy.pdffit2.output.stdout - fp = six.StringIO() - diffpy.pdffit2.redirect_stdout(fp) - try: - f(*args, **kwargs) - finally: - diffpy.pdffit2.redirect_stdout(savestdout) - return fp.getvalue() - - -# End of file diff --git a/diffpy/pdffit2/tests/run.py b/diffpy/pdffit2/tests/run.py deleted file mode 100644 index 790e018d..00000000 --- a/diffpy/pdffit2/tests/run.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2012 Trustees of the Columbia University -# in the City of New York. All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Convenience module for executing all unit tests with - -python -m diffpy.pdffit2.tests.run -""" - - -if __name__ == "__main__": - import sys - - # show warnings by default - if not sys.warnoptions: - import os - import warnings - - warnings.simplefilter("default") - # also affect subprocesses - os.environ["PYTHONWARNINGS"] = "default" - from diffpy.pdffit2.tests import test - - # produce zero exit code for a successful test - sys.exit(not test().wasSuccessful()) - -# End of file diff --git a/diffpy/pdffit2/tests/rundeps.py b/diffpy/pdffit2/tests/rundeps.py deleted file mode 100644 index 038475ae..00000000 --- a/diffpy/pdffit2/tests/rundeps.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2012 Trustees of the Columbia University -# in the City of New York. All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Convenience module for executing unit tests for all pdffit2 dependencies - -python -m diffpy.pdffit2.tests.rundeps -""" - - -if __name__ == "__main__": - import sys - - from diffpy.pdffit2.tests import testdeps - - # produce zero exit code for a successful test - sys.exit(not testdeps().wasSuccessful()) - -# End of file diff --git a/diffpy/pdffit2/tests/testdata/300K.gr b/diffpy/pdffit2/tests/testdata/300K.gr deleted file mode 100644 index 15578911..00000000 --- a/diffpy/pdffit2/tests/testdata/300K.gr +++ /dev/null @@ -1,2062 +0,0 @@ -History written: Fri Apr 30 13:05:36 2004 -produced by -##### Run Information runCorrection=T -prep=gsas machine=npdf -run=300K background=npdf_00907 -smooth=2 smoothParam=32 32 0 backKillThresh=-1.0 -in beam: radius=0.635 height=2.54 -temp=308 runTitle=Run 1018: LMO - RT (before), HIPPO-furnace - -##### Vanadium runCorrection=T -run=npdf_00709 background=npdf_00710 -smooth=2 smoothParam=32 32 0 vanKillThresh=4.0 vBackKillThresh=-1.0 -in beam: radius=0.635 height=2.54 - -##### Container runCorrection=T -run=npdf_00917 background=npdf_00907 -smooth=2 smoothParam=32 32 0 cBackKillThresh=-1.0 -wallThick=0.023 atomDensity=0.072110 -atomic information: scattCS=5.100 absorpCS=5.080 - -##### Sample Material numElements=3 NormLaue=0.47445 -Element relAtomNum atomMass atomCoherCS atomIncoherCS atomAbsorpCS - O 0.6000 15.999 4.2320 0.0008 0.00019 - Mn 0.2000 54.931 -1.7500 0.4000 13.30000 - La 0.2000 138.905 8.5300 1.1300 8.97000 -density= effDensity=3.4138 - -##### Banks=6 deltaQ=0.01 matchRef=0 matchScal=T matchOffset=T -bank angle blendQmin blendQmax (0.0 means no info) - 1 90.0 1.62 29.42 - 2 -90.0 1.62 29.42 - 3 119.0 1.97 35.85 - 4 -119.0 1.97 35.85 - 5 148.0 2.20 40.00 - 6 -148.0 2.20 40.00 - -##### Program Specific Information -## Ft calcError=1 (1 for true, 0 for false) -numRpoints=2000 maxR=20.0 numDensity=0.0 intMaxR=1.5 -## Damp Qmin=2.0 Qmax=32 startDampQ=32 QAveMin=0.6 -dampFuncType=0 modEqn=1.0000*S(Q) +0.0000 +0.0000*Q dampExtraToZero=0 -## Blend numBanks=6 banks=1,2,3,4,5,6 -## Soqd minProcOut=0 -samPlazcek=0 vanPlazcek=0 smoothData=0 modifyData=1 -## Corps minProcOut=0 numBanksMiss=0 - -##### prepgsas prepOutput=1 numBanksMiss=0 fileExt=gsa -instParamFile=npdf_displex_757.iparm -numBanksAdd=0 -numBanksMult=6 -Bank# mulData mulBack - 1 1.0230 1.0000 - 2 1.0300 1.0000 - 3 1.0200 1.0000 - 4 0.9800 1.0000 - 5 0.9930 1.0000 - 6 0.9750 1.0000 -##### start data -#O0 rg_int sig_rg_int low_int sig_low_int rmax rhofit -#S 1 - PDF from PDFgetN -#P0 -4.09986 0.44295 0.11702 0.01370 1.50 0.0731 -#L r G(r) dr dG(r) - 0.010 0.086 0.0 0.0441 - 0.020 0.149 0.0 0.0849 - 0.030 0.169 0.0 0.1193 - 0.040 0.130 0.0 0.1448 - 0.050 0.021 0.0 0.1598 - 0.060 -0.160 0.0 0.1637 - 0.070 -0.410 0.0 0.1568 - 0.080 -0.717 0.0 0.1411 - 0.090 -1.064 0.0 0.1196 - 0.100 -1.428 0.0 0.0979 - 0.110 -1.782 0.0 0.0842 - 0.120 -2.101 0.0 0.0854 - 0.130 -2.359 0.0 0.0992 - 0.140 -2.535 0.0 0.1166 - 0.150 -2.612 0.0 0.1311 - 0.160 -2.581 0.0 0.1392 - 0.170 -2.440 0.0 0.1400 - 0.180 -2.196 0.0 0.1341 - 0.190 -1.863 0.0 0.1238 - 0.200 -1.462 0.0 0.1126 - 0.210 -1.017 0.0 0.1050 - 0.220 -0.556 0.0 0.1044 - 0.230 -0.109 0.0 0.1107 - 0.240 0.299 0.0 0.1202 - 0.250 0.643 0.0 0.1290 - 0.260 0.906 0.0 0.1341 - 0.270 1.077 0.0 0.1343 - 0.280 1.152 0.0 0.1298 - 0.290 1.134 0.0 0.1222 - 0.300 1.035 0.0 0.1143 - 0.310 0.870 0.0 0.1091 - 0.320 0.660 0.0 0.1090 - 0.330 0.426 0.0 0.1137 - 0.340 0.193 0.0 0.1209 - 0.350 -0.019 0.0 0.1275 - 0.360 -0.192 0.0 0.1313 - 0.370 -0.313 0.0 0.1313 - 0.380 -0.373 0.0 0.1276 - 0.390 -0.372 0.0 0.1217 - 0.400 -0.314 0.0 0.1156 - 0.410 -0.207 0.0 0.1119 - 0.420 -0.065 0.0 0.1121 - 0.430 0.095 0.0 0.1159 - 0.440 0.257 0.0 0.1215 - 0.450 0.404 0.0 0.1267 - 0.460 0.523 0.0 0.1295 - 0.470 0.601 0.0 0.1292 - 0.480 0.632 0.0 0.1259 - 0.490 0.614 0.0 0.1210 - 0.500 0.548 0.0 0.1163 - 0.510 0.443 0.0 0.1136 - 0.520 0.307 0.0 0.1141 - 0.530 0.152 0.0 0.1175 - 0.540 -0.007 0.0 0.1222 - 0.550 -0.158 0.0 0.1263 - 0.560 -0.290 0.0 0.1283 - 0.570 -0.393 0.0 0.1277 - 0.580 -0.461 0.0 0.1248 - 0.590 -0.493 0.0 0.1205 - 0.600 -0.490 0.0 0.1166 - 0.610 -0.458 0.0 0.1146 - 0.620 -0.404 0.0 0.1153 - 0.630 -0.338 0.0 0.1184 - 0.640 -0.271 0.0 0.1225 - 0.650 -0.214 0.0 0.1259 - 0.660 -0.176 0.0 0.1275 - 0.670 -0.163 0.0 0.1268 - 0.680 -0.180 0.0 0.1240 - 0.690 -0.228 0.0 0.1203 - 0.700 -0.306 0.0 0.1171 - 0.710 -0.409 0.0 0.1156 - 0.720 -0.529 0.0 0.1164 - 0.730 -0.659 0.0 0.1192 - 0.740 -0.789 0.0 0.1226 - 0.750 -0.910 0.0 0.1254 - 0.760 -1.015 0.0 0.1265 - 0.770 -1.097 0.0 0.1257 - 0.780 -1.153 0.0 0.1232 - 0.790 -1.181 0.0 0.1200 - 0.800 -1.185 0.0 0.1173 - 0.810 -1.166 0.0 0.1163 - 0.820 -1.132 0.0 0.1173 - 0.830 -1.088 0.0 0.1198 - 0.840 -1.043 0.0 0.1228 - 0.850 -1.002 0.0 0.1251 - 0.860 -0.973 0.0 0.1259 - 0.870 -0.958 0.0 0.1249 - 0.880 -0.961 0.0 0.1226 - 0.890 -0.982 0.0 0.1198 - 0.900 -1.018 0.0 0.1177 - 0.910 -1.066 0.0 0.1170 - 0.920 -1.122 0.0 0.1181 - 0.930 -1.179 0.0 0.1204 - 0.940 -1.232 0.0 0.1229 - 0.950 -1.277 0.0 0.1247 - 0.960 -1.308 0.0 0.1251 - 0.970 -1.324 0.0 0.1240 - 0.980 -1.325 0.0 0.1219 - 0.990 -1.311 0.0 0.1195 - 1.000 -1.287 0.0 0.1178 - 1.010 -1.255 0.0 0.1175 - 1.020 -1.222 0.0 0.1187 - 1.030 -1.192 0.0 0.1208 - 1.040 -1.170 0.0 0.1231 - 1.050 -1.161 0.0 0.1245 - 1.060 -1.165 0.0 0.1246 - 1.070 -1.185 0.0 0.1234 - 1.080 -1.217 0.0 0.1214 - 1.090 -1.260 0.0 0.1193 - 1.100 -1.309 0.0 0.1180 - 1.110 -1.358 0.0 0.1180 - 1.120 -1.401 0.0 0.1193 - 1.130 -1.432 0.0 0.1212 - 1.140 -1.448 0.0 0.1231 - 1.150 -1.443 0.0 0.1242 - 1.160 -1.417 0.0 0.1241 - 1.170 -1.371 0.0 0.1228 - 1.180 -1.307 0.0 0.1209 - 1.190 -1.230 0.0 0.1191 - 1.200 -1.147 0.0 0.1182 - 1.210 -1.065 0.0 0.1184 - 1.220 -0.992 0.0 0.1198 - 1.230 -0.934 0.0 0.1217 - 1.240 -0.898 0.0 0.1233 - 1.250 -0.888 0.0 0.1241 - 1.260 -0.905 0.0 0.1237 - 1.270 -0.950 0.0 0.1224 - 1.280 -1.019 0.0 0.1206 - 1.290 -1.106 0.0 0.1191 - 1.300 -1.205 0.0 0.1184 - 1.310 -1.306 0.0 0.1188 - 1.320 -1.400 0.0 0.1202 - 1.330 -1.479 0.0 0.1220 - 1.340 -1.534 0.0 0.1234 - 1.350 -1.562 0.0 0.1239 - 1.360 -1.557 0.0 0.1234 - 1.370 -1.519 0.0 0.1220 - 1.380 -1.452 0.0 0.1204 - 1.390 -1.360 0.0 0.1190 - 1.400 -1.251 0.0 0.1186 - 1.410 -1.133 0.0 0.1193 - 1.420 -1.017 0.0 0.1207 - 1.430 -0.913 0.0 0.1224 - 1.440 -0.830 0.0 0.1236 - 1.450 -0.775 0.0 0.1239 - 1.460 -0.755 0.0 0.1232 - 1.470 -0.770 0.0 0.1217 - 1.480 -0.822 0.0 0.1201 - 1.490 -0.906 0.0 0.1190 - 1.500 -1.017 0.0 0.1188 - 1.510 -1.147 0.0 0.1196 - 1.520 -1.285 0.0 0.1210 - 1.530 -1.422 0.0 0.1226 - 1.540 -1.548 0.0 0.1236 - 1.550 -1.653 0.0 0.1238 - 1.560 -1.730 0.0 0.1230 - 1.570 -1.774 0.0 0.1216 - 1.580 -1.781 0.0 0.1201 - 1.590 -1.753 0.0 0.1191 - 1.600 -1.691 0.0 0.1190 - 1.610 -1.600 0.0 0.1198 - 1.620 -1.487 0.0 0.1213 - 1.630 -1.360 0.0 0.1227 - 1.640 -1.227 0.0 0.1236 - 1.650 -1.097 0.0 0.1236 - 1.660 -0.977 0.0 0.1227 - 1.670 -0.876 0.0 0.1213 - 1.680 -0.797 0.0 0.1200 - 1.690 -0.747 0.0 0.1191 - 1.700 -0.727 0.0 0.1191 - 1.710 -0.739 0.0 0.1200 - 1.720 -0.782 0.0 0.1214 - 1.730 -0.858 0.0 0.1227 - 1.740 -0.964 0.0 0.1234 - 1.750 -1.099 0.0 0.1234 - 1.760 -1.262 0.0 0.1225 - 1.770 -1.452 0.0 0.1212 - 1.780 -1.668 0.0 0.1200 - 1.790 -1.908 0.0 0.1193 - 1.800 -2.171 0.0 0.1195 - 1.810 -2.456 0.0 0.1204 - 1.820 -2.758 0.0 0.1216 - 1.830 -3.075 0.0 0.1227 - 1.840 -3.401 0.0 0.1233 - 1.850 -3.730 0.0 0.1230 - 1.860 -4.053 0.0 0.1221 - 1.870 -4.362 0.0 0.1209 - 1.880 -4.647 0.0 0.1198 - 1.890 -4.897 0.0 0.1194 - 1.900 -5.103 0.0 0.1197 - 1.910 -5.256 0.0 0.1206 - 1.920 -5.349 0.0 0.1218 - 1.930 -5.378 0.0 0.1227 - 1.940 -5.342 0.0 0.1231 - 1.950 -5.241 0.0 0.1227 - 1.960 -5.081 0.0 0.1218 - 1.970 -4.869 0.0 0.1207 - 1.980 -4.618 0.0 0.1198 - 1.990 -4.340 0.0 0.1196 - 2.000 -4.050 0.0 0.1200 - 2.010 -3.762 0.0 0.1210 - 2.020 -3.493 0.0 0.1221 - 2.030 -3.253 0.0 0.1229 - 2.040 -3.056 0.0 0.1231 - 2.050 -2.907 0.0 0.1226 - 2.060 -2.811 0.0 0.1215 - 2.070 -2.769 0.0 0.1204 - 2.080 -2.778 0.0 0.1197 - 2.090 -2.831 0.0 0.1196 - 2.100 -2.918 0.0 0.1201 - 2.110 -3.029 0.0 0.1211 - 2.120 -3.150 0.0 0.1222 - 2.130 -3.270 0.0 0.1229 - 2.140 -3.377 0.0 0.1229 - 2.150 -3.460 0.0 0.1223 - 2.160 -3.511 0.0 0.1213 - 2.170 -3.525 0.0 0.1202 - 2.180 -3.499 0.0 0.1196 - 2.190 -3.432 0.0 0.1196 - 2.200 -3.327 0.0 0.1202 - 2.210 -3.188 0.0 0.1213 - 2.220 -3.019 0.0 0.1223 - 2.230 -2.825 0.0 0.1229 - 2.240 -2.613 0.0 0.1229 - 2.250 -2.385 0.0 0.1222 - 2.260 -2.145 0.0 0.1212 - 2.270 -1.895 0.0 0.1202 - 2.280 -1.633 0.0 0.1197 - 2.290 -1.359 0.0 0.1197 - 2.300 -1.069 0.0 0.1204 - 2.310 -0.761 0.0 0.1214 - 2.320 -0.431 0.0 0.1223 - 2.330 -0.077 0.0 0.1228 - 2.340 0.303 0.0 0.1227 - 2.350 0.706 0.0 0.1221 - 2.360 1.131 0.0 0.1211 - 2.370 1.571 0.0 0.1203 - 2.380 2.020 0.0 0.1198 - 2.390 2.466 0.0 0.1199 - 2.400 2.899 0.0 0.1206 - 2.410 3.309 0.0 0.1215 - 2.420 3.682 0.0 0.1223 - 2.430 4.010 0.0 0.1227 - 2.440 4.285 0.0 0.1225 - 2.450 4.501 0.0 0.1218 - 2.460 4.656 0.0 0.1210 - 2.470 4.751 0.0 0.1203 - 2.480 4.792 0.0 0.1200 - 2.490 4.788 0.0 0.1203 - 2.500 4.749 0.0 0.1210 - 2.510 4.688 0.0 0.1218 - 2.520 4.620 0.0 0.1225 - 2.530 4.558 0.0 0.1226 - 2.540 4.518 0.0 0.1223 - 2.550 4.508 0.0 0.1215 - 2.560 4.539 0.0 0.1207 - 2.570 4.615 0.0 0.1201 - 2.580 4.738 0.0 0.1200 - 2.590 4.907 0.0 0.1204 - 2.600 5.115 0.0 0.1212 - 2.610 5.354 0.0 0.1220 - 2.620 5.613 0.0 0.1226 - 2.630 5.882 0.0 0.1226 - 2.640 6.146 0.0 0.1222 - 2.650 6.395 0.0 0.1213 - 2.660 6.619 0.0 0.1205 - 2.670 6.808 0.0 0.1200 - 2.680 6.957 0.0 0.1200 - 2.690 7.063 0.0 0.1205 - 2.700 7.126 0.0 0.1214 - 2.710 7.148 0.0 0.1222 - 2.720 7.134 0.0 0.1227 - 2.730 7.090 0.0 0.1226 - 2.740 7.023 0.0 0.1221 - 2.750 6.941 0.0 0.1212 - 2.760 6.849 0.0 0.1204 - 2.770 6.754 0.0 0.1200 - 2.780 6.659 0.0 0.1201 - 2.790 6.567 0.0 0.1206 - 2.800 6.477 0.0 0.1215 - 2.810 6.388 0.0 0.1222 - 2.820 6.297 0.0 0.1226 - 2.830 6.201 0.0 0.1225 - 2.840 6.094 0.0 0.1219 - 2.850 5.972 0.0 0.1211 - 2.860 5.832 0.0 0.1204 - 2.870 5.671 0.0 0.1200 - 2.880 5.487 0.0 0.1202 - 2.890 5.281 0.0 0.1209 - 2.900 5.053 0.0 0.1217 - 2.910 4.807 0.0 0.1224 - 2.920 4.548 0.0 0.1227 - 2.930 4.279 0.0 0.1225 - 2.940 4.006 0.0 0.1218 - 2.950 3.734 0.0 0.1210 - 2.960 3.467 0.0 0.1203 - 2.970 3.208 0.0 0.1200 - 2.980 2.958 0.0 0.1202 - 2.990 2.720 0.0 0.1209 - 3.000 2.491 0.0 0.1218 - 3.010 2.269 0.0 0.1224 - 3.020 2.053 0.0 0.1227 - 3.030 1.838 0.0 0.1224 - 3.040 1.622 0.0 0.1217 - 3.050 1.402 0.0 0.1209 - 3.060 1.176 0.0 0.1202 - 3.070 0.942 0.0 0.1200 - 3.080 0.703 0.0 0.1203 - 3.090 0.459 0.0 0.1210 - 3.100 0.213 0.0 0.1218 - 3.110 -0.029 0.0 0.1224 - 3.120 -0.263 0.0 0.1226 - 3.130 -0.484 0.0 0.1223 - 3.140 -0.688 0.0 0.1216 - 3.150 -0.868 0.0 0.1208 - 3.160 -1.024 0.0 0.1202 - 3.170 -1.152 0.0 0.1201 - 3.180 -1.254 0.0 0.1204 - 3.190 -1.330 0.0 0.1211 - 3.200 -1.385 0.0 0.1218 - 3.210 -1.423 0.0 0.1223 - 3.220 -1.450 0.0 0.1224 - 3.230 -1.472 0.0 0.1220 - 3.240 -1.495 0.0 0.1214 - 3.250 -1.526 0.0 0.1206 - 3.260 -1.568 0.0 0.1202 - 3.270 -1.625 0.0 0.1201 - 3.280 -1.698 0.0 0.1205 - 3.290 -1.787 0.0 0.1212 - 3.300 -1.888 0.0 0.1220 - 3.310 -1.998 0.0 0.1224 - 3.320 -2.111 0.0 0.1224 - 3.330 -2.220 0.0 0.1219 - 3.340 -2.319 0.0 0.1212 - 3.350 -2.401 0.0 0.1205 - 3.360 -2.460 0.0 0.1201 - 3.370 -2.492 0.0 0.1201 - 3.380 -2.495 0.0 0.1206 - 3.390 -2.467 0.0 0.1213 - 3.400 -2.411 0.0 0.1220 - 3.410 -2.329 0.0 0.1224 - 3.420 -2.229 0.0 0.1223 - 3.430 -2.116 0.0 0.1219 - 3.440 -1.998 0.0 0.1212 - 3.450 -1.885 0.0 0.1205 - 3.460 -1.785 0.0 0.1202 - 3.470 -1.705 0.0 0.1202 - 3.480 -1.652 0.0 0.1207 - 3.490 -1.631 0.0 0.1214 - 3.500 -1.645 0.0 0.1220 - 3.510 -1.696 0.0 0.1223 - 3.520 -1.782 0.0 0.1222 - 3.530 -1.901 0.0 0.1217 - 3.540 -2.049 0.0 0.1211 - 3.550 -2.219 0.0 0.1205 - 3.560 -2.405 0.0 0.1203 - 3.570 -2.600 0.0 0.1204 - 3.580 -2.797 0.0 0.1209 - 3.590 -2.990 0.0 0.1215 - 3.600 -3.171 0.0 0.1220 - 3.610 -3.337 0.0 0.1223 - 3.620 -3.483 0.0 0.1221 - 3.630 -3.605 0.0 0.1216 - 3.640 -3.702 0.0 0.1210 - 3.650 -3.771 0.0 0.1205 - 3.660 -3.813 0.0 0.1204 - 3.670 -3.826 0.0 0.1206 - 3.680 -3.810 0.0 0.1211 - 3.690 -3.765 0.0 0.1217 - 3.700 -3.691 0.0 0.1221 - 3.710 -3.589 0.0 0.1222 - 3.720 -3.456 0.0 0.1219 - 3.730 -3.294 0.0 0.1214 - 3.740 -3.101 0.0 0.1209 - 3.750 -2.880 0.0 0.1205 - 3.760 -2.629 0.0 0.1205 - 3.770 -2.351 0.0 0.1208 - 3.780 -2.049 0.0 0.1213 - 3.790 -1.726 0.0 0.1219 - 3.800 -1.387 0.0 0.1222 - 3.810 -1.038 0.0 0.1222 - 3.820 -0.686 0.0 0.1219 - 3.830 -0.338 0.0 0.1213 - 3.840 -0.003 0.0 0.1208 - 3.850 0.312 0.0 0.1205 - 3.860 0.598 0.0 0.1205 - 3.870 0.848 0.0 0.1209 - 3.880 1.056 0.0 0.1215 - 3.890 1.215 0.0 0.1220 - 3.900 1.323 0.0 0.1223 - 3.910 1.377 0.0 0.1222 - 3.920 1.376 0.0 0.1218 - 3.930 1.322 0.0 0.1212 - 3.940 1.217 0.0 0.1206 - 3.950 1.065 0.0 0.1204 - 3.960 0.871 0.0 0.1205 - 3.970 0.640 0.0 0.1210 - 3.980 0.378 0.0 0.1216 - 3.990 0.091 0.0 0.1221 - 4.000 -0.215 0.0 0.1223 - 4.010 -0.536 0.0 0.1222 - 4.020 -0.866 0.0 0.1217 - 4.030 -1.203 0.0 0.1211 - 4.040 -1.543 0.0 0.1206 - 4.050 -1.884 0.0 0.1204 - 4.060 -2.224 0.0 0.1206 - 4.070 -2.562 0.0 0.1211 - 4.080 -2.896 0.0 0.1217 - 4.090 -3.225 0.0 0.1222 - 4.100 -3.547 0.0 0.1223 - 4.110 -3.859 0.0 0.1221 - 4.120 -4.159 0.0 0.1216 - 4.130 -4.443 0.0 0.1210 - 4.140 -4.707 0.0 0.1205 - 4.150 -4.946 0.0 0.1203 - 4.160 -5.155 0.0 0.1205 - 4.170 -5.329 0.0 0.1211 - 4.180 -5.463 0.0 0.1217 - 4.190 -5.552 0.0 0.1222 - 4.200 -5.595 0.0 0.1224 - 4.210 -5.588 0.0 0.1221 - 4.220 -5.529 0.0 0.1216 - 4.230 -5.421 0.0 0.1210 - 4.240 -5.265 0.0 0.1205 - 4.250 -5.064 0.0 0.1204 - 4.260 -4.824 0.0 0.1206 - 4.270 -4.551 0.0 0.1211 - 4.280 -4.251 0.0 0.1217 - 4.290 -3.932 0.0 0.1221 - 4.300 -3.602 0.0 0.1222 - 4.310 -3.268 0.0 0.1219 - 4.320 -2.936 0.0 0.1214 - 4.330 -2.613 0.0 0.1209 - 4.340 -2.302 0.0 0.1205 - 4.350 -2.007 0.0 0.1204 - 4.360 -1.729 0.0 0.1207 - 4.370 -1.469 0.0 0.1212 - 4.380 -1.226 0.0 0.1218 - 4.390 -0.996 0.0 0.1221 - 4.400 -0.779 0.0 0.1222 - 4.410 -0.569 0.0 0.1219 - 4.420 -0.365 0.0 0.1213 - 4.430 -0.162 0.0 0.1208 - 4.440 0.042 0.0 0.1205 - 4.450 0.248 0.0 0.1205 - 4.460 0.456 0.0 0.1208 - 4.470 0.667 0.0 0.1213 - 4.480 0.878 0.0 0.1218 - 4.490 1.086 0.0 0.1221 - 4.500 1.288 0.0 0.1220 - 4.510 1.481 0.0 0.1217 - 4.520 1.658 0.0 0.1212 - 4.530 1.818 0.0 0.1207 - 4.540 1.955 0.0 0.1204 - 4.550 2.067 0.0 0.1205 - 4.560 2.153 0.0 0.1208 - 4.570 2.213 0.0 0.1214 - 4.580 2.249 0.0 0.1218 - 4.590 2.262 0.0 0.1221 - 4.600 2.258 0.0 0.1220 - 4.610 2.241 0.0 0.1216 - 4.620 2.219 0.0 0.1211 - 4.630 2.198 0.0 0.1207 - 4.640 2.185 0.0 0.1204 - 4.650 2.185 0.0 0.1206 - 4.660 2.205 0.0 0.1209 - 4.670 2.249 0.0 0.1214 - 4.680 2.319 0.0 0.1219 - 4.690 2.416 0.0 0.1220 - 4.700 2.540 0.0 0.1219 - 4.710 2.688 0.0 0.1215 - 4.720 2.856 0.0 0.1210 - 4.730 3.037 0.0 0.1206 - 4.740 3.226 0.0 0.1204 - 4.750 3.413 0.0 0.1206 - 4.760 3.592 0.0 0.1210 - 4.770 3.755 0.0 0.1215 - 4.780 3.896 0.0 0.1219 - 4.790 4.007 0.0 0.1220 - 4.800 4.084 0.0 0.1219 - 4.810 4.125 0.0 0.1215 - 4.820 4.129 0.0 0.1210 - 4.830 4.094 0.0 0.1207 - 4.840 4.025 0.0 0.1206 - 4.850 3.923 0.0 0.1208 - 4.860 3.794 0.0 0.1212 - 4.870 3.642 0.0 0.1216 - 4.880 3.474 0.0 0.1219 - 4.890 3.295 0.0 0.1220 - 4.900 3.112 0.0 0.1218 - 4.910 2.928 0.0 0.1214 - 4.920 2.748 0.0 0.1210 - 4.930 2.576 0.0 0.1207 - 4.940 2.412 0.0 0.1207 - 4.950 2.258 0.0 0.1210 - 4.960 2.113 0.0 0.1214 - 4.970 1.977 0.0 0.1218 - 4.980 1.847 0.0 0.1220 - 4.990 1.720 0.0 0.1220 - 5.000 1.594 0.0 0.1217 - 5.010 1.467 0.0 0.1213 - 5.020 1.336 0.0 0.1209 - 5.030 1.199 0.0 0.1207 - 5.040 1.057 0.0 0.1208 - 5.050 0.908 0.0 0.1211 - 5.060 0.754 0.0 0.1215 - 5.070 0.597 0.0 0.1219 - 5.080 0.440 0.0 0.1220 - 5.090 0.286 0.0 0.1219 - 5.100 0.140 0.0 0.1216 - 5.110 0.005 0.0 0.1211 - 5.120 -0.113 0.0 0.1208 - 5.130 -0.212 0.0 0.1206 - 5.140 -0.288 0.0 0.1207 - 5.150 -0.338 0.0 0.1211 - 5.160 -0.360 0.0 0.1216 - 5.170 -0.356 0.0 0.1220 - 5.180 -0.325 0.0 0.1221 - 5.190 -0.270 0.0 0.1220 - 5.200 -0.195 0.0 0.1216 - 5.210 -0.104 0.0 0.1211 - 5.220 -0.003 0.0 0.1208 - 5.230 0.102 0.0 0.1207 - 5.240 0.205 0.0 0.1208 - 5.250 0.299 0.0 0.1212 - 5.260 0.378 0.0 0.1217 - 5.270 0.439 0.0 0.1220 - 5.280 0.476 0.0 0.1221 - 5.290 0.487 0.0 0.1219 - 5.300 0.472 0.0 0.1215 - 5.310 0.432 0.0 0.1210 - 5.320 0.368 0.0 0.1207 - 5.330 0.285 0.0 0.1206 - 5.340 0.188 0.0 0.1208 - 5.350 0.084 0.0 0.1212 - 5.360 -0.020 0.0 0.1217 - 5.370 -0.116 0.0 0.1220 - 5.380 -0.197 0.0 0.1220 - 5.390 -0.256 0.0 0.1218 - 5.400 -0.287 0.0 0.1214 - 5.410 -0.287 0.0 0.1209 - 5.420 -0.250 0.0 0.1206 - 5.430 -0.178 0.0 0.1206 - 5.440 -0.070 0.0 0.1208 - 5.450 0.070 0.0 0.1212 - 5.460 0.240 0.0 0.1217 - 5.470 0.433 0.0 0.1219 - 5.480 0.643 0.0 0.1219 - 5.490 0.863 0.0 0.1217 - 5.500 1.086 0.0 0.1212 - 5.510 1.306 0.0 0.1208 - 5.520 1.515 0.0 0.1206 - 5.530 1.711 0.0 0.1206 - 5.540 1.889 0.0 0.1209 - 5.550 2.048 0.0 0.1214 - 5.560 2.187 0.0 0.1218 - 5.570 2.307 0.0 0.1221 - 5.580 2.412 0.0 0.1220 - 5.590 2.504 0.0 0.1217 - 5.600 2.587 0.0 0.1213 - 5.610 2.664 0.0 0.1209 - 5.620 2.740 0.0 0.1206 - 5.630 2.817 0.0 0.1207 - 5.640 2.897 0.0 0.1210 - 5.650 2.979 0.0 0.1214 - 5.660 3.062 0.0 0.1218 - 5.670 3.144 0.0 0.1220 - 5.680 3.221 0.0 0.1219 - 5.690 3.287 0.0 0.1216 - 5.700 3.338 0.0 0.1212 - 5.710 3.366 0.0 0.1208 - 5.720 3.366 0.0 0.1206 - 5.730 3.333 0.0 0.1207 - 5.740 3.264 0.0 0.1210 - 5.750 3.156 0.0 0.1214 - 5.760 3.009 0.0 0.1218 - 5.770 2.825 0.0 0.1219 - 5.780 2.606 0.0 0.1218 - 5.790 2.357 0.0 0.1215 - 5.800 2.087 0.0 0.1211 - 5.810 1.802 0.0 0.1207 - 5.820 1.511 0.0 0.1206 - 5.830 1.222 0.0 0.1207 - 5.840 0.944 0.0 0.1210 - 5.850 0.684 0.0 0.1214 - 5.860 0.447 0.0 0.1218 - 5.870 0.238 0.0 0.1219 - 5.880 0.059 0.0 0.1217 - 5.890 -0.089 0.0 0.1214 - 5.900 -0.208 0.0 0.1210 - 5.910 -0.301 0.0 0.1207 - 5.920 -0.374 0.0 0.1206 - 5.930 -0.430 0.0 0.1208 - 5.940 -0.477 0.0 0.1212 - 5.950 -0.520 0.0 0.1216 - 5.960 -0.566 0.0 0.1219 - 5.970 -0.619 0.0 0.1219 - 5.980 -0.684 0.0 0.1217 - 5.990 -0.763 0.0 0.1214 - 6.000 -0.859 0.0 0.1210 - 6.010 -0.971 0.0 0.1207 - 6.020 -1.098 0.0 0.1207 - 6.030 -1.238 0.0 0.1209 - 6.040 -1.388 0.0 0.1212 - 6.050 -1.545 0.0 0.1216 - 6.060 -1.705 0.0 0.1219 - 6.070 -1.865 0.0 0.1220 - 6.080 -2.021 0.0 0.1217 - 6.090 -2.172 0.0 0.1214 - 6.100 -2.315 0.0 0.1210 - 6.110 -2.449 0.0 0.1207 - 6.120 -2.575 0.0 0.1207 - 6.130 -2.694 0.0 0.1209 - 6.140 -2.805 0.0 0.1213 - 6.150 -2.912 0.0 0.1217 - 6.160 -3.016 0.0 0.1219 - 6.170 -3.119 0.0 0.1219 - 6.180 -3.223 0.0 0.1217 - 6.190 -3.329 0.0 0.1213 - 6.200 -3.439 0.0 0.1210 - 6.210 -3.552 0.0 0.1208 - 6.220 -3.669 0.0 0.1208 - 6.230 -3.789 0.0 0.1211 - 6.240 -3.911 0.0 0.1214 - 6.250 -4.033 0.0 0.1217 - 6.260 -4.153 0.0 0.1219 - 6.270 -4.269 0.0 0.1218 - 6.280 -4.378 0.0 0.1216 - 6.290 -4.478 0.0 0.1213 - 6.300 -4.567 0.0 0.1210 - 6.310 -4.640 0.0 0.1208 - 6.320 -4.697 0.0 0.1209 - 6.330 -4.734 0.0 0.1212 - 6.340 -4.751 0.0 0.1215 - 6.350 -4.745 0.0 0.1218 - 6.360 -4.714 0.0 0.1219 - 6.370 -4.659 0.0 0.1218 - 6.380 -4.578 0.0 0.1215 - 6.390 -4.473 0.0 0.1211 - 6.400 -4.344 0.0 0.1209 - 6.410 -4.194 0.0 0.1208 - 6.420 -4.025 0.0 0.1209 - 6.430 -3.840 0.0 0.1212 - 6.440 -3.645 0.0 0.1215 - 6.450 -3.443 0.0 0.1218 - 6.460 -3.241 0.0 0.1219 - 6.470 -3.045 0.0 0.1217 - 6.480 -2.860 0.0 0.1214 - 6.490 -2.691 0.0 0.1211 - 6.500 -2.545 0.0 0.1208 - 6.510 -2.424 0.0 0.1208 - 6.520 -2.333 0.0 0.1210 - 6.530 -2.272 0.0 0.1213 - 6.540 -2.241 0.0 0.1217 - 6.550 -2.239 0.0 0.1219 - 6.560 -2.262 0.0 0.1219 - 6.570 -2.305 0.0 0.1216 - 6.580 -2.361 0.0 0.1213 - 6.590 -2.425 0.0 0.1209 - 6.600 -2.488 0.0 0.1207 - 6.610 -2.541 0.0 0.1207 - 6.620 -2.578 0.0 0.1209 - 6.630 -2.592 0.0 0.1213 - 6.640 -2.577 0.0 0.1216 - 6.650 -2.530 0.0 0.1219 - 6.660 -2.449 0.0 0.1218 - 6.670 -2.334 0.0 0.1216 - 6.680 -2.187 0.0 0.1213 - 6.690 -2.012 0.0 0.1209 - 6.700 -1.815 0.0 0.1207 - 6.710 -1.601 0.0 0.1207 - 6.720 -1.380 0.0 0.1209 - 6.730 -1.158 0.0 0.1213 - 6.740 -0.944 0.0 0.1216 - 6.750 -0.743 0.0 0.1218 - 6.760 -0.562 0.0 0.1218 - 6.770 -0.404 0.0 0.1216 - 6.780 -0.272 0.0 0.1212 - 6.790 -0.166 0.0 0.1209 - 6.800 -0.083 0.0 0.1208 - 6.810 -0.022 0.0 0.1208 - 6.820 0.023 0.0 0.1211 - 6.830 0.057 0.0 0.1214 - 6.840 0.088 0.0 0.1217 - 6.850 0.122 0.0 0.1218 - 6.860 0.164 0.0 0.1217 - 6.870 0.222 0.0 0.1214 - 6.880 0.299 0.0 0.1211 - 6.890 0.398 0.0 0.1208 - 6.900 0.521 0.0 0.1207 - 6.910 0.667 0.0 0.1208 - 6.920 0.835 0.0 0.1211 - 6.930 1.021 0.0 0.1215 - 6.940 1.221 0.0 0.1217 - 6.950 1.428 0.0 0.1218 - 6.960 1.636 0.0 0.1217 - 6.970 1.839 0.0 0.1214 - 6.980 2.030 0.0 0.1211 - 6.990 2.203 0.0 0.1209 - 7.000 2.353 0.0 0.1208 - 7.010 2.476 0.0 0.1209 - 7.020 2.569 0.0 0.1212 - 7.030 2.630 0.0 0.1215 - 7.040 2.660 0.0 0.1217 - 7.050 2.658 0.0 0.1217 - 7.060 2.627 0.0 0.1216 - 7.070 2.571 0.0 0.1213 - 7.080 2.493 0.0 0.1210 - 7.090 2.397 0.0 0.1207 - 7.100 2.289 0.0 0.1207 - 7.110 2.173 0.0 0.1209 - 7.120 2.053 0.0 0.1213 - 7.130 1.933 0.0 0.1216 - 7.140 1.819 0.0 0.1218 - 7.150 1.712 0.0 0.1218 - 7.160 1.615 0.0 0.1216 - 7.170 1.531 0.0 0.1213 - 7.180 1.461 0.0 0.1210 - 7.190 1.405 0.0 0.1209 - 7.200 1.366 0.0 0.1209 - 7.210 1.342 0.0 0.1211 - 7.220 1.333 0.0 0.1214 - 7.230 1.340 0.0 0.1217 - 7.240 1.363 0.0 0.1218 - 7.250 1.401 0.0 0.1218 - 7.260 1.455 0.0 0.1216 - 7.270 1.524 0.0 0.1213 - 7.280 1.608 0.0 0.1210 - 7.290 1.707 0.0 0.1208 - 7.300 1.823 0.0 0.1209 - 7.310 1.954 0.0 0.1211 - 7.320 2.099 0.0 0.1215 - 7.330 2.260 0.0 0.1217 - 7.340 2.434 0.0 0.1219 - 7.350 2.620 0.0 0.1218 - 7.360 2.816 0.0 0.1216 - 7.370 3.018 0.0 0.1213 - 7.380 3.224 0.0 0.1210 - 7.390 3.430 0.0 0.1209 - 7.400 3.631 0.0 0.1210 - 7.410 3.823 0.0 0.1213 - 7.420 4.001 0.0 0.1216 - 7.430 4.160 0.0 0.1218 - 7.440 4.297 0.0 0.1219 - 7.450 4.406 0.0 0.1218 - 7.460 4.486 0.0 0.1215 - 7.470 4.534 0.0 0.1212 - 7.480 4.550 0.0 0.1209 - 7.490 4.533 0.0 0.1208 - 7.500 4.485 0.0 0.1210 - 7.510 4.408 0.0 0.1212 - 7.520 4.306 0.0 0.1216 - 7.530 4.183 0.0 0.1218 - 7.540 4.044 0.0 0.1218 - 7.550 3.892 0.0 0.1217 - 7.560 3.733 0.0 0.1214 - 7.570 3.571 0.0 0.1211 - 7.580 3.409 0.0 0.1209 - 7.590 3.251 0.0 0.1208 - 7.600 3.097 0.0 0.1210 - 7.610 2.949 0.0 0.1213 - 7.620 2.804 0.0 0.1216 - 7.630 2.663 0.0 0.1218 - 7.640 2.523 0.0 0.1218 - 7.650 2.380 0.0 0.1216 - 7.660 2.233 0.0 0.1213 - 7.670 2.077 0.0 0.1210 - 7.680 1.911 0.0 0.1208 - 7.690 1.734 0.0 0.1208 - 7.700 1.543 0.0 0.1210 - 7.710 1.341 0.0 0.1213 - 7.720 1.128 0.0 0.1216 - 7.730 0.906 0.0 0.1218 - 7.740 0.681 0.0 0.1218 - 7.750 0.455 0.0 0.1216 - 7.760 0.234 0.0 0.1213 - 7.770 0.022 0.0 0.1209 - 7.780 -0.176 0.0 0.1208 - 7.790 -0.356 0.0 0.1208 - 7.800 -0.514 0.0 0.1210 - 7.810 -0.650 0.0 0.1213 - 7.820 -0.761 0.0 0.1216 - 7.830 -0.848 0.0 0.1218 - 7.840 -0.912 0.0 0.1217 - 7.850 -0.957 0.0 0.1215 - 7.860 -0.984 0.0 0.1212 - 7.870 -0.997 0.0 0.1209 - 7.880 -1.000 0.0 0.1208 - 7.890 -0.996 0.0 0.1208 - 7.900 -0.988 0.0 0.1210 - 7.910 -0.978 0.0 0.1213 - 7.920 -0.968 0.0 0.1216 - 7.930 -0.958 0.0 0.1217 - 7.940 -0.949 0.0 0.1217 - 7.950 -0.939 0.0 0.1214 - 7.960 -0.928 0.0 0.1211 - 7.970 -0.914 0.0 0.1209 - 7.980 -0.897 0.0 0.1207 - 7.990 -0.876 0.0 0.1208 - 8.000 -0.850 0.0 0.1211 - 8.010 -0.821 0.0 0.1214 - 8.020 -0.791 0.0 0.1217 - 8.030 -0.761 0.0 0.1218 - 8.040 -0.736 0.0 0.1217 - 8.050 -0.718 0.0 0.1215 - 8.060 -0.711 0.0 0.1211 - 8.070 -0.718 0.0 0.1209 - 8.080 -0.742 0.0 0.1208 - 8.090 -0.784 0.0 0.1209 - 8.100 -0.845 0.0 0.1211 - 8.110 -0.922 0.0 0.1214 - 8.120 -1.014 0.0 0.1217 - 8.130 -1.115 0.0 0.1218 - 8.140 -1.220 0.0 0.1216 - 8.150 -1.322 0.0 0.1214 - 8.160 -1.415 0.0 0.1211 - 8.170 -1.489 0.0 0.1208 - 8.180 -1.540 0.0 0.1208 - 8.190 -1.561 0.0 0.1209 - 8.200 -1.549 0.0 0.1212 - 8.210 -1.501 0.0 0.1215 - 8.220 -1.417 0.0 0.1217 - 8.230 -1.300 0.0 0.1218 - 8.240 -1.155 0.0 0.1217 - 8.250 -0.988 0.0 0.1214 - 8.260 -0.808 0.0 0.1211 - 8.270 -0.624 0.0 0.1209 - 8.280 -0.445 0.0 0.1209 - 8.290 -0.282 0.0 0.1210 - 8.300 -0.144 0.0 0.1213 - 8.310 -0.038 0.0 0.1216 - 8.320 0.030 0.0 0.1218 - 8.330 0.056 0.0 0.1218 - 8.340 0.039 0.0 0.1216 - 8.350 -0.020 0.0 0.1214 - 8.360 -0.119 0.0 0.1211 - 8.370 -0.253 0.0 0.1210 - 8.380 -0.415 0.0 0.1209 - 8.390 -0.598 0.0 0.1211 - 8.400 -0.794 0.0 0.1214 - 8.410 -0.996 0.0 0.1216 - 8.420 -1.195 0.0 0.1217 - 8.430 -1.387 0.0 0.1217 - 8.440 -1.565 0.0 0.1216 - 8.450 -1.725 0.0 0.1213 - 8.460 -1.864 0.0 0.1211 - 8.470 -1.980 0.0 0.1210 - 8.480 -2.073 0.0 0.1210 - 8.490 -2.143 0.0 0.1211 - 8.500 -2.189 0.0 0.1214 - 8.510 -2.213 0.0 0.1216 - 8.520 -2.215 0.0 0.1217 - 8.530 -2.196 0.0 0.1217 - 8.540 -2.156 0.0 0.1215 - 8.550 -2.096 0.0 0.1213 - 8.560 -2.016 0.0 0.1210 - 8.570 -1.916 0.0 0.1210 - 8.580 -1.798 0.0 0.1210 - 8.590 -1.664 0.0 0.1212 - 8.600 -1.516 0.0 0.1214 - 8.610 -1.358 0.0 0.1216 - 8.620 -1.194 0.0 0.1217 - 8.630 -1.030 0.0 0.1216 - 8.640 -0.872 0.0 0.1214 - 8.650 -0.728 0.0 0.1212 - 8.660 -0.604 0.0 0.1210 - 8.670 -0.508 0.0 0.1210 - 8.680 -0.446 0.0 0.1211 - 8.690 -0.423 0.0 0.1213 - 8.700 -0.442 0.0 0.1215 - 8.710 -0.505 0.0 0.1217 - 8.720 -0.611 0.0 0.1217 - 8.730 -0.758 0.0 0.1216 - 8.740 -0.941 0.0 0.1214 - 8.750 -1.154 0.0 0.1211 - 8.760 -1.387 0.0 0.1210 - 8.770 -1.633 0.0 0.1210 - 8.780 -1.883 0.0 0.1211 - 8.790 -2.127 0.0 0.1213 - 8.800 -2.357 0.0 0.1215 - 8.810 -2.568 0.0 0.1216 - 8.820 -2.753 0.0 0.1216 - 8.830 -2.911 0.0 0.1215 - 8.840 -3.041 0.0 0.1212 - 8.850 -3.144 0.0 0.1210 - 8.860 -3.222 0.0 0.1209 - 8.870 -3.280 0.0 0.1210 - 8.880 -3.323 0.0 0.1212 - 8.890 -3.357 0.0 0.1214 - 8.900 -3.384 0.0 0.1216 - 8.910 -3.411 0.0 0.1217 - 8.920 -3.438 0.0 0.1216 - 8.930 -3.467 0.0 0.1214 - 8.940 -3.498 0.0 0.1212 - 8.950 -3.529 0.0 0.1209 - 8.960 -3.554 0.0 0.1208 - 8.970 -3.571 0.0 0.1209 - 8.980 -3.574 0.0 0.1211 - 8.990 -3.556 0.0 0.1214 - 9.000 -3.515 0.0 0.1216 - 9.010 -3.445 0.0 0.1217 - 9.020 -3.346 0.0 0.1216 - 9.030 -3.215 0.0 0.1214 - 9.040 -3.055 0.0 0.1211 - 9.050 -2.869 0.0 0.1209 - 9.060 -2.661 0.0 0.1208 - 9.070 -2.438 0.0 0.1209 - 9.080 -2.207 0.0 0.1212 - 9.090 -1.976 0.0 0.1214 - 9.100 -1.752 0.0 0.1216 - 9.110 -1.542 0.0 0.1217 - 9.120 -1.351 0.0 0.1216 - 9.130 -1.183 0.0 0.1214 - 9.140 -1.041 0.0 0.1211 - 9.150 -0.925 0.0 0.1209 - 9.160 -0.835 0.0 0.1209 - 9.170 -0.768 0.0 0.1210 - 9.180 -0.720 0.0 0.1212 - 9.190 -0.688 0.0 0.1215 - 9.200 -0.666 0.0 0.1217 - 9.210 -0.651 0.0 0.1217 - 9.220 -0.638 0.0 0.1216 - 9.230 -0.626 0.0 0.1214 - 9.240 -0.611 0.0 0.1211 - 9.250 -0.593 0.0 0.1209 - 9.260 -0.572 0.0 0.1209 - 9.270 -0.546 0.0 0.1210 - 9.280 -0.518 0.0 0.1212 - 9.290 -0.487 0.0 0.1215 - 9.300 -0.453 0.0 0.1217 - 9.310 -0.416 0.0 0.1217 - 9.320 -0.372 0.0 0.1216 - 9.330 -0.320 0.0 0.1213 - 9.340 -0.255 0.0 0.1211 - 9.350 -0.172 0.0 0.1209 - 9.360 -0.066 0.0 0.1209 - 9.370 0.070 0.0 0.1211 - 9.380 0.241 0.0 0.1213 - 9.390 0.451 0.0 0.1215 - 9.400 0.704 0.0 0.1217 - 9.410 1.001 0.0 0.1217 - 9.420 1.341 0.0 0.1215 - 9.430 1.721 0.0 0.1213 - 9.440 2.135 0.0 0.1211 - 9.450 2.576 0.0 0.1210 - 9.460 3.035 0.0 0.1210 - 9.470 3.500 0.0 0.1211 - 9.480 3.959 0.0 0.1214 - 9.490 4.403 0.0 0.1216 - 9.500 4.819 0.0 0.1217 - 9.510 5.199 0.0 0.1217 - 9.520 5.536 0.0 0.1215 - 9.530 5.823 0.0 0.1213 - 9.540 6.060 0.0 0.1210 - 9.550 6.246 0.0 0.1209 - 9.560 6.384 0.0 0.1210 - 9.570 6.477 0.0 0.1211 - 9.580 6.533 0.0 0.1214 - 9.590 6.558 0.0 0.1216 - 9.600 6.558 0.0 0.1217 - 9.610 6.541 0.0 0.1216 - 9.620 6.512 0.0 0.1215 - 9.630 6.474 0.0 0.1212 - 9.640 6.430 0.0 0.1210 - 9.650 6.379 0.0 0.1210 - 9.660 6.321 0.0 0.1210 - 9.670 6.251 0.0 0.1212 - 9.680 6.166 0.0 0.1215 - 9.690 6.060 0.0 0.1216 - 9.700 5.929 0.0 0.1217 - 9.710 5.768 0.0 0.1216 - 9.720 5.574 0.0 0.1214 - 9.730 5.346 0.0 0.1212 - 9.740 5.085 0.0 0.1210 - 9.750 4.792 0.0 0.1210 - 9.760 4.472 0.0 0.1211 - 9.770 4.132 0.0 0.1213 - 9.780 3.778 0.0 0.1215 - 9.790 3.420 0.0 0.1216 - 9.800 3.065 0.0 0.1217 - 9.810 2.722 0.0 0.1216 - 9.820 2.398 0.0 0.1214 - 9.830 2.098 0.0 0.1211 - 9.840 1.826 0.0 0.1210 - 9.850 1.584 0.0 0.1210 - 9.860 1.371 0.0 0.1211 - 9.870 1.185 0.0 0.1213 - 9.880 1.021 0.0 0.1215 - 9.890 0.875 0.0 0.1217 - 9.900 0.741 0.0 0.1216 - 9.910 0.613 0.0 0.1215 - 9.920 0.485 0.0 0.1213 - 9.930 0.354 0.0 0.1211 - 9.940 0.216 0.0 0.1210 - 9.950 0.070 0.0 0.1210 - 9.960 -0.084 0.0 0.1211 - 9.970 -0.244 0.0 0.1213 - 9.980 -0.408 0.0 0.1215 - 9.990 -0.570 0.0 0.1217 - 10.000 -0.727 0.0 0.1216 - 10.010 -0.872 0.0 0.1215 - 10.020 -1.002 0.0 0.1212 - 10.030 -1.112 0.0 0.1210 - 10.040 -1.200 0.0 0.1209 - 10.050 -1.262 0.0 0.1210 - 10.060 -1.299 0.0 0.1212 - 10.070 -1.312 0.0 0.1214 - 10.080 -1.300 0.0 0.1216 - 10.090 -1.268 0.0 0.1217 - 10.100 -1.216 0.0 0.1216 - 10.110 -1.148 0.0 0.1214 - 10.120 -1.065 0.0 0.1212 - 10.130 -0.970 0.0 0.1210 - 10.140 -0.863 0.0 0.1209 - 10.150 -0.744 0.0 0.1210 - 10.160 -0.612 0.0 0.1212 - 10.170 -0.465 0.0 0.1214 - 10.180 -0.303 0.0 0.1216 - 10.190 -0.123 0.0 0.1217 - 10.200 0.075 0.0 0.1216 - 10.210 0.293 0.0 0.1214 - 10.220 0.529 0.0 0.1212 - 10.230 0.781 0.0 0.1210 - 10.240 1.044 0.0 0.1209 - 10.250 1.314 0.0 0.1210 - 10.260 1.582 0.0 0.1212 - 10.270 1.841 0.0 0.1214 - 10.280 2.081 0.0 0.1216 - 10.290 2.293 0.0 0.1217 - 10.300 2.466 0.0 0.1216 - 10.310 2.593 0.0 0.1213 - 10.320 2.666 0.0 0.1211 - 10.330 2.679 0.0 0.1209 - 10.340 2.630 0.0 0.1209 - 10.350 2.518 0.0 0.1210 - 10.360 2.343 0.0 0.1212 - 10.370 2.109 0.0 0.1215 - 10.380 1.822 0.0 0.1216 - 10.390 1.489 0.0 0.1217 - 10.400 1.119 0.0 0.1215 - 10.410 0.718 0.0 0.1213 - 10.420 0.298 0.0 0.1211 - 10.430 -0.135 0.0 0.1209 - 10.440 -0.574 0.0 0.1209 - 10.450 -1.012 0.0 0.1210 - 10.460 -1.444 0.0 0.1212 - 10.470 -1.868 0.0 0.1214 - 10.480 -2.282 0.0 0.1216 - 10.490 -2.685 0.0 0.1216 - 10.500 -3.077 0.0 0.1215 - 10.510 -3.458 0.0 0.1213 - 10.520 -3.829 0.0 0.1211 - 10.530 -4.190 0.0 0.1210 - 10.540 -4.541 0.0 0.1210 - 10.550 -4.879 0.0 0.1211 - 10.560 -5.204 0.0 0.1213 - 10.570 -5.511 0.0 0.1215 - 10.580 -5.797 0.0 0.1217 - 10.590 -6.059 0.0 0.1216 - 10.600 -6.290 0.0 0.1215 - 10.610 -6.489 0.0 0.1213 - 10.620 -6.650 0.0 0.1211 - 10.630 -6.771 0.0 0.1210 - 10.640 -6.850 0.0 0.1210 - 10.650 -6.888 0.0 0.1211 - 10.660 -6.886 0.0 0.1214 - 10.670 -6.845 0.0 0.1216 - 10.680 -6.769 0.0 0.1217 - 10.690 -6.663 0.0 0.1216 - 10.700 -6.532 0.0 0.1215 - 10.710 -6.380 0.0 0.1213 - 10.720 -6.212 0.0 0.1211 - 10.730 -6.032 0.0 0.1210 - 10.740 -5.844 0.0 0.1211 - 10.750 -5.648 0.0 0.1212 - 10.760 -5.445 0.0 0.1214 - 10.770 -5.234 0.0 0.1216 - 10.780 -5.013 0.0 0.1217 - 10.790 -4.780 0.0 0.1216 - 10.800 -4.529 0.0 0.1214 - 10.810 -4.257 0.0 0.1212 - 10.820 -3.959 0.0 0.1211 - 10.830 -3.633 0.0 0.1210 - 10.840 -3.274 0.0 0.1211 - 10.850 -2.880 0.0 0.1213 - 10.860 -2.452 0.0 0.1215 - 10.870 -1.989 0.0 0.1216 - 10.880 -1.494 0.0 0.1217 - 10.890 -0.970 0.0 0.1215 - 10.900 -0.421 0.0 0.1214 - 10.910 0.147 0.0 0.1211 - 10.920 0.727 0.0 0.1210 - 10.930 1.315 0.0 0.1210 - 10.940 1.901 0.0 0.1211 - 10.950 2.481 0.0 0.1213 - 10.960 3.047 0.0 0.1215 - 10.970 3.594 0.0 0.1217 - 10.980 4.115 0.0 0.1217 - 10.990 4.605 0.0 0.1216 - 11.000 5.060 0.0 0.1214 - 11.010 5.475 0.0 0.1212 - 11.020 5.846 0.0 0.1210 - 11.030 6.169 0.0 0.1210 - 11.040 6.441 0.0 0.1211 - 11.050 6.658 0.0 0.1213 - 11.060 6.817 0.0 0.1215 - 11.070 6.915 0.0 0.1216 - 11.080 6.950 0.0 0.1216 - 11.090 6.919 0.0 0.1215 - 11.100 6.823 0.0 0.1213 - 11.110 6.661 0.0 0.1211 - 11.120 6.434 0.0 0.1210 - 11.130 6.144 0.0 0.1210 - 11.140 5.793 0.0 0.1212 - 11.150 5.386 0.0 0.1214 - 11.160 4.929 0.0 0.1215 - 11.170 4.427 0.0 0.1216 - 11.180 3.888 0.0 0.1216 - 11.190 3.318 0.0 0.1214 - 11.200 2.725 0.0 0.1212 - 11.210 2.117 0.0 0.1211 - 11.220 1.502 0.0 0.1210 - 11.230 0.885 0.0 0.1210 - 11.240 0.272 0.0 0.1212 - 11.250 -0.330 0.0 0.1213 - 11.260 -0.918 0.0 0.1215 - 11.270 -1.488 0.0 0.1215 - 11.280 -2.037 0.0 0.1215 - 11.290 -2.563 0.0 0.1213 - 11.300 -3.065 0.0 0.1211 - 11.310 -3.539 0.0 0.1210 - 11.320 -3.986 0.0 0.1209 - 11.330 -4.404 0.0 0.1210 - 11.340 -4.791 0.0 0.1212 - 11.350 -5.146 0.0 0.1214 - 11.360 -5.467 0.0 0.1216 - 11.370 -5.752 0.0 0.1216 - 11.380 -5.999 0.0 0.1215 - 11.390 -6.206 0.0 0.1213 - 11.400 -6.371 0.0 0.1211 - 11.410 -6.493 0.0 0.1210 - 11.420 -6.571 0.0 0.1209 - 11.430 -6.605 0.0 0.1210 - 11.440 -6.595 0.0 0.1212 - 11.450 -6.543 0.0 0.1214 - 11.460 -6.450 0.0 0.1216 - 11.470 -6.319 0.0 0.1216 - 11.480 -6.154 0.0 0.1215 - 11.490 -5.958 0.0 0.1213 - 11.500 -5.735 0.0 0.1211 - 11.510 -5.488 0.0 0.1210 - 11.520 -5.222 0.0 0.1210 - 11.530 -4.940 0.0 0.1211 - 11.540 -4.646 0.0 0.1213 - 11.550 -4.342 0.0 0.1215 - 11.560 -4.031 0.0 0.1216 - 11.570 -3.713 0.0 0.1216 - 11.580 -3.391 0.0 0.1215 - 11.590 -3.064 0.0 0.1213 - 11.600 -2.734 0.0 0.1211 - 11.610 -2.399 0.0 0.1210 - 11.620 -2.062 0.0 0.1210 - 11.630 -1.720 0.0 0.1211 - 11.640 -1.375 0.0 0.1213 - 11.650 -1.026 0.0 0.1215 - 11.660 -0.673 0.0 0.1216 - 11.670 -0.319 0.0 0.1216 - 11.680 0.038 0.0 0.1215 - 11.690 0.395 0.0 0.1212 - 11.700 0.752 0.0 0.1210 - 11.710 1.106 0.0 0.1210 - 11.720 1.456 0.0 0.1210 - 11.730 1.800 0.0 0.1212 - 11.740 2.136 0.0 0.1214 - 11.750 2.461 0.0 0.1216 - 11.760 2.774 0.0 0.1217 - 11.770 3.071 0.0 0.1216 - 11.780 3.351 0.0 0.1215 - 11.790 3.611 0.0 0.1213 - 11.800 3.849 0.0 0.1211 - 11.810 4.063 0.0 0.1210 - 11.820 4.251 0.0 0.1210 - 11.830 4.411 0.0 0.1212 - 11.840 4.542 0.0 0.1214 - 11.850 4.644 0.0 0.1216 - 11.860 4.718 0.0 0.1216 - 11.870 4.763 0.0 0.1215 - 11.880 4.782 0.0 0.1214 - 11.890 4.776 0.0 0.1212 - 11.900 4.749 0.0 0.1210 - 11.910 4.704 0.0 0.1210 - 11.920 4.644 0.0 0.1211 - 11.930 4.574 0.0 0.1213 - 11.940 4.496 0.0 0.1215 - 11.950 4.416 0.0 0.1217 - 11.960 4.334 0.0 0.1217 - 11.970 4.254 0.0 0.1216 - 11.980 4.177 0.0 0.1214 - 11.990 4.102 0.0 0.1212 - 12.000 4.030 0.0 0.1211 - 12.010 3.959 0.0 0.1210 - 12.020 3.886 0.0 0.1211 - 12.030 3.809 0.0 0.1213 - 12.040 3.725 0.0 0.1215 - 12.050 3.631 0.0 0.1216 - 12.060 3.524 0.0 0.1217 - 12.070 3.403 0.0 0.1216 - 12.080 3.266 0.0 0.1214 - 12.090 3.115 0.0 0.1212 - 12.100 2.950 0.0 0.1211 - 12.110 2.775 0.0 0.1211 - 12.120 2.593 0.0 0.1212 - 12.130 2.411 0.0 0.1214 - 12.140 2.233 0.0 0.1215 - 12.150 2.066 0.0 0.1216 - 12.160 1.916 0.0 0.1216 - 12.170 1.789 0.0 0.1215 - 12.180 1.690 0.0 0.1213 - 12.190 1.622 0.0 0.1211 - 12.200 1.587 0.0 0.1210 - 12.210 1.587 0.0 0.1210 - 12.220 1.620 0.0 0.1211 - 12.230 1.684 0.0 0.1213 - 12.240 1.774 0.0 0.1215 - 12.250 1.886 0.0 0.1216 - 12.260 2.013 0.0 0.1216 - 12.270 2.150 0.0 0.1215 - 12.280 2.290 0.0 0.1213 - 12.290 2.427 0.0 0.1211 - 12.300 2.556 0.0 0.1210 - 12.310 2.673 0.0 0.1210 - 12.320 2.775 0.0 0.1212 - 12.330 2.860 0.0 0.1213 - 12.340 2.928 0.0 0.1215 - 12.350 2.979 0.0 0.1215 - 12.360 3.015 0.0 0.1215 - 12.370 3.036 0.0 0.1214 - 12.380 3.046 0.0 0.1212 - 12.390 3.045 0.0 0.1211 - 12.400 3.035 0.0 0.1210 - 12.410 3.016 0.0 0.1211 - 12.420 2.987 0.0 0.1212 - 12.430 2.947 0.0 0.1214 - 12.440 2.894 0.0 0.1215 - 12.450 2.825 0.0 0.1216 - 12.460 2.736 0.0 0.1215 - 12.470 2.625 0.0 0.1213 - 12.480 2.488 0.0 0.1211 - 12.490 2.322 0.0 0.1210 - 12.500 2.127 0.0 0.1209 - 12.510 1.901 0.0 0.1210 - 12.520 1.647 0.0 0.1212 - 12.530 1.367 0.0 0.1214 - 12.540 1.064 0.0 0.1215 - 12.550 0.745 0.0 0.1215 - 12.560 0.416 0.0 0.1214 - 12.570 0.083 0.0 0.1213 - 12.580 -0.245 0.0 0.1211 - 12.590 -0.561 0.0 0.1210 - 12.600 -0.858 0.0 0.1210 - 12.610 -1.131 0.0 0.1211 - 12.620 -1.376 0.0 0.1213 - 12.630 -1.588 0.0 0.1215 - 12.640 -1.767 0.0 0.1216 - 12.650 -1.912 0.0 0.1216 - 12.660 -2.026 0.0 0.1214 - 12.670 -2.111 0.0 0.1212 - 12.680 -2.172 0.0 0.1210 - 12.690 -2.212 0.0 0.1209 - 12.700 -2.237 0.0 0.1210 - 12.710 -2.251 0.0 0.1211 - 12.720 -2.259 0.0 0.1213 - 12.730 -2.264 0.0 0.1215 - 12.740 -2.269 0.0 0.1216 - 12.750 -2.276 0.0 0.1216 - 12.760 -2.285 0.0 0.1215 - 12.770 -2.297 0.0 0.1213 - 12.780 -2.310 0.0 0.1211 - 12.790 -2.324 0.0 0.1210 - 12.800 -2.336 0.0 0.1210 - 12.810 -2.345 0.0 0.1212 - 12.820 -2.350 0.0 0.1214 - 12.830 -2.349 0.0 0.1216 - 12.840 -2.343 0.0 0.1216 - 12.850 -2.333 0.0 0.1216 - 12.860 -2.319 0.0 0.1214 - 12.870 -2.303 0.0 0.1212 - 12.880 -2.289 0.0 0.1211 - 12.890 -2.279 0.0 0.1210 - 12.900 -2.275 0.0 0.1210 - 12.910 -2.282 0.0 0.1212 - 12.920 -2.301 0.0 0.1214 - 12.930 -2.333 0.0 0.1216 - 12.940 -2.381 0.0 0.1217 - 12.950 -2.444 0.0 0.1216 - 12.960 -2.521 0.0 0.1215 - 12.970 -2.612 0.0 0.1212 - 12.980 -2.712 0.0 0.1210 - 12.990 -2.820 0.0 0.1210 - 13.000 -2.931 0.0 0.1210 - 13.010 -3.043 0.0 0.1212 - 13.020 -3.150 0.0 0.1214 - 13.030 -3.251 0.0 0.1216 - 13.040 -3.342 0.0 0.1217 - 13.050 -3.420 0.0 0.1216 - 13.060 -3.485 0.0 0.1215 - 13.070 -3.535 0.0 0.1213 - 13.080 -3.570 0.0 0.1211 - 13.090 -3.592 0.0 0.1210 - 13.100 -3.601 0.0 0.1211 - 13.110 -3.599 0.0 0.1212 - 13.120 -3.589 0.0 0.1214 - 13.130 -3.571 0.0 0.1216 - 13.140 -3.549 0.0 0.1216 - 13.150 -3.524 0.0 0.1216 - 13.160 -3.497 0.0 0.1214 - 13.170 -3.469 0.0 0.1212 - 13.180 -3.441 0.0 0.1211 - 13.190 -3.412 0.0 0.1210 - 13.200 -3.381 0.0 0.1211 - 13.210 -3.349 0.0 0.1213 - 13.220 -3.314 0.0 0.1215 - 13.230 -3.273 0.0 0.1216 - 13.240 -3.226 0.0 0.1216 - 13.250 -3.170 0.0 0.1216 - 13.260 -3.105 0.0 0.1214 - 13.270 -3.028 0.0 0.1212 - 13.280 -2.939 0.0 0.1211 - 13.290 -2.836 0.0 0.1210 - 13.300 -2.719 0.0 0.1211 - 13.310 -2.587 0.0 0.1213 - 13.320 -2.440 0.0 0.1214 - 13.330 -2.277 0.0 0.1215 - 13.340 -2.100 0.0 0.1216 - 13.350 -1.907 0.0 0.1215 - 13.360 -1.701 0.0 0.1213 - 13.370 -1.483 0.0 0.1212 - 13.380 -1.252 0.0 0.1211 - 13.390 -1.012 0.0 0.1211 - 13.400 -0.763 0.0 0.1212 - 13.410 -0.508 0.0 0.1213 - 13.420 -0.251 0.0 0.1215 - 13.430 0.007 0.0 0.1216 - 13.440 0.261 0.0 0.1215 - 13.450 0.507 0.0 0.1214 - 13.460 0.743 0.0 0.1212 - 13.470 0.962 0.0 0.1211 - 13.480 1.162 0.0 0.1210 - 13.490 1.338 0.0 0.1210 - 13.500 1.486 0.0 0.1212 - 13.510 1.604 0.0 0.1213 - 13.520 1.689 0.0 0.1215 - 13.530 1.739 0.0 0.1216 - 13.540 1.755 0.0 0.1215 - 13.550 1.735 0.0 0.1214 - 13.560 1.682 0.0 0.1213 - 13.570 1.599 0.0 0.1212 - 13.580 1.489 0.0 0.1211 - 13.590 1.357 0.0 0.1211 - 13.600 1.208 0.0 0.1212 - 13.610 1.047 0.0 0.1213 - 13.620 0.882 0.0 0.1214 - 13.630 0.717 0.0 0.1215 - 13.640 0.559 0.0 0.1214 - 13.650 0.412 0.0 0.1213 - 13.660 0.282 0.0 0.1211 - 13.670 0.171 0.0 0.1211 - 13.680 0.081 0.0 0.1210 - 13.690 0.014 0.0 0.1211 - 13.700 -0.031 0.0 0.1213 - 13.710 -0.054 0.0 0.1214 - 13.720 -0.059 0.0 0.1215 - 13.730 -0.048 0.0 0.1215 - 13.740 -0.025 0.0 0.1214 - 13.750 0.006 0.0 0.1213 - 13.760 0.041 0.0 0.1211 - 13.770 0.075 0.0 0.1210 - 13.780 0.105 0.0 0.1210 - 13.790 0.128 0.0 0.1211 - 13.800 0.141 0.0 0.1213 - 13.810 0.143 0.0 0.1215 - 13.820 0.131 0.0 0.1216 - 13.830 0.107 0.0 0.1215 - 13.840 0.070 0.0 0.1214 - 13.850 0.021 0.0 0.1213 - 13.860 -0.039 0.0 0.1212 - 13.870 -0.109 0.0 0.1211 - 13.880 -0.187 0.0 0.1211 - 13.890 -0.273 0.0 0.1212 - 13.900 -0.364 0.0 0.1214 - 13.910 -0.461 0.0 0.1215 - 13.920 -0.564 0.0 0.1216 - 13.930 -0.671 0.0 0.1215 - 13.940 -0.782 0.0 0.1214 - 13.950 -0.897 0.0 0.1212 - 13.960 -1.017 0.0 0.1210 - 13.970 -1.138 0.0 0.1210 - 13.980 -1.261 0.0 0.1210 - 13.990 -1.381 0.0 0.1212 - 14.000 -1.497 0.0 0.1214 - 14.010 -1.605 0.0 0.1215 - 14.020 -1.699 0.0 0.1216 - 14.030 -1.774 0.0 0.1216 - 14.040 -1.825 0.0 0.1214 - 14.050 -1.846 0.0 0.1212 - 14.060 -1.830 0.0 0.1211 - 14.070 -1.775 0.0 0.1210 - 14.080 -1.674 0.0 0.1211 - 14.090 -1.526 0.0 0.1212 - 14.100 -1.330 0.0 0.1214 - 14.110 -1.085 0.0 0.1215 - 14.120 -0.795 0.0 0.1216 - 14.130 -0.463 0.0 0.1215 - 14.140 -0.094 0.0 0.1214 - 14.150 0.302 0.0 0.1212 - 14.160 0.720 0.0 0.1211 - 14.170 1.148 0.0 0.1211 - 14.180 1.579 0.0 0.1212 - 14.190 2.002 0.0 0.1213 - 14.200 2.410 0.0 0.1215 - 14.210 2.795 0.0 0.1216 - 14.220 3.150 0.0 0.1216 - 14.230 3.470 0.0 0.1215 - 14.240 3.753 0.0 0.1214 - 14.250 3.998 0.0 0.1212 - 14.260 4.203 0.0 0.1211 - 14.270 4.370 0.0 0.1211 - 14.280 4.503 0.0 0.1212 - 14.290 4.603 0.0 0.1213 - 14.300 4.674 0.0 0.1215 - 14.310 4.722 0.0 0.1216 - 14.320 4.748 0.0 0.1216 - 14.330 4.756 0.0 0.1215 - 14.340 4.750 0.0 0.1214 - 14.350 4.732 0.0 0.1212 - 14.360 4.703 0.0 0.1211 - 14.370 4.666 0.0 0.1211 - 14.380 4.622 0.0 0.1212 - 14.390 4.572 0.0 0.1213 - 14.400 4.519 0.0 0.1215 - 14.410 4.464 0.0 0.1215 - 14.420 4.410 0.0 0.1215 - 14.430 4.361 0.0 0.1215 - 14.440 4.320 0.0 0.1213 - 14.450 4.290 0.0 0.1212 - 14.460 4.276 0.0 0.1211 - 14.470 4.282 0.0 0.1211 - 14.480 4.310 0.0 0.1212 - 14.490 4.363 0.0 0.1214 - 14.500 4.442 0.0 0.1215 - 14.510 4.546 0.0 0.1216 - 14.520 4.674 0.0 0.1216 - 14.530 4.820 0.0 0.1215 - 14.540 4.980 0.0 0.1213 - 14.550 5.145 0.0 0.1211 - 14.560 5.308 0.0 0.1211 - 14.570 5.460 0.0 0.1211 - 14.580 5.591 0.0 0.1212 - 14.590 5.691 0.0 0.1213 - 14.600 5.752 0.0 0.1214 - 14.610 5.768 0.0 0.1215 - 14.620 5.734 0.0 0.1214 - 14.630 5.646 0.0 0.1213 - 14.640 5.503 0.0 0.1212 - 14.650 5.307 0.0 0.1211 - 14.660 5.063 0.0 0.1210 - 14.670 4.775 0.0 0.1211 - 14.680 4.451 0.0 0.1212 - 14.690 4.098 0.0 0.1214 - 14.700 3.724 0.0 0.1215 - 14.710 3.337 0.0 0.1215 - 14.720 2.945 0.0 0.1215 - 14.730 2.554 0.0 0.1213 - 14.740 2.166 0.0 0.1212 - 14.750 1.786 0.0 0.1211 - 14.760 1.414 0.0 0.1211 - 14.770 1.049 0.0 0.1211 - 14.780 0.689 0.0 0.1213 - 14.790 0.333 0.0 0.1214 - 14.800 -0.023 0.0 0.1215 - 14.810 -0.383 0.0 0.1215 - 14.820 -0.746 0.0 0.1215 - 14.830 -1.116 0.0 0.1213 - 14.840 -1.491 0.0 0.1212 - 14.850 -1.869 0.0 0.1211 - 14.860 -2.248 0.0 0.1211 - 14.870 -2.622 0.0 0.1211 - 14.880 -2.986 0.0 0.1213 - 14.890 -3.333 0.0 0.1214 - 14.900 -3.657 0.0 0.1215 - 14.910 -3.952 0.0 0.1215 - 14.920 -4.213 0.0 0.1214 - 14.930 -4.434 0.0 0.1213 - 14.940 -4.615 0.0 0.1212 - 14.950 -4.754 0.0 0.1211 - 14.960 -4.852 0.0 0.1211 - 14.970 -4.914 0.0 0.1212 - 14.980 -4.942 0.0 0.1213 - 14.990 -4.942 0.0 0.1215 - 15.000 -4.921 0.0 0.1215 - 15.010 -4.884 0.0 0.1215 - 15.020 -4.837 0.0 0.1214 - 15.030 -4.785 0.0 0.1213 - 15.040 -4.730 0.0 0.1211 - 15.050 -4.676 0.0 0.1211 - 15.060 -4.622 0.0 0.1211 - 15.070 -4.568 0.0 0.1212 - 15.080 -4.511 0.0 0.1213 - 15.090 -4.449 0.0 0.1215 - 15.100 -4.380 0.0 0.1215 - 15.110 -4.299 0.0 0.1215 - 15.120 -4.204 0.0 0.1214 - 15.130 -4.096 0.0 0.1212 - 15.140 -3.973 0.0 0.1211 - 15.150 -3.838 0.0 0.1211 - 15.160 -3.693 0.0 0.1211 - 15.170 -3.544 0.0 0.1213 - 15.180 -3.397 0.0 0.1214 - 15.190 -3.257 0.0 0.1215 - 15.200 -3.131 0.0 0.1215 - 15.210 -3.025 0.0 0.1215 - 15.220 -2.943 0.0 0.1213 - 15.230 -2.888 0.0 0.1212 - 15.240 -2.862 0.0 0.1211 - 15.250 -2.863 0.0 0.1211 - 15.260 -2.888 0.0 0.1212 - 15.270 -2.931 0.0 0.1213 - 15.280 -2.986 0.0 0.1215 - 15.290 -3.044 0.0 0.1216 - 15.300 -3.097 0.0 0.1216 - 15.310 -3.137 0.0 0.1215 - 15.320 -3.155 0.0 0.1213 - 15.330 -3.146 0.0 0.1212 - 15.340 -3.106 0.0 0.1211 - 15.350 -3.035 0.0 0.1211 - 15.360 -2.932 0.0 0.1212 - 15.370 -2.804 0.0 0.1213 - 15.380 -2.654 0.0 0.1215 - 15.390 -2.492 0.0 0.1216 - 15.400 -2.326 0.0 0.1216 - 15.410 -2.165 0.0 0.1215 - 15.420 -2.018 0.0 0.1213 - 15.430 -1.892 0.0 0.1212 - 15.440 -1.793 0.0 0.1211 - 15.450 -1.725 0.0 0.1211 - 15.460 -1.687 0.0 0.1212 - 15.470 -1.677 0.0 0.1214 - 15.480 -1.690 0.0 0.1215 - 15.490 -1.720 0.0 0.1216 - 15.500 -1.757 0.0 0.1216 - 15.510 -1.793 0.0 0.1215 - 15.520 -1.819 0.0 0.1213 - 15.530 -1.825 0.0 0.1212 - 15.540 -1.806 0.0 0.1211 - 15.550 -1.757 0.0 0.1211 - 15.560 -1.677 0.0 0.1212 - 15.570 -1.566 0.0 0.1214 - 15.580 -1.430 0.0 0.1215 - 15.590 -1.273 0.0 0.1216 - 15.600 -1.106 0.0 0.1215 - 15.610 -0.939 0.0 0.1214 - 15.620 -0.782 0.0 0.1213 - 15.630 -0.645 0.0 0.1211 - 15.640 -0.537 0.0 0.1211 - 15.650 -0.467 0.0 0.1211 - 15.660 -0.437 0.0 0.1212 - 15.670 -0.450 0.0 0.1214 - 15.680 -0.505 0.0 0.1215 - 15.690 -0.596 0.0 0.1216 - 15.700 -0.716 0.0 0.1215 - 15.710 -0.857 0.0 0.1214 - 15.720 -1.006 0.0 0.1212 - 15.730 -1.152 0.0 0.1211 - 15.740 -1.284 0.0 0.1210 - 15.750 -1.392 0.0 0.1211 - 15.760 -1.465 0.0 0.1212 - 15.770 -1.498 0.0 0.1214 - 15.780 -1.486 0.0 0.1215 - 15.790 -1.428 0.0 0.1215 - 15.800 -1.325 0.0 0.1215 - 15.810 -1.181 0.0 0.1213 - 15.820 -1.001 0.0 0.1212 - 15.830 -0.793 0.0 0.1211 - 15.840 -0.564 0.0 0.1210 - 15.850 -0.323 0.0 0.1211 - 15.860 -0.078 0.0 0.1212 - 15.870 0.164 0.0 0.1214 - 15.880 0.398 0.0 0.1215 - 15.890 0.619 0.0 0.1215 - 15.900 0.824 0.0 0.1214 - 15.910 1.010 0.0 0.1213 - 15.920 1.178 0.0 0.1211 - 15.930 1.328 0.0 0.1210 - 15.940 1.459 0.0 0.1210 - 15.950 1.574 0.0 0.1211 - 15.960 1.671 0.0 0.1212 - 15.970 1.752 0.0 0.1214 - 15.980 1.815 0.0 0.1215 - 15.990 1.860 0.0 0.1215 - 16.000 1.884 0.0 0.1214 - 16.010 1.885 0.0 0.1213 - 16.020 1.861 0.0 0.1212 - 16.030 1.810 0.0 0.1211 - 16.040 1.731 0.0 0.1211 - 16.050 1.623 0.0 0.1212 - 16.060 1.488 0.0 0.1213 - 16.070 1.326 0.0 0.1214 - 16.080 1.143 0.0 0.1215 - 16.090 0.942 0.0 0.1215 - 16.100 0.731 0.0 0.1214 - 16.110 0.516 0.0 0.1213 - 16.120 0.305 0.0 0.1211 - 16.130 0.106 0.0 0.1211 - 16.140 -0.075 0.0 0.1211 - 16.150 -0.230 0.0 0.1212 - 16.160 -0.355 0.0 0.1213 - 16.170 -0.444 0.0 0.1215 - 16.180 -0.496 0.0 0.1215 - 16.190 -0.510 0.0 0.1215 - 16.200 -0.484 0.0 0.1214 - 16.210 -0.421 0.0 0.1212 - 16.220 -0.323 0.0 0.1211 - 16.230 -0.192 0.0 0.1211 - 16.240 -0.032 0.0 0.1211 - 16.250 0.155 0.0 0.1212 - 16.260 0.366 0.0 0.1213 - 16.270 0.599 0.0 0.1215 - 16.280 0.852 0.0 0.1215 - 16.290 1.124 0.0 0.1215 - 16.300 1.413 0.0 0.1214 - 16.310 1.720 0.0 0.1212 - 16.320 2.042 0.0 0.1211 - 16.330 2.378 0.0 0.1211 - 16.340 2.725 0.0 0.1212 - 16.350 3.079 0.0 0.1213 - 16.360 3.437 0.0 0.1215 - 16.370 3.793 0.0 0.1216 - 16.380 4.141 0.0 0.1216 - 16.390 4.475 0.0 0.1215 - 16.400 4.786 0.0 0.1214 - 16.410 5.070 0.0 0.1212 - 16.420 5.319 0.0 0.1211 - 16.430 5.529 0.0 0.1211 - 16.440 5.696 0.0 0.1212 - 16.450 5.818 0.0 0.1213 - 16.460 5.897 0.0 0.1214 - 16.470 5.932 0.0 0.1215 - 16.480 5.929 0.0 0.1215 - 16.490 5.891 0.0 0.1215 - 16.500 5.825 0.0 0.1213 - 16.510 5.736 0.0 0.1212 - 16.520 5.630 0.0 0.1211 - 16.530 5.513 0.0 0.1211 - 16.540 5.388 0.0 0.1212 - 16.550 5.258 0.0 0.1213 - 16.560 5.123 0.0 0.1215 - 16.570 4.982 0.0 0.1215 - 16.580 4.832 0.0 0.1215 - 16.590 4.669 0.0 0.1214 - 16.600 4.487 0.0 0.1213 - 16.610 4.280 0.0 0.1212 - 16.620 4.045 0.0 0.1211 - 16.630 3.776 0.0 0.1211 - 16.640 3.472 0.0 0.1212 - 16.650 3.131 0.0 0.1214 - 16.660 2.757 0.0 0.1215 - 16.670 2.352 0.0 0.1216 - 16.680 1.925 0.0 0.1215 - 16.690 1.484 0.0 0.1214 - 16.700 1.040 0.0 0.1213 - 16.710 0.603 0.0 0.1212 - 16.720 0.185 0.0 0.1211 - 16.730 -0.203 0.0 0.1211 - 16.740 -0.553 0.0 0.1212 - 16.750 -0.856 0.0 0.1213 - 16.760 -1.110 0.0 0.1215 - 16.770 -1.313 0.0 0.1215 - 16.780 -1.465 0.0 0.1215 - 16.790 -1.573 0.0 0.1214 - 16.800 -1.643 0.0 0.1212 - 16.810 -1.684 0.0 0.1211 - 16.820 -1.705 0.0 0.1211 - 16.830 -1.716 0.0 0.1212 - 16.840 -1.727 0.0 0.1213 - 16.850 -1.746 0.0 0.1214 - 16.860 -1.778 0.0 0.1215 - 16.870 -1.826 0.0 0.1215 - 16.880 -1.892 0.0 0.1214 - 16.890 -1.972 0.0 0.1213 - 16.900 -2.062 0.0 0.1212 - 16.910 -2.154 0.0 0.1211 - 16.920 -2.241 0.0 0.1211 - 16.930 -2.313 0.0 0.1211 - 16.940 -2.362 0.0 0.1213 - 16.950 -2.379 0.0 0.1214 - 16.960 -2.360 0.0 0.1215 - 16.970 -2.299 0.0 0.1215 - 16.980 -2.197 0.0 0.1214 - 16.990 -2.055 0.0 0.1213 - 17.000 -1.878 0.0 0.1212 - 17.010 -1.673 0.0 0.1211 - 17.020 -1.449 0.0 0.1211 - 17.030 -1.216 0.0 0.1212 - 17.040 -0.985 0.0 0.1213 - 17.050 -0.766 0.0 0.1214 - 17.060 -0.568 0.0 0.1215 - 17.070 -0.398 0.0 0.1215 - 17.080 -0.261 0.0 0.1214 - 17.090 -0.159 0.0 0.1212 - 17.100 -0.093 0.0 0.1211 - 17.110 -0.060 0.0 0.1210 - 17.120 -0.056 0.0 0.1211 - 17.130 -0.073 0.0 0.1212 - 17.140 -0.105 0.0 0.1213 - 17.150 -0.146 0.0 0.1215 - 17.160 -0.187 0.0 0.1215 - 17.170 -0.223 0.0 0.1215 - 17.180 -0.250 0.0 0.1214 - 17.190 -0.266 0.0 0.1213 - 17.200 -0.270 0.0 0.1211 - 17.210 -0.264 0.0 0.1211 - 17.220 -0.252 0.0 0.1211 - 17.230 -0.237 0.0 0.1212 - 17.240 -0.226 0.0 0.1213 - 17.250 -0.225 0.0 0.1215 - 17.260 -0.238 0.0 0.1215 - 17.270 -0.270 0.0 0.1215 - 17.280 -0.325 0.0 0.1214 - 17.290 -0.405 0.0 0.1212 - 17.300 -0.509 0.0 0.1211 - 17.310 -0.636 0.0 0.1211 - 17.320 -0.782 0.0 0.1211 - 17.330 -0.943 0.0 0.1213 - 17.340 -1.114 0.0 0.1214 - 17.350 -1.289 0.0 0.1215 - 17.360 -1.462 0.0 0.1216 - 17.370 -1.629 0.0 0.1215 - 17.380 -1.783 0.0 0.1214 - 17.390 -1.923 0.0 0.1212 - 17.400 -2.046 0.0 0.1211 - 17.410 -2.151 0.0 0.1211 - 17.420 -2.237 0.0 0.1211 - 17.430 -2.307 0.0 0.1213 - 17.440 -2.360 0.0 0.1214 - 17.450 -2.399 0.0 0.1215 - 17.460 -2.425 0.0 0.1216 - 17.470 -2.439 0.0 0.1215 - 17.480 -2.441 0.0 0.1214 - 17.490 -2.431 0.0 0.1213 - 17.500 -2.407 0.0 0.1211 - 17.510 -2.369 0.0 0.1211 - 17.520 -2.313 0.0 0.1212 - 17.530 -2.239 0.0 0.1213 - 17.540 -2.145 0.0 0.1214 - 17.550 -2.031 0.0 0.1215 - 17.560 -1.896 0.0 0.1215 - 17.570 -1.743 0.0 0.1215 - 17.580 -1.575 0.0 0.1213 - 17.590 -1.397 0.0 0.1212 - 17.600 -1.216 0.0 0.1211 - 17.610 -1.038 0.0 0.1211 - 17.620 -0.873 0.0 0.1212 - 17.630 -0.727 0.0 0.1213 - 17.640 -0.610 0.0 0.1215 - 17.650 -0.528 0.0 0.1216 - 17.660 -0.486 0.0 0.1216 - 17.670 -0.488 0.0 0.1215 - 17.680 -0.536 0.0 0.1214 - 17.690 -0.628 0.0 0.1212 - 17.700 -0.761 0.0 0.1211 - 17.710 -0.930 0.0 0.1211 - 17.720 -1.127 0.0 0.1212 - 17.730 -1.343 0.0 0.1213 - 17.740 -1.570 0.0 0.1215 - 17.750 -1.797 0.0 0.1215 - 17.760 -2.015 0.0 0.1215 - 17.770 -2.217 0.0 0.1214 - 17.780 -2.396 0.0 0.1213 - 17.790 -2.547 0.0 0.1211 - 17.800 -2.666 0.0 0.1211 - 17.810 -2.754 0.0 0.1211 - 17.820 -2.810 0.0 0.1212 - 17.830 -2.837 0.0 0.1214 - 17.840 -2.839 0.0 0.1215 - 17.850 -2.819 0.0 0.1216 - 17.860 -2.781 0.0 0.1215 - 17.870 -2.730 0.0 0.1214 - 17.880 -2.668 0.0 0.1213 - 17.890 -2.599 0.0 0.1211 - 17.900 -2.522 0.0 0.1210 - 17.910 -2.438 0.0 0.1211 - 17.920 -2.346 0.0 0.1212 - 17.930 -2.244 0.0 0.1213 - 17.940 -2.130 0.0 0.1214 - 17.950 -2.001 0.0 0.1215 - 17.960 -1.855 0.0 0.1215 - 17.970 -1.690 0.0 0.1214 - 17.980 -1.505 0.0 0.1213 - 17.990 -1.302 0.0 0.1211 - 18.000 -1.080 0.0 0.1211 - 18.010 -0.845 0.0 0.1211 - 18.020 -0.598 0.0 0.1212 - 18.030 -0.344 0.0 0.1213 - 18.040 -0.090 0.0 0.1215 - 18.050 0.161 0.0 0.1215 - 18.060 0.404 0.0 0.1215 - 18.070 0.635 0.0 0.1214 - 18.080 0.849 0.0 0.1212 - 18.090 1.047 0.0 0.1211 - 18.100 1.226 0.0 0.1211 - 18.110 1.387 0.0 0.1211 - 18.120 1.532 0.0 0.1212 - 18.130 1.662 0.0 0.1214 - 18.140 1.779 0.0 0.1215 - 18.150 1.887 0.0 0.1215 - 18.160 1.987 0.0 0.1214 - 18.170 2.081 0.0 0.1213 - 18.180 2.170 0.0 0.1212 - 18.190 2.251 0.0 0.1211 - 18.200 2.325 0.0 0.1211 - 18.210 2.388 0.0 0.1212 - 18.220 2.437 0.0 0.1213 - 18.230 2.467 0.0 0.1214 - 18.240 2.475 0.0 0.1214 - 18.250 2.457 0.0 0.1215 - 18.260 2.410 0.0 0.1214 - 18.270 2.332 0.0 0.1213 - 18.280 2.224 0.0 0.1212 - 18.290 2.086 0.0 0.1211 - 18.300 1.922 0.0 0.1211 - 18.310 1.736 0.0 0.1212 - 18.320 1.534 0.0 0.1213 - 18.330 1.324 0.0 0.1214 - 18.340 1.113 0.0 0.1215 - 18.350 0.909 0.0 0.1215 - 18.360 0.719 0.0 0.1214 - 18.370 0.550 0.0 0.1213 - 18.380 0.406 0.0 0.1212 - 18.390 0.291 0.0 0.1211 - 18.400 0.207 0.0 0.1211 - 18.410 0.153 0.0 0.1212 - 18.420 0.127 0.0 0.1213 - 18.430 0.126 0.0 0.1214 - 18.440 0.145 0.0 0.1215 - 18.450 0.180 0.0 0.1215 - 18.460 0.224 0.0 0.1214 - 18.470 0.273 0.0 0.1213 - 18.480 0.323 0.0 0.1212 - 18.490 0.370 0.0 0.1212 - 18.500 0.413 0.0 0.1212 - 18.510 0.452 0.0 0.1213 - 18.520 0.486 0.0 0.1214 - 18.530 0.519 0.0 0.1215 - 18.540 0.553 0.0 0.1215 - 18.550 0.592 0.0 0.1214 - 18.560 0.640 0.0 0.1213 - 18.570 0.700 0.0 0.1212 - 18.580 0.775 0.0 0.1212 - 18.590 0.866 0.0 0.1212 - 18.600 0.973 0.0 0.1212 - 18.610 1.097 0.0 0.1213 - 18.620 1.233 0.0 0.1214 - 18.630 1.379 0.0 0.1215 - 18.640 1.530 0.0 0.1215 - 18.650 1.681 0.0 0.1215 - 18.660 1.827 0.0 0.1213 - 18.670 1.963 0.0 0.1212 - 18.680 2.085 0.0 0.1212 - 18.690 2.188 0.0 0.1212 - 18.700 2.271 0.0 0.1212 - 18.710 2.333 0.0 0.1213 - 18.720 2.374 0.0 0.1215 - 18.730 2.396 0.0 0.1215 - 18.740 2.402 0.0 0.1215 - 18.750 2.394 0.0 0.1214 - 18.760 2.376 0.0 0.1213 - 18.770 2.351 0.0 0.1212 - 18.780 2.323 0.0 0.1211 - 18.790 2.292 0.0 0.1211 - 18.800 2.261 0.0 0.1212 - 18.810 2.228 0.0 0.1214 - 18.820 2.193 0.0 0.1215 - 18.830 2.154 0.0 0.1215 - 18.840 2.106 0.0 0.1215 - 18.850 2.047 0.0 0.1214 - 18.860 1.973 0.0 0.1213 - 18.870 1.880 0.0 0.1211 - 18.880 1.767 0.0 0.1211 - 18.890 1.631 0.0 0.1211 - 18.900 1.474 0.0 0.1212 - 18.910 1.296 0.0 0.1213 - 18.920 1.100 0.0 0.1214 - 18.930 0.892 0.0 0.1215 - 18.940 0.678 0.0 0.1215 - 18.950 0.462 0.0 0.1214 - 18.960 0.254 0.0 0.1213 - 18.970 0.060 0.0 0.1212 - 18.980 -0.114 0.0 0.1211 - 18.990 -0.262 0.0 0.1212 - 19.000 -0.380 0.0 0.1213 - 19.010 -0.465 0.0 0.1214 - 19.020 -0.517 0.0 0.1215 - 19.030 -0.536 0.0 0.1215 - 19.040 -0.526 0.0 0.1214 - 19.050 -0.490 0.0 0.1213 - 19.060 -0.434 0.0 0.1212 - 19.070 -0.363 0.0 0.1211 - 19.080 -0.284 0.0 0.1211 - 19.090 -0.203 0.0 0.1211 - 19.100 -0.125 0.0 0.1212 - 19.110 -0.055 0.0 0.1214 - 19.120 0.005 0.0 0.1215 - 19.130 0.054 0.0 0.1215 - 19.140 0.090 0.0 0.1214 - 19.150 0.114 0.0 0.1213 - 19.160 0.130 0.0 0.1212 - 19.170 0.139 0.0 0.1211 - 19.180 0.146 0.0 0.1211 - 19.190 0.152 0.0 0.1212 - 19.200 0.161 0.0 0.1213 - 19.210 0.175 0.0 0.1214 - 19.220 0.195 0.0 0.1215 - 19.230 0.221 0.0 0.1215 - 19.240 0.253 0.0 0.1214 - 19.250 0.287 0.0 0.1213 - 19.260 0.321 0.0 0.1212 - 19.270 0.351 0.0 0.1211 - 19.280 0.373 0.0 0.1211 - 19.290 0.383 0.0 0.1212 - 19.300 0.377 0.0 0.1213 - 19.310 0.354 0.0 0.1214 - 19.320 0.310 0.0 0.1215 - 19.330 0.245 0.0 0.1215 - 19.340 0.160 0.0 0.1214 - 19.350 0.057 0.0 0.1213 - 19.360 -0.060 0.0 0.1212 - 19.370 -0.187 0.0 0.1211 - 19.380 -0.320 0.0 0.1211 - 19.390 -0.453 0.0 0.1212 - 19.400 -0.580 0.0 0.1213 - 19.410 -0.696 0.0 0.1214 - 19.420 -0.798 0.0 0.1215 - 19.430 -0.880 0.0 0.1215 - 19.440 -0.942 0.0 0.1214 - 19.450 -0.981 0.0 0.1213 - 19.460 -0.999 0.0 0.1211 - 19.470 -0.996 0.0 0.1211 - 19.480 -0.976 0.0 0.1211 - 19.490 -0.941 0.0 0.1212 - 19.500 -0.896 0.0 0.1213 - 19.510 -0.845 0.0 0.1214 - 19.520 -0.793 0.0 0.1215 - 19.530 -0.743 0.0 0.1215 - 19.540 -0.699 0.0 0.1214 - 19.550 -0.664 0.0 0.1213 - 19.560 -0.641 0.0 0.1212 - 19.570 -0.631 0.0 0.1211 - 19.580 -0.634 0.0 0.1211 - 19.590 -0.650 0.0 0.1212 - 19.600 -0.678 0.0 0.1214 - 19.610 -0.718 0.0 0.1215 - 19.620 -0.767 0.0 0.1215 - 19.630 -0.825 0.0 0.1215 - 19.640 -0.888 0.0 0.1214 - 19.650 -0.957 0.0 0.1213 - 19.660 -1.028 0.0 0.1212 - 19.670 -1.102 0.0 0.1211 - 19.680 -1.176 0.0 0.1212 - 19.690 -1.250 0.0 0.1213 - 19.700 -1.323 0.0 0.1214 - 19.710 -1.395 0.0 0.1215 - 19.720 -1.463 0.0 0.1215 - 19.730 -1.529 0.0 0.1215 - 19.740 -1.589 0.0 0.1214 - 19.750 -1.643 0.0 0.1213 - 19.760 -1.690 0.0 0.1212 - 19.770 -1.727 0.0 0.1212 - 19.780 -1.754 0.0 0.1212 - 19.790 -1.767 0.0 0.1213 - 19.800 -1.767 0.0 0.1214 - 19.810 -1.751 0.0 0.1215 - 19.820 -1.720 0.0 0.1215 - 19.830 -1.672 0.0 0.1215 - 19.840 -1.609 0.0 0.1213 - 19.850 -1.530 0.0 0.1212 - 19.860 -1.438 0.0 0.1211 - 19.870 -1.334 0.0 0.1211 - 19.880 -1.219 0.0 0.1212 - 19.890 -1.097 0.0 0.1213 - 19.900 -0.969 0.0 0.1214 - 19.910 -0.837 0.0 0.1215 - 19.920 -0.703 0.0 0.1215 - 19.930 -0.568 0.0 0.1214 - 19.940 -0.432 0.0 0.1213 - 19.950 -0.298 0.0 0.1212 - 19.960 -0.163 0.0 0.1211 - 19.970 -0.028 0.0 0.1211 - 19.980 0.108 0.0 0.1212 - 19.990 0.245 0.0 0.1213 - 20.000 0.384 0.0 0.1214 diff --git a/diffpy/pdffit2/tests/testdata/Ni.dat b/diffpy/pdffit2/tests/testdata/Ni.dat deleted file mode 100644 index 360a4d6b..00000000 --- a/diffpy/pdffit2/tests/testdata/Ni.dat +++ /dev/null @@ -1,1001 +0,0 @@ - 1.50000 -0.539443 0.00000 1.00000 0.539443 - 1.51850 -1.03098 0.00000 1.00000 1.03098 - 1.53700 -1.43712 0.00000 1.00000 1.43712 - 1.55550 -1.73810 0.00000 1.00000 1.73810 - 1.57400 -1.93402 0.00000 1.00000 1.93402 - 1.59250 -2.04145 0.00000 1.00000 2.04145 - 1.61100 -2.08593 0.00000 1.00000 2.08593 - 1.62950 -2.09295 0.00000 1.00000 2.09295 - 1.64800 -2.08072 0.00000 1.00000 2.08072 - 1.66650 -2.05688 0.00000 1.00000 2.05688 - 1.68500 -2.02006 0.00000 1.00000 2.02006 - 1.70350 -1.96554 0.00000 1.00000 1.96554 - 1.72200 -1.89239 0.00000 1.00000 1.89239 - 1.74050 -1.80936 0.00000 1.00000 1.80936 - 1.75900 -1.73670 0.00000 1.00000 1.73670 - 1.77750 -1.70255 0.00000 1.00000 1.70255 - 1.79600 -1.73461 0.00000 1.00000 1.73461 - 1.81450 -1.84946 0.00000 1.00000 1.84946 - 1.83300 -2.04300 0.00000 1.00000 2.04300 - 1.85150 -2.28566 0.00000 1.00000 2.28566 - 1.87000 -2.52486 0.00000 1.00000 2.52486 - 1.88850 -2.69615 0.00000 1.00000 2.69615 - 1.90700 -2.74180 0.00000 1.00000 2.74180 - 1.92550 -2.63223 0.00000 1.00000 2.63223 - 1.94400 -2.38239 0.00000 1.00000 2.38239 - 1.96250 -2.05565 0.00000 1.00000 2.05565 - 1.98100 -1.75092 0.00000 1.00000 1.75092 - 1.99950 -1.57518 0.00000 1.00000 1.57518 - 2.01800 -1.60914 0.00000 1.00000 1.60914 - 2.03650 -1.87687 0.00000 1.00000 1.87687 - 2.05500 -2.33004 0.00000 1.00000 2.33004 - 2.07350 -2.85357 0.00000 1.00000 2.85357 - 2.09200 -3.29353 0.00000 1.00000 3.29353 - 2.11050 -3.50124 0.00000 1.00000 3.50124 - 2.12900 -3.38172 0.00000 1.00000 3.38172 - 2.14750 -2.93205 0.00000 1.00000 2.93205 - 2.16600 -2.25629 0.00000 1.00000 2.25629 - 2.18450 -1.54918 0.00000 1.00000 1.54918 - 2.20300 -1.04888 0.00000 1.00000 1.04888 - 2.22150 -0.968136 0.00000 1.00000 0.968136 - 2.24000 -1.42070 0.00000 1.00000 1.42070 - 2.25850 -2.36300 0.00000 1.00000 2.36300 - 2.27700 -3.56960 0.00000 1.00000 3.56960 - 2.29550 -4.65416 0.00000 1.00000 4.65416 - 2.31400 -5.13684 0.00000 1.00000 5.13684 - 2.33250 -4.54696 0.00000 1.00000 4.54696 - 2.35100 -2.53890 0.00000 1.00000 2.53890 - 2.36950 1.00656 0.00000 1.00000 -1.00656 - 2.38800 5.92223 0.00000 1.00000 -5.92223 - 2.40650 11.7527 0.00000 1.00000 -11.7527 - 2.42500 17.8143 0.00000 1.00000 -17.8143 - 2.44350 23.3057 0.00000 1.00000 -23.3057 - 2.46200 27.4478 0.00000 1.00000 -27.4478 - 2.48050 29.6246 0.00000 1.00000 -29.6246 - 2.49900 29.4986 0.00000 1.00000 -29.4986 - 2.51750 27.0749 0.00000 1.00000 -27.0749 - 2.53600 22.7028 0.00000 1.00000 -22.7028 - 2.55450 17.0112 0.00000 1.00000 -17.0112 - 2.57300 10.7932 0.00000 1.00000 -10.7932 - 2.59150 4.86134 0.00000 1.00000 -4.86134 - 2.61000 -0.0945224 0.00000 1.00000 0.0945224 - 2.62850 -3.61858 0.00000 1.00000 3.61858 - 2.64700 -5.54803 0.00000 1.00000 5.54803 - 2.66550 -6.01016 0.00000 1.00000 6.01016 - 2.68400 -5.36293 0.00000 1.00000 5.36293 - 2.70250 -4.09596 0.00000 1.00000 4.09596 - 2.72100 -2.71625 0.00000 1.00000 2.71625 - 2.73950 -1.64382 0.00000 1.00000 1.64382 - 2.75800 -1.13791 0.00000 1.00000 1.13791 - 2.77650 -1.26649 0.00000 1.00000 1.26649 - 2.79500 -1.92103 0.00000 1.00000 1.92103 - 2.81350 -2.86890 0.00000 1.00000 2.86890 - 2.83200 -3.82782 0.00000 1.00000 3.82782 - 2.85050 -4.54328 0.00000 1.00000 4.54328 - 2.86900 -4.85054 0.00000 1.00000 4.85054 - 2.88750 -4.70809 0.00000 1.00000 4.70809 - 2.90600 -4.19687 0.00000 1.00000 4.19687 - 2.92450 -3.48841 0.00000 1.00000 3.48841 - 2.94300 -2.79256 0.00000 1.00000 2.79256 - 2.96150 -2.29993 0.00000 1.00000 2.29993 - 2.98000 -2.13422 0.00000 1.00000 2.13422 - 2.99850 -2.32552 0.00000 1.00000 2.32552 - 3.01700 -2.80931 0.00000 1.00000 2.80931 - 3.03550 -3.44928 0.00000 1.00000 3.44928 - 3.05400 -4.07624 0.00000 1.00000 4.07624 - 3.07250 -4.53264 0.00000 1.00000 4.53264 - 3.09100 -4.71141 0.00000 1.00000 4.71141 - 3.10950 -4.58013 0.00000 1.00000 4.58013 - 3.12800 -4.18572 0.00000 1.00000 4.18572 - 3.14650 -3.63955 0.00000 1.00000 3.63955 - 3.16500 -3.08796 0.00000 1.00000 3.08796 - 3.18350 -2.67579 0.00000 1.00000 2.67579 - 3.20200 -2.51194 0.00000 1.00000 2.51194 - 3.22050 -2.64475 0.00000 1.00000 2.64475 - 3.23900 -3.05186 0.00000 1.00000 3.05186 - 3.25750 -3.64576 0.00000 1.00000 3.64576 - 3.27600 -4.29257 0.00000 1.00000 4.29257 - 3.29450 -4.83876 0.00000 1.00000 4.83876 - 3.31300 -5.14008 0.00000 1.00000 5.14008 - 3.33150 -5.08721 0.00000 1.00000 5.08721 - 3.35000 -4.62391 0.00000 1.00000 4.62391 - 3.36850 -3.75470 0.00000 1.00000 3.75470 - 3.38700 -2.54063 0.00000 1.00000 2.54063 - 3.40550 -1.08396 0.00000 1.00000 1.08396 - 3.42400 0.493223 0.00000 1.00000 -0.493223 - 3.44250 2.06874 0.00000 1.00000 -2.06874 - 3.46100 3.53152 0.00000 1.00000 -3.53152 - 3.47950 4.78254 0.00000 1.00000 -4.78254 - 3.49800 5.72969 0.00000 1.00000 -5.72969 - 3.51650 6.28423 0.00000 1.00000 -6.28423 - 3.53500 6.36504 0.00000 1.00000 -6.36504 - 3.55350 5.91247 0.00000 1.00000 -5.91247 - 3.57200 4.90861 0.00000 1.00000 -4.90861 - 3.59050 3.39740 0.00000 1.00000 -3.39740 - 3.60900 1.49612 0.00000 1.00000 -1.49612 - 3.62750 -0.608193 0.00000 1.00000 0.608193 - 3.64600 -2.68019 0.00000 1.00000 2.68019 - 3.66450 -4.47243 0.00000 1.00000 4.47243 - 3.68300 -5.76925 0.00000 1.00000 5.76925 - 3.70150 -6.42920 0.00000 1.00000 6.42920 - 3.72000 -6.41719 0.00000 1.00000 6.41719 - 3.73850 -5.81875 0.00000 1.00000 5.81875 - 3.75700 -4.83074 0.00000 1.00000 4.83074 - 3.77550 -3.72667 0.00000 1.00000 3.72667 - 3.79400 -2.80071 0.00000 1.00000 2.80071 - 3.81250 -2.30147 0.00000 1.00000 2.30147 - 3.83100 -2.37126 0.00000 1.00000 2.37126 - 3.84950 -3.00713 0.00000 1.00000 3.00713 - 3.86800 -4.05566 0.00000 1.00000 4.05566 - 3.88650 -5.24604 0.00000 1.00000 5.24604 - 3.90500 -6.25585 0.00000 1.00000 6.25585 - 3.92350 -6.79521 0.00000 1.00000 6.79521 - 3.94200 -6.68830 0.00000 1.00000 6.68830 - 3.96050 -5.93010 0.00000 1.00000 5.93010 - 3.97900 -4.70113 0.00000 1.00000 4.70113 - 3.99750 -3.33259 0.00000 1.00000 3.33259 - 4.01600 -2.22683 0.00000 1.00000 2.22683 - 4.03450 -1.75037 0.00000 1.00000 1.75037 - 4.05300 -2.12498 0.00000 1.00000 2.12498 - 4.07150 -3.34471 0.00000 1.00000 3.34471 - 4.09000 -5.14253 0.00000 1.00000 5.14253 - 4.10850 -7.01935 0.00000 1.00000 7.01935 - 4.12700 -8.33391 0.00000 1.00000 8.33391 - 4.14550 -8.43660 0.00000 1.00000 8.43660 - 4.16400 -6.81920 0.00000 1.00000 6.81920 - 4.18250 -3.24667 0.00000 1.00000 3.24667 - 4.20100 2.16009 0.00000 1.00000 -2.16009 - 4.21950 8.91152 0.00000 1.00000 -8.91152 - 4.23800 16.2134 0.00000 1.00000 -16.2134 - 4.25650 23.0973 0.00000 1.00000 -23.0973 - 4.27500 28.5935 0.00000 1.00000 -28.5935 - 4.29350 31.9106 0.00000 1.00000 -31.9106 - 4.31200 32.5842 0.00000 1.00000 -32.5842 - 4.33050 30.5617 0.00000 1.00000 -30.5617 - 4.34900 26.2027 0.00000 1.00000 -26.2027 - 4.36750 20.1990 0.00000 1.00000 -20.1990 - 4.38600 13.4320 0.00000 1.00000 -13.4320 - 4.40450 6.80337 0.00000 1.00000 -6.80337 - 4.42300 1.07527 0.00000 1.00000 -1.07527 - 4.44150 -3.24700 0.00000 1.00000 3.24700 - 4.46000 -5.96945 0.00000 1.00000 5.96945 - 4.47850 -7.19581 0.00000 1.00000 7.19581 - 4.49700 -7.25613 0.00000 1.00000 7.25613 - 4.51550 -6.59972 0.00000 1.00000 6.59972 - 4.53400 -5.68054 0.00000 1.00000 5.68054 - 4.55250 -4.86170 0.00000 1.00000 4.86170 - 4.57100 -4.35835 0.00000 1.00000 4.35835 - 4.58950 -4.22677 0.00000 1.00000 4.22677 - 4.60800 -4.39508 0.00000 1.00000 4.39508 - 4.62650 -4.72130 0.00000 1.00000 4.72130 - 4.64500 -5.05871 0.00000 1.00000 5.05871 - 4.66350 -5.30848 0.00000 1.00000 5.30848 - 4.68200 -5.44197 0.00000 1.00000 5.44197 - 4.70050 -5.50097 0.00000 1.00000 5.50097 - 4.71900 -5.56456 0.00000 1.00000 5.56456 - 4.73750 -5.69659 0.00000 1.00000 5.69659 - 4.75600 -5.90806 0.00000 1.00000 5.90806 - 4.77450 -6.13525 0.00000 1.00000 6.13525 - 4.79300 -6.24364 0.00000 1.00000 6.24364 - 4.81150 -6.05670 0.00000 1.00000 6.05670 - 4.83000 -5.40165 0.00000 1.00000 5.40165 - 4.84850 -4.16022 0.00000 1.00000 4.16022 - 4.86700 -2.31100 0.00000 1.00000 2.31100 - 4.88550 0.0479985 0.00000 1.00000 -0.0479985 - 4.90400 2.70271 0.00000 1.00000 -2.70271 - 4.92250 5.35252 0.00000 1.00000 -5.35252 - 4.94100 7.65960 0.00000 1.00000 -7.65960 - 4.95950 9.30734 0.00000 1.00000 -9.30734 - 4.97800 10.0558 0.00000 1.00000 -10.0558 - 4.99650 9.78268 0.00000 1.00000 -9.78268 - 5.01500 8.50309 0.00000 1.00000 -8.50309 - 5.03350 6.36470 0.00000 1.00000 -6.36470 - 5.05200 3.62252 0.00000 1.00000 -3.62252 - 5.07050 0.599290 0.00000 1.00000 -0.599290 - 5.08900 -2.36086 0.00000 1.00000 2.36086 - 5.10750 -4.93870 0.00000 1.00000 4.93870 - 5.12600 -6.88149 0.00000 1.00000 6.88149 - 5.14450 -8.03565 0.00000 1.00000 8.03565 - 5.16300 -8.36668 0.00000 1.00000 8.36668 - 5.18150 -7.96304 0.00000 1.00000 7.96304 - 5.20000 -7.02207 0.00000 1.00000 7.02207 - 5.21850 -5.81895 0.00000 1.00000 5.81895 - 5.23700 -4.66171 0.00000 1.00000 4.66171 - 5.25550 -3.83844 0.00000 1.00000 3.83844 - 5.27400 -3.56410 0.00000 1.00000 3.56410 - 5.29250 -3.93573 0.00000 1.00000 3.93573 - 5.31100 -4.90467 0.00000 1.00000 4.90467 - 5.32950 -6.27267 0.00000 1.00000 6.27267 - 5.34800 -7.71536 0.00000 1.00000 7.71536 - 5.36650 -8.83203 0.00000 1.00000 8.83203 - 5.38500 -9.21516 0.00000 1.00000 9.21516 - 5.40350 -8.52808 0.00000 1.00000 8.52808 - 5.42200 -6.57611 0.00000 1.00000 6.57611 - 5.44050 -3.35625 0.00000 1.00000 3.35625 - 5.45900 0.925287 0.00000 1.00000 -0.925287 - 5.47750 5.87209 0.00000 1.00000 -5.87209 - 5.49600 10.9500 0.00000 1.00000 -10.9500 - 5.51450 15.5640 0.00000 1.00000 -15.5640 - 5.53300 19.1477 0.00000 1.00000 -19.1477 - 5.55150 21.2490 0.00000 1.00000 -21.2490 - 5.57000 21.6003 0.00000 1.00000 -21.6003 - 5.58850 20.1588 0.00000 1.00000 -20.1588 - 5.60700 17.1124 0.00000 1.00000 -17.1124 - 5.62550 12.8494 0.00000 1.00000 -12.8494 - 5.64400 7.89927 0.00000 1.00000 -7.89927 - 5.66250 2.85190 0.00000 1.00000 -2.85190 - 5.68100 -1.72997 0.00000 1.00000 1.72997 - 5.69950 -5.39381 0.00000 1.00000 5.39381 - 5.71800 -7.86162 0.00000 1.00000 7.86162 - 5.73650 -9.06420 0.00000 1.00000 9.06420 - 5.75500 -9.13837 0.00000 1.00000 9.13837 - 5.77350 -8.38683 0.00000 1.00000 8.38683 - 5.79200 -7.20818 0.00000 1.00000 7.20818 - 5.81050 -6.01172 0.00000 1.00000 6.01172 - 5.82900 -5.13567 0.00000 1.00000 5.13567 - 5.84750 -4.78662 0.00000 1.00000 4.78662 - 5.86600 -5.01125 0.00000 1.00000 5.01125 - 5.88450 -5.70222 0.00000 1.00000 5.70222 - 5.90300 -6.63275 0.00000 1.00000 6.63275 - 5.92150 -7.51031 0.00000 1.00000 7.51031 - 5.94000 -8.03914 0.00000 1.00000 8.03914 - 5.95850 -7.98163 0.00000 1.00000 7.98163 - 5.97700 -7.20897 0.00000 1.00000 7.20897 - 5.99550 -5.73309 0.00000 1.00000 5.73309 - 6.01400 -3.71335 0.00000 1.00000 3.71335 - 6.03250 -1.43572 0.00000 1.00000 1.43572 - 6.05100 0.734316 0.00000 1.00000 -0.734316 - 6.06950 2.41816 0.00000 1.00000 -2.41816 - 6.08800 3.29880 0.00000 1.00000 -3.29880 - 6.10650 3.18922 0.00000 1.00000 -3.18922 - 6.12500 2.07961 0.00000 1.00000 -2.07961 - 6.14350 0.150522 0.00000 1.00000 -0.150522 - 6.16200 -2.25436 0.00000 1.00000 2.25436 - 6.18050 -4.69426 0.00000 1.00000 4.69426 - 6.19900 -6.72460 0.00000 1.00000 6.72460 - 6.21750 -7.99834 0.00000 1.00000 7.99834 - 6.23600 -8.35142 0.00000 1.00000 8.35142 - 6.25450 -7.84948 0.00000 1.00000 7.84948 - 6.27300 -6.78013 0.00000 1.00000 6.78013 - 6.29150 -5.58671 0.00000 1.00000 5.58671 - 6.31000 -4.75441 0.00000 1.00000 4.75441 - 6.32850 -4.67266 0.00000 1.00000 4.67266 - 6.34700 -5.50714 0.00000 1.00000 5.50714 - 6.36550 -7.11590 0.00000 1.00000 7.11590 - 6.38400 -9.03699 0.00000 1.00000 9.03699 - 6.40250 -10.5592 0.00000 1.00000 10.5592 - 6.42100 -10.8676 0.00000 1.00000 10.8676 - 6.43950 -9.23379 0.00000 1.00000 9.23379 - 6.45800 -5.20861 0.00000 1.00000 5.20861 - 6.47650 1.23011 0.00000 1.00000 -1.23011 - 6.49500 9.61241 0.00000 1.00000 -9.61241 - 6.51350 19.0142 0.00000 1.00000 -19.0142 - 6.53200 28.1967 0.00000 1.00000 -28.1967 - 6.55050 35.8243 0.00000 1.00000 -35.8243 - 6.56900 40.7166 0.00000 1.00000 -40.7166 - 6.58750 42.0833 0.00000 1.00000 -42.0833 - 6.60600 39.6873 0.00000 1.00000 -39.6873 - 6.62450 33.8989 0.00000 1.00000 -33.8989 - 6.64300 25.6256 0.00000 1.00000 -25.6256 - 6.66150 16.1324 0.00000 1.00000 -16.1324 - 6.68000 6.79125 0.00000 1.00000 -6.79125 - 6.69850 -1.18411 0.00000 1.00000 1.18411 - 6.71700 -6.95910 0.00000 1.00000 6.95910 - 6.73550 -10.2079 0.00000 1.00000 10.2079 - 6.75400 -11.1248 0.00000 1.00000 11.1248 - 6.77250 -10.3198 0.00000 1.00000 10.3198 - 6.79100 -8.62815 0.00000 1.00000 8.62815 - 6.80950 -6.88571 0.00000 1.00000 6.88571 - 6.82800 -5.72660 0.00000 1.00000 5.72660 - 6.84650 -5.45332 0.00000 1.00000 5.45332 - 6.86500 -6.00649 0.00000 1.00000 6.00649 - 6.88350 -7.03437 0.00000 1.00000 7.03437 - 6.90200 -8.03570 0.00000 1.00000 8.03570 - 6.92050 -8.53209 0.00000 1.00000 8.53209 - 6.93900 -8.22002 0.00000 1.00000 8.22002 - 6.95750 -7.06140 0.00000 1.00000 7.06140 - 6.97600 -5.29017 0.00000 1.00000 5.29017 - 6.99450 -3.33754 0.00000 1.00000 3.33754 - 7.01300 -1.70148 0.00000 1.00000 1.70148 - 7.03150 -0.800760 0.00000 1.00000 0.800760 - 7.05000 -0.856664 0.00000 1.00000 0.856664 - 7.06850 -1.83505 0.00000 1.00000 1.83505 - 7.08700 -3.46358 0.00000 1.00000 3.46358 - 7.10550 -5.31731 0.00000 1.00000 5.31731 - 7.12400 -6.94715 0.00000 1.00000 6.94715 - 7.14250 -8.01332 0.00000 1.00000 8.01332 - 7.16100 -8.38320 0.00000 1.00000 8.38320 - 7.17950 -8.16268 0.00000 1.00000 8.16268 - 7.19800 -7.64952 0.00000 1.00000 7.64952 - 7.21650 -7.22129 0.00000 1.00000 7.22129 - 7.23500 -7.19206 0.00000 1.00000 7.19206 - 7.25350 -7.68220 0.00000 1.00000 7.68220 - 7.27200 -8.54371 0.00000 1.00000 8.54371 - 7.29050 -9.36819 0.00000 1.00000 9.36819 - 7.30900 -9.58072 0.00000 1.00000 9.58072 - 7.32750 -8.59790 0.00000 1.00000 8.59790 - 7.34600 -6.00785 0.00000 1.00000 6.00785 - 7.36450 -1.72106 0.00000 1.00000 1.72106 - 7.38300 3.95269 0.00000 1.00000 -3.95269 - 7.40150 10.3276 0.00000 1.00000 -10.3276 - 7.42000 16.4640 0.00000 1.00000 -16.4640 - 7.43850 21.3618 0.00000 1.00000 -21.3618 - 7.45700 24.1782 0.00000 1.00000 -24.1782 - 7.47550 24.4162 0.00000 1.00000 -24.4162 - 7.49400 22.0356 0.00000 1.00000 -22.0356 - 7.51250 17.4573 0.00000 1.00000 -17.4573 - 7.53100 11.4623 0.00000 1.00000 -11.4623 - 7.54950 5.01118 0.00000 1.00000 -5.01118 - 7.56800 -0.965076 0.00000 1.00000 0.965076 - 7.58650 -5.75153 0.00000 1.00000 5.75153 - 7.60500 -8.96799 0.00000 1.00000 8.96799 - 7.62350 -10.5969 0.00000 1.00000 10.5969 - 7.64200 -10.9206 0.00000 1.00000 10.9206 - 7.66050 -10.3893 0.00000 1.00000 10.3893 - 7.67900 -9.46200 0.00000 1.00000 9.46200 - 7.69750 -8.46444 0.00000 1.00000 8.46444 - 7.71600 -7.50854 0.00000 1.00000 7.50854 - 7.73450 -6.49304 0.00000 1.00000 6.49304 - 7.75300 -5.18168 0.00000 1.00000 5.18168 - 7.77150 -3.32911 0.00000 1.00000 3.32911 - 7.79000 -0.811546 0.00000 1.00000 0.811546 - 7.80850 2.28073 0.00000 1.00000 -2.28073 - 7.82700 5.61902 0.00000 1.00000 -5.61902 - 7.84550 8.68909 0.00000 1.00000 -8.68909 - 7.86400 10.9073 0.00000 1.00000 -10.9073 - 7.88250 11.7676 0.00000 1.00000 -11.7676 - 7.90100 10.9777 0.00000 1.00000 -10.9777 - 7.91950 8.54633 0.00000 1.00000 -8.54633 - 7.93800 4.79627 0.00000 1.00000 -4.79627 - 7.95650 0.300695 0.00000 1.00000 -0.300695 - 7.97500 -4.24152 0.00000 1.00000 4.24152 - 7.99350 -8.15787 0.00000 1.00000 8.15787 - 8.01200 -10.9420 0.00000 1.00000 10.9420 - 8.03050 -12.3456 0.00000 1.00000 12.3456 - 8.04900 -12.4001 0.00000 1.00000 12.4001 - 8.06750 -11.3663 0.00000 1.00000 11.3663 - 8.08600 -9.63181 0.00000 1.00000 9.63181 - 8.10450 -7.58723 0.00000 1.00000 7.58723 - 8.12300 -5.52117 0.00000 1.00000 5.52117 - 8.14150 -3.56353 0.00000 1.00000 3.56353 - 8.16000 -1.69260 0.00000 1.00000 1.69260 - 8.17850 0.199827 0.00000 1.00000 -0.199827 - 8.19700 2.21044 0.00000 1.00000 -2.21044 - 8.21550 4.33057 0.00000 1.00000 -4.33057 - 8.23400 6.39218 0.00000 1.00000 -6.39218 - 8.25250 8.07555 0.00000 1.00000 -8.07555 - 8.27100 8.97896 0.00000 1.00000 -8.97896 - 8.28950 8.73073 0.00000 1.00000 -8.73073 - 8.30800 7.11016 0.00000 1.00000 -7.11016 - 8.32650 4.14151 0.00000 1.00000 -4.14151 - 8.34500 0.130936 0.00000 1.00000 -0.130936 - 8.36350 -4.36837 0.00000 1.00000 4.36837 - 8.38200 -8.65854 0.00000 1.00000 8.65854 - 8.40050 -12.0433 0.00000 1.00000 12.0433 - 8.41900 -13.9807 0.00000 1.00000 13.9807 - 8.43750 -14.2030 0.00000 1.00000 14.2030 - 8.45600 -12.7704 0.00000 1.00000 12.7704 - 8.47450 -10.0445 0.00000 1.00000 10.0445 - 8.49300 -6.58938 0.00000 1.00000 6.58938 - 8.51150 -3.02663 0.00000 1.00000 3.02663 - 8.53000 0.112114 0.00000 1.00000 -0.112114 - 8.54850 2.49566 0.00000 1.00000 -2.49566 - 8.56700 4.03580 0.00000 1.00000 -4.03580 - 8.58550 4.85377 0.00000 1.00000 -4.85377 - 8.60400 5.18537 0.00000 1.00000 -5.18537 - 8.62250 5.25808 0.00000 1.00000 -5.25808 - 8.64100 5.18193 0.00000 1.00000 -5.18193 - 8.65950 4.89182 0.00000 1.00000 -4.89182 - 8.67800 4.16349 0.00000 1.00000 -4.16349 - 8.69650 2.70252 0.00000 1.00000 -2.70252 - 8.71500 0.282220 0.00000 1.00000 -0.282220 - 8.73350 -3.11124 0.00000 1.00000 3.11124 - 8.75200 -7.17490 0.00000 1.00000 7.17490 - 8.77050 -11.2672 0.00000 1.00000 11.2672 - 8.78900 -14.4886 0.00000 1.00000 14.4886 - 8.80750 -15.8559 0.00000 1.00000 15.8559 - 8.82600 -14.5328 0.00000 1.00000 14.5328 - 8.84450 -10.0609 0.00000 1.00000 10.0609 - 8.86300 -2.52773 0.00000 1.00000 2.52773 - 8.88150 7.37428 0.00000 1.00000 -7.37428 - 8.90000 18.4240 0.00000 1.00000 -18.4240 - 8.91850 29.0726 0.00000 1.00000 -29.0726 - 8.93700 37.7295 0.00000 1.00000 -37.7295 - 8.95550 43.0717 0.00000 1.00000 -43.0717 - 8.97400 44.3044 0.00000 1.00000 -44.3044 - 8.99250 41.3154 0.00000 1.00000 -41.3154 - 9.01100 34.6857 0.00000 1.00000 -34.6857 - 9.02950 25.5570 0.00000 1.00000 -25.5570 - 9.04800 15.3859 0.00000 1.00000 -15.3859 - 9.06650 5.64529 0.00000 1.00000 -5.64529 - 9.08500 -2.45985 0.00000 1.00000 2.45985 - 9.10350 -8.19758 0.00000 1.00000 8.19758 - 9.12200 -11.3936 0.00000 1.00000 11.3936 - 9.14050 -12.3840 0.00000 1.00000 12.3840 - 9.15900 -11.8591 0.00000 1.00000 11.8591 - 9.17750 -10.6446 0.00000 1.00000 10.6446 - 9.19600 -9.48212 0.00000 1.00000 9.48212 - 9.21450 -8.86286 0.00000 1.00000 8.86286 - 9.23300 -8.95166 0.00000 1.00000 8.95166 - 9.25150 -9.60978 0.00000 1.00000 9.60978 - 9.27000 -10.4985 0.00000 1.00000 10.4985 - 9.28850 -11.2264 0.00000 1.00000 11.2264 - 9.30700 -11.4956 0.00000 1.00000 11.4956 - 9.32550 -11.2056 0.00000 1.00000 11.2056 - 9.34400 -10.4851 0.00000 1.00000 10.4851 - 9.36250 -9.64367 0.00000 1.00000 9.64367 - 9.38100 -9.05839 0.00000 1.00000 9.05839 - 9.39950 -9.03059 0.00000 1.00000 9.03059 - 9.41800 -9.65891 0.00000 1.00000 9.65891 - 9.43650 -10.7695 0.00000 1.00000 10.7695 - 9.45500 -11.9282 0.00000 1.00000 11.9282 - 9.47350 -12.5352 0.00000 1.00000 12.5352 - 9.49200 -11.9793 0.00000 1.00000 11.9793 - 9.51050 -9.80968 0.00000 1.00000 9.80968 - 9.52900 -5.88098 0.00000 1.00000 5.88098 - 9.54750 -0.429865 0.00000 1.00000 0.429865 - 9.56600 5.93738 0.00000 1.00000 -5.93738 - 9.58450 12.3467 0.00000 1.00000 -12.3467 - 9.60300 17.8253 0.00000 1.00000 -17.8253 - 9.62150 21.4983 0.00000 1.00000 -21.4983 - 9.64000 22.7684 0.00000 1.00000 -22.7684 - 9.65850 21.4353 0.00000 1.00000 -21.4353 - 9.67700 17.7297 0.00000 1.00000 -17.7297 - 9.69550 12.2556 0.00000 1.00000 -12.2556 - 9.71400 5.85940 0.00000 1.00000 -5.85940 - 9.73250 -0.539853 0.00000 1.00000 0.539853 - 9.75100 -6.11696 0.00000 1.00000 6.11696 - 9.76950 -10.2704 0.00000 1.00000 10.2704 - 9.78800 -12.6954 0.00000 1.00000 12.6954 - 9.80650 -13.3941 0.00000 1.00000 13.3941 - 9.82500 -12.6315 0.00000 1.00000 12.6315 - 9.84350 -10.8487 0.00000 1.00000 10.8487 - 9.86200 -8.55755 0.00000 1.00000 8.55755 - 9.88050 -6.24003 0.00000 1.00000 6.24003 - 9.89900 -4.27478 0.00000 1.00000 4.27478 - 9.91750 -2.90328 0.00000 1.00000 2.90328 - 9.93600 -2.23386 0.00000 1.00000 2.23386 - 9.95450 -2.27104 0.00000 1.00000 2.27104 - 9.97300 -2.95175 0.00000 1.00000 2.95175 - 9.99150 -4.17209 0.00000 1.00000 4.17209 - 10.0100 -5.79607 0.00000 1.00000 5.79607 - 10.0285 -7.64859 0.00000 1.00000 7.64859 - 10.0470 -9.50283 0.00000 1.00000 9.50283 - 10.0655 -11.0757 0.00000 1.00000 11.0757 - 10.0840 -12.0425 0.00000 1.00000 12.0425 - 10.1025 -12.0751 0.00000 1.00000 12.0751 - 10.1210 -10.9017 0.00000 1.00000 10.9017 - 10.1395 -8.37613 0.00000 1.00000 8.37613 - 10.1580 -4.54026 0.00000 1.00000 4.54026 - 10.1765 0.338357 0.00000 1.00000 -0.338357 - 10.1950 5.76996 0.00000 1.00000 -5.76996 - 10.2135 11.0939 0.00000 1.00000 -11.0939 - 10.2320 15.5741 0.00000 1.00000 -15.5741 - 10.2505 18.5225 0.00000 1.00000 -18.5225 - 10.2690 19.4270 0.00000 1.00000 -19.4270 - 10.2875 18.0567 0.00000 1.00000 -18.0567 - 10.3060 14.5227 0.00000 1.00000 -14.5227 - 10.3245 9.27796 0.00000 1.00000 -9.27796 - 10.3430 3.05599 0.00000 1.00000 -3.05599 - 10.3615 -3.24345 0.00000 1.00000 3.24345 - 10.3800 -8.70145 0.00000 1.00000 8.70145 - 10.3985 -12.5330 0.00000 1.00000 12.5330 - 10.4170 -14.2182 0.00000 1.00000 14.2182 - 10.4355 -13.5885 0.00000 1.00000 13.5885 - 10.4540 -10.8525 0.00000 1.00000 10.8525 - 10.4725 -6.55772 0.00000 1.00000 6.55772 - 10.4910 -1.49640 0.00000 1.00000 1.49640 - 10.5095 3.42852 0.00000 1.00000 -3.42852 - 10.5280 7.35363 0.00000 1.00000 -7.35363 - 10.5465 9.59717 0.00000 1.00000 -9.59717 - 10.5650 9.77054 0.00000 1.00000 -9.77054 - 10.5835 7.84234 0.00000 1.00000 -7.84234 - 10.6020 4.14584 0.00000 1.00000 -4.14584 - 10.6205 -0.671143 0.00000 1.00000 0.671143 - 10.6390 -5.74603 0.00000 1.00000 5.74603 - 10.6575 -10.1361 0.00000 1.00000 10.1361 - 10.6760 -12.9671 0.00000 1.00000 12.9671 - 10.6945 -13.5738 0.00000 1.00000 13.5738 - 10.7130 -11.6108 0.00000 1.00000 11.6108 - 10.7315 -7.11852 0.00000 1.00000 7.11852 - 10.7500 -0.532582 0.00000 1.00000 0.532582 - 10.7685 7.36496 0.00000 1.00000 -7.36496 - 10.7870 15.5502 0.00000 1.00000 -15.5502 - 10.8055 22.9046 0.00000 1.00000 -22.9046 - 10.8240 28.3836 0.00000 1.00000 -28.3836 - 10.8425 31.1819 0.00000 1.00000 -31.1819 - 10.8610 30.8667 0.00000 1.00000 -30.8667 - 10.8795 27.4544 0.00000 1.00000 -27.4544 - 10.8980 21.4174 0.00000 1.00000 -21.4174 - 10.9165 13.6149 0.00000 1.00000 -13.6149 - 10.9350 5.15717 0.00000 1.00000 -5.15717 - 10.9535 -2.77403 0.00000 1.00000 2.77403 - 10.9720 -9.11963 0.00000 1.00000 9.11963 - 10.9905 -13.1166 0.00000 1.00000 13.1166 - 11.0090 -14.4189 0.00000 1.00000 14.4189 - 11.0275 -13.1446 0.00000 1.00000 13.1446 - 11.0460 -9.84069 0.00000 1.00000 9.84069 - 11.0645 -5.37361 0.00000 1.00000 5.37361 - 11.0830 -0.766336 0.00000 1.00000 0.766336 - 11.1015 2.99059 0.00000 1.00000 -2.99059 - 11.1200 5.12102 0.00000 1.00000 -5.12102 - 11.1385 5.20555 0.00000 1.00000 -5.20555 - 11.1570 3.25580 0.00000 1.00000 -3.25580 - 11.1755 -0.295787 0.00000 1.00000 0.295787 - 11.1940 -4.68917 0.00000 1.00000 4.68917 - 11.2125 -8.99252 0.00000 1.00000 8.99252 - 11.2310 -12.2872 0.00000 1.00000 12.2872 - 11.2495 -13.8447 0.00000 1.00000 13.8447 - 11.2680 -13.2610 0.00000 1.00000 13.2610 - 11.2865 -10.5280 0.00000 1.00000 10.5280 - 11.3050 -6.02790 0.00000 1.00000 6.02790 - 11.3235 -0.457428 0.00000 1.00000 0.457428 - 11.3420 5.30272 0.00000 1.00000 -5.30272 - 11.3605 10.3468 0.00000 1.00000 -10.3468 - 11.3790 13.9003 0.00000 1.00000 -13.9003 - 11.3975 15.4459 0.00000 1.00000 -15.4459 - 11.4160 14.7993 0.00000 1.00000 -14.7993 - 11.4345 12.1251 0.00000 1.00000 -12.1251 - 11.4530 7.89515 0.00000 1.00000 -7.89515 - 11.4715 2.79743 0.00000 1.00000 -2.79743 - 11.4900 -2.38402 0.00000 1.00000 2.38402 - 11.5085 -6.89848 0.00000 1.00000 6.89848 - 11.5270 -10.1446 0.00000 1.00000 10.1446 - 11.5455 -11.7562 0.00000 1.00000 11.7562 - 11.5640 -11.6477 0.00000 1.00000 11.6477 - 11.5825 -10.0156 0.00000 1.00000 10.0156 - 11.6010 -7.29778 0.00000 1.00000 7.29778 - 11.6195 -4.09885 0.00000 1.00000 4.09885 - 11.6380 -1.08810 0.00000 1.00000 1.08810 - 11.6565 1.11439 0.00000 1.00000 -1.11439 - 11.6750 2.04788 0.00000 1.00000 -2.04788 - 11.6935 1.49867 0.00000 1.00000 -1.49867 - 11.7120 -0.451611 0.00000 1.00000 0.451611 - 11.7305 -3.42848 0.00000 1.00000 3.42848 - 11.7490 -6.82125 0.00000 1.00000 6.82125 - 11.7675 -9.88740 0.00000 1.00000 9.88740 - 11.7860 -11.8896 0.00000 1.00000 11.8896 - 11.8045 -12.2430 0.00000 1.00000 12.2430 - 11.8230 -10.6446 0.00000 1.00000 10.6446 - 11.8415 -7.15722 0.00000 1.00000 7.15722 - 11.8600 -2.22583 0.00000 1.00000 2.22583 - 11.8785 3.38458 0.00000 1.00000 -3.38458 - 11.8970 8.72108 0.00000 1.00000 -8.72108 - 11.9155 12.8213 0.00000 1.00000 -12.8213 - 11.9340 14.9032 0.00000 1.00000 -14.9032 - 11.9525 14.5281 0.00000 1.00000 -14.5281 - 11.9710 11.6999 0.00000 1.00000 -11.6999 - 11.9895 6.87776 0.00000 1.00000 -6.87776 - 12.0080 0.891504 0.00000 1.00000 -0.891504 - 12.0265 -5.22565 0.00000 1.00000 5.22565 - 12.0450 -10.4522 0.00000 1.00000 10.4522 - 12.0635 -13.9931 0.00000 1.00000 13.9931 - 12.0820 -15.4435 0.00000 1.00000 15.4435 - 12.1005 -14.8644 0.00000 1.00000 14.8644 - 12.1190 -12.7520 0.00000 1.00000 12.7520 - 12.1375 -9.90845 0.00000 1.00000 9.90845 - 12.1560 -7.24453 0.00000 1.00000 7.24453 - 12.1745 -5.56166 0.00000 1.00000 5.56166 - 12.1930 -5.36161 0.00000 1.00000 5.36161 - 12.2115 -6.72586 0.00000 1.00000 6.72586 - 12.2300 -9.28835 0.00000 1.00000 9.28835 - 12.2485 -12.3067 0.00000 1.00000 12.3067 - 12.2670 -14.8178 0.00000 1.00000 14.8178 - 12.2855 -15.8476 0.00000 1.00000 15.8476 - 12.3040 -14.6332 0.00000 1.00000 14.6332 - 12.3225 -10.8097 0.00000 1.00000 10.8097 - 12.3410 -4.52145 0.00000 1.00000 4.52145 - 12.3595 3.57058 0.00000 1.00000 -3.57058 - 12.3780 12.3893 0.00000 1.00000 -12.3893 - 12.3965 20.6314 0.00000 1.00000 -20.6314 - 12.4150 27.0092 0.00000 1.00000 -27.0092 - 12.4335 30.4959 0.00000 1.00000 -30.4959 - 12.4520 30.5247 0.00000 1.00000 -30.5247 - 12.4705 27.1034 0.00000 1.00000 -27.1034 - 12.4890 20.8197 0.00000 1.00000 -20.8197 - 12.5075 12.7348 0.00000 1.00000 -12.7348 - 12.5260 4.18409 0.00000 1.00000 -4.18409 - 12.5445 -3.47600 0.00000 1.00000 3.47600 - 12.5630 -9.12640 0.00000 1.00000 9.12640 - 12.5815 -12.0958 0.00000 1.00000 12.0958 - 12.6000 -12.2803 0.00000 1.00000 12.2803 - 12.6185 -10.1467 0.00000 1.00000 10.1467 - 12.6370 -6.61573 0.00000 1.00000 6.61573 - 12.6555 -2.84816 0.00000 1.00000 2.84816 - 12.6740 0.0234471 0.00000 1.00000 -0.0234471 - 12.6925 1.16051 0.00000 1.00000 -1.16051 - 12.7110 0.222329 0.00000 1.00000 -0.222329 - 12.7295 -2.53923 0.00000 1.00000 2.53923 - 12.7480 -6.31966 0.00000 1.00000 6.31966 - 12.7665 -9.93250 0.00000 1.00000 9.93250 - 12.7850 -12.0782 0.00000 1.00000 12.0782 - 12.8035 -11.6556 0.00000 1.00000 11.6556 - 12.8220 -8.04822 0.00000 1.00000 8.04822 - 12.8405 -1.31753 0.00000 1.00000 1.31753 - 12.8590 7.74657 0.00000 1.00000 -7.74657 - 12.8775 17.7420 0.00000 1.00000 -17.7420 - 12.8960 26.9214 0.00000 1.00000 -26.9214 - 12.9145 33.5578 0.00000 1.00000 -33.5578 - 12.9330 36.3277 0.00000 1.00000 -36.3277 - 12.9515 34.6234 0.00000 1.00000 -34.6234 - 12.9700 28.7156 0.00000 1.00000 -28.7156 - 12.9885 19.7233 0.00000 1.00000 -19.7233 - 13.0070 9.38804 0.00000 1.00000 -9.38804 - 13.0255 -0.297908 0.00000 1.00000 0.297908 - 13.0440 -7.52791 0.00000 1.00000 7.52791 - 13.0625 -11.0794 0.00000 1.00000 11.0794 - 13.0810 -10.5807 0.00000 1.00000 10.5807 - 13.0995 -6.58087 0.00000 1.00000 6.58087 - 13.1180 -0.404585 0.00000 1.00000 0.404585 - 13.1365 6.17556 0.00000 1.00000 -6.17556 - 13.1550 11.3708 0.00000 1.00000 -11.3708 - 13.1735 13.8053 0.00000 1.00000 -13.8053 - 13.1920 12.8357 0.00000 1.00000 -12.8357 - 13.2105 8.68336 0.00000 1.00000 -8.68336 - 13.2290 2.34908 0.00000 1.00000 -2.34908 - 13.2475 -4.66287 0.00000 1.00000 4.66287 - 13.2660 -10.7379 0.00000 1.00000 10.7379 - 13.2845 -14.5602 0.00000 1.00000 14.5602 - 13.3030 -15.4343 0.00000 1.00000 15.4343 - 13.3215 -13.4393 0.00000 1.00000 13.4393 - 13.3400 -9.37967 0.00000 1.00000 9.37967 - 13.3585 -4.55053 0.00000 1.00000 4.55053 - 13.3770 -0.382431 0.00000 1.00000 0.382431 - 13.3955 1.93839 0.00000 1.00000 -1.93839 - 13.4140 1.77366 0.00000 1.00000 -1.77366 - 13.4325 -0.818874 0.00000 1.00000 0.818874 - 13.4510 -5.13072 0.00000 1.00000 5.13072 - 13.4695 -10.0255 0.00000 1.00000 10.0255 - 13.4880 -14.2744 0.00000 1.00000 14.2744 - 13.5065 -16.9060 0.00000 1.00000 16.9060 - 13.5250 -17.4714 0.00000 1.00000 17.4714 - 13.5435 -16.1512 0.00000 1.00000 16.1512 - 13.5620 -13.6784 0.00000 1.00000 13.6784 - 13.5805 -11.1043 0.00000 1.00000 11.1043 - 13.5990 -9.47288 0.00000 1.00000 9.47288 - 13.6175 -9.49567 0.00000 1.00000 9.49567 - 13.6360 -11.3153 0.00000 1.00000 11.3153 - 13.6545 -14.4268 0.00000 1.00000 14.4268 - 13.6730 -17.7824 0.00000 1.00000 17.7824 - 13.6915 -20.0552 0.00000 1.00000 20.0552 - 13.7100 -19.9965 0.00000 1.00000 19.9965 - 13.7285 -16.7898 0.00000 1.00000 16.7898 - 13.7470 -10.3089 0.00000 1.00000 10.3089 - 13.7655 -1.20781 0.00000 1.00000 1.20781 - 13.7840 9.18567 0.00000 1.00000 -9.18567 - 13.8025 19.1488 0.00000 1.00000 -19.1488 - 13.8210 26.9489 0.00000 1.00000 -26.9489 - 13.8395 31.2366 0.00000 1.00000 -31.2366 - 13.8580 31.3496 0.00000 1.00000 -31.3496 - 13.8765 27.4511 0.00000 1.00000 -27.4511 - 13.8950 20.4697 0.00000 1.00000 -20.4697 - 13.9135 11.8582 0.00000 1.00000 -11.8582 - 13.9320 3.23523 0.00000 1.00000 -3.23523 - 13.9505 -3.99882 0.00000 1.00000 3.99882 - 13.9690 -8.96984 0.00000 1.00000 8.96984 - 13.9875 -11.4848 0.00000 1.00000 11.4848 - 14.0060 -11.9967 0.00000 1.00000 11.9967 - 14.0245 -11.3970 0.00000 1.00000 11.3970 - 14.0430 -10.7008 0.00000 1.00000 10.7008 - 14.0615 -10.7168 0.00000 1.00000 10.7168 - 14.0800 -11.7936 0.00000 1.00000 11.7936 - 14.0985 -13.7115 0.00000 1.00000 13.7115 - 14.1170 -15.7457 0.00000 1.00000 15.7457 - 14.1355 -16.8835 0.00000 1.00000 16.8835 - 14.1540 -16.1342 0.00000 1.00000 16.1342 - 14.1725 -12.8466 0.00000 1.00000 12.8466 - 14.1910 -6.94542 0.00000 1.00000 6.94542 - 14.2095 0.982134 0.00000 1.00000 -0.982134 - 14.2280 9.77953 0.00000 1.00000 -9.77953 - 14.2465 17.9729 0.00000 1.00000 -17.9729 - 14.2650 24.1178 0.00000 1.00000 -24.1178 - 14.2835 27.1485 0.00000 1.00000 -27.1485 - 14.3020 26.6355 0.00000 1.00000 -26.6355 - 14.3205 22.8839 0.00000 1.00000 -22.8839 - 14.3390 16.8479 0.00000 1.00000 -16.8479 - 14.3575 9.88786 0.00000 1.00000 -9.88786 - 14.3760 3.43554 0.00000 1.00000 -3.43554 - 14.3945 -1.34253 0.00000 1.00000 1.34253 - 14.4130 -3.79922 0.00000 1.00000 3.79922 - 14.4315 -3.91650 0.00000 1.00000 3.91650 - 14.4500 -2.25034 0.00000 1.00000 2.25034 - 14.4685 0.265934 0.00000 1.00000 -0.265934 - 14.4870 2.60091 0.00000 1.00000 -2.60091 - 14.5055 3.90902 0.00000 1.00000 -3.90902 - 14.5240 3.74411 0.00000 1.00000 -3.74411 - 14.5425 2.15013 0.00000 1.00000 -2.15013 - 14.5610 -0.388481 0.00000 1.00000 0.388481 - 14.5795 -3.11515 0.00000 1.00000 3.11515 - 14.5980 -5.23631 0.00000 1.00000 5.23631 - 14.6165 -6.15513 0.00000 1.00000 6.15513 - 14.6350 -5.63898 0.00000 1.00000 5.63898 - 14.6535 -3.87566 0.00000 1.00000 3.87566 - 14.6720 -1.40645 0.00000 1.00000 1.40645 - 14.6905 1.04029 0.00000 1.00000 -1.04029 - 14.7090 2.76304 0.00000 1.00000 -2.76304 - 14.7275 3.28473 0.00000 1.00000 -3.28473 - 14.7460 2.47788 0.00000 1.00000 -2.47788 - 14.7645 0.584519 0.00000 1.00000 -0.584519 - 14.7830 -1.87052 0.00000 1.00000 1.87052 - 14.8015 -4.24417 0.00000 1.00000 4.24417 - 14.8200 -5.96765 0.00000 1.00000 5.96765 - 14.8385 -6.70965 0.00000 1.00000 6.70965 - 14.8570 -6.46211 0.00000 1.00000 6.46211 - 14.8755 -5.52356 0.00000 1.00000 5.52356 - 14.8940 -4.38544 0.00000 1.00000 4.38544 - 14.9125 -3.55512 0.00000 1.00000 3.55512 - 14.9310 -3.36898 0.00000 1.00000 3.36898 - 14.9495 -3.85281 0.00000 1.00000 3.85281 - 14.9680 -4.67590 0.00000 1.00000 4.67590 - 14.9865 -5.21922 0.00000 1.00000 5.21922 - 15.0050 -4.74479 0.00000 1.00000 4.74479 - 15.0235 -2.62144 0.00000 1.00000 2.62144 - 15.0420 1.45687 0.00000 1.00000 -1.45687 - 15.0605 7.32500 0.00000 1.00000 -7.32500 - 15.0790 14.3193 0.00000 1.00000 -14.3193 - 15.0975 21.3835 0.00000 1.00000 -21.3835 - 15.1160 27.2852 0.00000 1.00000 -27.2852 - 15.1345 30.8902 0.00000 1.00000 -30.8902 - 15.1530 31.4245 0.00000 1.00000 -31.4245 - 15.1715 28.6588 0.00000 1.00000 -28.6588 - 15.1900 22.9682 0.00000 1.00000 -22.9682 - 15.2085 15.2541 0.00000 1.00000 -15.2541 - 15.2270 6.74712 0.00000 1.00000 -6.74712 - 15.2455 -1.25964 0.00000 1.00000 1.25964 - 15.2640 -7.68049 0.00000 1.00000 7.68049 - 15.2825 -11.8442 0.00000 1.00000 11.8442 - 15.3010 -13.5919 0.00000 1.00000 13.5919 - 15.3195 -13.2493 0.00000 1.00000 13.2493 - 15.3380 -11.4916 0.00000 1.00000 11.4916 - 15.3565 -9.14144 0.00000 1.00000 9.14144 - 15.3750 -6.95504 0.00000 1.00000 6.95504 - 15.3935 -5.44896 0.00000 1.00000 5.44896 - 15.4120 -4.80772 0.00000 1.00000 4.80772 - 15.4305 -4.88897 0.00000 1.00000 4.88897 - 15.4490 -5.31706 0.00000 1.00000 5.31706 - 15.4675 -5.63285 0.00000 1.00000 5.63285 - 15.4860 -5.45462 0.00000 1.00000 5.45462 - 15.5045 -4.60459 0.00000 1.00000 4.60459 - 15.5230 -3.16776 0.00000 1.00000 3.16776 - 15.5415 -1.46992 0.00000 1.00000 1.46992 - 15.5600 0.0157586 0.00000 1.00000 -0.0157586 - 15.5785 0.806047 0.00000 1.00000 -0.806047 - 15.5970 0.550242 0.00000 1.00000 -0.550242 - 15.6155 -0.861348 0.00000 1.00000 0.861348 - 15.6340 -3.25430 0.00000 1.00000 3.25430 - 15.6525 -6.20584 0.00000 1.00000 6.20584 - 15.6710 -9.14992 0.00000 1.00000 9.14992 - 15.6895 -11.5204 0.00000 1.00000 11.5204 - 15.7080 -12.8909 0.00000 1.00000 12.8909 - 15.7265 -13.0717 0.00000 1.00000 13.0717 - 15.7450 -12.1417 0.00000 1.00000 12.1417 - 15.7635 -10.4097 0.00000 1.00000 10.4097 - 15.7820 -8.32011 0.00000 1.00000 8.32011 - 15.8005 -6.33136 0.00000 1.00000 6.33136 - 15.8190 -4.80087 0.00000 1.00000 4.80087 - 15.8375 -3.90675 0.00000 1.00000 3.90675 - 15.8560 -3.62474 0.00000 1.00000 3.62474 - 15.8745 -3.76225 0.00000 1.00000 3.76225 - 15.8930 -4.03596 0.00000 1.00000 4.03596 - 15.9115 -4.16761 0.00000 1.00000 4.16761 - 15.9300 -3.96959 0.00000 1.00000 3.96959 - 15.9485 -3.39629 0.00000 1.00000 3.39629 - 15.9670 -2.54969 0.00000 1.00000 2.54969 - 15.9855 -1.64188 0.00000 1.00000 1.64188 - 16.0040 -0.928772 0.00000 1.00000 0.928772 - 16.0225 -0.634845 0.00000 1.00000 0.634845 - 16.0410 -0.888145 0.00000 1.00000 0.888145 - 16.0595 -1.67980 0.00000 1.00000 1.67980 - 16.0780 -2.85514 0.00000 1.00000 2.85514 - 16.0965 -4.13661 0.00000 1.00000 4.13661 - 16.1150 -5.17310 0.00000 1.00000 5.17310 - 16.1335 -5.60636 0.00000 1.00000 5.60636 - 16.1520 -5.14159 0.00000 1.00000 5.14159 - 16.1705 -3.60734 0.00000 1.00000 3.60734 - 16.1890 -0.992023 0.00000 1.00000 0.992023 - 16.2075 2.54958 0.00000 1.00000 -2.54958 - 16.2260 6.71807 0.00000 1.00000 -6.71807 - 16.2445 11.1120 0.00000 1.00000 -11.1120 - 16.2630 15.2812 0.00000 1.00000 -15.2812 - 16.2815 18.7822 0.00000 1.00000 -18.7822 - 16.3000 21.2269 0.00000 1.00000 -21.2269 - 16.3185 22.3212 0.00000 1.00000 -22.3212 - 16.3370 21.8912 0.00000 1.00000 -21.8912 - 16.3555 19.8991 0.00000 1.00000 -19.8991 - 16.3740 16.4493 0.00000 1.00000 -16.4493 - 16.3925 11.7863 0.00000 1.00000 -11.7863 - 16.4110 6.28331 0.00000 1.00000 -6.28331 - 16.4295 0.418687 0.00000 1.00000 -0.418687 - 16.4480 -5.25963 0.00000 1.00000 5.25963 - 16.4665 -10.1842 0.00000 1.00000 10.1842 - 16.4850 -13.8295 0.00000 1.00000 13.8295 - 16.5035 -15.7785 0.00000 1.00000 15.7785 - 16.5220 -15.7830 0.00000 1.00000 15.7830 - 16.5405 -13.8070 0.00000 1.00000 13.8070 - 16.5590 -10.0391 0.00000 1.00000 10.0391 - 16.5775 -4.87264 0.00000 1.00000 4.87264 - 16.5960 1.14589 0.00000 1.00000 -1.14589 - 16.6145 7.38649 0.00000 1.00000 -7.38649 - 16.6330 13.2091 0.00000 1.00000 -13.2091 - 16.6515 18.0296 0.00000 1.00000 -18.0296 - 16.6700 21.3708 0.00000 1.00000 -21.3708 - 16.6885 22.8991 0.00000 1.00000 -22.8991 - 16.7070 22.4456 0.00000 1.00000 -22.4456 - 16.7255 20.0158 0.00000 1.00000 -20.0158 - 16.7440 15.7881 0.00000 1.00000 -15.7881 - 16.7625 10.1035 0.00000 1.00000 -10.1035 - 16.7810 3.44424 0.00000 1.00000 -3.44424 - 16.7995 -3.59847 0.00000 1.00000 3.59847 - 16.8180 -10.3717 0.00000 1.00000 10.3717 - 16.8365 -16.2205 0.00000 1.00000 16.2205 - 16.8550 -20.5580 0.00000 1.00000 20.5580 - 16.8735 -22.9372 0.00000 1.00000 22.9372 - 16.8920 -23.1129 0.00000 1.00000 23.1129 - 16.9105 -21.0837 0.00000 1.00000 21.0837 - 16.9290 -17.1032 0.00000 1.00000 17.1032 - 16.9475 -11.6563 0.00000 1.00000 11.6563 - 16.9660 -5.39998 0.00000 1.00000 5.39998 - 16.9845 0.923758 0.00000 1.00000 -0.923758 - 17.0030 6.59122 0.00000 1.00000 -6.59122 - 17.0215 10.9979 0.00000 1.00000 -10.9979 - 17.0400 13.7383 0.00000 1.00000 -13.7383 - 17.0585 14.6477 0.00000 1.00000 -14.6477 - 17.0770 13.7998 0.00000 1.00000 -13.7998 - 17.0955 11.4638 0.00000 1.00000 -11.4638 - 17.1140 8.03578 0.00000 1.00000 -8.03578 - 17.1325 3.96378 0.00000 1.00000 -3.96378 - 17.1510 -0.316698 0.00000 1.00000 0.316698 - 17.1695 -4.42438 0.00000 1.00000 4.42438 - 17.1880 -8.04681 0.00000 1.00000 8.04681 - 17.2065 -10.9324 0.00000 1.00000 10.9324 - 17.2250 -12.8725 0.00000 1.00000 12.8725 - 17.2435 -13.6898 0.00000 1.00000 13.6898 - 17.2620 -13.2456 0.00000 1.00000 13.2456 - 17.2805 -11.4675 0.00000 1.00000 11.4675 - 17.2990 -8.39144 0.00000 1.00000 8.39144 - 17.3175 -4.20001 0.00000 1.00000 4.20001 - 17.3360 0.758004 0.00000 1.00000 -0.758004 - 17.3545 5.98116 0.00000 1.00000 -5.98116 - 17.3730 10.8661 0.00000 1.00000 -10.8661 - 17.3915 14.7906 0.00000 1.00000 -14.7906 - 17.4100 17.2137 0.00000 1.00000 -17.2137 - 17.4285 17.7745 0.00000 1.00000 -17.7745 - 17.4470 16.3661 0.00000 1.00000 -16.3661 - 17.4655 13.1690 0.00000 1.00000 -13.1690 - 17.4840 8.63053 0.00000 1.00000 -8.63053 - 17.5025 3.39246 0.00000 1.00000 -3.39246 - 17.5210 -1.82203 0.00000 1.00000 1.82203 - 17.5395 -6.33848 0.00000 1.00000 6.33848 - 17.5580 -9.64981 0.00000 1.00000 9.64981 - 17.5765 -11.4978 0.00000 1.00000 11.4978 - 17.5950 -11.9009 0.00000 1.00000 11.9009 - 17.6135 -11.1239 0.00000 1.00000 11.1239 - 17.6320 -9.59944 0.00000 1.00000 9.59944 - 17.6505 -7.81972 0.00000 1.00000 7.81972 - 17.6690 -6.22442 0.00000 1.00000 6.22442 - 17.6875 -5.11122 0.00000 1.00000 5.11122 - 17.7060 -4.58875 0.00000 1.00000 4.58875 - 17.7245 -4.58029 0.00000 1.00000 4.58029 - 17.7430 -4.87225 0.00000 1.00000 4.87225 - 17.7615 -5.18968 0.00000 1.00000 5.18968 - 17.7800 -5.27616 0.00000 1.00000 5.27616 - 17.7985 -4.95771 0.00000 1.00000 4.95771 - 17.8170 -4.17763 0.00000 1.00000 4.17763 - 17.8355 -2.99861 0.00000 1.00000 2.99861 - 17.8540 -1.57655 0.00000 1.00000 1.57655 - 17.8725 -0.115674 0.00000 1.00000 0.115674 - 17.8910 1.18232 0.00000 1.00000 -1.18232 - 17.9095 2.16253 0.00000 1.00000 -2.16253 - 17.9280 2.74507 0.00000 1.00000 -2.74507 - 17.9465 2.93310 0.00000 1.00000 -2.93310 - 17.9650 2.80225 0.00000 1.00000 -2.80225 - 17.9835 2.47685 0.00000 1.00000 -2.47685 - 18.0020 2.09940 0.00000 1.00000 -2.09940 - 18.0205 1.79907 0.00000 1.00000 -1.79907 - 18.0390 1.66403 0.00000 1.00000 -1.66403 - 18.0575 1.72260 0.00000 1.00000 -1.72260 - 18.0760 1.93703 0.00000 1.00000 -1.93703 - 18.0945 2.21113 0.00000 1.00000 -2.21113 - 18.1130 2.40837 0.00000 1.00000 -2.40837 - 18.1315 2.37442 0.00000 1.00000 -2.37442 - 18.1500 1.95988 0.00000 1.00000 -1.95988 - 18.1685 1.04724 0.00000 1.00000 -1.04724 - 18.1870 -0.426523 0.00000 1.00000 0.426523 - 18.2055 -2.45315 0.00000 1.00000 2.45315 - 18.2240 -4.90773 0.00000 1.00000 4.90773 - 18.2425 -7.52944 0.00000 1.00000 7.52944 - 18.2610 -9.92715 0.00000 1.00000 9.92715 - 18.2795 -11.6174 0.00000 1.00000 11.6174 - 18.2980 -12.0956 0.00000 1.00000 12.0956 - 18.3165 -10.9327 0.00000 1.00000 10.9327 - 18.3350 -7.88331 0.00000 1.00000 7.88331 - 18.3535 -2.98071 0.00000 1.00000 2.98071 - 18.3720 3.40650 0.00000 1.00000 -3.40650 - 18.3905 10.5811 0.00000 1.00000 -10.5811 - 18.4090 17.5968 0.00000 1.00000 -17.5968 - 18.4275 23.4036 0.00000 1.00000 -23.4036 - 18.4460 27.0310 0.00000 1.00000 -27.0310 - 18.4645 27.7731 0.00000 1.00000 -27.7731 - 18.4830 25.3345 0.00000 1.00000 -25.3345 - 18.5015 19.9052 0.00000 1.00000 -19.9052 - 18.5200 12.1472 0.00000 1.00000 -12.1472 - 18.5385 3.09099 0.00000 1.00000 -3.09099 - 18.5570 -6.03798 0.00000 1.00000 6.03798 - 18.5755 -14.0281 0.00000 1.00000 14.0281 - 18.5940 -19.8843 0.00000 1.00000 19.8843 - 18.6125 -22.9844 0.00000 1.00000 22.9844 - 18.6310 -23.1597 0.00000 1.00000 23.1597 - 18.6495 -20.6881 0.00000 1.00000 20.6881 - 18.6680 -16.2075 0.00000 1.00000 16.2075 - 18.6865 -10.5714 0.00000 1.00000 10.5714 - 18.7050 -4.68098 0.00000 1.00000 4.68098 - 18.7235 0.671251 0.00000 1.00000 -0.671251 - 18.7420 4.91529 0.00000 1.00000 -4.91529 - 18.7605 7.75797 0.00000 1.00000 -7.75797 - 18.7790 9.17588 0.00000 1.00000 -9.17588 - 18.7975 9.35965 0.00000 1.00000 -9.35965 - 18.8160 8.63035 0.00000 1.00000 -8.63035 - 18.8345 7.35145 0.00000 1.00000 -7.35145 - 18.8530 5.85510 0.00000 1.00000 -5.85510 - 18.8715 4.39513 0.00000 1.00000 -4.39513 - 18.8900 3.13002 0.00000 1.00000 -3.13002 - 18.9085 2.13168 0.00000 1.00000 -2.13168 - 18.9270 1.40976 0.00000 1.00000 -1.40976 - 18.9455 0.939913 0.00000 1.00000 -0.939913 - 18.9640 0.686429 0.00000 1.00000 -0.686429 - 18.9825 0.614229 0.00000 1.00000 -0.614229 - 19.0010 0.690570 0.00000 1.00000 -0.690570 - 19.0195 0.880032 0.00000 1.00000 -0.880032 - 19.0380 1.13788 0.00000 1.00000 -1.13788 - 19.0565 1.40627 0.00000 1.00000 -1.40627 - 19.0750 1.61604 0.00000 1.00000 -1.61604 - 19.0935 1.69418 0.00000 1.00000 -1.69418 - 19.1120 1.57467 0.00000 1.00000 -1.57467 - 19.1305 1.20912 0.00000 1.00000 -1.20912 - 19.1490 0.574418 0.00000 1.00000 -0.574418 - 19.1675 -0.322868 0.00000 1.00000 0.322868 - 19.1860 -1.44364 0.00000 1.00000 1.44364 - 19.2045 -2.71278 0.00000 1.00000 2.71278 - 19.2230 -4.01492 0.00000 1.00000 4.01492 - 19.2415 -5.19189 0.00000 1.00000 5.19189 - 19.2600 -6.04623 0.00000 1.00000 6.04623 - 19.2785 -6.35560 0.00000 1.00000 6.35560 - 19.2970 -5.90135 0.00000 1.00000 5.90135 - 19.3155 -4.51168 0.00000 1.00000 4.51168 - 19.3340 -2.11474 0.00000 1.00000 2.11474 - 19.3525 1.20914 0.00000 1.00000 -1.20914 - 19.3710 5.19105 0.00000 1.00000 -5.19105 - 19.3895 9.36912 0.00000 1.00000 -9.36912 - 19.4080 13.1271 0.00000 1.00000 -13.1271 - 19.4265 15.7779 0.00000 1.00000 -15.7779 - 19.4450 16.6827 0.00000 1.00000 -16.6827 - 19.4635 15.3867 0.00000 1.00000 -15.3867 - 19.4820 11.7418 0.00000 1.00000 -11.7418 - 19.5005 5.98757 0.00000 1.00000 -5.98757 - 19.5190 -1.23710 0.00000 1.00000 1.23710 - 19.5375 -8.96359 0.00000 1.00000 8.96359 - 19.5560 -16.0382 0.00000 1.00000 16.0382 - 19.5745 -21.3164 0.00000 1.00000 21.3164 - 19.5930 -23.8699 0.00000 1.00000 23.8699 - 19.6115 -23.1644 0.00000 1.00000 23.1644 - 19.6300 -19.1740 0.00000 1.00000 19.1740 - 19.6485 -12.4057 0.00000 1.00000 12.4057 - 19.6670 -3.82669 0.00000 1.00000 3.82669 - 19.6855 5.29471 0.00000 1.00000 -5.29471 - 19.7040 13.6058 0.00000 1.00000 -13.6058 - 19.7225 19.9014 0.00000 1.00000 -19.9014 - 19.7410 23.3260 0.00000 1.00000 -23.3260 - 19.7595 23.5068 0.00000 1.00000 -23.5068 - 19.7780 20.5929 0.00000 1.00000 -20.5929 - 19.7965 15.1973 0.00000 1.00000 -15.1973 - 19.8150 8.25741 0.00000 1.00000 -8.25741 - 19.8335 0.846490 0.00000 1.00000 -0.846490 - 19.8520 -6.02165 0.00000 1.00000 6.02165 - 19.8705 -11.5565 0.00000 1.00000 11.5565 - 19.8890 -15.2939 0.00000 1.00000 15.2939 - 19.9075 -17.1257 0.00000 1.00000 17.1257 - 19.9260 -17.2573 0.00000 1.00000 17.2573 - 19.9445 -16.1119 0.00000 1.00000 16.1119 - 19.9630 -14.2055 0.00000 1.00000 14.2055 - 19.9815 -12.0275 0.00000 1.00000 12.0275 - 20.0000 -9.95383 0.00000 1.00000 9.95383 diff --git a/diffpy/pdffit2/tests/testdata/Ni.stru b/diffpy/pdffit2/tests/testdata/Ni.stru deleted file mode 100644 index b4da517c..00000000 --- a/diffpy/pdffit2/tests/testdata/Ni.stru +++ /dev/null @@ -1,33 +0,0 @@ -title structure Ni FCC -format pdffit -scale 1.000000 -sharp 0.000000, 1.000000, 0.000000 -spcgr Fm-3m -cell 3.520000, 3.520000, 3.520000, 90.000000, 90.000000, 90.000000 -dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 -ncell 1, 1, 1, 4 -atoms -NI 0.00000000 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.00000000 0.50000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 diff --git a/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru b/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru deleted file mode 100644 index 71ba3651..00000000 --- a/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru +++ /dev/null @@ -1,345 +0,0 @@ -title Pb8 (Sc16/3 W8/3)0.75 (Ti8)0.25 O24, B factors from BNL2 -format pdffit -scale 1.000000 -sharp 0.000000, 1.000000, 0.000000 -spcgr Fm-3m -cell 8.072700, 8.072700, 8.072700, 90.000000, 90.000000, 90.000000 -dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 -ncell 1, 1, 1, 56 -atoms -PB 0.25000000 0.25000000 0.25000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.25000000 0.75000000 0.75000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.75000000 0.25000000 0.75000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.75000000 0.75000000 0.25000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.25000000 0.25000000 0.75000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.75000000 0.25000000 0.25000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.25000000 0.75000000 0.25000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -PB 0.75000000 0.75000000 0.75000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.04795025 0.04795025 0.04795025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.00000000 0.25735000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.50000000 0.75735003 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.00000000 0.75735003 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.50000000 0.25735000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.00000000 0.74264997 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.50000000 0.24265000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.00000000 0.24265000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.50000000 0.74264997 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.25735000 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.75735003 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.75735003 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.25735000 0.50000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.74264997 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.24265000 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.24265000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.74264997 0.50000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.25735000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.75735003 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.75735003 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.25735000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.74264997 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.24265000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.00000000 0.24265000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -O 0.50000000 0.74264997 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.02293025 0.02293025 0.02293025 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.00000000 0.00000000 0.00000000 0.9739 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.00000000 0.50000000 0.50000000 0.9739 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.50000000 0.00000000 0.50000000 0.9739 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.50000000 0.50000000 0.00000000 0.9739 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.50000000 0.50000000 0.50000000 0.0261 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.50000000 0.00000000 0.00000000 0.0261 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.00000000 0.50000000 0.00000000 0.0261 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -SC 0.00000000 0.00000000 0.50000000 0.0261 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.00000000 0.00000000 0.00000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.00000000 0.50000000 0.50000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.50000000 0.00000000 0.50000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.50000000 0.50000000 0.00000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.50000000 0.50000000 0.50000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.50000000 0.00000000 0.00000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.00000000 0.50000000 0.00000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -W 0.00000000 0.00000000 0.50000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.00000000 0.00000000 0.00000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.00000000 0.50000000 0.50000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.50000000 0.00000000 0.50000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.50000000 0.50000000 0.00000000 0.0131 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.50000000 0.50000000 0.50000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.50000000 0.00000000 0.00000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.00000000 0.50000000 0.00000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -TI 0.00000000 0.00000000 0.50000000 0.4869 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00809050 0.00809050 0.00809050 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 diff --git a/diffpy/pdffit2/tests/testdata/badNi.dat b/diffpy/pdffit2/tests/testdata/badNi.dat deleted file mode 100644 index ef5b7007..00000000 --- a/diffpy/pdffit2/tests/testdata/badNi.dat +++ /dev/null @@ -1,1001 +0,0 @@ - 1.50000 -0.539443 0.00000 1.00000 0.539443 - 1.51850 -1.03098 0.00000 1.00000 1.03098 - 1.53700 -1.43712 0.00000 1.00000 1.43712 - 1.55550 -1.73810 0.00000 1.00000 1.73810 - 1.57400 -1.93402 0.00000 1.00000 1.93402 - 1.59250 -2.04145 0.00000 1.00000 2.04145 - 1.61100 -2.08593 0.00000 1.00000 2.08593 - 1.62950 -2.09295 0.00000 1.00000 2.09295 - 1.64800 -2.08072 0.00000 1.00000 2.08072 - 1.66650 -2.05688 0.00000 1.00000 2.05688 - 1.68500 -2.02006 0.00000 1.00000 2.02006 - 1.70350 -1.96554 0.00000 1.00000 1.96554 - 1.72200 -1.89239 0.00000 1.00000 1.89239 - 1.74050 -1.80936 0.00000 1.00000 1.80936 - 1.75900 -1.73670 0.00000 1.00000 1.73670 - 1.77750 -1.70255 0.00000 1.00000 1.70255 - 1.79600 -1.73461 0.00000 1.00000 1.73461 - 1.81450 -1.84946 0.00000 1.00000 1.84946 - 1.83300 -2.04300 0.00000 1.00000 2.04300 - 1.85150 -2.28566 0.00000 1.00000 2.28566 - 1.87000 -2.52486 0.00000 1.00000 2.52486 - 1.88850 -2.69615 0.00000 1.00000 2.69615 - 1.92700 -2.74180 0.00000 1.00000 2.74180 - 1.92550 -2.63223 0.00000 1.00000 2.63223 - 1.94400 -2.38239 0.00000 1.00000 2.38239 - 1.96250 -2.05565 0.00000 1.00000 2.05565 - 1.98100 -1.75092 0.00000 1.00000 1.75092 - 1.99950 -1.57518 0.00000 1.00000 1.57518 - 2.01800 -1.60914 0.00000 1.00000 1.60914 - 2.03650 -1.87687 0.00000 1.00000 1.87687 - 2.05500 -2.33004 0.00000 1.00000 2.33004 - 2.07350 -2.85357 0.00000 1.00000 2.85357 - 2.09200 -3.29353 0.00000 1.00000 3.29353 - 2.11050 -3.50124 0.00000 1.00000 3.50124 - 2.12900 -3.38172 0.00000 1.00000 3.38172 - 2.14750 -2.93205 0.00000 1.00000 2.93205 - 2.16600 -2.25629 0.00000 1.00000 2.25629 - 2.18450 -1.54918 0.00000 1.00000 1.54918 - 2.20300 -1.04888 0.00000 1.00000 1.04888 - 2.22150 -0.968136 0.00000 1.00000 0.968136 - 2.24000 -1.42070 0.00000 1.00000 1.42070 - 2.25850 -2.36300 0.00000 1.00000 2.36300 - 2.27700 -3.56960 0.00000 1.00000 3.56960 - 2.29550 -4.65416 0.00000 1.00000 4.65416 - 2.31400 -5.13684 0.00000 1.00000 5.13684 - 2.33250 -4.54696 0.00000 1.00000 4.54696 - 2.35100 -2.53890 0.00000 1.00000 2.53890 - 2.36950 1.00656 0.00000 1.00000 -1.00656 - 2.38800 5.92223 0.00000 1.00000 -5.92223 - 2.40650 11.7527 0.00000 1.00000 -11.7527 - 2.42500 17.8143 0.00000 1.00000 -17.8143 - 2.44350 23.3057 0.00000 1.00000 -23.3057 - 2.46200 27.4478 0.00000 1.00000 -27.4478 - 2.48050 29.6246 0.00000 1.00000 -29.6246 - 2.49900 29.4986 0.00000 1.00000 -29.4986 - 2.51750 27.0749 0.00000 1.00000 -27.0749 - 2.53600 22.7028 0.00000 1.00000 -22.7028 - 2.55450 17.0112 0.00000 1.00000 -17.0112 - 2.57300 10.7932 0.00000 1.00000 -10.7932 - 2.59150 4.86134 0.00000 1.00000 -4.86134 - 2.61000 -0.0945224 0.00000 1.00000 0.0945224 - 2.62850 -3.61858 0.00000 1.00000 3.61858 - 2.64700 -5.54803 0.00000 1.00000 5.54803 - 2.66550 -6.01016 0.00000 1.00000 6.01016 - 2.68400 -5.36293 0.00000 1.00000 5.36293 - 2.70250 -4.09596 0.00000 1.00000 4.09596 - 2.72100 -2.71625 0.00000 1.00000 2.71625 - 2.73950 -1.64382 0.00000 1.00000 1.64382 - 2.75800 -1.13791 0.00000 1.00000 1.13791 - 2.77650 -1.26649 0.00000 1.00000 1.26649 - 2.79500 -1.92103 0.00000 1.00000 1.92103 - 2.81350 -2.86890 0.00000 1.00000 2.86890 - 2.83200 -3.82782 0.00000 1.00000 3.82782 - 2.85050 -4.54328 0.00000 1.00000 4.54328 - 2.86900 -4.85054 0.00000 1.00000 4.85054 - 2.88750 -4.70809 0.00000 1.00000 4.70809 - 2.90600 -4.19687 0.00000 1.00000 4.19687 - 2.92450 -3.48841 0.00000 1.00000 3.48841 - 2.94300 -2.79256 0.00000 1.00000 2.79256 - 2.96150 -2.29993 0.00000 1.00000 2.29993 - 2.98000 -2.13422 0.00000 1.00000 2.13422 - 2.99850 -2.32552 0.00000 1.00000 2.32552 - 3.01700 -2.80931 0.00000 1.00000 2.80931 - 3.03550 -3.44928 0.00000 1.00000 3.44928 - 3.05400 -4.07624 0.00000 1.00000 4.07624 - 3.07250 -4.53264 0.00000 1.00000 4.53264 - 3.09100 -4.71141 0.00000 1.00000 4.71141 - 3.10950 -4.58013 0.00000 1.00000 4.58013 - 3.12800 -4.18572 0.00000 1.00000 4.18572 - 3.14650 -3.63955 0.00000 1.00000 3.63955 - 3.16500 -3.08796 0.00000 1.00000 3.08796 - 3.18350 -2.67579 0.00000 1.00000 2.67579 - 3.20200 -2.51194 0.00000 1.00000 2.51194 - 3.22050 -2.64475 0.00000 1.00000 2.64475 - 3.23900 -3.05186 0.00000 1.00000 3.05186 - 3.25750 -3.64576 0.00000 1.00000 3.64576 - 3.27600 -4.29257 0.00000 1.00000 4.29257 - 3.29450 -4.83876 0.00000 1.00000 4.83876 - 3.31300 -5.14008 0.00000 1.00000 5.14008 - 3.33150 -5.08721 0.00000 1.00000 5.08721 - 3.35000 -4.62391 0.00000 1.00000 4.62391 - 3.36850 -3.75470 0.00000 1.00000 3.75470 - 3.38700 -2.54063 0.00000 1.00000 2.54063 - 3.40550 -1.08396 0.00000 1.00000 1.08396 - 3.42400 0.493223 0.00000 1.00000 -0.493223 - 3.44250 2.06874 0.00000 1.00000 -2.06874 - 3.46100 3.53152 0.00000 1.00000 -3.53152 - 3.47950 4.78254 0.00000 1.00000 -4.78254 - 3.49800 5.72969 0.00000 1.00000 -5.72969 - 3.51650 6.28423 0.00000 1.00000 -6.28423 - 3.53500 6.36504 0.00000 1.00000 -6.36504 - 3.55350 5.91247 0.00000 1.00000 -5.91247 - 3.57200 4.90861 0.00000 1.00000 -4.90861 - 3.59050 3.39740 0.00000 1.00000 -3.39740 - 3.60900 1.49612 0.00000 1.00000 -1.49612 - 3.62750 -0.608193 0.00000 1.00000 0.608193 - 3.64600 -2.68019 0.00000 1.00000 2.68019 - 3.66450 -4.47243 0.00000 1.00000 4.47243 - 3.68300 -5.76925 0.00000 1.00000 5.76925 - 3.70150 -6.42920 0.00000 1.00000 6.42920 - 3.72000 -6.41719 0.00000 1.00000 6.41719 - 3.73850 -5.81875 0.00000 1.00000 5.81875 - 3.75700 -4.83074 0.00000 1.00000 4.83074 - 3.77550 -3.72667 0.00000 1.00000 3.72667 - 3.79400 -2.80071 0.00000 1.00000 2.80071 - 3.81250 -2.30147 0.00000 1.00000 2.30147 - 3.83100 -2.37126 0.00000 1.00000 2.37126 - 3.84950 -3.00713 0.00000 1.00000 3.00713 - 3.86800 -4.05566 0.00000 1.00000 4.05566 - 3.88650 -5.24604 0.00000 1.00000 5.24604 - 3.90500 -6.25585 0.00000 1.00000 6.25585 - 3.92350 -6.79521 0.00000 1.00000 6.79521 - 3.94200 -6.68830 0.00000 1.00000 6.68830 - 3.96050 -5.93010 0.00000 1.00000 5.93010 - 3.97900 -4.70113 0.00000 1.00000 4.70113 - 3.99750 -3.33259 0.00000 1.00000 3.33259 - 4.01600 -2.22683 0.00000 1.00000 2.22683 - 4.03450 -1.75037 0.00000 1.00000 1.75037 - 4.05300 -2.12498 0.00000 1.00000 2.12498 - 4.07150 -3.34471 0.00000 1.00000 3.34471 - 4.09000 -5.14253 0.00000 1.00000 5.14253 - 4.10850 -7.01935 0.00000 1.00000 7.01935 - 4.12700 -8.33391 0.00000 1.00000 8.33391 - 4.14550 -8.43660 0.00000 1.00000 8.43660 - 4.16400 -6.81920 0.00000 1.00000 6.81920 - 4.18250 -3.24667 0.00000 1.00000 3.24667 - 4.20100 2.16009 0.00000 1.00000 -2.16009 - 4.21950 8.91152 0.00000 1.00000 -8.91152 - 4.23800 16.2134 0.00000 1.00000 -16.2134 - 4.25650 23.0973 0.00000 1.00000 -23.0973 - 4.27500 28.5935 0.00000 1.00000 -28.5935 - 4.29350 31.9106 0.00000 1.00000 -31.9106 - 4.31200 32.5842 0.00000 1.00000 -32.5842 - 4.33050 30.5617 0.00000 1.00000 -30.5617 - 4.34900 26.2027 0.00000 1.00000 -26.2027 - 4.36750 20.1990 0.00000 1.00000 -20.1990 - 4.38600 13.4320 0.00000 1.00000 -13.4320 - 4.40450 6.80337 0.00000 1.00000 -6.80337 - 4.42300 1.07527 0.00000 1.00000 -1.07527 - 4.44150 -3.24700 0.00000 1.00000 3.24700 - 4.46000 -5.96945 0.00000 1.00000 5.96945 - 4.47850 -7.19581 0.00000 1.00000 7.19581 - 4.49700 -7.25613 0.00000 1.00000 7.25613 - 4.51550 -6.59972 0.00000 1.00000 6.59972 - 4.53400 -5.68054 0.00000 1.00000 5.68054 - 4.55250 -4.86170 0.00000 1.00000 4.86170 - 4.57100 -4.35835 0.00000 1.00000 4.35835 - 4.58950 -4.22677 0.00000 1.00000 4.22677 - 4.60800 -4.39508 0.00000 1.00000 4.39508 - 4.62650 -4.72130 0.00000 1.00000 4.72130 - 4.64500 -5.05871 0.00000 1.00000 5.05871 - 4.66350 -5.30848 0.00000 1.00000 5.30848 - 4.68200 -5.44197 0.00000 1.00000 5.44197 - 4.70050 -5.50097 0.00000 1.00000 5.50097 - 4.71900 -5.56456 0.00000 1.00000 5.56456 - 4.73750 -5.69659 0.00000 1.00000 5.69659 - 4.75600 -5.90806 0.00000 1.00000 5.90806 - 4.77450 -6.13525 0.00000 1.00000 6.13525 - 4.79300 -6.24364 0.00000 1.00000 6.24364 - 4.81150 -6.05670 0.00000 1.00000 6.05670 - 4.83000 -5.40165 0.00000 1.00000 5.40165 - 4.84850 -4.16022 0.00000 1.00000 4.16022 - 4.86700 -2.31100 0.00000 1.00000 2.31100 - 4.88550 0.0479985 0.00000 1.00000 -0.0479985 - 4.90400 2.70271 0.00000 1.00000 -2.70271 - 4.92250 5.35252 0.00000 1.00000 -5.35252 - 4.94100 7.65960 0.00000 1.00000 -7.65960 - 4.95950 9.30734 0.00000 1.00000 -9.30734 - 4.97800 10.0558 0.00000 1.00000 -10.0558 - 4.99650 9.78268 0.00000 1.00000 -9.78268 - 5.01500 8.50309 0.00000 1.00000 -8.50309 - 5.03350 6.36470 0.00000 1.00000 -6.36470 - 5.05200 3.62252 0.00000 1.00000 -3.62252 - 5.07050 0.599290 0.00000 1.00000 -0.599290 - 5.08900 -2.36086 0.00000 1.00000 2.36086 - 5.10750 -4.93870 0.00000 1.00000 4.93870 - 5.12600 -6.88149 0.00000 1.00000 6.88149 - 5.14450 -8.03565 0.00000 1.00000 8.03565 - 5.16300 -8.36668 0.00000 1.00000 8.36668 - 5.18150 -7.96304 0.00000 1.00000 7.96304 - 5.20000 -7.02207 0.00000 1.00000 7.02207 - 5.21850 -5.81895 0.00000 1.00000 5.81895 - 5.23700 -4.66171 0.00000 1.00000 4.66171 - 5.25550 -3.83844 0.00000 1.00000 3.83844 - 5.27400 -3.56410 0.00000 1.00000 3.56410 - 5.29250 -3.93573 0.00000 1.00000 3.93573 - 5.31100 -4.90467 0.00000 1.00000 4.90467 - 5.32950 -6.27267 0.00000 1.00000 6.27267 - 5.34800 -7.71536 0.00000 1.00000 7.71536 - 5.36650 -8.83203 0.00000 1.00000 8.83203 - 5.38500 -9.21516 0.00000 1.00000 9.21516 - 5.40350 -8.52808 0.00000 1.00000 8.52808 - 5.42200 -6.57611 0.00000 1.00000 6.57611 - 5.44050 -3.35625 0.00000 1.00000 3.35625 - 5.45900 0.925287 0.00000 1.00000 -0.925287 - 5.47750 5.87209 0.00000 1.00000 -5.87209 - 5.49600 10.9500 0.00000 1.00000 -10.9500 - 5.51450 15.5640 0.00000 1.00000 -15.5640 - 5.53300 19.1477 0.00000 1.00000 -19.1477 - 5.55150 21.2490 0.00000 1.00000 -21.2490 - 5.57000 21.6003 0.00000 1.00000 -21.6003 - 5.58850 20.1588 0.00000 1.00000 -20.1588 - 5.60700 17.1124 0.00000 1.00000 -17.1124 - 5.62550 12.8494 0.00000 1.00000 -12.8494 - 5.64400 7.89927 0.00000 1.00000 -7.89927 - 5.66250 2.85190 0.00000 1.00000 -2.85190 - 5.68100 -1.72997 0.00000 1.00000 1.72997 - 5.69950 -5.39381 0.00000 1.00000 5.39381 - 5.71800 -7.86162 0.00000 1.00000 7.86162 - 5.73650 -9.06420 0.00000 1.00000 9.06420 - 5.75500 -9.13837 0.00000 1.00000 9.13837 - 5.77350 -8.38683 0.00000 1.00000 8.38683 - 5.79200 -7.20818 0.00000 1.00000 7.20818 - 5.81050 -6.01172 0.00000 1.00000 6.01172 - 5.82900 -5.13567 0.00000 1.00000 5.13567 - 5.84750 -4.78662 0.00000 1.00000 4.78662 - 5.86600 -5.01125 0.00000 1.00000 5.01125 - 5.88450 -5.70222 0.00000 1.00000 5.70222 - 5.90300 -6.63275 0.00000 1.00000 6.63275 - 5.92150 -7.51031 0.00000 1.00000 7.51031 - 5.94000 -8.03914 0.00000 1.00000 8.03914 - 5.95850 -7.98163 0.00000 1.00000 7.98163 - 5.97700 -7.20897 0.00000 1.00000 7.20897 - 5.99550 -5.73309 0.00000 1.00000 5.73309 - 6.01400 -3.71335 0.00000 1.00000 3.71335 - 6.03250 -1.43572 0.00000 1.00000 1.43572 - 6.05100 0.734316 0.00000 1.00000 -0.734316 - 6.06950 2.41816 0.00000 1.00000 -2.41816 - 6.08800 3.29880 0.00000 1.00000 -3.29880 - 6.10650 3.18922 0.00000 1.00000 -3.18922 - 6.12500 2.07961 0.00000 1.00000 -2.07961 - 6.14350 0.150522 0.00000 1.00000 -0.150522 - 6.16200 -2.25436 0.00000 1.00000 2.25436 - 6.18050 -4.69426 0.00000 1.00000 4.69426 - 6.19900 -6.72460 0.00000 1.00000 6.72460 - 6.21750 -7.99834 0.00000 1.00000 7.99834 - 6.23600 -8.35142 0.00000 1.00000 8.35142 - 6.25450 -7.84948 0.00000 1.00000 7.84948 - 6.27300 -6.78013 0.00000 1.00000 6.78013 - 6.29150 -5.58671 0.00000 1.00000 5.58671 - 6.31000 -4.75441 0.00000 1.00000 4.75441 - 6.32850 -4.67266 0.00000 1.00000 4.67266 - 6.34700 -5.50714 0.00000 1.00000 5.50714 - 6.36550 -7.11590 0.00000 1.00000 7.11590 - 6.38400 -9.03699 0.00000 1.00000 9.03699 - 6.40250 -10.5592 0.00000 1.00000 10.5592 - 6.42100 -10.8676 0.00000 1.00000 10.8676 - 6.43950 -9.23379 0.00000 1.00000 9.23379 - 6.45800 -5.20861 0.00000 1.00000 5.20861 - 6.47650 1.23011 0.00000 1.00000 -1.23011 - 6.49500 9.61241 0.00000 1.00000 -9.61241 - 6.51350 19.0142 0.00000 1.00000 -19.0142 - 6.53200 28.1967 0.00000 1.00000 -28.1967 - 6.55050 35.8243 0.00000 1.00000 -35.8243 - 6.56900 40.7166 0.00000 1.00000 -40.7166 - 6.58750 42.0833 0.00000 1.00000 -42.0833 - 6.60600 39.6873 0.00000 1.00000 -39.6873 - 6.62450 33.8989 0.00000 1.00000 -33.8989 - 6.64300 25.6256 0.00000 1.00000 -25.6256 - 6.66150 16.1324 0.00000 1.00000 -16.1324 - 6.68000 6.79125 0.00000 1.00000 -6.79125 - 6.69850 -1.18411 0.00000 1.00000 1.18411 - 6.71700 -6.95910 0.00000 1.00000 6.95910 - 6.73550 -10.2079 0.00000 1.00000 10.2079 - 6.75400 -11.1248 0.00000 1.00000 11.1248 - 6.77250 -10.3198 0.00000 1.00000 10.3198 - 6.79100 -8.62815 0.00000 1.00000 8.62815 - 6.80950 -6.88571 0.00000 1.00000 6.88571 - 6.82800 -5.72660 0.00000 1.00000 5.72660 - 6.84650 -5.45332 0.00000 1.00000 5.45332 - 6.86500 -6.00649 0.00000 1.00000 6.00649 - 6.88350 -7.03437 0.00000 1.00000 7.03437 - 6.90200 -8.03570 0.00000 1.00000 8.03570 - 6.92050 -8.53209 0.00000 1.00000 8.53209 - 6.93900 -8.22002 0.00000 1.00000 8.22002 - 6.95750 -7.06140 0.00000 1.00000 7.06140 - 6.97600 -5.29017 0.00000 1.00000 5.29017 - 6.99450 -3.33754 0.00000 1.00000 3.33754 - 7.01300 -1.70148 0.00000 1.00000 1.70148 - 7.03150 -0.800760 0.00000 1.00000 0.800760 - 7.05000 -0.856664 0.00000 1.00000 0.856664 - 7.06850 -1.83505 0.00000 1.00000 1.83505 - 7.08700 -3.46358 0.00000 1.00000 3.46358 - 7.10550 -5.31731 0.00000 1.00000 5.31731 - 7.12400 -6.94715 0.00000 1.00000 6.94715 - 7.14250 -8.01332 0.00000 1.00000 8.01332 - 7.16100 -8.38320 0.00000 1.00000 8.38320 - 7.17950 -8.16268 0.00000 1.00000 8.16268 - 7.19800 -7.64952 0.00000 1.00000 7.64952 - 7.21650 -7.22129 0.00000 1.00000 7.22129 - 7.23500 -7.19206 0.00000 1.00000 7.19206 - 7.25350 -7.68220 0.00000 1.00000 7.68220 - 7.27200 -8.54371 0.00000 1.00000 8.54371 - 7.29050 -9.36819 0.00000 1.00000 9.36819 - 7.30900 -9.58072 0.00000 1.00000 9.58072 - 7.32750 -8.59790 0.00000 1.00000 8.59790 - 7.34600 -6.00785 0.00000 1.00000 6.00785 - 7.36450 -1.72106 0.00000 1.00000 1.72106 - 7.38300 3.95269 0.00000 1.00000 -3.95269 - 7.40150 10.3276 0.00000 1.00000 -10.3276 - 7.42000 16.4640 0.00000 1.00000 -16.4640 - 7.43850 21.3618 0.00000 1.00000 -21.3618 - 7.45700 24.1782 0.00000 1.00000 -24.1782 - 7.47550 24.4162 0.00000 1.00000 -24.4162 - 7.49400 22.0356 0.00000 1.00000 -22.0356 - 7.51250 17.4573 0.00000 1.00000 -17.4573 - 7.53100 11.4623 0.00000 1.00000 -11.4623 - 7.54950 5.01118 0.00000 1.00000 -5.01118 - 7.56800 -0.965076 0.00000 1.00000 0.965076 - 7.58650 -5.75153 0.00000 1.00000 5.75153 - 7.60500 -8.96799 0.00000 1.00000 8.96799 - 7.62350 -10.5969 0.00000 1.00000 10.5969 - 7.64200 -10.9206 0.00000 1.00000 10.9206 - 7.66050 -10.3893 0.00000 1.00000 10.3893 - 7.67900 -9.46200 0.00000 1.00000 9.46200 - 7.69750 -8.46444 0.00000 1.00000 8.46444 - 7.71600 -7.50854 0.00000 1.00000 7.50854 - 7.73450 -6.49304 0.00000 1.00000 6.49304 - 7.75300 -5.18168 0.00000 1.00000 5.18168 - 7.77150 -3.32911 0.00000 1.00000 3.32911 - 7.79000 -0.811546 0.00000 1.00000 0.811546 - 7.80850 2.28073 0.00000 1.00000 -2.28073 - 7.82700 5.61902 0.00000 1.00000 -5.61902 - 7.84550 8.68909 0.00000 1.00000 -8.68909 - 7.86400 10.9073 0.00000 1.00000 -10.9073 - 7.88250 11.7676 0.00000 1.00000 -11.7676 - 7.90100 10.9777 0.00000 1.00000 -10.9777 - 7.91950 8.54633 0.00000 1.00000 -8.54633 - 7.93800 4.79627 0.00000 1.00000 -4.79627 - 7.95650 0.300695 0.00000 1.00000 -0.300695 - 7.97500 -4.24152 0.00000 1.00000 4.24152 - 7.99350 -8.15787 0.00000 1.00000 8.15787 - 8.01200 -10.9420 0.00000 1.00000 10.9420 - 8.03050 -12.3456 0.00000 1.00000 12.3456 - 8.04900 -12.4001 0.00000 1.00000 12.4001 - 8.06750 -11.3663 0.00000 1.00000 11.3663 - 8.08600 -9.63181 0.00000 1.00000 9.63181 - 8.10450 -7.58723 0.00000 1.00000 7.58723 - 8.12300 -5.52117 0.00000 1.00000 5.52117 - 8.14150 -3.56353 0.00000 1.00000 3.56353 - 8.16000 -1.69260 0.00000 1.00000 1.69260 - 8.17850 0.199827 0.00000 1.00000 -0.199827 - 8.19700 2.21044 0.00000 1.00000 -2.21044 - 8.21550 4.33057 0.00000 1.00000 -4.33057 - 8.23400 6.39218 0.00000 1.00000 -6.39218 - 8.25250 8.07555 0.00000 1.00000 -8.07555 - 8.27100 8.97896 0.00000 1.00000 -8.97896 - 8.28950 8.73073 0.00000 1.00000 -8.73073 - 8.30800 7.11016 0.00000 1.00000 -7.11016 - 8.32650 4.14151 0.00000 1.00000 -4.14151 - 8.34500 0.130936 0.00000 1.00000 -0.130936 - 8.36350 -4.36837 0.00000 1.00000 4.36837 - 8.38200 -8.65854 0.00000 1.00000 8.65854 - 8.40050 -12.0433 0.00000 1.00000 12.0433 - 8.41900 -13.9807 0.00000 1.00000 13.9807 - 8.43750 -14.2030 0.00000 1.00000 14.2030 - 8.45600 -12.7704 0.00000 1.00000 12.7704 - 8.47450 -10.0445 0.00000 1.00000 10.0445 - 8.49300 -6.58938 0.00000 1.00000 6.58938 - 8.51150 -3.02663 0.00000 1.00000 3.02663 - 8.53000 0.112114 0.00000 1.00000 -0.112114 - 8.54850 2.49566 0.00000 1.00000 -2.49566 - 8.56700 4.03580 0.00000 1.00000 -4.03580 - 8.58550 4.85377 0.00000 1.00000 -4.85377 - 8.60400 5.18537 0.00000 1.00000 -5.18537 - 8.62250 5.25808 0.00000 1.00000 -5.25808 - 8.64100 5.18193 0.00000 1.00000 -5.18193 - 8.65950 4.89182 0.00000 1.00000 -4.89182 - 8.67800 4.16349 0.00000 1.00000 -4.16349 - 8.69650 2.70252 0.00000 1.00000 -2.70252 - 8.71500 0.282220 0.00000 1.00000 -0.282220 - 8.73350 -3.11124 0.00000 1.00000 3.11124 - 8.75200 -7.17490 0.00000 1.00000 7.17490 - 8.77050 -11.2672 0.00000 1.00000 11.2672 - 8.78900 -14.4886 0.00000 1.00000 14.4886 - 8.80750 -15.8559 0.00000 1.00000 15.8559 - 8.82600 -14.5328 0.00000 1.00000 14.5328 - 8.84450 -10.0609 0.00000 1.00000 10.0609 - 8.86300 -2.52773 0.00000 1.00000 2.52773 - 8.88150 7.37428 0.00000 1.00000 -7.37428 - 8.90000 18.4240 0.00000 1.00000 -18.4240 - 8.91850 29.0726 0.00000 1.00000 -29.0726 - 8.93700 37.7295 0.00000 1.00000 -37.7295 - 8.95550 43.0717 0.00000 1.00000 -43.0717 - 8.97400 44.3044 0.00000 1.00000 -44.3044 - 8.99250 41.3154 0.00000 1.00000 -41.3154 - 9.01100 34.6857 0.00000 1.00000 -34.6857 - 9.02950 25.5570 0.00000 1.00000 -25.5570 - 9.04800 15.3859 0.00000 1.00000 -15.3859 - 9.06650 5.64529 0.00000 1.00000 -5.64529 - 9.08500 -2.45985 0.00000 1.00000 2.45985 - 9.10350 -8.19758 0.00000 1.00000 8.19758 - 9.12200 -11.3936 0.00000 1.00000 11.3936 - 9.14050 -12.3840 0.00000 1.00000 12.3840 - 9.15900 -11.8591 0.00000 1.00000 11.8591 - 9.17750 -10.6446 0.00000 1.00000 10.6446 - 9.19600 -9.48212 0.00000 1.00000 9.48212 - 9.21450 -8.86286 0.00000 1.00000 8.86286 - 9.23300 -8.95166 0.00000 1.00000 8.95166 - 9.25150 -9.60978 0.00000 1.00000 9.60978 - 9.27000 -10.4985 0.00000 1.00000 10.4985 - 9.28850 -11.2264 0.00000 1.00000 11.2264 - 9.30700 -11.4956 0.00000 1.00000 11.4956 - 9.32550 -11.2056 0.00000 1.00000 11.2056 - 9.34400 -10.4851 0.00000 1.00000 10.4851 - 9.36250 -9.64367 0.00000 1.00000 9.64367 - 9.38100 -9.05839 0.00000 1.00000 9.05839 - 9.39950 -9.03059 0.00000 1.00000 9.03059 - 9.41800 -9.65891 0.00000 1.00000 9.65891 - 9.43650 -10.7695 0.00000 1.00000 10.7695 - 9.45500 -11.9282 0.00000 1.00000 11.9282 - 9.47350 -12.5352 0.00000 1.00000 12.5352 - 9.49200 -11.9793 0.00000 1.00000 11.9793 - 9.51050 -9.80968 0.00000 1.00000 9.80968 - 9.52900 -5.88098 0.00000 1.00000 5.88098 - 9.54750 -0.429865 0.00000 1.00000 0.429865 - 9.56600 5.93738 0.00000 1.00000 -5.93738 - 9.58450 12.3467 0.00000 1.00000 -12.3467 - 9.60300 17.8253 0.00000 1.00000 -17.8253 - 9.62150 21.4983 0.00000 1.00000 -21.4983 - 9.64000 22.7684 0.00000 1.00000 -22.7684 - 9.65850 21.4353 0.00000 1.00000 -21.4353 - 9.67700 17.7297 0.00000 1.00000 -17.7297 - 9.69550 12.2556 0.00000 1.00000 -12.2556 - 9.71400 5.85940 0.00000 1.00000 -5.85940 - 9.73250 -0.539853 0.00000 1.00000 0.539853 - 9.75100 -6.11696 0.00000 1.00000 6.11696 - 9.76950 -10.2704 0.00000 1.00000 10.2704 - 9.78800 -12.6954 0.00000 1.00000 12.6954 - 9.80650 -13.3941 0.00000 1.00000 13.3941 - 9.82500 -12.6315 0.00000 1.00000 12.6315 - 9.84350 -10.8487 0.00000 1.00000 10.8487 - 9.86200 -8.55755 0.00000 1.00000 8.55755 - 9.88050 -6.24003 0.00000 1.00000 6.24003 - 9.89900 -4.27478 0.00000 1.00000 4.27478 - 9.91750 -2.90328 0.00000 1.00000 2.90328 - 9.93600 -2.23386 0.00000 1.00000 2.23386 - 9.95450 -2.27104 0.00000 1.00000 2.27104 - 9.97300 -2.95175 0.00000 1.00000 2.95175 - 9.99150 -4.17209 0.00000 1.00000 4.17209 - 10.0100 -5.79607 0.00000 1.00000 5.79607 - 10.0285 -7.64859 0.00000 1.00000 7.64859 - 10.0470 -9.50283 0.00000 1.00000 9.50283 - 10.0655 -11.0757 0.00000 1.00000 11.0757 - 10.0840 -12.0425 0.00000 1.00000 12.0425 - 10.1025 -12.0751 0.00000 1.00000 12.0751 - 10.1210 -10.9017 0.00000 1.00000 10.9017 - 10.1395 -8.37613 0.00000 1.00000 8.37613 - 10.1580 -4.54026 0.00000 1.00000 4.54026 - 10.1765 0.338357 0.00000 1.00000 -0.338357 - 10.1950 5.76996 0.00000 1.00000 -5.76996 - 10.2135 11.0939 0.00000 1.00000 -11.0939 - 10.2320 15.5741 0.00000 1.00000 -15.5741 - 10.2505 18.5225 0.00000 1.00000 -18.5225 - 10.2690 19.4270 0.00000 1.00000 -19.4270 - 10.2875 18.0567 0.00000 1.00000 -18.0567 - 10.3060 14.5227 0.00000 1.00000 -14.5227 - 10.3245 9.27796 0.00000 1.00000 -9.27796 - 10.3430 3.05599 0.00000 1.00000 -3.05599 - 10.3615 -3.24345 0.00000 1.00000 3.24345 - 10.3800 -8.70145 0.00000 1.00000 8.70145 - 10.3985 -12.5330 0.00000 1.00000 12.5330 - 10.4170 -14.2182 0.00000 1.00000 14.2182 - 10.4355 -13.5885 0.00000 1.00000 13.5885 - 10.4540 -10.8525 0.00000 1.00000 10.8525 - 10.4725 -6.55772 0.00000 1.00000 6.55772 - 10.4910 -1.49640 0.00000 1.00000 1.49640 - 10.5095 3.42852 0.00000 1.00000 -3.42852 - 10.5280 7.35363 0.00000 1.00000 -7.35363 - 10.5465 9.59717 0.00000 1.00000 -9.59717 - 10.5650 9.77054 0.00000 1.00000 -9.77054 - 10.5835 7.84234 0.00000 1.00000 -7.84234 - 10.6020 4.14584 0.00000 1.00000 -4.14584 - 10.6205 -0.671143 0.00000 1.00000 0.671143 - 10.6390 -5.74603 0.00000 1.00000 5.74603 - 10.6575 -10.1361 0.00000 1.00000 10.1361 - 10.6760 -12.9671 0.00000 1.00000 12.9671 - 10.6945 -13.5738 0.00000 1.00000 13.5738 - 10.7130 -11.6108 0.00000 1.00000 11.6108 - 10.7315 -7.11852 0.00000 1.00000 7.11852 - 10.7500 -0.532582 0.00000 1.00000 0.532582 - 10.7685 7.36496 0.00000 1.00000 -7.36496 - 10.7870 15.5502 0.00000 1.00000 -15.5502 - 10.8055 22.9046 0.00000 1.00000 -22.9046 - 10.8240 28.3836 0.00000 1.00000 -28.3836 - 10.8425 31.1819 0.00000 1.00000 -31.1819 - 10.8610 30.8667 0.00000 1.00000 -30.8667 - 10.8795 27.4544 0.00000 1.00000 -27.4544 - 10.8980 21.4174 0.00000 1.00000 -21.4174 - 10.9165 13.6149 0.00000 1.00000 -13.6149 - 10.9350 5.15717 0.00000 1.00000 -5.15717 - 10.9535 -2.77403 0.00000 1.00000 2.77403 - 10.9720 -9.11963 0.00000 1.00000 9.11963 - 10.9905 -13.1166 0.00000 1.00000 13.1166 - 11.0090 -14.4189 0.00000 1.00000 14.4189 - 11.0275 -13.1446 0.00000 1.00000 13.1446 - 11.0460 -9.84069 0.00000 1.00000 9.84069 - 11.0645 -5.37361 0.00000 1.00000 5.37361 - 11.0830 -0.766336 0.00000 1.00000 0.766336 - 11.1015 2.99059 0.00000 1.00000 -2.99059 - 11.1200 5.12102 0.00000 1.00000 -5.12102 - 11.1385 5.20555 0.00000 1.00000 -5.20555 - 11.1570 3.25580 0.00000 1.00000 -3.25580 - 11.1755 -0.295787 0.00000 1.00000 0.295787 - 11.1940 -4.68917 0.00000 1.00000 4.68917 - 11.2125 -8.99252 0.00000 1.00000 8.99252 - 11.2310 -12.2872 0.00000 1.00000 12.2872 - 11.2495 -13.8447 0.00000 1.00000 13.8447 - 11.2680 -13.2610 0.00000 1.00000 13.2610 - 11.2865 -10.5280 0.00000 1.00000 10.5280 - 11.3050 -6.02790 0.00000 1.00000 6.02790 - 11.3235 -0.457428 0.00000 1.00000 0.457428 - 11.3420 5.30272 0.00000 1.00000 -5.30272 - 11.3605 10.3468 0.00000 1.00000 -10.3468 - 11.3790 13.9003 0.00000 1.00000 -13.9003 - 11.3975 15.4459 0.00000 1.00000 -15.4459 - 11.4160 14.7993 0.00000 1.00000 -14.7993 - 11.4345 12.1251 0.00000 1.00000 -12.1251 - 11.4530 7.89515 0.00000 1.00000 -7.89515 - 11.4715 2.79743 0.00000 1.00000 -2.79743 - 11.4900 -2.38402 0.00000 1.00000 2.38402 - 11.5085 -6.89848 0.00000 1.00000 6.89848 - 11.5270 -10.1446 0.00000 1.00000 10.1446 - 11.5455 -11.7562 0.00000 1.00000 11.7562 - 11.5640 -11.6477 0.00000 1.00000 11.6477 - 11.5825 -10.0156 0.00000 1.00000 10.0156 - 11.6010 -7.29778 0.00000 1.00000 7.29778 - 11.6195 -4.09885 0.00000 1.00000 4.09885 - 11.6380 -1.08810 0.00000 1.00000 1.08810 - 11.6565 1.11439 0.00000 1.00000 -1.11439 - 11.6750 2.04788 0.00000 1.00000 -2.04788 - 11.6935 1.49867 0.00000 1.00000 -1.49867 - 11.7120 -0.451611 0.00000 1.00000 0.451611 - 11.7305 -3.42848 0.00000 1.00000 3.42848 - 11.7490 -6.82125 0.00000 1.00000 6.82125 - 11.7675 -9.88740 0.00000 1.00000 9.88740 - 11.7860 -11.8896 0.00000 1.00000 11.8896 - 11.8045 -12.2430 0.00000 1.00000 12.2430 - 11.8230 -10.6446 0.00000 1.00000 10.6446 - 11.8415 -7.15722 0.00000 1.00000 7.15722 - 11.8600 -2.22583 0.00000 1.00000 2.22583 - 11.8785 3.38458 0.00000 1.00000 -3.38458 - 11.8970 8.72108 0.00000 1.00000 -8.72108 - 11.9155 12.8213 0.00000 1.00000 -12.8213 - 11.9340 14.9032 0.00000 1.00000 -14.9032 - 11.9525 14.5281 0.00000 1.00000 -14.5281 - 11.9710 11.6999 0.00000 1.00000 -11.6999 - 11.9895 6.87776 0.00000 1.00000 -6.87776 - 12.0080 0.891504 0.00000 1.00000 -0.891504 - 12.0265 -5.22565 0.00000 1.00000 5.22565 - 12.0450 -10.4522 0.00000 1.00000 10.4522 - 12.0635 -13.9931 0.00000 1.00000 13.9931 - 12.0820 -15.4435 0.00000 1.00000 15.4435 - 12.1005 -14.8644 0.00000 1.00000 14.8644 - 12.1190 -12.7520 0.00000 1.00000 12.7520 - 12.1375 -9.90845 0.00000 1.00000 9.90845 - 12.1560 -7.24453 0.00000 1.00000 7.24453 - 12.1745 -5.56166 0.00000 1.00000 5.56166 - 12.1930 -5.36161 0.00000 1.00000 5.36161 - 12.2115 -6.72586 0.00000 1.00000 6.72586 - 12.2300 -9.28835 0.00000 1.00000 9.28835 - 12.2485 -12.3067 0.00000 1.00000 12.3067 - 12.2670 -14.8178 0.00000 1.00000 14.8178 - 12.2855 -15.8476 0.00000 1.00000 15.8476 - 12.3040 -14.6332 0.00000 1.00000 14.6332 - 12.3225 -10.8097 0.00000 1.00000 10.8097 - 12.3410 -4.52145 0.00000 1.00000 4.52145 - 12.3595 3.57058 0.00000 1.00000 -3.57058 - 12.3780 12.3893 0.00000 1.00000 -12.3893 - 12.3965 20.6314 0.00000 1.00000 -20.6314 - 12.4150 27.0092 0.00000 1.00000 -27.0092 - 12.4335 30.4959 0.00000 1.00000 -30.4959 - 12.4520 30.5247 0.00000 1.00000 -30.5247 - 12.4705 27.1034 0.00000 1.00000 -27.1034 - 12.4890 20.8197 0.00000 1.00000 -20.8197 - 12.5075 12.7348 0.00000 1.00000 -12.7348 - 12.5260 4.18409 0.00000 1.00000 -4.18409 - 12.5445 -3.47600 0.00000 1.00000 3.47600 - 12.5630 -9.12640 0.00000 1.00000 9.12640 - 12.5815 -12.0958 0.00000 1.00000 12.0958 - 12.6000 -12.2803 0.00000 1.00000 12.2803 - 12.6185 -10.1467 0.00000 1.00000 10.1467 - 12.6370 -6.61573 0.00000 1.00000 6.61573 - 12.6555 -2.84816 0.00000 1.00000 2.84816 - 12.6740 0.0234471 0.00000 1.00000 -0.0234471 - 12.6925 1.16051 0.00000 1.00000 -1.16051 - 12.7110 0.222329 0.00000 1.00000 -0.222329 - 12.7295 -2.53923 0.00000 1.00000 2.53923 - 12.7480 -6.31966 0.00000 1.00000 6.31966 - 12.7665 -9.93250 0.00000 1.00000 9.93250 - 12.7850 -12.0782 0.00000 1.00000 12.0782 - 12.8035 -11.6556 0.00000 1.00000 11.6556 - 12.8220 -8.04822 0.00000 1.00000 8.04822 - 12.8405 -1.31753 0.00000 1.00000 1.31753 - 12.8590 7.74657 0.00000 1.00000 -7.74657 - 12.8775 17.7420 0.00000 1.00000 -17.7420 - 12.8960 26.9214 0.00000 1.00000 -26.9214 - 12.9145 33.5578 0.00000 1.00000 -33.5578 - 12.9330 36.3277 0.00000 1.00000 -36.3277 - 12.9515 34.6234 0.00000 1.00000 -34.6234 - 12.9700 28.7156 0.00000 1.00000 -28.7156 - 12.9885 19.7233 0.00000 1.00000 -19.7233 - 13.0070 9.38804 0.00000 1.00000 -9.38804 - 13.0255 -0.297908 0.00000 1.00000 0.297908 - 13.0440 -7.52791 0.00000 1.00000 7.52791 - 13.0625 -11.0794 0.00000 1.00000 11.0794 - 13.0810 -10.5807 0.00000 1.00000 10.5807 - 13.0995 -6.58087 0.00000 1.00000 6.58087 - 13.1180 -0.404585 0.00000 1.00000 0.404585 - 13.1365 6.17556 0.00000 1.00000 -6.17556 - 13.1550 11.3708 0.00000 1.00000 -11.3708 - 13.1735 13.8053 0.00000 1.00000 -13.8053 - 13.1920 12.8357 0.00000 1.00000 -12.8357 - 13.2105 8.68336 0.00000 1.00000 -8.68336 - 13.2290 2.34908 0.00000 1.00000 -2.34908 - 13.2475 -4.66287 0.00000 1.00000 4.66287 - 13.2660 -10.7379 0.00000 1.00000 10.7379 - 13.2845 -14.5602 0.00000 1.00000 14.5602 - 13.3030 -15.4343 0.00000 1.00000 15.4343 - 13.3215 -13.4393 0.00000 1.00000 13.4393 - 13.3400 -9.37967 0.00000 1.00000 9.37967 - 13.3585 -4.55053 0.00000 1.00000 4.55053 - 13.3770 -0.382431 0.00000 1.00000 0.382431 - 13.3955 1.93839 0.00000 1.00000 -1.93839 - 13.4140 1.77366 0.00000 1.00000 -1.77366 - 13.4325 -0.818874 0.00000 1.00000 0.818874 - 13.4510 -5.13072 0.00000 1.00000 5.13072 - 13.4695 -10.0255 0.00000 1.00000 10.0255 - 13.4880 -14.2744 0.00000 1.00000 14.2744 - 13.5065 -16.9060 0.00000 1.00000 16.9060 - 13.5250 -17.4714 0.00000 1.00000 17.4714 - 13.5435 -16.1512 0.00000 1.00000 16.1512 - 13.5620 -13.6784 0.00000 1.00000 13.6784 - 13.5805 -11.1043 0.00000 1.00000 11.1043 - 13.5990 -9.47288 0.00000 1.00000 9.47288 - 13.6175 -9.49567 0.00000 1.00000 9.49567 - 13.6360 -11.3153 0.00000 1.00000 11.3153 - 13.6545 -14.4268 0.00000 1.00000 14.4268 - 13.6730 -17.7824 0.00000 1.00000 17.7824 - 13.6915 -20.0552 0.00000 1.00000 20.0552 - 13.7100 -19.9965 0.00000 1.00000 19.9965 - 13.7285 -16.7898 0.00000 1.00000 16.7898 - 13.7470 -10.3089 0.00000 1.00000 10.3089 - 13.7655 -1.20781 0.00000 1.00000 1.20781 - 13.7840 9.18567 0.00000 1.00000 -9.18567 - 13.8025 19.1488 0.00000 1.00000 -19.1488 - 13.8210 26.9489 0.00000 1.00000 -26.9489 - 13.8395 31.2366 0.00000 1.00000 -31.2366 - 13.8580 31.3496 0.00000 1.00000 -31.3496 - 13.8765 27.4511 0.00000 1.00000 -27.4511 - 13.8950 20.4697 0.00000 1.00000 -20.4697 - 13.9135 11.8582 0.00000 1.00000 -11.8582 - 13.9320 3.23523 0.00000 1.00000 -3.23523 - 13.9505 -3.99882 0.00000 1.00000 3.99882 - 13.9690 -8.96984 0.00000 1.00000 8.96984 - 13.9875 -11.4848 0.00000 1.00000 11.4848 - 14.0060 -11.9967 0.00000 1.00000 11.9967 - 14.0245 -11.3970 0.00000 1.00000 11.3970 - 14.0430 -10.7008 0.00000 1.00000 10.7008 - 14.0615 -10.7168 0.00000 1.00000 10.7168 - 14.0800 -11.7936 0.00000 1.00000 11.7936 - 14.0985 -13.7115 0.00000 1.00000 13.7115 - 14.1170 -15.7457 0.00000 1.00000 15.7457 - 14.1355 -16.8835 0.00000 1.00000 16.8835 - 14.1540 -16.1342 0.00000 1.00000 16.1342 - 14.1725 -12.8466 0.00000 1.00000 12.8466 - 14.1910 -6.94542 0.00000 1.00000 6.94542 - 14.2095 0.982134 0.00000 1.00000 -0.982134 - 14.2280 9.77953 0.00000 1.00000 -9.77953 - 14.2465 17.9729 0.00000 1.00000 -17.9729 - 14.2650 24.1178 0.00000 1.00000 -24.1178 - 14.2835 27.1485 0.00000 1.00000 -27.1485 - 14.3020 26.6355 0.00000 1.00000 -26.6355 - 14.3205 22.8839 0.00000 1.00000 -22.8839 - 14.3390 16.8479 0.00000 1.00000 -16.8479 - 14.3575 9.88786 0.00000 1.00000 -9.88786 - 14.3760 3.43554 0.00000 1.00000 -3.43554 - 14.3945 -1.34253 0.00000 1.00000 1.34253 - 14.4130 -3.79922 0.00000 1.00000 3.79922 - 14.4315 -3.91650 0.00000 1.00000 3.91650 - 14.4500 -2.25034 0.00000 1.00000 2.25034 - 14.4685 0.265934 0.00000 1.00000 -0.265934 - 14.4870 2.60091 0.00000 1.00000 -2.60091 - 14.5055 3.90902 0.00000 1.00000 -3.90902 - 14.5240 3.74411 0.00000 1.00000 -3.74411 - 14.5425 2.15013 0.00000 1.00000 -2.15013 - 14.5610 -0.388481 0.00000 1.00000 0.388481 - 14.5795 -3.11515 0.00000 1.00000 3.11515 - 14.5980 -5.23631 0.00000 1.00000 5.23631 - 14.6165 -6.15513 0.00000 1.00000 6.15513 - 14.6350 -5.63898 0.00000 1.00000 5.63898 - 14.6535 -3.87566 0.00000 1.00000 3.87566 - 14.6720 -1.40645 0.00000 1.00000 1.40645 - 14.6905 1.04029 0.00000 1.00000 -1.04029 - 14.7090 2.76304 0.00000 1.00000 -2.76304 - 14.7275 3.28473 0.00000 1.00000 -3.28473 - 14.7460 2.47788 0.00000 1.00000 -2.47788 - 14.7645 0.584519 0.00000 1.00000 -0.584519 - 14.7830 -1.87052 0.00000 1.00000 1.87052 - 14.8015 -4.24417 0.00000 1.00000 4.24417 - 14.8200 -5.96765 0.00000 1.00000 5.96765 - 14.8385 -6.70965 0.00000 1.00000 6.70965 - 14.8570 -6.46211 0.00000 1.00000 6.46211 - 14.8755 -5.52356 0.00000 1.00000 5.52356 - 14.8940 -4.38544 0.00000 1.00000 4.38544 - 14.9125 -3.55512 0.00000 1.00000 3.55512 - 14.9310 -3.36898 0.00000 1.00000 3.36898 - 14.9495 -3.85281 0.00000 1.00000 3.85281 - 14.9680 -4.67590 0.00000 1.00000 4.67590 - 14.9865 -5.21922 0.00000 1.00000 5.21922 - 15.0050 -4.74479 0.00000 1.00000 4.74479 - 15.0235 -2.62144 0.00000 1.00000 2.62144 - 15.0420 1.45687 0.00000 1.00000 -1.45687 - 15.0605 7.32500 0.00000 1.00000 -7.32500 - 15.0790 14.3193 0.00000 1.00000 -14.3193 - 15.0975 21.3835 0.00000 1.00000 -21.3835 - 15.1160 27.2852 0.00000 1.00000 -27.2852 - 15.1345 30.8902 0.00000 1.00000 -30.8902 - 15.1530 31.4245 0.00000 1.00000 -31.4245 - 15.1715 28.6588 0.00000 1.00000 -28.6588 - 15.1900 22.9682 0.00000 1.00000 -22.9682 - 15.2085 15.2541 0.00000 1.00000 -15.2541 - 15.2270 6.74712 0.00000 1.00000 -6.74712 - 15.2455 -1.25964 0.00000 1.00000 1.25964 - 15.2640 -7.68049 0.00000 1.00000 7.68049 - 15.2825 -11.8442 0.00000 1.00000 11.8442 - 15.3010 -13.5919 0.00000 1.00000 13.5919 - 15.3195 -13.2493 0.00000 1.00000 13.2493 - 15.3380 -11.4916 0.00000 1.00000 11.4916 - 15.3565 -9.14144 0.00000 1.00000 9.14144 - 15.3750 -6.95504 0.00000 1.00000 6.95504 - 15.3935 -5.44896 0.00000 1.00000 5.44896 - 15.4120 -4.80772 0.00000 1.00000 4.80772 - 15.4305 -4.88897 0.00000 1.00000 4.88897 - 15.4490 -5.31706 0.00000 1.00000 5.31706 - 15.4675 -5.63285 0.00000 1.00000 5.63285 - 15.4860 -5.45462 0.00000 1.00000 5.45462 - 15.5045 -4.60459 0.00000 1.00000 4.60459 - 15.5230 -3.16776 0.00000 1.00000 3.16776 - 15.5415 -1.46992 0.00000 1.00000 1.46992 - 15.5600 0.0157586 0.00000 1.00000 -0.0157586 - 15.5785 0.806047 0.00000 1.00000 -0.806047 - 15.5970 0.550242 0.00000 1.00000 -0.550242 - 15.6155 -0.861348 0.00000 1.00000 0.861348 - 15.6340 -3.25430 0.00000 1.00000 3.25430 - 15.6525 -6.20584 0.00000 1.00000 6.20584 - 15.6710 -9.14992 0.00000 1.00000 9.14992 - 15.6895 -11.5204 0.00000 1.00000 11.5204 - 15.7080 -12.8909 0.00000 1.00000 12.8909 - 15.7265 -13.0717 0.00000 1.00000 13.0717 - 15.7450 -12.1417 0.00000 1.00000 12.1417 - 15.7635 -10.4097 0.00000 1.00000 10.4097 - 15.7820 -8.32011 0.00000 1.00000 8.32011 - 15.8005 -6.33136 0.00000 1.00000 6.33136 - 15.8190 -4.80087 0.00000 1.00000 4.80087 - 15.8375 -3.90675 0.00000 1.00000 3.90675 - 15.8560 -3.62474 0.00000 1.00000 3.62474 - 15.8745 -3.76225 0.00000 1.00000 3.76225 - 15.8930 -4.03596 0.00000 1.00000 4.03596 - 15.9115 -4.16761 0.00000 1.00000 4.16761 - 15.9300 -3.96959 0.00000 1.00000 3.96959 - 15.9485 -3.39629 0.00000 1.00000 3.39629 - 15.9670 -2.54969 0.00000 1.00000 2.54969 - 15.9855 -1.64188 0.00000 1.00000 1.64188 - 16.0040 -0.928772 0.00000 1.00000 0.928772 - 16.0225 -0.634845 0.00000 1.00000 0.634845 - 16.0410 -0.888145 0.00000 1.00000 0.888145 - 16.0595 -1.67980 0.00000 1.00000 1.67980 - 16.0780 -2.85514 0.00000 1.00000 2.85514 - 16.0965 -4.13661 0.00000 1.00000 4.13661 - 16.1150 -5.17310 0.00000 1.00000 5.17310 - 16.1335 -5.60636 0.00000 1.00000 5.60636 - 16.1520 -5.14159 0.00000 1.00000 5.14159 - 16.1705 -3.60734 0.00000 1.00000 3.60734 - 16.1890 -0.992023 0.00000 1.00000 0.992023 - 16.2075 2.54958 0.00000 1.00000 -2.54958 - 16.2260 6.71807 0.00000 1.00000 -6.71807 - 16.2445 11.1120 0.00000 1.00000 -11.1120 - 16.2630 15.2812 0.00000 1.00000 -15.2812 - 16.2815 18.7822 0.00000 1.00000 -18.7822 - 16.3000 21.2269 0.00000 1.00000 -21.2269 - 16.3185 22.3212 0.00000 1.00000 -22.3212 - 16.3370 21.8912 0.00000 1.00000 -21.8912 - 16.3555 19.8991 0.00000 1.00000 -19.8991 - 16.3740 16.4493 0.00000 1.00000 -16.4493 - 16.3925 11.7863 0.00000 1.00000 -11.7863 - 16.4110 6.28331 0.00000 1.00000 -6.28331 - 16.4295 0.418687 0.00000 1.00000 -0.418687 - 16.4480 -5.25963 0.00000 1.00000 5.25963 - 16.4665 -10.1842 0.00000 1.00000 10.1842 - 16.4850 -13.8295 0.00000 1.00000 13.8295 - 16.5035 -15.7785 0.00000 1.00000 15.7785 - 16.5220 -15.7830 0.00000 1.00000 15.7830 - 16.5405 -13.8070 0.00000 1.00000 13.8070 - 16.5590 -10.0391 0.00000 1.00000 10.0391 - 16.5775 -4.87264 0.00000 1.00000 4.87264 - 16.5960 1.14589 0.00000 1.00000 -1.14589 - 16.6145 7.38649 0.00000 1.00000 -7.38649 - 16.6330 13.2091 0.00000 1.00000 -13.2091 - 16.6515 18.0296 0.00000 1.00000 -18.0296 - 16.6700 21.3708 0.00000 1.00000 -21.3708 - 16.6885 22.8991 0.00000 1.00000 -22.8991 - 16.7070 22.4456 0.00000 1.00000 -22.4456 - 16.7255 20.0158 0.00000 1.00000 -20.0158 - 16.7440 15.7881 0.00000 1.00000 -15.7881 - 16.7625 10.1035 0.00000 1.00000 -10.1035 - 16.7810 3.44424 0.00000 1.00000 -3.44424 - 16.7995 -3.59847 0.00000 1.00000 3.59847 - 16.8180 -10.3717 0.00000 1.00000 10.3717 - 16.8365 -16.2205 0.00000 1.00000 16.2205 - 16.8550 -20.5580 0.00000 1.00000 20.5580 - 16.8735 -22.9372 0.00000 1.00000 22.9372 - 16.8920 -23.1129 0.00000 1.00000 23.1129 - 16.9105 -21.0837 0.00000 1.00000 21.0837 - 16.9290 -17.1032 0.00000 1.00000 17.1032 - 16.9475 -11.6563 0.00000 1.00000 11.6563 - 16.9660 -5.39998 0.00000 1.00000 5.39998 - 16.9845 0.923758 0.00000 1.00000 -0.923758 - 17.0030 6.59122 0.00000 1.00000 -6.59122 - 17.0215 10.9979 0.00000 1.00000 -10.9979 - 17.0400 13.7383 0.00000 1.00000 -13.7383 - 17.0585 14.6477 0.00000 1.00000 -14.6477 - 17.0770 13.7998 0.00000 1.00000 -13.7998 - 17.0955 11.4638 0.00000 1.00000 -11.4638 - 17.1140 8.03578 0.00000 1.00000 -8.03578 - 17.1325 3.96378 0.00000 1.00000 -3.96378 - 17.1510 -0.316698 0.00000 1.00000 0.316698 - 17.1695 -4.42438 0.00000 1.00000 4.42438 - 17.1880 -8.04681 0.00000 1.00000 8.04681 - 17.2065 -10.9324 0.00000 1.00000 10.9324 - 17.2250 -12.8725 0.00000 1.00000 12.8725 - 17.2435 -13.6898 0.00000 1.00000 13.6898 - 17.2620 -13.2456 0.00000 1.00000 13.2456 - 17.2805 -11.4675 0.00000 1.00000 11.4675 - 17.2990 -8.39144 0.00000 1.00000 8.39144 - 17.3175 -4.20001 0.00000 1.00000 4.20001 - 17.3360 0.758004 0.00000 1.00000 -0.758004 - 17.3545 5.98116 0.00000 1.00000 -5.98116 - 17.3730 10.8661 0.00000 1.00000 -10.8661 - 17.3915 14.7906 0.00000 1.00000 -14.7906 - 17.4100 17.2137 0.00000 1.00000 -17.2137 - 17.4285 17.7745 0.00000 1.00000 -17.7745 - 17.4470 16.3661 0.00000 1.00000 -16.3661 - 17.4655 13.1690 0.00000 1.00000 -13.1690 - 17.4840 8.63053 0.00000 1.00000 -8.63053 - 17.5025 3.39246 0.00000 1.00000 -3.39246 - 17.5210 -1.82203 0.00000 1.00000 1.82203 - 17.5395 -6.33848 0.00000 1.00000 6.33848 - 17.5580 -9.64981 0.00000 1.00000 9.64981 - 17.5765 -11.4978 0.00000 1.00000 11.4978 - 17.5950 -11.9009 0.00000 1.00000 11.9009 - 17.6135 -11.1239 0.00000 1.00000 11.1239 - 17.6320 -9.59944 0.00000 1.00000 9.59944 - 17.6505 -7.81972 0.00000 1.00000 7.81972 - 17.6690 -6.22442 0.00000 1.00000 6.22442 - 17.6875 -5.11122 0.00000 1.00000 5.11122 - 17.7060 -4.58875 0.00000 1.00000 4.58875 - 17.7245 -4.58029 0.00000 1.00000 4.58029 - 17.7430 -4.87225 0.00000 1.00000 4.87225 - 17.7615 -5.18968 0.00000 1.00000 5.18968 - 17.7800 -5.27616 0.00000 1.00000 5.27616 - 17.7985 -4.95771 0.00000 1.00000 4.95771 - 17.8170 -4.17763 0.00000 1.00000 4.17763 - 17.8355 -2.99861 0.00000 1.00000 2.99861 - 17.8540 -1.57655 0.00000 1.00000 1.57655 - 17.8725 -0.115674 0.00000 1.00000 0.115674 - 17.8910 1.18232 0.00000 1.00000 -1.18232 - 17.9095 2.16253 0.00000 1.00000 -2.16253 - 17.9280 2.74507 0.00000 1.00000 -2.74507 - 17.9465 2.93310 0.00000 1.00000 -2.93310 - 17.9650 2.80225 0.00000 1.00000 -2.80225 - 17.9835 2.47685 0.00000 1.00000 -2.47685 - 18.0020 2.09940 0.00000 1.00000 -2.09940 - 18.0205 1.79907 0.00000 1.00000 -1.79907 - 18.0390 1.66403 0.00000 1.00000 -1.66403 - 18.0575 1.72260 0.00000 1.00000 -1.72260 - 18.0760 1.93703 0.00000 1.00000 -1.93703 - 18.0945 2.21113 0.00000 1.00000 -2.21113 - 18.1130 2.40837 0.00000 1.00000 -2.40837 - 18.1315 2.37442 0.00000 1.00000 -2.37442 - 18.1500 1.95988 0.00000 1.00000 -1.95988 - 18.1685 1.04724 0.00000 1.00000 -1.04724 - 18.1870 -0.426523 0.00000 1.00000 0.426523 - 18.2055 -2.45315 0.00000 1.00000 2.45315 - 18.2240 -4.90773 0.00000 1.00000 4.90773 - 18.2425 -7.52944 0.00000 1.00000 7.52944 - 18.2610 -9.92715 0.00000 1.00000 9.92715 - 18.2795 -11.6174 0.00000 1.00000 11.6174 - 18.2980 -12.0956 0.00000 1.00000 12.0956 - 18.3165 -10.9327 0.00000 1.00000 10.9327 - 18.3350 -7.88331 0.00000 1.00000 7.88331 - 18.3535 -2.98071 0.00000 1.00000 2.98071 - 18.3720 3.40650 0.00000 1.00000 -3.40650 - 18.3905 10.5811 0.00000 1.00000 -10.5811 - 18.4090 17.5968 0.00000 1.00000 -17.5968 - 18.4275 23.4036 0.00000 1.00000 -23.4036 - 18.4460 27.0310 0.00000 1.00000 -27.0310 - 18.4645 27.7731 0.00000 1.00000 -27.7731 - 18.4830 25.3345 0.00000 1.00000 -25.3345 - 18.5015 19.9052 0.00000 1.00000 -19.9052 - 18.5200 12.1472 0.00000 1.00000 -12.1472 - 18.5385 3.09099 0.00000 1.00000 -3.09099 - 18.5570 -6.03798 0.00000 1.00000 6.03798 - 18.5755 -14.0281 0.00000 1.00000 14.0281 - 18.5940 -19.8843 0.00000 1.00000 19.8843 - 18.6125 -22.9844 0.00000 1.00000 22.9844 - 18.6310 -23.1597 0.00000 1.00000 23.1597 - 18.6495 -20.6881 0.00000 1.00000 20.6881 - 18.6680 -16.2075 0.00000 1.00000 16.2075 - 18.6865 -10.5714 0.00000 1.00000 10.5714 - 18.7050 -4.68098 0.00000 1.00000 4.68098 - 18.7235 0.671251 0.00000 1.00000 -0.671251 - 18.7420 4.91529 0.00000 1.00000 -4.91529 - 18.7605 7.75797 0.00000 1.00000 -7.75797 - 18.7790 9.17588 0.00000 1.00000 -9.17588 - 18.7975 9.35965 0.00000 1.00000 -9.35965 - 18.8160 8.63035 0.00000 1.00000 -8.63035 - 18.8345 7.35145 0.00000 1.00000 -7.35145 - 18.8530 5.85510 0.00000 1.00000 -5.85510 - 18.8715 4.39513 0.00000 1.00000 -4.39513 - 18.8900 3.13002 0.00000 1.00000 -3.13002 - 18.9085 2.13168 0.00000 1.00000 -2.13168 - 18.9270 1.40976 0.00000 1.00000 -1.40976 - 18.9455 0.939913 0.00000 1.00000 -0.939913 - 18.9640 0.686429 0.00000 1.00000 -0.686429 - 18.9825 0.614229 0.00000 1.00000 -0.614229 - 19.0010 0.690570 0.00000 1.00000 -0.690570 - 19.0195 0.880032 0.00000 1.00000 -0.880032 - 19.0380 1.13788 0.00000 1.00000 -1.13788 - 19.0565 1.40627 0.00000 1.00000 -1.40627 - 19.0750 1.61604 0.00000 1.00000 -1.61604 - 19.0935 1.69418 0.00000 1.00000 -1.69418 - 19.1120 1.57467 0.00000 1.00000 -1.57467 - 19.1305 1.20912 0.00000 1.00000 -1.20912 - 19.1490 0.574418 0.00000 1.00000 -0.574418 - 19.1675 -0.322868 0.00000 1.00000 0.322868 - 19.1860 -1.44364 0.00000 1.00000 1.44364 - 19.2045 -2.71278 0.00000 1.00000 2.71278 - 19.2230 -4.01492 0.00000 1.00000 4.01492 - 19.2415 -5.19189 0.00000 1.00000 5.19189 - 19.2600 -6.04623 0.00000 1.00000 6.04623 - 19.2785 -6.35560 0.00000 1.00000 6.35560 - 19.2970 -5.90135 0.00000 1.00000 5.90135 - 19.3155 -4.51168 0.00000 1.00000 4.51168 - 19.3340 -2.11474 0.00000 1.00000 2.11474 - 19.3525 1.20914 0.00000 1.00000 -1.20914 - 19.3710 5.19105 0.00000 1.00000 -5.19105 - 19.3895 9.36912 0.00000 1.00000 -9.36912 - 19.4080 13.1271 0.00000 1.00000 -13.1271 - 19.4265 15.7779 0.00000 1.00000 -15.7779 - 19.4450 16.6827 0.00000 1.00000 -16.6827 - 19.4635 15.3867 0.00000 1.00000 -15.3867 - 19.4820 11.7418 0.00000 1.00000 -11.7418 - 19.5005 5.98757 0.00000 1.00000 -5.98757 - 19.5190 -1.23710 0.00000 1.00000 1.23710 - 19.5375 -8.96359 0.00000 1.00000 8.96359 - 19.5560 -16.0382 0.00000 1.00000 16.0382 - 19.5745 -21.3164 0.00000 1.00000 21.3164 - 19.5930 -23.8699 0.00000 1.00000 23.8699 - 19.6115 -23.1644 0.00000 1.00000 23.1644 - 19.6300 -19.1740 0.00000 1.00000 19.1740 - 19.6485 -12.4057 0.00000 1.00000 12.4057 - 19.6670 -3.82669 0.00000 1.00000 3.82669 - 19.6855 5.29471 0.00000 1.00000 -5.29471 - 19.7040 13.6058 0.00000 1.00000 -13.6058 - 19.7225 19.9014 0.00000 1.00000 -19.9014 - 19.7410 23.3260 0.00000 1.00000 -23.3260 - 19.7595 23.5068 0.00000 1.00000 -23.5068 - 19.7780 20.5929 0.00000 1.00000 -20.5929 - 19.7965 15.1973 0.00000 1.00000 -15.1973 - 19.8150 8.25741 0.00000 1.00000 -8.25741 - 19.8335 0.846490 0.00000 1.00000 -0.846490 - 19.8520 -6.02165 0.00000 1.00000 6.02165 - 19.8705 -11.5565 0.00000 1.00000 11.5565 - 19.8890 -15.2939 0.00000 1.00000 15.2939 - 19.9075 -17.1257 0.00000 1.00000 17.1257 - 19.9260 -17.2573 0.00000 1.00000 17.2573 - 19.9445 -16.1119 0.00000 1.00000 16.1119 - 19.9630 -14.2055 0.00000 1.00000 14.2055 - 19.9815 -12.0275 0.00000 1.00000 12.0275 - 20.0000 -9.95383 0.00000 1.00000 9.95383 diff --git a/diffpy/pdffit2/tests/testdata/badNi.stru b/diffpy/pdffit2/tests/testdata/badNi.stru deleted file mode 100644 index d0b980cb..00000000 --- a/diffpy/pdffit2/tests/testdata/badNi.stru +++ /dev/null @@ -1,32 +0,0 @@ -title structure Ni FCC -format pdffit -scale 1.000000 -sharp 0.000000, 1.000000, 0.000000 -spcgr Fm-3m -cell 3.520000, 3.520000, 3.520000, 90.000000, 90.000000, 90.000000 -dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 -ncell 1, 1, 1, 4 -atoms -NI 0.00000000 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.00000000 0.50000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 diff --git a/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru b/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru deleted file mode 100644 index 089db0da..00000000 --- a/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru +++ /dev/null @@ -1,33 +0,0 @@ -title structure Ni FCC -format pdffit -scale 1.000000 -sharp 0.000000, 1.000000, 0.000000 -spcgr Fm-3m -cell 3.520000, 3.520000, 3.520000, 90.000000, 90.000000, 0.000000 -dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 -ncell 1, 1, 1, 4 -atoms -NI 0.00000000 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.00000000 0.50000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 diff --git a/diffpy/pdffit2/tests/testdata/noLattice.stru b/diffpy/pdffit2/tests/testdata/noLattice.stru deleted file mode 100644 index 4f8e7212..00000000 --- a/diffpy/pdffit2/tests/testdata/noLattice.stru +++ /dev/null @@ -1,32 +0,0 @@ -title structure Ni FCC -format pdffit -scale 1.000000 -sharp 0.000000, 1.000000, 0.000000 -spcgr Fm-3m -cell 3.520000, 3.520000, -3.520000, 90.000000, 90.000000, 90.000000 -dcell 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000 -ncell 1, 1, 1, 4 -atoms -NI 0.00000000 0.00000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.00000000 0.50000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 -NI 0.50000000 0.50000000 0.00000000 1.0000 - 0.00000000 0.00000000 0.00000000 0.0000 - 0.00126651 0.00126651 0.00126651 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 diff --git a/diffpy/pdffit2/version.py b/diffpy/pdffit2/version.py deleted file mode 100644 index 0e60302c..00000000 --- a/diffpy/pdffit2/version.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2008 trustees of the Michigan State University. -# All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -""" -Definition of __version__, __date__, __timestamp__, __git_commit__. - -Notes ------ -Variable `__gitsha__` is deprecated as of version 1.2. -Use `__git_commit__` instead. -""" - -__all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] - -import os.path - -from pkg_resources import resource_filename - -# obtain version information from the version.cfg file -cp = dict(version="", date="", commit="", timestamp="0") -fcfg = resource_filename(__name__, "version.cfg") -if not os.path.isfile(fcfg): # pragma: no cover - from warnings import warn - - warn('Package metadata not found, execute "./setup.py egg_info".') - fcfg = os.devnull -with open(fcfg) as fp: - kwords = [[w.strip() for w in line.split(" = ", 1)] for line in fp if line[:1].isalpha() and " = " in line] -assert all(w[0] in cp for w in kwords), "received unrecognized keyword" -cp.update(kwords) - -__version__ = cp["version"] -__date__ = cp["date"] -__git_commit__ = cp["commit"] -__timestamp__ = int(cp["timestamp"]) - -# TODO remove deprecated __gitsha__ in version 1.3. -__gitsha__ = __git_commit__ - -del cp, fcfg, fp, kwords - -# End of file diff --git a/libpdffit2/Atom.cc b/libpdffit2/Atom.cc deleted file mode 100644 index aa2e66f2..00000000 --- a/libpdffit2/Atom.cc +++ /dev/null @@ -1,104 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class Atom -* -* Comments: -* -***********************************************************************/ - -#include - -#include "Atom.h" -#include "MathUtils.h" -#include "LocalPeriodicTable.h" - -using namespace std; - -// class data - private - - -Atom::AtomFormat Atom::streamformat = Atom::DISCUS; - - -// public class methods - - -void Atom::setDiscusFormat() -{ - Atom::streamformat = DISCUS; -} - - -void Atom::setPdffitFormat() -{ - Atom::streamformat = PDFFIT; -} - - -// private methods - - -istream& Atom::read_discus_atom(istream& in) -{ - double B; - string symbol; - const double fac = 1.0 / (8.0*M_PI*M_PI); - in >> symbol >> pos[0] >> pos[1] >> pos[2] >> B; - if (!in) return in; - // here we read successfully - const LocalPeriodicTable* lpt = LocalPeriodicTable::instance(); - atom_type = lpt->lookup(symbol); - fill_n(u, 3, fac*B); - fill_n(u+3, 3, 0.0); - occ = 1.0; - docc = 0.0; - fill_n(dpos, 3, 0.0); - fill_n(du, 6, 0.0); - return in; -} - - -istream& Atom::read_pdffit_atom(istream& in) -{ - string symbol; - in >> symbol >> pos[0] >> pos[1] >> pos[2] >> occ >> - dpos[0] >> dpos[1] >> dpos[2] >> docc >> - u[0] >> u[1] >> u[2] >> - du[0] >> du[1] >> du[2] >> - u[3] >> u[4] >> u[5] >> - du[3] >> du[4] >> du[5]; - if (!in) return in; - // here we read successfully - const LocalPeriodicTable* lpt = LocalPeriodicTable::instance(); - atom_type = lpt->lookup(symbol); - return in; -} - - -// non-member operators - - -istream& operator>>(istream& in, Atom& a) -{ - switch (Atom::streamformat) - { - case Atom::DISCUS: return a.read_discus_atom(in); - case Atom::PDFFIT: return a.read_pdffit_atom(in); - }; - return in; -} - - -// End of file diff --git a/libpdffit2/Atom.h b/libpdffit2/Atom.h deleted file mode 100644 index 11955036..00000000 --- a/libpdffit2/Atom.h +++ /dev/null @@ -1,70 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class Atom -* -* Comments: -* -***********************************************************************/ - -#ifndef ATOM_H_INCLUDED -#define ATOM_H_INCLUDED - -#include -#include "AtomType.h" - -class PdfFit; -class DataSet; -class Phase; - -class Atom -{ - // friends who need to touch offset - friend class PdfFit; - friend class DataSet; - friend class Phase; - friend std::istream& operator>>(std::istream& in, Atom& a); - - public: - - // class methods - static void setDiscusFormat(); - static void setPdffitFormat(); - - // data - const AtomType* atom_type; - double weight; // normalized scattering factor - double pos[3], dpos[3]; - double u[6], du[6]; - double occ, docc; - - private: - - // types and class data - enum AtomFormat { DISCUS, PDFFIT }; - static AtomFormat streamformat; - - // data - int offset; - - // methods - std::istream& read_discus_atom(std::istream& in); - std::istream& read_pdffit_atom(std::istream& in); -}; - -// non-member operators - -std::istream& operator>>(std::istream& in, Atom& a); - -#endif // ATOM_H_INCLUDED diff --git a/libpdffit2/AtomType.h b/libpdffit2/AtomType.h deleted file mode 100644 index 4c002e8d..00000000 --- a/libpdffit2/AtomType.h +++ /dev/null @@ -1,76 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class AtomType -* -* Comments: storage of element properties like name, symbol, -* atomic mass or scattering power -* -***********************************************************************/ - -#ifndef ATOMTYPE_H_INCLUDED -#define ATOMTYPE_H_INCLUDED - -#include -#include -#include - -class AtomType -{ - public: - // Data - std::string symbol; // element symbol - std::string name; // element name - bool isotope; // flag for isotopes - int z; // atomic number - double M; // atomic mass - int charge; // total charge in e - double radius; // ionic radius - double xsf; // x-ray scattering factor - double nsf; // neutron scattering factor - - // Constructor - AtomType() - { - z = 0; - M = 0.0; - isotope = false; - charge = 0; - radius = 0.0; - xsf = 0.0; - nsf = 0.0; - } - - // Methods - double sf(char scattering_type) const - { - switch (scattering_type) - { - case 'x': - case 'X': - return xsf; - case 'n': - case 'N': - return nsf; - default: - std::ostringstream emsg; - emsg << "Invalid scattering type '" << - scattering_type << "'"; - throw std::runtime_error(emsg.str()); - } - return 0.0; - } -}; - -#endif // ATOMTYPE_H_INCLUDED diff --git a/libpdffit2/LocalPeriodicTable.cc b/libpdffit2/LocalPeriodicTable.cc deleted file mode 100644 index 482f2f10..00000000 --- a/libpdffit2/LocalPeriodicTable.cc +++ /dev/null @@ -1,147 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2008 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class LocalPeriodicTable -* -* Comments: Light-weight class which allows redefinitions of scattering -* factors. This class throws ValueError for unknown elements. -* -***********************************************************************/ - -#include -#include "LocalPeriodicTable.h" -#include "exceptions.h" - -using namespace std; - - -// public class methods - - -const LocalPeriodicTable* LocalPeriodicTable::instance() -{ - static unique_ptr the_table(new LocalPeriodicTable()); - return the_table.get(); -} - - -// constructor - - -LocalPeriodicTable::LocalPeriodicTable() -{ - // private data - this->_periodic_table = PeriodicTable::instance(); -} - - -// public methods - - -const AtomType* LocalPeriodicTable::name(const string& nm) const -{ - const AtomType* atp0; - try { - atp0 = this->_periodic_table->name(nm); - } - catch (runtime_error e) { - throw ValueError(e.what()); - } - const AtomType* atp = local_symbol(atp0->symbol); - return atp; -} - - -const AtomType* LocalPeriodicTable::symbol(const string& smbl) const -{ - const AtomType* atp = local_symbol(smbl); - return atp; -} - - -const AtomType* LocalPeriodicTable::lookup(const string& pat) const -{ - const AtomType* atp0; - try { - atp0 = this->_periodic_table->lookup(pat); - } - catch (runtime_error e) { - throw ValueError(e.what()); - } - const AtomType* atp = local_symbol(atp0->symbol); - return atp; -} - - -bool LocalPeriodicTable::has(const string& pat) const -{ - return this->_periodic_table->has(pat); -} - - -void LocalPeriodicTable::reset(const string& smbl) -{ - const AtomType* atp0; - try { - atp0 = this->_periodic_table->symbol(smbl); - } - catch (runtime_error e) { - throw ValueError(e.what()); - } - // overwrite with default only when smbl is in the local table - if (this->_local_table.count(smbl)) - { - this->_local_table[smbl] = *atp0; - } -} - - -void LocalPeriodicTable::setXsf(const string& smbl, double xsf) -{ - AtomType* atp = this->local_symbol(smbl); - atp->xsf = xsf; -} - - -void LocalPeriodicTable::setNsf(const string& smbl, double nsf) -{ - AtomType* atp = this->local_symbol(smbl); - atp->nsf = nsf; -} - - -// private methods - - -AtomType* LocalPeriodicTable::local_symbol(const string& smbl) const -{ - map::iterator atplocal; - atplocal = this->_local_table.find(smbl); - if (atplocal == this->_local_table.end()) - { - const AtomType* atp0; - try { - atp0 = this->_periodic_table->symbol(smbl); - } - catch (runtime_error e) { - throw ValueError(e.what()); - } - atplocal = this->_local_table.insert(make_pair(smbl, *atp0)).first; - } - AtomType* atp = &(atplocal->second); - return atp; -} - - -// End of file diff --git a/libpdffit2/LocalPeriodicTable.h b/libpdffit2/LocalPeriodicTable.h deleted file mode 100644 index 551faee5..00000000 --- a/libpdffit2/LocalPeriodicTable.h +++ /dev/null @@ -1,63 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2008 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class LocalPeriodicTable -* -* Comments: Light-weight class which allows redefinitions of scattering -* factors. It keeps a local copy of each looked up species, -* which can be redefined. -* This class also throws ValueError for unknown elements. -* -***********************************************************************/ - -#ifndef LOCALPERIODICTABLE_H_INCLUDED -#define LOCALPERIODICTABLE_H_INCLUDED - -#include -#include -#include "PeriodicTable.h" - -class LocalPeriodicTable -{ - public: - - // class methods - - // common instance for clients that do not need to own one - static const LocalPeriodicTable* instance(); - - // constructor - LocalPeriodicTable(); - - // methods - const AtomType* name(const std::string& nm) const; - const AtomType* symbol(const std::string& smbl) const; - const AtomType* lookup(const std::string& pat) const; - bool has(const std::string& pat) const; - void reset(const std::string& smbl); - void setXsf(const std::string& smbl, double xsf); - void setNsf(const std::string& smbl, double nsf); - - private: - - // data - PeriodicTable* _periodic_table; - mutable std::map _local_table; - - // methods - AtomType* local_symbol(const std::string& smbl) const; - -}; - -#endif // LOCALPERIODICTABLE_H_INCLUDED diff --git a/libpdffit2/MathUtils.h b/libpdffit2/MathUtils.h deleted file mode 100644 index 21240276..00000000 --- a/libpdffit2/MathUtils.h +++ /dev/null @@ -1,94 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2007 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch, Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Math functions and numerical constants for pdffit2 and formula parser. -* -* Comments: -* -***********************************************************************/ - -#ifndef MATHUTILS_H_INCLUDED -#define MATHUTILS_H_INCLUDED - -#include -#include - -// numerical constants -const double rad = M_PI/180.0; -const double double_eps = (1.0 + sqrt(std::numeric_limits().epsilon())) - 1.0; -const double double_max = std::numeric_limits().max(); -const double deltar_tol = 1.0e-3; - -// MS compatibility fix - define functions not provided by MSVC cmath -#ifdef _MSC_VER -#include - -#if _MSC_VER < 1800 // log2 has been available since MSVC 2013 -inline double log2(double x) { return log(x)/log(2.0); } -#endif - -inline int isnan(double x) { return _isnan(x); } -inline double round(double x) { return (x < 0) ? ceil(x - 0.5) : floor(x + 0.5); } - -#endif // _MSC_VER - -// nearest integer -inline int nint(const double x) -{ - return (int) round(x); -} - -// math functions and derivatives used in formula parser - -inline double neg(double x) { return -x; } -inline double dneg(double x) { return -1.0; } - -inline double sqr(double x) { return x*x; } -inline double dsqr(double x) { return 2.0*x; } - -inline double cube(double x) { return x*x*x; } -inline double dcube(double x) { return 3.0*sqr(x); } - -inline double dsqrt(double x) { return 0.5/sqrt(x); } - -inline double dexp(double x) { return exp(x); } -inline double dlog(double x) { return 1.0/x; } - -inline double sind(double x) { return sin(rad*x); } -inline double dsind(double x) { return rad*cos(rad*x); } - -inline double cosd(double x) { return cos(rad*x); } -inline double dcosd(double x) { return -rad*sin(rad*x); } - -inline double tand(double x) { return tan(rad*x); } -inline double dtand(double x) { return rad/sqr(cosd(x)); } - -inline double dsin(double x) { return cos(x); } -inline double dcos(double x) { return -sin(x); } -inline double dtan(double x) { return 1.0/sqr(cos(x)); } - -inline double dasin(double x) { return 1.0/sqrt(1.0 - x*x); } -inline double dacos(double x) { return -1.0/sqrt(1.0 - x*x); } -inline double datan(double x) { return 1/(1+sqr(x)); } - -inline double asind(double x) { return asin(x)/rad; } -inline double dasind(double x) { return dasin(x)/rad; } - -inline double acosd(double x) { return acos(x)/rad; } -inline double dacosd(double x) { return dacos(x)/rad; } - -inline double atand(double x) { return atan(x)/rad; } -inline double datand(double x) { return datan(x)/rad; } - -#endif // MATHUTILS_H_INCLUDED diff --git a/libpdffit2/OutputStreams.cc b/libpdffit2/OutputStreams.cc deleted file mode 100644 index 6bacc8c1..00000000 --- a/libpdffit2/OutputStreams.cc +++ /dev/null @@ -1,24 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Custom output and error streams. -* -***********************************************************************/ - -#include "OutputStreams.h" - -std::ostream* NS_PDFFIT2::pout = &std::cout; -std::ostream* NS_PDFFIT2::perr = &std::cerr; - -// End of file diff --git a/libpdffit2/OutputStreams.h b/libpdffit2/OutputStreams.h deleted file mode 100644 index d269b6b3..00000000 --- a/libpdffit2/OutputStreams.h +++ /dev/null @@ -1,31 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Custom output and error streams. -* -***********************************************************************/ - -#ifndef OUTPUTSTREAMS_H_INCLUDED -#define OUTPUTSTREAMS_H_INCLUDED - -#include - -namespace NS_PDFFIT2 { - -extern std::ostream* pout; -extern std::ostream* perr; - -} - -#endif // OUTPUTSTREAMS_H_INCLUDED diff --git a/libpdffit2/PairDistance.h b/libpdffit2/PairDistance.h deleted file mode 100644 index 92c375f3..00000000 --- a/libpdffit2/PairDistance.h +++ /dev/null @@ -1,42 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Simple struct for pair distance and indices of atoms in the pair -* -***********************************************************************/ - -#ifndef PAIRDISTANCE_H_INCLUDED -#define PAIRDISTANCE_H_INCLUDED - -struct PairDistance -{ - // Data members - double dij; // distance - double ddij; // standard deviation - int i; // first index based from 1 - int j; // second index based from 1 - - // Constructor - PairDistance() : dij(0.0), ddij(0.0), i(0), j(0) - { } - -}; - -// Comparison operator -inline bool operator<(const PairDistance& pd0, const PairDistance& pd1) -{ - return (pd0.dij < pd1.dij); -} - -#endif // PAIRDISTANCE_H_INCLUDED diff --git a/libpdffit2/PeriodicTable.cc b/libpdffit2/PeriodicTable.cc deleted file mode 100644 index dd1b4481..00000000 --- a/libpdffit2/PeriodicTable.cc +++ /dev/null @@ -1,3459 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class PeriodicTable -* -* Comments: singleton class, use PeriodicTable::instance() -* for its pointer -* -***********************************************************************/ - -#include -#include -#include - -// MS compatibility fix -#include - -#include "PeriodicTable.h" - -using namespace std; - -//////////////////////////////////////////////////////////////////////// -// helper function -//////////////////////////////////////////////////////////////////////// -namespace { - -inline bool isalphachar(const char& c) -{ - return isalpha(c); -} - -} // namespace - -//////////////////////////////////////////////////////////////////////// -// PeriodicTable definitions -//////////////////////////////////////////////////////////////////////// - -PeriodicTable::PeriodicTable() -{ - init(); -} - -PeriodicTable::~PeriodicTable() -{ - clear(); -} - -AtomType* PeriodicTable::name(const string& s) -{ - map::iterator ii; - ii = name_index.find(s); - if (ii == name_index.end()) - { - ostringstream emsg; - emsg << "Element or isotope '" << s << "' is not defined."; - throw runtime_error(emsg.str()); - } - return ii->second; -} - -AtomType* PeriodicTable::symbol(const string& s) -{ - map::iterator ii; - ii = symbol_index.find(s); - if (ii == symbol_index.end()) - { - ostringstream emsg; - emsg << "Element or isotope '" << s << "' is not defined."; - throw runtime_error(emsg.str()); - } - return ii->second; -} - -AtomType* PeriodicTable::lookup(string s) -{ - // force standard case - string::iterator sii = find_if(s.begin(), s.end(), isalphachar); - if (sii != s.end()) - { - *sii = toupper(*sii); - for (sii++; sii != s.end(); ++sii) *sii = tolower(*sii); - } - map::iterator ii; - ii = symbol_index.find(s); - if ( ii == symbol_index.end() && - (ii = name_index.find(s)) == name_index.end() ) - { - ostringstream emsg; - emsg << "Element or isotope '" << s << "' is not defined."; - throw runtime_error(emsg.str()); - } - return ii->second; -} - -bool PeriodicTable::has(const std::string& s) -{ - bool rv; - try - { - lookup(s); - rv = true; - } - catch(runtime_error) - { - rv = false; - } - return rv; -} - -void PeriodicTable::defAtomType(const AtomType& atp) -{ - // check if already defined - if (symbol_index.count(atp.symbol)) - { - ostringstream emsg; - emsg << "Element symbol '" << atp.symbol - << "' already defined."; - throw runtime_error(emsg.str()); - } - if (name_index.count(atp.name)) - { - ostringstream emsg; - emsg << "Element name '" << atp.name - << "' already defined."; - throw runtime_error(emsg.str()); - } - // all should be fine here - pt_backup.push_back(new AtomType(atp)); - AtomType* newatp = new AtomType(atp); - pt_public.push_back(newatp); - symbol_index[newatp->symbol] = newatp; - name_index[newatp->name] = newatp; -} - -void PeriodicTable::deleteAtomType(const AtomType* atp) -{ - deque::iterator ii; - ii = find(pt_public.begin(), pt_public.end(), atp); - if (ii == pt_public.end()) return; - // here we need to free and remove atp related data - symbol_index.erase(atp->symbol); - name_index.erase(atp->name); - size_t idx = ii - pt_public.begin(); - delete pt_public[idx]; pt_public.erase(pt_public.begin() + idx); - delete pt_backup[idx]; pt_backup.erase(pt_backup.begin() + idx); -} - -void PeriodicTable::reset(AtomType* atp) -{ - deque::iterator ii; - if (!count(pt_backup.begin(), pt_backup.end(), atp)) - { - ostringstream emsg; - emsg << "Element '" << atp->symbol << "' is not defined."; - throw runtime_error(emsg.str()); - } - size_t idx = ii - pt_backup.begin(); - *(pt_public[idx]) = *(pt_backup[idx]); -} - -void PeriodicTable::resetAll() -{ - deque::iterator iipub = pt_public.begin(); - deque::iterator iibak = pt_backup.begin(); - for ( ; iipub != pt_public.end(); ++iipub, ++iibak) - { - **iipub = **iibak; - } -} - -void PeriodicTable::init() -{ - // load element data to pt_backup - fill_pt_backup(); - // make public copy and initialize lookup maps - pt_public.resize(pt_backup.size()); - // fill in lookup map - deque::iterator iipub = pt_public.begin(); - deque::iterator iibak = pt_backup.begin(); - for ( ; iipub != pt_public.end(); ++iipub, ++iibak) - { - *iipub = new AtomType(**iibak); - symbol_index[(*iipub)->symbol] = *iipub; - name_index[(*iipub)->name] = *iipub; - } - // add standard symbols for deuterium and tritium - symbol_index["2-H"] = lookup("D"); - symbol_index["3-H"] = lookup("T"); -} - -void PeriodicTable::clear() -{ - deque::iterator iipub = pt_public.begin(); - deque::iterator iibak = pt_backup.begin(); - for ( ; iipub != pt_public.end(); ++iipub, ++iibak) - { - delete *iipub; *iipub = NULL; - delete *iibak; *iibak = NULL; - } - pt_public.clear(); - pt_backup.clear(); -} - -void PeriodicTable::fill_pt_backup() -{ - // Refs: - // 1. Albert-Jose Dianoux, Gerry Lander, Neutron Data Booklet, - // Second Edition, ILL 2003 - // 2. ionic radii: http://www.fhi-berlin.mpg.de/th/balsac/balm.47.html - AtomType* atp; - AtomType* itp; - // hydrogen - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "H"; - atp->name = "Hydrogen"; - atp->z = 1; - atp->M = 1.007947; - atp->radius = 0.4350; - atp->xsf = 1.0; - atp->nsf = -3.7409; - // isotopes - // 1-hydrogen - itp = new AtomType(*atp); - itp->symbol = "1-H"; - itp->name = "1-Hydrogen"; - itp->isotope = true; - itp->M = 1.0078250321; - itp->nsf = -3.7423; - pt_backup.push_back(itp); - // deuterium - itp = new AtomType(*atp); - itp->symbol = "D"; - itp->name = "Deuterium"; - itp->isotope = true; - itp->M = 2.0141017780; - itp->nsf = 6.674; - pt_backup.push_back(itp); - // tritium - itp = new AtomType(*atp); - itp->symbol = "T"; - itp->name = "Tritium"; - itp->isotope = true; - itp->M = 3.0160492675; - itp->nsf = 4.792; - pt_backup.push_back(itp); - } - // helium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "He"; - atp->name = "Helium"; - atp->z = 2; - atp->M = 4.0026022; - atp->radius = 1.4000; - atp->xsf = 2.0; - atp->nsf = 3.263; - // isotopes - // 3-helium - itp = new AtomType(*atp); - itp->symbol = "3-He"; - itp->name = "3-Helium"; - itp->isotope = true; - itp->M = 3.0160293097; - itp->nsf = 5.74; - pt_backup.push_back(itp); - // 4-helium - itp = new AtomType(*atp); - itp->symbol = "4-He"; - itp->name = "4-Helium"; - itp->isotope = true; - itp->M = 4.0026032497; - itp->nsf = 3.26; - pt_backup.push_back(itp); - } - // lithium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Li"; - atp->name = "Lithium"; - atp->z = 3; - atp->M = 6.9412; - atp->radius = 1.5199; - atp->xsf = 3.0; - atp->nsf = -1.903; - // isotopes - // 6-lithium - itp = new AtomType(*atp); - itp->symbol = "6-Li"; - itp->name = "6-Lithium"; - itp->isotope = true; - itp->M = 6.0151223; - itp->nsf = 2.0; - pt_backup.push_back(itp); - // 7-lithium - itp = new AtomType(*atp); - itp->symbol = "7-Li"; - itp->name = "7-Lithium"; - itp->isotope = true; - itp->M = 7.0160040; - itp->nsf = -2.22; - pt_backup.push_back(itp); - } - // beryllium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Be"; - atp->name = "Beryllium"; - atp->z = 4; - atp->M = 9.0121823; - atp->radius = 1.1430; - atp->xsf = 4.0; - atp->nsf = 7.791; - } - // boron - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "B"; - atp->name = "Boron"; - atp->z = 5; - atp->M = 10.8117; - atp->radius = 0.9750; - atp->xsf = 5.0; - atp->nsf = 5.304; - // isotopes - // 10-boron - itp = new AtomType(*atp); - itp->symbol = "10-B"; - itp->name = "10-Boron"; - itp->isotope = true; - itp->M = 10.0129370; - itp->nsf = -0.2; - pt_backup.push_back(itp); - // 11-boron - itp = new AtomType(*atp); - itp->symbol = "11-B"; - itp->name = "11-Boron"; - itp->isotope = true; - itp->M = 11.0093055; - itp->nsf = 6.65; - pt_backup.push_back(itp); - } - // carbon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "C"; - atp->name = "Carbon"; - atp->z = 6; - atp->M = 12.01078; - atp->radius = 0.6550; - atp->xsf = 6.0; - atp->nsf = 6.648413; - // isotopes - // 12-carbon - itp = new AtomType(*atp); - itp->symbol = "12-C"; - itp->name = "12-Carbon"; - itp->isotope = true; - itp->M = 12.0; - itp->nsf = 6.6535; - pt_backup.push_back(itp); - // 13-carbon - itp = new AtomType(*atp); - itp->symbol = "13-C"; - itp->name = "13-Carbon"; - itp->isotope = true; - itp->M = 13.0033548378; - itp->nsf = 6.19; - pt_backup.push_back(itp); - } - // nitrogen - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "N"; - atp->name = "Nitrogen"; - atp->z = 7; - atp->M = 14.00672; - atp->radius = 0.7500; - atp->xsf = 7.0; - atp->nsf = 9.36; - // isotopes - // 14-nitrogen - itp = new AtomType(*atp); - itp->symbol = "14-N"; - itp->name = "14-Nitrogen"; - itp->isotope = true; - itp->M = 14.0030740052; - itp->nsf = 9.37; - pt_backup.push_back(itp); - // 15-nitrogen - itp = new AtomType(*atp); - itp->symbol = "15-N"; - itp->name = "15-Nitrogen"; - itp->isotope = true; - itp->M = 15.0001088984; - itp->nsf = 6.44; - pt_backup.push_back(itp); - } - // oxygen - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "O"; - atp->name = "Oxygen"; - atp->z = 8; - atp->M = 15.99943; - atp->radius = 0.7300; - atp->xsf = 8.0; - atp->nsf = 5.8054; - // isotopes - // 16-oxygen - itp = new AtomType(*atp); - itp->symbol = "16-O"; - itp->name = "16-Oxygen"; - itp->isotope = true; - itp->M = 15.9949146221; - itp->nsf = 5.805; - pt_backup.push_back(itp); - // 17-oxygen - itp = new AtomType(*atp); - itp->symbol = "17-O"; - itp->name = "17-Oxygen"; - itp->isotope = true; - itp->M = 16.99913150; - itp->nsf = 5.6; - pt_backup.push_back(itp); - // 18-oxygen - itp = new AtomType(*atp); - itp->symbol = "18-O"; - itp->name = "18-Oxygen"; - itp->isotope = true; - itp->M = 17.9991604; - itp->nsf = 5.84; - pt_backup.push_back(itp); - } - // fluorine - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "F"; - atp->name = "Fluorine"; - atp->z = 9; - atp->M = 18.99840325; - atp->radius = 0.7200; - atp->xsf = 9.0; - atp->nsf = 5.65412; - } - // neon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ne"; - atp->name = "Neon"; - atp->z = 10; - atp->M = 20.17976; - atp->radius = 1.6000; - atp->xsf = 10.0; - atp->nsf = 4.5666; - // isotopes - // 20-neon - itp = new AtomType(*atp); - itp->symbol = "20-Ne"; - itp->name = "20-Neon"; - itp->isotope = true; - itp->M = 19.9924401759; - itp->nsf = 4.631; - pt_backup.push_back(itp); - // 21-neon - itp = new AtomType(*atp); - itp->symbol = "21-Ne"; - itp->name = "21-Neon"; - itp->isotope = true; - itp->M = 20.99384674; - itp->nsf = 6.66; - pt_backup.push_back(itp); - // 22-neon - itp = new AtomType(*atp); - itp->symbol = "22-Ne"; - itp->name = "22-Neon"; - itp->isotope = true; - itp->M = 21.99138551; - itp->nsf = 3.87; - pt_backup.push_back(itp); - } - // sodium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Na"; - atp->name = "Sodium"; - atp->z = 11; - atp->M = 22.9897702; - atp->radius = 1.8579; - atp->xsf = 11.0; - atp->nsf = 3.632; - } - // magnesium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Mg"; - atp->name = "Magnesium"; - atp->z = 12; - atp->M = 24.30506; - atp->radius = 1.6047; - atp->xsf = 12.0; - atp->nsf = 5.3754; - // isotopes - // 24-magnesium - itp = new AtomType(*atp); - itp->symbol = "24-Mg"; - itp->name = "24-Magnesium"; - itp->isotope = true; - itp->M = 23.98504190; - itp->nsf = 5.49; - pt_backup.push_back(itp); - // 25-magnesium - itp = new AtomType(*atp); - itp->symbol = "25-Mg"; - itp->name = "25-Magnesium"; - itp->isotope = true; - itp->M = 24.98583702; - itp->nsf = 3.62; - pt_backup.push_back(itp); - // 26-magnesium - itp = new AtomType(*atp); - itp->symbol = "26-Mg"; - itp->name = "26-Magnesium"; - itp->isotope = true; - itp->M = 25.98259304; - itp->nsf = 4.89; - pt_backup.push_back(itp); - } - // aluminium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Al"; - atp->name = "Aluminium"; - atp->z = 13; - atp->M = 26.9815382; - atp->radius = 1.4318; - atp->xsf = 13.0; - atp->nsf = 3.4495; - } - // silicon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Si"; - atp->name = "Silicon"; - atp->z = 14; - atp->M = 28.08553; - atp->radius = 1.1758; - atp->xsf = 14.0; - atp->nsf = 4.15071; - // isotopes - // 28-silicon - itp = new AtomType(*atp); - itp->symbol = "28-Si"; - itp->name = "28-Silicon"; - itp->isotope = true; - itp->M = 27.9769265327; - itp->nsf = 4.106; - pt_backup.push_back(itp); - // 29-silicon - itp = new AtomType(*atp); - itp->symbol = "29-Si"; - itp->name = "29-Silicon"; - itp->isotope = true; - itp->M = 28.97649472; - itp->nsf = 4.7; - pt_backup.push_back(itp); - // 30-silicon - itp = new AtomType(*atp); - itp->symbol = "30-Si"; - itp->name = "30-Silicon"; - itp->isotope = true; - itp->M = 29.97377022; - itp->nsf = 4.58; - pt_backup.push_back(itp); - } - // phosphorus - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "P"; - atp->name = "Phosphorus"; - atp->z = 15; - atp->M = 30.9737612; - atp->radius = 1.0600; - atp->xsf = 15.0; - atp->nsf = 5.131; - } - // sulfur - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "S"; - atp->name = "Sulfur"; - atp->z = 16; - atp->M = 32.0655; - atp->radius = 1.0200; - atp->xsf = 16.0; - atp->nsf = 2.8471; - // isotopes - // 32-sulfur - itp = new AtomType(*atp); - itp->symbol = "32-S"; - itp->name = "32-Sulfur"; - itp->isotope = true; - itp->M = 31.97207069; - itp->nsf = 2.804; - pt_backup.push_back(itp); - // 33-sulfur - itp = new AtomType(*atp); - itp->symbol = "33-S"; - itp->name = "33-Sulfur"; - itp->isotope = true; - itp->M = 32.97145850; - itp->nsf = 4.74; - pt_backup.push_back(itp); - // 34-sulfur - itp = new AtomType(*atp); - itp->symbol = "34-S"; - itp->name = "34-Sulfur"; - itp->isotope = true; - itp->M = 33.96786683; - itp->nsf = 3.48; - pt_backup.push_back(itp); - // 36-sulfur - itp = new AtomType(*atp); - itp->symbol = "36-S"; - itp->name = "36-Sulfur"; - itp->isotope = true; - itp->M = 35.96708088; - itp->nsf = 3.0; - pt_backup.push_back(itp); - } - // chlorine - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cl"; - atp->name = "Chlorine"; - atp->z = 17; - atp->M = 35.4532; - atp->radius = 0.9900; - atp->xsf = 17.0; - atp->nsf = 9.57928; - // isotopes - // 35-chlorine - itp = new AtomType(*atp); - itp->symbol = "35-Cl"; - itp->name = "35-Chlorine"; - itp->isotope = true; - itp->M = 34.96885271; - itp->nsf = 11.7; - pt_backup.push_back(itp); - // 37-chlorine - itp = new AtomType(*atp); - itp->symbol = "37-Cl"; - itp->name = "37-Chlorine"; - itp->isotope = true; - itp->M = 36.96590260; - itp->nsf = 3.08; - pt_backup.push_back(itp); - } - // argon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ar"; - atp->name = "Argon"; - atp->z = 18; - atp->M = 39.9481; - atp->radius = 1.9000; - atp->xsf = 18.0; - atp->nsf = 1.9096; - // isotopes - // 36-argon - itp = new AtomType(*atp); - itp->symbol = "36-Ar"; - itp->name = "36-Argon"; - itp->isotope = true; - itp->M = 35.96754628; - itp->nsf = 24.9; - pt_backup.push_back(itp); - // 38-argon - itp = new AtomType(*atp); - itp->symbol = "38-Ar"; - itp->name = "38-Argon"; - itp->isotope = true; - itp->M = 37.9627322; - itp->nsf = 3.5; - pt_backup.push_back(itp); - // 40-argon - itp = new AtomType(*atp); - itp->symbol = "40-Ar"; - itp->name = "40-Argon"; - itp->isotope = true; - itp->M = 39.962383123; - itp->nsf = 1.7; - pt_backup.push_back(itp); - } - // potassium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "K"; - atp->name = "Potassium"; - atp->z = 19; - atp->M = 39.09831; - atp->radius = 2.2620; - atp->xsf = 19.0; - atp->nsf = 3.672; - // isotopes - // 39-potassium - itp = new AtomType(*atp); - itp->symbol = "39-K"; - itp->name = "39-Potassium"; - itp->isotope = true; - itp->M = 38.9637069; - itp->nsf = 3.79; - pt_backup.push_back(itp); - // 40-potassium - itp = new AtomType(*atp); - itp->symbol = "40-K"; - itp->name = "40-Potassium"; - itp->isotope = true; - itp->M = 39.96399867; - itp->nsf = 3.1; - pt_backup.push_back(itp); - // 41-potassium - itp = new AtomType(*atp); - itp->symbol = "41-K"; - itp->name = "41-Potassium"; - itp->isotope = true; - itp->M = 40.96182597; - itp->nsf = 2.69; - pt_backup.push_back(itp); - } - // calcium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ca"; - atp->name = "Calcium"; - atp->z = 20; - atp->M = 40.0784; - atp->radius = 1.9758; - atp->xsf = 20.0; - atp->nsf = 4.702; - // isotopes - // 40-calcium - itp = new AtomType(*atp); - itp->symbol = "40-Ca"; - itp->name = "40-Calcium"; - itp->isotope = true; - itp->M = 39.9625912; - itp->nsf = 4.78; - pt_backup.push_back(itp); - // 42-calcium - itp = new AtomType(*atp); - itp->symbol = "42-Ca"; - itp->name = "42-Calcium"; - itp->isotope = true; - itp->M = 41.9586183; - itp->nsf = 3.36; - pt_backup.push_back(itp); - // 43-calcium - itp = new AtomType(*atp); - itp->symbol = "43-Ca"; - itp->name = "43-Calcium"; - itp->isotope = true; - itp->M = 42.9587668; - itp->nsf = -1.56; - pt_backup.push_back(itp); - // 44-calcium - itp = new AtomType(*atp); - itp->symbol = "44-Ca"; - itp->name = "44-Calcium"; - itp->isotope = true; - itp->M = 43.9554811; - itp->nsf = 1.42; - pt_backup.push_back(itp); - // 46-calcium - itp = new AtomType(*atp); - itp->symbol = "46-Ca"; - itp->name = "46-Calcium"; - itp->isotope = true; - itp->M = 45.9536928; - itp->nsf = 3.55; - pt_backup.push_back(itp); - // 48-calcium - itp = new AtomType(*atp); - itp->symbol = "48-Ca"; - itp->name = "48-Calcium"; - itp->isotope = true; - itp->M = 47.952534; - itp->nsf = 0.39; - pt_backup.push_back(itp); - } - // scandium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sc"; - atp->name = "Scandium"; - atp->z = 21; - atp->M = 44.9559108; - atp->radius = 1.6545; - atp->xsf = 21.0; - atp->nsf = 12.11; - } - // titanium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ti"; - atp->name = "Titanium"; - atp->z = 22; - atp->M = 47.8671; - atp->radius = 1.4755; - atp->xsf = 22.0; - atp->nsf = -3.37013; - // isotopes - // 46-titanium - itp = new AtomType(*atp); - itp->symbol = "46-Ti"; - itp->name = "46-Titanium"; - itp->isotope = true; - itp->M = 45.9526295; - itp->nsf = 4.72; - pt_backup.push_back(itp); - // 47-titanium - itp = new AtomType(*atp); - itp->symbol = "47-Ti"; - itp->name = "47-Titanium"; - itp->isotope = true; - itp->M = 46.9517638; - itp->nsf = 3.53; - pt_backup.push_back(itp); - // 48-titanium - itp = new AtomType(*atp); - itp->symbol = "48-Ti"; - itp->name = "48-Titanium"; - itp->isotope = true; - itp->M = 47.9479471; - itp->nsf = -5.86; - pt_backup.push_back(itp); - // 49-titanium - itp = new AtomType(*atp); - itp->symbol = "49-Ti"; - itp->name = "49-Titanium"; - itp->isotope = true; - itp->M = 48.9478708; - itp->nsf = 0.98; - pt_backup.push_back(itp); - // 50-titanium - itp = new AtomType(*atp); - itp->symbol = "50-Ti"; - itp->name = "50-Titanium"; - itp->isotope = true; - itp->M = 49.9447921; - itp->nsf = 5.88; - pt_backup.push_back(itp); - } - // vanadium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "V"; - atp->name = "Vanadium"; - atp->z = 23; - atp->M = 50.94151; - atp->radius = 1.3090; - atp->xsf = 23.0; - atp->nsf = -0.44314; - // isotopes - // 50-vanadium - itp = new AtomType(*atp); - itp->symbol = "50-V"; - itp->name = "50-Vanadium"; - itp->isotope = true; - itp->M = 49.9471628; - itp->nsf = 7.6; - pt_backup.push_back(itp); - // 51-vanadium - itp = new AtomType(*atp); - itp->symbol = "51-V"; - itp->name = "51-Vanadium"; - itp->isotope = true; - itp->M = 50.9439637; - itp->nsf = -0.402; - pt_backup.push_back(itp); - } - // chromium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cr"; - atp->name = "Chromium"; - atp->z = 24; - atp->M = 51.99616; - atp->radius = 1.2490; - atp->xsf = 24.0; - atp->nsf = 3.6357; - // isotopes - // 50-chromium - itp = new AtomType(*atp); - itp->symbol = "50-Cr"; - itp->name = "50-Chromium"; - itp->isotope = true; - itp->M = 49.9460496; - itp->nsf = -4.50; - pt_backup.push_back(itp); - // 52-chromium - itp = new AtomType(*atp); - itp->symbol = "52-Cr"; - itp->name = "52-Chromium"; - itp->isotope = true; - itp->M = 51.9405119; - itp->nsf = 4.914; - pt_backup.push_back(itp); - // 0-chromium - itp = new AtomType(*atp); - itp->symbol = "53-Cr"; - itp->name = "53-Chromium"; - itp->isotope = true; - itp->M = 52.9406538; - itp->nsf = -4.20; - pt_backup.push_back(itp); - // 54-chromium - itp = new AtomType(*atp); - itp->symbol = "54-Cr"; - itp->name = "54-Chromium"; - itp->isotope = true; - itp->M = 53.9388849; - itp->nsf = 4.55; - pt_backup.push_back(itp); - } - // manganese - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Mn"; - atp->name = "Manganese"; - atp->z = 25; - atp->M = 54.9380499; - atp->radius = 1.3500; - atp->xsf = 25.0; - atp->nsf = -3.75018; - } - // iron - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Fe"; - atp->name = "Iron"; - atp->z = 26; - atp->M = 55.8452; - atp->radius = 1.2411; - atp->xsf = 26.0; - atp->nsf = 9.452; - // isotopes - // 54-iron - itp = new AtomType(*atp); - itp->symbol = "54-Fe"; - itp->name = "54-Iron"; - itp->isotope = true; - itp->M = 53.9396148; - itp->nsf = 4.2; - pt_backup.push_back(itp); - // 56-iron - itp = new AtomType(*atp); - itp->symbol = "56-Fe"; - itp->name = "56-Iron"; - itp->isotope = true; - itp->M = 55.9349421; - itp->nsf = 10.1; - pt_backup.push_back(itp); - // 57-iron - itp = new AtomType(*atp); - itp->symbol = "57-Fe"; - itp->name = "57-Iron"; - itp->isotope = true; - itp->M = 56.9353987; - itp->nsf = 2.3; - pt_backup.push_back(itp); - // 58-iron - itp = new AtomType(*atp); - itp->symbol = "58-Fe"; - itp->name = "58-Iron"; - itp->isotope = true; - itp->M = 57.9332805; - itp->nsf = 15; - pt_backup.push_back(itp); - } - // cobalt - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Co"; - atp->name = "Cobalt"; - atp->z = 27; - atp->M = 58.9332009; - atp->radius = 1.2535; - atp->xsf = 27.0; - atp->nsf = 2.492; - } - // nickel - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ni"; - atp->name = "Nickel"; - atp->z = 28; - atp->M = 58.69342; - atp->radius = 1.2460; - atp->xsf = 28.0; - atp->nsf = 10.31; - // isotopes - // 58-nickel - itp = new AtomType(*atp); - itp->symbol = "58-Ni"; - itp->name = "58-Nickel"; - itp->isotope = true; - itp->M = 57.9353479; - itp->nsf = 14.4; - pt_backup.push_back(itp); - // 60-nickel - itp = new AtomType(*atp); - itp->symbol = "60-Ni"; - itp->name = "60-Nickel"; - itp->isotope = true; - itp->M = 59.9307906; - itp->nsf = 2.8; - pt_backup.push_back(itp); - // 61-nickel - itp = new AtomType(*atp); - itp->symbol = "61-Ni"; - itp->name = "61-Nickel"; - itp->isotope = true; - itp->M = 60.9310604; - itp->nsf = 7.60; - pt_backup.push_back(itp); - // 62-nickel - itp = new AtomType(*atp); - itp->symbol = "62-Ni"; - itp->name = "62-Nickel"; - itp->isotope = true; - itp->M = 61.9283488; - itp->nsf = -8.7; - pt_backup.push_back(itp); - // 64-nickel - itp = new AtomType(*atp); - itp->symbol = "64-Ni"; - itp->name = "64-Nickel"; - itp->isotope = true; - itp->M = 63.9279696; - itp->nsf = -0.37; - pt_backup.push_back(itp); - } - // copper - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cu"; - atp->name = "Copper"; - atp->z = 29; - atp->M = 63.5463; - atp->radius = 1.2780; - atp->xsf = 29.0; - atp->nsf = 7.7184; - // isotopes - // 63-copper - itp = new AtomType(*atp); - itp->symbol = "63-Cu"; - itp->name = "63-Copper"; - itp->isotope = true; - itp->M = 62.9296011; - itp->nsf = 6.477; - pt_backup.push_back(itp); - // 65-copper - itp = new AtomType(*atp); - itp->symbol = "65-Cu"; - itp->name = "65-Copper"; - itp->isotope = true; - itp->M = 64.9277937; - itp->nsf = 10.204; - pt_backup.push_back(itp); - } - // zinc - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Zn"; - atp->name = "Zinc"; - atp->z = 30; - atp->M = 65.4094; - atp->radius = 1.3325; - atp->xsf = 30.0; - atp->nsf = 5.6805; - // isotopes - // 64-zinc - itp = new AtomType(*atp); - itp->symbol = "64-Zn"; - itp->name = "64-Zinc"; - itp->isotope = true; - itp->M = 63.9291466; - itp->nsf = 5.23; - pt_backup.push_back(itp); - // 66-zinc - itp = new AtomType(*atp); - itp->symbol = "66-Zn"; - itp->name = "66-Zinc"; - itp->isotope = true; - itp->M = 65.9260368; - itp->nsf = 5.98; - pt_backup.push_back(itp); - // 67-zinc - itp = new AtomType(*atp); - itp->symbol = "67-Zn"; - itp->name = "67-Zinc"; - itp->isotope = true; - itp->M = 66.9271309; - itp->nsf = 7.58; - pt_backup.push_back(itp); - // 68-zinc - itp = new AtomType(*atp); - itp->symbol = "68-Zn"; - itp->name = "68-Zinc"; - itp->isotope = true; - itp->M = 67.9248476; - itp->nsf = 6.04; - pt_backup.push_back(itp); - // 70-zinc - itp = new AtomType(*atp); - itp->symbol = "70-Zn"; - itp->name = "70-Zinc"; - itp->isotope = true; - itp->M = 69.925325; - itp->nsf = 6.9; - pt_backup.push_back(itp); - } - // gallium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ga"; - atp->name = "Gallium"; - atp->z = 31; - atp->M = 69.7231; - atp->radius = 1.3501; - atp->xsf = 31.0; - atp->nsf = 7.2882; - // isotopes - // 69-gallium - itp = new AtomType(*atp); - itp->symbol = "69-Ga"; - itp->name = "69-Gallium"; - itp->isotope = true; - itp->M = 68.925581; - itp->nsf = 8.043; - pt_backup.push_back(itp); - // 71-gallium - itp = new AtomType(*atp); - itp->symbol = "71-Ga"; - itp->name = "71-Gallium"; - itp->isotope = true; - itp->M = 70.9247050; - itp->nsf = 6.170; - pt_backup.push_back(itp); - } - // germanium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ge"; - atp->name = "Germanium"; - atp->z = 32; - atp->M = 72.641; - atp->radius = 1.2248; - atp->xsf = 32.0; - atp->nsf = 8.18520; - // isotopes - // 70-germanium - itp = new AtomType(*atp); - itp->symbol = "70-Ge"; - itp->name = "70-Germanium"; - itp->isotope = true; - itp->M = 69.9242504; - itp->nsf = 10.0; - pt_backup.push_back(itp); - // 72-germanium - itp = new AtomType(*atp); - itp->symbol = "72-Ge"; - itp->name = "72-Germanium"; - itp->isotope = true; - itp->M = 71.9220762; - itp->nsf = 8.51; - pt_backup.push_back(itp); - // 73-germanium - itp = new AtomType(*atp); - itp->symbol = "73-Ge"; - itp->name = "73-Germanium"; - itp->isotope = true; - itp->M = 72.9234594; - itp->nsf = 5.02; - pt_backup.push_back(itp); - // 74-germanium - itp = new AtomType(*atp); - itp->symbol = "74-Ge"; - itp->name = "74-Germanium"; - itp->isotope = true; - itp->M = 73.9211782; - itp->nsf = 7.58; - pt_backup.push_back(itp); - // 76-germanium - itp = new AtomType(*atp); - itp->symbol = "76-Ge"; - itp->name = "76-Germanium"; - itp->isotope = true; - itp->M = 75.9214027; - itp->nsf = 8.2; - pt_backup.push_back(itp); - } - // arsenic - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "As"; - atp->name = "Arsenic"; - atp->z = 33; - atp->M = 74.921602; - atp->radius = 1.2000; - atp->xsf = 33.0; - atp->nsf = 6.581; - } - // selenium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Se"; - atp->name = "Selenium"; - atp->z = 34; - atp->M = 78.963; - atp->radius = 1.1600; - atp->xsf = 34.0; - atp->nsf = 7.9709; - // isotopes - // 74-selenium - itp = new AtomType(*atp); - itp->symbol = "74-Se"; - itp->name = "74-Selenium"; - itp->isotope = true; - itp->M = 73.9224766; - itp->nsf = 0.8; - pt_backup.push_back(itp); - // 76-selenium - itp = new AtomType(*atp); - itp->symbol = "76-Se"; - itp->name = "76-Selenium"; - itp->isotope = true; - itp->M = 75.9192141; - itp->nsf = 12.2; - pt_backup.push_back(itp); - // 77-selenium - itp = new AtomType(*atp); - itp->symbol = "77-Se"; - itp->name = "77-Selenium"; - itp->isotope = true; - itp->M = 76.9199146; - itp->nsf = 8.25; - pt_backup.push_back(itp); - // 78-selenium - itp = new AtomType(*atp); - itp->symbol = "78-Se"; - itp->name = "78-Selenium"; - itp->isotope = true; - itp->M = 77.9173095; - itp->nsf = 8.24; - pt_backup.push_back(itp); - // 80-selenium - itp = new AtomType(*atp); - itp->symbol = "80-Se"; - itp->name = "80-Selenium"; - itp->isotope = true; - itp->M = 79.9165218; - itp->nsf = 7.48; - pt_backup.push_back(itp); - // 82-selenium - itp = new AtomType(*atp); - itp->symbol = "82-Se"; - itp->name = "82-Selenium"; - itp->isotope = true; - itp->M = 81.9167000; - itp->nsf = 6.34; - pt_backup.push_back(itp); - } - // bromine - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Br"; - atp->name = "Bromine"; - atp->z = 35; - atp->M = 79.9041; - atp->radius = 1.1400; - atp->xsf = 35.0; - atp->nsf = 6.792; - // isotopes - // 79-bromine - itp = new AtomType(*atp); - itp->symbol = "79-Br"; - itp->name = "79-Bromine"; - itp->isotope = true; - itp->M = 78.9183376; - itp->nsf = 6.79; - pt_backup.push_back(itp); - // 81-bromine - itp = new AtomType(*atp); - itp->symbol = "81-Br"; - itp->name = "81-Bromine"; - itp->isotope = true; - itp->M = 80.916291; - itp->nsf = 6.78; - pt_backup.push_back(itp); - } - // krypton - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Kr"; - atp->name = "Krypton"; - atp->z = 36; - atp->M = 83.7982; - atp->radius = 2.0000; - atp->xsf = 36.0; - atp->nsf = 7.812; - // isotopes - // 86-krypton - itp = new AtomType(*atp); - itp->symbol = "86-Kr"; - itp->name = "86-Krypton"; - itp->isotope = true; - itp->M = 85.9106103; - itp->nsf = 8.07; - pt_backup.push_back(itp); - } - // rubidium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Rb"; - atp->name = "Rubidium"; - atp->z = 37; - atp->M = 85.46783; - atp->radius = 2.4700; - atp->xsf = 37.0; - atp->nsf = 7.082; - // isotopes - // 85-rubidium - itp = new AtomType(*atp); - itp->symbol = "85-Rb"; - itp->name = "85-Rubidium"; - itp->isotope = true; - itp->M = 84.9117893; - itp->nsf = 7.07; - pt_backup.push_back(itp); - // 87-rubidium - itp = new AtomType(*atp); - itp->symbol = "87-Rb"; - itp->name = "87-Rubidium"; - itp->isotope = true; - itp->M = 86.9091835; - itp->nsf = 7.27; - pt_backup.push_back(itp); - } - // strontium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sr"; - atp->name = "Strontium"; - atp->z = 38; - atp->M = 87.621; - atp->radius = 2.1513; - atp->xsf = 38.0; - atp->nsf = 7.022; - // isotopes - // 84-strontium - itp = new AtomType(*atp); - itp->symbol = "84-Sr"; - itp->name = "84-Strontium"; - itp->isotope = true; - itp->M = 83.913425; - itp->nsf = 5.0; - pt_backup.push_back(itp); - // 86-strontium - itp = new AtomType(*atp); - itp->symbol = "86-Sr"; - itp->name = "86-Strontium"; - itp->isotope = true; - itp->M = 85.9092624; - itp->nsf = 5.68; - pt_backup.push_back(itp); - // 87-strontium - itp = new AtomType(*atp); - itp->symbol = "87-Sr"; - itp->name = "87-Strontium"; - itp->isotope = true; - itp->M = 86.9088793; - itp->nsf = 7.41; - pt_backup.push_back(itp); - // 88-strontium - itp = new AtomType(*atp); - itp->symbol = "88-Sr"; - itp->name = "88-Strontium"; - itp->isotope = true; - itp->M = 87.9056143; - itp->nsf = 7.16; - pt_backup.push_back(itp); - } - // yttrium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Y"; - atp->name = "Yttrium"; - atp->z = 39; - atp->M = 88.905852; - atp->radius = 1.8237; - atp->xsf = 39.0; - atp->nsf = 7.752; - } - // zirconium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Zr"; - atp->name = "Zirconium"; - atp->z = 40; - atp->M = 91.2242; - atp->radius = 1.6156; - atp->xsf = 40.0; - atp->nsf = 7.163; - // isotopes - // 90-zirconium - itp = new AtomType(*atp); - itp->symbol = "90-Zr"; - itp->name = "90-Zirconium"; - itp->isotope = true; - itp->M = 89.9047037; - itp->nsf = 6.5; - pt_backup.push_back(itp); - // 91-zirconium - itp = new AtomType(*atp); - itp->symbol = "91-Zr"; - itp->name = "91-Zirconium"; - itp->isotope = true; - itp->M = 90.9056450; - itp->nsf = 8.8; - pt_backup.push_back(itp); - // 92-zirconium - itp = new AtomType(*atp); - itp->symbol = "92-Zr"; - itp->name = "92-Zirconium"; - itp->isotope = true; - itp->M = 91.9050401; - itp->nsf = 7.5; - pt_backup.push_back(itp); - // 94-zirconium - itp = new AtomType(*atp); - itp->symbol = "94-Zr"; - itp->name = "94-Zirconium"; - itp->isotope = true; - itp->M = 93.9063158; - itp->nsf = 8.3; - pt_backup.push_back(itp); - // 96-zirconium - itp = new AtomType(*atp); - itp->symbol = "96-Zr"; - itp->name = "96-Zirconium"; - itp->isotope = true; - itp->M = 95.908276; - itp->nsf = 5.5; - pt_backup.push_back(itp); - } - // niobium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Nb"; - atp->name = "Niobium"; - atp->z = 41; - atp->M = 92.906382; - atp->radius = 1.4318; - atp->xsf = 41.0; - atp->nsf = 7.0543; - } - // molybdenum - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Mo"; - atp->name = "Molybdenum"; - atp->z = 42; - atp->M = 95.942; - atp->radius = 1.3626; - atp->xsf = 42.0; - atp->nsf = 6.71520; - // isotopes - // 92-molybdenum - itp = new AtomType(*atp); - itp->symbol = "92-Mo"; - itp->name = "92-Molybdenum"; - itp->isotope = true; - itp->M = 91.906810; - itp->nsf = 6.93; - pt_backup.push_back(itp); - // 94-molybdenum - itp = new AtomType(*atp); - itp->symbol = "94-Mo"; - itp->name = "94-Molybdenum"; - itp->isotope = true; - itp->M = 93.9050876; - itp->nsf = 6.82; - pt_backup.push_back(itp); - // 95-molybdenum - itp = new AtomType(*atp); - itp->symbol = "95-Mo"; - itp->name = "95-Molybdenum"; - itp->isotope = true; - itp->M = 94.9058415; - itp->nsf = 6.93; - pt_backup.push_back(itp); - // 96-molybdenum - itp = new AtomType(*atp); - itp->symbol = "96-Mo"; - itp->name = "96-Molybdenum"; - itp->isotope = true; - itp->M = 95.9046789; - itp->nsf = 6.22; - pt_backup.push_back(itp); - // 97-molybdenum - itp = new AtomType(*atp); - itp->symbol = "97-Mo"; - itp->name = "97-Molybdenum"; - itp->isotope = true; - itp->M = 96.9060210; - itp->nsf = 7.26; - pt_backup.push_back(itp); - // 98-molybdenum - itp = new AtomType(*atp); - itp->symbol = "98-Mo"; - itp->name = "98-Molybdenum"; - itp->isotope = true; - itp->M = 97.9054078; - itp->nsf = 6.60; - pt_backup.push_back(itp); - // 100-molybdenum - itp = new AtomType(*atp); - itp->symbol = "100-Mo"; - itp->name = "100-Molybdenum"; - itp->isotope = true; - itp->M = 99.907477; - itp->nsf = 6.75; - pt_backup.push_back(itp); - } - // technetium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Tc"; - atp->name = "Technetium"; - atp->z = 43; - atp->M = 98.0; - atp->radius = 1.3675; - atp->xsf = 43.0; - atp->nsf = 6.83; - } - // ruthenium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ru"; - atp->name = "Ruthenium"; - atp->z = 44; - atp->M = 101.072; - atp->radius = 1.3529; - atp->xsf = 44.0; - atp->nsf = 7.022; - } - // rhodium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Rh"; - atp->name = "Rhodium"; - atp->z = 45; - atp->M = 102.905502; - atp->radius = 1.3450; - atp->xsf = 45.0; - atp->nsf = 5.904; - } - // palladium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pd"; - atp->name = "Palladium"; - atp->z = 46; - atp->M = 106.421; - atp->radius = 1.3755; - atp->xsf = 46.0; - atp->nsf = 5.916; - // isotopes - // 102-palladium - itp = new AtomType(*atp); - itp->symbol = "102-Pd"; - itp->name = "102-Palladium"; - itp->isotope = true; - itp->M = 101.905608; - itp->nsf = 7.7; - pt_backup.push_back(itp); - // 104-palladium - itp = new AtomType(*atp); - itp->symbol = "104-Pd"; - itp->name = "104-Palladium"; - itp->isotope = true; - itp->M = 103.904035; - itp->nsf = 7.7; - pt_backup.push_back(itp); - // 105-palladium - itp = new AtomType(*atp); - itp->symbol = "105-Pd"; - itp->name = "105-Palladium"; - itp->isotope = true; - itp->M = 104.905084; - itp->nsf = 5.5; - pt_backup.push_back(itp); - // 106-palladium - itp = new AtomType(*atp); - itp->symbol = "106-Pd"; - itp->name = "106-Palladium"; - itp->isotope = true; - itp->M = 105.903483; - itp->nsf = 6.4; - pt_backup.push_back(itp); - // 108-palladium - itp = new AtomType(*atp); - itp->symbol = "108-Pd"; - itp->name = "108-Palladium"; - itp->isotope = true; - itp->M = 107.903894; - itp->nsf = 4.1; - pt_backup.push_back(itp); - // 110-palladium - itp = new AtomType(*atp); - itp->symbol = "110-Pd"; - itp->name = "110-Palladium"; - itp->isotope = true; - itp->M = 109.905152; - itp->nsf = 7.7; - pt_backup.push_back(itp); - } - // silver - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ag"; - atp->name = "Silver"; - atp->z = 47; - atp->M = 107.86822; - atp->radius = 1.4447; - atp->xsf = 47.0; - atp->nsf = 5.9227; - // isotopes - // 107-silver - itp = new AtomType(*atp); - itp->symbol = "107-Ag"; - itp->name = "107-Silver"; - itp->isotope = true; - itp->M = 106.905093; - itp->nsf = 7.555; - pt_backup.push_back(itp); - // 109-silver - itp = new AtomType(*atp); - itp->symbol = "109-Ag"; - itp->name = "109-Silver"; - itp->isotope = true; - itp->M = 108.904756; - itp->nsf = 4.165; - pt_backup.push_back(itp); - } - // cadmium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cd"; - atp->name = "Cadmium"; - atp->z = 48; - atp->M = 112.4118; - atp->radius = 1.4894; - atp->xsf = 48.0; - atp->nsf = 4.835; - // isotopes - // 106-cadmium - itp = new AtomType(*atp); - itp->symbol = "106-Cd"; - itp->name = "106-Cadmium"; - itp->isotope = true; - itp->M = 105.906458; - itp->nsf = 5.0; - pt_backup.push_back(itp); - // 108-cadmium - itp = new AtomType(*atp); - itp->symbol = "108-Cd"; - itp->name = "108-Cadmium"; - itp->isotope = true; - itp->M = 107.904183; - itp->nsf = 5.31; - pt_backup.push_back(itp); - // 110-cadmium - itp = new AtomType(*atp); - itp->symbol = "110-Cd"; - itp->name = "110-Cadmium"; - itp->isotope = true; - itp->M = 109.903006; - itp->nsf = 5.78; - pt_backup.push_back(itp); - // 111-cadmium - itp = new AtomType(*atp); - itp->symbol = "111-Cd"; - itp->name = "111-Cadmium"; - itp->isotope = true; - itp->M = 110.904182; - itp->nsf = 6.47; - pt_backup.push_back(itp); - // 112-cadmium - itp = new AtomType(*atp); - itp->symbol = "112-Cd"; - itp->name = "112-Cadmium"; - itp->isotope = true; - itp->M = 111.9027572; - itp->nsf = 6.34; - pt_backup.push_back(itp); - // 113-cadmium - itp = new AtomType(*atp); - itp->symbol = "113-Cd"; - itp->name = "113-Cadmium"; - itp->isotope = true; - itp->M = 112.9044009; - itp->nsf = -8.0; - pt_backup.push_back(itp); - // 114-cadmium - itp = new AtomType(*atp); - itp->symbol = "114-Cd"; - itp->name = "114-Cadmium"; - itp->isotope = true; - itp->M = 113.9033581; - itp->nsf = 7.48; - pt_backup.push_back(itp); - // 116-cadmium - itp = new AtomType(*atp); - itp->symbol = "116-Cd"; - itp->name = "116-Cadmium"; - itp->isotope = true; - itp->M = 115.904755; - itp->nsf = 6.26; - pt_backup.push_back(itp); - } - // indium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "In"; - atp->name = "Indium"; - atp->z = 49; - atp->M = 114.8183; - atp->radius = 1.6662; - atp->xsf = 49.0; - atp->nsf = 4.0652; - // isotopes - // 113-indium - itp = new AtomType(*atp); - itp->symbol = "113-In"; - itp->name = "113-Indium"; - itp->isotope = true; - itp->M = 112.904061; - itp->nsf = 5.39; - pt_backup.push_back(itp); - // 115-indium - itp = new AtomType(*atp); - itp->symbol = "115-In"; - itp->name = "115-Indium"; - itp->isotope = true; - itp->M = 114.903878; - itp->nsf = 4.00; - pt_backup.push_back(itp); - } - // tin - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sn"; - atp->name = "Tin"; - atp->z = 50; - atp->M = 118.7107; - atp->radius = 1.5375; - atp->xsf = 50.0; - atp->nsf = 6.2252; - // isotopes - // 112-tin - itp = new AtomType(*atp); - itp->symbol = "112-Sn"; - itp->name = "112-Tin"; - itp->isotope = true; - itp->M = 111.904821; - itp->nsf = 6.0; - pt_backup.push_back(itp); - // 114-tin - itp = new AtomType(*atp); - itp->symbol = "114-Sn"; - itp->name = "114-Tin"; - itp->isotope = true; - itp->M = 113.902782; - itp->nsf = 6.0; - pt_backup.push_back(itp); - // 115-tin - itp = new AtomType(*atp); - itp->symbol = "115-Sn"; - itp->name = "115-Tin"; - itp->isotope = true; - itp->M = 114.903346; - itp->nsf = 6.0; - pt_backup.push_back(itp); - // 116-tin - itp = new AtomType(*atp); - itp->symbol = "116-Sn"; - itp->name = "116-Tin"; - itp->isotope = true; - itp->M = 115.901744; - itp->nsf = 6.1; - pt_backup.push_back(itp); - // 117-tin - itp = new AtomType(*atp); - itp->symbol = "117-Sn"; - itp->name = "117-Tin"; - itp->isotope = true; - itp->M = 116.902954; - itp->nsf = 6.59; - pt_backup.push_back(itp); - // 118-tin - itp = new AtomType(*atp); - itp->symbol = "118-Sn"; - itp->name = "118-Tin"; - itp->isotope = true; - itp->M = 117.901606; - itp->nsf = 6.23; - pt_backup.push_back(itp); - // 119-tin - itp = new AtomType(*atp); - itp->symbol = "119-Sn"; - itp->name = "119-Tin"; - itp->isotope = true; - itp->M = 118.903309; - itp->nsf = 6.28; - pt_backup.push_back(itp); - // 120-tin - itp = new AtomType(*atp); - itp->symbol = "120-Sn"; - itp->name = "120-Tin"; - itp->isotope = true; - itp->M = 119.9021966; - itp->nsf = 6.67; - pt_backup.push_back(itp); - // 122-tin - itp = new AtomType(*atp); - itp->symbol = "122-Sn"; - itp->name = "122-Tin"; - itp->isotope = true; - itp->M = 121.9034401; - itp->nsf = 5.93; - pt_backup.push_back(itp); - // 124-tin - itp = new AtomType(*atp); - itp->symbol = "124-Sn"; - itp->name = "124-Tin"; - itp->isotope = true; - itp->M = 123.9052746; - itp->nsf = 6.15; - pt_backup.push_back(itp); - } - // antimony - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sb"; - atp->name = "Antimony"; - atp->z = 51; - atp->M = 121.7601; - atp->radius = 1.4000; - atp->xsf = 51.0; - atp->nsf = 5.573; - // isotopes - // 121-antimony - itp = new AtomType(*atp); - itp->symbol = "121-Sb"; - itp->name = "121-Antimony"; - itp->isotope = true; - itp->M = 120.9038180; - itp->nsf = 5.71; - pt_backup.push_back(itp); - // 123-antimony - itp = new AtomType(*atp); - itp->symbol = "123-Sb"; - itp->name = "123-Antimony"; - itp->isotope = true; - itp->M = 122.9042157; - itp->nsf = 5.38; - pt_backup.push_back(itp); - } - // tellurium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Te"; - atp->name = "Tellurium"; - atp->z = 52; - atp->M = 127.603; - atp->radius = 1.3600; - atp->xsf = 52.0; - atp->nsf = 5.682; - // isotopes - // 120-tellurium - itp = new AtomType(*atp); - itp->symbol = "120-Te"; - itp->name = "120-Tellurium"; - itp->isotope = true; - itp->M = 119.904020; - itp->nsf = 5.3; - pt_backup.push_back(itp); - // 122-tellurium - itp = new AtomType(*atp); - itp->symbol = "122-Te"; - itp->name = "122-Tellurium"; - itp->isotope = true; - itp->M = 121.9030471; - itp->nsf = 3.8; - pt_backup.push_back(itp); - // 123-tellurium - itp = new AtomType(*atp); - itp->symbol = "123-Te"; - itp->name = "123-Tellurium"; - itp->isotope = true; - itp->M = 122.9042730; - itp->nsf = -0.05; - pt_backup.push_back(itp); - // 124-tellurium - itp = new AtomType(*atp); - itp->symbol = "124-Te"; - itp->name = "124-Tellurium"; - itp->isotope = true; - itp->M = 123.9028195; - itp->nsf = 7.95; - pt_backup.push_back(itp); - // 125-tellurium - itp = new AtomType(*atp); - itp->symbol = "125-Te"; - itp->name = "125-Tellurium"; - itp->isotope = true; - itp->M = 124.9044247; - itp->nsf = 5.01; - pt_backup.push_back(itp); - // 126-tellurium - itp = new AtomType(*atp); - itp->symbol = "126-Te"; - itp->name = "126-Tellurium"; - itp->isotope = true; - itp->M = 125.9033055; - itp->nsf = 5.55; - pt_backup.push_back(itp); - // 128-tellurium - itp = new AtomType(*atp); - itp->symbol = "128-Te"; - itp->name = "128-Tellurium"; - itp->isotope = true; - itp->M = 127.9044614; - itp->nsf = 5.88; - pt_backup.push_back(itp); - // 130-tellurium - itp = new AtomType(*atp); - itp->symbol = "130-Te"; - itp->name = "130-Tellurium"; - itp->isotope = true; - itp->M = 129.9062228; - itp->nsf = 6.01; - pt_backup.push_back(itp); - } - // iodine - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "I"; - atp->name = "Iodine"; - atp->z = 53; - atp->M = 126.904473; - atp->radius = 1.3300; - atp->xsf = 53.0; - atp->nsf = 5.282; - } - // xenon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Xe"; - atp->name = "Xenon"; - atp->z = 54; - atp->M = 131.2936; - atp->radius = 2.2000; - atp->xsf = 54.0; - atp->nsf = 4.694; - } - // cesium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cs"; - atp->name = "Cesium"; - atp->z = 55; - atp->M = 132.905452; - atp->radius = 2.6325; - atp->xsf = 55.0; - atp->nsf = 5.422; - } - // barium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ba"; - atp->name = "Barium"; - atp->z = 56; - atp->M = 137.3277; - atp->radius = 2.1705; - atp->xsf = 56.0; - atp->nsf = 5.073; - // isotopes - // 130-barium - itp = new AtomType(*atp); - itp->symbol = "130-Ba"; - itp->name = "130-Barium"; - itp->isotope = true; - itp->M = 129.906310; - itp->nsf = -3.6; - pt_backup.push_back(itp); - // 132-barium - itp = new AtomType(*atp); - itp->symbol = "132-Ba"; - itp->name = "132-Barium"; - itp->isotope = true; - itp->M = 131.905056; - itp->nsf = 7.8; - pt_backup.push_back(itp); - // 134-barium - itp = new AtomType(*atp); - itp->symbol = "134-Ba"; - itp->name = "134-Barium"; - itp->isotope = true; - itp->M = 133.904503; - itp->nsf = 5.7; - pt_backup.push_back(itp); - // 135-barium - itp = new AtomType(*atp); - itp->symbol = "135-Ba"; - itp->name = "135-Barium"; - itp->isotope = true; - itp->M = 134.905683; - itp->nsf = 4.66; - pt_backup.push_back(itp); - // 136-barium - itp = new AtomType(*atp); - itp->symbol = "136-Ba"; - itp->name = "136-Barium"; - itp->isotope = true; - itp->M = 135.904570; - itp->nsf = 4.90; - pt_backup.push_back(itp); - // 137-barium - itp = new AtomType(*atp); - itp->symbol = "137-Ba"; - itp->name = "137-Barium"; - itp->isotope = true; - itp->M = 136.905821; - itp->nsf = 6.82; - pt_backup.push_back(itp); - // 138-barium - itp = new AtomType(*atp); - itp->symbol = "138-Ba"; - itp->name = "138-Barium"; - itp->isotope = true; - itp->M = 137.905241; - itp->nsf = 4.83; - pt_backup.push_back(itp); - } - // lanthanum - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "La"; - atp->name = "Lanthanum"; - atp->z = 57; - atp->M = 138.90552; - atp->radius = 1.8725; - atp->xsf = 57.0; - atp->nsf = 8.244; - // isotopes - // 138-lanthanum - itp = new AtomType(*atp); - itp->symbol = "138-La"; - itp->name = "138-Lanthanum"; - itp->isotope = true; - itp->M = 137.907107; - itp->nsf = 8.0; - pt_backup.push_back(itp); - // 139-lanthanum - itp = new AtomType(*atp); - itp->symbol = "139-La"; - itp->name = "139-Lanthanum"; - itp->isotope = true; - itp->M = 138.906348; - itp->nsf = 8.24; - pt_backup.push_back(itp); - } - // cerium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ce"; - atp->name = "Cerium"; - atp->z = 58; - atp->M = 140.1161; - atp->radius = 1.8243; - atp->xsf = 58.0; - atp->nsf = 4.842; - // isotopes - // 136-cerium - itp = new AtomType(*atp); - itp->symbol = "136-Ce"; - itp->name = "136-Cerium"; - itp->isotope = true; - itp->M = 135.907140; - itp->nsf = 5.76; - pt_backup.push_back(itp); - // 138-cerium - itp = new AtomType(*atp); - itp->symbol = "138-Ce"; - itp->name = "138-Cerium"; - itp->isotope = true; - itp->M = 137.905986; - itp->nsf = 6.65; - pt_backup.push_back(itp); - // 140-cerium - itp = new AtomType(*atp); - itp->symbol = "140-Ce"; - itp->name = "140-Cerium"; - itp->isotope = true; - itp->M = 139.905434; - itp->nsf = 4.81; - pt_backup.push_back(itp); - // 142-cerium - itp = new AtomType(*atp); - itp->symbol = "142-Ce"; - itp->name = "142-Cerium"; - itp->isotope = true; - itp->M = 141.909240; - itp->nsf = 4.72; - pt_backup.push_back(itp); - } - // praseodymium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pr"; - atp->name = "Praseodymium"; - atp->z = 59; - atp->M = 140.907652; - atp->radius = 1.8362; - atp->xsf = 59.0; - atp->nsf = 4.585; - } - // neodymium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Nd"; - atp->name = "Neodymium"; - atp->z = 60; - atp->M = 144.243; - atp->radius = 1.8295; - atp->xsf = 60.0; - atp->nsf = 7.695; - // isotopes - // 142-neodymium - itp = new AtomType(*atp); - itp->symbol = "142-Nd"; - itp->name = "142-Neodymium"; - itp->isotope = true; - itp->M = 141.907719; - itp->nsf = 7.7; - pt_backup.push_back(itp); - // 143-neodymium - itp = new AtomType(*atp); - itp->symbol = "143-Nd"; - itp->name = "143-Neodymium"; - itp->isotope = true; - itp->M = 142.909810; - itp->nsf = 14.0; - pt_backup.push_back(itp); - // 144-neodymium - itp = new AtomType(*atp); - itp->symbol = "144-Nd"; - itp->name = "144-Neodymium"; - itp->isotope = true; - itp->M = 143.910083; - itp->nsf = 2.8; - pt_backup.push_back(itp); - // 145-neodymium - itp = new AtomType(*atp); - itp->symbol = "145-Nd"; - itp->name = "145-Neodymium"; - itp->isotope = true; - itp->M = 144.912569; - itp->nsf = 14.0; - pt_backup.push_back(itp); - // 146-neodymium - itp = new AtomType(*atp); - itp->symbol = "146-Nd"; - itp->name = "146-Neodymium"; - itp->isotope = true; - itp->M = 145.913112; - itp->nsf = 8.7; - pt_backup.push_back(itp); - // 148-neodymium - itp = new AtomType(*atp); - itp->symbol = "148-Nd"; - itp->name = "148-Neodymium"; - itp->isotope = true; - itp->M = 147.916889; - itp->nsf = 5.7; - pt_backup.push_back(itp); - // 150-neodymium - itp = new AtomType(*atp); - itp->symbol = "150-Nd"; - itp->name = "150-Neodymium"; - itp->isotope = true; - itp->M = 149.920887; - itp->nsf = 5.28; - pt_backup.push_back(itp); - } - // promethium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pm"; - atp->name = "Promethium"; - atp->z = 61; - atp->M = 145.0; - atp->radius = 1.8090; - atp->xsf = 61.0; - atp->nsf = 12.64; - } - // samarium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sm"; - atp->name = "Samarium"; - atp->z = 62; - atp->M = 150.363; - atp->radius = 1.8040; - atp->xsf = 62.0; - atp->nsf = 0.005; - // isotopes - // 144-samarium - itp = new AtomType(*atp); - itp->symbol = "144-Sm"; - itp->name = "144-Samarium"; - itp->isotope = true; - itp->M = 143.911995; - itp->nsf = -3.0; - pt_backup.push_back(itp); - // 147-samarium - itp = new AtomType(*atp); - itp->symbol = "147-Sm"; - itp->name = "147-Samarium"; - itp->isotope = true; - itp->M = 146.914893; - itp->nsf = 14.0; - pt_backup.push_back(itp); - // 148-samarium - itp = new AtomType(*atp); - itp->symbol = "148-Sm"; - itp->name = "148-Samarium"; - itp->isotope = true; - itp->M = 147.914818; - itp->nsf = -3.0; - pt_backup.push_back(itp); - // 149-samarium - itp = new AtomType(*atp); - itp->symbol = "149-Sm"; - itp->name = "149-Samarium"; - itp->isotope = true; - itp->M = 148.917180; - itp->nsf = 18.7; - pt_backup.push_back(itp); - // 150-samarium - itp = new AtomType(*atp); - itp->symbol = "150-Sm"; - itp->name = "150-Samarium"; - itp->isotope = true; - itp->M = 149.917271; - itp->nsf = 14.0; - pt_backup.push_back(itp); - // 152-samarium - itp = new AtomType(*atp); - itp->symbol = "152-Sm"; - itp->name = "152-Samarium"; - itp->isotope = true; - itp->M = 151.919728; - itp->nsf = -5.0; - pt_backup.push_back(itp); - // 154-samarium - itp = new AtomType(*atp); - itp->symbol = "154-Sm"; - itp->name = "154-Samarium"; - itp->isotope = true; - itp->M = 153.922205; - itp->nsf = 8.0; - pt_backup.push_back(itp); - } - // europium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Eu"; - atp->name = "Europium"; - atp->z = 63; - atp->M = 151.9641; - atp->radius = 1.9840; - atp->xsf = 63.0; - atp->nsf = 5.33; - // isotopes - // 153-europium - itp = new AtomType(*atp); - itp->symbol = "153-Eu"; - itp->name = "153-Europium"; - itp->isotope = true; - itp->M = 152.921226; - itp->nsf = 8.22; - pt_backup.push_back(itp); - } - // gadolinium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Gd"; - atp->name = "Gadolinium"; - atp->z = 64; - atp->M = 157.253; - atp->radius = 1.8180; - atp->xsf = 64.0; - atp->nsf = 9.52; - // isotopes - // 152-gadolinium - itp = new AtomType(*atp); - itp->symbol = "152-Gd"; - itp->name = "152-Gadolinium"; - itp->isotope = true; - itp->M = 151.919788; - itp->nsf = 10.0; - pt_backup.push_back(itp); - // 154-gadolinium - itp = new AtomType(*atp); - itp->symbol = "154-Gd"; - itp->name = "154-Gadolinium"; - itp->isotope = true; - itp->M = 153.920862; - itp->nsf = 10.0; - pt_backup.push_back(itp); - // 155-gadolinium - itp = new AtomType(*atp); - itp->symbol = "155-Gd"; - itp->name = "155-Gadolinium"; - itp->isotope = true; - itp->M = 154.922619; - itp->nsf = 13.8; - pt_backup.push_back(itp); - // 156-gadolinium - itp = new AtomType(*atp); - itp->symbol = "156-Gd"; - itp->name = "156-Gadolinium"; - itp->isotope = true; - itp->M = 155.922120; - itp->nsf = 6.3; - pt_backup.push_back(itp); - // 157-gadolinium - itp = new AtomType(*atp); - itp->symbol = "157-Gd"; - itp->name = "157-Gadolinium"; - itp->isotope = true; - itp->M = 156.923957; - itp->nsf = 4.0; - pt_backup.push_back(itp); - // 158-gadolinium - itp = new AtomType(*atp); - itp->symbol = "158-Gd"; - itp->name = "158-Gadolinium"; - itp->isotope = true; - itp->M = 157.924101; - itp->nsf = 9.0; - pt_backup.push_back(itp); - // 160-gadolinium - itp = new AtomType(*atp); - itp->symbol = "160-Gd"; - itp->name = "160-Gadolinium"; - itp->isotope = true; - itp->M = 159.927051; - itp->nsf = 9.15; - pt_backup.push_back(itp); - } - // terbium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Tb"; - atp->name = "Terbium"; - atp->z = 65; - atp->M = 158.925342; - atp->radius = 1.8005; - atp->xsf = 65.0; - atp->nsf = 7.342; - } - // dysprosium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Dy"; - atp->name = "Dysprosium"; - atp->z = 66; - atp->M = 162.5001; - atp->radius = 1.7951; - atp->xsf = 66.0; - atp->nsf = 16.93; - // isotopes - // 156-dysprosium - itp = new AtomType(*atp); - itp->symbol = "156-Dy"; - itp->name = "156-Dysprosium"; - itp->isotope = true; - itp->M = 155.924278; - itp->nsf = 6.1; - pt_backup.push_back(itp); - // 158-dysprosium - itp = new AtomType(*atp); - itp->symbol = "158-Dy"; - itp->name = "158-Dysprosium"; - itp->isotope = true; - itp->M = 157.924405; - itp->nsf = 6.0; - pt_backup.push_back(itp); - // 160-dysprosium - itp = new AtomType(*atp); - itp->symbol = "160-Dy"; - itp->name = "160-Dysprosium"; - itp->isotope = true; - itp->M = 159.925194; - itp->nsf = 6.7; - pt_backup.push_back(itp); - // 161-dysprosium - itp = new AtomType(*atp); - itp->symbol = "161-Dy"; - itp->name = "161-Dysprosium"; - itp->isotope = true; - itp->M = 160.926930; - itp->nsf = 10.3; - pt_backup.push_back(itp); - // 162-dysprosium - itp = new AtomType(*atp); - itp->symbol = "162-Dy"; - itp->name = "162-Dysprosium"; - itp->isotope = true; - itp->M = 161.926795; - itp->nsf = -1.4; - pt_backup.push_back(itp); - // 163-dysprosium - itp = new AtomType(*atp); - itp->symbol = "163-Dy"; - itp->name = "163-Dysprosium"; - itp->isotope = true; - itp->M = 162.928728; - itp->nsf = 5.0; - pt_backup.push_back(itp); - // 164-dysprosium - itp = new AtomType(*atp); - itp->symbol = "164-Dy"; - itp->name = "164-Dysprosium"; - itp->isotope = true; - itp->M = 163.929171; - itp->nsf = 49.4; - pt_backup.push_back(itp); - } - // holmium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ho"; - atp->name = "Holmium"; - atp->z = 67; - atp->M = 164.930322; - atp->radius = 1.7886; - atp->xsf = 67.0; - atp->nsf = 8.443; - } - // erbium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Er"; - atp->name = "Erbium"; - atp->z = 68; - atp->M = 167.2593; - atp->radius = 1.7794; - atp->xsf = 68.0; - atp->nsf = 7.792; - // isotopes - // 162-erbium - itp = new AtomType(*atp); - itp->symbol = "162-Er"; - itp->name = "162-Erbium"; - itp->isotope = true; - itp->M = 161.928775; - itp->nsf = 9.01; - pt_backup.push_back(itp); - // 164-erbium - itp = new AtomType(*atp); - itp->symbol = "164-Er"; - itp->name = "164-Erbium"; - itp->isotope = true; - itp->M = 163.929197; - itp->nsf = 7.95; - pt_backup.push_back(itp); - // 166-erbium - itp = new AtomType(*atp); - itp->symbol = "166-Er"; - itp->name = "166-Erbium"; - itp->isotope = true; - itp->M = 165.930290; - itp->nsf = 10.51; - pt_backup.push_back(itp); - // 167-erbium - itp = new AtomType(*atp); - itp->symbol = "167-Er"; - itp->name = "167-Erbium"; - itp->isotope = true; - itp->M = 166.932045; - itp->nsf = 3.06; - pt_backup.push_back(itp); - // 168-erbium - itp = new AtomType(*atp); - itp->symbol = "168-Er"; - itp->name = "168-Erbium"; - itp->isotope = true; - itp->M = 167.932368; - itp->nsf = 7.43; - pt_backup.push_back(itp); - // 170-erbium - itp = new AtomType(*atp); - itp->symbol = "170-Er"; - itp->name = "170-Erbium"; - itp->isotope = true; - itp->M = 169.935460; - itp->nsf = 9.61; - pt_backup.push_back(itp); - } - // thulium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Tm"; - atp->name = "Thulium"; - atp->z = 69; - atp->M = 168.934212; - atp->radius = 1.7687; - atp->xsf = 69.0; - atp->nsf = 7.073; - } - // ytterbium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Yb"; - atp->name = "Ytterbium"; - atp->z = 70; - atp->M = 173.043; - atp->radius = 1.9396; - atp->xsf = 70.0; - atp->nsf = 12.413; - // isotopes - // 168-ytterbium - itp = new AtomType(*atp); - itp->symbol = "168-Yb"; - itp->name = "168-Ytterbium"; - itp->isotope = true; - itp->M = 167.933894; - itp->nsf = -4.07; - pt_backup.push_back(itp); - // 170-ytterbium - itp = new AtomType(*atp); - itp->symbol = "170-Yb"; - itp->name = "170-Ytterbium"; - itp->isotope = true; - itp->M = 169.934759; - itp->nsf = 6.8; - pt_backup.push_back(itp); - // 171-ytterbium - itp = new AtomType(*atp); - itp->symbol = "171-Yb"; - itp->name = "171-Ytterbium"; - itp->isotope = true; - itp->M = 170.936322; - itp->nsf = 9.7; - pt_backup.push_back(itp); - // 172-ytterbium - itp = new AtomType(*atp); - itp->symbol = "172-Yb"; - itp->name = "172-Ytterbium"; - itp->isotope = true; - itp->M = 171.9363777; - itp->nsf = 9.5; - pt_backup.push_back(itp); - // 173-ytterbium - itp = new AtomType(*atp); - itp->symbol = "173-Yb"; - itp->name = "173-Ytterbium"; - itp->isotope = true; - itp->M = 172.9382068; - itp->nsf = 9.56; - pt_backup.push_back(itp); - // 174-ytterbium - itp = new AtomType(*atp); - itp->symbol = "174-Yb"; - itp->name = "174-Ytterbium"; - itp->isotope = true; - itp->M = 173.9388581; - itp->nsf = 19.2; - pt_backup.push_back(itp); - // 176-ytterbium - itp = new AtomType(*atp); - itp->symbol = "176-Yb"; - itp->name = "176-Ytterbium"; - itp->isotope = true; - itp->M = 175.942568; - itp->nsf = 8.7; - pt_backup.push_back(itp); - } - // lutetium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Lu"; - atp->name = "Lutetium"; - atp->z = 71; - atp->M = 174.9671; - atp->radius = 1.7515; - atp->xsf = 71.0; - atp->nsf = 7.213; - // isotopes - // 175-lutetium - itp = new AtomType(*atp); - itp->symbol = "175-Lu"; - itp->name = "175-Lutetium"; - itp->isotope = true; - itp->M = 174.9407679; - itp->nsf = 7.28; - pt_backup.push_back(itp); - // 176-lutetium - itp = new AtomType(*atp); - itp->symbol = "176-Lu"; - itp->name = "176-Lutetium"; - itp->isotope = true; - itp->M = 175.9426824; - itp->nsf = 6.1; - pt_backup.push_back(itp); - } - // hafnium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Hf"; - atp->name = "Hafnium"; - atp->z = 72; - atp->M = 178.492; - atp->radius = 1.5973; - atp->xsf = 72.0; - atp->nsf = 7.7714; - // isotopes - // 174-hafnium - itp = new AtomType(*atp); - itp->symbol = "174-Hf"; - itp->name = "174-Hafnium"; - itp->isotope = true; - itp->M = 173.940040; - itp->nsf = 10.9; - pt_backup.push_back(itp); - // 176-hafnium - itp = new AtomType(*atp); - itp->symbol = "176-Hf"; - itp->name = "176-Hafnium"; - itp->isotope = true; - itp->M = 175.9414018; - itp->nsf = 6.61; - pt_backup.push_back(itp); - // 177-hafnium - itp = new AtomType(*atp); - itp->symbol = "177-Hf"; - itp->name = "177-Hafnium"; - itp->isotope = true; - itp->M = 176.9432200; - itp->nsf = 0.8; - pt_backup.push_back(itp); - // 178-hafnium - itp = new AtomType(*atp); - itp->symbol = "178-Hf"; - itp->name = "178-Hafnium"; - itp->isotope = true; - itp->M = 177.9436977; - itp->nsf = 5.9; - pt_backup.push_back(itp); - // 179-hafnium - itp = new AtomType(*atp); - itp->symbol = "179-Hf"; - itp->name = "179-Hafnium"; - itp->isotope = true; - itp->M = 178.9458151; - itp->nsf = 7.46; - pt_backup.push_back(itp); - // 180-hafnium - itp = new AtomType(*atp); - itp->symbol = "180-Hf"; - itp->name = "180-Hafnium"; - itp->isotope = true; - itp->M = 179.9465488; - itp->nsf = 13.2; - pt_backup.push_back(itp); - } - // tantalum - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ta"; - atp->name = "Tantalum"; - atp->z = 73; - atp->M = 180.94791; - atp->radius = 1.4280; - atp->xsf = 73.0; - atp->nsf = 6.917; - // isotopes - // 180-tantalum - itp = new AtomType(*atp); - itp->symbol = "180-Ta"; - itp->name = "180-Tantalum"; - itp->isotope = true; - itp->M = 179.947466; - itp->nsf = 7.0; - pt_backup.push_back(itp); - // 181-tantalum - itp = new AtomType(*atp); - itp->symbol = "181-Ta"; - itp->name = "181-Tantalum"; - itp->isotope = true; - itp->M = 180.947996; - itp->nsf = 6.91; - pt_backup.push_back(itp); - } - // tungsten - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "W"; - atp->name = "Tungsten"; - atp->z = 74; - atp->M = 183.841; - atp->radius = 1.3705; - atp->xsf = 74.0; - atp->nsf = 4.75518; - // isotopes - // 180-tungsten - itp = new AtomType(*atp); - itp->symbol = "180-W"; - itp->name = "180-Tungsten"; - itp->isotope = true; - itp->M = 179.946706; - itp->nsf = 5.0; - pt_backup.push_back(itp); - // 182-tungsten - itp = new AtomType(*atp); - itp->symbol = "182-W"; - itp->name = "182-Tungsten"; - itp->isotope = true; - itp->M = 181.948206; - itp->nsf = 7.04; - pt_backup.push_back(itp); - // 183-tungsten - itp = new AtomType(*atp); - itp->symbol = "183-W"; - itp->name = "183-Tungsten"; - itp->isotope = true; - itp->M = 182.9502245; - itp->nsf = 6.59; - pt_backup.push_back(itp); - // 184-tungsten - itp = new AtomType(*atp); - itp->symbol = "184-W"; - itp->name = "184-Tungsten"; - itp->isotope = true; - itp->M = 183.9509326; - itp->nsf = 7.55; - pt_backup.push_back(itp); - // 186-tungsten - itp = new AtomType(*atp); - itp->symbol = "186-W"; - itp->name = "186-Tungsten"; - itp->isotope = true; - itp->M = 185.954362; - itp->nsf = -0.73; - pt_backup.push_back(itp); - } - // rhenium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Re"; - atp->name = "Rhenium"; - atp->z = 75; - atp->M = 186.2071; - atp->radius = 1.3800; - atp->xsf = 75.0; - atp->nsf = 9.22; - // isotopes - // 185-rhenium - itp = new AtomType(*atp); - itp->symbol = "185-Re"; - itp->name = "185-Rhenium"; - itp->isotope = true; - itp->M = 184.9529557; - itp->nsf = 9.0; - pt_backup.push_back(itp); - // 187-rhenium - itp = new AtomType(*atp); - itp->symbol = "187-Re"; - itp->name = "187-Rhenium"; - itp->isotope = true; - itp->M = 186.9557508; - itp->nsf = 9.3; - pt_backup.push_back(itp); - } - // osmium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Os"; - atp->name = "Osmium"; - atp->z = 76; - atp->M = 190.233; - atp->radius = 1.3676; - atp->xsf = 76.0; - atp->nsf = 10.72; - // isotopes - // 184-osmium - itp = new AtomType(*atp); - itp->symbol = "184-Os"; - itp->name = "184-Osmium"; - itp->isotope = true; - itp->M = 183.952491; - itp->nsf = 10.0; - pt_backup.push_back(itp); - // 186-osmium - itp = new AtomType(*atp); - itp->symbol = "186-Os"; - itp->name = "186-Osmium"; - itp->isotope = true; - itp->M = 185.953838; - itp->nsf = 12.0; - pt_backup.push_back(itp); - // 187-osmium - itp = new AtomType(*atp); - itp->symbol = "187-Os"; - itp->name = "187-Osmium"; - itp->isotope = true; - itp->M = 186.9557479; - itp->nsf = 10.0; - pt_backup.push_back(itp); - // 188-osmium - itp = new AtomType(*atp); - itp->symbol = "188-Os"; - itp->name = "188-Osmium"; - itp->isotope = true; - itp->M = 187.9558360; - itp->nsf = 7.8; - pt_backup.push_back(itp); - // 189-osmium - itp = new AtomType(*atp); - itp->symbol = "189-Os"; - itp->name = "189-Osmium"; - itp->isotope = true; - itp->M = 188.9581449; - itp->nsf = 11.0; - pt_backup.push_back(itp); - // 190-osmium - itp = new AtomType(*atp); - itp->symbol = "190-Os"; - itp->name = "190-Osmium"; - itp->isotope = true; - itp->M = 189.958445; - itp->nsf = 11.4; - pt_backup.push_back(itp); - // 192-osmium - itp = new AtomType(*atp); - itp->symbol = "192-Os"; - itp->name = "192-Osmium"; - itp->isotope = true; - itp->M = 191.961479; - itp->nsf = 11.9; - pt_backup.push_back(itp); - } - // iridium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ir"; - atp->name = "Iridium"; - atp->z = 77; - atp->M = 192.2173; - atp->radius = 1.3573; - atp->xsf = 77.0; - atp->nsf = 10.63; - } - // platinum - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pt"; - atp->name = "Platinum"; - atp->z = 78; - atp->M = 195.0782; - atp->radius = 1.3873; - atp->xsf = 78.0; - atp->nsf = 9.601; - // isotopes - // 190-platinum - itp = new AtomType(*atp); - itp->symbol = "190-Pt"; - itp->name = "190-Platinum"; - itp->isotope = true; - itp->M = 189.959930; - itp->nsf = 9.0; - pt_backup.push_back(itp); - // 192-platinum - itp = new AtomType(*atp); - itp->symbol = "192-Pt"; - itp->name = "192-Platinum"; - itp->isotope = true; - itp->M = 191.961035; - itp->nsf = 9.9; - pt_backup.push_back(itp); - // 194-platinum - itp = new AtomType(*atp); - itp->symbol = "194-Pt"; - itp->name = "194-Platinum"; - itp->isotope = true; - itp->M = 193.962664; - itp->nsf = 10.55; - pt_backup.push_back(itp); - // 195-platinum - itp = new AtomType(*atp); - itp->symbol = "195-Pt"; - itp->name = "195-Platinum"; - itp->isotope = true; - itp->M = 194.964774; - itp->nsf = 8.91; - pt_backup.push_back(itp); - // 196-platinum - itp = new AtomType(*atp); - itp->symbol = "196-Pt"; - itp->name = "196-Platinum"; - itp->isotope = true; - itp->M = 195.964935; - itp->nsf = 9.89; - pt_backup.push_back(itp); - // 198-platinum - itp = new AtomType(*atp); - itp->symbol = "198-Pt"; - itp->name = "198-Platinum"; - itp->isotope = true; - itp->M = 197.967876; - itp->nsf = 7.8; - pt_backup.push_back(itp); - } - // gold - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Au"; - atp->name = "Gold"; - atp->z = 79; - atp->M = 196.966552; - atp->radius = 1.4419; - atp->xsf = 79.0; - atp->nsf = 7.907; - } - // mercury - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Hg"; - atp->name = "Mercury"; - atp->z = 80; - atp->M = 200.592; - atp->radius = 1.5025; - atp->xsf = 80.0; - atp->nsf = 12.59545; - // isotopes - // 196-mercury - itp = new AtomType(*atp); - itp->symbol = "196-Hg"; - itp->name = "196-Mercury"; - itp->isotope = true; - itp->M = 195.965815; - itp->nsf = 30.3; - pt_backup.push_back(itp); - // 199-mercury - itp = new AtomType(*atp); - itp->symbol = "199-Hg"; - itp->name = "199-Mercury"; - itp->isotope = true; - itp->M = 198.968262; - itp->nsf = 16.9; - pt_backup.push_back(itp); - // 202-mercury - itp = new AtomType(*atp); - itp->symbol = "202-Hg"; - itp->name = "202-Mercury"; - itp->isotope = true; - itp->M = 201.970626; - itp->nsf = 11.002; - pt_backup.push_back(itp); - } - // thallium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Tl"; - atp->name = "Thallium"; - atp->z = 81; - atp->M = 204.38332; - atp->radius = 1.7283; - atp->xsf = 81.0; - atp->nsf = 8.7765; - // isotopes - // 203-thalium - itp = new AtomType(*atp); - itp->symbol = "203-Tl"; - itp->name = "203-Thallium"; - itp->isotope = true; - itp->M = 202.972329; - itp->nsf = 8.51; - pt_backup.push_back(itp); - // 205-thalium - itp = new AtomType(*atp); - itp->symbol = "205-Tl"; - itp->name = "205-Thallium"; - itp->isotope = true; - itp->M = 204.974412; - itp->nsf = 8.87; - pt_backup.push_back(itp); - } - // lead - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pb"; - atp->name = "Lead"; - atp->z = 82; - atp->M = 207.21; - atp->radius = 1.7501; - atp->xsf = 82.0; - atp->nsf = 9.4012; - // isotopes - // 204-lead - itp = new AtomType(*atp); - itp->symbol = "204-Pb"; - itp->name = "204-Lead"; - itp->isotope = true; - itp->M = 203.973029; - itp->nsf = 10.893; - pt_backup.push_back(itp); - // 206-lead - itp = new AtomType(*atp); - itp->symbol = "206-Pb"; - itp->name = "206-Lead"; - itp->isotope = true; - itp->M = 205.974449; - itp->nsf = 9.2221; - pt_backup.push_back(itp); - // 207-lead - itp = new AtomType(*atp); - itp->symbol = "207-Pb"; - itp->name = "207-Lead"; - itp->isotope = true; - itp->M = 206.975881; - itp->nsf = 9.286; - pt_backup.push_back(itp); - // 208-lead - itp = new AtomType(*atp); - itp->symbol = "208-Pb"; - itp->name = "208-Lead"; - itp->isotope = true; - itp->M = 207.976636; - itp->nsf = 9.494; - pt_backup.push_back(itp); - } - // bismuth - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Bi"; - atp->name = "Bismuth"; - atp->z = 83; - atp->M = 208.980382; - atp->radius = 1.4600; - atp->xsf = 83.0; - atp->nsf = 8.5322; - } - // polonium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Po"; - atp->name = "Polonium"; - atp->z = 84; - atp->M = 209.0; - atp->radius = 1.4600; - atp->xsf = 84.0; - atp->nsf = 0.0; - } - // astatine - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "At"; - atp->name = "Astatine"; - atp->z = 85; - atp->M = 210.0; - atp->radius = 1.4500; - atp->xsf = 85.0; - atp->nsf = 0.0; - } - // radon - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Rn"; - atp->name = "Radon"; - atp->z = 86; - atp->M = 222.0; - atp->radius = 1.4300; - atp->xsf = 86.0; - atp->nsf = 0.0; - } - // francium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Fr"; - atp->name = "Francium"; - atp->z = 87; - atp->M = 223.0; - atp->radius = 2.5000; - atp->xsf = 87.0; - atp->nsf = 0.0; - } - // radium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ra"; - atp->name = "Radium"; - atp->z = 88; - atp->M = 226.0; - atp->radius = 2.1400; - atp->xsf = 88.0; - atp->nsf = 10.0; - } - // actinium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ac"; - atp->name = "Actinium"; - atp->z = 89; - atp->M = 227.0; - atp->radius = 1.8775; - atp->xsf = 89.0; - atp->nsf = 0.0; - } - // thorium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Th"; - atp->name = "Thorium"; - atp->z = 90; - atp->M = 232.03811; - atp->radius = 1.7975; - atp->xsf = 90.0; - atp->nsf = 10.31; - } - // protactinium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pa"; - atp->name = "Protactinium"; - atp->z = 91; - atp->M = 231.035882; - atp->radius = 1.6086; - atp->xsf = 91.0; - atp->nsf = 9.13; - } - // uranium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "U"; - atp->name = "Uranium"; - atp->z = 92; - atp->M = 238.028913; - atp->radius = 1.5683; - atp->xsf = 92.0; - atp->nsf = 8.417; - // isotopes - // 233-uranium - itp = new AtomType(*atp); - itp->symbol = "233-U"; - itp->name = "233-Uranium"; - itp->isotope = true; - itp->M = 233.039628; - itp->nsf = 10.1; - pt_backup.push_back(itp); - // 234-uranium - itp = new AtomType(*atp); - itp->symbol = "234-U"; - itp->name = "234-Uranium"; - itp->isotope = true; - itp->M = 234.0409456; - itp->nsf = 12.4; - pt_backup.push_back(itp); - // 235-uranium - itp = new AtomType(*atp); - itp->symbol = "235-U"; - itp->name = "235-Uranium"; - itp->isotope = true; - itp->M = 235.0439231; - itp->nsf = 10.50; - pt_backup.push_back(itp); - // 238-uranium - itp = new AtomType(*atp); - itp->symbol = "238-U"; - itp->name = "238-Uranium"; - itp->isotope = true; - itp->M = 238.0507826; - itp->nsf = 8.407; - pt_backup.push_back(itp); - } - // neptunium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Np"; - atp->name = "Neptunium"; - atp->z = 93; - atp->M = 237.0; - atp->radius = 1.0000; - atp->xsf = 93.0; - atp->nsf = 10.55; - } - // plutonium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Pu"; - atp->name = "Plutonium"; - atp->z = 94; - atp->M = 244.0; - atp->radius = 1.0000; - atp->xsf = 94.0; - atp->nsf = 7.71; - // isotopes - // 240-plutonium - itp = new AtomType(*atp); - itp->symbol = "240-Pu"; - itp->name = "240-Plutonium"; - itp->isotope = true; - itp->M = 240.0538075; - itp->nsf = 3.5; - pt_backup.push_back(itp); - // 242-plutonium - itp = new AtomType(*atp); - itp->symbol = "242-Pu"; - itp->name = "242-Plutonium"; - itp->isotope = true; - itp->M = 242.0587368; - itp->nsf = 8.1; - pt_backup.push_back(itp); - } - // americium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Am"; - atp->name = "Americium"; - atp->z = 95; - atp->M = 243.0; - atp->radius = 1.0000; - atp->xsf = 95.0; - atp->nsf = 8.32; - } - // curium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cm"; - atp->name = "Curium"; - atp->z = 96; - atp->M = 247.0; - atp->radius = 1.0000; - atp->xsf = 96.0; - atp->nsf = 9.53; - // isotopes - // 246-curium - itp = new AtomType(*atp); - itp->symbol = "246-Cm"; - itp->name = "246-Curium"; - itp->isotope = true; - itp->M = 246.0672176; - itp->nsf = 9.3; - pt_backup.push_back(itp); - // 248-curium - itp = new AtomType(*atp); - itp->symbol = "248-Cm"; - itp->name = "248-Curium"; - itp->isotope = true; - itp->M = 248.072342; - itp->nsf = 7.7; - pt_backup.push_back(itp); - } - // berkelium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Bk"; - atp->name = "Berkelium"; - atp->z = 97; - atp->M = 247.0; - atp->radius = 1.0000; - atp->xsf = 97.0; - atp->nsf = 0.0; - } - // californium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Cf"; - atp->name = "Californium"; - atp->z = 98; - atp->M = 251.0; - atp->radius = 1.0000; - atp->xsf = 98.0; - atp->nsf = 0.0; - } - // einsteinium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Es"; - atp->name = "Einsteinium"; - atp->z = 99; - atp->M = 252.0; - atp->radius = 1.0000; - atp->xsf = 99.0; - atp->nsf = 0.0; - } - // fermium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Fm"; - atp->name = "Fermium"; - atp->z = 100; - atp->M = 257.0; - atp->radius = 1.0000; - atp->xsf = 100.0; - atp->nsf = 0.0; - } - // mendelevium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Md"; - atp->name = "Mendelevium"; - atp->z = 101; - atp->M = 258.0; - atp->radius = 1.0000; - atp->xsf = 101.0; - atp->nsf = 0.0; - } - // nobelium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "No"; - atp->name = "Nobelium"; - atp->z = 102; - atp->M = 259.0; - atp->radius = 1.0000; - atp->xsf = 102.0; - atp->nsf = 0.0; - } - // lawrencium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Lr"; - atp->name = "Lawrencium"; - atp->z = 103; - atp->M = 262.0; - atp->radius = 1.0000; - atp->xsf = 103.0; - atp->nsf = 0.0; - } - // rutherfordium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Rf"; - atp->name = "Rutherfordium"; - atp->z = 104; - atp->M = 261.0; - atp->radius = 1.0000; - atp->xsf = 104.0; - atp->nsf = 0.0; - } - // dubnium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Db"; - atp->name = "Dubnium"; - atp->z = 105; - atp->M = 262.0; - atp->radius = 1.0000; - atp->xsf = 105.0; - atp->nsf = 0.0; - } - // seaborgium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Sg"; - atp->name = "Seaborgium"; - atp->z = 106; - atp->M = 266.0; - atp->radius = 1.0000; - atp->xsf = 106.0; - atp->nsf = 0.0; - } - // bohrium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Bh"; - atp->name = "Bohrium"; - atp->z = 107; - atp->M = 264.0; - atp->radius = 1.0000; - atp->xsf = 107.0; - atp->nsf = 0.0; - } - // hassium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Hs"; - atp->name = "Hassium"; - atp->z = 108; - atp->M = 277.0; - atp->radius = 1.0000; - atp->xsf = 108.0; - atp->nsf = 0.0; - } - // meitnerium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Mt"; - atp->name = "Meitnerium"; - atp->z = 109; - atp->M = 268.0; - atp->radius = 1.0000; - atp->xsf = 109.0; - atp->nsf = 0.0; - } - // darmstadtium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Ds"; - atp->name = "Darmstadtium"; - atp->z = 110; - atp->M = 281.0; - atp->radius = 1.0000; - atp->xsf = 110.0; - atp->nsf = 0.0; - } - // roentgenium - atp = *pt_backup.insert(pt_backup.end(), new AtomType()); - { - atp->symbol = "Rg"; - atp->name = "Roentgenium"; - atp->z = 111; - atp->M = 272.0; - atp->radius = 1.0000; - atp->xsf = 111.0; - atp->nsf = 0.0; - } -} - -// End of file diff --git a/libpdffit2/PeriodicTable.h b/libpdffit2/PeriodicTable.h deleted file mode 100644 index 99949031..00000000 --- a/libpdffit2/PeriodicTable.h +++ /dev/null @@ -1,75 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class PeriodicTable -* -* Comments: singleton class, use PeriodicTable::instance() -* for its pointer -* -***********************************************************************/ - -#ifndef PERIODICTABLE_H_INCLUDED -#define PERIODICTABLE_H_INCLUDED - -#include -#include -#include -#include -#include "AtomType.h" -#include "support_msvc9.h" - -// PeriodicTable -class PeriodicTable -{ - private: - - // PeriodicTable is a singleton class - PeriodicTable(); - - public: - - // Access to singleton instance - static PeriodicTable* instance() - { - static std::unique_ptr the_table(new PeriodicTable()); - return the_table.get(); - } - // Destructor - ~PeriodicTable(); - - // Methods - AtomType* name(const std::string& s); - AtomType* symbol(const std::string& s); - AtomType* lookup(std::string s); // icase lookup - bool has(const std::string& s); - void defAtomType(const AtomType& atp); - void deleteAtomType(const AtomType* atp); - void reset(AtomType* atp); // retrieve atp from pt_backup - void resetAll(); // reset all elements - - private: - - // Data Members - std::map name_index; - std::map symbol_index; - std::deque pt_public; - std::deque pt_backup; - - // Methods - void init(); - void clear(); - void fill_pt_backup(); -}; - -#endif // PERIODICTABLE_H_INCLUDED diff --git a/libpdffit2/PointsInSphere.cc b/libpdffit2/PointsInSphere.cc deleted file mode 100644 index 8e51c575..00000000 --- a/libpdffit2/PointsInSphere.cc +++ /dev/null @@ -1,243 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* classes PointsInSphere, ReflectionsInQminQmax, ReflectionsInDmaxDmin -* -* Comments: sequencers for lattice points insided 3D sphere -* -***********************************************************************/ - -#include -#include "PointsInSphere.h" - -using namespace NS_POINTSINSPHERE; - -//////////////////////////////////////////////////////////////////////// -// LatticeParameters -//////////////////////////////////////////////////////////////////////// - -LatticeParameters::LatticeParameters( double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ) : - a(_a), b(_b), c(_c), - alpha(_alpha), beta(_beta), gamma(_gamma) -{ - update(); -} - -LatticeParameters& LatticeParameters::update() -{ - ca = cosd(alpha); cb = cosd(beta); cg = cosd(gamma); - sa = sind(alpha); sb = sind(beta); sg = sind(gamma); - // Vunit is a volume of unit cell with a=b=c=1 - const double Vunit = sqrt(1.0 + 2.0*ca*cb*cg - ca*ca - cb*cb - cg*cg); - ar = sa/(a*Vunit); - br = sb/(b*Vunit); - cr = sg/(c*Vunit); - car = (cb*cg - ca)/(sb*sg); sar = sqrt(1.0 - car*car); - cbr = (ca*cg - cb)/(sa*sg); sbr = sqrt(1.0 - cbr*cbr); - cgr = (ca*cb - cg)/(sa*sb); sgr = sqrt(1.0 - cgr*cgr); - alphar = 180.0/M_PI*acos(car); - betar = 180.0/M_PI*acos(cbr); - gammar = 180.0/M_PI*acos(cgr); - return *this; -} - -LatticeParameters LatticeParameters::reciprocal() const -{ - using namespace std; - LatticeParameters rec(*this); - swap(rec.a, rec.ar); - swap(rec.b, rec.br); - swap(rec.c, rec.cr); - swap(rec.alpha, rec.alphar); - swap(rec.beta, rec.betar); - swap(rec.gamma, rec.gammar); - swap(rec.ca, rec.car); - swap(rec.cb, rec.cbr); - swap(rec.cg, rec.cgr); - swap(rec.sa, rec.sar); - swap(rec.sb, rec.sbr); - swap(rec.sg, rec.sgr); - return rec; -} - - -//////////////////////////////////////////////////////////////////////// -// PointsInSphere -//////////////////////////////////////////////////////////////////////// - -PointsInSphere::PointsInSphere( double _Rmin, double _Rmax, - const LatticeParameters& _latpar ) : - m(mno[0]), n(mno[1]), o(mno[2]), - Rmin(_Rmin), Rmax(_Rmax), latpar(_latpar) -{ - init(); - rewind(); -} - -PointsInSphere::PointsInSphere( double _Rmin, double _Rmax, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ) : - m(mno[0]), n(mno[1]), o(mno[2]), - Rmin(_Rmin), Rmax(_Rmax), - latpar(_a, _b, _c, _alpha, _beta, _gamma) -{ - init(); - rewind(); -} - -void PointsInSphere::init() -{ - RminSquare = (Rmin < 0.0) ? -(Rmin*Rmin) : Rmin*Rmin; - RmaxSquare = (Rmax < 0.0) ? -(Rmax*Rmax) : Rmax*Rmax; - dn0dm = latpar.cgr*latpar.br/latpar.ar; - do0dm = latpar.cbr*latpar.cr/latpar.ar; - // 2D reciprocal parameters in bc plane - b2r = 1.0/(latpar.b*latpar.sa); - c2r = 1.0/(latpar.c*latpar.sa); - ca2r = -latpar.ca; - do0dn = ca2r*c2r/b2r; - // 1D reciprocal along c axis - c1r = 1.0/latpar.c; -} - -void PointsInSphere::rewind() -{ - mHalfSpan = Rmax*latpar.ar; - hi_m = int(ceil(mHalfSpan)); - m = -hi_m; - // make indices n, o invalid, reset the neares point - n = hi_n = 0; - o = hi_o = outside_o = 0; - n0plane = o0plane = o0line = 0.0; - // unset excluded zone - oExclHalfSpan = 0.0; - // get the first inside point - next_o(); -} - -void PointsInSphere::next_o() -{ - do - { - o++; - if (o < hi_o) - { - return; - } - if (hi_o != outside_o) - { - hi_o = outside_o; - o = int( ceil(o0line+oExclHalfSpan) ) - 1; - continue; - } - next_n(); - } - while (!finished()); -} - -void PointsInSphere::next_n() -{ - do - { - n++; - if (n < hi_n) - { - o0line = o0plane + (n-n0plane)*do0dn; - double RlineSquare = RplaneSquare - pow((n-n0plane)/b2r,2); - oHalfSpan = RlineSquare > 0.0 ? sqrt(RlineSquare)*c1r : 0.0; - // parentheses improve round-off errors around [0,0,0] - double RExclSquare = RminSquare + (RlineSquare - RmaxSquare); - oExclHalfSpan = RExclSquare > 0.0 ? sqrt(RExclSquare)*c1r : 0.0; - o = int(floor(o0line - oHalfSpan)); - outside_o = int(ceil(o0line + oHalfSpan)); - hi_o = outside_o; - if (oExclHalfSpan) - { - int hole_o = int(ceil(o0line - oExclHalfSpan)); - if (fabs(hole_o-o0line) < oExclHalfSpan) hi_o = hole_o; - } - return; - } - next_m(); - } - while (!finished()); -} - -void PointsInSphere::next_m() -{ - m++; - if (finished()) - { - return; - } - // not finished here - n0plane = m*dn0dm; - o0plane = m*do0dm; - RplaneSquare = RmaxSquare - pow(m/latpar.ar,2); - nHalfSpan = RplaneSquare > 0.0 ? sqrt(RplaneSquare)*b2r : 0.0; - n = int(floor(n0plane - nHalfSpan)); - hi_n = int(ceil(n0plane + nHalfSpan)); -} - -double PointsInSphere::r() const -{ - const double &a = latpar.a, &b = latpar.b, &c = latpar.c; - const double &ca = latpar.ca, &cb = latpar.cb, &cg = latpar.cg; - return sqrt( m*m*a*a + n*n*b*b + o*o*c*c - + 2*m*n*a*b*cg + 2*m*o*a*c*cb + 2*n*o*b*c*ca ); -} - - -//////////////////////////////////////////////////////////////////////// -// ReflectionsInQminQmax -//////////////////////////////////////////////////////////////////////// - -ReflectionsInQminQmax::ReflectionsInQminQmax( double _Qmin, double _Qmax, - const LatticeParameters& _latpar ) : - Qmin(_Qmin), Qmax(_Qmax), - latpar(_latpar), - sph(Qmin*M_1_PI/2.0, Qmax*M_1_PI/2.0, latpar.reciprocal()), - hkl(sph.mno), h(hkl[0]), k(hkl[1]), l(hkl[2]) -{ } - -ReflectionsInQminQmax::ReflectionsInQminQmax( double _Qmin, double _Qmax, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ) : - Qmin(_Qmin), Qmax(_Qmax), - latpar(_a, _b, _c, _alpha, _beta, _gamma), - sph(Qmin*M_1_PI/2.0, Qmax*M_1_PI/2.0, latpar.reciprocal()), - hkl(sph.mno), h(hkl[0]), k(hkl[1]), l(hkl[2]) -{ } - - -//////////////////////////////////////////////////////////////////////// -// ReflectionsInDmaxDmin -//////////////////////////////////////////////////////////////////////// - -ReflectionsInDmaxDmin::ReflectionsInDmaxDmin( double _Dmax, double _Dmin, - const LatticeParameters& _latpar ) : - ReflectionsInQminQmax(2.0*M_PI/_Dmax, 2.0*M_PI/_Dmin, _latpar), - Dmax(_Dmax), Dmin(_Dmin) -{ } - -ReflectionsInDmaxDmin::ReflectionsInDmaxDmin( double _Dmax, double _Dmin, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ) : - ReflectionsInQminQmax( 2.0*M_PI/_Dmax, 2.0*M_PI/_Dmin, - _a, _b, _c, _alpha, _beta, _gamma ), - Dmax(_Dmax), Dmin(_Dmin) -{ } - -// End of file diff --git a/libpdffit2/PointsInSphere.h b/libpdffit2/PointsInSphere.h deleted file mode 100644 index 2c3b5d45..00000000 --- a/libpdffit2/PointsInSphere.h +++ /dev/null @@ -1,182 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* classes PointsInSphere, ReflectionsInQminQmax, ReflectionsInDmaxDmin -* -* Constructors: -* -* PointsInSphere(Rmin, Rmax, a, b, c, alpha, beta, gamma) -* ReflectionsInQminQmax(Qmin, Qmax, a, b, c, alpha, beta, gamma) -* ReflectionsInDmaxDmin(Dmax, Dmin, a, b, c, alpha, beta, gamma) -* -* Examples: -* -* PointsInSphere sph(Rmin, Rmax, a, b, c, alpha, beta, gamma) -* for (sph.rewind(); !sph.finished(); sph.next()) -* { -* // lattice indices are in sph.m, sph.n, sph.o or sph.mno[3] -* // sph.r() is distance from origin, -* // where Rmin < sph.r() < Rmax -* } -* -* ReflectionsInQminQmax refl(Qmin, Qmax, a, b, c, alpha, beta, gamma) -* for (ReflectionsInQminQmax ref(Qmin, Qmax, a, b, c, alpha, beta, gamma); -* !ref.finished(); ref.next() ) -* { -* // Miller indices are in ref.h, ref.k, ref.l or ref.hkl[3] -* // ref.Q() is magnitude of Q vector -* // ref.d() is lattice plane spacing -* } -* -* Tip: add epsilon to Rmax to avoid roundoff issues -* -***********************************************************************/ - -#ifndef POINTSINSPHERE_H_INCLUDED -#define POINTSINSPHERE_H_INCLUDED - -#include - - -namespace NS_POINTSINSPHERE { - -class LatticeParameters -{ -public: - LatticeParameters( double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ); - // calculate all properties from current lattice parameters - LatticeParameters& update(); - // return a reciprocal of this lattice - LatticeParameters reciprocal() const; - // input arguments - double a, b, c, alpha, beta, gamma; - // cosines and sines of direct lattice angles - double ca, cb, cg, sa, sb, sg; - // reciprocal lattice and its cosines and sines - double ar, br, cr, alphar, betar, gammar; - double car, cbr, cgr, sar, sbr, sgr; -private: - // helper functions - inline double cosd(double x) { return cos(M_PI/180.0*x); } - inline double sind(double x) { return sin(M_PI/180.0*x); } -}; - -class PointsInSphere -{ -public: - PointsInSphere( double _Rmin, double _Rmax, - const LatticeParameters& _latpar ); - PointsInSphere( double _Rmin, double _Rmax, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ); - void rewind(); - inline void next() - { - next_o(); - } - inline bool finished() - { - return !(m < hi_m); - } - // mno array and m, n, o aliases are supposed to be read only - int mno[3]; - int &m, &n, &o; - double r() const; - // input arguments - const double Rmin, Rmax; - const LatticeParameters latpar; -private: - // loop advance functions - void next_m(); - void next_n(); - void next_o(); - void init(); - // calculated constants set by init() - double RminSquare, RmaxSquare; - // 2D reciprocal parameters and cosine in bc plane - double b2r, c2r, ca2r; - // reciprocal c - double c1r; - // offset of the nearest point to [0,0,0] - double dn0dm, do0dm, do0dn; - // loop variables - double n0plane, o0plane, o0line; - double mHalfSpan, nHalfSpan, oHalfSpan; - // o indices excluded due to Rmin - double oExclHalfSpan; - int hi_m, hi_n, hi_o, outside_o; - double RplaneSquare; -}; - -class ReflectionsInQminQmax -{ -public: - ReflectionsInQminQmax( double _Qmin, double _Qmax, - const LatticeParameters& _latpar ); - ReflectionsInQminQmax( double _Qmin, double _Qmax, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ); - inline void rewind() - { - sph.rewind(); - } - inline void next() - { - sph.next(); - } - inline bool finished() - { - return sph.finished(); - } - // input arguments - const double Qmin, Qmax; - const LatticeParameters latpar; -private: - // sph must be initialized before hkl and h, k, l - PointsInSphere sph; -public: - // hkl array and h, k, l aliases are supposed to be read only - int *hkl; - int &h, &k, &l; - inline double Q() const - { - return 2.0*M_PI*sph.r(); - } - inline double d() const - { - return 1.0/sph.r(); - } -}; - -class ReflectionsInDmaxDmin : ReflectionsInQminQmax -{ -public: - ReflectionsInDmaxDmin( double _Dmax, double _Dmin, - const LatticeParameters& _latpar ); - ReflectionsInDmaxDmin( double _Dmax, double _Dmin, - double _a, double _b, double _c, - double _alpha, double _beta, double _gamma ); - // input arguments - const double Dmax, Dmin; -}; - - -} // namespace NS_POINTSINSPHERE - -using NS_POINTSINSPHERE::PointsInSphere; -using NS_POINTSINSPHERE::ReflectionsInQminQmax; -using NS_POINTSINSPHERE::ReflectionsInDmaxDmin; - -#endif // POINTSINSPHERE_H_INCLUDED diff --git a/libpdffit2/ShapeFactors.h b/libpdffit2/ShapeFactors.h deleted file mode 100644 index 031efe66..00000000 --- a/libpdffit2/ShapeFactors.h +++ /dev/null @@ -1,43 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2007 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* PDF corrections due to particle shape. -* -* Comments: -* PDF correction for spherical particles obtained from -* R.C. Howell et al, Phys. Rev. B 73, 094107 (2006) -* http://link.aps.org/abstract/PRB/v73/e094107 -* -***********************************************************************/ - -#ifndef SHAPEFACTORS_H_INCLUDED -#define SHAPEFACTORS_H_INCLUDED - -#include - -// envelope function for spherical nanoparticle with diameter d -inline double sphereEnvelope(double r, double d) -{ - double rdratio = r/d; - return (rdratio < 1.0) ? (1.0 - 1.5*rdratio + 0.5*pow(rdratio, 3)) : 0.0; -} - -// derivative of sphereEnvelope by diameter d -inline double dsphereEnvelope(double r, double d) -{ - double rdratio = r/d; - return (rdratio < 1.0) ? (1.5*rdratio/d - 1.5*pow(rdratio, 3)/d) : 0.0; -} - -#endif // SHAPEFACTORS_H_INCLUDED diff --git a/libpdffit2/StringUtils.cc b/libpdffit2/StringUtils.cc deleted file mode 100644 index 73fc04da..00000000 --- a/libpdffit2/StringUtils.cc +++ /dev/null @@ -1,58 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch, Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Utilities for string formatting. -* -***********************************************************************/ - -#include -#include - -#include "StringUtils.h" -#include "MathUtils.h" - -using namespace std; - -// return an uppercase copy of string s -string toupper(string s) -{ - for (string::iterator ii = s.begin(); ii != s.end(); ++ii) - { - *ii = toupper(*ii); - } - return s; -} - -// class FormatValueWithStd -string FormatValueWithStd::operator() (double x, double dx) -{ - ostringstream out(f_leading_blank ? " " : "", ios_base::app); - out << x << setprecision(f_std_precision); - // do not write dx when it is too small - if (dx > fabs(x)*1e-8) out << " (" << dx << ')'; - else if (std::isnan(dx)) out << " (NaN)"; - // left-pad string to the width - string rv = out.str(); - int rvlen = rv.size(); - // pad or prepend blanks as necessary - if (rvlen < f_width) - { - size_t nblanks = f_width - rvlen; - if (f_left) rv.append(nblanks, ' '); - else rv.insert(0, nblanks, ' '); - } - return rv; -} - -// End of file diff --git a/libpdffit2/StringUtils.h b/libpdffit2/StringUtils.h deleted file mode 100644 index edb74a96..00000000 --- a/libpdffit2/StringUtils.h +++ /dev/null @@ -1,71 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Utilities for string formatting. -* -***********************************************************************/ - -#ifndef STRINGUTILS_H_INCLUDED -#define STRINGUTILS_H_INCLUDED - -#include - -std::string toupper(std::string s); - -class FormatValueWithStd -{ - private: - - // Data members - int f_width; - bool f_left; - bool f_leading_blank; - int f_std_precision; - - public: - - // Constructor: - FormatValueWithStd() - { - f_width = 0; - f_left = false; - f_leading_blank = false; - f_std_precision = 2; - } - - // Methods: - std::string operator() (double x, double dx); - inline FormatValueWithStd& width(int w) - { - f_width = w; - return *this; - } - inline FormatValueWithStd& left() - { - f_left = true; - return *this; - } - inline FormatValueWithStd& right() - { - f_left = false; - return *this; - } - inline FormatValueWithStd& leading_blank(bool flag) - { - f_leading_blank = flag; - return *this; - } -}; - -#endif // STRINGUTILS_H_INCLUDED diff --git a/libpdffit2/exceptions.h b/libpdffit2/exceptions.h deleted file mode 100644 index 738ce1a6..00000000 --- a/libpdffit2/exceptions.h +++ /dev/null @@ -1,95 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow, Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Exceptions used in pdffit2. -* -* Comments: -* -***********************************************************************/ - -#ifndef EXCEPTIONS_H_INCLUDED -#define EXCEPTIONS_H_INCLUDED - -#include -#include - -class Exception -{ - private: - std::string msg; - public: - Exception(std::string _msg) : msg(_msg) {} - std::string GetMsg() - { - return msg; - } -}; - -//specific exceptions - mimic python names -class ValueError : public Exception -{ - public: - ValueError(std::string _msg) : Exception(_msg) {} -}; - -class unassignedError : public Exception -{ - public: - unassignedError(std::string _msg) : Exception(_msg) {} -}; - -class IOError : public Exception -{ - public: - IOError(std::string _msg) : Exception(_msg) {} -}; - -class dataError : public Exception -{ - public: - dataError(std::string _msg) : Exception(_msg) {} -}; - -class structureError : public Exception -{ - public: - structureError(std::string _msg) : Exception(_msg) {} -}; - -class constraintError : public Exception -{ - public: - constraintError(std::string _msg) : Exception(_msg) {} -}; - -class calculationError : public Exception -{ - public: - calculationError(std::string _msg) : Exception(_msg) {} -}; - -class parseError : public Exception -{ - public: - parseError(std::string _msg) : Exception(_msg) {} -}; - -//This one is used internally, and should not make it to the python layer. -class vgetException : public Exception -{ - public: - vgetException(std::string _msg) : Exception(_msg) {} -}; - -#endif // EXCEPTIONS_H_INCLUDED diff --git a/libpdffit2/fit.cc b/libpdffit2/fit.cc deleted file mode 100644 index 4426aa29..00000000 --- a/libpdffit2/fit.cc +++ /dev/null @@ -1,836 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch, Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Mixed definitions of several DataSet, Fit and PdfFit methods -* -* Comments: Up to date with 1.3.10 Fortran version. -* What a spagetti. -* -***********************************************************************/ - -#include -#include -#include -#include -#include - -#include "MathUtils.h" -#include "ShapeFactors.h" -#include "pdffit.h" - -using NS_PDFFIT2::pout; - -/************************* - Main fit routine -**************************/ -// Command called in Fortran -// Now called - -int PdfFit::refine(bool deriv, double toler) { - int finished = 0; - while( !finished ) - { - finished = refine_step(deriv, toler); - } - return 1; -} - - -// CLF Wed May 25 2005 -// Added one-step refinement so that the progress can be checked after each -// refinement step. Many parameters made into public data members of Fit. This -// function is for use in higher level refinement routines. -int PdfFit::refine_step(bool deriv, double toler) -{ - static bool fit_running = false; - const int NSTAG = 3, MINITER = 3, MAXITER = 100; - - fit_running = fit_running && (fit.iter != 0); - // If fit_running flag is down, this is the first iteration. - // If so, then set up the fit. - if(!fit_running) - { - fit.iter = 0; - fit.alambda = -1; - fit.stagnating = 0; - fit.chisq = double_max; - fit_running = true; - - *pout << - "*******************\n" << - "Starting refinement\n" << - "*******************\n"; - - for (int is=0; isiset << " Phase: "; - for (unsigned int ip=0; ippsel.size(); ip++) - if (datasets[is]->psel[ip]) *pout << phase[ip]->iphase << " "; - *pout << endl; - - } - - fit_setup(); - } - - - //------ Here starts the fitting - - // setting the offset for all refinable variables - - if( (fit.iter order = this->order_by_id(); - vector::iterator i; - int j; - for (i = order.begin(), j = 0; i != order.end(); ++i) - { - if (ip[*i]) - { - *pout << setw(4) << id[*i] << ": " << setw(9) << fixed << p[*i]; - j++; - if (j % 4) *pout << " "; - else *pout << endl; - } - } - if (j % 4) *pout << endl; - *pout << endl; - (*pout).unsetf(ios_base::fixed); -} - -/********************************************************** - Setting the offset for all refinable variables -**********************************************************/ -void PdfFit::fit_setup() -{ - // initialize the array with the addresses of refinable variable - // and initialize the offset pointers to be used in derivative routines - // also makes a vector containing the address of the error of each - // refinable variable - //int ip, ia, is, j; - int j; - - // First we make an initial fill of all constrained equations - // to detect missing parameters but mainly to detect the fixed constraints, - // i.e. constraints without parameters or with only fixed parameters - - fit.fill_variables(); - - // for each refinable variable detect the corresponding constraint - - fit.refvar.clear(); - fit.sdptr.clear(); - - for (int ip=0; ipphase[ip]; - - phase.offset = fit.refvar.size(); - - for (j=0;j<3;j++) - { - fit.refvar.push_back(fit.vfind(phase.a0[j])); - fit.sdptr.push_back(&phase.da0[j]); - } - for (j=0;j<3;j++) - { - fit.refvar.push_back(fit.vfind(phase.win[j])); - fit.sdptr.push_back(&phase.dwin[j]); - - } - fit.refvar.push_back(fit.vfind(phase.delta2)); - fit.sdptr.push_back(&phase.ddelta2); - - fit.refvar.push_back(fit.vfind(phase.delta1)); - fit.sdptr.push_back(&phase.ddelta1); - - fit.refvar.push_back(fit.vfind(phase.pscale)); - fit.sdptr.push_back(&phase.dpscale); - - fit.refvar.push_back(fit.vfind(phase.spdiameter)); - fit.sdptr.push_back(&phase.dspdiameter); - - fit.refvar.push_back(fit.vfind(phase.sratio)); - fit.sdptr.push_back(&phase.dsratio); - - for (int ia=0; iadatasets[is]; - - ds.offset = fit.refvar.size(); - - fit.refvar.push_back(fit.vfind(ds.dscale)); - fit.sdptr.push_back(&ds.ddscale); - - fit.refvar.push_back(fit.vfind(ds.qdamp)); - fit.sdptr.push_back(&ds.dqdamp); - - fit.refvar.push_back(fit.vfind(ds.qbroad)); - fit.sdptr.push_back(&ds.dqbroad); - } - - // maximum number of refinable variables - int maxvar = fit.refvar.size(); - - // fill the vector pointing from available refinable variables to - // actual constrained variables - - if (maxvar != getnpar() ) - { - throw constraintError("Parameter set but not constrained."); - } - - fit.ndof = 0; - - for (int i=0; idatasets.empty()) - { - throw unassignedError("Space for calculation must be alloc'ed first"); - } - fit_theory(false, true); - *pout << "\n================================== DONE =================================\n"; - return; -} - -/*********************************************************** - Here we calculate PDF and derivatives during LS fit - (previously known as fit_theory) -************************************************************/ -void PdfFit::fit_theory(bool ldiff, bool lout) -{ - int is, ip, ia, i; - - -// ------ First we compute all constrained equations and the PDF - - fit.fill_variables(); - - // reposition atoms in the elementary unit cells - // Check if this is the correct wayto do things - for (ip=0; ipnatoms; ia++) - { - for(i=0; i<3; i++) - { - phase[ip]->atom[ia].pos[i] = fmod(phase[ip]->atom[ia].pos[i], phase[ip]->icc[i]); - } - } - } - - for (ip=0; iplattice(); - - // determine pdf for each dataset - fit.ntot = 0; - fit.wnorm = 0.0; - - for (is=0; isdatasets[is]; - - ds.determine(ldiff, lout, fit); - - // compute variables for reduced chi-squared and Rw - fit.ntot += ds.nfmax - ds.nfmin + 1; - fit.wnorm += ds.weighedSquareObs(); - } -} - - -double PdfFit::totalWeighedSquareObs() const -{ - return fit.wnorm; -} - - -int PdfFit::totalReducedObservations() const -{ - return fit.ntot - fit.ndof; -} - - -/*********************************************************************** - This routine sets up the matrix A with the derivatives d(PDF)/dx -************************************************************************/ - -void DataSet::fit_setup_derivatives(Fit &fit) -{ - int i, j, ia, ipar, offset; - unsigned int ip; - double fac, facs, facp, ddrho; - double r, bk; - fac = facs = facp = ddrho = r = bk = 0; - - DataSet& ds = *this; - - //------ Loop over all data points - - for (i = ds.ncmin; i <= ds.ncmax; i++) - { - // --- Some common variables - - r = i*ds.deltar + ds.rmin; - - // background envelope due to Q resolution - bk = (ds.qdamp > 0.0) ? exp(-sqr(r*ds.qdamp)/2.0) : 1.0; - - - //------ ---------------------------------------------------------------- - //------ Derivatives per atom : x,y,z,u,o - //------ ---------------------------------------------------------------- - - for (ip=0; ip 0.0 && r > phase.stepcut) - { - shape_env = 0.0; - } - - facp = phase.pscale * shape_env * ds.dscale * bk; - facs = 1.0 / (phase.np*r); - fac = facs*facp; - - for (ia=0; ia, so every contribution to - // the pdf contributes to the derivatives - ds.fit_a[i][ipar] += phase.pscale * ds.dscale * - (1.0 - 2.0 * atom.weight) / phase.np * - (calc[i][ip] + - 4.0*M_PI * r * phase.rho0 * phase.dnorm * bk * shape_env); - } - } - - //------ ---------------------------------------------------------------- - //------ Derivatives per phase : lat, delta2, pscale, spdiameter, sratio - //------ ---------------------------------------------------------------- - - // ----- ----- d/d(lat[j] for j=1,2,3) - - offset = phase.offset; - - for (j=0;j<3;j++) - { - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + - 4.0*M_PI*r*phase.dnorm*phase.rho0/phase.a0[j]); - } - - // ----- ----- d/d(lat[4]) - - if ( (ipar=fit.refvar[offset++]) != -1) - { - ddrho = sqr(phase.a0[0]*phase.a0[1]*phase.a0[2]/phase.v)* - rad*phase.sina*(phase.cosa - phase.cosb*phase.cosg); - ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + - 4.0*M_PI*r*phase.dnorm*phase.rho0*ddrho); - } - - // ----- ----- d/d(lat[5]) - - if ( (ipar=fit.refvar[offset++]) != -1) - { - ddrho = sqr(phase.a0[0]*phase.a0[1]*phase.a0[2]/phase.v)* - rad*phase.sinb*(phase.cosb - phase.cosa*phase.cosg); - ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + - 4.0*M_PI*r*phase.dnorm*phase.rho0*ddrho); - } - - // ----- ----- d/d(lat[6]) - - if ( (ipar=fit.refvar[offset++]) != -1) - { - ddrho = sqr(phase.a0[0]*phase.a0[1]*phase.a0[2]/phase.v)* - rad*phase.sing*(phase.cosg - phase.cosa*phase.cosb); - ds.fit_a[i][ipar] = facp*(facs*ds.fit_a[i][ipar] + - 4.0*M_PI*r*phase.dnorm*phase.rho0*ddrho); - } - - // ----- ----- d/d(delta2[ip]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] *= fac; - - - // ----- ----- d/d(delta1[ip]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] *= fac; - - //----- ----- d/d(pscale[ip]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] = ds.calc[i][ip] * ds.dscale; - - // ----- --- d/d(spdiameter) - if ( (ipar=fit.refvar[offset++]) != -1) - { - ds.fit_a[i][ipar] = (phase.spdiameter <= 0.0) ? 0.0 : - ds.calc[i][ip] * ds.dscale * phase.pscale * - dsphereEnvelope(r, phase.spdiameter) / - ((shape_env > 0.0) ? shape_env : 1.0); - } - - // ----- ----- d/d(sratio[ip]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] *= fac; - } - - //------ ---------------------------------------------------------------- - //------ Derivatives per dataset : dscale, qdamp, qbroad - //------ ---------------------------------------------------------------- - - offset = ds.offset; - - // ----- --- d/d(dscale[is]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] = ds.pdftot[i] / ds.dscale; - - // ----- --- d/d(qdamp[is]) - - if ( (ipar=fit.refvar[offset++]) != -1) - { - if (ds.qdamp > 0.0) - ds.fit_a[i][ipar] = -r*r * ds.qdamp * ds.pdftot[i]; - else - ds.fit_a[i][ipar] = 0; - } - - // ----- --- d/d(qbroad[ip]) - - if ( (ipar=fit.refvar[offset++]) != -1) - ds.fit_a[i][ipar] *= fac; - - } - -//------ Finally we need to apply Qmax cutoff on the derivatives - - if (ds.qmax > 0.0) - { - int nclen = ds.ncmax + 1 - ds.ncmin; - // matrix column is not a continuous data block, a copy is required - valarray col_ip_array(nclen); - double* col_ip = &(col_ip_array[0]); - for(ip=0; ip::iterator apos; - apos = find(var.begin(), var.end(), &a); - if (apos == var.end()) return -1; - // variable is found here, now check if it is refinable - int idx = apos - var.begin(); - return vref[idx] ? idx : -1; -} - - -void Fit::constrain(double &a, string inpform, fcon f, int ipar, FCON type) -{ - int ivar; - if ( (ivar=vfind(a)) != -1) - { - form[ivar] = inpform; - fconstraint[ivar] = f; - idef[ivar] = ipar; - ctype[ivar] = type; - vref[ivar] = true; - *pout << "Warning: replacing existing constraint\n\n"; - } - else - { - var.push_back(&a); - form.push_back(inpform); - fconstraint.push_back(f); - idef.push_back(ipar); - ctype.push_back(type); - vref.push_back(true); - } -} - - -void Fit::constrain(double &a, string inpform) -{ - constrain(a, inpform, NULL, -1, USER); -} - -void Fit::constrain(double &a, fcon f ) -{ - constrain(a, string(), f, -1, USER); -} - -// if a # is passed instead of a function, then the default function will be used -// which is just var = p[ipar] -void Fit::constrain(double &a, int ipar) -{ - constrain(a, ipar, IDENT); -} - -// if a # and the FCOMP-type are passed instead of a function, then the -// complement function will be used: -// which is just var = 1-p[ipar] -void Fit::constrain(double &a, int ipar, FCON type) -{ - if ( (type == IDENT) || (type == FCOMP) || (type == FSQR) ) - constrain(a, string(), NULL, ipar, type); - else - throw constraintError("Unknown constraint"); -} - -void Fit::fill_variables() -{ - dvdp.resize(var.size(),p.size()); - - for (unsigned int i=0; i dnumdp; - - *var[i] = parse(form[i],dnumdp); - - // store numerical derivatives - for(unsigned int iu=0; iuip[ip]; - - // calculate derivative wrt to p[ip] if parameter is free - if (this->ip[ip]) - { - dvdp[i][ip] = dnumdp[iu]; - } - } - } - else if (f) - { - //try - //{ - vector dvdp_i(dvdp.rowVector(i)); - *var[i] = f(p, dvdp_i); - copy(dvdp_i.begin(), dvdp_i.end(), dvdp[i]); - for(int ipar=0; iparip[ipar]); - } - } - else - { - int ipar = parfind(idef[i]); - - if (ipar == -1) - { - ostringstream msg; - msg << "parameter " << idef[i] << " undefined"; - throw constraintError( msg.str() ); - } - - // constraint is fixed if parameter ipar is fixed - vref[i] = this->ip[ipar]; - - if (ctype[i] == IDENT) - { - *var[i] = p[ipar]; - dvdp[i][ipar] = 1.0; - } - else if (ctype[i] == FCOMP) - { - *var[i] = 1.0 - p[ipar]; - dvdp[i][ipar] = -1.0; - } - else if (ctype[i] == FSQR) - { - *var[i] = sqr(p[ipar]); - dvdp[i][ipar] = 2.0*p[ipar]; - } - } - } -} - -int Fit::parfind(unsigned int pidx) -{ - // find the position of pidx in parameter indices vector id - // return -1 if not found - vector::iterator pos; - pos = find(id.begin(), id.end(), pidx); - if (pos == id.end()) - { - return -1; - } - return int(pos - id.begin()); -} - -void Fit::setpar(unsigned int pidx, double val) -{ - int ipar = parfind(pidx); - if (ipar != -1) - { - p[ipar] = val; - } - else - { - p.push_back(val); - ip.push_back(1); // select refinement "ON" when par gets defined - id.push_back(pidx); // store the parameter identifier - } -} - -double Fit::getpar(unsigned int pidx) -{ - int ipar = parfind(pidx); - if (ipar < 0) - { - ostringstream msg; - msg << "Parameter " << pidx << " does not exist"; - throw unassignedError( msg.str() ); - } - return p[ipar]; -} - -void Fit::fixpar(int pidx) -{ - if (pidx == ALL) - { - fill(ip.begin(), ip.end(), false); - return; - } - int ipar = parfind(pidx); - if (ipar == -1) - { - ostringstream emsg; - emsg << "Parameter " << pidx << " not defined."; - throw unassignedError(emsg.str()); - } - ip[ipar] = false; -} - -void Fit::freepar(int pidx) -{ - if (pidx == ALL) - { - fill(ip.begin(), ip.end(), true); - return; - } - int ipar = parfind(pidx); - if (ipar == -1) - { - ostringstream emsg; - emsg << "Parameter " << pidx << " not defined."; - throw unassignedError(emsg.str()); - } - ip[ipar] = true; -} - -/************************************************************************** - This routine calculates errors dx from dp ... - - The covariance of the constrained variables is given by the left and right - matrix multiplication of the dvdp matrix with the covariance matrix - (based on a Taylor expansion of each constraint around the mean parameter values). - The old Fortran program had a sqrt(sum of squares) as error. This - does not take into account parameter correlations, and implicitly considers - the parameters uncorrelated, which is an under-estimation of the parameters. -****************************************************************************/ -void PdfFit::fit_errors() -{ - int ip; - matrix dvdpt = fit.dvdp.transposed(); - - // compute the errors on the parameters as sqrt of diagonal elements of - // covariance matrix - fit.dp = fit.covar.sd(); - - // compute errors on refined variables: left and right matrix multiplication - // of covariance matrix with dvdp - fit.vcovar = fit.dvdp * fit.covar * dvdpt; - - fit.dvar = fit.vcovar.sd(); - - //for(int i=0;ilattice(); -} - -/*********************************************************************** - This routine converts the errors on the constraints to - errors on the actual pdf-paramters -************************************************************************/ - -void Fit::fill_errors() -{ - // transfers the errors on the constrained variables to the corresponding - // pdf error-variables - - int icon; - - // loop over all refinable variables and transfer the sd on any constrained - // variable into the sd on the refinable variable - for (unsigned int i=0; i= big) - { - big=fabs(a[j][k]); - irow=j; - icol=k; - } - } - } - } - } - ++(ipiv[icol]); - /*We now have the pivot element, so we interchange rows, if needed, to put the pivot - element on the diagonal. The columns are not physically interchanged, only relabeled: - indxc[i], the column of the ith pivot element, is the ith column that is reduced, while - indxr[i] is the row in which that pivot element was originally located. If indxr[i] - != indxc[i] there is an implied column interchange. With this form of bookkeeping, the - solution b's will end up in the correct order, and the inverse matrix will be scrambled - by columns.*/ - if (irow != icol) { - for (l=1;l<=n;l++) swap(a[irow][l],a[icol][l]); - for (l=1;l<=m;l++) swap(b[irow][l],b[icol][l]); - } - indxr[i]=irow; // We are now ready to divide the pivot row by the - // pivot element, located at irow and icol. - indxc[i]=icol; - - // Indices of a start at 1, make sure we don't reference invalid - // index of a. When icol is 0, all checked elements of the matrix - // a were zero and it is probably singular as well. - if (icol == 0 || a[icol][icol] == 0.0) - { - throw calculationError("Singular matrix during minimization"); - } - pivinv=1.0/a[icol][icol]; - a[icol][icol]=1.0; - for (l=1;l<=n;l++) a[icol][l] *= pivinv; - for (l=1;l<=m;l++) b[icol][l] *= pivinv; - for (ll=1;ll<=n;ll++) // Next, we reduce the rows... - if (ll != icol) { // ...except for the pivot one, of course. - dum=a[ll][icol]; - a[ll][icol]=0.0; - for (l=1;l<=n;l++) a[ll][l] -= a[icol][l]*dum; - for (l=1;l<=m;l++) b[ll][l] -= b[icol][l]*dum; - } - } - /*This is the end of the main loop over columns of the reduction. It only remains to unscram- - ble the solution in view of the column interchanges. We do this by interchanging pairs of - columns in the reverse order that the permutation was built up.*/ - for (l=n;l>=1;l--) - { - if (indxr[l] == indxc[l]) continue; - for (k=1;k<=n;k++) swap(a[k][indxr[l]],a[k][indxc[l]]); - } // And we are done. - free_ivector(ipiv,1,n); - free_ivector(indxr,1,n); - free_ivector(indxc,1,n); -} - -// End of file diff --git a/libpdffit2/matrix.h b/libpdffit2/matrix.h deleted file mode 100644 index bc80b8ca..00000000 --- a/libpdffit2/matrix.h +++ /dev/null @@ -1,239 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* template class matrix -* -* Comments: optimized from original vector of vectors -* -***********************************************************************/ - -#ifndef MATRIX_H_INCLUDED -#define MATRIX_H_INCLUDED - -#include -#include -#include - -#include "OutputStreams.h" -using NS_PDFFIT2::pout; - -template class matrix -{ - private: - - // Data Methods - T* mdata; - size_t mrows; - size_t mcols; - size_t msize; - - public: - - // Constructors - matrix() : - mdata(NULL), mrows(0), mcols(0), msize(0) - { } - matrix(const matrix& src) : - mdata(new T[src.mrows*src.mcols]), - mrows(src.mrows), mcols(src.mcols), msize(src.msize) - { - std::copy(src.mdata, src.mdata + src.msize, mdata); - } - matrix(size_t m, size_t n) : - mrows(m), mcols(n), msize(mrows*mcols) - { - mdata = new T[mrows*mcols]; - std::fill(mdata, mdata + msize, T(0)); - } - // Destructor - ~matrix() - { - delete[] mdata; - } - // Methods - matrix& operator=(const matrix& src) - { - if (this == &src) return *this; - delete[] mdata; - mdata = new T[src.msize]; - std::copy(src.mdata, src.mdata + src.msize, mdata); - mrows = src.mrows; - mcols = src.mcols; - msize = src.msize; - return *this; - } - matrix& operator=(T value) - { - std::fill_n(mdata, msize, value); - return *this; - } - void resize(size_t m, size_t n, T value=T(0)) - { - if (m == mrows && n == mcols) return; - T* resized = new T[m*n]; - std::fill(resized, resized + m*n, value); - for ( size_t i = 0, offset = 0; - i != std::min(m, mrows); ++i, offset += n ) - { - for (size_t j = 0; j != std::min(n, mcols); ++j) - { - resized[offset+j] = (*this)(i, j); - } - } - delete[] mdata; - mdata = resized; - mrows = m; - mcols = n; - msize = m*n; - } - void clear() - { - delete[] mdata; - mdata = NULL; - mrows = mcols = msize = 0; - } - std::vector rowVector(size_t i) - { - return std::vector(mdata + mcols*i, mdata + mcols*(i+1)); - } - std::vector colVector(size_t j) - { - std::vector column(mrows); - typename std::vector::iterator vii; - vii = column.begin(); - T* pt = mdata + j; - for (; vii != column.end(); ++vii, pt += mcols) *vii = *pt; - return column; - } - inline size_t getrows() - { - return mrows; - } - inline size_t getcols() - { - return mcols; - } - inline T* operator[](size_t i) - { - return mdata + mcols*i; - } - inline T& operator()(size_t i, size_t j) - { - return *(mdata + i*mcols + j); - } - matrix transposed() - { - matrix mxt(mcols, mrows); - T* pt = mxt.mdata; - for (size_t j = 0; j != mcols; ++j) - { - for (size_t i = 0; i != mrows; ++i, ++pt) - { - *pt = (*this)(i, j); - } - } - return mxt; - } - // returns standard deviation vector from covariance matrix - std::vector sd() - { - std::vector v(mcols); - if (mcols != mrows) - { - const char* emsg = "Matrix not square in "; - throw emsg; - } - typename std::vector::iterator vii; - vii = v.begin(); - for (T* pii = mdata; pii < mdata + msize; pii += mcols + 1, ++vii) - { - *vii = sqrt(*pii); - } - return v; - } - matrix operator*(matrix& B) - { - matrix& A = *this; - matrix C(A.mrows, B.mcols); - if (A.mcols != B.mrows) - { - const char* emsg = "Inconsistent matrix multiplication"; - throw emsg; - } - for (size_t i = 0; i != A.mrows; ++i) - { - for (size_t j = 0; j != B.mcols; ++j) - { - T& Cij = C(i,j); - Cij = 0; - for (size_t k = 0; k != A.mcols; ++k) - { - Cij += A(i,k)*B(k,j); - } - } - } - return C; - } - template - friend std::ostream& operator<<(std::ostream &out, matrix &mx); - void print() - { - using namespace std; - for (size_t i = 0; i != mrows; ++i) - { - *pout << i << ": "; - for (size_t j = 0; j != mcols; ++j) - { - *pout << (*this)(i,j) << " "; - } - *pout << endl; - } - } -}; - -template -std::ostream &operator<<(std::ostream &out, std::vector &v) -{ - using namespace std; - out << "("; - for (size_t i=0; i != v.size(); ++i) - { - out << v[i]; - if (i != (v.size()-1)) out << ", "; - else out << ")\n"; - } - return out; -} - -template -std::ostream& operator<<(std::ostream &out, matrix &mx) -{ - using namespace std; - out << "( "; - for (size_t i = 0; i != mx.mrows; ++i) - { - out << "("; - for (size_t j = 0; j != mx.mcols; ++j) - { - *pout << mx(i,j); - if (j != (mx.mcols-1)) *pout << ", "; - else *pout << ")"; - } - if (i != (mx.mrows-1)) *pout << ", "; - else *pout << " )\n"; - } - return out; -} - -#endif // MATRIX_H_INCLUDED diff --git a/libpdffit2/metric.cc b/libpdffit2/metric.cc deleted file mode 100644 index 5f696495..00000000 --- a/libpdffit2/metric.cc +++ /dev/null @@ -1,341 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Definitions of several Phase methods -* -* Comments: -* -***********************************************************************/ - -#include - -#include "MathUtils.h" -#include "StringUtils.h" -#include "pdffit.h" -using NS_PDFFIT2::pout; - -/********************************************************************* - Calculates lattice constants, metric and reciprocal metric - tensor, permutation tensors and unit cell volume. - It's done quite some old fashioned way, rather than calculating - the direct metric tensor and its inverse. - - This extended version calculates standard deviations as well - **********************************************************************/ -void Phase::lattice() -{ - double abscosa, abscosb, abscosg, arg, darg; - double dcosa, dcosb, dcosg, voll, dvoll; - double cos1, cos2, cosi, sin1, sin2, sini; - double dcos1, dcos2, dcosi, dsin1, dsin2, dsini; - int i, i1, i2, j, k, ncc; - - cosa = cosd(win[0]); - cosb = cosd(win[1]); - cosg = cosd(win[2]); - - sina = sind(win[0]); - sinb = sind(win[1]); - sing = sind(win[2]); - - abscosa = fabs(cosa); - abscosb = fabs(cosb); - abscosg = fabs(cosg); - - dcosa = fabs(sina*rad*dwin[0]); - dcosb = fabs(sinb*rad*dwin[1]); - dcosg = fabs(sing*rad*dwin[2]); - - voll = 1.0 - sqr(cosa) - sqr(cosb) - sqr(cosg) + 2.0*cosa*cosb*cosg; - - if (voll <= double_eps) - { - throw structureError("Unit cell volume is not positive."); - } - v = sqrt(voll)*a0[0]*a0[1]*a0[2]; - - dvoll = 2.0*(abscosa*dcosa + abscosb*dcosb + abscosg*dcosg + - dcosa*abscosb*abscosg + abscosa*dcosb*abscosg + abscosa*abscosb*dcosg); - dv = 0.5/sqrt(voll)*dvoll*a0[0]*a0[1]*a0[2] - + sqrt(voll)*(da0[0]*a0[1]*a0[2] + a0[0]*da0[1]*a0[2] + a0[0]*a0[1]*da0[2]); - - vr = 1.0/v; - dvr = 1.0/(v*v)*dv; - - //------ - calculate direct metric tensor - - tensor(gten,a0,win); - dtensor(a0,win,dgten,da0,dwin); - - //------ - calculate reciprocal lattice constants - - // WHY ARE THERE NO ABSOLUTE VALUES IN THE FOLLOWING FORMULAE FOR THE STANDARD - // DEVIATIONS?? - for (i=0; i<3; i++) // i = 0,1,2 - { - i1 = (i+1) % 3; // i1 = 1,2,0 - i2 = (i+2) % 3; // i2 = 2,0,1 - - cos1 = cosd(win[i1]); - cos2 = cosd(win[i2]); - cosi = cosd(win[i]); - sin1 = sind(win[i1]); - sin2 = sind(win[i2]); - sini = sind(win[i]); - - ar[i] = a0[i1]*a0[i2]*sini/v; - arg = (cos1*cos2-cosi)/(sin1*sin2); - wrez[i] = acosd(arg); - - dcos1 = sin1*rad*dwin[i1]; - dcos2 = sin2*rad*dwin[i2]; - dcosi = sini*rad*dwin[i]; - dsin1 = cos1*rad*dwin[i1]; - dsin2 = cos2*rad*dwin[i2]; - dsini = cosi*rad*dwin[i]; - - dar[i] = ( (da0[i1]*a0[i2] + a0[i1]*da0[i2])*sini + - a0[i1]*a0[i2]*dsini) /v + a0[i1]*a0[i2]*sini/(v*v)*dv; - darg = (dcos1*cos2 + cos1*dcos2 + dcosi)/(sin1*sin2) - + arg/sin1*dsin1 + arg/sin2*dsin2; - dwrez[i] = 1./sqrt(1-arg*arg)*darg/rad; - } - - //------ - calculate reciprocal tensor - - tensor(rten,ar,wrez); - dtensor(ar,wrez,drten,dar,dwrez); - - //------ - calculate permutation tensors - - for (i=0; i<3; i++) - { - for (j=0; j<3; j++) - { - for (k=0; k<3; k++) - { - eps(i,j,k) = 0.0; - reps(i,j,k) = 0.0; - deps(i,j,k) = 0.0; - dreps(i,j,k) = 0.0; - } - } - } - - eps(0,1,2) = v; - eps(1,2,0) = v; - eps(2,0,1) = v; - eps(0,2,1) = -v; - eps(2,1,0) = -v; - eps(1,0,2) = -v; - reps(0,1,2) = vr; - reps(1,2,0) = vr; - reps(2,0,1) = vr; - reps(0,2,1) = -vr; - reps(2,1,0) = -vr; - reps(1,0,2) = -vr; - - deps(0,1,2) = dv; - deps(1,2,0) = dv; - deps(2,0,1) = dv; - deps(0,2,1) = -dv; - deps(2,1,0) = -dv; - deps(1,0,2) = -dv; - dreps(0,1,2) = dvr; - dreps(1,2,0) = dvr; - dreps(2,0,1) = dvr; - dreps(0,2,1) = -dvr; - dreps(2,1,0) = -dvr; - dreps(1,0,2) = -dvr; - - //------ - Calculate number density - - np = 0.0; - dnp = 0.0; - - for (i=0; i -#include - -const int getNR_END() -{ - return 1; -} - -static void nrerror(char error_text[]) - /* Numerical Recipes standard error handler */ -{ - fprintf(stderr,"Numerical Recipes run-time error...\n"); - fprintf(stderr,"%s\n",error_text); - fprintf(stderr,"...now exiting to system...\n"); - exit(1); -} - -template T *_vector(long nl, long nh) - /* allocate a vector with subscript range v[nl..nh] */ -{ - T *v = NULL; - if (nl > nh) return v; - v=(T *)malloc((size_t) ((nh-nl+1+getNR_END())*sizeof(T))); - if (!v) nrerror("allocation failure in _vector()"); - return v-nl+getNR_END(); -} - -double *dvector(long nl, long nh) - /* allocate a double vector with subscript range v[nl..nh] */ -{ - return _vector(nl, nh); -} - -int *ivector(long nl, long nh) - /* allocate an int vector with subscript range v[nl..nh] */ -{ - return _vector(nl, nh); -} - -template void _free_vector(T *v, long nl, long nh) - /* free a vector allocated with vector() */ -{ - if (nl > nh) return; - free((T*) (v+nl-getNR_END())); -} - -void free_dvector(double *v, long nl, long nh) - /* free a double vector allocated with vector() */ -{ - _free_vector(v, nl, nh); -} - - -void free_ivector(int *v, long nl, long nh) - /* free an int vector allocated with ivector() */ -{ - _free_vector(v, nl, nh); -} - -template T **_matrix(long nrl, long nrh, long ncl, long nch) - /* allocate a matrix with subscript range m[nrl..nrh][ncl..nch] */ -{ - long i, nrow=nrh-nrl+1,ncol=nch-ncl+1; - T **m = NULL; - if (nrl > nrh || ncl > nch) return m; - - /* allocate pointers to rows */ - m=(T **) malloc((size_t)((nrow+getNR_END())*sizeof(T*))); - if (!m) nrerror("allocation failure 1 in matrix()"); - m += getNR_END(); - m -= nrl; - /* allocate rows and set pointers to them */ - m[nrl]=(T *) malloc((size_t)((nrow*ncol+getNR_END())*sizeof(T))); - if (!m[nrl]) nrerror("allocation failure 2 in matrix()"); - m[nrl] += getNR_END(); - m[nrl] -= ncl; - for(i=nrl+1;i<=nrh;i++) m[i]=m[i-1]+ncol; - /* return pointer to array of pointers to rows */ - return m; -} - -double **dmatrix(long nrl, long nrh, long ncl, long nch) - /* allocate a double matrix with subscript range m[nrl..nrh][ncl..nch] */ -{ - return _matrix(nrl, nrh, ncl, nch); -} - -template void _free_matrix(T **m, long nrl, long nrh, long ncl, long nch) - /* free a double matrix allocated by matrix() */ -{ - if (nrl > nrh || ncl > nch) return; - free((T*) (m[nrl]+ncl-getNR_END())); - free((T**) (m+nrl-getNR_END())); -} - -void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch) - /* free a double matrix allocated by matrix() */ -{ - _free_matrix(m, nrl, nrh, ncl, nch); -} - -// End of file diff --git a/libpdffit2/nrutil.h b/libpdffit2/nrutil.h deleted file mode 100644 index ee1bd4cb..00000000 --- a/libpdffit2/nrutil.h +++ /dev/null @@ -1,34 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Utilities from numerical recipies. -* -* Comments: -* -***********************************************************************/ - -#ifndef NRUTIL_H_INCLUDED -#define NRUTIL_H_INCLUDED - -#include - -void nrerror(char error_text[]); -int *ivector(long nl, long nh); -double *dvector(long nl, long nh); -double **dmatrix(long nrl, long nrh, long ncl, long nch); -void free_ivector(int *v, long nl, long nh); -void free_dvector(double *v, long nl, long nh); -void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch); - -#endif // NRUTIL_H_INCLUDED diff --git a/libpdffit2/output.cc b/libpdffit2/output.cc deleted file mode 100644 index 36928794..00000000 --- a/libpdffit2/output.cc +++ /dev/null @@ -1,350 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Output methods for Phase, DataSet and Fit classes -* -* Comments: -* -***********************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#include "pdffit.h" -#include "StringUtils.h" - -/************************************************************ - * Outputs phase information for phase 'ipha' on file 'id' - * Thu Oct 13 2005 - CLF Modified code to handle - * general types of streams. - *************************************************************/ -void Phase::output(ostream &fout) -{ - FormatValueWithStd value_std; - value_std.left(); - - fout << " " << string(78,'-') << '\n' - << " PHASE " << iphase << " : " << name << '\n' - << " " << string(78,'-') << endl; - - fout << " Scale factor : " << - value_std(pscale, dpscale) << endl; - - fout << " Particle diameter : "; - if (spdiameter <= 0.0) fout << "not applied\n"; - else fout << value_std(spdiameter, dspdiameter) << " A\n"; - - fout << " Step cutoff : "; - if (stepcut <= 0.0) fout << "not applied\n"; - else fout << value_std(stepcut, 0.0) << " A\n"; - - if (corr_max > 0.0) - { - fout << " Correlation limit [A] : " << corr_max << endl; - } - - fout << " Quad. corr. factor : " - << value_std(delta2, ddelta2) << endl; - - fout << " Lin. corr. factor : " - << value_std(delta1, ddelta1) << endl; - - fout << " Low r sigma ratio : " << value_std(sratio, dsratio) << '\n' - << " R cutoff [A] : " << value_std(rcut, 0.0) << endl; - - value_std.leading_blank(true).left(); - fout << " Lattice parameters :" - << value_std.width(20)(a0[0], da0[0]) - << value_std.width(20)(a0[1], da0[1]) - << value_std.width(0)(a0[2], da0[2]) << '\n'; - - fout << " & angles :" - << value_std.width(20)(win[0], dwin[0]) - << value_std.width(20)(win[1], dwin[1]) - << value_std.width(0)(win[2], dwin[2]) << '\n'; - - fout << endl; - - fout << " Atom positions & occupancies :" << endl; - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - fout << " " - << setw(4) << left << toupper(ai->atom_type->symbol) << setw(0); - value_std.width(20); - for (int i = 0; i < 3; i++) - { - fout << value_std(ai->pos[i], ai->dpos[i]); - } - fout << value_std.width(0)(ai->occ,ai->docc) << endl; - } - fout << endl; - - fout << " Anisotropic temperature factors :" << endl; - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - fout << " " << setw(4) << toupper(ai->atom_type->symbol); - for (int i = 0; i < 3; i++) - { - fout << value_std.width(i == 2 ? 0 : 20)(ai->u[i], ai->du[i]); - } - fout << endl; - if ( ai->u[3] || ai->u[4] || ai->u[5]) - { - fout << " "; - for (int i = 3; i < 6; i++) - { - fout << value_std.width(i == 5 ? 0 : 20)(ai->u[i], ai->du[i]); - } - fout << endl; - } - } -} - -string DataSet::selectedAtomsString(int ip, char ijchar) -{ - if (!psel[ip]) return string(""); - if (ijchar != 'i' && ijchar != 'j') - { - ostringstream emsg; - emsg << "Invalid value of ijchar '" << ijchar << "'"; - throw ValueError(emsg.str()); - } - // build string of selected indices per each atom type - // also check if any type is selected and ignored at the same time - map selidxstr; - set ignored_types; - Phase* ph = psel[ip]; - set& ignored = ijchar == 'i' ? phase_ignore_i[ph] : phase_ignore_j[ph]; - for (int aidx = 0; aidx < ph->natoms; ++aidx) - { - const AtomType* atp = ph->atom[aidx].atom_type; - if (ignored.count(aidx)) ignored_types.insert(atp); - else - { - ostringstream sidx; - sidx << ' ' << aidx + 1; - selidxstr[atp] += sidx.str(); - } - } - ostringstream ssel; - for ( vector::iterator atp = ph->atom_types.begin(); - atp != ph->atom_types.end(); ++atp ) - { - if (!selidxstr.count(*atp)) continue; - ssel << " " << toupper((*atp)->symbol); - if (ignored_types.count(*atp)) ssel << selidxstr[*atp]; - } - return ssel.str(); -} - -/*********************************************************** - Outputs information about this data set - Thu Oct 13 2005 - CLF - Modified code to handle general types of - streams. -************************************************************/ -void DataSet::output(ostream& fout) -{ - FormatValueWithStd value_std; - - fout << " " << string(78,'-') << '\n' - << " DATA SET : " << iset << " (" << name << ")" << '\n' - << " " << string(78,'-') << endl; - - fout << " Data range in r [A] : " << setw(8) << left << rmin << " -> " - << setw(8) << rmax << " Step dr : " << setw(0) << deltar << endl; - - fout << " Calculated range : " << setw(8) << rcmin << " -> " - << setw(0) << rcmax << endl; - - fout << " Refinement r range : " << setw(8) << rfmin << " -> " - << setw(8) << rfmax - << " Data pts : " << setw(5) << nfmin << " -> " - << setw(0) << nfmax << endl; - - fout << - " Reduced chi squared : " << this->getdsredchisq() << '\n' << - " Rw - value : " << this->getdsrw() << '\n' << endl; - - fout << endl << " Experimental settings :" << endl; - - if (scattering_type == 'X') - fout << " Radiation : X-Rays\n"; - else - fout << " Radiation : Neutrons\n"; - - if (qmax <= 0.0) - fout << " Termination at Qmax : not applied\n"; - else - fout << " Termination at Qmax : " << qmax << " A**-1\n"; - - if (qdamp <= 0.0) - fout << " DQ dampening Qdamp : not applied\n"; - else - fout << " DQ dampening Qdamp : " << value_std(qdamp, dqdamp) << " A**-1\n"; - - if (qbroad <= 0.0) - fout << " DQ broadening Qbroad : not applied\n"; - else - fout << " DQ broadening Qbroad : " << value_std(qbroad, dqbroad) << " A**-1\n"; - - fout << " Scale factor : " << value_std(dscale, ddscale) << endl; - - fout << endl; - - fout << " Selected phases and atoms for this data set :\n"; - - for(size_t ip = 0; ip != psel.size(); ip++) - { - if (!psel[ip]) continue; - fout << " Phase " << ip+1 << " :\n"; - - fout << " Atoms (i) :"; - fout << selectedAtomsString(ip, 'i') << '\n'; - fout << " Atoms (j) :"; - fout << selectedAtomsString(ip, 'j') << '\n'; - } - fout << '\n'; - - fout << " Relative phase content in terms of\n"; - fout << " atoms unit cells mass\n"; - vector< pair > atomfractions; - vector< pair > cellfractions; - vector< pair > massfractions; - atomfractions = getAtomPhaseFractions(); - cellfractions = getCellPhaseFractions(); - massfractions = getMassPhaseFractions(); - for(size_t ip = 0; ip != psel.size(); ip++) - { - fout << " Phase " << ip + 1 << " :"; - value_std.left().width(24).leading_blank(true); - fout << value_std(atomfractions[ip].first, atomfractions[ip].second); - fout << value_std(cellfractions[ip].first, cellfractions[ip].second); - value_std.width(0); - fout << value_std(massfractions[ip].first, massfractions[ip].second); - fout << '\n'; - } - fout << endl; -} - -/************************************************* - Outputs parameter information - Thu Oct 13 2005 - CLF - Modified code to handle general types of - streams. -**************************************************/ -void Fit::output(ostream &fout) -{ - fout << " " << string(78,'-') << '\n' - << " PARAMETER INFORMATION :" << '\n' - << " " << string(78,'-') << endl; - - int npar = 0; - - for (int i=0; i order = this->order_by_id(); - vector::iterator i; - for (i = order.begin(); i != order.end(); ++i) - { - int nword = i - order.begin(); - bool lastword = (nword + 1) % 3 == 0 || nword + 1 == psize(); - double dpi = ip[*i] ? dp[*i] : 0.0; - fout << right << ' ' << setw(3) << id[*i] << setw(0) << ":" - << value_std.width(lastword ? 0 : 20)(p[*i], dpi); - fout << (lastword ? "\n" : " "); - } - - fout << " " << string(78,'-') << '\n' - << " REFINEMENT INFORMATION:\n" - << " " << string(78,'-') << endl; - - fout << " Number of iterations : " << iter << endl; - - fout << " Reduced chi squared : " << redchisq << '\n' - << " Rw - value : " << fit_rw << '\n' << endl; - - fout << " Correlations greater than 0.8 :\n\n"; - - bool lkor = false; - - for (i = order.begin(); i != order.end(); ++i) - { - if (!ip[*i]) continue; - - vector::iterator j; - for (j = i + 1; j != order.end(); ++j) - { - if (!ip[*j]) continue; - - double corr = covar[*i][*j]/dp[*i]/dp[*j]; - - if (fabs(corr) > 0.8) - { - fout << " Corr(p[" << id[*i] << "], p[" << id[*j] << "]) = " << corr << endl; - lkor = true; - } - } - } - if (!lkor) - fout << " *** none ***\n"; - } -} - - -// Parameter indices in the vector id are not ordered by default. -// Return a proper order indices for id. This method is used -// for parameters printout. -vector Fit::order_by_id() const -{ - assert(this->psize() == int(this->id.size())); - typedef pair IdIndex; - vector id_with_idx; - for (size_t i = 0; i < id.size(); ++i) - { - id_with_idx.push_back(IdIndex(id[i], i)); - } - sort(id_with_idx.begin(), id_with_idx.end()); - // build return value - vector rv; - rv.reserve(id_with_idx.size()); - vector::iterator ii; - for (ii = id_with_idx.begin(); ii != id_with_idx.end(); ++ii) - { - rv.push_back(ii->second); - } - return rv; -} - - -// End of file diff --git a/libpdffit2/parser.cc b/libpdffit2/parser.cc deleted file mode 100644 index 46a5157c..00000000 --- a/libpdffit2/parser.cc +++ /dev/null @@ -1,402 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Formula parser implemented as methods of Fit class -* -* Comments: -* -***********************************************************************/ - -#include -#include -#include -#include -#include - -#include "MathUtils.h" -#include "pdffit.h" - -static vector vstack; -static vector > dstack; // stack with derivative vectors -static bool deriv; - -string stackvar(int i) -{ - ostringstream expr; - expr << '#' << i; - return(expr.str()); -} - -/***************************************************************************************** - Searches for all parameters in the expression and replace them by stack pointers - *****************************************************************************************/ -string Fit::substitute_pars(string &expr) -{ - int ipos=-1, bopen, bclose; - unsigned int i; - string idexpr; - - // search the expression for the next @-sign - while((bopen=expr.find('@',ipos+1)) != (int) string::npos) - { - int id; - - istringstream inexpr(expr); - inexpr.seekg(bopen+1); - - inexpr >> id; - - if (!inexpr) - throw parseError(expr); - - bclose = inexpr.tellg(); - - // expression must be a valid parameter id - int ipar = parfind(id); - - if (ipar == -1) - { - ostringstream msg; - msg << "parameter " << id << " undefined"; - throw constraintError(msg.str()); - } - - // check if same parameter already occurred in this formula - for (i=0; i dnumdp(used.size()); - for (i=0; i()); - } - } - - return expr; // okay -} - -// get next number from expression -// only fill derivatives if that number has derivatives -double Fit::getnum(istringstream &inexpr, vector &dnumdp) -{ - double num; - char c; - int id; - map::iterator iter; - - // Various possibilities when reading the next value inside the - // unbracketted expression - - if (deriv) dnumdp.clear(); - - inexpr >> c; - - if (inexpr.eof()) - throw parseError("Error while reading value"); - - // if first character is a minus sign, call getnum again with expression stripped - // from its minus sign - if ((c=='-') || (c=='+')) - { - num = getnum(inexpr, dnumdp); - if (deriv && !dnumdp.empty() && (c=='-')) - { - for (unsigned int i=0; i check for built-in function - // read-up to next # - else if ((c>='a') && (c<='z')) - { - int start=inexpr.tellg(); - start--; - string::size_type end; - end = inexpr.str().find('#', start); - if (end == string::npos) - { - throw parseError("Error while reading builtin function arguments"); - } - - string sbuiltin = inexpr.str().substr(start,end-start); - if ((iter=builtin.find(sbuiltin)) == builtin.end()) - { - throw parseError("Unknown builtin function"); - } - - // set read pointer behind #-sign - inexpr.seekg(end+1); - - // read argument number - inexpr >> id; - if (!inexpr) - throw parseError(inexpr.str()); - num = iter->second.func(vstack[id]); - - // fill the partial derivatives if function argument had derivatives - if (deriv && !dstack[id].empty()) - { - double fder=iter->second.deriv(vstack[id]); - dnumdp = vector(used.size()); - for(unsigned int i=0; i> id; - if (!inexpr) - throw parseError(inexpr.str()); - num = vstack[id]; - if (deriv && !dstack[id].empty()) dnumdp = dstack[id]; - } - else - { - inexpr.unget(); - inexpr >> num; - - if (!inexpr) - throw parseError("Error while reading value"); - } - return num; -} - -/********************************************** - computes a basic expression without brackets - ***********************************************/ -double Fit::compute(string &expr, vector &dnumdp) -{ - ostringstream ostreamexpr; - string opstring="*/+-"; - double num1, num2, num; - vector dnum1dp, dnum2dp; - char op; // operator - - // transform string to string stream to read numbers more easily - istringstream inexpr(expr); - - // Two parsing passes are performed to ensure correct precedence of - // operators: first for * and /, then for + and - - int pass = 1; - - while(1) - { - int pos, end; - - if (deriv) dnumdp.clear(); - - pos = inexpr.tellg(); - - num1 = getnum(inexpr, dnum1dp); - - inexpr >> op; - - // check if this ends the expression - // if pass==2: expression completely parsed - // if pass==1: go to pass 2 - if (inexpr.eof()) - { - if (pass==2) - { - num = num1; - if (deriv && !dnum1dp.empty()) - dnumdp = dnum1dp; - break; - } - else - { - pass = 2; - inexpr.clear(); - inexpr.str(expr); - continue; - } - } - - if (!inexpr) - throw parseError(expr); - - if (opstring.find(op) == string::npos) - throw parseError(expr); - - // if a + or - operation is encountered in pass 1 -> look for next operation - if ( (pass==1) && ((op == '+') || op == '-') ) - { - continue; - } - - num2 = getnum(inexpr,dnum2dp); - - if (!dnum1dp.empty() || !dnum2dp.empty()) - dnumdp = vector(used.size()); - - switch (op) - { - case '+': - num = num1+num2; - - if (deriv) - { - if (!dnum1dp.empty()) dnumdp = dnum1dp; - if (!dnum2dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] += dnum2dp[i]; - } - break; - - case '-': - num = num1-num2; - - if (deriv) - { - if (!dnum1dp.empty()) dnumdp = dnum1dp; - if (!dnum2dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] -= dnum2dp[i]; - } - break; - - case '*': - num = num1*num2; - - if (deriv) - { - if (!dnum1dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] += dnum1dp[i]*num2; - if (!dnum2dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] += num1*dnum2dp[i]; - } - break; - - case '/': - num = num1/num2; - - if (deriv) - { - if (!dnum1dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] += dnum1dp[i]/num2; - if (!dnum2dp.empty()) - for (unsigned int i=0; i< used.size(); i++) - dnumdp[i] -= num1*dnum2dp[i]/sqr(num2); - } - break; - } - - end = inexpr.tellg(); - - // replace computed substring by stack pointer, and push value on the stack - expr.replace(pos,end-pos,stackvar(vstack.size())); - vstack.push_back(num); - - // store the derivatives as well. Note that the derivative vector may be empty - // if no derivatives was non-zero. - if (deriv) - dstack.push_back(dnumdp); - - inexpr.clear(); - inexpr.str(expr); - inexpr.seekg(pos); - } - - // the expression has been reduced to just one number - return num; -} - -/*************************************************************************************** - Searches the formula for bracketted expressions replace them by their numerical values - ****************************************************************************************/ - -double Fit::parse(string line, vector &dnumdp) -{ - int bopen, bclose; - string expression; - double num; - - if (line.find('#') != string::npos) - throw parseError("Illegal character in formula"); - - // the first elements on the stack will be the used parameter values - vstack.clear(); - used.clear(); - - // Search for parameters, check their existence and put on the stack - line = substitute_pars(line); - - // look for first closing bracket - while( (bclose=line.find(')')) != (int) string::npos) - { - // look for closest opening bracket in front of closing bracket - if ( (bopen=line.rfind('(',bclose-1)) == (int) string::npos) - throw parseError("Unmatched brackets in formula"); - - // isolate expression within the brackets - expression = line.substr(bopen+1,bclose-bopen-1); - - // compute isolated expression - num = compute(expression, dnumdp); - - // put the bracket-value on the stack and replace substring by stack pointer, - // and push new value on the stack - line.replace(bopen,bclose-bopen+1,stackvar(vstack.size())); - vstack.push_back(num); - - if (deriv) - dstack.push_back(dnumdp); - - } - - // After all brackets have been worked out, the final expression is evaluated - num = compute(line, dnumdp); - - return num; // okay -} - -// End of file diff --git a/libpdffit2/pdf.cc b/libpdffit2/pdf.cc deleted file mode 100644 index 0ab857b6..00000000 --- a/libpdffit2/pdf.cc +++ /dev/null @@ -1,1776 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch, Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Mixed methods for PDF calculation from PdfFit, DataSet and Phase -* -* Comments: Up to date with 1.3.10 Fortran version. -* What a spagetti. -* -***********************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "PointsInSphere.h" -#include "StringUtils.h" -#include "LocalPeriodicTable.h" -#include "MathUtils.h" -#include "ShapeFactors.h" - -#include "pdffit.h" - -using NS_PDFFIT2::pout; - -#define NEW_SHARP - -/***************************************************************** - Allocating space for dummy dataset when calculating PDF - without data -******************************************************************/ -void PdfFit::alloc(char tp, double qmax, double qdamp, double rmin, double rmax, int bin) -{ - - DataSet* pds = new DataSet(this); - int i; - if (rmax < rmin || rmin < 0 || rmax < 0) - { - throw ValueError("Check rmin, rmax"); - } - if (bin <= 1) - { - throw ValueError("bin must be > 1"); - } - if( qmax < 0.0 ) - { - throw ValueError("qmax must be >= 0"); - } - if( qdamp < 0 ) - { - throw ValueError("qdamp must be >= 0"); - } - - // 2009-03-11 PJ: Removed check if a structure has been loaded before. - // It can be now loaded after calling alloc. - - pds->iset = nset+1; - - pds->scattering_type = tp; - - pds->qmax = qmax; - pds->qdamp = qdamp; - pds->rmin = pds->rfmin = rmin; - pds->rmax = pds->rfmax = rmax; - pds->bin = bin; - pds->deltar = (rmax-rmin)/double(bin-1); - pds->name = "Dummy set"; - - pds->obs.resize(bin); - pds->wic.resize(bin); - - for (i=0; iobs[i] = 0.0; - pds->wic[i] = 1.0; - } - - *pout << " Allocated PDF data set " << pds->iset << " (r = " - << rmin << " to " << rmax << " A, " << bin << " points) ..." << endl; - - // automatically select existing phases and its atoms for the new dataset - for (int ip=0; ipselphase(ip, this->phase[ip]); - - this->datasets.push_back(pds); - nset++; - setdata(nset); -} - -// cut-away high Q harmonics using fast Fourier transformation -void DataSet::applyQmaxCutoff(double* y, size_t len) -{ - // pad y with the same number of zeros up to the next power of 2 - size_t padlen = 2*len; - // MS compatibility fix - padlen = (size_t) pow(2.0, ceil(log2(padlen))) ; - // ycpad is complex, so it needs to be twice as long - valarray ycpad_array(2*padlen); - double* ycpad = &(ycpad_array[0]); - fill_n(ycpad, 2*padlen, 0.0); - // copy y to real components of ycpad - for (size_t i = 0; i != len; ++i) ycpad[2*i] = y[i]; - // apply fft - int status; - status = gsl_fft_complex_radix2_forward(ycpad, 1, padlen); - if (status != GSL_SUCCESS) - { - throw calculationError("Fourier Transformation failed."); - } - // Q step for ycpad - double dQ = 2*M_PI/((padlen-1)*deltar); - // loQidx, hiQidx correspond to Qmax and -Qmax frequencies - // they need to be integer to catch cases with huge qmax/dQ - int loQidx = int( ceil(qmax/dQ) ); - int hiQidx = padlen + 1 - loQidx; - // zero high Q components in ycpad - for (int i = loQidx; i < hiQidx; ++i) - { - ycpad[2*i] = ycpad[2*i+1] = 0.0; - } - // transform back - status = gsl_fft_complex_radix2_inverse(ycpad, 1, padlen); - if (status != GSL_SUCCESS) - { - throw calculationError("Fourier Transformation failed."); - } - // copy real components - for (size_t i = 0; i != len; ++i) y[i] = ycpad[2*i]; -} - - -/***************************************************** - Calculate PDF for dataset with current structure - - In initial version: one phase -******************************************************/ - -void DataSet::determine(bool ldiff, bool lout, Fit &fit) -{ - //int kk, ibin, ip; - int ib, ie, ig; - double rmax2, rmin2, gaus, rk, rb,re, rtot, ract; - vector ppp; - double dd[3], d[3], dist2, dist, rg, r; - double sigmap, sigma, gnorm, ampl; - long totcalc=0; - - if (lout) *pout << " Calculating PDF ...\n"; - - // total # points to be fitted - nfmin = nint((rfmin-rmin)/deltar); - nfmax = nint((rfmax-rmin)/deltar); - - // extend calculation range before applying Qmax cutoff - extendCalculationRange(lout); - - rmax2 = sqr(rcmax+1.0); - rmin2 = sqr(rcmin-1.0) * ((rcmin-1.0) < 0.0 ? -1.0 : 1.0); - rmin2 = max(0.01,rmin2); - - pdftot.resize(ncmax+1); - fill(pdftot.begin(), pdftot.end(), 0.0); - calc.resize(ncmax+1,psel.size()); - ppp.resize(ncmax+1); - - if (ldiff) - { - fit_a.resize(ncmax+1, fit.varsize()); - fit_a = 0.0; - } - - // ------ Loop over all phases - - for (unsigned ip=0; ip ignore_i(phase.natoms); - valarray ignore_j(phase.natoms); - for (int aidx = 0; aidx < phase.natoms; ++aidx) - { - ignore_i[aidx] = phase_ignore_i[&phase].count(aidx); - ignore_j[aidx] = phase_ignore_j[&phase].count(aidx); - } - - // ------ Get the ratio total pairs/selected weight in structure - - rtot = 0.0; - ract = 0.0; - for (int iidx = 0; iidx < phase.natoms; ++iidx) - { - Atom& ai = phase.atom[iidx]; - for (int jidx = iidx; jidx < phase.natoms; ++jidx) - { - Atom& aj = phase.atom[jidx]; - double halfloopscale = (iidx == jidx) ? 1.0 : 2.0; - rtot += halfloopscale * ai.weight * aj.weight; - // skip ignored pair - bool skip = (ignore_i[iidx] || ignore_j[jidx]) && - (ignore_i[jidx] || ignore_j[iidx]); - if (skip) continue; - ract += halfloopscale * ai.weight * aj.weight; - } - } - phase.dnorm = ract/rtot; - - //-------------------------------------------------------------- - - fill(ppp.begin() + ncmin, ppp.begin() + ncmax + 1, 0.0); - - // calculate range for PointsInSphere sequencer - // (negative rsphmin is no problem) - double buffzone = phase.circum_diameter(); - double rsphmin = sqrt(rmin2) - buffzone; - double rsphmax = sqrt(rmax2) + buffzone; - // limit rsphmax, when stepcut has been set for the phase - if (phase.stepcut > 0.0) - { - rsphmax = min(rsphmax, phase.stepcut + buffzone); - } - PointsInSphere sph( rsphmin, rsphmax, phase.a0[0]*phase.icc[0], - phase.a0[1]*phase.icc[1], phase.a0[2]*phase.icc[2], - phase.win[0], phase.win[1], phase.win[2] ); - - // loop only over selected atom indexes - for (int iidx = 0; iidx < phase.natoms; ++iidx) - { - Atom& ai = phase.atom[iidx]; - for (int jidx = iidx; jidx < phase.natoms; ++jidx) - { - Atom& aj = phase.atom[jidx]; - - // skip ignored pair - bool skip = (ignore_i[iidx] || ignore_j[jidx]) && - (ignore_i[jidx] || ignore_j[iidx]); - if (skip) continue; - - for (sph.rewind(); !sph.finished(); sph.next()) - { - for (int i=0; i<3; i++) - { - dd[i] = ai.pos[i] - aj.pos[i] - - sph.mno[i]*phase.icc[i]; - d[i] = dd[i] * phase.a0[i]; - } - dist2 = phase.skalpro(dd,dd); - - // check if pair distance is within dataset r limits - if ((dist2 < rmin2) || (dist2 > rmax2)) continue; - - // dist is distance r_ij - dist = sqrt(dist2); - - //------ Setting up 'thermal' Gaussian - sigmap = sqrt(phase.msdAtoms(ai, aj, dd)); - // neglect unphysical summed square displacements - if (sigmap <= 0.0) continue; - - //- PDF peak width modifications - new 07/2003 - -#if defined(NEW_SHARP) - // Computation of peak sharpening sigma - // sigma = sigmap* sqrt(1 - delta2/r_ij^2 - delta1/r_ij + qbroad*r_ij^2) - double corfact; - corfact = 1 - phase.delta2/dist2 - - phase.delta1/dist + sqr(qbroad)*dist2; - - // if sigma negative: set it back to 1e-5 just for this point - // note: derivative will be incorrect in this case - if (corfact <= 0) - { - continue; // neglect contribution - } - else - { - sigma = sigmap * sqrt(corfact); - } -#else - // Computation of peak sharpening sigma - // sigma = sqrt(sqr(sigmap) - delta2/r_ij^2 - delta1/r_ij + qbroad*r_ij^2) - double sigma2; - sigma2 = sqr(sigmap) - phase.delta2/dist2 - - phase.delta1/dist + sqr(qbroad)*dist2; - - // if sigma2 negative: set it back to 1e-5 just for this point - // note: derivative will be incorrect in this case - if (sigma2 <= 1e-10) - { - sigma = 1e-5; // neglect contribution - } - else - { - sigma = sqrt(sigma2); - } -#endif - // apply rcut if requested - if (dist < phase.rcut) - { - sigma *= phase.sratio; - } - - // The gaus curve is computed up to distance of 5 sigma - gnorm = 1.0/(sqrt(2.0*M_PI)*sigma); - ampl = ai.occ * ai.weight * aj.occ * aj.weight; - - if (iidx != jidx) ampl += ampl; - - rb = max(rcmin, dist - 5.0*sigma); - re = min(rcmax, dist + 5.0*sigma); - if (phase.stepcut > 0.0) - { - re = min(re, phase.stepcut); - } - - ib = nint((rb-rmin)/deltar); - ie = nint((re-rmin)/deltar); - - for(ig=ib; ig<=ie; ig++) - { - totcalc++; - rk = rmin + ig*deltar; - rg = rk-dist; - gaus = gnorm * exp(-0.5*sqr(rg/sigma)); - ppp[ig] += ampl*gaus; - - // if derivative are needed - if (ldiff) - { - pdf_derivative(phase, ai, aj, rk, - sigma, sigmap, dist, d, ampl, gaus, - fit, fit_a[ig]); - } - } - } - } - } - - //------ - Convert to proper G(r) and add to total PDF - - for (int i = ncmin; i<=ncmax; i++) - { - r = i*deltar + rmin; - - calc[i][ip] = ppp[i]/phase.np/r - 4.0*M_PI*r*phase.rho0*phase.dnorm; - - // Q-resolution envelope - if (qdamp > 0.0) - { - calc[i][ip] *= exp(-sqr(r*qdamp)/2.0); - } - - // PDF envelope for spherical nano particles - if (phase.spdiameter > 0.0) - { - calc[i][ip] *= sphereEnvelope(r, phase.spdiameter); - } - - // Empirical shape step cutoff of the PDF - if (phase.stepcut > 0.0) - { - double stepfactor = (r <= phase.stepcut) ? 1.0 : 0.0; - calc[i][ip] *= stepfactor; - } - - //if ( (r <= phase.corr_max) || (phase.corr_max <= 0.0) ) - pdftot[i] += this->dscale * phase.pscale * calc[i][ip]; - } - } - - // finalize computation of derivatives if required - // this HAS to happen before the multiplication by deltar/pi and before - // the convolution to avoid "double operations" on the derivatives, - // as this will be taken care of in the derivatives. - if (ldiff) - { - fit_setup_derivatives(fit); // computes matrix dpdf/dvar - } - - //for (i=ncmin;i<=ncmax;i++) - // *pout << i << " " << pdftot[i] << endl; - - // From here on we can restrict ourselves to the range [nfmin,nfmax] - // for the outerloop - - // Apply Qmax cutoff - if (qmax > 0.0) - { - applyQmaxCutoff(&pdftot[ncmin], ncmax-ncmin+1); - } -} - -/***************************************************************** - This routine calculates the sums over 'ij' needed for the - derivatives - this is faster than doing the complete loop - in 'pdf_determine' again .. - gaus: gaus[igaus+kk] from -******************************************************************/ -void DataSet::pdf_derivative (Phase &phase, - const Atom& atomi, const Atom& atomj, double rk, double sigma, - double sigmap, double dist, double d[3], double ampl,double gaus, - Fit &fit, double* fit_a_i) -{ - double rd,dg; - rd = dg = 0.0; - double s11,s22,s33,s12,s13,s23; - double drdx, drda, phi, dsdphi, dspdx, dspda; - int ipar, i, ioffset, joffset; - - //------ Some common calculations - - s11 = atomi.u[0] + atomj.u[0]; - s22 = atomi.u[1] + atomj.u[1]; - s33 = atomi.u[2] + atomj.u[2]; - s12 = atomi.u[3] + atomj.u[3]; - s13 = atomi.u[4] + atomj.u[4]; - s23 = atomi.u[5] + atomj.u[5]; - - rd = (rk-dist)/sigma; - - if (dist < phase.rcut) - { - phi = phase.sratio; - dsdphi = sigma/phi; - } - else - { - phi = 1.0; - dsdphi = 0.0; - } - - // derivative of T_ij wrt sigma - double T = ampl*gaus; - double dTds = T/sigma*(rd*rd-1); - double dTdr = (rk-dist)/sqr(sigma)*T; - -#if defined(NEW_SHARP) - // define s2 = sp**2 - delta2/sqr(rij) - delta1/rij + alpha*sqr(rij) - // then s = phi*sqrt(s2) - double dsds2 = sqr(phi*sigmap)/(2.0*sigma); - double dsdsp = sigma/sigmap; - double dsdr = dsds2*(2.0*phase.delta2/cube(dist) - + phase.delta1/sqr(dist) + 2.0*sqr(qbroad)*dist); -#else - // define s2 = sp**2 - delta2/sqr(rij) - delta1/rij + alpha*sqr(rij) - // then s = phi*sqrt(s2) - double dsds2 = sqr(phi)/(2.0*sigma); - if (sigma==1e-5) dsds2 = 0; - - double dsdsp = 2.0*sigmap*dsds2; - double dsdr = dsds2*(2.0*phase.delta2/cube(dist) - + phase.delta1/sqr(dist) + 2.0*sqr(qbroad)*dist); -#endif - double dspdr = - sigmap/dist; - - - - /*---------------------------------------------------------------- - //------ Derivatives per atom : x,y,z,u,o - //- ------------------------------------------------------------- - - dTdx = dTds.(dsdsp.(dspdr.drdx+dspdx) + dsdr.drdx) + dTdr.drdx - */ - - ioffset = atomi.offset; - joffset = atomj.offset; - - // ----- d/dx[ip,ia] - - if ( (fit.refvar[ioffset] != -1) || (fit.refvar[joffset] != -1) ) - { - drdx = phase.a0[0]/dist*(d[0] + phase.cosg*d[1] + phase.cosb*d[2]); - dspdx = phase.a0[0]*(d[0]*s11 + d[1]*s12 + d[2]*s13)/sqr(dist)/sigmap; - - dg = dTds*(dsdsp*(dspdr*drdx+dspdx) + dsdr*drdx) + dTdr*drdx; - } - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] -= dg; - } - - - // ----- d/dy[ip,ia] - - if ( (fit.refvar[ioffset] != -1) || (fit.refvar[joffset] != -1) ) - { - drdx = phase.a0[1]/dist*(phase.cosg*d[0] + d[1] + phase.cosa*d[2]); - dspdx = phase.a0[1]*(d[0]*s12 + d[1]*s22 + d[2]*s23)/sqr(dist)/sigmap; - - dg = dTds*(dsdsp*(dspdr*drdx+dspdx) + dsdr*drdx) + dTdr*drdx; - } - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] -= dg; - } - - - // ----- d/dz[ip,ia] - - if ( (fit.refvar[ioffset] != -1) || (fit.refvar[joffset] != -1) ) - { - drdx = phase.a0[2]/dist*(phase.cosb*d[0] + phase.cosa*d[1] + d[2]); - dspdx = phase.a0[2]*(d[0]*s13 + d[1]*s23 + d[2]*s33)/sqr(dist)/sigmap; - - dg = dTds*(dsdsp*(dspdr*drdx+dspdx) + dsdr*drdx) + dTdr*drdx; - } - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] -= dg; - } - - - // ----- d/du[j,ip,ia] (j=11,22,33,12,13,23) - - /* - dTdu = dTds.dsdsp.dspdu - */ - - // u[0], u[1], u[2] - - double dspdu = 1/(2.0*sigmap*sqr(dist)); - - double fsimp = dTds*dsdsp*dspdu; - - for (i=0; i<3; i++) - { - dg = fsimp*sqr(d[i]); - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - //*pout << phase.a0[i] << " " << d[i] << " " << ig << " " << i << " " << fit_a_i[ipar] << endl; - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - } - - // u[3] - - dg = 2.0*fsimp*d[0]*d[1]; - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - // u[4] - - dg = 2.0*fsimp*d[0]*d[2]; - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - // u[5] - - dg = 2.0*fsimp*d[1]*d[2]; - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] += dg; - } - - - // ----- d/d occ[ip,ia], d/d occ[ip,ja] - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - fit_a_i[ipar] += T/atomi.occ; - } - - if ( (ipar=fit.refvar[joffset++]) != -1) - { - fit_a_i[ipar] += T/atomj.occ; - } - - //------ ---------------------------------------------------------------- - //------ Derivatives per phase : lat,delta2,delta1 - //------ ---------------------------------------------------------------- - - // ----- d/d(lattice parameter a) - - ioffset = phase.offset; - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = (d[0] + phase.cosg*d[1] + phase.cosb*d[2])*d[0]/phase.a0[0]/dist; - dspda = (d[0]*s11 + d[1]*s12 + d[2]*s13)*d[0]/phase.a0[0]/sqr(dist)/sigmap; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda + dTds*dsdsp*dspda; - - fit_a_i[ipar] += dg; - } - - // ----- d/d(lattice parameter b) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = (phase.cosg*d[0] + d[1] + phase.cosa*d[2])*d[1]/phase.a0[1]/dist; - dspda = (d[0]*s12 + d[1]*s22 + d[2]*s23)*d[1]/phase.a0[1]/sqr(dist)/sigmap; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda + dTds*dsdsp*dspda; - - fit_a_i[ipar] += dg; - } - - // ----- d/d(lattice parameter c) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = (phase.cosb*d[0] + phase.cosa*d[1] + d[2])*d[2]/phase.a0[2]/dist; - dspda = (d[0]*s13 + d[1]*s23 + d[2]*s33)*d[2]/phase.a0[2]/sqr(dist)/sigmap; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda + dTds*dsdsp*dspda; - - fit_a_i[ipar] += dg; - } - - - // ----- d/d(lattice angle alpha) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = - rad*phase.sina*d[1]*d[2]/dist; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda; - - fit_a_i[ipar] += dg; - } - - // ----- d/d(lattice angle beta) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = - rad*phase.sinb*d[0]*d[2]/dist; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda; - - fit_a_i[ipar] += dg; - } - - // ----- d/d(lattice angle gamma) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - drda = - rad*phase.sing*d[0]*d[1]/dist; - - dg = (dTds*(dsdsp*dspdr+dsdr) + dTdr)*drda; - - fit_a_i[ipar] += dg; - } - - // Derivatives wrt the peak sharpening parameters - - // ----- d/d(delta2) - - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - dg = -dTds*dsds2/sqr(dist); - fit_a_i[ipar] += dg; - } - - // ----- d/d(delta1) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - dg = -dTds*dsds2/dist; - fit_a_i[ipar] += dg; - } - - // ----- d/d(pscale) - - ioffset++; - - // ----- d/d(spdiameter) - - ioffset++; - - // ----- d/d(sratio) - - if ( (ipar=fit.refvar[ioffset++]) != -1) - { - dg = dTds*dsdphi; - fit_a_i[ipar] += dg; - } - - - //------ ---------------------------------------------------------------- - //------ Derivatives per data set : dscale, qdamp, qbroad - //------ ---------------------------------------------------------------- - - ioffset = this->offset; - - // ----- d/d(dscale[is]) - - ioffset++; - - // ----- d/d(qdamp[is]) - - ioffset++; - - // ----- d/d(qbroad[ip]) - - if( (ipar=fit.refvar[ioffset++]) != -1) - { - dg = dTds*dsds2*(2.0*qbroad*sqr(dist)); - fit_a_i[ipar] += dg; - } - -} - - -/**************************************************************** -* Calculated average atom mass in this phase -*****************************************************************/ -double Phase::averageAtomicMass() -{ - double mavg = 0.0; - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - mavg += ai->occ * ai->atom_type->M; - } - mavg /= np; - return mavg; -} - -/**************************************************************** -* Calculated average scattering factor for given radiation type -*****************************************************************/ -double Phase::averageScatteringFactor(char tp) -{ - double bavg = 0.0; - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - bavg += ai->occ * ai->atom_type->sf(tp); - } - bavg /= np; - return bavg; -} - -/**************************************************************** -* Update atom weights for given scattering type -*****************************************************************/ -void Phase::setup_weights(char tp) -{ - // calculate average scattering factor - double bavg = averageScatteringFactor(tp); - // get normalized weight of each atom - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - ai->weight = ai->atom_type->sf(tp) / bavg; - } -} - -/************************************************************************ -* Extend r-range by 6 ripples of sinc before applying Qmax cutoff. -* Contributions from peaks outside should be less than 1.5%. -* -* todo: should also extend by the 5*max(sigma) -************************************************************************/ -void DataSet::extendCalculationRange(bool lout) -{ - const int nripples = 6; - // initialize calculation range to fitting range - rcmin = rfmin; - rcmax = rfmax; - ncmin = nint((rcmin - rmin)/deltar); - ncmax = nint((rcmax - rmin)/deltar); - // check if Qmax cutoff is applied - if (!(0.0 < qmax)) return; - // get extension width - double rext = nripples*2*M_PI/qmax; - // FIXME - it should be possible to have rcmin smaller than rmin, - // but there is too much spaghetti that depends on it. - rcmin = max(rmin, rfmin - rext); - rcmax = rfmax + rext; - ncmin = nint((rcmin - rmin)/deltar); - ncmax = nint((rcmax - rmin)/deltar); - if (lout) - { - *pout << " Extending PDF search distance to " << - rcmin << " -> " << rcmax << " A ...\n"; - } -} - -/************************************************************************ - * Diameter of sphere that can enclose primitive cell. - * This is equal to the longest unit cell diagonal. - ************************************************************************/ -double Phase::circum_diameter() -{ - if (atom.empty()) return 0.0; - // array of all 4 diagonals - const size_t numdiags = 4; - static double ucdiagonals[numdiags][3] = { - {+1.0, +1.0, +1.0}, - {-1.0, +1.0, +1.0}, - {+1.0, -1.0, +1.0}, - {+1.0, +1.0, -1.0} - }; - double maxnorm = -1; - for (size_t idx = 0; idx != numdiags; ++idx) - { - const double* ucd = ucdiagonals[idx]; - double normucd = sqrt(skalpro(ucd, ucd)); - if (normucd > maxnorm) - { - maxnorm = normucd; - } - } - // adjust to round-off errors - const double epsilond = sqrt(numeric_limits().epsilon()); - maxnorm = maxnorm*(1.0+epsilond) + epsilond; - return maxnorm; -} - -/************************************************************************ - * combined mean square displacements of 2 atoms along lattice vector - ************************************************************************/ -double Phase::msdAtoms(const Atom& ai, const Atom& aj, double* vl) -{ - // msd = transpose(gten*vln) * ar[i]*U[i,j]*ar[j] * gten*vln - // normalize vl - double vlnorm = sqrt(skalpro(vl,vl)); - double vln[3] = { vl[0]/vlnorm, vl[1]/vlnorm, vl[2]/vlnorm }; - // combine squared atom displacements - double U[6]; - for (size_t i = 0; i != 6; ++i) - { - U[i] = ai.u[i] + aj.u[i]; - } - // Un = ar[i]*U[i,j]*ar[j] - double Un[6] = { U[0]*ar[0]*ar[0], U[1]*ar[1]*ar[1], U[2]*ar[2]*ar[2], - U[3]*ar[0]*ar[1], U[4]*ar[0]*ar[2], U[5]*ar[1]*ar[2] }; - // rhs = gten*vln - double rhs[3] = { 0.0, 0.0, 0.0 }; - for (size_t i = 0; i != 3; ++i) - { - for (size_t j = 0; j != 3; ++j) - { - rhs[i] += gten[i][j] * vln[j]; - } - } - // msd = transpose(rhs) * Un * rhs - double msd; - msd = Un[0]*rhs[0]*rhs[0] + Un[1]*rhs[1]*rhs[1] + Un[2]*rhs[2]*rhs[2] + - 2*Un[3]*rhs[0]*rhs[1] + 2*Un[4]*rhs[0]*rhs[2] + 2*Un[5]*rhs[1]*rhs[2]; - return msd; -} - -/********************************* ------- - Save fit results - Thu Oct 13 2005 - CLF - Changed code to return a string of the - saved file. Actually saving the file is - optional. -*********************************/ -string PdfFit::save_res(string fname) -{ - //check to see if a refinement has even been done. - //after a refinement is finished, fit.iter = -1 - if(fit.iter == 0) - { - throw unassignedError("Refinement must be performed first"); - } - ofstream fout; - stringstream outfilestream; - string outfilestring = ""; - - outfilestream << " " << string(78,'=') << endl - << " PDF REFINEMENT\n" - << " Using PDFFIT version : " << PdfFit::version() << endl - << " " << string(78,'=') << endl; - - for(int ip=0; ipoutput(outfilestream); - - fit.output(outfilestream); - - outfilestream << " " << string(78,'=') << endl; - - if( fname != "" ) - { - fout.open(fname.c_str()); - - if (!fout) - { - throw IOError("Cannot create output file"); - } - - *pout << " Saving fit results to file : " << fname << endl; - - fout << outfilestream.str(); - //fout.setf(ios::showpoint); - - fout.close(); - } - - return outfilestream.str(); -} - -/************************************************* - ------- Save PDF, structure or complete result - Thu Oct 13 2005 - CLF - Changed code to return a string of the - saved file. Actually saving the file is - optional. -**************************************************/ -string PdfFit::save_pdf(int iset, string fname) -{ - string outfilestring = ""; - - //------ - Save PDF (G(r)) - - if ( (iset < 1) || (iset > nset) ) - { - throw unassignedError("data set does not exist"); - } - else if( fname != "" ) - { - ofstream fout; - fout.open(fname.c_str()); - - if (!fout) - { - throw IOError("cannot create output file"); - } - - *pout << " Saving PDF data set " << iset << " to file : " << fname << endl; - - outfilestring = datasets[iset-1]->build_pdf_file(); - - fout << outfilestring; - fout.close(); - } - else - { - outfilestring = datasets[iset-1]->build_pdf_file(); - } - - return outfilestring; -} - - -/* - Thu Oct 13 2005 - CLF - Changed code to return a string of the - saved file. -*/ -string DataSet::build_pdf_file() -{ - string blank=string(4,' '); - stringstream outfilestream; - outfilestream.setf(ios::showpoint); - - for (int i=nfmin;i<=nfmax;i++) - { - double r = i*deltar + rmin; - outfilestream << setw(12) << r << blank << setw(12) << pdftot[i] << blank << setw(12) << 0.0 - << blank << setw(12) << 1.0/sqrt(wic[i]) << blank << setw(12) - << obs[i]-pdftot[i] << endl; - } - - return outfilestream.str(); -} - -//------ - Save DIF file (Gobs-G(r)) -/* - Thu Oct 13 2005 - CLF - Changed code to return a string of the - saved file. Actually saving the file - is optional. -*/ - -string PdfFit::save_dif(int iset, string fname) -{ - - ofstream fout; - string outfilestring = ""; - - if ( (iset < 1) || (iset > nset) ) - { - throw unassignedError("Data set does not exist"); - } - else if (fname != "" ) - { - fout.open(fname.c_str()); - - if (!fout) - { - throw IOError("Cannot create output file"); - } - - *pout << " Saving difference data set " << iset << " to file : " << fname << endl; - - outfilestring = datasets[iset-1]->build_dif_file(); - - fout << outfilestring; - fout.close(); - } - else - { - outfilestring = datasets[iset-1]->build_dif_file(); - } - - return outfilestring; -} - -/* - Thu Oct 13 2005 - CLF - Changed code to return a string of the saved file. -*/ -string DataSet::build_dif_file() -{ - string blank=string(4,' '); - stringstream outfilestream; - outfilestream.setf(ios::showpoint); - - for (int i=nfmin;i<=nfmax;i++) - { - double r = i*deltar + rmin; - outfilestream << setw(12) << r << blank << setw(12) << obs[i]-pdftot[i] << endl; - } - - return outfilestream.str(); -} - -void PdfFit::selphase(int ip) -{ - if (!curset) - { - throw unassignedError("No data set selected"); - } - assert(nphase == (int)phase.size()); - if (ip == ALL) - { - curset->psel = phase; - } - else - { - // check if one-based index ip is out of bounds - if (ip < 1 || ip > nphase) - { - stringstream eout; - eout << "Phase " << ip << " undefined"; - throw unassignedError(eout.str()); - } - curset->selphase(ip - 1, phase[ip - 1]); - } -} - -void DataSet::selphase(int ip, Phase *phase) -{ - if (int(psel.size()) <= ip) - { - psel.resize(ip+1); - } - psel[ip] = phase; -} - - -vector DataSet::getcrw() const -{ - assert(mowner); - double wsqobs = mowner->totalWeighedSquareObs(); - // Get reciprocal value of wsqobs. - // Do not normalize when wsqobs is zero. - double recwsqobs = (wsqobs > 0) ? (1.0 / wsqobs) : 1.0; - vector rv = this->cumchisq; - vector::iterator xi; - for (xi = rv.begin(); xi != rv.end(); ++xi) - { - *xi = sqrt(*xi * recwsqobs); - } - return rv; -} - - -double DataSet::weighedSquareObs() const -{ - double rv = 0; - for (int i = nfmin; i <= nfmax; i++) - { - rv += wic[i] * obs[i] * obs[i]; - } - return rv; -} - - -double DataSet::getdsrw() const -{ - vector crw = this->getcrw(); - double rv = crw.empty() ? 0.0 : crw.back(); - return rv; -} - - -double DataSet::getdsredchisq() const -{ - assert(mowner); - int nredobs = mowner->totalReducedObservations(); - double c2 = this->cumchisq.empty() ? 0.0 : this->cumchisq.back(); - double rv = (nredobs > 0) ? (c2 / nredobs) : 0.0; - return rv; -} - - -void PdfFit::pdesel(int ip) -{ - if (!curset) - { - throw unassignedError("No data set selected"); - } - assert(nphase == (int)curset->psel.size()); - if (ip == ALL) - { - fill(curset->psel.begin(), curset->psel.end(), - static_cast(NULL)); - } - else - { - // check if one-based index ip is out of bounds - if (ip < 1 || ip > nphase) - { - stringstream eout; - eout << "phase " << ip << " undefined"; - throw unassignedError(eout.str()); - } - curset->psel[ip - 1] = NULL; - } -} - -// phase[ip-1] or curphase for ip == 0 -Phase* PdfFit::getphase(int ip) -{ - Phase* ph = (0 < ip && ip <= nphase) ? phase[ip-1] : curphase; - if (!ph || ip < 0 || ip > nphase) - { - throw unassignedError("Phase does not exist."); - } - return ph; -} - -void PdfFit::check_sel_args(int ip, char ijchar, int aidx1) -{ - ostringstream emsg; - if (!curset) - { - throw unassignedError("No data set selected"); - } - if (ip < 1 || ip > int(curset->psel.size())) - { - emsg << "phase " << ip << " undefined or not selected\n"; - throw unassignedError(emsg.str()); - } - if (ijchar != 'i' && ijchar != 'j') - { - ostringstream emsg; - emsg << "Invalid value of ijchar '" << ijchar << "'"; - throw ValueError(emsg.str()); - } - if (aidx1 < 1 || aidx1 > (curset->psel[ip - 1]->natoms)) - { - emsg << "invalid atom index " << aidx1 << ".\n"; - throw ValueError(emsg.str()); - } -} - -void PdfFit::selphaseForEachDataSet(Phase* ph) -{ - // find 0-based index of ph in PdfFit::phase vector - assert(count(this->phase.begin(), this->phase.end(), ph) > 0); - int phidx0 = find(this->phase.begin(), this->phase.end(), ph) - - this->phase.begin(); - vector::iterator dsi; - for (dsi = this->datasets.begin(); dsi != this->datasets.end(); ++dsi) - { - DataSet* pds = *dsi; - pds->selphase(phidx0, ph); - } -} - -void PdfFit::selectAtomType(int ip, char ijchar, char* symbol, bool select) -{ - check_sel_args(ip, ijchar); - Phase* ph = curset->psel[ip - 1]; - const LocalPeriodicTable* lpt = ph->getPeriodicTable(); - const AtomType* atp = lpt->lookup(symbol); - set& ignored = ijchar == 'i' ? - curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; - for (int aidx = 0; aidx < ph->natoms; ++aidx) - { - if (atp != ph->atom[aidx].atom_type) continue; - if (select) ignored.erase(aidx); - else ignored.insert(aidx); - } -} - -void PdfFit::selectAtomIndex(int ip, char ijchar, int aidx1, bool select) -{ - check_sel_args(ip, ijchar, aidx1); - Phase* ph = curset->psel[ip - 1]; - set& ignored = ijchar == 'i' ? - curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; - int aidx = aidx1 - 1; - if (select) ignored.erase(aidx); - else ignored.insert(aidx); -} - -void PdfFit::selectAll(int ip, char ijchar) -{ - check_sel_args(ip, ijchar); - Phase* ph = curset->psel[ip - 1]; - set& ignored = ijchar == 'i' ? - curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; - ignored.clear(); -} - -void PdfFit::selectNone(int ip, char ijchar) -{ - check_sel_args(ip, ijchar); - Phase* ph = curset->psel[ip - 1]; - set& ignored = ijchar == 'i' ? - curset->phase_ignore_i[ph] : curset->phase_ignore_j[ph]; - for (int aidx = 0; aidx < ph->natoms; ++aidx) ignored.insert(aidx); -} - -/***************************************** - Wed Oct 12 2005 - CLF - Reads observed PDF from arrays. -******************************************/ -int PdfFit::read_data_arrays(char tp, double qmax, double qdamp, - int length, double * r_data, double * Gr_data, double * dGr_data, string _name) -{ - DataSet* pds = new DataSet(this); - - try { - pds->read_data_arrays(nset+1, tp, qmax, qdamp, length, - r_data, Gr_data, dGr_data, _name); - } - catch(Exception e) { - delete pds; - throw; - } - - // automatically select existing phases and its atoms for the new dataset - for (int ip=0; ipselphase(ip, this->phase[ip]); - - this->datasets.push_back(pds); - nset++; - setdata(nset); - - return 1; -} - -/***************************************** - Wed Oct 12 2005 - CLF - Reads observed PDF from a c-style string. -******************************************/ - -int PdfFit::read_data_string(string& buffer, char tp, double qmax, double qdamp, string _name) -{ - DataSet* pds = new DataSet(this); - try { - pds->read_data_string(nset+1, buffer, tp, qmax, qdamp); - } - catch(Exception e) { - delete pds; - throw; - } - // automatically select existing phases and its atoms for the new dataset - for (int ip = 0; ip < nphase; ip++) pds->selphase(ip, this->phase[ip]); - - this->datasets.push_back(pds); - nset++; - setdata(nset); - - return 1; -} - -/***************************************** - Reads observed PDF as xy ASCII file. -******************************************/ - -int PdfFit::read_data(string datafile, char tp, double qmax, double qdamp) -{ - DataSet* pds = new DataSet(this); - try { - pds->read_data(nset+1, datafile, tp, qmax, qdamp); - } - catch(Exception e) { - delete pds; - throw; - } - - // automatically select existing phases and its atoms for the new dataset - for (int ip=0; ipselphase(ip, this->phase[ip]); - - this->datasets.push_back(pds); - nset++; - setdata(nset); - - return 1; -} - -// local helper to check for regular spacing in sequence -namespace { - -template -bool isRegular(Iterator first, Iterator last) -{ - if (last - first < 2) return true; - double dx = double( *(last-1) - *first ) / double(last - first - 1); - for (Iterator p0 = first, p1 = first + 1; p1 != last; ++p0, ++p1) - { - if (fabs(*p1 - *p0 - dx) > deltar_tol) return false; - } - return true; -} - -} // local namespace - - -/* Wed Oct 12 2005 - CLF - * Using read_data_arrays adds functionality - * to pdffit2, allowing one to read data that is alread stored as arrays. - */ -void DataSet::read_data_arrays(int _iset, char tp, double _qmax, double _qdamp, - int length, double * r_data, double * Gr_data, - double * dGr_data, string _name ) -{ - iset = _iset; - - //------ Now analyse given parameters - - //------ - get exp. method (neutron/x-ray) - - scattering_type = tp; - - //------ - get QMAX and Qdamp - - qmax = _qmax; - qdamp = _qdamp; - - //------ Finally we actually read the data - - bool lwei = true; - - /* Only really care about G(r) and dG(r), the uncertainty */ - for( int i = 0; i < length; i++ ) - { - double wic; - - if( dGr_data == NULL ) - { - wic = 1.0; - lwei = false; - } - else - { - wic = 1.0/sqrt( dGr_data[i] ); - } - - this->obs.push_back( Gr_data[i] ); - this->wic.push_back(wic); - - } - - *pout << " Reading data from arrays...\n"; - - rmin = rfmin = r_data[0]; - rmax = rfmax = r_data[length - 1]; - bin = length; - deltar = (rmax - rmin)/double(bin-1); - // check if r has equidistant spacing - if (!isRegular(r_data, r_data + length)) - { - throw dataError("Irregular spacing of r values."); - } - name = _name; - - *pout << " Read PDF data set " << iset << - " (r = " << rmin << " to " << rmax << " A, " << - bin << " points) ...\n"; - if (!lwei) this->warningOnMissingWeights(); - *pout << endl; - - return; -} - -void DataSet::read_data_stream(int _iset, istream& fdata, - char tp, double _qmax, double _qdamp, string _name) -{ - string line; - - iset = _iset; - - //------ - get exp. method (neutron/x-ray) - - scattering_type = tp; - - //------ - get QMAX and Qdamp - - qmax = _qmax; - qdamp = _qdamp; - - //------ Ignore header lines - getline(fdata, line); - if (line.compare(0, 7, "History") == 0) - { - for ( ; !fdata.eof(); getline(fdata,line)) - { - if (line[0] != '#') continue; - // get 3 words from line - string w0, w1, w2; - istringstream fline(line); - fline >> w0 >> w1 >> w2; - if ( w0.find_first_not_of('#') == string::npos && - w1 == "start" && w2 == "data" ) break; - } - } - //------ Any other header lines starting with # ? - while (line[0] == '#') getline(fdata,line); - - //------ Finally we actually read the data - - // find number of columns - int ncol = 0; - if (!line.empty()) - { - double x; - istringstream sline(line); - while (sline >> x) ++ncol; - } - - vector r_data; - bool lwei = (ncol > 2); // flag for weights defined by dGr - - while (true) - { - double ri, obs; - double val, wic; - istringstream sline(line); - - sline >> ri >> obs; - if (!sline) break; - - // Obtain weights from dGr. Use dGr values only when they are all - // positive, otherwise set all weights to 1. - wic = 1.0; - switch (ncol) - { - case 3: - if (sline >> val && val > 0.0) - { - wic = 1.0/sqr(val); - } - else - { - lwei = false; - } - break; - case 4: - // skip one value - if (sline >> val >> val && val > 0.0) - { - wic = 1.0/sqr(val); - } - else - { - lwei = false; - } - break; - } - - // copy values to data arrays - r_data.push_back(ri); - this->obs.push_back(obs); - this->wic.push_back(wic); - - if (!getline(fdata, line)) break; - } - - // make sure all wic values are one when lwei is false, because - // lwei could be reset due to zero dGr value - if (!lwei) - { - fill(this->wic.begin(), this->wic.end(), 1.0); - } - - *pout << " Reading " << ncol << " columns ...\n"; - - if (!isRegular(r_data.begin(), r_data.end())) - { - throw dataError("Irregular spacing of r values."); - } - if (this->obs.size() < 2) - { - throw dataError("Incredibly short data set."); - } - bin = this->obs.size(); - this->rmin = this->rfmin = r_data.front(); - this->rmax = this->rfmax = r_data.back(); - this->nfmin = 0; - this->nfmax = bin - 1; - this->deltar = (rmax - rmin)/double(bin-1); - this->name = _name; - - *pout << " Read PDF data set " << iset << " (r = " << rmin - << " to " << rmax << " A, " << bin << " points) ...\n"; - - if (!lwei) this->warningOnMissingWeights(); - - *pout << endl; - - return; -} - -/* Wed Oct 12 2005 - CLF - * Using read_data_string adds functionality - * to pdffit2, allowing one to read data that has already been loaded. - * - * - * Thu Nov 3 2005 - CLF - * Need to add some data checking routines! - */ -void DataSet::read_data_string(int _iset, string& buffer, char tp, double _qmax, - double _qdamp, string _name) -{ - istringstream fdata(buffer); - read_data_stream(_iset, fdata, tp, _qmax, _qdamp, _name); - return; -} - -/* Wed Oct 12 2005 - CLF - * Using read_data and the above read_data_string adds functionality - * to pdffit2, allowing one to read data that has already been loaded. - */ -void DataSet::read_data(int _iset, string pfile, char tp, double _qmax, - double _qdamp) -{ - // open and check pfile - ifstream fdata(pfile.c_str()); - if (!fdata) throw IOError("File does not exist"); - // read the data - read_data_stream(_iset, fdata, tp, _qmax, _qdamp, pfile); - return; -} - -/********************************* - Sets R-range for fitting -**********************************/ -void PdfFit::range(int is, double rmin, double rmax) -{ - if( rmin >= rmax ) - { - throw ValueError("rmin must be < rmax"); - } - if (is == ALL) - { - for(is = 0; is < nset; is++) datasets[is]->range(rmin,rmax); - } - else - { - if ( (is >= 1) && (is <= nset) ) - { - datasets[is-1]->range(rmin,rmax); - } - else - { - throw ValueError("Invalid data set number"); - } - } -} - -void DataSet::range(double rmin, double rmax) -{ - if ( (rmin >= this->rmin) && (rmin <= this->rmax) - && (rmax <= this->rmax) && (rmin < rmax) ) - { - this->rfmin = rmin; - this->rfmax = rmax; - } - else - { - throw ValueError("Range outside data set limits"); - } -} - -vector< pair > DataSet::getAtomPhaseFractions() -{ - size_t nphase = psel.size(); - valarray xi(nphase); - valarray dxi(nphase); - for (size_t ip = 0; ip < nphase; ip++) - { - Phase* ph = psel[ip]; - if (!ph) - { - xi[ip] = 0.0; - dxi[ip] = 0.0; - } - else - { - double bavg = ph->averageScatteringFactor(scattering_type); - xi[ip] = ph->pscale / (bavg*bavg); - dxi[ip] = ph->dpscale / (bavg*bavg); - } - } - double xtot = xi.sum(); - vector< pair > rv(nphase, make_pair(0.0, 0.0)); - double dx2tot = (dxi * dxi).sum(); - // get normalized phase fractions fi, do this only when xtot > 0 - for (size_t ip = 0; ip < nphase && 0.0 < xtot; ip++) - { - double fi = xi[ip] / xtot; - double dfi2 = ( dxi[ip]*dxi[ip] * (xtot*xtot - 2*xtot*xi[ip]) + - xi[ip]*xi[ip]*dx2tot ) / pow(xtot, 4); - double dfi = sqrt(dfi2); - rv[ip].first = fi; - rv[ip].second = dfi; - } - return rv; -} - -vector< pair > DataSet::getCellPhaseFractions() -{ - size_t nphase = psel.size(); - valarray xi(nphase); - valarray dxi(nphase); - for (size_t ip = 0; ip < nphase; ip++) - { - Phase* ph = psel[ip]; - if (!ph) - { - xi[ip] = 0.0; - dxi[ip] = 0.0; - } - else - { - double bavg = ph->averageScatteringFactor(scattering_type); - xi[ip] = ph->pscale / (bavg*bavg * ph->np); - dxi[ip] = ph->dpscale / (bavg*bavg * ph->np); - } - } - double xtot = xi.sum(); - vector< pair > rv(nphase, make_pair(0.0, 0.0)); - double dx2tot = (dxi * dxi).sum(); - // get normalized phase fractions fi, do this only when xtot > 0 - for (size_t ip = 0; ip < nphase && 0.0 < xtot; ip++) - { - double fi = xi[ip] / xtot; - double dfi2 = ( dxi[ip]*dxi[ip] * (xtot*xtot - 2*xtot*xi[ip]) + - xi[ip]*xi[ip]*dx2tot ) / pow(xtot, 4); - double dfi = sqrt(dfi2); - rv[ip].first = fi; - rv[ip].second = dfi; - } - return rv; -} - -vector< pair > DataSet::getMassPhaseFractions() -{ - size_t nphase = psel.size(); - valarray xi(nphase); - valarray dxi(nphase); - for (size_t ip = 0; ip < nphase; ip++) - { - Phase* ph = psel[ip]; - if (!ph) - { - xi[ip] = 0.0; - dxi[ip] = 0.0; - } - else - { - double bavg = ph->averageScatteringFactor(scattering_type); - double mavg = ph->averageAtomicMass(); - xi[ip] = ph->pscale * mavg / (bavg*bavg); - dxi[ip] = ph->dpscale * mavg / (bavg*bavg); - } - } - double xtot = xi.sum(); - vector< pair > rv(nphase, make_pair(0.0, 0.0)); - double dx2tot = (dxi * dxi).sum(); - // get normalized phase fractions fi, do this only when xtot > 0 - for (size_t ip = 0; ip < nphase && 0.0 < xtot; ip++) - { - double fi = xi[ip] / xtot; - double dfi2 = ( dxi[ip]*dxi[ip] * (xtot*xtot - 2*xtot*xi[ip]) + - xi[ip]*xi[ip]*dx2tot ) / pow(xtot, 4); - double dfi = sqrt(dfi2); - rv[ip].first = fi; - rv[ip].second = dfi; - } - return rv; -} - - -void DataSet::warningOnMissingWeights() const -{ - *pout << - " ****WARN****\n" << - " Uncertainties on G(r) were absent or unreadable in your input\n" << - " data. The program reset these uncertainties to unity. This\n" << - " does not affect at all the refined parameter values. However,\n" << - " the values of the estimated uncertainties on these refined\n" << - " parameter values are not reliable.\n" << - " ****WARN****\n"; -} - -// End of file diff --git a/libpdffit2/pdffit.cc b/libpdffit2/pdffit.cc deleted file mode 100644 index 7eaa5f49..00000000 --- a/libpdffit2/pdffit.cc +++ /dev/null @@ -1,372 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch, Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* PdfFit and Fit methods for implementing PDFFIT1 interpreter commands. -* -* Comments: -* -***********************************************************************/ - -#include -#include -#include -#include -#include - -#include "MathUtils.h" -#include "pdffit.h" - - -// class methods - -const string& PdfFit::version(const char* ver) -{ - static unique_ptr vervalue; - static const string undefined_version = "1.0?"; - // definition of the version value. This should be only called once, - // when the pdffit2 module is initialized. We allow redefinition - // with the same version as this may happen when pdffit2 gets reloaded. - if (ver) - { - if (!vervalue.get()) - { - vervalue.reset(new string(ver)); - } - else if (*vervalue != ver) - { - ostringstream emsg; - emsg << "Invalid redefinition of PdfFit::version."; - throw invalid_argument(emsg.str()); - } - } - // take care of return value rv. - const string& rv = vervalue.get() ? *vervalue : undefined_version; - return rv; -} - - -// constructor and destructor - - -PdfFit::PdfFit() -{ - reset(); - init(); -} - - -PdfFit::~PdfFit() -{ - reset(); -} - - -/********************************************************** - resets the data sets and crystal structures to empty -***********************************************************/ - -void PdfFit::reset() -{ - //------ Data sets - - vector::iterator dsi = this->datasets.begin(); - for (; dsi != this->datasets.end(); ++dsi) delete *dsi; - this->datasets.clear(); - this->nset = 0; - this->curset = NULL; - - //------ Structure - - vector::iterator phi = this->phase.begin(); - for (; phi != this->phase.end(); ++phi) delete *phi; - this->phase.clear(); - this->nphase = 0; - this->curphase = NULL; - this->total = 0; - - // ------ Fit - - this->fit.reset(); -} - -void Fit::reset() -{ - // reset all data members to initial values - alambda = chisq = ochisq = fit_rw = redchisq = wnorm = 1.0; - stagnating = ntot = ndof = 1; - iter = 0; - // clean all arrays - p.clear(); - dp.clear(); - id.clear(); - ip.clear(); - covar.clear(); - alpha.clear(); - var.clear(); - dvar.clear(); - vref.clear(); - vcovar.clear(); - fconstraint.clear(); - form.clear(); - idef.clear(); - ctype.clear(); - used.clear(); - dvdp.clear(); - sdptr.clear(); - refvar.clear(); -} - - -void Fit::init_builtins() -{ - typedef pair entry; - builtin.insert(entry("-",Builtin(neg,dneg))); - builtin.insert(entry("sin",Builtin(sin,dsin))); - builtin.insert(entry("cos",Builtin(cos,dcos))); - builtin.insert(entry("tan",Builtin(tan,dtan))); - builtin.insert(entry("sind",Builtin(sind,dsind))); - builtin.insert(entry("cosd",Builtin(cosd,dcosd))); - builtin.insert(entry("tand",Builtin(tand,dtand))); - builtin.insert(entry("asin",Builtin(asin,dasin))); - builtin.insert(entry("acos",Builtin(acos,dacos))); - builtin.insert(entry("atan",Builtin(atan,datan))); - builtin.insert(entry("asind",Builtin(asind,dasind))); - builtin.insert(entry("acosd",Builtin(acosd,dacosd))); - builtin.insert(entry("atand",Builtin(atand,datand))); - builtin.insert(entry("exp",Builtin(exp,dexp))); - builtin.insert(entry("log",Builtin(log,dlog))); - builtin.insert(entry("sqr",Builtin(sqr,dsqr))); - builtin.insert(entry("cube",Builtin(cube,dcube))); - builtin.insert(entry("sqrt",Builtin(sqrt,dsqrt))); -} - -/* - Initialization routine -*/ -void PdfFit::init() // called setup in Fortran program -{ - fit.init_builtins(); -} - -void PdfFit::setphase(int ip) -{ - if ((ip<1) || (ip > nphase)) - { - stringstream eout; - eout << "Warning: phase " << ip << " undefined"; - throw unassignedError(eout.str()); - } - - Phase &phase=*this->phase[ip-1]; - - curphase = &phase; - - lat.resize(6); - lat[0].setptr(&phase.a0[0]); - lat[1].setptr(&phase.a0[1]); - lat[2].setptr(&phase.a0[2]); - lat[3].setptr(&phase.win[0]); - lat[4].setptr(&phase.win[1]); - lat[5].setptr(&phase.win[2]); - - pscale.setptr(&phase.pscale); - spdiameter.setptr(&phase.spdiameter); - stepcut.setptr(&phase.stepcut); - delta2.setptr(&phase.delta2); - delta1.setptr(&phase.delta1); - sratio.setptr(&phase.sratio); - rcut.setptr(&phase.rcut); - - x.resize(phase.natoms); - y.resize(phase.natoms); - z.resize(phase.natoms); - u11.resize(phase.natoms); - u22.resize(phase.natoms); - u33.resize(phase.natoms); - u12.resize(phase.natoms); - u13.resize(phase.natoms); - u23.resize(phase.natoms); - occ.resize(phase.natoms); - - for(int ia=0; ia nset)) - { - stringstream eout; - eout << "Warning: set " << is << " undefined"; - throw unassignedError(eout.str()); - } - - DataSet* pds = this->datasets[is-1]; - - curset = pds; - - dscale.setptr( &(pds->dscale) ); - qdamp.setptr( &(pds->qdamp) ); - qbroad.setptr( &(pds->qbroad) ); -} - - -const vector& DataSet::getpdf_obs() -{ - return this->obs; -} - - -const vector& DataSet::getpdf_fit() -{ - if (this->pdftot.empty()) - { - size_t n = this->obs.size(); - this->pdftot.assign(n, 0.0); - } - return this->pdftot; -} - - -vector PdfFit::getpdf_obs() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->getpdf_obs(); -} - -vector PdfFit::getpdf_fit() -{ - if (!curset) - { - throw unassignedError("No fit data"); - } - return curset->getpdf_fit(); -} - -int PdfFit::getnfmin() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->nfmin; -} - -int PdfFit::getnfmax() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->nfmax; -} - -double PdfFit::getdeltar() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->deltar; -} - -double PdfFit::getrmin() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->rmin; -} - -double PdfFit::getrmax() -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->rmax; -} - -vector PdfFit::getcrw() const -{ - if (!curset) - { - throw unassignedError("No data loaded"); - } - return curset->getcrw(); -} - -map > PdfFit::getPhaseFractions() -{ - if (!curset) - { - const char* emsg = "Dataset not defined, unknown scattering type"; - throw unassignedError(emsg); - } - map > rv; - vector< pair > atomfractions; - vector< pair > cellfractions; - vector< pair > massfractions; - atomfractions = curset->getAtomPhaseFractions(); - cellfractions = curset->getCellPhaseFractions(); - massfractions = curset->getMassPhaseFractions(); - size_t n = atomfractions.size(); - for (size_t i = 0; i != n; ++i) - { - rv["atom"].push_back(atomfractions[i].first); - rv["stdatom"].push_back(atomfractions[i].second); - rv["cell"].push_back(cellfractions[i].first); - rv["stdcell"].push_back(cellfractions[i].second); - rv["mass"].push_back(massfractions[i].first); - rv["stdmass"].push_back(massfractions[i].second); - } - return rv; -} - -double PdfFit::get_scat(char tp, string smbpat) -{ - double rv; - const LocalPeriodicTable* lpt = this->curphase ? - this->curphase->getPeriodicTable() : - LocalPeriodicTable::instance(); - const AtomType* atp = lpt->lookup(smbpat); - try { - rv = atp->sf(tp); - } - catch (runtime_error e) { - throw ValueError(e.what()); - } - return rv; -} - -// End of file diff --git a/libpdffit2/pdffit.h b/libpdffit2/pdffit.h deleted file mode 100644 index a4b030ac..00000000 --- a/libpdffit2/pdffit.h +++ /dev/null @@ -1,611 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* classes Phase, DataSet, Fit, Pdf, PdfFit, RefVar, NonRefVar, Builtin -* -* Comments: Main header file included by all others. Big mess. -* -***********************************************************************/ - -#ifndef PDFFIT_H_INCLUDED -#define PDFFIT_H_INCLUDED - -#include -#include -#include -#include -#include -#include - -#include "AtomType.h" -#include "Atom.h" -#include "PairDistance.h" -#include "matrix.h" -#include "exceptions.h" -#include "LocalPeriodicTable.h" -#include "OutputStreams.h" - -using namespace std; - -/*********************************************************************** - * Here are constants for the parameter coding - DO NOT CHANGE - * unless you are rewriting the program !!!!!!!!!!!!!!!!!!!!!! - *********************************************************************** - * - * n_st : Number of global structural parameters per phase - * n_at : Number of parameters for each atom - * n_ex : Number of experimental parameters per dataset - * - ***********************************************************************/ - -const int n_st = 11; -const int n_at = 10; -const int n_ex = 3; - -const int ALL = -1; -typedef vector::iterator VAIT; - -enum FCON { USER, IDENT, FCOMP, FSQR }; - -typedef double (*fbuiltin)(double); - -class Fit; -class PdfFit; -class DataSet; -class Phase; -class NonRefVar; -class RefVar; - - -// non-refinable variables accessible to the users -class NonRefVar -{ - friend class PdfFit; - double *a; - - public: - NonRefVar() : a(NULL) - { - mtype = "NonRefVar"; - } - bool isAssigned() { return (a != NULL); } - void setptr(double* a) { this->a = a; } - void setval(double a) { *this->a = a; } - double get() { - double rv = (a) ? *a : 0.0; - return rv; - } - const string& type() const - { - return mtype; - } - - protected: - string mtype; -}; - -// Refinable variables accessible to the users -class RefVar: public NonRefVar -{ - friend class PdfFit; - public: - RefVar() : NonRefVar() - { - mtype = "RefVar"; - } -}; - - -typedef double (*fcon)(vector&, vector&); -typedef double (*fbuiltin) (double); - -// TK commented out 03/31/05 -// class Builtin { fbuiltin func, deriv; -// public: -// Builtin(fbuiltin func, fbuiltin deriv): func(func), deriv(deriv) {} -// }; - -// TK 03/31/05 replaced above with -class Builtin { - public: - fbuiltin func, deriv; // made these public. - // Really should just be a struct, or provide - // const pointers. - Builtin(fbuiltin func, fbuiltin deriv): func(func), deriv(deriv) {} -}; - -// contains the address of the variable, and the current value of the parameter -class Fit -{ - friend class PdfFit; - - map builtin; - - double parse(string line, vector &dnumdp); - double compute(string &expr, vector &dnumdp); - string substitute_pars(string &expr); - double getnum(istringstream &inexpr, vector &dnumdp); - void init_builtins(); - void reset(); - - public: - Fit() - { - reset(); - } - - // CLF Wed May 25 2005 - // Made these members of fit. Were local variables to - // refine function. - double alambda, chisq, ochisq; - int stagnating; - // CLF - - int iter; - double fit_rw; - double redchisq; // reduced chi-squared - double wnorm; // sum of weighted squared datapoints - int ntot, ndof; // total # of points, number of degrees of freedom - // parameter related variables - vector p; // fit-parameters - vector dp; // errors on the refined parameters; - vector id; // parameter identification number (arbitrary integer) - vector ip; // parameter selection - matrix covar, alpha; // covariance matrix and curvature - - // constraint related variables - vector var; // constrained variables - vector dvar; // errors on the constrained variables - vector vref; // true if variable contains free parameters - matrix vcovar; // covariance matrix on constrained variables - vector fconstraint; // constraint equations - vector form; // constraint formula - vector idef; // default parameter if no explicit constraint - vector ctype; // type of constraint - - vector used; // vector of used parameter indices (not ids) in the current constraint - - // variables relating constraint-parameter - matrix dvdp; // derivative of var wrt p - - // variables relating to refinable variables - vector sdptr; // pointer to standard deviation of refinable variable - - vector refvar; // integer pointer from refinable variable to actual constraint # - - void fixpar(int pidx); - void freepar(int pidx); - void setpar(unsigned int pidx, double val); - double getpar(unsigned int pidx); - void constrain(double &a, string form); - void constrain(double &a, double f(vector&, vector&) ); - void constrain(double &a, int ipar ); - void constrain(double &a, int ipar, FCON type); - void constrain(double &a, string inpform, fcon f, int idef, FCON type); - int vfind(double &a); // look for variable in list of constraints - int parfind(unsigned int j); - void fill_variables(); - void fill_errors(); - int varsize() const { return var.size(); } - int psize() const { return p.size(); } - //Thu Oct 13 2005 - CLF - void output(ostream &fout); - void out(); - - private: - vector order_by_id() const; - -}; - -class PdfFit -{ - // class methods - - public: - static const string& version(const char* ver=NULL); - - private: - - //Struct cr; - int nphase; - int total; // total # of atoms - vector phase; - - Fit fit; - - // Dataset parameters - int nset; - vector datasets; - DataSet *curset; - - void init(); - - public: - - void fit_setup(); - void fit_errors(); - void fit_theory(bool ldiff, bool lout); - double totalWeighedSquareObs() const; - int totalReducedObservations() const; - - private: - - void initarrays(); - - void mrqmin(vector &a, vector &ia, matrix &covar, - matrix &alpha, double &chisq, double &alamda, - bool deriv); - void mrqmin(double a[], int ia[], int ma, double **covar, - double **alpha, double *chisq, double *alamda, bool deriv); - void mrqcof(double*, int*, int, double**, double*, double*, bool deriv); - void fill_variables(vector a); - int getnpar() { return nset*n_ex + nphase*n_st + total*n_at; } - - public: - - Phase* curphase; - PdfFit(); - ~PdfFit(); - - void alloc(char tp, double qmax, double qdamp, - double rmin, double rmax, int bin); - void calc(); - int read_struct(string fname); // returns 1:OK, 0:Error - int read_data(string fname, char tp, double qmax, double qdamp); - //Wed Oct 12 2005 - CLF - int read_struct_string(char * buffer); // returns 1:OK, 0:Error - int read_data_string(string& buffer, char tp, double qmax, double - qdamp, string name = "string"); - int read_data_arrays(char tp, double qmax, double qdamp, int length, - double * r_data, double * Gr_data, double * dGr_data = NULL, - string name = "array"); - void reset(); - //Thu Oct 13 2005 - CLF - string save_pdf(int iset, string fname = ""); - string save_dif(int iset, string fname = ""); - string save_res(string fname = ""); - string save_struct(int ip, string strucfile = ""); - string show_struct(int ip); - // - int refine(bool deriv, double toler = 0.00000001); - int refine_step(bool deriv, double toler = 0.00000001); - double getrw(void) - { - return fit.fit_rw; - } - void setpar(unsigned int pidx, double val) - { - fit.setpar(pidx, val); - } - void setpar(unsigned int pidx, RefVar v) - { - fit.setpar(pidx, *v.a); - } - double getpar(unsigned int pidx) - { - return fit.getpar(pidx); - } - void fixpar(int pidx) - { - fit.fixpar(pidx); - } - void freepar(int pidx) - { - fit.freepar(pidx); - } - void range(int iset, double rmin, double rmax); - - void constrain(RefVar v, double f(vector&, vector&)) - { - fit.constrain(*v.a,f); - } - void constrain(RefVar v, string form) - { - fit.constrain(*v.a,form); - } - void constrain(RefVar v, int ipar) - { - fit.constrain(*v.a,ipar); - } - void constrain(RefVar v, int ipar, FCON type) - { - fit.constrain(*v.a,ipar,type); - } - void setphase(int ip); - void setdata(int is); - void setvar(RefVar v, double a) { v.setval(a); } - double getvar(RefVar v) { return v.get(); } - void setvar(NonRefVar v, double a) { v.setval(a); } - double getvar(NonRefVar v) { return v.get(); } - - void selphase(int ip); - void pdesel(int ip); - Phase* getphase(int ip); - int num_phases() { return this->nphase; } - int num_datasets() { return this->nset; } - - private: - - void check_sel_args(int ip, char ijchar, int aidx1=1); - void selphaseForEachDataSet(Phase*); - - public: - - void selectAtomType(int ip, char ijchar, char* symbol, bool select); - void selectAtomIndex(int ip, char ijchar, int aidx1, bool select); - void selectAll(int ip, char ijchar); - void selectNone(int ip, char ijchar); - - pair bond_angle(int ia, int ja, int ka); - PairDistance bond_length_atoms(int ia, int ja); - vector bond_length_types(string symi, string symj, - double bmin, double bmax); - - vector getpdf_obs(); - vector getpdf_fit(); - - // current phase and set refinable variable pointers - vector lat, x, y, z, u11, u22, u33, u12, u13, u23, occ; - RefVar pscale; - RefVar spdiameter; - NonRefVar stepcut; - RefVar sratio; - RefVar delta2, delta1; - RefVar dscale, qdamp, qbroad; - NonRefVar rcut; - int getnfmin(); - int getnfmax(); - double getdeltar(); - double getrmin(); - double getrmax(); - vector getcrw() const; - map > getPhaseFractions(); - double get_scat(char tp, string smbpat); -}; - -class Pdf -{ - public: - - int nfmin, nfmax, ncmin, ncmax; - double qmax, qdamp, rmin, rmax, deltar; - double rfmin, rfmax; // fit range - double rcmin, rcmax; // extended calculation range - double dscale, ddscale, qbroad, dqbroad, dqdamp; - - Pdf() - { - nfmin = nfmax = ncmin = ncmax = 0; - qmax = qdamp = rmin = rmax = deltar = 0.0; - rfmin = rfmax = rcmin = rcmax = 0.0; - dscale = 0.0; ddscale = 0.0; - qbroad = dqbroad = dqdamp = 0.0; - } - - vector pdftot; // total pdf - matrix calc; // ?? pdf for each phase and each point in the dataset -}; - -class DataSet: public Pdf -{ - - private: - int offset; - const PdfFit* mowner; - void applyQmaxCutoff(double* y, size_t len); - void extendCalculationRange(bool lout); - string selectedAtomsString(int ip, char ijchar); - void read_data_stream(int iset, istream& fdata, - char tp, double qmax, double qdamp, string name); - void warningOnMissingWeights() const; - - public: - - int iset; // Dataset index - char scattering_type; - string name; - - DataSet(const PdfFit* owner) : Pdf(), mowner(owner) - { - dscale = 1.0; ddscale = 0; - qbroad = dqbroad = 0.0; - }; - // pdf-related - void determine(bool ldiff, bool lout, Fit &par); - void pdf_derivative (Phase& phase, - const Atom& atomi, const Atom& atomj, double rk, double sigma, - double sigmap, double dist, double d[3], double ampl, - double gaus, Fit &fit, double* fit_a_i); - - const vector& getpdf_fit(); - const vector& getpdf_obs(); - //Thu Oct 13 2005 - CLF - string build_pdf_file(); - string build_dif_file(); - // - void read_data(int iset, string fname, char tp, double qmax, double qdamp); - //Wed Oct 12 2005 - CLF - void read_data_string(int iset, string& buffer, char tp, double qmax, double qdamp, - string name = "string"); - void read_data_arrays(int iset, char tp, double qmax, double qdamp, - int length, double * r_data, double * Gr_data, double * dGr_data = NULL, string name = "array"); - // - //Thu Oct 13 2005 - CLF - void output(ostream &fout); - void range(double rmin, double rmax); - - void fit_setup_derivatives(Fit &par); - void selphase(int ip, Phase *phase); - - vector getcrw() const; - double weighedSquareObs() const; - double getdsrw() const; - double getdsredchisq() const; - - // phase fraction calculations - vector< pair > getAtomPhaseFractions(); - vector< pair > getCellPhaseFractions(); - vector< pair > getMassPhaseFractions(); - - // fit related - matrix fit_a, fit_b; // nbin*npar - - int bin; - vector obs, wic; - - // phase specific information this dataset: selected, allowed atoms - vector psel; // phase selection - // i and j indices to be ignored when calculating PDF - map > phase_ignore_i; - map > phase_ignore_j; - vector cumchisq; - friend void PdfFit::fit_setup(); - -}; - -class Phase { - - private: - - // data - string spcgr, name; - int offset; - LocalPeriodicTable _local_periodic_table; - - double ar[3], wrez[3], dar[3], dwrez[3]; - double gten[3][3], dgten[3][3]; // tensor and sd - double rten[3][3], drten[3][3]; // tensor and sd - double _eps[3][3][3], _reps[3][3][3], _deps[3][3][3], _dreps[3][3][3]; - double &eps(int i, int j, int k) { return _eps[i][j][k]; } - double &reps(int i, int j, int k) { return _reps[i][j][k]; } - double &deps(int i, int j, int k) { return _deps[i][j][k]; } - double &dreps(int i, int j, int k) { return _dreps[i][j][k]; } - - // methods - - set selectAtomsOf(string symbol); - - // Added a return value - string get_scat_string(char tp, const AtomType* atp); - - // shift to equivalent lattice position nearest to the origin - void make_nearest(double xyz[3]); - - public: - - vector atom_types; - int iphase; - double cosa, cosb, cosg, sina, sinb, sing; - double v, dv, vr, dvr; - int icc[3]; - // Phase has a number of public elements as it is often cross-referenced - - int natoms; // total number of atoms in multicell icc0 x icc1 x icc2 - int ncatoms; // number of atoms in one cell - - // IMPORTANT: atom[i].atom_type must be a pointer to AtomType - // from _local_periodic_table. Insertion of a new entry to - // vector atom must be followed by reassign_atom_type(entry); - vector atom; - - double pscale, dpscale; - double a0[3], win[3], da0[3], dwin[3]; - double np, dnp, rho0, drho0; // np: total occupance, rho0: number density - - // pdf-related - double delta2, sratio, rcut; - double ddelta2, dsratio, delta1, ddelta1; - double spdiameter, dspdiameter; // spherical particle diameter - double stepcut; - double dnorm, corr_max; - - - Phase() - { - pscale = 1.0; dpscale = 0.0; - sratio=1.0; - a0[0] = a0[1] = a0[2] = da0[0] = da0[1] = da0[2] = - win[0] = win[1] = win[2] = dwin[0] = dwin[1] = dwin[2] = - delta2 = ddelta2 = dsratio = rcut = 0.0; - delta1 = ddelta1 = corr_max = 0.0; - spdiameter = dspdiameter = 0.0; - stepcut = 0.0; - icc[0] = icc[1] = icc[2] = ncatoms = natoms = 0; - spcgr = "P1"; - name = "UNNAMED"; - } - inline size_t nscat() - { - return atom_types.size(); - } - void read_struct(int iphase, string fname); - void read_struct_string(int iphase, char * buffer); - private: - void read_struct_stream(int _iphase, istream& fstruct); - void read_header(istream &fstruct, bool &ldiscus); - void read_atoms(istream &fstruct); - // Reset atom_type to point to an entry from _local_periodic_table - void reassign_atom_type(Atom* ap); - - public: - //Thu Oct 13 2005 - CLF - void output(ostream &fout); - template void save_struct(Stream &fout); - - void lattice(); - void show_lattice(); - void tensor(double ten[3][3], double vec[3], double win[3]); - void dtensor(double vec[3], double win[3], double dten[3][3], double dvec[3], double dwin[3]); - - double skalpro(const double h[3], const double k[3]); - double dskalpro(double h[3], double k[3], double dh[3], double dk[3]); - - double circum_diameter(); // diameter of a sphere enclosing unit cell - // mean square displacement of 2 atoms - double msdAtoms(const Atom& ai, const Atom& aj, double* vl); - // reference to the local periodic table - LocalPeriodicTable* getPeriodicTable(); - - // pdf-related - - double averageAtomicMass(); - double averageScatteringFactor(char tp); - void setup_weights(char tp); - - pair bond_angle(int ia, int ja, int ka); - PairDistance bond_length_atoms(int ia, int ja); - vector bond_length_types(string symi, string symj, - double bmin, double bmax); - // Fri Oct 28 2005 - CLF - // Added a return value - void show_scat(char tp); - string get_scat_string(char tp); - string get_scat_string(char tp, string smbpat); - void set_scat(char tp, const string& smbpat, double value); - void reset_scat(const string& smbpat); - - friend class Atom; - friend class DataSet; - friend void PdfFit::fit_setup(); - friend void DataSet::fit_setup_derivatives(Fit &par); - friend void DataSet::determine(bool ldiff, bool lout, Fit &par); - friend void DataSet::pdf_derivative (Phase& phase, - const Atom& atomi, const Atom& atomj, double rk, double sigma, - double sigmap, double dist, double d[3], double ampl, - double gaus, Fit &fit, double* fit_a_i); - friend void PdfFit::fit_theory(bool ldiff, bool lout); -}; - - -#endif // PDFFIT_H_INCLUDED diff --git a/libpdffit2/pdflsmin.cc b/libpdffit2/pdflsmin.cc deleted file mode 100644 index 078d2754..00000000 --- a/libpdffit2/pdflsmin.cc +++ /dev/null @@ -1,326 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* PdfFit methods for Levenberg-Marquardt least-squares minimization. -* -* Comments: -* -***********************************************************************/ - -//#define CHECK_DERIVATIVES - -#include -#include -#include -#include -#include - -#include "MathUtils.h" -#include "matrix.h" -#include "nrutil.h" -#include "pdffit.h" - -using NS_PDFFIT2::pout; - -void PdfFit::mrqmin(vector &a, vector &ia, matrix &covar, - matrix &alpha, double &chisq, double &alamda, bool deriv) -{ - using std::copy; - - int ma = a.size(); - double** _covar = new double*[ma]; - double** _alpha = new double*[ma]; - double* _a = new double[ma]; - - copy(a.begin(), a.end(), _a); - - for (int i = 0; i < ma; i++) - { - _covar[i] = &covar[i][0]-1; - _alpha[i] = &alpha[i][0]-1; - } - - int* iaptr = ia.size() ? &(ia[0]) - 1 : NULL; - mrqmin(_a-1, iaptr, ma, _covar-1, _alpha-1, &chisq, &alamda, deriv); - - copy(_a, _a + ma, a.begin()); - - delete [] _a; - delete [] _alpha; - delete [] _covar; -} - - -// Levenberg-Marquardt method, attempting to reduce the value Chi2 of a fit -// between a set of data points x[1..ndata], y[1..ndata] with individual -// standard deviations sig[1..ndata], and a nonlinear function dependent on ma -// coeffcients a[1..ma]. The input array ia[1..ma] indicates by nonzero -// entries those components of a that should be fitted for, and by zero entries -// those components that should be held fixed at their input values. The -// program re- turns current best-fit values for the parameters a[1..ma], and -// Chi2=chisq. The arrays covar[1..ma][1..ma], alpha[1..ma][1..ma] are used as -// working space during most iterations. Supply a routine -// funcs(x,a,yfit,dyda,ma) that evaluates the fitting function yfit, and its -// derivatives dyda[1..ma] with respect to the fitting parameters a at x. On -// the first call provide an initial guess for the parameters a, and set -// alamda<0 for initialization (which then sets alamda=.001). If a step -// succeeds chisq becomes smaller and alamda de- creases by a factor of 10. If -// a step fails alamda grows by a factor of 10. You must call this routine -// repeatedly until convergence is achieved. Then, make one final call with -// alamda=0, so that covar[1..ma][1..ma] returns the covariance matrix, and -// alpha the curvature matrix. (Parameters held fixed will return zero -// covariances.) -void PdfFit::mrqmin(double a[], int ia[], int ma, double **covar, double **alpha, double *chisq, double *alamda, bool deriv) -{ - void covsrt(double **covar, int ma, int ia[], int mfit); - void gaussj(double **a, int n, double **b, int m); - - int j, k, l; - static int mfit; - static double ochisq, *atry, *beta, *da, **oneda; - - if (*alamda < 0.0) - { - // Initialization. - atry = dvector(1, ma); - beta = dvector(1, ma); - da = dvector(1, ma); - - for (mfit = 0, j = 1; j <= ma; j++) - if (ia[j]) mfit++; - - oneda = dmatrix(1, mfit, 1, 1); - *alamda = 0.001; - mrqcof(a, ia, ma, alpha, beta, chisq, deriv); - ochisq=(*chisq); - for (j = 1; j <= ma; j++) atry[j]=a[j]; - - *pout << "\n******************************** ITER: " << fit.iter << " ********************************\n"; - fit.fit_rw = sqrt(ochisq/fit.wnorm); - fit.redchisq = ochisq/(fit.ntot-fit.ndof); - fit.out(); - *pout << " chisq.: " << ochisq << " red.chisq.: " << fit.redchisq << " Rw: " << fit.fit_rw << endl; - } - // Alter linearized fitting matrix, by augmenting diagonal elements. - for (j = 1; j <= mfit; j++) - { - for (k = 1; k <= mfit; k++) covar[j][k]=alpha[j][k]; - covar[j][j]=alpha[j][j]*(1.0+(*alamda)); - oneda[j][1]=beta[j]; - } - - //=================================================================== -#if defined(TEST) - print(covar, mfit); double **save = dmatrix(1, mfit, 1, mfit); - for(int i = 1; i <= mfit; i++) for(j = 1; j <= mfit; j++) save[i][j] = covar[i][j]; - for(int i = 1; i <= mfit; i++) printf("%lg ", oneda[i][1]); printf("\n"); -#endif - //=================================================================== - - gaussj(covar, mfit, oneda, 1); // Matrix solution. - - //=================================================================== -#if defined(TEST) - double res; - for(int i = 1; i <= mfit; i++) - { - res = 0; - for(j = 1; j <= mfit; j++) - res += save[i][j]*oneda[j][1]; printf("%lg ", res); - } - printf("\n"); -#endif - //================================================================= - - for (j = 1; j <= mfit; j++) da[j]=oneda[j][1]; - if (*alamda == 0.0) { // Once converged, evaluate covariance matrix. - covsrt(covar, ma, ia, mfit); - covsrt(alpha, ma, ia, mfit); // Spread out alpha to its full size too. - free_dmatrix(oneda, 1, mfit, 1, 1); - free_dvector(da, 1, ma); - free_dvector(beta, 1, ma); - free_dvector(atry, 1, ma); - return; - } - for (j = 0, l = 1; l <= ma; l++) // Did the trial succeed? - if (ia[l]) atry[l]=a[l]+da[++j]; - mrqcof(atry, ia, ma, covar, da, chisq, deriv); - if (*chisq < ochisq) { // Success, accept the new solution. - *alamda *= 0.1; - ochisq=(*chisq); - for (j = 1; j <= mfit; j++) { - for (k = 1; k <= mfit; k++) alpha[j][k]=covar[j][k]; - beta[j]=da[j]; - } - for (l = 1; l <= ma; l++) a[l]=atry[l]; - } else { // Failure, increase alamda and return. - *alamda *= 10.0; - *chisq = ochisq; - } -} - -// Used by mrqmin to evaluate the linearized fitting matrix alpha, and -// vector beta as in (15.5.8), and calculate Chi2. -void PdfFit::mrqcof(double a[], int ia[], int ma, double **alpha, double beta[], double *chisq, bool deriv) -{ - int i, j, k, l, m, mfit = 0; - double wt, sig2i, dy, *dyda; - //double ymod; - - dyda = dvector(1, ma); - for (j = 1; j <= ma; j++) - if (ia[j]) mfit++; - for (j = 1; j <= mfit; j++) { // Initialize (symmetric) alpha, beta. - for (k = 1; k <= j; k++) alpha[j][k]=0.0; - beta[j]=0.0; - } - - // careful: a of mrqcof is in fact atry of mrqmin! - for (j = 1; j <= ma; j++) - fit.p[j-1] = a[j]; - - // printf("a=%.12lg %.12lg %.12lg\n", a[1], a[2], a[3]); - - fit_theory(deriv, false); // yields pdftot and derivatives wrt parameters - - //============================================================================= -#if !defined(CHECK_DERIVATIVES) - // deriv: true for analytic derivatives, false for numerical ones - if (!deriv) -#endif - { -#if defined(CHECK_DERIVATIVES) - matrix dersave = datasets[0]->fit_b; -#endif - - // numerical derivative - vector > pdfsave; - for (int is = 0; is < nset; is++) - { - pdfsave.push_back(datasets[is]->pdftot); - - // fit_b used both in numerical and analytical derivative case - datasets[is]->fit_b.clear(); - datasets[is]->fit_b.resize(datasets[is]->ncmax+1, fit.psize()); - } - - double psave; - - if (fit.psize() != ma) { - throw constraintError("Inconsistent number of parameters"); - } - - for (int ip = 0; ip < fit.psize(); ip++) - { - if (!fit.ip[ip]) continue; - - double delta = double_eps*fit.p[ip]; - if (fabs(delta) < double_eps/100) delta = double_eps; - psave = fit.p[ip]; - fit.p[ip] += delta; - fit_theory(false, false); // yields pdftot and derivatives wrt parameters - fit.p[ip] = psave; - - for (int is = 0; is < nset; is++) - { - DataSet* pds = this->datasets[is]; - - for (i = pds->nfmin; i <= pds->nfmax; i++) - { - pds->fit_b[i][ip] = (pds->pdftot[i]-pdfsave[is][i])/delta; - } - } - -#if defined(CHECK_DERIVATIVES) - i = 200; - { - *pout << "DERIVATIVES:: ANALYTIC : " << dersave[i][ip] << endl; - *pout << " NUMERICAL: " << (datasets[0]->pdftot[i]-pdfsave[0][i])/delta - << " (delta[" << fit.id[ip] << "]=" << delta << ")" << endl << endl; - } -#endif - } - for (int is = 0; is < nset; is++) datasets[is]->pdftot = pdfsave[is]; - -#if defined(CHECK_DERIVATIVES) - exit(0); -#endif - } - //============================================================================= - - *chisq = 0.0; - - for (int is = 0; is < nset; is++) - { - DataSet* pds = this->datasets[is]; - pds->cumchisq.clear(); - - for (i = pds->nfmin; i <= pds->nfmax; i++) - { // Summation loop over all data. - - //(*funcs)(x[i], a, &ymod, dyda, ma); - sig2i = pds->wic[i]; - dy = pds->obs[i] - pds->pdftot[i]; - - for (j = 1; j <= ma; j++) - dyda[j] = pds->fit_b[i][j-1]; // of course use fit_b, NOT fit_a - - //if (i==0) printf("dyda=%.12lg %.12lg %.12lg\n", dyda[1], dyda[2], dyda[3]); - - for (j = 0, l = 1; l <= ma; l++) { - if (ia[l]) { - wt = dyda[l]*sig2i; - for (j++, k = 0, m = 1; m <= l; m++) - if (ia[m]) alpha[j][++k] += wt*dyda[m]; - beta[j] += dy*wt; - } - } - double prev = pds->cumchisq.empty() ? 0.0 : pds->cumchisq.back(); - double chisq_contribution = dy * dy * sig2i; - pds->cumchisq.push_back(prev + chisq_contribution); - } - *chisq += pds->cumchisq.empty() ? 0.0 : pds->cumchisq.back(); - } - for (j = 2; j <= mfit; j++) // Fill in the symmetric side. - for (k = 1; k < j; k++) alpha[k][j]=alpha[j][k]; - free_dvector(dyda, 1, ma); - //print(alpha, ma); -} - - -// Expand in storage the covariance matrix covar, so as to take into account -// parameters that are being held fixed. (For the latter, return zero -// covariances.) -void covsrt(double **covar, int ma, int ia[], int mfit) -{ - int i, j, k; - for (i = mfit+1; i <= ma; i++) - { - for (j = 1; j <= i; j++) - { - covar[i][j]=covar[j][i]=0.0; - } - } - k = mfit; - for (j = ma; j >= 1; j--) { - if (ia[j]) - { - for (i = 1; i <= ma; i++) swap(covar[i][k], covar[i][j]); - for (i = 1; i <= ma; i++) swap(covar[k][i], covar[j][i]); - k--; - } - } -} - -// End of file diff --git a/libpdffit2/scatlen.cc b/libpdffit2/scatlen.cc deleted file mode 100644 index 81beee03..00000000 --- a/libpdffit2/scatlen.cc +++ /dev/null @@ -1,114 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Phase methods for accessing scattering factors. -* -* Comments: Up to date with 1.3.10 Fortran version. -* In Fortran this was fourier.f -* -***********************************************************************/ - -#include -#include - -#include "LocalPeriodicTable.h" -#include "StringUtils.h" -#include "pdffit.h" - -using NS_PDFFIT2::pout; - -void Phase::show_scat(char tp) -{ - *pout << get_scat_string(tp); -} - -string Phase::get_scat_string(char tp) -{ - stringstream sout; - vector::iterator atp; - for (atp = atom_types.begin(); atp != atom_types.end(); ++atp) - { - sout << get_scat_string(tp, *atp); - } - return sout.str(); -} - -string Phase::get_scat_string(char tp, string smbpat) -{ - const LocalPeriodicTable* lpt = getPeriodicTable(); - const AtomType* atp = lpt->lookup(smbpat); - return get_scat_string(tp, atp); -} - -string Phase::get_scat_string(char tp, const AtomType* atp) -{ - stringstream sout; - string usymbol = toupper(atp->symbol); - switch(tp) - { - case 'n': - case 'N': - sout << "Neutron scattering length for " << usymbol << " : "; - break; - case 'x': - case 'X': - sout << "X-ray scattering factor for " << usymbol << " : "; - break; - } - // this also throws runtime_error for invalid tp value - sout << atp->sf(tp); - return sout.str(); -} - -void Phase::set_scat(char tp, const string& smbpat, double value) -{ - LocalPeriodicTable* lpt = getPeriodicTable(); - const string& stdsmbl = lpt->lookup(smbpat)->symbol; - switch (tp) - { - case 'n': - case 'N': - lpt->setNsf(stdsmbl, value); - break; - case 'x': - case 'X': - lpt->setXsf(stdsmbl, value); - break; - default: - ostringstream emsg; - emsg << "Invalid scattering type '" << tp << "'"; - throw runtime_error(emsg.str()); - } - const AtomType* atp = lpt->symbol(stdsmbl); - *pout << get_scat_string(tp, atp); -} - -void Phase::reset_scat(const string& smbpat) -{ - LocalPeriodicTable* lpt = getPeriodicTable(); - const AtomType* atp = lpt->lookup(smbpat); - const string& stdsmbl = atp->symbol; - lpt->reset(stdsmbl); - *pout << get_scat_string('N', stdsmbl); - *pout << get_scat_string('X', stdsmbl); -} - - -LocalPeriodicTable* Phase::getPeriodicTable() -{ - return &this->_local_periodic_table; -} - - -// End of file diff --git a/libpdffit2/stru.cc b/libpdffit2/stru.cc deleted file mode 100644 index f9022f23..00000000 --- a/libpdffit2/stru.cc +++ /dev/null @@ -1,837 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Jacques Bloch -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* PdfFit and Phase methods for reading and saving the structure, -* and for calculating bond lengths and angles. -* -* Comments: -* -***********************************************************************/ - -// Up to date with 1.3.10 Fortran version - -#include -#include -#include -#include - -#include "PointsInSphere.h" -#include "LocalPeriodicTable.h" -#include "Atom.h" -#include "StringUtils.h" -#include "PairDistance.h" -#include "MathUtils.h" -#include "pdffit.h" - -using NS_PDFFIT2::pout; - - -/*********************************************************************** -* local helper routines -***********************************************************************/ - -namespace { - -// Read a number and an eventual comma delimiter or EOF -template Type vget(istringstream &fin, char delim) -{ - char c; - Type val; - - fin >> val; - - // Return if reading error - if (!fin) { - string line; - fin.clear(); - fin >> line; - throw vgetException(line); - } - if (!fin) return 0; - - // check on end of file before looking for delimiter - if (fin.eof()) return val; - - // read eventual delimiter - fin >> c; - - // if a character c has been read and it is not the expected - // delimiter: put back for next reading - if (fin && c != delim) fin.unget(); - - // clear any error in case no delimiter could be read - if (!fin) fin.clear(); - - return val; -} - -// read space delimited value -template Type vget(istringstream &fin) -{ - Type val; - fin >> val; - return val; -} - -// read space or comma delimited double -double dget(istringstream &fin) -{ - return vget(fin, ','); -} - -// read space or comma delimited integer -int iget(istringstream &fin) -{ - return vget(fin, ','); -} - - -// strip leading spaces -string lstrip(const string &line) -{ - string naked; - string::size_type i = line.find_first_not_of(" \t"); - if (i != string::npos) naked = line.substr(i); - return naked; -} - -// substitute all occurences of literal pattern with new string -void substitute(string& s, const string& pat, const string& sub) -{ - string::size_type p; - string::size_type start = 0; - for (p = s.find(pat, start); p != string::npos; p = s.find(pat, start)) - { - s = s.replace(p, pat.size(), sub); - start = p + sub.size(); - } -} - - -} // local namespace - - -/*********************************************************************** -* Read a structure file. -***********************************************************************/ -int PdfFit::read_struct(string structfile) -{ - Phase* ph = new Phase(); - try { - ph->read_struct(nphase+1, structfile); - } - catch(Exception e) { - delete ph; - // Moved error catching to python bindings. - throw; - } - this->phase.push_back(ph); - this->total += ph->natoms; - this->nphase++; - this->selphaseForEachDataSet(ph); - this->setphase(this->nphase); - ph->show_lattice(); - return 1; -} - -/*********************************************************************** - Wed Oct 12 2005 - CLF - Read a structure from a storage string. -*************************************************************************/ -int PdfFit::read_struct_string(char * buffer) -{ - Phase* ph = new Phase(); - try { - ph->read_struct_string(nphase+1, buffer); - } - catch(Exception e) { - delete ph; - throw; - } - this->phase.push_back(ph); - this->total += ph->natoms; - this->nphase++; - this->selphaseForEachDataSet(ph); - this->setphase(this->nphase); - ph->show_lattice(); - return 1; -} - -void Phase::read_struct(int _iphase, string structfile) -{ - ifstream fstruct; - - fstruct.open(structfile.c_str()); - if (!fstruct) throw IOError("File does not exist"); - - read_struct_stream(_iphase, fstruct); -} - -void Phase::read_struct_string(int _iphase, char * buffer) -{ - istringstream fstruct(buffer); - read_struct_stream(_iphase, fstruct); -} - -void Phase::read_struct_stream(int _iphase, istream& fstruct) -{ - double tot; - bool ldiscus; - - iphase = _iphase; - natoms = 0; - - read_header(fstruct, ldiscus); - - if (ldiscus) - { - *pout << " Structure file format : DISCUS (converting B -> Uij) \n"; - Atom::streamformat = Atom::DISCUS; - } - else - { - *pout << " Structure file format : PDFFIT\n"; - Atom::streamformat = Atom::PDFFIT; - } - - read_atoms(fstruct); - // update atom_types - atom_types.clear(); - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - if (!count(atom_types.begin(), atom_types.end(), ai->atom_type)) - { - atom_types.push_back(ai->atom_type); - } - } - - lattice(); - - tot = icc[0]*icc[1]*icc[2]*ncatoms; - - if (tot != natoms) - { - throw structureError("Inconsistent # of atoms in structure"); - } -} - - -/****************************************************************** - This subroutine reads the header of a structure file - Wed Oct 12 2005 - CLF - Changed ifstream to istream to accomodate stringstreams - as well. -********************************************************************/ - -void Phase::read_header(istream &fstruct, bool &ldiscus) -{ - string ier_msg; - string befehl, line; - - - // initialize format type to discuss format - ldiscus = true; - - /* parse structure file header and fill phase variables */ - - while (getline(fstruct, line)) - { - istringstream sline(line); - string action; - - // try to read a command from structure file - // if an error occurs, an exception will be caught - try{ - sline >> befehl; - - // get out if we get to atom positions - if (befehl == "atoms") break; - - // skip comments, i.e., when befehl starts with '#' - else if (befehl.find('#') == 0) continue; - - // format - else if (befehl == "format") - { - string format; - sline >> format; - ldiscus = (format != "pdffit"); - } - - // scale factor (PDFFIT) - else if (befehl == "scale") - { - action = "Reading scale factor"; - this->pscale = dget(sline); - this->dpscale = 0.0; - if (!sline) - { - throw structureError(action); - } - } - - // peak sharpening factors (PDFFIT) - else if (befehl == "sharp") - { - action = "reading sharpening parameters"; - double v0 = 0.0, v1 = 0.0, v2 = 0.0, v3 = 0.0; - // at least 3-parameters must be read without error - v0 = dget(sline); - v1 = dget(sline); - v2 = dget(sline); - // we have new format if we can read the 4th parameter - try { - v3 = dget(sline); - delta2 = v0; - delta1 = v1; - sratio = v2; - rcut = v3; - } - // if reading of 4th parameter fails, assume old format - catch(vgetException) { - delta2 = v0; - delta1 = 0.0; - sratio = v1; - rcut = v2; - } - ddelta2 = 0.0; - dsratio = 0.0; - ddelta1 = 0.0; - } - - // space group symbol (only to save it later for DISCUS use) - else if (befehl == "spcgr") - { - sline >> spcgr; - } - - // particle shape corrections - else if (befehl == "shape") - { - action = "reading particle shape correction data"; - string shapedata; - getline(sline, shapedata); - substitute(shapedata, ",", " "); - istringstream shapestream(shapedata); - string w; - shapestream >> w; - if (w == "sphere") - { - this->spdiameter = dget(shapestream); - } - else if (w == "stepcut") - { - this->stepcut = dget(shapestream); - } - else - { - ostringstream emsg; - emsg << " Unknown shape correction: " << w; - throw structureError(emsg.str()); - } - } - - // title / name for structure - else if (befehl == "title") - { - getline(sline, name); - // getline keeps leading whitespace - name = lstrip(name); - } - - // cell constants - else if (befehl == "cell") - { - action = "reading unit cell parameters"; - a0[0] = dget(sline); - a0[1] = dget(sline); - a0[2] = dget(sline); - win[0] = dget(sline); - win[1] = dget(sline); - win[2] = dget(sline); - } - - // standard deviation of cell constants - else if (befehl == "dcell") - { - action = "reading standard deviation of unit cell parameters"; - da0[0] = dget(sline); - da0[1] = dget(sline); - da0[2] = dget(sline); - dwin[0] = dget(sline); - dwin[1] = dget(sline); - dwin[2] = dget(sline); - } - - // crystal dimensions and number of atoms per unit cell 'ncell' - else if (befehl == "ncell") - { - action = "reading # atoms/unit cell"; - icc[0] = iget(sline); - icc[1] = iget(sline); - icc[2] = iget(sline); - ncatoms = iget(sline); - } - - // show warning message otherwise - else - { - *pout << " ****WARN**** Unknown keyword: " << - befehl << " (ignored) ****\n"; - } - } // end of try - // catch vget-exception and throw the specific exception - catch(vgetException e) { throw structureError(action+e.GetMsg()); } - } -} - -void Phase::read_atoms(istream& fstruct) -{ - Atom a; - while (fstruct >> a) - { - reassign_atom_type(&a); - this->atom.push_back(a); - natoms++; - } - return; -} - - -void Phase::reassign_atom_type(Atom* ap) -{ - LocalPeriodicTable* lpt = getPeriodicTable(); - const string& smbl = ap->atom_type->symbol; - ap->atom_type = lpt->symbol(smbl); -} - - - -/******************************************* -c------ - Save structure for given phase - Thu Oct 13 2005 - CLF - Changed code to return a string of the - saved file. Actually saving the file is - optional. -*******************************************/ -string PdfFit::show_struct(int ip) -{ - string filestring = save_struct(ip,""); - return filestring; -} - -string PdfFit::save_struct(int ip, string strucfile) -{ - - stringstream outfilestream; - - if ( (ip < 1) || (ip > nphase) ) - { - throw unassignedError("phase does not exist"); - } - else - { - bool ldiscus=false; - ofstream fout; - - if (!strucfile.empty()) - { - if (ldiscus) - *pout << " Saving structure (DISCUS format) phase " << ip - << " to file : " << strucfile << endl; - else - *pout << " Saving structure phase " << ip << " to file : " - << strucfile << endl; - - phase[ip-1]->save_struct(outfilestream); - - fout.open(strucfile.c_str()); - if (!fout) { - throw IOError("cannot create output file"); - } - fout << outfilestream.str(); - fout.close(); - } - else - { - phase[ip-1]->save_struct(outfilestream); - } - } - - return outfilestream.str(); -} - -/*************************************************************** -c This subroutine saves the structure and/or the unit cell -c onto a file. The format uses keyword description. -****************************************************************/ -template void Phase::save_struct(Stream &fout) -{ - const double fac = 8.0*M_PI*M_PI /3.0; - bool ldis=false; - - // -- Write new type of structure file - - fout << "title " << name << endl; - - fout << setprecision(6) << fixed; - - if (!ldis) - { - fout << "format pdffit" << endl; - fout << "scale " << setw(9) << pscale << endl; - fout << "sharp " << setw(9) << delta2 << ", " << setw(9) << delta1 << ", " - << setw(9) << sratio << ", " << setw(9) << rcut << endl; - } - - fout << "spcgr " << spcgr << endl; - - if (spdiameter > 0.0) - { - fout << "shape sphere, " << spdiameter << endl; - } - - if (stepcut > 0.0) - { - fout << "shape stepcut, " << stepcut << endl; - } - - fout << "cell "; - for (int i=0; i<3; i++) - fout << setw(9) << a0[i] << ", "; - - for (int i=0; i<3; i++) - { - fout << setw(9) << win[i]; - if (i!=2) - fout << ", "; - else - fout << endl; - } - - if (!ldis) - { - fout << "dcell "; - for (int i=0; i<3; i++) - fout << setw(9) << da0[i] << ", "; - - for (int i=0; i<3; i++) - { - fout << setw(9) << dwin[i]; - if (i!=2) - fout << ", "; - else - fout << endl; - } - } - - fout << "ncell "; - for (int i=0; i<3; i++) - fout << setw(9) << icc[i] << ", "; - fout << setw(9) << ncatoms << endl; - - fout << "atoms" << endl; - for (VAIT ai = atom.begin(); ai != atom.end(); ++ai) - { - - if (ldis) - { - double dw = fac*(ai->u[1]+ai->u[2]+ai->u[3]); - fout << setw(4) << left << ai->atom_type->symbol; - fout << right << setprecision(8); - for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->pos[i]; - fout << ' ' << setw(12) << dw << endl; - } - else - { - fout << setw(4) << left << ai->atom_type->symbol; - fout << right << setprecision(8); - for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->pos[i]; - fout << ' ' << setw(12) << setprecision(4) << ai->occ << endl; - - fout << " "; - fout << setprecision(8); - for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->dpos[i]; - fout << ' ' << setw(12) << setprecision(4) << ai->docc << endl; - - fout << " "; - fout << setprecision(8); - for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->u[i]; - fout << endl; - - fout << " "; - for (int i=0; i<3; i++) fout << ' ' << setw(17) << ai->du[i]; - fout << endl; - - fout << " "; - for (int i=3; i<6; i++) fout << ' ' << setw(17) << ai->u[i]; - fout << endl; - - fout << " "; - for (int i=3; i<6; i++) fout << ' ' << setw(17) << ai->du[i]; - fout << endl; - } - } -} - - -/*************************************** -c Calculate bond angles with errors -****************************************/ -pair PdfFit::bond_angle(int ia, int ja, int ka) -{ - if (!curphase) - { - throw unassignedError("Must read structure first"); - } - return curphase->bond_angle(ia, ja, ka); -} - -/*********************************************************************** -* shift to equivalent lattice position that is nearest to the origin -***********************************************************************/ -void Phase::make_nearest(double xyz[3]) -{ - // first shift to the first unit cell - for (int i = 0; i !=3; ++i) - { - // MS compatibility - use fmod instead of remainder - xyz[i] = fmod(xyz[i], icc[i]); - } - // that is all in orthogonal cell or if we get to the origin - if ( (xyz[0] == 0.0 && xyz[1] == 0.0 && xyz[2] == 0.0) || - (win[0] == 90.0 && win[1] == 90.0 && win[2] == 90.0) ) - { - return; - } - // otherwise we need to check all cells around - // first, let us shift to octant with xyz[i] <= 0.0 - for (int i = 0; i != 3; ++i) - { - if (xyz[i] > 0.0) xyz[i] -= icc[i]; - } - double nearest[3] = { xyz[0], xyz[1], xyz[2] }; - double mindsquare = skalpro(nearest, nearest); - double test[3]; - for (test[0] = xyz[0]; test[0] < icc[0]; test[0] += icc[0]) - { - for (test[1] = xyz[1]; test[1] < icc[1]; test[1] += icc[1]) - { - for (test[2] = xyz[2]; test[2] < icc[2]; test[2] += icc[2]) - { - double dsquare = skalpro(test,test); - if (dsquare < mindsquare) - { - copy(test, test+3, nearest); - dsquare = mindsquare; - } - } - } - } - copy(nearest, nearest+3, xyz); -} - -pair Phase::bond_angle(int ia, int ja, int ka) -{ - double x[3], y[3], dx[3], dy[3], xx, yy, xy, dxx, dyy, dxy, arg, darg, ang, dang; - - - if ( (ia < 1) || (ia > natoms) || (ja < 1) || (ja > natoms) - || (ka < 1) || (ka > natoms)) - { - stringstream eout; - eout << "Incorrect atom number(s): " << ia << ", " << ja << ", " << ka; - throw ValueError(eout.str()); - } - if ( ia == ja || ia == ka || ja == ka ) - { - stringstream eout; - eout << "All atoms must be different: " << ia << ", "; - eout << ja << ", " << ka; - throw ValueError(eout.str()); - } - - Atom& ai = atom[ia - 1]; - Atom& aj = atom[ja - 1]; - Atom& ak = atom[ka - 1]; - - for (int i=0; i<3; i++) - { - x[i] = aj.pos[i] - ai.pos[i]; - y[i] = aj.pos[i] - ak.pos[i]; - dx[i] = aj.dpos[i] + ai.dpos[i]; - dy[i] = aj.dpos[i] + ak.dpos[i]; - } - - make_nearest(x); - make_nearest(y); - xx = sqrt(skalpro(x,x)); - yy = sqrt(skalpro(y,y)); - xy = skalpro(x,y); - - dxx = 0.5/xx*dskalpro(x,x,dx,dx); - dyy = 0.5/yy*dskalpro(y,y,dy,dy); - dxy = dskalpro(x,y,dx,dy); - arg = xy/(xx*yy); - ang = acosd(arg); - darg = (1.0/(xx*yy)*dxy + arg/xx*dxx +arg/yy*dyy); - if (arg != 1.0) - dang = fabs(1.0/sqrt(1.0-arg*arg)/rad*darg); - else - dang = 0.0; - - pair rv(ang, dang); - - return rv; -} - -/*************************************** -c Calculate bond lengths with errors -****************************************/ -PairDistance PdfFit::bond_length_atoms(int ia, int ja) -{ - if (!curphase) - { - throw unassignedError("Must read structure first"); - } - return curphase->bond_length_atoms(ia, ja); -} - -PairDistance Phase::bond_length_atoms(int ia, int ja) -{ - double d[3], dd[3], dist, ddist; - - // -- Simple distance between given atoms - - if ( (ia < 1) || (ia > natoms) || (ja < 1) || (ja > natoms) ) - { - - stringstream eout; - eout << "Incorrect atom number(s): " << ia << ", " << ja; - throw ValueError(eout.str()); - } - - Atom& ai = atom[ia-1]; - Atom& aj = atom[ja-1]; - - for (int jj=0; jj<3; jj++) - { - d[jj] = ai.pos[jj] - aj.pos[jj]; - dd[jj] = ai.dpos[jj] + aj.dpos[jj]; - } - make_nearest(d); - dist = sqrt(skalpro(d,d)); - ddist = (dist > 0) ? 0.5/dist * dskalpro(d,d,dd,dd) : 0.0; - - PairDistance pd; - pd.dij = dist; - pd.ddij = ddist; - pd.i = ia; - pd.j = ja; - - return pd; -} - - -vector PdfFit::bond_length_types(string symi, string symj, - double bmin, double bmax) -{ - if (!curphase) - { - throw unassignedError("Must read structure first"); - } - return curphase->bond_length_types(symi, symj, bmin, bmax); -} - -vector Phase::bond_length_types(string symi, string symj, - double bmin, double bmax) -{ - double d[3], dd[3], dist, ddist; - set iselection, jselection; - iselection = selectAtomsOf(symi); - jselection = selectAtomsOf(symj); - - // ---- Get all bonds in specified range - - // calculate range for PointsInSphere sequencer - // (negative rsphmin is no problem) - double buffzone = circum_diameter(); - double rsphmin = bmin - buffzone; - double rsphmax = bmax + buffzone; - PointsInSphere sph( rsphmin, rsphmax, a0[0]*icc[0], - a0[1]*icc[1], a0[2]*icc[2], - win[0], win[1], win[2] ); - - // -- Loop over all atoms within the crystal - vector rv; - set::iterator ia, ja; - for (ia = iselection.begin(); ia != iselection.end(); ++ia) - { - for (ja = jselection.begin(); ja != jselection.end(); ++ja) - { - for (sph.rewind(); !sph.finished(); sph.next()) - { - for (int jj=0; jj<3; jj++) - { - d[jj] = atom[*ia].pos[jj] - atom[*ja].pos[jj] - - sph.mno[jj]*icc[jj]; - dd[jj] = atom[*ia].dpos[jj] + atom[*ja].dpos[jj]; - } - dist = sqrt(skalpro(d,d)); - if ( (dist >= bmin) && (dist <= bmax) ) - { - ddist = (dist > 0) ? 0.5/dist * dskalpro(d,d,dd,dd) : 0.0; - PairDistance pd; - pd.dij = dist; - pd.ddij = ddist; - pd.i = *ia + 1; - pd.j = *ja + 1; - rv.push_back(pd); - } - } - } - } - stable_sort(rv.begin(), rv.end()); - return rv; -} - -set Phase::selectAtomsOf(string symbol) -{ - set selection; - if (toupper(symbol) == "ALL") - { - for (size_t i = 0; i != size_t(natoms); ++i) selection.insert(i); - return selection; - } - // here we need to find AtomType - LocalPeriodicTable* lpt = getPeriodicTable(); - const AtomType* atp; - try - { - atp = lpt->lookup(symbol); - } - catch (ValueError e) - { - ostringstream emsg; - emsg << "Incorrect atom type '" << symbol << "'"; - throw ValueError(emsg.str()); - } - for (size_t i = 0; i != size_t(natoms); ++i) - { - if (atom[i].atom_type == atp) selection.insert(i); - } - return selection; -} - -// End of file diff --git a/libpdffit2/support_msvc9.h b/libpdffit2/support_msvc9.h deleted file mode 100644 index cb4bbf70..00000000 --- a/libpdffit2/support_msvc9.h +++ /dev/null @@ -1,13 +0,0 @@ -/*********************************************************************** -* Python 2.7 needs MSVC 9.0 which does not have unique_ptr. -* Work around by substituting auto_ptr instead. -***********************************************************************/ - -#ifdef _MSC_VER - -// workarounds for MSVC 9.0 -------------------------------------------- -#if _MSC_VER <= 1500 -#define unique_ptr auto_ptr -#endif - -#endif // _MSC_VER diff --git a/libpdffit2/tests/Makefile b/libpdffit2/tests/Makefile deleted file mode 100644 index f6bfe566..00000000 --- a/libpdffit2/tests/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -######################################################################## -# Targets: alltests unittests -# -# Comments: This Makefile is for building and running C++ unit tests -# on the libpdffit2 sources. Intended for developers, not for the end -# users who just want to build pdffit2 from sources. -# -######################################################################## - - -# compiler options -CPPFLAGS += -I../ $(shell cppunit-config --cflags) -LDLIBS += $(shell cppunit-config --libs) - - -# default target -all: unittest - - -# build unit test driver -alltests: alltests.cc \ - TestPointsInSphere.cc ../PointsInSphere.cc - - -# execute unit tests -unittest: alltests - ./alltests - - -# clean up any generated files -clean: - rm -f alltests diff --git a/libpdffit2/tests/TestPointsInSphere.cc b/libpdffit2/tests/TestPointsInSphere.cc deleted file mode 100644 index b82fcb31..00000000 --- a/libpdffit2/tests/TestPointsInSphere.cc +++ /dev/null @@ -1,228 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Unit tests for PointsInSphere module -* -* Comments: -* -***********************************************************************/ - -#include -#include -#include -#include - -#include "PointsInSphere.h" - -using namespace std; -using namespace NS_POINTSINSPHERE; - -namespace { - -const double eps = 1.0e-12; - -struct vidxgroup -{ - double vijk[4]; - vidxgroup(double v, int* ijk) - { - vijk[0] = v; - for (size_t i = 0; i != 3; ++i) { vijk[i+1] = ijk[i]; } - } - vidxgroup(double v, int i, int j, int k) - { - vijk[0] = v; vijk[1] = i; vijk[2] = j; vijk[3] = k; - } -}; - -bool operator<(const vidxgroup &x, const vidxgroup &y) -{ - return (x.vijk[0] < y.vijk[0] - eps) || - lexicographical_compare(x.vijk+1, x.vijk+4, y.vijk+1, y.vijk+4); -} - -bool operator==(const vidxgroup &x, const vidxgroup &y) -{ - bool eq = (fabs(x.vijk[0] - y.vijk[0]) < eps) && - equal(x.vijk+1, x.vijk+4, y.vijk+1); - return eq; -} - -ostream& operator<<(ostream &s, const vidxgroup &x) -{ - return s << "<" << x.vijk[0] << ";" << int(x.vijk[1]) - << ',' << int(x.vijk[2]) << ',' << int(x.vijk[3]) << '>'; -} - -} // namespace - -//////////////////////////////////////////////////////////////////////// -// TestPointsInSphere -//////////////////////////////////////////////////////////////////////// - -class TestPointsInSphere : public CppUnit::TestFixture -{ - - CPPUNIT_TEST_SUITE(TestPointsInSphere); - CPPUNIT_TEST(test_Cubic); - CPPUNIT_TEST(test_Orthorombic); - CPPUNIT_TEST(test_Hexagonal); - CPPUNIT_TEST(test_FCC); - CPPUNIT_TEST_SUITE_END(); - -private: - - LatticeParameters* latpar; - -public: - - void setUp() - { - latpar = new LatticeParameters(1, 1, 1, 90, 90, 90); - } - - void tearDown() - { - delete latpar; - } - -private: - - int count(double Rmin, double Rmax) - { - int c = 0; - for ( PointsInSphere sph(Rmin, Rmax, *latpar); - not sph.finished(); sph.next(), ++c ) - { } - return c; - } - - vector sortedPoints(double Rmin, double Rmax) - { - vector ridx; - for ( PointsInSphere sph(Rmin, Rmax, *latpar); - not sph.finished(); sph.next() ) - { - ridx.push_back(vidxgroup(sph.r(), sph.mno)); - } - sort(ridx.begin(), ridx.end()); - return ridx; - } - -public: - - void test_Cubic() - { - latpar->a = latpar->b = latpar->c = 1.0; - latpar->alpha = latpar->beta = latpar->gamma = 90.0; - latpar->update(); - CPPUNIT_ASSERT_EQUAL(0, count(0.0, 0.0)); - CPPUNIT_ASSERT_EQUAL(0, count(eps, 0.5)); - CPPUNIT_ASSERT_EQUAL(0, count(1.0 + eps, 1.1)); - CPPUNIT_ASSERT_EQUAL(1, count(0.0, eps)); - CPPUNIT_ASSERT_EQUAL(7, count(0.0, 1 + eps)); - CPPUNIT_ASSERT_EQUAL(19, count(0.0, sqrt(2.0) + eps)); - CPPUNIT_ASSERT_EQUAL(12, count(1.0 + eps, sqrt(2.0) + eps)); - } - - void test_Orthorombic() - { - latpar->a = 1.0; latpar->b = 2.0; latpar->c = 3.0; - latpar->alpha = latpar->beta = latpar->gamma = 90.0; - latpar->update(); - CPPUNIT_ASSERT_EQUAL(3, count(0.0, 1.1)); - CPPUNIT_ASSERT_EQUAL(4, count(1.9, 2.1)); - vidxgroup ep[] = { - vidxgroup(0, 0, 0, 0), - vidxgroup(1, -1, 0, 0), - vidxgroup(1, 1, 0, 0), - vidxgroup(2, -2, 0, 0), - vidxgroup(2, 0, -1, 0), - vidxgroup(2, 0, 1, 0), - vidxgroup(2, 2, 0, 0), - vidxgroup(sqrt(5.0), -1, -1, 0), - vidxgroup(sqrt(5.0), -1, 1, 0), - vidxgroup(sqrt(5.0), 1, -1, 0), - vidxgroup(sqrt(5.0), 1, 1, 0), - vidxgroup(sqrt(8.0), -2, -1, 0), - vidxgroup(sqrt(8.0), -2, 1, 0), - vidxgroup(sqrt(8.0), 2, -1, 0), - vidxgroup(sqrt(8.0), 2, 1, 0), - vidxgroup(3, -3, 0, 0), - vidxgroup(3, 0, 0, -1), - vidxgroup(3, 0, 0, 1), - vidxgroup(3, 3, 0, 0), - }; - vector exp_pts(ep, ep + sizeof(ep)/sizeof(vidxgroup)); - vector act_pts = sortedPoints(0.0, 3.0+eps); - CPPUNIT_ASSERT_EQUAL(exp_pts.size(), act_pts.size()); - for (size_t i = 0; i != exp_pts.size(); ++i) - { - CPPUNIT_ASSERT_EQUAL(exp_pts[i], act_pts[i]); - } - } - - void test_Hexagonal() - { - latpar->a = 1.0; latpar->b = 1.0; latpar->c = 2.0; - latpar->alpha = latpar->beta = 90.0; latpar->gamma = 120.0; - latpar->update(); - CPPUNIT_ASSERT_EQUAL(7, count(0.0, 1+eps)); - vidxgroup ep[] = { - vidxgroup(0, 0, 0, 0), - vidxgroup(1, -1, -1, 0), - vidxgroup(1, -1, 0, 0), - vidxgroup(1, 0, -1, 0), - vidxgroup(1, 0, 1, 0), - vidxgroup(1, 1, 0, 0), - vidxgroup(1, 1, 1, 0), - vidxgroup(sqrt(3.0), -2, -1, 0), - vidxgroup(sqrt(3.0), -1, -2, 0), - vidxgroup(sqrt(3.0), -1, 1, 0), - vidxgroup(sqrt(3.0), 1, -1, 0), - vidxgroup(sqrt(3.0), 1, 2, 0), - vidxgroup(sqrt(3.0), 2, 1, 0), - vidxgroup(2, -2, -2, 0), - vidxgroup(2, -2, 0, 0), - vidxgroup(2, 0, -2, 0), - vidxgroup(2, 0, 0, -1), - vidxgroup(2, 0, 0, 1), - vidxgroup(2, 0, 2, 0), - vidxgroup(2, 2, 0, 0), - vidxgroup(2, 2, 2, 0), - }; - vector exp_pts(ep, ep + sizeof(ep)/sizeof(vidxgroup)); - vector act_pts = sortedPoints(0.0, 2.0+eps); - CPPUNIT_ASSERT_EQUAL(exp_pts.size(), act_pts.size()); - for (size_t i = 0; i != exp_pts.size(); ++i) - { - CPPUNIT_ASSERT_EQUAL(exp_pts[i], act_pts[i]); - } - } - - void test_FCC() - { - latpar->a = latpar->b = latpar->c = sqrt(0.5); - latpar->alpha = latpar->beta = latpar->gamma = 60.0; - latpar->update(); - CPPUNIT_ASSERT_EQUAL(13, count(0.0, sqrt(0.5)+eps)); - CPPUNIT_ASSERT_EQUAL(19, count(0.0, 1.0+eps)); - } - -}; - -// Registers the fixture into the 'registry' -CPPUNIT_TEST_SUITE_REGISTRATION(TestPointsInSphere); - -// End of file diff --git a/libpdffit2/tests/alltests.cc b/libpdffit2/tests/alltests.cc deleted file mode 100644 index 318cb4b3..00000000 --- a/libpdffit2/tests/alltests.cc +++ /dev/null @@ -1,46 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Unit tests driver -* -***********************************************************************/ - -#include -#include -#include -#include -#include - -using namespace std; -using namespace CppUnit; - -int main() -{ - // Get the top level suite from the registry - Test *suite = TestFactoryRegistry::getRegistry().makeTest(); - - // Adds the test to the list of test to run - TextUi::TestRunner runner; - runner.addTest( suite ); - - // Change the default outputter to a compiler error format outputter - runner.setOutputter( new CompilerOutputter(&runner.result(), cerr) ); - // Run the tests. - bool wasSucessful = runner.run(); - - // Return error code 1 if the one of test failed. - return wasSucessful ? EXIT_SUCCESS : EXIT_FAILURE; -} - -// End of file diff --git a/pdffit2module/PyFileStreambuf.h b/pdffit2module/PyFileStreambuf.h deleted file mode 100644 index 3a2bc383..00000000 --- a/pdffit2module/PyFileStreambuf.h +++ /dev/null @@ -1,97 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2007 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* class PyFileStreambuf -* -* Comments: PyFileStreambuf is a C++ streambuf which writes to a python -* file-like object. The python file can be changed anytime by -* calling the redirect() method. -* -* Examples: // redirect std::cout -* std::cout.rdbuf( PyFileStreambuf(PyObject* python_file) ); -* -***********************************************************************/ - -#ifndef PYFILESTREAMBUF_H_INCLUDED -#define PYFILESTREAMBUF_H_INCLUDED -#define PY_SSIZE_T_CLEAN - -#include -#include - -// MS compatibility fix -#include - -class PyFileStreambuf : public std::streambuf -{ - private: - - // Data members - PyObject* py_file; - - public: - - // Constructor - PyFileStreambuf(PyObject* f) : py_file(f) - { - Py_INCREF(py_file); - } - - // Destructor - ~PyFileStreambuf() - { - Py_DECREF(py_file); - } - - // Methods - PyObject* redirect(PyObject* f) - { - Py_INCREF(f); - Py_DECREF(py_file); - py_file = f; - return py_file; - } - - protected: - - virtual int_type overflow( int_type c) - { - PyObject* rv; - rv = PyObject_CallMethod(py_file, "write", "(s#)", &c, 1); - if (rv) { Py_DECREF(rv); } - return c; - } - - virtual std::streamsize xsputn(const char_type* s, std::streamsize n) - { - PyObject* rv; - rv = PyObject_CallMethod(py_file, "write", "(s#)", s, n); - if (rv) { Py_DECREF(rv); } - return n; - } - - virtual int sync() - { - if (PyObject_HasAttrString(py_file, "flush")) - { - PyObject* rv; - rv = PyObject_CallMethod(py_file, "flush", NULL); - if (rv) { Py_DECREF(rv); } - } - return 0; - } - -}; - -#endif // PYFILESTREAMBUF_H_INCLUDED diff --git a/pdffit2module/bindings.cc b/pdffit2module/bindings.cc deleted file mode 100644 index 568e1dd1..00000000 --- a/pdffit2module/bindings.cc +++ /dev/null @@ -1,341 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Method table for python module bindings. -* -* Comments: -* -***********************************************************************/ -#define PY_SSIZE_T_CLEAN -#include - -#include "bindings.h" -#include "misc.h" - -// the method table -struct PyMethodDef pypdffit2_methods[] = { - - //copyright - {pypdffit2_copyright__name__, pypdffit2_copyright, - METH_VARARGS, pypdffit2_copyright__doc__}, - - //create - {pypdffit2_create__name__, pypdffit2_create, - METH_VARARGS, pypdffit2_create__doc__}, - - //read_struct - {pypdffit2_read_struct__name__, pypdffit2_read_struct, - METH_VARARGS, pypdffit2_read_struct__doc__}, - - //read_struct_string - {pypdffit2_read_struct_string__name__, pypdffit2_read_struct_string, - METH_VARARGS, pypdffit2_read_struct_string__doc__}, - - //read_data - {pypdffit2_read_data__name__, pypdffit2_read_data, - METH_VARARGS, pypdffit2_read_data__doc__}, - - //read_data_string - {pypdffit2_read_data_string__name__, pypdffit2_read_data_string, - METH_VARARGS, pypdffit2_read_data_string__doc__}, - - //read_data_arrays - {pypdffit2_read_data_arrays__name__, pypdffit2_read_data_arrays, - METH_VARARGS, pypdffit2_read_data_arrays__doc__}, - - //pdfrange - {pypdffit2_pdfrange__name__, pypdffit2_pdfrange, - METH_VARARGS, pypdffit2_pdfrange__doc__}, - - //reset - {pypdffit2_reset__name__, pypdffit2_reset, - METH_VARARGS, pypdffit2_reset__doc__}, - - //alloc - {pypdffit2_alloc__name__, pypdffit2_alloc, - METH_VARARGS, pypdffit2_alloc__doc__}, - - //calc - {pypdffit2_calc__name__, pypdffit2_calc, - METH_VARARGS, pypdffit2_calc__doc__}, - - //refine - {pypdffit2_refine__name__, pypdffit2_refine, - METH_VARARGS, pypdffit2_refine__doc__}, - - //refine_step - {pypdffit2_refine_step__name__, pypdffit2_refine_step, - METH_VARARGS, pypdffit2_refine_step__doc__}, - - //save_pdf - {pypdffit2_save_pdf__name__, pypdffit2_save_pdf, - METH_VARARGS, pypdffit2_save_pdf__doc__}, - - //save_dif - {pypdffit2_save_dif__name__, pypdffit2_save_dif, - METH_VARARGS, pypdffit2_save_dif__doc__}, - - //save_res - {pypdffit2_save_res__name__, pypdffit2_save_res, - METH_VARARGS, pypdffit2_save_res__doc__}, - - //save_struct - {pypdffit2_save_struct__name__, pypdffit2_save_struct, - METH_VARARGS, pypdffit2_save_struct__doc__}, - - //show_struct - {pypdffit2_show_struct__name__, pypdffit2_show_struct, - METH_VARARGS, pypdffit2_show_struct__doc__}, - - //constrain_int - {pypdffit2_constrain_int__name__, pypdffit2_constrain_int, - METH_VARARGS, pypdffit2_constrain_int__doc__}, - - //constrain_str - {pypdffit2_constrain_str__name__, pypdffit2_constrain_str, - METH_VARARGS, pypdffit2_constrain_str__doc__}, - - //setpar_dbl - {pypdffit2_setpar_dbl__name__, pypdffit2_setpar_dbl, - METH_VARARGS, pypdffit2_setpar_dbl__doc__}, - - //setpar_RV - {pypdffit2_setpar_RV__name__, pypdffit2_setpar_RV, - METH_VARARGS, pypdffit2_setpar_RV__doc__}, - - //setvar - {pypdffit2_setvar__name__, pypdffit2_setvar, - METH_VARARGS, pypdffit2_setvar__doc__}, - - //getvar - {pypdffit2_getvar__name__, pypdffit2_getvar, - METH_VARARGS, pypdffit2_getvar__doc__}, - - //getR - {pypdffit2_getR__name__, pypdffit2_getR, - METH_VARARGS, pypdffit2_getR__doc__}, - - //getpdf_fit - {pypdffit2_getpdf_fit__name__, pypdffit2_getpdf_fit, - METH_VARARGS, pypdffit2_getpdf_fit__doc__}, - - //getpdf_obs - {pypdffit2_getpdf_obs__name__, pypdffit2_getpdf_obs, - METH_VARARGS, pypdffit2_getpdf_obs__doc__}, - - //getpdf_diff - {pypdffit2_getpdf_diff__name__, pypdffit2_getpdf_diff, - METH_VARARGS, pypdffit2_getpdf_diff__doc__}, - - //getcrw - {pypdffit2_getcrw__name__, pypdffit2_getcrw, - METH_VARARGS, pypdffit2_getcrw__doc__}, - - //getrw - {pypdffit2_getrw__name__, pypdffit2_getrw, - METH_VARARGS, pypdffit2_getrw__doc__}, - - //getpar - {pypdffit2_getpar__name__, pypdffit2_getpar, - METH_VARARGS, pypdffit2_getpar__doc__}, - - //fixpar - {pypdffit2_fixpar__name__, pypdffit2_fixpar, - METH_VARARGS, pypdffit2_fixpar__doc__}, - - //freepar - {pypdffit2_freepar__name__, pypdffit2_freepar, - METH_VARARGS, pypdffit2_freepar__doc__}, - - //setphase - {pypdffit2_setphase__name__, pypdffit2_setphase, - METH_VARARGS, pypdffit2_setphase__doc__}, - - //setdata - {pypdffit2_setdata__name__, pypdffit2_setdata, - METH_VARARGS, pypdffit2_setdata__doc__}, - - //psel - {pypdffit2_psel__name__, pypdffit2_psel, - METH_VARARGS, pypdffit2_psel__doc__}, - - //pdesel - {pypdffit2_pdesel__name__, pypdffit2_pdesel, - METH_VARARGS, pypdffit2_pdesel__doc__}, - - //selectAtomType - {pypdffit2_selectAtomType__name__, pypdffit2_selectAtomType, - METH_VARARGS, pypdffit2_selectAtomType__doc__}, - - //selectAtomIndex - {pypdffit2_selectAtomIndex__name__, pypdffit2_selectAtomIndex, - METH_VARARGS, pypdffit2_selectAtomIndex__doc__}, - - //selectAll - {pypdffit2_selectAll__name__, pypdffit2_selectAll, - METH_VARARGS, pypdffit2_selectAll__doc__}, - - //selectNone - {pypdffit2_selectNone__name__, pypdffit2_selectNone, - METH_VARARGS, pypdffit2_selectNone__doc__}, - - //bond_angle - {pypdffit2_bond_angle__name__, pypdffit2_bond_angle, - METH_VARARGS, pypdffit2_bond_angle__doc__}, - - //bond_length_atoms - {pypdffit2_bond_length_atoms__name__, pypdffit2_bond_length_atoms, - METH_VARARGS, pypdffit2_bond_length_atoms__doc__}, - - //bond_length_types - {pypdffit2_bond_length_types__name__, pypdffit2_bond_length_types, - METH_VARARGS, pypdffit2_bond_length_types__doc__}, - - //get_scat_string - {pypdffit2_get_scat_string__name__, pypdffit2_get_scat_string, - METH_VARARGS, pypdffit2_get_scat_string__doc__}, - - //get_scat - {pypdffit2_get_scat__name__, pypdffit2_get_scat, - METH_VARARGS, pypdffit2_get_scat__doc__}, - - //set_scat - {pypdffit2_set_scat__name__, pypdffit2_set_scat, - METH_VARARGS, pypdffit2_set_scat__doc__}, - - //reset_scat - {pypdffit2_reset_scat__name__, pypdffit2_reset_scat, - METH_VARARGS, pypdffit2_reset_scat__doc__}, - - //lat - {pypdffit2_lat__name__, pypdffit2_lat, - METH_VARARGS, pypdffit2_lat__doc__}, - - //x - {pypdffit2_x__name__, pypdffit2_x, - METH_VARARGS, pypdffit2_x__doc__}, - - //y - {pypdffit2_y__name__, pypdffit2_y, - METH_VARARGS, pypdffit2_y__doc__}, - - //z - {pypdffit2_z__name__, pypdffit2_z, - METH_VARARGS, pypdffit2_z__doc__}, - - //u11 - {pypdffit2_u11__name__, pypdffit2_u11, - METH_VARARGS, pypdffit2_u11__doc__}, - - //u22 - {pypdffit2_u22__name__, pypdffit2_u22, - METH_VARARGS, pypdffit2_u22__doc__}, - - //u33 - {pypdffit2_u33__name__, pypdffit2_u33, - METH_VARARGS, pypdffit2_u33__doc__}, - - //u12 - {pypdffit2_u12__name__, pypdffit2_u12, - METH_VARARGS, pypdffit2_u12__doc__}, - - //u13 - {pypdffit2_u13__name__, pypdffit2_u13, - METH_VARARGS, pypdffit2_u13__doc__}, - - //u23 - {pypdffit2_u23__name__, pypdffit2_u23, - METH_VARARGS, pypdffit2_u23__doc__}, - - //occ - {pypdffit2_occ__name__, pypdffit2_occ, - METH_VARARGS, pypdffit2_occ__doc__}, - - //pscale - {pypdffit2_pscale__name__, pypdffit2_pscale, - METH_VARARGS, pypdffit2_pscale__doc__}, - - //spdiameter - {pypdffit2_spdiameter__name__, pypdffit2_spdiameter, - METH_VARARGS, pypdffit2_spdiameter__doc__}, - - //stepcut - {pypdffit2_stepcut__name__, pypdffit2_stepcut, - METH_VARARGS, pypdffit2_stepcut__doc__}, - - //sratio - {pypdffit2_sratio__name__, pypdffit2_sratio, - METH_VARARGS, pypdffit2_sratio__doc__}, - - //delta2 - {pypdffit2_delta2__name__, pypdffit2_delta2, - METH_VARARGS, pypdffit2_delta2__doc__}, - - //delta1 - {pypdffit2_delta1__name__, pypdffit2_delta1, - METH_VARARGS, pypdffit2_delta1__doc__}, - - //dscale - {pypdffit2_dscale__name__, pypdffit2_dscale, - METH_VARARGS, pypdffit2_dscale__doc__}, - - //qdamp - {pypdffit2_qdamp__name__, pypdffit2_qdamp, - METH_VARARGS, pypdffit2_qdamp__doc__}, - - //qbroad - {pypdffit2_qbroad__name__, pypdffit2_qbroad, - METH_VARARGS, pypdffit2_qbroad__doc__}, - - //rcut - {pypdffit2_rcut__name__, pypdffit2_rcut, - METH_VARARGS, pypdffit2_rcut__doc__}, - - //get_atoms - {pypdffit2_get_atoms__name__, pypdffit2_get_atoms, - METH_VARARGS, pypdffit2_get_atoms__doc__}, - - //num_atoms - {pypdffit2_num_atoms__name__, pypdffit2_num_atoms, - METH_VARARGS, pypdffit2_num_atoms__doc__}, - - //get_atom_types - {pypdffit2_get_atom_types__name__, pypdffit2_get_atom_types, - METH_VARARGS, pypdffit2_get_atom_types__doc__}, - - //num_phases - {pypdffit2_num_phases__name__, pypdffit2_num_phases, - METH_VARARGS, pypdffit2_num_phases__doc__}, - - //num_datasets - {pypdffit2_num_datasets__name__, pypdffit2_num_datasets, - METH_VARARGS, pypdffit2_num_datasets__doc__}, - - //phase_fractions - {pypdffit2_phase_fractions__name__, pypdffit2_phase_fractions, - METH_VARARGS, pypdffit2_phase_fractions__doc__}, - - //redirect_stdout - {pypdffit2_redirect_stdout__name__, pypdffit2_redirect_stdout, - METH_VARARGS, pypdffit2_redirect_stdout__doc__}, - - //is_element - {pypdffit2_is_element__name__, pypdffit2_is_element, - METH_VARARGS, pypdffit2_is_element__doc__}, - -// Sentinel - {0, 0} -}; - -// End of file diff --git a/pdffit2module/bindings.h b/pdffit2module/bindings.h deleted file mode 100644 index bf1e1406..00000000 --- a/pdffit2module/bindings.h +++ /dev/null @@ -1,27 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Method table for python module bindings. -* -* Comments: -* -***********************************************************************/ - -#ifndef PYPDFFIT2_BINDINGS_H -#define PYPDFFIT2_BINDINGS_H - -// the method table -extern struct PyMethodDef pypdffit2_methods[]; - -#endif // PYPDFFIT2_BINDINGS_H diff --git a/pdffit2module/misc.cc b/pdffit2module/misc.cc deleted file mode 100644 index 80198049..00000000 --- a/pdffit2module/misc.cc +++ /dev/null @@ -1,2219 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Bindings from python to c++ PdfFit class. -* -* Comments: -* -***********************************************************************/ -#define PY_SSIZE_T_CLEAN -#include -#include -#include -#include -#include -#include -#include -#include - -#include "misc.h" -#include "pyexceptions.h" -#include "PyFileStreambuf.h" -#include "libpdffit2/StringUtils.h" -#include "libpdffit2/LocalPeriodicTable.h" -#include "libpdffit2/pdffit.h" - -// ostream buffer used for engine output redirection -PyFileStreambuf* py_stdout_streambuf = NULL; - -// copyright -char pypdffit2_copyright__doc__[] = ""; -char pypdffit2_copyright__name__[] = "copyright"; - -static char pypdffit2_copyright_note[] = - "pdffit2 python module: Copyright (c) 2005-2016 Simon J. L. Billinge et al."; - -// constant strings for python capsule names (cn) -static char* cnpfit = "pdffit"; -static char* cnvar = "pdfvar"; - -PyObject * pypdffit2_copyright(PyObject *, PyObject *) -{ - return Py_BuildValue("s", pypdffit2_copyright_note); -} - -//helper function to convert a pylist to a double array. -void double_array_from_pylist(PyObject *pylist, double *d_array, int const length) -{ - //length is the size of the d_array and not necessarily equal to the length - //of the pylist - PyObject *pyval = 0; - - for(int i = 0; i < length; i++) { - pyval = PyList_GetItem(pylist, i); - d_array[i] = PyFloat_AsDouble(pyval); - } -} - -// helper function to delete PdfFit object -static void deletePdfFit(PyObject* ptr) -{ - PdfFit *pdf = (PdfFit *)PyCapsule_GetPointer(ptr, cnpfit); - delete pdf; - return; -} - -// create a PdfFit instance -char pypdffit2_create__doc__[] = ""; -char pypdffit2_create__name__[] = "create"; - -PyObject * pypdffit2_create(PyObject *, PyObject *args) -{ - PdfFit *ppdf = new PdfFit(); - PyObject *py_ppdf = PyCapsule_New((void *)ppdf, cnpfit, deletePdfFit); - return py_ppdf; -} - - -// read_struct -char pypdffit2_read_struct__doc__[] = "Read structure file into memory."; -char pypdffit2_read_struct__name__[] = "read_struct"; - -PyObject * pypdffit2_read_struct(PyObject *, PyObject *args) -{ - char *fname; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &fname); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->read_struct(fname); - } - catch(structureError e) { - PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); - return 0; - } - catch(calculationError e) { - PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); - return 0; - } - catch(IOError e) { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// read_struct_string -char pypdffit2_read_struct_string__doc__[] = "Read structure file into memory from a c-string."; -char pypdffit2_read_struct_string__name__[] = "read_struct_string"; - -PyObject * pypdffit2_read_struct_string(PyObject *, PyObject *args) -{ - char *buffer; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &buffer); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->read_struct_string(buffer); - } - catch(structureError e) { - PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(pypdffit2_structureError, e.GetMsg().c_str()); - return 0; - } - catch(calculationError e) { - PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - - -// read_data -char pypdffit2_read_data__doc__[] = "Read data file into memory."; -char pypdffit2_read_data__name__[] = "read_data"; - -PyObject * pypdffit2_read_data(PyObject *, PyObject *args) -{ - char *fname; - char stype; - double qmax, qdamp; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oscdd", &py_ppdf, &fname, &stype, &qmax, &qdamp); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->read_data(fname, stype, qmax, qdamp); - } - catch(IOError e) { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(dataError e) { - PyErr_SetString(pypdffit2_dataError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// read_data_string -char pypdffit2_read_data_string__doc__[] = "Read data from string into memory."; -char pypdffit2_read_data_string__name__[] = "read_data_string"; - -PyObject * pypdffit2_read_data_string(PyObject *, PyObject *args) -{ - char *buffer; - char *c_name = NULL; - char stype; - double qmax, qdamp; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oscdd|s", &py_ppdf, &buffer, &stype, &qmax, &qdamp, &c_name); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - string name = c_name ? c_name : ""; - try { - string sbuffer(buffer); - ppdf->read_data_string(sbuffer, stype, qmax, qdamp, name); - } - catch(IOError e) { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(dataError e) { - PyErr_SetString(pypdffit2_dataError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// read_data_arrays - read_data_lists in PdfFit class -char pypdffit2_read_data_arrays__doc__[] = "Read data from arrays into memory."; -char pypdffit2_read_data_arrays__name__[] = "read_data_arrays"; - -PyObject * pypdffit2_read_data_arrays(PyObject *, PyObject *args) -{ - char stype; - double qmax, qdamp; - int length; - char * c_name = NULL; - double *r_data = NULL; - double *Gr_data = NULL; - double *dGr_data = NULL; - PyObject *py_r_data = Py_None; - PyObject *py_Gr_data = Py_None; - PyObject *py_dGr_data = Py_None; - PyObject *py_ppdf = NULL; - int ok = PyArg_ParseTuple(args, "OcddOO|Os", &py_ppdf, &stype, &qmax, &qdamp, - &py_r_data, &py_Gr_data, &py_dGr_data, &c_name); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - - length = PyList_Size(py_Gr_data); - //quick check that the arrays are all the same length // - int r_len = PyList_Size(py_r_data); - int dGr_len = length; - if(py_dGr_data != Py_None) { - dGr_len = PyList_Size(py_dGr_data); - } - if(r_len != length || dGr_len != length) - { - string err_string = "Data arrays have different lengths"; - PyErr_SetString(PyExc_ValueError, err_string.c_str()); - return 0; - } - - // create data arrays - r_data = new double [length]; - double_array_from_pylist(py_r_data, r_data, length); - Gr_data = new double [length]; - double_array_from_pylist(py_Gr_data, Gr_data, length); - if(py_dGr_data != Py_None) { - dGr_data = new double [length]; - double_array_from_pylist(py_dGr_data, dGr_data, length); - } - string name = c_name; - try { - ppdf->read_data_arrays(stype, qmax, qdamp, length, - r_data, Gr_data, dGr_data, name); - } - catch(dataError e) { - PyErr_SetString(pypdffit2_dataError, e.GetMsg().c_str()); - return 0; - } - - // read_data_arrays creates its own copy of the data, so we must delete our - // copies here. - delete [] r_data; - delete [] Gr_data; - if( dGr_data != NULL ) delete [] dGr_data; - Py_INCREF(Py_None); - return Py_None; -} - -// pdfrange (range in c) -char pypdffit2_pdfrange__doc__[] = "Set r-range of pdf."; -char pypdffit2_pdfrange__name__[] = "pdfrange"; - -PyObject * pypdffit2_pdfrange(PyObject *, PyObject *args) -{ - int iset; - double rmin, rmax; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oidd", &py_ppdf, &iset, &rmin, &rmax); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->range(iset, rmin, rmax); - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// reset -char pypdffit2_reset__doc__[] = "reset pdf data"; -char pypdffit2_reset__name__[] = "reset"; - -PyObject * pypdffit2_reset(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - ppdf->reset(); - Py_INCREF(Py_None); - return Py_None; -} - -// alloc -char pypdffit2_alloc__doc__[] = "Allocate space for pdf data"; -char pypdffit2_alloc__name__[] = "alloc"; - -PyObject * pypdffit2_alloc(PyObject *, PyObject *args) -{ - char stype; - double qmax, qdamp, rmin, rmax; - int bin; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ocddddi", &py_ppdf, &stype, &qmax, &qdamp, &rmin, &rmax, &bin); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->alloc(stype, qmax, qdamp, rmin, rmax, bin); - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// calc -char pypdffit2_calc__doc__[] = "calculate pdf from data"; -char pypdffit2_calc__name__[] = "calc"; - -PyObject * pypdffit2_calc(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->calc(); - } - catch (calculationError e) { - PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch (parseError e) { - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// refine -char pypdffit2_refine__doc__[] = "refine model to pdf data"; -char pypdffit2_refine__name__[] = "refine"; - -PyObject * pypdffit2_refine(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - double toler; - int ok = PyArg_ParseTuple(args, "Od", &py_ppdf, &toler); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - ppdf->refine(true, toler); - } - catch(constraintError e) { - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - catch(calculationError e) { - PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// local helper class for background thread in pypdffit2_refine_step() -namespace { - -class RefineStepHelper -{ - private: - PyThreadState* thread_state; - ostringstream msgout; - - public: - // Constructor saves thread state and arranges for holding - // engine output when redirected - RefineStepHelper() - { - if (py_stdout_streambuf) - { - NS_PDFFIT2::pout->rdbuf(msgout.rdbuf()); - } - thread_state = PyEval_SaveThread(); - } - - // method for restoring thread state and writing any outstanding output - void clean() - { - PyEval_RestoreThread(thread_state); - if (py_stdout_streambuf) - { - NS_PDFFIT2::pout->rdbuf(py_stdout_streambuf); - *NS_PDFFIT2::pout << msgout.str(); - } - } -}; - -} // local namespace - -// refine_step -char pypdffit2_refine_step__doc__[] = "Make one step in the refinement process."; -char pypdffit2_refine_step__name__[] = "refine_step"; - -PyObject * pypdffit2_refine_step(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - double toler; - int ok = PyArg_ParseTuple(args, "Od", &py_ppdf, &toler); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - RefineStepHelper janitor; // takes care of thread an output issues - int finished = 1; - try { - finished = ppdf->refine_step(true, toler); - } - catch(parseError e) { - // parseError is due to invalid constraint - janitor.clean(); - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - catch(constraintError e) { - janitor.clean(); - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - catch(calculationError e) { - janitor.clean(); - PyErr_SetString(pypdffit2_calculationError, e.GetMsg().c_str()); - return 0; - } - catch(unassignedError e) { - janitor.clean(); - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(...) { - janitor.clean(); - return 0; - } - janitor.clean(); - - return Py_BuildValue("i", finished); -} - -// save_pdf -char pypdffit2_save_pdf__doc__[] = "Save calculated pdf to file"; -char pypdffit2_save_pdf__name__[] = "save_pdf"; - -PyObject * pypdffit2_save_pdf(PyObject *, PyObject *args) -{ - char *fname; - int iset; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ois", &py_ppdf, &iset, &fname); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - string outfilestring = ppdf->save_pdf(iset, fname); - return Py_BuildValue("s", outfilestring.c_str()); - } - catch(IOError e) - { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// save_dif -char pypdffit2_save_dif__doc__[] = "Save pdf difference to file"; -char pypdffit2_save_dif__name__[] = "save_dif"; - -PyObject * pypdffit2_save_dif(PyObject *, PyObject *args) -{ - char *fname; - int iset; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ois", &py_ppdf, &iset, &fname); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - string outfilestring = ppdf->save_dif(iset, fname); - return Py_BuildValue("s", outfilestring.c_str()); - } - catch(IOError e) - { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// save_res -char pypdffit2_save_res__doc__[] = "Save residual to file"; -char pypdffit2_save_res__name__[] = "save_res"; - -PyObject * pypdffit2_save_res(PyObject *, PyObject *args) -{ - char *fname; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &fname); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - string outfilestring = ppdf->save_res(fname); - return Py_BuildValue("s", outfilestring.c_str()); - } - catch(IOError e) - { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// save_struct -char pypdffit2_save_struct__doc__[] = "Save refined structure to file"; -char pypdffit2_save_struct__name__[] = "save_struct"; - -PyObject * pypdffit2_save_struct(PyObject *, PyObject *args) -{ - char *fname; - int iset; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ois", &py_ppdf, &iset, &fname); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - string outfilestring = ppdf->save_struct(iset, fname); - return Py_BuildValue("s", outfilestring.c_str()); - } - catch(IOError e) - { - PyErr_SetString(PyExc_IOError, e.GetMsg().c_str()); - return 0; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// show_struct -char pypdffit2_show_struct__doc__[] = "Show structure."; -char pypdffit2_show_struct__name__[] = "show_struct"; - -PyObject * pypdffit2_show_struct(PyObject *, PyObject *args) -{ - int ip; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - string outfilestring = ppdf->show_struct(ip); - return Py_BuildValue("s", outfilestring.c_str()); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// constrain to string -char pypdffit2_constrain_str__doc__[] = "Constrain refined variable to string."; -char pypdffit2_constrain_str__name__[] = "constrain_str"; - -PyObject* pypdffit2_constrain_str(PyObject*, PyObject* args) -{ - PyObject* py_v = 0; - char* vname; - char* form; - PyObject* py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OOss", &py_ppdf, &py_v, &vname, &form); - if (!ok) return 0; - PdfFit* ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - RefVar* v = (RefVar *) PyCapsule_GetPointer(py_v, cnvar); - if (v->type() != "RefVar") - { - string emsg = "cannot constrain non-refinable variable "; - emsg += vname; - PyErr_SetString(pypdffit2_constraintError, emsg.c_str()); - return 0; - } - if (v->isAssigned()) { - try { - ppdf->constrain(*v, form); - } - catch (constraintError e) { - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - } - else { - ostringstream emsg; - emsg << "Variable " << vname << " was not yet assigned"; - PyErr_SetString(pypdffit2_unassignedError, emsg.str().c_str()); - } - Py_INCREF(Py_None); - return Py_None; -} - -// constrain to integer. -char pypdffit2_constrain_int__doc__[] = "Constrain refined variable to integer."; -char pypdffit2_constrain_int__name__[] = "constrain_int"; - -PyObject* pypdffit2_constrain_int(PyObject*, PyObject* args) -{ - PyObject* py_v = 0; - int ftype = 0; - char* vname; - int ipar; - PyObject* py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OOsi|i", &py_ppdf, &py_v, &vname, &ipar, &ftype); - if (!ok) return 0; - PdfFit* ppdf = (PdfFit*) PyCapsule_GetPointer(py_ppdf, cnpfit); - RefVar* v = (RefVar*) PyCapsule_GetPointer(py_v, cnvar); - if (v->type() != "RefVar") - { - string emsg = "cannot constrain non-refinable variable "; - emsg += vname; - PyErr_SetString(pypdffit2_constraintError, emsg.c_str()); - return 0; - } - if (v->isAssigned()) { - try { - if (ftype) - { - ppdf->constrain(*v, ipar, (FCON)ftype); - } - else ppdf->constrain(*v, ipar); - } - catch (constraintError e) { - PyErr_SetString(pypdffit2_constraintError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - } - else { - ostringstream emsg; - emsg << "Variable " << vname << " was not yet assigned"; - PyErr_SetString(pypdffit2_unassignedError, emsg.str().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// setpar with value of double -char pypdffit2_setpar_dbl__doc__[] = "Set parameter value."; -char pypdffit2_setpar_dbl__name__[] = "setpar_dbl"; - -PyObject * pypdffit2_setpar_dbl(PyObject *, PyObject *args) -{ - unsigned int n; - double val; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OId", &py_ppdf, &n, &val); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->setpar(n, val); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// setpar with value of RefVar -char pypdffit2_setpar_RV__doc__[] = "Set parameter value via refined variable."; -char pypdffit2_setpar_RV__name__[] = "setpar_RV"; - -PyObject * pypdffit2_setpar_RV(PyObject *, PyObject *args) -{ - unsigned int n; - RefVar *v; - PyObject *py_v; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OIO", &py_ppdf, &n, &py_v); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - v = (RefVar *) PyCapsule_GetPointer(py_v, cnvar); - if( v->isAssigned() ) { - try - { - ppdf->setpar(n, *v); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - } - else { - string eout = "Variable not yet assigned"; - PyErr_SetString(pypdffit2_unassignedError, eout.c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// setvar -char pypdffit2_setvar__doc__[] = "Set variable to value."; -char pypdffit2_setvar__name__[] = "setvar"; - -PyObject * pypdffit2_setvar(PyObject *, PyObject *args) -{ - double a; - NonRefVar *v; - PyObject *py_v; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OOd", &py_ppdf, &py_v, &a); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - v = (NonRefVar *) PyCapsule_GetPointer(py_v, cnvar); - if( v->isAssigned() ) { - ppdf->setvar(*v, a); - } - else { - string eout = "Must import a structure"; - PyErr_SetString(pypdffit2_unassignedError, eout.c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// getvar -char pypdffit2_getvar__doc__[] = "Get variable value."; -char pypdffit2_getvar__name__[] = "getvar"; - -PyObject * pypdffit2_getvar(PyObject *, PyObject *args) -{ - NonRefVar *v = 0; - PyObject *py_v = 0; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OO", &py_ppdf, &py_v); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - v = (NonRefVar *) PyCapsule_GetPointer(py_v, cnvar); - if(v->isAssigned()) { - double crval = ppdf->getvar(*v); - return Py_BuildValue("d", crval); - } - else { - string eout = "Variable not yet assigned"; - PyErr_SetString(pypdffit2_unassignedError, eout.c_str()); - return 0; - Py_INCREF(Py_None); - return Py_None; - } -} - -// getcrw -char pypdffit2_getcrw__doc__[] = "Get cumulative Rw for the current dataset."; -char pypdffit2_getcrw__name__[] = "getcrw"; - -PyObject * pypdffit2_getcrw(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - vector crw = ppdf->getcrw(); - PyObject *py_r; - py_r = PyList_New(crw.size()); - for (int i = 0; i != int(crw.size()); ++i) - { - PyList_SetItem(py_r, i, PyFloat_FromDouble(crw[i])); - } - return py_r; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// getrw -char pypdffit2_getrw__doc__[] = "Get rw of fit."; -char pypdffit2_getrw__name__[] = "getrw"; - -PyObject * pypdffit2_getrw(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - double crval = ppdf->getrw(); - return Py_BuildValue("d", crval); -} - -// getR -char pypdffit2_getR__doc__[] = "Get list of r-values for plotting."; -char pypdffit2_getR__name__[] = "getR"; - -PyObject * pypdffit2_getR(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - /* One should not put functionality in the bindings. However, - * this function is meant to create a python object from a - * c-object that does not actually exist. All that is stored - * in pdffit about the fitted R-range is the minimum, maximum, - * and step size. This binding turns that info into a python - * list. If the number of fit points stored in nfmax and nfmin - * have not yet been assigned, then this falls back on the - * r-points. This is crucial so that one can investigate the - * PDF before any fitting has been done. Once fit parameters - * have been established, they can be used and the r list, - * pdf-obs list, and pdf-fit list will be the same size. - * Also see getpdf_obs(). - */ - try - { - int nfmin = ppdf->getnfmin(); - int nfmax = ppdf->getnfmax(); - int len = nfmax - nfmin + 1; - double rmin = ppdf->getrmin(); - double rmax = ppdf->getrmax(); - double deltar = ppdf->getdeltar(); - PyObject *py_r; - if(len == 1) - { - nfmin = 0; - nfmax = (int) ((rmax - rmin)/deltar); - len = nfmax + 1; - } - py_r = PyList_New(len); - for (int i=nfmin;i<=nfmax;i++) - { - PyList_SetItem(py_r, i-nfmin, Py_BuildValue("d", i*deltar + rmin)); - } - - return py_r; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - - -// getpdf_fit -char pypdffit2_getpdf_fit__doc__[] = "Get list of calculated pdf points."; -char pypdffit2_getpdf_fit__name__[] = "getpdf_fit"; - -PyObject * pypdffit2_getpdf_fit(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - //Return only the data range used in the fit - try - { - int min = ppdf->getnfmin(); - int max = ppdf->getnfmax(); - int len = max - min + 1; - vector v_pdfdata = ppdf->getpdf_fit(); - PyObject *py_r; - py_r = PyList_New(len); - for (int i=min;i<=max;i++) { - PyList_SetItem(py_r, i-min, Py_BuildValue("d", v_pdfdata[i])); - } - return py_r; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - - -// getpdf_obs -char pypdffit2_getpdf_obs__doc__[] = "Get list of observed (theory) pdf points."; -char pypdffit2_getpdf_obs__name__[] = "getpdf_obs"; - -PyObject * pypdffit2_getpdf_obs(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - vector v_pdfdata = ppdf->getpdf_obs(); - int nfmin = ppdf->getnfmin(); - int nfmax = ppdf->getnfmax(); - int len = nfmax - nfmin + 1; - //Return only the data range used in the fit - PyObject *py_r; - py_r = PyList_New(len); - for (int i=nfmin;i<=nfmax;i++) { - PyList_SetItem(py_r, i-nfmin, Py_BuildValue("d", v_pdfdata[i])); - } - return py_r; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// getpdf_diff -char pypdffit2_getpdf_diff__doc__[] = "Get list of differences between observed and fitted PDF points."; -char pypdffit2_getpdf_diff__name__[] = "getpdf_diff"; - -PyObject * pypdffit2_getpdf_diff(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - vector Gobs = ppdf->getpdf_obs(); - vector Gfit = ppdf->getpdf_fit(); - int nfmin = ppdf->getnfmin(); - int nfmax = ppdf->getnfmax(); - int len = nfmax - nfmin + 1; - //Return only the data range used in the fit - PyObject *py_r; - py_r = PyList_New(len); - for (int i = nfmin; i <= nfmax; i++) { - double Gdiff_i = Gobs[i] - Gfit[i]; - PyList_SetItem(py_r, i-nfmin, Py_BuildValue("d", Gdiff_i)); - } - return py_r; - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - - -// getpar -char pypdffit2_getpar__doc__[] = "Get value of parameter"; -char pypdffit2_getpar__name__[] = "getpar"; - -PyObject * pypdffit2_getpar(PyObject *, PyObject *args) -{ - unsigned int n; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "OI", &py_ppdf, &n); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - double crval = ppdf->getpar(n); - return Py_BuildValue("d", crval); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// fixpar -char pypdffit2_fixpar__doc__[] = "Fix value of parameter."; -char pypdffit2_fixpar__name__[] = "fixpar"; - -PyObject * pypdffit2_fixpar(PyObject *, PyObject *args) -{ - int n; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &n); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->fixpar(n); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// freepar -char pypdffit2_freepar__doc__[] = "Free parameter."; -char pypdffit2_freepar__name__[] = "freepar"; - -PyObject * pypdffit2_freepar(PyObject *, PyObject *args) -{ - int n; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &n); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->freepar(n); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// setphase -char pypdffit2_setphase__doc__[] = "Set phase in focus."; -char pypdffit2_setphase__name__[] = "setphase"; - -PyObject * pypdffit2_setphase(PyObject *, PyObject *args) -{ - int ip; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->setphase(ip); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// setdata -char pypdffit2_setdata__doc__[] = "Set data in focus."; -char pypdffit2_setdata__name__[] = "setdata"; - -PyObject * pypdffit2_setdata(PyObject *, PyObject *args) -{ - int is; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &is); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->setdata(is); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// psel -char pypdffit2_psel__doc__[] = "Select phase in focus."; -char pypdffit2_psel__name__[] = "psel"; - -PyObject * pypdffit2_psel(PyObject *, PyObject *args) -{ - int ip; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->selphase(ip); - } - catch(unassignedError e) - { - // PyErr_Warn(PyExc_Warning, e.GetMsg().c_str()); - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// pdesel -char pypdffit2_pdesel__doc__[] = "Deselect phase in focus."; -char pypdffit2_pdesel__name__[] = "pdesel"; - -PyObject * pypdffit2_pdesel(PyObject *, PyObject *args) -{ - int ip; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->pdesel(ip); - } - catch(unassignedError e) - { - // PyErr_Warn(PyExc_Warning, e.GetMsg().c_str()); - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// selectAtomType -char pypdffit2_selectAtomType__doc__[] = "Include element in 'i' or 'j' pair of PDF calculation."; -char pypdffit2_selectAtomType__name__[] = "selectAtomType"; - -PyObject * pypdffit2_selectAtomType(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip; - char ijchar; - char* smbpat; - bool select; - int ok = PyArg_ParseTuple(args, "Oicsb", &py_ppdf, &ip, &ijchar, &smbpat, &select); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->selectAtomType(ip, ijchar, smbpat, select); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) - { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// selectAtomIndex -char pypdffit2_selectAtomIndex__doc__[] = "Include atom of given index in 'i' or 'j' pair of PDF calculation."; -char pypdffit2_selectAtomIndex__name__[] = "selectAtomIndex"; - -PyObject * pypdffit2_selectAtomIndex(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip; - char ijchar; - int aidx1; - bool select; - int ok = PyArg_ParseTuple(args, "Oicib", &py_ppdf, &ip, &ijchar, &aidx1, &select); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->selectAtomIndex(ip, ijchar, aidx1, select); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) - { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// selectAll -char pypdffit2_selectAll__doc__[] = "Include all atoms in 'i' or 'j' pair of PDF calculation."; -char pypdffit2_selectAll__name__[] = "selectAll"; - -PyObject * pypdffit2_selectAll(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip; - char ijchar; - int ok = PyArg_ParseTuple(args, "Oic", &py_ppdf, &ip, &ijchar); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->selectAll(ip, ijchar); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) - { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// selectNone -char pypdffit2_selectNone__doc__[] = "Include all atoms in 'i' or 'j' pair of PDF calculation."; -char pypdffit2_selectNone__name__[] = "selectNone"; - -PyObject * pypdffit2_selectNone(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip; - char ijchar; - int ok = PyArg_ParseTuple(args, "Oic", &py_ppdf, &ip, &ijchar); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try - { - ppdf->selectNone(ip, ijchar); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) - { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// bond_angle -char pypdffit2_bond_angle__doc__[] = "Return bond angle between three atoms."; -char pypdffit2_bond_angle__name__[] = "bond_angle"; - -PyObject * pypdffit2_bond_angle(PyObject *, PyObject *args) -{ - int ia, ja, ka; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oiii", &py_ppdf, &ia, &ja, &ka); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - pair angstd = ppdf->bond_angle(ia, ja, ka); - PyObject* py_tpl; - py_tpl = Py_BuildValue("(d,d)", angstd.first, angstd.second); - return py_tpl; - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// bond_length_atoms (nearest bond length between two atoms) -char pypdffit2_bond_length_atoms__doc__[] = - "Return a tuple of (dij, ddij) for distance between two atoms\n" - "and its standard deviation."; -char pypdffit2_bond_length_atoms__name__[] = "bond_length_atoms"; - -PyObject * pypdffit2_bond_length_atoms(PyObject *, PyObject *args) -{ - int ia, ja; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oii", &py_ppdf, &ia, &ja); - PairDistance pd; - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - pd = ppdf->bond_length_atoms(ia, ja); - PyObject *py_tpl; - py_tpl = Py_BuildValue("(d,d)", pd.dij, pd.ddij); - return py_tpl; - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// bond_length_types (bond lengths between two elements inside given bounds) -char pypdffit2_bond_length_types__doc__[] = - "Return bond lengths between two elements within given bounds\n" - "\n" - "a1 -- symbol of the first element in pair or 'ALL'\n" - "a2 -- symbol of the second element in pair or 'ALL'\n" - "lb -- lower bound for bond lengths\n" - "ub -- upper bound for bond lengths\n" - "\n" - "Return a dictionary of distance data containing:\n" - "\n" - "dij : list of bond lenghts within given bounds\n" - "ddij : list of bond legnth standard deviations\n" - "ij0 : list of tupled pairs of indices starting at 0\n" - "ij1 : list of tupled pairs of indices starting at 1"; -char pypdffit2_bond_length_types__name__[] = "bond_length_types"; - -PyObject * pypdffit2_bond_length_types(PyObject *, PyObject *args) -{ - char* symi; - char* symj; - double bmin = 0; - double bmax = 0; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ossdd", &py_ppdf, &symi, &symj, &bmin, &bmax); - vector pdvec; - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - pdvec = ppdf->bond_length_types(symi, symj, bmin, bmax); - int np = pdvec.size(); - PyObject* py_dij; - PyObject* py_ddij; - PyObject* py_ij0; - PyObject* py_ij1; - py_dij = PyList_New(np); - py_ddij = PyList_New(np); - py_ij0 = PyList_New(np); - py_ij1 = PyList_New(np); - for (int i = 0; i < np; ++i) - { - PairDistance& pd = pdvec[i]; - PyObject *py_item; - py_item = PyFloat_FromDouble(pd.dij); - PyList_SetItem(py_dij, i, py_item); - py_item = PyFloat_FromDouble(pd.ddij); - PyList_SetItem(py_ddij, i, py_item); - py_item = Py_BuildValue("(i,i)", pd.i - 1, pd.j - 1); - PyList_SetItem(py_ij0, i, py_item); - py_item = Py_BuildValue("(i,i)", pd.i, pd.j); - PyList_SetItem(py_ij1, i, py_item); - } - PyObject* py_rv; - py_rv = PyDict_New(); - PyDict_SetItemString(py_rv, "dij", py_dij); - PyDict_SetItemString(py_rv, "ddij", py_ddij); - PyDict_SetItemString(py_rv, "ij0", py_ij0); - PyDict_SetItemString(py_rv, "ij1", py_ij1); - return py_rv; - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } -} - -// get_scat_string -char pypdffit2_get_scat_string__doc__[] = "Return string with scatter details."; -char pypdffit2_get_scat_string__name__[] = "get_scat_string"; - -PyObject * pypdffit2_get_scat_string(PyObject *, PyObject *args) -{ - char stype; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oc", &py_ppdf, &stype); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - string outstring; - if (!ppdf->curphase) - { - PyErr_SetString(pypdffit2_unassignedError, "No scatterers exist"); - return 0; - } - // here curphase exists, get_scat_string throws runtime error - // for invalid stype. - try { - outstring = (ppdf->curphase)->get_scat_string(stype); - } - catch (runtime_error e) { - PyErr_SetString(PyExc_ValueError, e.what()); - return 0; - } - return Py_BuildValue("s", outstring.c_str()); -} - -// get_scat -char pypdffit2_get_scat__doc__[] = "Return scattering factor for given element."; -char pypdffit2_get_scat__name__[] = "get_scat"; - -PyObject * pypdffit2_get_scat(PyObject *, PyObject *args) -{ - char stype; - char* smbpat; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ocs", &py_ppdf, &stype, &smbpat); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - double value; - try { - value = ppdf->get_scat(stype, smbpat); - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - PyObject* py_rv; - py_rv = PyFloat_FromDouble(value); - return py_rv; -} - -// set_scat -char pypdffit2_set_scat__doc__[] = "Set custom scattering factor for given element."; -char pypdffit2_set_scat__name__[] = "set_scat"; - -PyObject * pypdffit2_set_scat(PyObject *, PyObject *args) -{ - char stype; - char* smbpat; - double value; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Ocsd", &py_ppdf, &stype, &smbpat, &value); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - if (!ppdf->curphase) - { - PyErr_SetString(pypdffit2_unassignedError, "phase does not exist"); - return 0; - } - // Here curphase exists. set_scat may throw - // runtime or ValueError for invalid arguments - try { - ppdf->curphase->set_scat(stype, smbpat, value); - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - catch (runtime_error e) { - PyErr_SetString(PyExc_ValueError, e.what()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -// reset_scat -char pypdffit2_reset_scat__doc__[] = "Reset scattering factor for given element."; -char pypdffit2_reset_scat__name__[] = "reset_scat"; - -PyObject * pypdffit2_reset_scat(PyObject *, PyObject *args) -{ - char* smbpat; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Os", &py_ppdf, &smbpat); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - if (!ppdf->curphase) - { - PyErr_SetString(pypdffit2_unassignedError, "phase does not exist"); - return 0; - } - // Here curphase exists. reset_scat may throw - // runtime or ValueError for invalid arguments - try { - ppdf->curphase->reset_scat(smbpat); - } - catch (ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } - Py_INCREF(Py_None); - return Py_None; -} - -//throw-away variable that helps with exception handling -//RefVar *_junkRV = new RefVar(); -// utility function (not available from Python) -RefVar *getRefVar(vector &v, unsigned int i) -{ - if (v.size() == 0) - { - throw unassignedError("Variable not yet assigned"); - } - else if (i > v.size() || i < 1) - { - stringstream errstr; - errstr << "Index " << i << " out of bounds"; - throw ValueError(errstr.str()); - } - return &v[i-1]; -} - -//current phase and set refinable variable pointers - -// lat -char pypdffit2_lat__doc__[] = "Pointer to refinable variable lat."; -char pypdffit2_lat__name__[] = "lat"; - -PyObject * pypdffit2_lat(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->lat,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// x -char pypdffit2_x__doc__[] = "Pointer to refinable variable x."; -char pypdffit2_x__name__[] = "x"; - -PyObject * pypdffit2_x(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->x,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// y -char pypdffit2_y__doc__[] = "Pointer to refinable variable y."; -char pypdffit2_y__name__[] = "y"; - -PyObject * pypdffit2_y(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->y,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// z -char pypdffit2_z__doc__[] = "Pointer to refinable variable z."; -char pypdffit2_z__name__[] = "z"; - -PyObject * pypdffit2_z(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->z,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u11 -char pypdffit2_u11__doc__[] = "Pointer to refinable variable u11."; -char pypdffit2_u11__name__[] = "u11"; - -PyObject * pypdffit2_u11(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u11,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u22 -char pypdffit2_u22__doc__[] = "Pointer to refinable variable u22."; -char pypdffit2_u22__name__[] = "u22"; - -PyObject * pypdffit2_u22(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u22,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u33 -char pypdffit2_u33__doc__[] = "Pointer to refinable variable u33."; -char pypdffit2_u33__name__[] = "u33"; - -PyObject * pypdffit2_u33(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u33,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u12 -char pypdffit2_u12__doc__[] = "Pointer to refinable variable u12."; -char pypdffit2_u12__name__[] = "u12"; - -PyObject * pypdffit2_u12(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u12,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u13 -char pypdffit2_u13__doc__[] = "Pointer to refinable variable u13."; -char pypdffit2_u13__name__[] = "u13"; - -PyObject * pypdffit2_u13(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u13,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// u23 -char pypdffit2_u23__doc__[] = "Pointer to refinable variable u23."; -char pypdffit2_u23__name__[] = "u23"; - -PyObject * pypdffit2_u23(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->u23,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// occ -char pypdffit2_occ__doc__[] = "Pointer to refinable variable occ."; -char pypdffit2_occ__name__[] = "occ"; - -PyObject * pypdffit2_occ(PyObject *, PyObject *args) -{ - int i; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "Oi", &py_ppdf, &i); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - try { - RefVar *v = getRefVar(ppdf->occ,i); - PyObject *py_v = PyCapsule_New(v, cnvar, NULL); - return py_v; - } - catch(unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - catch(ValueError e) { - PyErr_SetString(PyExc_ValueError, e.GetMsg().c_str()); - return 0; - } -} - -// pscale -char pypdffit2_pscale__doc__[] = "Pointer to variable pscale."; -char pypdffit2_pscale__name__[] = "pscale"; - -PyObject * pypdffit2_pscale(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->pscale), cnvar, NULL); - return py_v; -} - -// spdiameter -char pypdffit2_spdiameter__doc__[] = "Pointer to variable spdiameter."; -char pypdffit2_spdiameter__name__[] = "spdiameter"; - -PyObject * pypdffit2_spdiameter(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->spdiameter), cnvar, NULL); - return py_v; -} - -// stepcut -char pypdffit2_stepcut__doc__[] = "Pointer to nonvariable stepcut."; -char pypdffit2_stepcut__name__[] = "stepcut"; - -PyObject * pypdffit2_stepcut(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->stepcut), cnvar, NULL); - return py_v; -} - -// sratio -char pypdffit2_sratio__doc__[] = "Pointer to variable sratio."; -char pypdffit2_sratio__name__[] = "sratio"; - -PyObject * pypdffit2_sratio(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->sratio), cnvar, NULL); - return py_v; -} - -// delta2 -char pypdffit2_delta2__doc__[] = "Pointer to variable delta2."; -char pypdffit2_delta2__name__[] = "delta2"; - -PyObject * pypdffit2_delta2(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->delta2), cnvar, NULL); - return py_v; -} - -// delta1 -char pypdffit2_delta1__doc__[] = "Pointer to variable delta1."; -char pypdffit2_delta1__name__[] = "delta1"; - -PyObject * pypdffit2_delta1(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->delta1), cnvar, NULL); - return py_v; -} - -// dscale -char pypdffit2_dscale__doc__[] = "Pointer to variable dscale."; -char pypdffit2_dscale__name__[] = "dscale"; - -PyObject * pypdffit2_dscale(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->dscale), cnvar, NULL); - return py_v; -} - -// qdamp -char pypdffit2_qdamp__doc__[] = "Pointer to variable qdamp."; -char pypdffit2_qdamp__name__[] = "qdamp"; - -PyObject * pypdffit2_qdamp(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->qdamp), cnvar, NULL); - return py_v; -} - -// qbroad -char pypdffit2_qbroad__doc__[] = "Pointer to variable qbroad."; -char pypdffit2_qbroad__name__[] = "qbroad"; - -PyObject * pypdffit2_qbroad(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->qbroad), cnvar, NULL); - return py_v; -} - -// rcut -char pypdffit2_rcut__doc__[] = "Pointer to nonvariable rcut."; -char pypdffit2_rcut__name__[] = "rcut"; - -PyObject * pypdffit2_rcut(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - PyObject *py_v = PyCapsule_New(&(ppdf->rcut), cnvar, NULL); - return py_v; -} - -// get_atoms -char pypdffit2_get_atoms__doc__[] = "Get element symbols of atoms in the phase."; -char pypdffit2_get_atoms__name__[] = "get_atoms"; - -PyObject * pypdffit2_get_atoms(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip = 0; - int ok = PyArg_ParseTuple(args, "O|i", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - Phase* ph; - try { - ph = ppdf->getphase(ip); - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - // Phase ph is defined here - PyObject *py_atoms = PyList_New(ph->natoms); - for (int i = 0; i < ph->natoms; ++i) - { - string usymbol = toupper(ph->atom[i].atom_type->symbol); - PyList_SetItem(py_atoms, i, PyUnicode_FromString(usymbol.c_str())); - } - return py_atoms; -} - -// num_atoms -char pypdffit2_num_atoms__doc__[] = "Get the number of atoms in the current phase."; -char pypdffit2_num_atoms__name__[] = "num_atoms"; - -PyObject * pypdffit2_num_atoms(PyObject *, PyObject *args) -{ - int retval = 0; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - if (ppdf->curphase) - { - retval = (ppdf->curphase)->natoms; - } - else - { - PyErr_SetString(pypdffit2_unassignedError, "No data loaded"); - return 0; - } - return Py_BuildValue("i", retval); -} - -// get_atom_types -char pypdffit2_get_atom_types__doc__[] = "Get ordered unique symbols of atoms in the phase."; -char pypdffit2_get_atom_types__name__[] = "get_atom_types"; - -PyObject * pypdffit2_get_atom_types(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ip = 0; - int ok = PyArg_ParseTuple(args, "O|i", &py_ppdf, &ip); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - Phase* ph; - try { - ph = ppdf->getphase(ip); - } - catch (unassignedError e) { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - // Phase ph is defined here - PyObject *py_atom_types = PyList_New(ph->atom_types.size()); - for (int i = 0; i < int(ph->atom_types.size()); ++i) - { - string usymbol = toupper(ph->atom_types[i]->symbol); - PyList_SetItem(py_atom_types, i, PyUnicode_FromString(usymbol.c_str())); - } - return py_atom_types; -} - - -// num_phases -char pypdffit2_num_phases__doc__[] = "Get the number of loaded phases."; -char pypdffit2_num_phases__name__[] = "num_phases"; - -PyObject * pypdffit2_num_phases(PyObject *, PyObject *args) -{ - int retval = 0; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - retval = ppdf->num_phases(); - return Py_BuildValue("i", retval); -} - - -// num_datasets -char pypdffit2_num_datasets__doc__[] = "Get the number of loaded datasets."; -char pypdffit2_num_datasets__name__[] = "num_datasets"; - -PyObject * pypdffit2_num_datasets(PyObject *, PyObject *args) -{ - int retval = 0; - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - retval = ppdf->num_datasets(); - return Py_BuildValue("i", retval); -} - - -// phase_fractions -char pypdffit2_phase_fractions__doc__[] = - "Return relative phase fractions for current dataset scattering type\n" - "\n" - "Return a dictionary of relative phase fractions:\n" - "\n" - "atom -- list of fractions normalized to atom count\n" - "stdatom -- errors of atom count fractions\n" - "cell -- list of fractions normalized to unit cell count\n" - "stdcell -- errors of unit cell count fractions\n" - "mass -- list of relative weight fractions\n" - "stdmass -- errors of relative weight fractions\n" - ; -char pypdffit2_phase_fractions__name__[] = "phase_fractions"; - -PyObject * pypdffit2_phase_fractions(PyObject *, PyObject *args) -{ - PyObject *py_ppdf = 0; - int ok = PyArg_ParseTuple(args, "O", &py_ppdf); - if (!ok) return 0; - PdfFit *ppdf = (PdfFit *) PyCapsule_GetPointer(py_ppdf, cnpfit); - map > fractions; - try - { - fractions = ppdf->getPhaseFractions(); - } - catch(unassignedError e) - { - PyErr_SetString(pypdffit2_unassignedError, e.GetMsg().c_str()); - return 0; - } - // convert fractions map to an equivalent python dictionary - map >::iterator ii; - PyObject* py_rv; - py_rv = PyDict_New(); - for (ii = fractions.begin(); ii != fractions.end(); ++ii) - { - int n = ii->second.size(); - PyObject* py_lst; - py_lst = PyList_New(n); - for (int i = 0; i < n; ++i) - { - PyObject* py_value; - py_value = PyFloat_FromDouble(ii->second.at(i)); - PyList_SetItem(py_lst, i, py_value); - } - PyDict_SetItemString(py_rv, ii->first.c_str(), py_lst); - } - return py_rv; -} - -// redirect_stdout -char pypdffit2_redirect_stdout__doc__[] = "Redirect engine output to a file-like object."; -char pypdffit2_redirect_stdout__name__[] = "redirect_stdout"; - -PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *args) -{ - // instance of PyFileStreambuf which takes care of redirection - PyObject *py_file = 0; - int ok = PyArg_ParseTuple(args, "O", &py_file); - if (!ok) return 0; - // check if py_file has write and flush attributes - if ( !PyObject_HasAttrString(py_file, "write") || - !PyObject_HasAttrString(py_file, "flush") ) - { - PyErr_SetString(PyExc_TypeError, "expected file-like argument"); - return 0; - } - // create py_stdout_streambuf if necessary - if (!py_stdout_streambuf) - { - py_stdout_streambuf = new PyFileStreambuf(py_file); - } - py_stdout_streambuf->redirect(py_file); - // on first redirection we need to assign new ostream to NS_PDFFIT2::pout - if (NS_PDFFIT2::pout == &std::cout) - { - NS_PDFFIT2::pout = new ostream(py_stdout_streambuf); - } - Py_INCREF(Py_None); - return Py_None; -} - -// is_element -char pypdffit2_is_element__doc__[] = "Check if element or isotope is defined in the built-in periodic table."; -char pypdffit2_is_element__name__[] = "is_element"; - -PyObject * pypdffit2_is_element(PyObject *, PyObject *args) -{ - // instance of PyFileStreambuf which takes care of redirection - char *smbpat; - int ok = PyArg_ParseTuple(args, "s", &smbpat); - if (!ok) return 0; - const LocalPeriodicTable* lpt = LocalPeriodicTable::instance(); - PyObject *rv = PyBool_FromLong(lpt->has(smbpat)); - return rv; -} - -// End of file diff --git a/pdffit2module/misc.h b/pdffit2module/misc.h deleted file mode 100644 index f8782307..00000000 --- a/pdffit2module/misc.h +++ /dev/null @@ -1,486 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Bindings from python to c++ PdfFit class. -* -* Comments: -* -***********************************************************************/ - -#ifndef PYPDFFIT2_MISC_H -#define PYPDFFIT2_MISC_H - -// copyright -extern char pypdffit2_copyright__name__[]; -extern char pypdffit2_copyright__doc__[]; -extern "C" -PyObject * pypdffit2_copyright(PyObject *, PyObject *); - -// create -extern char pypdffit2_create__name__[]; -extern char pypdffit2_create__doc__[]; -extern "C" -PyObject * pypdffit2_create(PyObject *, PyObject *); - -// read_struct -extern char pypdffit2_read_struct__name__[]; -extern char pypdffit2_read_struct__doc__[]; -extern "C" -PyObject * pypdffit2_read_struct(PyObject *, PyObject *); - -// read_struct_string -extern char pypdffit2_read_struct_string__name__[]; -extern char pypdffit2_read_struct_string__doc__[]; -extern "C" -PyObject * pypdffit2_read_struct_string(PyObject *, PyObject *); - -// read_data -extern char pypdffit2_read_data__name__[]; -extern char pypdffit2_read_data__doc__[]; -extern "C" -PyObject * pypdffit2_read_data(PyObject *, PyObject *); - -// read_data_string -extern char pypdffit2_read_data_string__name__[]; -extern char pypdffit2_read_data_string__doc__[]; -extern "C" -PyObject * pypdffit2_read_data_string(PyObject *, PyObject *); - -// read_data_arrays -extern char pypdffit2_read_data_arrays__name__[]; -extern char pypdffit2_read_data_arrays__doc__[]; -extern "C" -PyObject * pypdffit2_read_data_arrays(PyObject *, PyObject *); - -// pdfrange -extern char pypdffit2_pdfrange__doc__[]; -extern char pypdffit2_pdfrange__name__[]; -extern "C" -PyObject * pypdffit2_pdfrange(PyObject *, PyObject *); - -// reset -extern char pypdffit2_reset__doc__[]; -extern char pypdffit2_reset__name__[]; -extern "C" -PyObject * pypdffit2_reset(PyObject *, PyObject *); - -// alloc -extern char pypdffit2_alloc__doc__[]; -extern char pypdffit2_alloc__name__[]; -extern "C" -PyObject * pypdffit2_alloc(PyObject *, PyObject *); - -// calc -extern char pypdffit2_calc__doc__[]; -extern char pypdffit2_calc__name__[]; -extern "C" -PyObject * pypdffit2_calc(PyObject *, PyObject *); - -// refine -extern char pypdffit2_refine__doc__[]; -extern char pypdffit2_refine__name__[]; -extern "C" -PyObject * pypdffit2_refine(PyObject *, PyObject *); - -// refine_step -extern char pypdffit2_refine_step__doc__[]; -extern char pypdffit2_refine_step__name__[]; -extern "C" -PyObject * pypdffit2_refine_step(PyObject *, PyObject *); - -// save_pdf -extern char pypdffit2_save_pdf__doc__[]; -extern char pypdffit2_save_pdf__name__[]; -extern "C" -PyObject * pypdffit2_save_pdf(PyObject *, PyObject *); - -// save_dif -extern char pypdffit2_save_dif__doc__[]; -extern char pypdffit2_save_dif__name__[]; -extern "C" -PyObject * pypdffit2_save_dif(PyObject *, PyObject *); - -// save_res -extern char pypdffit2_save_res__doc__[]; -extern char pypdffit2_save_res__name__[]; -extern "C" -PyObject * pypdffit2_save_res(PyObject *, PyObject *); - -// save_struct -extern char pypdffit2_save_struct__doc__[]; -extern char pypdffit2_save_struct__name__[]; -extern "C" -PyObject * pypdffit2_save_struct(PyObject *, PyObject *); - -// show_struct -extern char pypdffit2_show_struct__doc__[]; -extern char pypdffit2_show_struct__name__[]; -extern "C" -PyObject * pypdffit2_show_struct(PyObject *, PyObject *); - -// constrain to string -extern char pypdffit2_constrain_str__doc__[]; -extern char pypdffit2_constrain_str__name__[]; -extern "C" -PyObject * pypdffit2_constrain_str(PyObject *, PyObject *); - -// constrain_int to integer -extern char pypdffit2_constrain_int__doc__[]; -extern char pypdffit2_constrain_int__name__[]; -extern "C" -PyObject * pypdffit2_constrain_int(PyObject *, PyObject *); - -// setpar_dbl -extern char pypdffit2_setpar_dbl__doc__[]; -extern char pypdffit2_setpar_dbl__name__[]; -extern "C" -PyObject * pypdffit2_setpar_dbl(PyObject *, PyObject *); - -// setpar with RefVar -extern char pypdffit2_setpar_RV__doc__[]; -extern char pypdffit2_setpar_RV__name__[]; -extern "C" -PyObject * pypdffit2_setpar_RV(PyObject *, PyObject *); - -// setvar -extern char pypdffit2_setvar__doc__[]; -extern char pypdffit2_setvar__name__[]; -extern "C" -PyObject * pypdffit2_setvar(PyObject *, PyObject *); - -// getvar -extern char pypdffit2_getvar__doc__[]; -extern char pypdffit2_getvar__name__[]; -extern "C" -PyObject * pypdffit2_getvar(PyObject *, PyObject *); - -// getR -extern char pypdffit2_getR__doc__[]; -extern char pypdffit2_getR__name__[]; -extern "C" -PyObject * pypdffit2_getR(PyObject *, PyObject *); - -// getpdf_fit -extern char pypdffit2_getpdf_fit__doc__[]; -extern char pypdffit2_getpdf_fit__name__[]; -extern "C" -PyObject * pypdffit2_getpdf_fit(PyObject *, PyObject *); - -// getpdf_obs -extern char pypdffit2_getpdf_obs__doc__[]; -extern char pypdffit2_getpdf_obs__name__[]; -extern "C" -PyObject * pypdffit2_getpdf_obs(PyObject *, PyObject *); - -// getpdf_diff -extern char pypdffit2_getpdf_diff__doc__[]; -extern char pypdffit2_getpdf_diff__name__[]; -extern "C" -PyObject * pypdffit2_getpdf_diff(PyObject *, PyObject *); - -// getcrw -extern char pypdffit2_getcrw__doc__[]; -extern char pypdffit2_getcrw__name__[]; -extern "C" -PyObject * pypdffit2_getcrw(PyObject *, PyObject *); - -// getrw -extern char pypdffit2_getrw__doc__[]; -extern char pypdffit2_getrw__name__[]; -extern "C" -PyObject * pypdffit2_getrw(PyObject *, PyObject *); - -// getpar -extern char pypdffit2_getpar__doc__[]; -extern char pypdffit2_getpar__name__[]; -extern "C" -PyObject * pypdffit2_getpar(PyObject *, PyObject *); - -// fixpar -extern char pypdffit2_fixpar__doc__[]; -extern char pypdffit2_fixpar__name__[]; -extern "C" -PyObject * pypdffit2_fixpar(PyObject *, PyObject *); - -// freepar -extern char pypdffit2_freepar__doc__[]; -extern char pypdffit2_freepar__name__[]; -extern "C" -PyObject * pypdffit2_freepar(PyObject *, PyObject *); - -// setphase -extern char pypdffit2_setphase__doc__[]; -extern char pypdffit2_setphase__name__[]; -extern "C" -PyObject * pypdffit2_setphase(PyObject *, PyObject *); - -// setdata -extern char pypdffit2_setdata__doc__[]; -extern char pypdffit2_setdata__name__[]; -extern "C" -PyObject * pypdffit2_setdata(PyObject *, PyObject *); - -// psel -extern char pypdffit2_psel__doc__[]; -extern char pypdffit2_psel__name__[]; -extern "C" -PyObject * pypdffit2_psel(PyObject *, PyObject *); - -// pdesel -extern char pypdffit2_pdesel__doc__[]; -extern char pypdffit2_pdesel__name__[]; -extern "C" -PyObject * pypdffit2_pdesel(PyObject *, PyObject *); - -// selectAtomType -extern char pypdffit2_selectAtomType__doc__[]; -extern char pypdffit2_selectAtomType__name__[]; -extern "C" -PyObject * pypdffit2_selectAtomType(PyObject *, PyObject *); - -// selectAtomIndex -extern char pypdffit2_selectAtomIndex__doc__[]; -extern char pypdffit2_selectAtomIndex__name__[]; -extern "C" -PyObject * pypdffit2_selectAtomIndex(PyObject *, PyObject *); - -// selectAll -extern char pypdffit2_selectAll__doc__[]; -extern char pypdffit2_selectAll__name__[]; -extern "C" -PyObject * pypdffit2_selectAll(PyObject *, PyObject *); - -// selectNone -extern char pypdffit2_selectNone__doc__[]; -extern char pypdffit2_selectNone__name__[]; -extern "C" -PyObject * pypdffit2_selectNone(PyObject *, PyObject *); - -// bond_angle -extern char pypdffit2_bond_angle__doc__[]; -extern char pypdffit2_bond_angle__name__[]; -extern "C" -PyObject * pypdffit2_bond_angle(PyObject *, PyObject *); - -// bond_length_atoms -extern char pypdffit2_bond_length_atoms__doc__[]; -extern char pypdffit2_bond_length_atoms__name__[]; -extern "C" -PyObject * pypdffit2_bond_length_atoms(PyObject *, PyObject *); - -// bond_length_types -extern char pypdffit2_bond_length_types__doc__[]; -extern char pypdffit2_bond_length_types__name__[]; -extern "C" -PyObject * pypdffit2_bond_length_types(PyObject *, PyObject *); - -// get_scat_string -extern char pypdffit2_get_scat_string__doc__[]; -extern char pypdffit2_get_scat_string__name__[]; -extern "C" -PyObject * pypdffit2_get_scat_string(PyObject *, PyObject *); - -// get_scat -extern char pypdffit2_get_scat__doc__[]; -extern char pypdffit2_get_scat__name__[]; -extern "C" -PyObject * pypdffit2_get_scat(PyObject *, PyObject *); - -// set_scat -extern char pypdffit2_set_scat__doc__[]; -extern char pypdffit2_set_scat__name__[]; -extern "C" -PyObject * pypdffit2_set_scat(PyObject *, PyObject *); - -// reset_scat -extern char pypdffit2_reset_scat__doc__[]; -extern char pypdffit2_reset_scat__name__[]; -extern "C" -PyObject * pypdffit2_reset_scat(PyObject *, PyObject *); - -// lat -extern char pypdffit2_lat__doc__[]; -extern char pypdffit2_lat__name__[]; -extern "C" -PyObject * pypdffit2_lat(PyObject *, PyObject *); - -// x -extern char pypdffit2_x__doc__[]; -extern char pypdffit2_x__name__[]; -extern "C" -PyObject * pypdffit2_x(PyObject *, PyObject *); - -// y -extern char pypdffit2_y__doc__[]; -extern char pypdffit2_y__name__[]; -extern "C" -PyObject * pypdffit2_y(PyObject *, PyObject *); - -// z -extern char pypdffit2_z__doc__[]; -extern char pypdffit2_z__name__[]; -extern "C" -PyObject * pypdffit2_z(PyObject *, PyObject *); - -// u11 -extern char pypdffit2_u11__doc__[]; -extern char pypdffit2_u11__name__[]; -extern "C" -PyObject * pypdffit2_u11(PyObject *, PyObject *); - -// u22 -extern char pypdffit2_u22__doc__[]; -extern char pypdffit2_u22__name__[]; -extern "C" -PyObject * pypdffit2_u22(PyObject *, PyObject *); - -// u33 -extern char pypdffit2_u33__doc__[]; -extern char pypdffit2_u33__name__[]; -extern "C" -PyObject * pypdffit2_u33(PyObject *, PyObject *); - -// u12 -extern char pypdffit2_u12__doc__[]; -extern char pypdffit2_u12__name__[]; -extern "C" -PyObject * pypdffit2_u12(PyObject *, PyObject *); - -// u13 -extern char pypdffit2_u13__doc__[]; -extern char pypdffit2_u13__name__[]; -extern "C" -PyObject * pypdffit2_u13(PyObject *, PyObject *); - -// u23 -extern char pypdffit2_u23__doc__[]; -extern char pypdffit2_u23__name__[]; -extern "C" -PyObject * pypdffit2_u23(PyObject *, PyObject *); - -// occ -extern char pypdffit2_occ__doc__[]; -extern char pypdffit2_occ__name__[]; -extern "C" -PyObject * pypdffit2_occ(PyObject *, PyObject *); - -// pscale -extern char pypdffit2_pscale__doc__[]; -extern char pypdffit2_pscale__name__[]; -extern "C" -PyObject * pypdffit2_pscale(PyObject *, PyObject *); - -// spdiameter -extern char pypdffit2_spdiameter__doc__[]; -extern char pypdffit2_spdiameter__name__[]; -extern "C" -PyObject * pypdffit2_spdiameter(PyObject *, PyObject *); - -// stepcut -extern char pypdffit2_stepcut__doc__[]; -extern char pypdffit2_stepcut__name__[]; -extern "C" -PyObject * pypdffit2_stepcut(PyObject *, PyObject *); - -// sratio -extern char pypdffit2_sratio__doc__[]; -extern char pypdffit2_sratio__name__[]; -extern "C" -PyObject * pypdffit2_sratio(PyObject *, PyObject *); - -// delta2 -extern char pypdffit2_delta2__doc__[]; -extern char pypdffit2_delta2__name__[]; -extern "C" -PyObject * pypdffit2_delta2(PyObject *, PyObject *); - -// delta1 -extern char pypdffit2_delta1__doc__[]; -extern char pypdffit2_delta1__name__[]; -extern "C" -PyObject * pypdffit2_delta1(PyObject *, PyObject *); - -// dscale -extern char pypdffit2_dscale__doc__[]; -extern char pypdffit2_dscale__name__[]; -extern "C" -PyObject * pypdffit2_dscale(PyObject *, PyObject *); - -// qdamp -extern char pypdffit2_qdamp__doc__[]; -extern char pypdffit2_qdamp__name__[]; -extern "C" -PyObject * pypdffit2_qdamp(PyObject *, PyObject *); - -// qbroad -extern char pypdffit2_qbroad__doc__[]; -extern char pypdffit2_qbroad__name__[]; -extern "C" -PyObject * pypdffit2_qbroad(PyObject *, PyObject *); - -// rcut -extern char pypdffit2_rcut__doc__[]; -extern char pypdffit2_rcut__name__[]; -extern "C" -PyObject * pypdffit2_rcut(PyObject *, PyObject *); - -// get_atoms -extern char pypdffit2_get_atoms__doc__[]; -extern char pypdffit2_get_atoms__name__[]; -extern "C" -PyObject * pypdffit2_get_atoms(PyObject *, PyObject *); - -// num_atoms -extern char pypdffit2_num_atoms__doc__[]; -extern char pypdffit2_num_atoms__name__[]; -extern "C" -PyObject * pypdffit2_num_atoms(PyObject *, PyObject *); - -// get_atom_types -extern char pypdffit2_get_atom_types__doc__[]; -extern char pypdffit2_get_atom_types__name__[]; -extern "C" -PyObject * pypdffit2_get_atom_types(PyObject *, PyObject *); - -// num_phases -extern char pypdffit2_num_phases__doc__[]; -extern char pypdffit2_num_phases__name__[]; -extern "C" -PyObject * pypdffit2_num_phases(PyObject *, PyObject *); - -// num_datasets -extern char pypdffit2_num_datasets__doc__[]; -extern char pypdffit2_num_datasets__name__[]; -extern "C" -PyObject * pypdffit2_num_datasets(PyObject *, PyObject *); - -// phase_fractions -extern char pypdffit2_phase_fractions__doc__[]; -extern char pypdffit2_phase_fractions__name__[]; -extern "C" -PyObject * pypdffit2_phase_fractions(PyObject *, PyObject *); - -// redirect_stdout -extern char pypdffit2_redirect_stdout__doc__[]; -extern char pypdffit2_redirect_stdout__name__[]; -extern "C" -PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *); - -// is_element -extern char pypdffit2_is_element__doc__[]; -extern char pypdffit2_is_element__name__[]; -extern "C" -PyObject * pypdffit2_is_element(PyObject *, PyObject *); - -#endif // PYPDFFIT2_MISC_H diff --git a/pdffit2module/pdffit2module.cc b/pdffit2module/pdffit2module.cc deleted file mode 100644 index acf89fa3..00000000 --- a/pdffit2module/pdffit2module.cc +++ /dev/null @@ -1,150 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* The python pdffit2 module. -* -* Comments: -* -***********************************************************************/ -#define PY_SSIZE_T_CLEAN -#include -#include - -#include "pyexceptions.h" -#include "bindings.h" -#include "libpdffit2/pdffit.h" - -using namespace std; - -char pypdffit2_module__doc__[] = - "pdffit2 - interface to the core calculation routines in C++"; - -// local helper for transfer version information from -// Python to C++ PdfFit class. - -namespace { - -void transfer_version() -{ - // obtain version information from the Python module - PyObject* mdiffpy_pdffit2; - mdiffpy_pdffit2 = PyImport_ImportModule("diffpy.pdffit2"); - if (!mdiffpy_pdffit2) return; - PyObject* pyversion; - pyversion = PyObject_GetAttrString(mdiffpy_pdffit2, "__version__"); - Py_DECREF(mdiffpy_pdffit2); - if (!pyversion) return; - const char* cversion; -#if PY_MAJOR_VERSION >= 3 - cversion = PyUnicode_AsUTF8(pyversion); -#else - cversion = PyString_AsString(pyversion); -#endif - // copy version information to C++ constant - if (cversion) PdfFit::version(cversion); - Py_DECREF(pyversion); -} - - -void setup_module_contents(PyObject* d) -{ - // install the module exceptions - pypdffit2_runtimeError = PyErr_NewException("pdffit2.runtime", 0, 0); - PyDict_SetItemString(d, "RuntimeException", pypdffit2_runtimeError); - - pypdffit2_unassignedError = PyErr_NewException( - "pdffit2.unassignedError", 0, 0); - PyDict_SetItemString(d, "unassignedError", pypdffit2_unassignedError); - - pypdffit2_dataError = PyErr_NewException( - "pdffit2.dataError", 0, 0); - PyDict_SetItemString(d, "dataError", pypdffit2_dataError); - - pypdffit2_structureError = PyErr_NewException( - "pdffit2.structureError", 0, 0); - PyDict_SetItemString(d, "structureError", pypdffit2_structureError); - - pypdffit2_calculationError = PyErr_NewException( - "pdffit2.calculationError", 0, 0); - PyDict_SetItemString(d, "calculationError", pypdffit2_calculationError); - - pypdffit2_constraintError = PyErr_NewException( - "pdffit2.constraintError", 0, 0); - PyDict_SetItemString(d, "constraintError", pypdffit2_constraintError); - - transfer_version(); -} - -} // namespace ------------------------------------------------------------- - -// TODO remove PY_MAJOR_VERSION blocks after ending support for Python 2.7 - -#if PY_MAJOR_VERSION == 2 - -// Initialization function for the module (*must* be called initpdffit2) -extern "C" -void -initpdffit2() -{ - // create the module and add the functions - PyObject * m = Py_InitModule4( - "pdffit2", pypdffit2_methods, - pypdffit2_module__doc__, 0, PYTHON_API_VERSION); - - // get its dictionary - PyObject * d = PyModule_GetDict(m); - - // check for errors - if (PyErr_Occurred()) { - Py_FatalError("can't initialize module pdffit2"); - } - - // install the module exceptions and version string - setup_module_contents(d); - - return; -} - -#else - -// Module initialization for Python 3 ---------------------------------------- - -static struct PyModuleDef pdffit2moduledef = { - PyModuleDef_HEAD_INIT, - // .m_name = - "pdffit2", - // .m_doc = - pypdffit2_module__doc__, - // .m_size = - -1, - // .m_methods = - pypdffit2_methods, -}; - - -PyMODINIT_FUNC -PyInit_pdffit2(void) - -{ - PyObject *module = PyModule_Create(&pdffit2moduledef); - if (module == NULL) return NULL; - - PyObject* d = PyModule_GetDict(module); - setup_module_contents(d); - return module; -} - -#endif // PY_MAJOR_VERSION == 2 - -// End of file diff --git a/pdffit2module/pyexceptions.cc b/pdffit2module/pyexceptions.cc deleted file mode 100644 index e94b3d16..00000000 --- a/pdffit2module/pyexceptions.cc +++ /dev/null @@ -1,30 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Exceptions for pdffit2 python module. -* -* Comments: -* -***********************************************************************/ -#define PY_SSIZE_T_CLEAN -#include - -PyObject *pypdffit2_runtimeError = 0; -PyObject *pypdffit2_unassignedError = 0; -PyObject *pypdffit2_dataError = 0; -PyObject *pypdffit2_structureError = 0; -PyObject *pypdffit2_calculationError = 0; -PyObject *pypdffit2_constraintError = 0; - -// End of file diff --git a/pdffit2module/pyexceptions.h b/pdffit2module/pyexceptions.h deleted file mode 100644 index 09bd942b..00000000 --- a/pdffit2module/pyexceptions.h +++ /dev/null @@ -1,33 +0,0 @@ -/*********************************************************************** -* -* pdffit2 by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2006 trustees of the Michigan State University -* All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -************************************************************************ -* -* Exceptions for pdffit2 python module. -* -* Comments: -* -***********************************************************************/ - -#ifndef PYPDFFIT2_EXCEPTIONS_H -#define PYPDFFIT2_EXCEPTIONS_H - -// exceptions - -extern PyObject *pypdffit2_runtimeError; -extern PyObject *pypdffit2_unassignedError; -extern PyObject *pypdffit2_dataError; -extern PyObject *pypdffit2_structureError; -extern PyObject *pypdffit2_constraintError; -extern PyObject *pypdffit2_calculationError; - -#endif // PYPDFFIT2_EXCEPTIONS_H From c6d6cffc62c54bd1dabc7a74994d3c6f77d41e1d Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:02:27 -0400 Subject: [PATCH 032/294] Update init py files --- src/diffpy/__init__.py | 6 +- src/diffpy/pdffit2/__init__.py | 9 ++- src/diffpy/pdffit2/tests/__init__.py | 102 +++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 2 deletions(-) diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 5b3af482..e1ae0400 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -1,6 +1,8 @@ #!/usr/bin/env python ############################################################################## # +# (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. # @@ -13,7 +15,9 @@ # ############################################################################## -"""Blank namespace package for module diffpy.""" +"""diffpy - tools for structure analysis by diffraction. + +Blank namespace package for module diffpy.""" from pkgutil import extend_path diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index e12b2fb9..c5a8e039 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -1,6 +1,8 @@ #!/usr/bin/env python ############################################################################## # +# (c) 2006 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. # @@ -16,9 +18,14 @@ """PDFfit2 - real space structure refinement program.""" # package version -from diffpy.pdffit2.version import __version__ +from diffpy.pdffit2.version import __version__, __date__ +from diffpy.pdffit2.pdffit import PdfFit +from diffpy.pdffit2.output import redirect_stdout +from diffpy.pdffit2.pdffit2 import is_element # silence the pyflakes syntax checker assert __version__ or True +assert __date__ or True +assert all((PdfFit, redirect_stdout, is_element)) # End of file diff --git a/src/diffpy/pdffit2/tests/__init__.py b/src/diffpy/pdffit2/tests/__init__.py index e69de29b..174b14d2 100644 --- a/src/diffpy/pdffit2/tests/__init__.py +++ b/src/diffpy/pdffit2/tests/__init__.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +############################################################################## +# +# (c) 2012 Trustees of the Columbia University in the City of New York. +# All rights reserved. +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. +# +# File coded by: Billinge Group members and community contributors. +# +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors +# +# See LICENSE.rst for license information. +# +############################################################################## + +"""Unit tests for the diffpy.pdffit2 package. +""" + +import unittest + +def testsuite(pattern=''): + '''Create a unit tests suite for the diffpy.pdffit2 package. + + Parameters + ---------- + pattern : str, optional + Regular expression pattern for selecting test cases. + Select all tests when empty. Ignore the pattern when + any of unit test modules fails to import. + + Returns + ------- + suite : `unittest.TestSuite` + The TestSuite object containing the matching tests. + ''' + import re + from os.path import dirname + from itertools import chain + from pkg_resources import resource_filename + loader = unittest.defaultTestLoader + thisdir = resource_filename(__name__, '') + depth = __name__.count('.') + 1 + topdir = thisdir + for i in range(depth): + topdir = dirname(topdir) + suite_all = loader.discover(thisdir, pattern='*Test*.py', + top_level_dir=topdir) + # always filter the suite by pattern to test-cover the selection code. + suite = unittest.TestSuite() + rx = re.compile(pattern) + tsuites = list(chain.from_iterable(suite_all)) + tsok = all(isinstance(ts, unittest.TestSuite) for ts in tsuites) + if not tsok: # pragma: no cover + return suite_all + tcases = chain.from_iterable(tsuites) + for tc in tcases: + tcwords = tc.id().split('.') + shortname = '.'.join(tcwords[-3:]) + if rx.search(shortname): + suite.addTest(tc) + # verify all tests are found for an empty pattern. + assert pattern or suite_all.countTestCases() == suite.countTestCases() + return suite + + +def test(): + '''Execute all unit tests for the diffpy.pdffit2 package. + + Returns + ------- + result : `unittest.TestResult` + ''' + suite = testsuite() + runner = unittest.TextTestRunner() + result = runner.run(suite) + return result + + +def testdeps(): + '''Execute all unit tests for diffpy.pdffit2 and its dependencies. + + Returns + ------- + result : `unittest.TestResult` + ''' + from importlib import import_module + modulenames = ''' + diffpy.pdffit2.tests + diffpy.structure.tests + '''.split() + suite = unittest.TestSuite() + for mname in modulenames: + mod = import_module(mname) + suite.addTests(mod.testsuite()) + runner = unittest.TextTestRunner() + result = runner.run(suite) + return result + + +# End of file From 055ccd04a1fd78ed618aecf740d61321b1b60267 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:06:22 -0400 Subject: [PATCH 033/294] add six to requirements --- requirements/run.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/run.txt b/requirements/run.txt index 9cc306b0..33133cd6 100644 --- a/requirements/run.txt +++ b/requirements/run.txt @@ -1 +1,2 @@ diffpy.structure +six From e77515def0e4e488648e4450e315f750985bf214 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:09:54 -0400 Subject: [PATCH 034/294] run.py without pytest --- src/diffpy/pdffit2/tests/run.py | 42 +++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/diffpy/pdffit2/tests/run.py b/src/diffpy/pdffit2/tests/run.py index 463f010e..39ae1dcf 100644 --- a/src/diffpy/pdffit2/tests/run.py +++ b/src/diffpy/pdffit2/tests/run.py @@ -1,6 +1,8 @@ #!/usr/bin/env python ############################################################################## # +# (c) 2012 Trustees of the Columbia University in the City of New York. +# All rights reserved. # (c) 2024 The Trustees of Columbia University in the City of New York. # All rights reserved. # @@ -12,23 +14,39 @@ # See LICENSE.rst for license information. # ############################################################################## + """Convenience module for executing all unit tests with python -m diffpy.pdffit2.tests.run """ -import sys -import pytest +if __name__ == '__main__': + import sys + # show warnings by default + if not sys.warnoptions: + import os, warnings + warnings.simplefilter("default") + # also affect subprocesses + os.environ["PYTHONWARNINGS"] = "default" + from diffpy.pdffit2.tests import test + # produce zero exit code for a successful test + sys.exit(not test().wasSuccessful()) + -if __name__ == "__main__": - # show output results from every test function - args = ["-v"] - # show the message output for skipped and expected failure tests - if len(sys.argv) > 1: - args.extend(sys.argv[1:]) - print("pytest arguments: {}".format(args)) - # call pytest and exit with the return code from pytest - exit_res = pytest.main(args) - sys.exit(exit_res) +# Consider upgrading to pytest +# import sys +# +# import pytest +# +# if __name__ == "__main__": +# # show output results from every test function +# args = ["-v"] +# # show the message output for skipped and expected failure tests +# if len(sys.argv) > 1: +# args.extend(sys.argv[1:]) +# print("pytest arguments: {}".format(args)) +# # call pytest and exit with the return code from pytest +# exit_res = pytest.main(args) +# sys.exit(exit_res) # End of file From 29d68a277e06e4ee5b6d04c8e5159a230f8cc4cf Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:25:08 -0400 Subject: [PATCH 035/294] add other vars in version.py --- src/diffpy/pdffit2/version.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 69e4d1b2..478a5ca7 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -16,11 +16,14 @@ """Definition of __version__.""" # We do not use the other three variables, but can be added back if needed. -# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] +__all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] # obtain version information from importlib.metadata import version __version__ = version("diffpy.pdffit2") +__date__ = __all__[0] +__git_commit__ = __all__[1] +__timestamp__ = __all__[2] -# End of file +# End of file \ No newline at end of file From 7f6ca7cd7e4ba4f879dd4133634c7bbc33b27bf4 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:30:12 -0400 Subject: [PATCH 036/294] pre-commit fixes --- src/diffpy/pdffit2/tests/__init__.py | 37 +++++++++++++++------------- src/diffpy/pdffit2/tests/run.py | 8 ++++-- src/diffpy/pdffit2/version.py | 2 +- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/diffpy/pdffit2/tests/__init__.py b/src/diffpy/pdffit2/tests/__init__.py index 174b14d2..4ffdb21c 100644 --- a/src/diffpy/pdffit2/tests/__init__.py +++ b/src/diffpy/pdffit2/tests/__init__.py @@ -20,8 +20,9 @@ import unittest -def testsuite(pattern=''): - '''Create a unit tests suite for the diffpy.pdffit2 package. + +def testsuite(pattern=""): + """Create a unit tests suite for the diffpy.pdffit2 package. Parameters ---------- @@ -34,30 +35,31 @@ def testsuite(pattern=''): ------- suite : `unittest.TestSuite` The TestSuite object containing the matching tests. - ''' + """ import re - from os.path import dirname from itertools import chain + from os.path import dirname + from pkg_resources import resource_filename + loader = unittest.defaultTestLoader - thisdir = resource_filename(__name__, '') - depth = __name__.count('.') + 1 + thisdir = resource_filename(__name__, "") + depth = __name__.count(".") + 1 topdir = thisdir for i in range(depth): topdir = dirname(topdir) - suite_all = loader.discover(thisdir, pattern='*Test*.py', - top_level_dir=topdir) + suite_all = loader.discover(thisdir, pattern="*Test*.py", top_level_dir=topdir) # always filter the suite by pattern to test-cover the selection code. suite = unittest.TestSuite() rx = re.compile(pattern) tsuites = list(chain.from_iterable(suite_all)) tsok = all(isinstance(ts, unittest.TestSuite) for ts in tsuites) - if not tsok: # pragma: no cover + if not tsok: # pragma: no cover return suite_all tcases = chain.from_iterable(tsuites) for tc in tcases: - tcwords = tc.id().split('.') - shortname = '.'.join(tcwords[-3:]) + tcwords = tc.id().split(".") + shortname = ".".join(tcwords[-3:]) if rx.search(shortname): suite.addTest(tc) # verify all tests are found for an empty pattern. @@ -66,12 +68,12 @@ def testsuite(pattern=''): def test(): - '''Execute all unit tests for the diffpy.pdffit2 package. + """Execute all unit tests for the diffpy.pdffit2 package. Returns ------- result : `unittest.TestResult` - ''' + """ suite = testsuite() runner = unittest.TextTestRunner() result = runner.run(suite) @@ -79,17 +81,18 @@ def test(): def testdeps(): - '''Execute all unit tests for diffpy.pdffit2 and its dependencies. + """Execute all unit tests for diffpy.pdffit2 and its dependencies. Returns ------- result : `unittest.TestResult` - ''' + """ from importlib import import_module - modulenames = ''' + + modulenames = """ diffpy.pdffit2.tests diffpy.structure.tests - '''.split() + """.split() suite = unittest.TestSuite() for mname in modulenames: mod = import_module(mname) diff --git a/src/diffpy/pdffit2/tests/run.py b/src/diffpy/pdffit2/tests/run.py index 39ae1dcf..d5c4ea41 100644 --- a/src/diffpy/pdffit2/tests/run.py +++ b/src/diffpy/pdffit2/tests/run.py @@ -20,15 +20,19 @@ """ -if __name__ == '__main__': +if __name__ == "__main__": import sys + # show warnings by default if not sys.warnoptions: - import os, warnings + import os + import warnings + warnings.simplefilter("default") # also affect subprocesses os.environ["PYTHONWARNINGS"] = "default" from diffpy.pdffit2.tests import test + # produce zero exit code for a successful test sys.exit(not test().wasSuccessful()) diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 478a5ca7..60d34a97 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -26,4 +26,4 @@ __git_commit__ = __all__[1] __timestamp__ = __all__[2] -# End of file \ No newline at end of file +# End of file From 26776a3b492df4203483e3343651b1b299b61695 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 12:32:42 -0400 Subject: [PATCH 037/294] isort fix --- .pre-commit-config.yaml | 2 +- src/diffpy/pdffit2/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0ab2ecdd..8aedd156 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: hooks: - id: isort args: ["--profile", "black", "--order-by-type"] - exclude: ^diffpy/pdffit2/__init__\.py$ + exclude: ^src/diffpy/pdffit2/__init__\.py$ - repo: https://github.com/kynan/nbstripout rev: 0.7.1 hooks: diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index c5a8e039..fe3fbce3 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -18,9 +18,9 @@ """PDFfit2 - real space structure refinement program.""" # package version +from diffpy.pdffit2.output import redirect_stdout from diffpy.pdffit2.version import __version__, __date__ from diffpy.pdffit2.pdffit import PdfFit -from diffpy.pdffit2.output import redirect_stdout from diffpy.pdffit2.pdffit2 import is_element # silence the pyflakes syntax checker From 3490497e46ee87948cee5e8888373d9cc90dbf90 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 13:57:09 -0400 Subject: [PATCH 038/294] Add cookiecutter doc files --- doc/Makefile | 194 ++++++++++++ doc/make.bat | 36 +++ doc/source/_static/.placeholder | 0 .../api/diffpy.pdffit2.example_package.rst | 31 ++ doc/source/api/diffpy.pdffit2.rst | 30 ++ doc/source/conf.py | 289 ++++++++++++++++++ doc/source/index.rst | 44 +++ doc/source/license.rst | 39 +++ doc/source/release.rst | 5 + 9 files changed, 668 insertions(+) create mode 100644 doc/Makefile create mode 100644 doc/make.bat create mode 100644 doc/source/_static/.placeholder create mode 100644 doc/source/api/diffpy.pdffit2.example_package.rst create mode 100644 doc/source/api/diffpy.pdffit2.rst create mode 100644 doc/source/conf.py create mode 100644 doc/source/index.rst create mode 100644 doc/source/license.rst create mode 100644 doc/source/release.rst diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 00000000..ef016bb8 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,194 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = build +BASENAME = $(subst .,,$(subst $() $(),,diffpy.pdffit2)) + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/$(BASENAME).qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/$(BASENAME).qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/$(BASENAME)" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/$(BASENAME)" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +# Manual publishing to the gh-pages branch + +GITREPOPATH = $(shell cd $(CURDIR) && git rev-parse --git-dir) +GITREMOTE = origin +GITREMOTEURL = $(shell git config --get remote.$(GITREMOTE).url) +GITLASTCOMMIT = $(shell git rev-parse --short HEAD) + +publish: + @test -d build/html || \ + ( echo >&2 "Run 'make html' first!"; false ) + git show-ref --verify --quiet refs/heads/gh-pages || \ + git branch --track gh-pages $(GITREMOTE)/gh-pages + test -d build/gh-pages || \ + git clone -s -b gh-pages $(GITREPOPATH) build/gh-pages + cd build/gh-pages && \ + git pull $(GITREMOTEURL) gh-pages + rsync -acv --delete --exclude=.git --exclude=.rsync-exclude \ + --exclude-from=build/gh-pages/.rsync-exclude \ + --link-dest=$(CURDIR)/build/html build/html/ build/gh-pages/ + cd build/gh-pages && \ + git add --all . && \ + git diff --cached --quiet || \ + git commit -m "Sync with the source at $(GITLASTCOMMIT)." + cd build/gh-pages && \ + git push origin gh-pages diff --git a/doc/make.bat b/doc/make.bat new file mode 100644 index 00000000..2be83069 --- /dev/null +++ b/doc/make.bat @@ -0,0 +1,36 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build +set SPHINXPROJ=PackagingScientificPython + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/doc/source/_static/.placeholder b/doc/source/_static/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/doc/source/api/diffpy.pdffit2.example_package.rst b/doc/source/api/diffpy.pdffit2.example_package.rst new file mode 100644 index 00000000..1c6346c7 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.example_package.rst @@ -0,0 +1,31 @@ +.. _example_package documentation: + +|title| +======= + +.. |title| replace:: diffpy.pdffit2.example_package package + +.. automodule:: diffpy.pdffit2.example_package + :members: + :undoc-members: + :show-inheritance: + +|foo| +----- + +.. |foo| replace:: diffpy.pdffit2.example_package.foo module + +.. automodule:: diffpy.pdffit2.example_package.foo + :members: + :undoc-members: + :show-inheritance: + +|bar| +----- + +.. |bar| replace:: diffpy.pdffit2.example_package.bar module + +.. automodule:: diffpy.pdffit2.example_package.foo + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.rst new file mode 100644 index 00000000..70ca1b77 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.rst @@ -0,0 +1,30 @@ +:tocdepth: -1 + +|title| +======= + +.. |title| replace:: diffpy.pdffit2 package + +.. automodule:: diffpy.pdffit2 + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + diffpy.pdffit2.example_package + +Submodules +---------- + +|module| +-------- + +.. |module| replace:: diffpy.pdffit2.example_submodule module + +.. automodule:: diffpy.pdffit2.example_submodule + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 00000000..c15e8639 --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,289 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# diffpy.pdffit2 documentation build configuration file, created by +# sphinx-quickstart on Thu Jan 30 15:49:41 2014. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import time +from importlib.metadata import version +from pathlib import Path + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use Path().resolve() to make it absolute, like shown here. +# sys.path.insert(0, str(Path(".").resolve())) +sys.path.insert(0, str(Path("../..").resolve())) +sys.path.insert(0, str(Path("../../src").resolve())) + +# abbreviations +ab_authors = "Billinge Group members and community contributors" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", + "sphinx.ext.intersphinx", + "sphinx_rtd_theme", + "m2r", +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = "index" + +# General information about the project. +project = "diffpy.pdffit2" +copyright = "%Y, The Trustees of Columbia University in the City of New York" + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. + +fullversion = version(project) +# The short X.Y version. +version = "".join(fullversion.split(".post")[:1]) +# The full version, including alpha/beta/rc tags. +release = fullversion + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +today = time.strftime("%B %d, %Y", time.localtime()) +year = today.split()[-1] +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' +# substitute YEAR in the copyright string +copyright = copyright.replace("%Y", year) + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +modindex_common_prefix = ["diffpy.pdffit2"] + +# Display all warnings for missing links. +nitpicky = True + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +html_theme_options = { + "navigation_with_keys": "true", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +# html_static_path = ['_static'] + +# 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 = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Output file base name for HTML help builder. +basename = "diffpy.pdffit2".replace(" ", "").replace(".", "") +htmlhelp_basename = basename + "doc" + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ("index", "diffpy.pdffit2.tex", "diffpy.pdffit2 Documentation", ab_authors, "manual"), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [("index", "diffpy.pdffit2", "diffpy.pdffit2 Documentation", ab_authors, 1)] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + "index", + "diffpy.pdffit2", + "diffpy.pdffit2 Documentation", + ab_authors, + "diffpy.pdffit2", + "One line description of project.", + "Miscellaneous", + ), +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +# intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 00000000..bc6f0043 --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,44 @@ +####### +|title| +####### + +.. |title| replace:: diffpy.pdffit2 documentation + +diffpy.pdffit2 - PDFfit2 - real space structure refinement program.. + +| Software version |release|. +| Last updated |today|. + +======= +Authors +======= + +diffpy.pdffit2 is developed by Billinge Group +and its community contributors. + +For a detailed list of contributors see +https://github.com/diffpy/diffpy.pdffit2/graphs/contributors. + +============ +Installation +============ + +See the `README `_ +file included with the distribution. + +================= +Table of contents +================= +.. toctree:: + :titlesonly: + + license + release + Package API + +======= +Indices +======= + +* :ref:`genindex` +* :ref:`search` diff --git a/doc/source/license.rst b/doc/source/license.rst new file mode 100644 index 00000000..cfab61c2 --- /dev/null +++ b/doc/source/license.rst @@ -0,0 +1,39 @@ +:tocdepth: -1 + +.. index:: license + +License +####### + +OPEN SOURCE LICENSE AGREEMENT +============================= +BSD 3-Clause License + +Copyright (c) 2024, The Trustees of Columbia University in +the City of New York. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +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 HOLDER 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. diff --git a/doc/source/release.rst b/doc/source/release.rst new file mode 100644 index 00000000..27cd0cc9 --- /dev/null +++ b/doc/source/release.rst @@ -0,0 +1,5 @@ +:tocdepth: -1 + +.. index:: release notes + +.. include:: ../../CHANGELOG.rst From 30ffb875e73b7d370c2af5248b2538ab8b977963 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:00:21 -0400 Subject: [PATCH 039/294] Add epydoc from uncookiecut version --- doc/source/epydoc/Makefile | 17 ++++++++++++ doc/source/epydoc/epydoc.cfg | 54 ++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 doc/source/epydoc/Makefile create mode 100644 doc/source/epydoc/epydoc.cfg diff --git a/doc/source/epydoc/Makefile b/doc/source/epydoc/Makefile new file mode 100644 index 00000000..756095f5 --- /dev/null +++ b/doc/source/epydoc/Makefile @@ -0,0 +1,17 @@ +PKGNAME = diffpy.pdffit2 +OUTPUT = html +WEBDOCDIR = login.cacr.caltech.edu:/cacr/home/proj/danse/docs.danse.us/docroot/diffraction + + +all: + epydoc --config=epydoc.cfg --output=$(OUTPUT) \ + --name=$(PKGNAME) $(PKGNAME) + + +clean: + /bin/rm -rf $(OUTPUT) + + +publish: + rsync -e /usr/bin/ssh -va --chmod=a+rwx,o-w,Dg+s,Fa-x \ + $(OUTPUT)/ $(WEBDOCDIR)/$(PKGNAME) diff --git a/doc/source/epydoc/epydoc.cfg b/doc/source/epydoc/epydoc.cfg new file mode 100644 index 00000000..dddbcd90 --- /dev/null +++ b/doc/source/epydoc/epydoc.cfg @@ -0,0 +1,54 @@ +[epydoc] + +# docformat +# The default markup language for docstrings, for modules that do +# not define __docformat__. Defaults to epytext. +docformat: plaintext + +# The type of output that should be generated. Should be one +# of: html, text, latex, dvi, ps, pdf. +output: html + +# An integer indicating how verbose epydoc should be. The default +# value is 0; negative values will supress warnings and errors; +# positive values will give more verbose output. +verbosity: 0 + +# A boolean value indicating that Epydoc should show a tracaback +# in case of unexpected error. By default don't show tracebacks +debug: 0 + +# If True, don't try to use colors or cursor control when doing +# textual output. The default False assumes a rich text prompt +simple-term: 1 + +# The format for showing inheritance objects. +# It should be one of: 'grouped', 'listed', 'included'. +inheritance: grouped + +# Whether or not to inclue private variables. (Even if included, +# private variables will be hidden by default.) +private: yes + +# Whether or not to list each module's imports. +imports: yes + +# Whether or not to include syntax highlighted source code in +# the output (HTML only). +sourcecode: yes + +# Whether or not to includea a page with Epydoc log, containing +# effective option at the time of generation and the reported logs. +include-log: no + +### Output options + +# The documented project's name. +#name: diffpy.FIXME + +# The CSS stylesheet for HTML output. Can be the name of a builtin +# stylesheet, or the name of a file. +css: white + +# The documented project's URL. +url: http://www.diffpy.org/ From 43f040687c226bca13771dc52b961940c7005691 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 16:23:29 -0400 Subject: [PATCH 040/294] Added workflow files --- .github/workflows/docs.yml | 43 +++++++++++++++++++++++++ .github/workflows/main.yml | 54 ++++++++++++++++++++++++++++++++ .github/workflows/pre-commit.yml | 19 +++++++++++ 3 files changed, 116 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..a4661f5c --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,43 @@ +name: Build Documentation + +on: + push: + branches: + - main + release: + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: build + auto-update-conda: true + + - name: install requirements + run: >- + conda install -n build -c conda-forge + --file requirements/build.txt + --file requirements/run.txt + --file requirements/docs.txt + --quiet --yes + + - name: install the package + run: python -m pip install . --no-deps + + - name: build documents + run: make -C doc html + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doc/build/html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..f306d0a8 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,54 @@ +name: CI + +on: + push: + branches: + - main + - CI + pull_request: + workflow_dispatch: + +jobs: + miniconda: + name: Miniconda ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ["ubuntu-latest"] + steps: + - name: check out diffpy.pdffit2 + uses: actions/checkout@v3 + with: + repository: diffpy/diffpy.pdffit2 + path: . + fetch-depth: 0 # avoid shallow clone with no tags + + - name: initialize miniconda + # this uses a marketplace action that sets up miniconda in a way that makes + # it easier to use. I tried setting it up without this and it was a pain + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test + # environment.yml file is needed by this action. Because I don't want + # maintain this but rather maintain the requirements files it just has + # basic things in it like conda and pip + environment-file: ./environment.yml + python-version: 3 + auto-activate-base: false + + - name: install diffpy.pdffit2 requirements + shell: bash -l {0} + run: | + conda config --set always_yes yes --set changeps1 no + conda config --add channels conda-forge + conda activate test + conda install --file requirements/run.txt + conda install --file requirements/test.txt + pip install . + - name: Validate diffpy.pdffit2 + shell: bash -l {0} + run: | + conda activate test + coverage run -m pytest -vv -s + coverage report -m + codecov diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000..f2ff7e42 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,19 @@ +name: pre-commit + +on: + pull_request: + push: + workflow_dispatch: + +jobs: + pre-commit: + # pull requests are a duplicate of a branch push if within the same repo. + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + - uses: pre-commit/action@v3.0.0 + with: + extra_args: --all-files From b1dcb4d4b2b0a3b6838091ab138e7e42b0541824 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 16:49:18 -0400 Subject: [PATCH 041/294] update testing in main.yml --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f306d0a8..083672bd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,6 +49,8 @@ jobs: shell: bash -l {0} run: | conda activate test - coverage run -m pytest -vv -s + coverage run src/diffpy/pdffit2/tests/run.py +# uncover this after migrating to pytest +# coverage run -m pytest -vv -s coverage report -m codecov From 57ac92abb90fb88b36c025d5861bf3e34cbece50 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 16:53:09 -0400 Subject: [PATCH 042/294] pre-commit fixes --- .github/workflows/main.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 083672bd..00f20efe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,7 +50,14 @@ jobs: run: | conda activate test coverage run src/diffpy/pdffit2/tests/run.py -# uncover this after migrating to pytest -# coverage run -m pytest -vv -s coverage report -m codecov + +# Use this after migrating to pytest +# - name: Validate diffpy.pdffit2 +# shell: bash -l {0} +# run: | +# conda activate test +# coverage run -m pytest -vv -s +# coverage report -m +# codecov From 200318cf8c07c13b7f7d956c865c73f59c5872f6 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 17:00:07 -0400 Subject: [PATCH 043/294] use editable mode w/ main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00f20efe..73a63006 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,7 +44,7 @@ jobs: conda activate test conda install --file requirements/run.txt conda install --file requirements/test.txt - pip install . + pip install -e . - name: Validate diffpy.pdffit2 shell: bash -l {0} run: | From d020dbbf1b35ad5e6d1afa3a270a7abddb0626c1 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 12:30:24 -0400 Subject: [PATCH 044/294] added AUTHORS.rst --- AUTHORS.rst | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 AUTHORS.rst diff --git a/AUTHORS.rst b/AUTHORS.rst new file mode 100644 index 00000000..c7329e2f --- /dev/null +++ b/AUTHORS.rst @@ -0,0 +1,68 @@ +Authors +======= + +Billinge Group and community contibutors. + +---- + +This code was derived from the first PDFFIT program by Thomas Proffen. +The sources were converted to C++ by Jacques Bloch and then extensively hacked, +extended and purged from most glaring bugs by Chris Farrow and Pavol Juhas. +This code is currently maintained as part of the DiffPy project to create +python modules for structure investigations from diffraction data. + +The DiffPy team is located in the Billinge-group at the Applied Physics +and Applied Mathematics Department of the Columbia University in New York. +Currently the team consists of + + Simon Billinge + + Pavol Juhas + + Chris Farrow + + Emil Bozin + + Wenduo Zhou + + Peng Tian + + Timur Dykhne + +Please see the header of each source file for a detailed list of +contributors. This is an open-source project and we hope and expect +that the list of contributors will expand with time. Many thanks to +all current and future contributors! + +For more information on the DiffPy project email sb2896@columbia.edu + +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. + +Acknowledgments +--------------- + +We are truly grateful to all the people who have contributed, in all +different ways, to this project: Thomas Proffen, Xiangyun Qiu, Pete +Peterson and Jacques Bloch, previous Billinge-group members whose +contributions to the codes are living well beyond their affiliation with +the group; The hard working DANSE group at Caltech, University of +Maryland, Iowa State and University of Tennessee, especially Brent Fultz +for doggedly putting DANSE all together and Michael Aivazis, and the +indomitable Mike McKerns for their design input and MM's gargantuan +excel spreadsheets; The former members of the Billinge-group members, +especially HyunJeong Kim and Ahmad Masadeh for enthusiastic testing and +feature requests; Last but not least, our long suffering family members, +and the whole coffee and tea industries at large, without whom none of +this would have been possible. + + +Contributors +------------ + +For a list of contributors, visit +https://github.com/diffpy/diffpy.pdffit2/graphs/contributors \ No newline at end of file From 806a9b263c025d9294cc219ed8c84fdb884aec4c Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 12:31:17 -0400 Subject: [PATCH 045/294] Added CHANGELOG.rst --- CHANGELOG.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CHANGELOG.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 00000000..843c40a4 --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,26 @@ +============= +Release Notes +============= + +No notable functional changes from 1.4.1 + +-------------------------- +Version 1.4.2 – 2023-12-09 +-------------------------- + +Added +===== + +- Support for Python 3.11, 3.12 + +Changed +======= + +Deprecated +========== + +Removed +======= + +Fixed +===== \ No newline at end of file From eb866303629376fde3e13168e32005fff63928b0 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 12:31:38 -0400 Subject: [PATCH 046/294] Added code of conduct --- CODE_OF_CONDUCT.rst | 133 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 CODE_OF_CONDUCT.rst diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst new file mode 100644 index 00000000..ff9c3561 --- /dev/null +++ b/CODE_OF_CONDUCT.rst @@ -0,0 +1,133 @@ +===================================== + Contributor Covenant Code of Conduct +===================================== + +Our Pledge +---------- + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +Our Standards +------------- + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +Enforcement Responsibilities +---------------------------- + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +Scope +----- + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +Enforcement +----------- + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +sb2896@columbia.edu. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +Enforcement Guidelines +---------------------- + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +1. Correction +**************** + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +2. Warning +************* + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +3. Temporary Ban +****************** + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +4. Permanent Ban +****************** + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +Attribution +----------- + +This Code of Conduct is adapted from the `Contributor Covenant `_. + +Community Impact Guidelines were inspired by `Mozilla's code of conduct enforcement ladder `_. + +For answers to common questions about this code of conduct, see the `FAQ `_. `Translations are available `_ From 04c9200447bba7ed273d99c3180c280ede555a21 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 12:36:13 -0400 Subject: [PATCH 047/294] Added LICENSE.rst --- LICENSE.rst | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 LICENSE.rst diff --git a/LICENSE.rst b/LICENSE.rst new file mode 100644 index 00000000..3949fdf0 --- /dev/null +++ b/LICENSE.rst @@ -0,0 +1,50 @@ +This program is part of the DiffPy and DANSE open-source projects +and is available subject to the conditions and terms laid out below. + +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. Juhas, J. W. Liu, D. Bryndin, E. S. Bozin, + 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) + +Copyright 2006-2007, Board of Trustees of Michigan State University, +Copyright 2008-2019, Board of Trustees of Columbia University in the +city of New York. (Copyright holder indicated in each source file). + +For more information please visit the project web-page: + http://www.diffpy.org/ +or email Prof. Simon Billinge at sb2896@columbia.edu + +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 name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS". COPYRIGHT HOLDER +EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EITHER +EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS, ADEQUACY OR SUITABILITY +FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF FREEDOM FROM +INFRINGEMENT OF ANY DOMESTIC OR FOREIGN PATENT, COPYRIGHTS, TRADE +SECRETS OR OTHER PROPRIETARY RIGHTS OF ANY PARTY. IN NO EVENT SHALL +COPYRIGHT HOLDER BE LIABLE TO ANY PARTY 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 OR RELATING TO THIS AGREEMENT, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. From 880acae5ceaa98db118c2b9d2a438979db1847d9 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 12:37:05 -0400 Subject: [PATCH 048/294] Added isort config --- .isort.cfg | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 00000000..e0926f42 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,4 @@ +[settings] +line_length = 115 +multi_line_output = 3 +include_trailing_comma = True From a09972c36b33e7c7f88f664d11bb25db15f4142a Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 12:41:46 -0400 Subject: [PATCH 049/294] Added news directory w/ template --- news/TEMPLATE.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/TEMPLATE.rst diff --git a/news/TEMPLATE.rst b/news/TEMPLATE.rst new file mode 100644 index 00000000..790d30b1 --- /dev/null +++ b/news/TEMPLATE.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From ee4dbba608bd6a8a1581a3f5857756987052a121 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:56:44 +0000 Subject: [PATCH 050/294] [pre-commit.ci] auto fixes from pre-commit hooks --- AUTHORS.rst | 2 +- CHANGELOG.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index c7329e2f..8cae8521 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -65,4 +65,4 @@ Contributors ------------ For a list of contributors, visit -https://github.com/diffpy/diffpy.pdffit2/graphs/contributors \ No newline at end of file +https://github.com/diffpy/diffpy.pdffit2/graphs/contributors diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 843c40a4..55012a9d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -23,4 +23,4 @@ Removed ======= Fixed -===== \ No newline at end of file +===== From 9fa82c95a8b5c03c66a68014286ade2613976a63 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 13:24:36 -0400 Subject: [PATCH 051/294] Move examples/ and devutils/ to src/ --- {devutils => src/devutils}/makesdist | 0 {examples => src/examples}/Ni-xray.gr | 0 {examples => src/examples}/Ni.stru | 0 {examples => src/examples}/Ni_calculation.py | 0 {examples => src/examples}/Ni_plot_pdf.py | 0 {examples => src/examples}/Ni_refinement.py | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename {devutils => src/devutils}/makesdist (100%) rename {examples => src/examples}/Ni-xray.gr (100%) rename {examples => src/examples}/Ni.stru (100%) rename {examples => src/examples}/Ni_calculation.py (100%) rename {examples => src/examples}/Ni_plot_pdf.py (100%) rename {examples => src/examples}/Ni_refinement.py (100%) diff --git a/devutils/makesdist b/src/devutils/makesdist similarity index 100% rename from devutils/makesdist rename to src/devutils/makesdist diff --git a/examples/Ni-xray.gr b/src/examples/Ni-xray.gr similarity index 100% rename from examples/Ni-xray.gr rename to src/examples/Ni-xray.gr diff --git a/examples/Ni.stru b/src/examples/Ni.stru similarity index 100% rename from examples/Ni.stru rename to src/examples/Ni.stru diff --git a/examples/Ni_calculation.py b/src/examples/Ni_calculation.py similarity index 100% rename from examples/Ni_calculation.py rename to src/examples/Ni_calculation.py diff --git a/examples/Ni_plot_pdf.py b/src/examples/Ni_plot_pdf.py similarity index 100% rename from examples/Ni_plot_pdf.py rename to src/examples/Ni_plot_pdf.py diff --git a/examples/Ni_refinement.py b/src/examples/Ni_refinement.py similarity index 100% rename from examples/Ni_refinement.py rename to src/examples/Ni_refinement.py From a354607544fe7e7e5f22bc17660bd4922d4bb680 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 13:27:15 -0400 Subject: [PATCH 052/294] update codecov.yml --- .codecov.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index 86671410..505809d2 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,2 +1,37 @@ +# codecov can find this file anywhere in the repo, so we don't need to clutter +# the root folder. +#comment: false + fixes: - ".*/site-packages/::src/" + +codecov: + notify: + require_ci_to_pass: no + +coverage: + status: + patch: + 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/ From 66d4eb94c84e687fb68b472cc037cd9eab55c29d Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 13:27:36 -0400 Subject: [PATCH 053/294] update coveragerc --- .coveragerc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.coveragerc b/.coveragerc index d0a0d16d..e20b9438 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,16 @@ -# Configuration of the coverage.py tool for reporting test coverage. - +[run] +source = + diffpy.pdffit2 +omit = + ## exclude debug.py from codecov report + */tests/debug.py [report] +omit = + */python?.?/* + */site-packages/nose/* + # ignore _version.py and versioneer.py + .*version.* + *_version.py # RE patterns for lines to be excluded from consideration. exclude_lines = ## Have to re-enable the standard pragma @@ -13,10 +23,4 @@ exclude_lines = ## Don't complain if non-runnable code isn't run: ^[ ]*@unittest.skip\b ^[ ]{4}unittest.main() - if __name__ == .__main__.: - - -[run] -omit = - ## exclude debug.py from codecov report - */tests/debug.py + if __name__ == '__main__': From 9ad618b9ffaddb15a0ff2f38d7d0b0a4082572a8 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 13:45:40 -0400 Subject: [PATCH 054/294] update MANIFEST.in --- MANIFEST.in | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 1b41a5df..68709887 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,20 +1,28 @@ -recursive-include diffpy * -recursive-exclude diffpy *.py[co] *.so -recursive-include libpdffit2 *.[ch]* -recursive-include pdffit2module *.[ch]* -recursive-include examples * -include AUTHORS.txt LICENSE*.txt README* -include Makefile -prune libpdffit2/tests +recursive-include src/diffpy * +recursive-exclude src/diffpy *.py[co] *.so +recursive-include docs *.rst conf.py Makefile make.bat + +recursive-include src/extensions/libpdffit2 *.[ch]* +recursive-include src/extensions/pdffit2module *.[ch]* +recursive-include src/examples * +include AUTHORS.rst +include diffpy.pdffit2/version.py +include LICENSE.rst +include README.rst +include requirements/ +prune src/extensions/libpdffit2/tests global-exclude .gitattributes .gitignore .gitarchive.cfg global-exclude .DS_Store +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] + +# If including data files in the package, add them like: +# include path/to/data_file # Avoid user content in setup.cfg to make distribution reproducible. exclude setup.cfg # Exclude git-tracked files spuriously added by setuptools_scm exclude .coveragerc -exclude .travis* -prune conda-recipe -prune devutils -prune doc +prune src/devutils +prune doc \ No newline at end of file From b8e6a4d0d5c346643a430f7f47780be7f2407e58 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 17:45:50 +0000 Subject: [PATCH 055/294] [pre-commit.ci] auto fixes from pre-commit hooks --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 68709887..3089ae64 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -25,4 +25,4 @@ exclude setup.cfg # Exclude git-tracked files spuriously added by setuptools_scm exclude .coveragerc prune src/devutils -prune doc \ No newline at end of file +prune doc From 93107b1f18c58717556953e1a8c78f374115891d Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 13:50:40 -0400 Subject: [PATCH 056/294] remove "-e" from pip installation - fixed with MANIFEST.in change --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 73a63006..00f20efe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,7 +44,7 @@ jobs: conda activate test conda install --file requirements/run.txt conda install --file requirements/test.txt - pip install -e . + pip install . - name: Validate diffpy.pdffit2 shell: bash -l {0} run: | From 8337426df40d59b0286cdb2ec70e915171f54d64 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 15:09:48 -0400 Subject: [PATCH 057/294] move makesdist to main repo dir to match diffpy.utils --- {src/devutils => devutils}/makesdist | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {src/devutils => devutils}/makesdist (100%) diff --git a/src/devutils/makesdist b/devutils/makesdist similarity index 100% rename from src/devutils/makesdist rename to devutils/makesdist From bcb722cd8229ecc7f178ac90707f8c0847b6b374 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 24 Jul 2024 15:10:34 -0400 Subject: [PATCH 058/294] MANIFEST.in devuitls fix --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 3089ae64..9902cd57 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -24,5 +24,5 @@ exclude setup.cfg # Exclude git-tracked files spuriously added by setuptools_scm exclude .coveragerc -prune src/devutils +prune devutils prune doc From 13c21502b41ead898a5b44bd13b2c042744ea2a6 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Thu, 25 Jul 2024 01:22:48 -0400 Subject: [PATCH 059/294] Update AUTHORS.rst --- AUTHORS.rst | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 8cae8521..d6679278 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -13,23 +13,12 @@ python modules for structure investigations from diffraction data. The DiffPy team is located in the Billinge-group at the Applied Physics and Applied Mathematics Department of the Columbia University in New York. -Currently the team consists of +Previous significant contributors to this code were - Simon Billinge + Pavol Juhas, Chris Farrow, Jacques Bloch, Wenduo Zhou - Pavol Juhas - - Chris Farrow - - Emil Bozin - - Wenduo Zhou - - Peng Tian - - Timur Dykhne - -Please see the header of each source file for a detailed list of +Please see the github contributions and the header of each source file +for a detailed list of contributors. This is an open-source project and we hope and expect that the list of contributors will expand with time. Many thanks to all current and future contributors! From b52e7b442a512e90309783ec9a85b2d308d4864a Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Thu, 25 Jul 2024 01:24:11 -0400 Subject: [PATCH 060/294] columbia copyright updated to 2024 --- LICENSE.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.rst b/LICENSE.rst index 3949fdf0..9618d51a 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -11,7 +11,7 @@ the following paper in your publication: crystals, J. Phys.: Condens. Matter 19, 335219 (2007) Copyright 2006-2007, Board of Trustees of Michigan State University, -Copyright 2008-2019, Board of Trustees of Columbia University in the +Copyright 2008-2024, Board of Trustees of Columbia University in the city of New York. (Copyright holder indicated in each source file). For more information please visit the project web-page: From 7750f1a6a8196168e528cfdc9cbb121adc07e9cb Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Thu, 25 Jul 2024 11:41:46 -0400 Subject: [PATCH 061/294] Move examples/ to doc/ --- {src => doc}/examples/Ni-xray.gr | 0 {src => doc}/examples/Ni.stru | 0 {src => doc}/examples/Ni_calculation.py | 0 {src => doc}/examples/Ni_plot_pdf.py | 0 {src => doc}/examples/Ni_refinement.py | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename {src => doc}/examples/Ni-xray.gr (100%) rename {src => doc}/examples/Ni.stru (100%) rename {src => doc}/examples/Ni_calculation.py (100%) rename {src => doc}/examples/Ni_plot_pdf.py (100%) rename {src => doc}/examples/Ni_refinement.py (100%) diff --git a/src/examples/Ni-xray.gr b/doc/examples/Ni-xray.gr similarity index 100% rename from src/examples/Ni-xray.gr rename to doc/examples/Ni-xray.gr diff --git a/src/examples/Ni.stru b/doc/examples/Ni.stru similarity index 100% rename from src/examples/Ni.stru rename to doc/examples/Ni.stru diff --git a/src/examples/Ni_calculation.py b/doc/examples/Ni_calculation.py similarity index 100% rename from src/examples/Ni_calculation.py rename to doc/examples/Ni_calculation.py diff --git a/src/examples/Ni_plot_pdf.py b/doc/examples/Ni_plot_pdf.py similarity index 100% rename from src/examples/Ni_plot_pdf.py rename to doc/examples/Ni_plot_pdf.py diff --git a/src/examples/Ni_refinement.py b/doc/examples/Ni_refinement.py similarity index 100% rename from src/examples/Ni_refinement.py rename to doc/examples/Ni_refinement.py From 350600044634e044668c5619cd67d60a31bc1a64 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Thu, 25 Jul 2024 11:43:54 -0400 Subject: [PATCH 062/294] Removed .idea directory --- .idea/.gitignore | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b81..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml From 305c32515c814514be5a5b61b4c504de8b550f0b Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Thu, 25 Jul 2024 11:44:22 -0400 Subject: [PATCH 063/294] Removed build.yaml --- .github/workflows/build.yaml | 67 ------------------------------------ 1 file changed, 67 deletions(-) delete mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 9f8369e5..00000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,67 +0,0 @@ -name: build and upload - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - build: - strategy: - max-parallel: 4 - matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - os: [ubuntu-latest, macos-latest, windows-latest] - - runs-on: ${{ matrix.os }} - steps: - - name: Check-out repository - uses: actions/checkout@v2 - - - name: set up conda - uses: s-weigand/setup-conda@v1 - with: - update-conda: true - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - conda install -c conda-forge twine - conda install -c conda-forge wheel - conda install -c conda-forge setuptools - conda install -c conda-forge pip - conda install -c conda-forge gsl - - - name: Build wheels - run: | - python setup.py sdist bdist_wheel - - - name: Run tests - run: | - conda install -c conda-forge numpy - python setup.py install - python conda-recipe/run_test.py - - - name: Upload Artifacts GitHub releases - uses: ncipollo/release-action@v1 - with: - draft: false - prerelease: true - allowUpdates: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: ${{ github.workspace }}/dist/*.whl - tag: 1.4.1 - body: This is an alpha build of the pdffit2 library (1.4.2) - - # This step will upload tagged commits to pypi. - # The pypi token must be added to GH secrets - # - # - name: Publish package - # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - # uses: pypa/gh-action-pypi-publish@release/v1 - # with: - # password: ${{ secrets.PYPI_API_TOKEN }} From de29675a757a507186d0e4ff3f98b17a61362a59 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Thu, 25 Jul 2024 11:44:34 -0400 Subject: [PATCH 064/294] Removed travis.yml --- .travis.yml | 108 ---------------------------------------------------- 1 file changed, 108 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d5979526..00000000 --- a/.travis.yml +++ /dev/null @@ -1,108 +0,0 @@ -dist: xenial -language: generic - -os: - - linux - - osx - -env: - - MYUSEMC=true MYPYTHON_VERSION=2.7 - - MYUSEMC=true MYPYTHON_VERSION=3.7 - - MYUSEMC=true MYPYTHON_VERSION=3.8 - - MYUSEMC=true MYPYTHON_VERSION=3.9 - - MYUSEMC=true MYPYTHON_VERSION=3.10 - - MYUSEMC=true MYPYTHON_VERSION=3.11 - - MYUSEMC=true MYPYTHON_VERSION=3.12 - - MYUSEMC=false - -matrix: - exclude: - - os: osx - env: MYUSEMC=false - -git: - depth: 999999 - -branches: - except: - - /^v[0-9]/ - - -before_install: - - MYNAME=diffpy.pdffit2 - - MYCOMMIT="$(git rev-parse HEAD)" - - umask 022 - - git fetch origin --tags - - if ${MYUSEMC}; then - NOAPT=true; NOMC=false; - else - NOAPT=false; NOMC=true; - MYPIPFLAGS="--user"; - fi - - MYMCREPO=https://repo.anaconda.com/miniconda - - case ${TRAVIS_OS_NAME} in - linux) - MYMCBUNDLE=Miniconda3-latest-Linux-x86_64.sh ;; - osx) - MYMCBUNDLE=Miniconda3-latest-MacOSX-x86_64.sh ;; - *) - echo "Unsupported operating system." >&2; - exit 2 ;; - esac - - MYRUNDIR=${PWD}/build/rundir - - - mkdir -p ~/pkgs - - mkdir -p ${MYRUNDIR} - - cp .coveragerc ${MYRUNDIR}/ - - - $NOMC || pushd ~/pkgs - - $NOMC || wget --timestamping ${MYMCREPO}/${MYMCBUNDLE} - - $NOMC || test -x ~/mc/bin/conda || bash ${MYMCBUNDLE} -b -f -p ~/mc - - $NOMC || popd - - $NOMC || source ~/mc/bin/activate base - - $NOMC || conda update --yes conda - - $NOMC || conda install --yes conda-build conda-verify jinja2 - # avoid warnings from setup.py - - $NOMC || conda install --yes gsl - - $NOMC || conda create --name=testenv --yes python=${MYPYTHON_VERSION} coverage - - $NOMC || conda config --add channels diffpy - - - $NOAPT || test "${TRAVIS_OS_NAME}" = "linux" || exit $? - - $NOAPT || PATH="$(echo "$PATH" | sed 's,:/opt/pyenv/[^:]*,,g')" - - $NOAPT || test "$(which python)" = "/usr/bin/python" || ( - which python; exit 1) - - $NOAPT || sudo apt-get update -qq - - $NOAPT || sudo apt-get install -y - build-essential libgsl0-dev python-dev - python-numpy python-setuptools python-pip - - $NOAPT || devutils/makesdist - - $NOAPT || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)" - - -install: - - $NOMC || conda build --python=${MYPYTHON_VERSION} conda-recipe - - $NOMC || conda render --python=${MYPYTHON_VERSION} --output conda-recipe | - sed 's,.*/,,; s/[.]tar[.]bz2$//; s/-/=/g' > /tmp/mypackage.txt - - $NOMC || source activate testenv - - $NOMC || conda install --yes --use-local --file=/tmp/mypackage.txt - - - $NOAPT || pip install $MYPIPFLAGS coverage - # TODO - restore pip install once it works. - # - $NOAPT || pip install $MYPIPFLAGS "${MYTARBUNDLE}" - - $NOAPT || easy_install --user "${MYTARBUNDLE}" - - - cd ${MYRUNDIR} - - MYGIT_REV=$(python -c "import ${MYNAME}.version as v; print(v.__git_commit__)") - - if [[ "${MYCOMMIT}" != "${MYGIT_REV}" ]]; then - echo "Version mismatch ${MYCOMMIT} vs ${MYGIT_REV}."; - exit 1; - fi - - -script: - - coverage run --source ${MYNAME} -m ${MYNAME}.tests.rundeps - - -after_success: - - pip install $MYPIPFLAGS codecov - - codecov From b51f396376c53fe99d7edd21a8055207343a7186 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Thu, 25 Jul 2024 11:44:47 -0400 Subject: [PATCH 065/294] Removed AUTHORS.txt --- AUTHORS.txt | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 AUTHORS.txt diff --git a/AUTHORS.txt b/AUTHORS.txt deleted file mode 100644 index 2c1d7f81..00000000 --- a/AUTHORS.txt +++ /dev/null @@ -1,47 +0,0 @@ -This code was derived from the first PDFFIT program by Thomas Proffen. -The sources were converted to C++ by Jacques Bloch and then extensively hacked, -extended and purged from most glaring bugs by Chris Farrow and Pavol Juhas. -This code is currently maintained as part of the DiffPy project to create -python modules for structure investigations from diffraction data. - -The DiffPy team is located in the Billinge-group at the Applied Physics -and Applied Mathematics Department of the Columbia University in New York. -Currently the team consists of - - Simon Billinge - Pavol Juhas - Chris Farrow - Emil Bozin - Wenduo Zhou - Peng Tian - Timur Dykhne - -Please see the header of each source file for a detailed list of -contributors. This is an open-source project and we hope and expect -that the list of contributors will expand with time. Many thanks to -all current and future contributors! - -For more information on the DiffPy project email sb2896@columbia.edu - -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. - -Acknowledgments: - -We are truly grateful to all the people who have contributed, in all -different ways, to this project: Thomas Proffen, Xiangyun Qiu, Pete -Peterson and Jacques Bloch, previous Billinge-group members whose -contributions to the codes are living well beyond their affiliation with -the group; The hard working DANSE group at Caltech, University of -Maryland, Iowa State and University of Tennessee, especially Brent Fultz -for doggedly putting DANSE all together and Michael Aivazis, and the -indomitable Mike McKerns for their design input and MM's gargantuan -excel spreadsheets; The former members of the Billinge-group members, -especially HyunJeong Kim and Ahmad Masadeh for enthusiastic testing and -feature requests; Last but not least, our long suffering family members, -and the whole coffee and tea industries at large, without whom none of -this would have been possible. From 3f0bcc2d7e2441e45ca1df8b3f931dcc8d6615b8 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Thu, 25 Jul 2024 11:45:00 -0400 Subject: [PATCH 066/294] Removed CHANGELOG.md --- CHANGELOG.md | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index b101ecc6..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,17 +0,0 @@ -# Release notes - -No notable functional changes from 1.4.1 - -## Version 1.4.2 – 2023-12-09 - -### Added - -- Support for Python 3.11, 3.12 - -### Changed - -### Deprecated - -### Removed - -### Fixed From 9daab27c10b92b54f21e84eb517550d98b847ce7 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Thu, 25 Jul 2024 11:45:13 -0400 Subject: [PATCH 067/294] Removed LICENSE.txt --- LICENSE.txt | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 3949fdf0..00000000 --- a/LICENSE.txt +++ /dev/null @@ -1,50 +0,0 @@ -This program is part of the DiffPy and DANSE open-source projects -and is available subject to the conditions and terms laid out below. - -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. Juhas, J. W. Liu, D. Bryndin, E. S. Bozin, - 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) - -Copyright 2006-2007, Board of Trustees of Michigan State University, -Copyright 2008-2019, Board of Trustees of Columbia University in the -city of New York. (Copyright holder indicated in each source file). - -For more information please visit the project web-page: - http://www.diffpy.org/ -or email Prof. Simon Billinge at sb2896@columbia.edu - -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 name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS". COPYRIGHT HOLDER -EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EITHER -EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS, ADEQUACY OR SUITABILITY -FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF FREEDOM FROM -INFRINGEMENT OF ANY DOMESTIC OR FOREIGN PATENT, COPYRIGHTS, TRADE -SECRETS OR OTHER PROPRIETARY RIGHTS OF ANY PARTY. IN NO EVENT SHALL -COPYRIGHT HOLDER BE LIABLE TO ANY PARTY 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 OR RELATING TO THIS AGREEMENT, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. From b00d64b3f65fda72e59596edee0781f865d04714 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Fri, 26 Jul 2024 02:52:58 -0400 Subject: [PATCH 068/294] news --- news/news.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 news/news.rst diff --git a/news/news.rst b/news/news.rst new file mode 100644 index 00000000..e9bf5d01 --- /dev/null +++ b/news/news.rst @@ -0,0 +1,24 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Code linted to group flake8 standards +* Package structure moved to diffpy standard structure + +**Security:** + +* From 50c92e51d459948826c3ce67bf7c00a6264af23a Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Fri, 26 Jul 2024 02:54:28 -0400 Subject: [PATCH 069/294] remove travis badge --- README.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.rst b/README.rst index bef2a4ce..6bc9518f 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,3 @@ -.. image:: https://travis-ci.org/diffpy/diffpy.pdffit2.svg?branch=master - :target: https://travis-ci.org/diffpy/diffpy.pdffit2 .. image:: https://codecov.io/gh/diffpy/diffpy.pdffit2/branch/master/graph/badge.svg :target: https://codecov.io/gh/diffpy/diffpy.pdffit2 From 04bfea045f4a3911d26a5a714501fe007df23576 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Fri, 26 Jul 2024 12:19:26 -0400 Subject: [PATCH 070/294] run auto_api - build API --- .../api/diffpy.pdffit2..git.branches.rst | 10 +++++ doc/source/api/diffpy.pdffit2..git.hooks.rst | 10 +++++ doc/source/api/diffpy.pdffit2..git.info.rst | 10 +++++ .../diffpy.pdffit2..git.logs.refs.heads.rst | 10 +++++ ....pdffit2..git.logs.refs.remotes.origin.rst | 10 +++++ .../diffpy.pdffit2..git.logs.refs.remotes.rst | 18 +++++++++ .../api/diffpy.pdffit2..git.logs.refs.rst | 19 ++++++++++ doc/source/api/diffpy.pdffit2..git.logs.rst | 18 +++++++++ .../api/diffpy.pdffit2..git.objects.info.rst | 10 +++++ .../api/diffpy.pdffit2..git.objects.pack.rst | 10 +++++ .../api/diffpy.pdffit2..git.objects.rst | 19 ++++++++++ .../api/diffpy.pdffit2..git.refs.heads.rst | 10 +++++ ...iffpy.pdffit2..git.refs.remotes.origin.rst | 10 +++++ .../api/diffpy.pdffit2..git.refs.remotes.rst | 18 +++++++++ doc/source/api/diffpy.pdffit2..git.refs.rst | 20 ++++++++++ .../api/diffpy.pdffit2..git.refs.tags.rst | 10 +++++ doc/source/api/diffpy.pdffit2..git.rst | 23 ++++++++++++ doc/source/api/diffpy.pdffit2..github.rst | 18 +++++++++ .../api/diffpy.pdffit2..github.workflows.rst | 10 +++++ ...iffpy.pdffit2..idea.inspectionProfiles.rst | 10 +++++ doc/source/api/diffpy.pdffit2..idea.rst | 18 +++++++++ .../api/diffpy.pdffit2.conda-recipe.rst | 21 +++++++++++ doc/source/api/diffpy.pdffit2.devutils.rst | 10 +++++ doc/source/api/diffpy.pdffit2.dist.rst | 10 +++++ doc/source/api/diffpy.pdffit2.doc.epydoc.rst | 10 +++++ .../api/diffpy.pdffit2.doc.examples.rst | 37 +++++++++++++++++++ doc/source/api/diffpy.pdffit2.doc.rst | 20 ++++++++++ .../api/diffpy.pdffit2.doc.source._static.rst | 10 +++++ .../api/diffpy.pdffit2.doc.source.api.rst | 10 +++++ .../api/diffpy.pdffit2.doc.source.epydoc.rst | 10 +++++ doc/source/api/diffpy.pdffit2.doc.source.rst | 31 ++++++++++++++++ .../api/diffpy.pdffit2.example_package.rst | 31 ---------------- doc/source/api/diffpy.pdffit2.news.rst | 10 +++++ .../api/diffpy.pdffit2.requirements.rst | 10 +++++ doc/source/api/diffpy.pdffit2.rst | 28 +++++++++----- ...py.pdffit2.src.diffpy.pdffit2.egg-info.rst | 10 +++++ .../api/diffpy.pdffit2.src.diffpy.pdffit2.rst | 37 +++++++++++++++++++ doc/source/api/diffpy.pdffit2.src.diffpy.rst | 18 +++++++++ ...ffpy.pdffit2.src.extensions.libpdffit2.rst | 10 +++++ ...y.pdffit2.src.extensions.pdffit2module.rst | 10 +++++ .../api/diffpy.pdffit2.src.extensions.rst | 19 ++++++++++ doc/source/api/diffpy.pdffit2.src.rst | 20 ++++++++++ 42 files changed, 622 insertions(+), 41 deletions(-) create mode 100644 doc/source/api/diffpy.pdffit2..git.branches.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.hooks.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.info.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.logs.refs.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.logs.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.objects.info.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.objects.pack.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.objects.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.refs.heads.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.refs.remotes.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.refs.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.refs.tags.rst create mode 100644 doc/source/api/diffpy.pdffit2..git.rst create mode 100644 doc/source/api/diffpy.pdffit2..github.rst create mode 100644 doc/source/api/diffpy.pdffit2..github.workflows.rst create mode 100644 doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst create mode 100644 doc/source/api/diffpy.pdffit2..idea.rst create mode 100644 doc/source/api/diffpy.pdffit2.conda-recipe.rst create mode 100644 doc/source/api/diffpy.pdffit2.devutils.rst create mode 100644 doc/source/api/diffpy.pdffit2.dist.rst create mode 100644 doc/source/api/diffpy.pdffit2.doc.epydoc.rst create mode 100644 doc/source/api/diffpy.pdffit2.doc.examples.rst create mode 100644 doc/source/api/diffpy.pdffit2.doc.rst create mode 100644 doc/source/api/diffpy.pdffit2.doc.source._static.rst create mode 100644 doc/source/api/diffpy.pdffit2.doc.source.api.rst create mode 100644 doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst create mode 100644 doc/source/api/diffpy.pdffit2.doc.source.rst delete mode 100644 doc/source/api/diffpy.pdffit2.example_package.rst create mode 100644 doc/source/api/diffpy.pdffit2.news.rst create mode 100644 doc/source/api/diffpy.pdffit2.requirements.rst create mode 100644 doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst create mode 100644 doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst create mode 100644 doc/source/api/diffpy.pdffit2.src.diffpy.rst create mode 100644 doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst create mode 100644 doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst create mode 100644 doc/source/api/diffpy.pdffit2.src.extensions.rst create mode 100644 doc/source/api/diffpy.pdffit2.src.rst diff --git a/doc/source/api/diffpy.pdffit2..git.branches.rst b/doc/source/api/diffpy.pdffit2..git.branches.rst new file mode 100644 index 00000000..e448ee3b --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.branches.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.branches package +==================================== + +.. automodule:: diffpy.pdffit2..git.branches + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..git.hooks.rst b/doc/source/api/diffpy.pdffit2..git.hooks.rst new file mode 100644 index 00000000..21156bde --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.hooks.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.hooks package +================================= + +.. automodule:: diffpy.pdffit2..git.hooks + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..git.info.rst b/doc/source/api/diffpy.pdffit2..git.info.rst new file mode 100644 index 00000000..6af4f94a --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.info.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.info package +================================ + +.. automodule:: diffpy.pdffit2..git.info + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst new file mode 100644 index 00000000..1f33cefe --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.logs.refs.heads package +=========================================== + +.. automodule:: diffpy.pdffit2..git.logs.refs.heads + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst new file mode 100644 index 00000000..3d46f4d2 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.logs.refs.remotes.origin package +==================================================== + +.. automodule:: diffpy.pdffit2..git.logs.refs.remotes.origin + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst new file mode 100644 index 00000000..c6b1133a --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst @@ -0,0 +1,18 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.logs.refs.remotes package +============================================= + +.. automodule:: diffpy.pdffit2..git.logs.refs.remotes + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2..git.logs.refs.remotes.origin + diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.rst new file mode 100644 index 00000000..f3f52bb6 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.logs.refs.rst @@ -0,0 +1,19 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.logs.refs package +===================================== + +.. automodule:: diffpy.pdffit2..git.logs.refs + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2..git.logs.refs.remotes + diffpy.pdffit2..git.logs.refs.heads + diff --git a/doc/source/api/diffpy.pdffit2..git.logs.rst b/doc/source/api/diffpy.pdffit2..git.logs.rst new file mode 100644 index 00000000..b0a95a07 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.logs.rst @@ -0,0 +1,18 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.logs package +================================ + +.. automodule:: diffpy.pdffit2..git.logs + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2..git.logs.refs + diff --git a/doc/source/api/diffpy.pdffit2..git.objects.info.rst b/doc/source/api/diffpy.pdffit2..git.objects.info.rst new file mode 100644 index 00000000..e0d5cfd8 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.objects.info.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.objects.info package +======================================== + +.. automodule:: diffpy.pdffit2..git.objects.info + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..git.objects.pack.rst b/doc/source/api/diffpy.pdffit2..git.objects.pack.rst new file mode 100644 index 00000000..e499b2ef --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.objects.pack.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.objects.pack package +======================================== + +.. automodule:: diffpy.pdffit2..git.objects.pack + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..git.objects.rst b/doc/source/api/diffpy.pdffit2..git.objects.rst new file mode 100644 index 00000000..51819b09 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.objects.rst @@ -0,0 +1,19 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.objects package +=================================== + +.. automodule:: diffpy.pdffit2..git.objects + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2..git.objects.info + diffpy.pdffit2..git.objects.pack + diff --git a/doc/source/api/diffpy.pdffit2..git.refs.heads.rst b/doc/source/api/diffpy.pdffit2..git.refs.heads.rst new file mode 100644 index 00000000..355dce1d --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.refs.heads.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.refs.heads package +====================================== + +.. automodule:: diffpy.pdffit2..git.refs.heads + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst b/doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst new file mode 100644 index 00000000..9c8826ef --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.refs.remotes.origin package +=============================================== + +.. automodule:: diffpy.pdffit2..git.refs.remotes.origin + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..git.refs.remotes.rst b/doc/source/api/diffpy.pdffit2..git.refs.remotes.rst new file mode 100644 index 00000000..dd7dd110 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.refs.remotes.rst @@ -0,0 +1,18 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.refs.remotes package +======================================== + +.. automodule:: diffpy.pdffit2..git.refs.remotes + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2..git.refs.remotes.origin + diff --git a/doc/source/api/diffpy.pdffit2..git.refs.rst b/doc/source/api/diffpy.pdffit2..git.refs.rst new file mode 100644 index 00000000..8b77b9d1 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.refs.rst @@ -0,0 +1,20 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.refs package +================================ + +.. automodule:: diffpy.pdffit2..git.refs + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2..git.refs.tags + diffpy.pdffit2..git.refs.remotes + diffpy.pdffit2..git.refs.heads + diff --git a/doc/source/api/diffpy.pdffit2..git.refs.tags.rst b/doc/source/api/diffpy.pdffit2..git.refs.tags.rst new file mode 100644 index 00000000..53acf633 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.refs.tags.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..git.refs.tags package +===================================== + +.. automodule:: diffpy.pdffit2..git.refs.tags + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..git.rst b/doc/source/api/diffpy.pdffit2..git.rst new file mode 100644 index 00000000..95e2b35b --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..git.rst @@ -0,0 +1,23 @@ +:tocdepth: -1 + +diffpy.pdffit2..git package +=========================== + +.. automodule:: diffpy.pdffit2..git + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2..git.hooks + diffpy.pdffit2..git.info + diffpy.pdffit2..git.branches + diffpy.pdffit2..git.objects + diffpy.pdffit2..git.logs + diffpy.pdffit2..git.refs + diff --git a/doc/source/api/diffpy.pdffit2..github.rst b/doc/source/api/diffpy.pdffit2..github.rst new file mode 100644 index 00000000..01859fde --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..github.rst @@ -0,0 +1,18 @@ +:tocdepth: -1 + +diffpy.pdffit2..github package +============================== + +.. automodule:: diffpy.pdffit2..github + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2..github.workflows + diff --git a/doc/source/api/diffpy.pdffit2..github.workflows.rst b/doc/source/api/diffpy.pdffit2..github.workflows.rst new file mode 100644 index 00000000..9f1daf12 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..github.workflows.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..github.workflows package +======================================== + +.. automodule:: diffpy.pdffit2..github.workflows + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst b/doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst new file mode 100644 index 00000000..929148cf --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2..idea.inspectionProfiles package +=============================================== + +.. automodule:: diffpy.pdffit2..idea.inspectionProfiles + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2..idea.rst b/doc/source/api/diffpy.pdffit2..idea.rst new file mode 100644 index 00000000..7cf242f0 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2..idea.rst @@ -0,0 +1,18 @@ +:tocdepth: -1 + +diffpy.pdffit2..idea package +============================ + +.. automodule:: diffpy.pdffit2..idea + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2..idea.inspectionProfiles + diff --git a/doc/source/api/diffpy.pdffit2.conda-recipe.rst b/doc/source/api/diffpy.pdffit2.conda-recipe.rst new file mode 100644 index 00000000..c9da6edb --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.conda-recipe.rst @@ -0,0 +1,21 @@ +:tocdepth: -1 + +diffpy.pdffit2.conda-recipe package +=================================== + +.. automodule:: diffpy.pdffit2.conda-recipe + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +diffpy.pdffit2.conda-recipe.run_test module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.pdffit2.conda-recipe.run_test + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.devutils.rst b/doc/source/api/diffpy.pdffit2.devutils.rst new file mode 100644 index 00000000..bfdb4551 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.devutils.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.devutils package +=============================== + +.. automodule:: diffpy.pdffit2.devutils + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.dist.rst b/doc/source/api/diffpy.pdffit2.dist.rst new file mode 100644 index 00000000..0baee332 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.dist.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.dist package +=========================== + +.. automodule:: diffpy.pdffit2.dist + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.doc.epydoc.rst b/doc/source/api/diffpy.pdffit2.doc.epydoc.rst new file mode 100644 index 00000000..09cc3203 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.doc.epydoc.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.doc.epydoc package +================================= + +.. automodule:: diffpy.pdffit2.doc.epydoc + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.doc.examples.rst b/doc/source/api/diffpy.pdffit2.doc.examples.rst new file mode 100644 index 00000000..70e0eb3a --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.doc.examples.rst @@ -0,0 +1,37 @@ +:tocdepth: -1 + +diffpy.pdffit2.doc.examples package +=================================== + +.. automodule:: diffpy.pdffit2.doc.examples + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +diffpy.pdffit2.doc.examples.Ni_plot_pdf module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.pdffit2.doc.examples.Ni_plot_pdf + :members: + :undoc-members: + :show-inheritance: + +diffpy.pdffit2.doc.examples.Ni_calculation module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.pdffit2.doc.examples.Ni_calculation + :members: + :undoc-members: + :show-inheritance: + +diffpy.pdffit2.doc.examples.Ni_refinement module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.pdffit2.doc.examples.Ni_refinement + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.doc.rst b/doc/source/api/diffpy.pdffit2.doc.rst new file mode 100644 index 00000000..c7240e08 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.doc.rst @@ -0,0 +1,20 @@ +:tocdepth: -1 + +diffpy.pdffit2.doc package +========================== + +.. automodule:: diffpy.pdffit2.doc + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2.doc.epydoc + diffpy.pdffit2.doc.source + diffpy.pdffit2.doc.examples + diff --git a/doc/source/api/diffpy.pdffit2.doc.source._static.rst b/doc/source/api/diffpy.pdffit2.doc.source._static.rst new file mode 100644 index 00000000..74e4514d --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.doc.source._static.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.doc.source._static package +========================================= + +.. automodule:: diffpy.pdffit2.doc.source._static + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.doc.source.api.rst b/doc/source/api/diffpy.pdffit2.doc.source.api.rst new file mode 100644 index 00000000..f4fa7c73 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.doc.source.api.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.doc.source.api package +===================================== + +.. automodule:: diffpy.pdffit2.doc.source.api + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst b/doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst new file mode 100644 index 00000000..c3c73d02 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.doc.source.epydoc package +======================================== + +.. automodule:: diffpy.pdffit2.doc.source.epydoc + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.doc.source.rst b/doc/source/api/diffpy.pdffit2.doc.source.rst new file mode 100644 index 00000000..56eebb22 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.doc.source.rst @@ -0,0 +1,31 @@ +:tocdepth: -1 + +diffpy.pdffit2.doc.source package +================================= + +.. automodule:: diffpy.pdffit2.doc.source + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2.doc.source.epydoc + diffpy.pdffit2.doc.source._static + diffpy.pdffit2.doc.source.api + +Submodules +---------- + +diffpy.pdffit2.doc.source.conf module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.pdffit2.doc.source.conf + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.example_package.rst b/doc/source/api/diffpy.pdffit2.example_package.rst deleted file mode 100644 index 1c6346c7..00000000 --- a/doc/source/api/diffpy.pdffit2.example_package.rst +++ /dev/null @@ -1,31 +0,0 @@ -.. _example_package documentation: - -|title| -======= - -.. |title| replace:: diffpy.pdffit2.example_package package - -.. automodule:: diffpy.pdffit2.example_package - :members: - :undoc-members: - :show-inheritance: - -|foo| ------ - -.. |foo| replace:: diffpy.pdffit2.example_package.foo module - -.. automodule:: diffpy.pdffit2.example_package.foo - :members: - :undoc-members: - :show-inheritance: - -|bar| ------ - -.. |bar| replace:: diffpy.pdffit2.example_package.bar module - -.. automodule:: diffpy.pdffit2.example_package.foo - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.news.rst b/doc/source/api/diffpy.pdffit2.news.rst new file mode 100644 index 00000000..eeef3a39 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.news.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.news package +=========================== + +.. automodule:: diffpy.pdffit2.news + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.requirements.rst b/doc/source/api/diffpy.pdffit2.requirements.rst new file mode 100644 index 00000000..eb7c9dd3 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.requirements.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.requirements package +=================================== + +.. automodule:: diffpy.pdffit2.requirements + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.rst index 70ca1b77..98892ba0 100644 --- a/doc/source/api/diffpy.pdffit2.rst +++ b/doc/source/api/diffpy.pdffit2.rst @@ -1,9 +1,7 @@ :tocdepth: -1 -|title| -======= - -.. |title| replace:: diffpy.pdffit2 package +diffpy.pdffit2 package +====================== .. automodule:: diffpy.pdffit2 :members: @@ -14,17 +12,27 @@ Subpackages ----------- .. toctree:: - diffpy.pdffit2.example_package + :titlesonly: + + diffpy.pdffit2.conda-recipe + diffpy.pdffit2.doc + diffpy.pdffit2.dist + diffpy.pdffit2..idea + diffpy.pdffit2.src + diffpy.pdffit2.news + diffpy.pdffit2..github + diffpy.pdffit2.devutils + diffpy.pdffit2.requirements + diffpy.pdffit2..git Submodules ---------- -|module| --------- - -.. |module| replace:: diffpy.pdffit2.example_submodule module +diffpy.pdffit2.setup module +^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. automodule:: diffpy.pdffit2.example_submodule +.. automodule:: diffpy.pdffit2.setup :members: :undoc-members: :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst b/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst new file mode 100644 index 00000000..566bf83f --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.src.diffpy.pdffit2.egg-info package +================================================== + +.. automodule:: diffpy.pdffit2.src.diffpy.pdffit2.egg-info + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst new file mode 100644 index 00000000..e51749be --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst @@ -0,0 +1,37 @@ +:tocdepth: -1 + +diffpy.pdffit2.src.diffpy.pdffit2 package +========================================= + +.. automodule:: diffpy.pdffit2.src.diffpy.pdffit2 + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +diffpy.pdffit2.src.diffpy.pdffit2.ipy_ext module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.pdffit2.src.diffpy.pdffit2.ipy_ext + :members: + :undoc-members: + :show-inheritance: + +diffpy.pdffit2.src.diffpy.pdffit2.pdffit module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.pdffit2.src.diffpy.pdffit2.pdffit + :members: + :undoc-members: + :show-inheritance: + +diffpy.pdffit2.src.diffpy.pdffit2.output module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.pdffit2.src.diffpy.pdffit2.output + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.src.diffpy.rst b/doc/source/api/diffpy.pdffit2.src.diffpy.rst new file mode 100644 index 00000000..7362896e --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.src.diffpy.rst @@ -0,0 +1,18 @@ +:tocdepth: -1 + +diffpy.pdffit2.src.diffpy package +================================= + +.. automodule:: diffpy.pdffit2.src.diffpy + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2.src.diffpy.pdffit2 + diff --git a/doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst b/doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst new file mode 100644 index 00000000..7e55fcaa --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.src.extensions.libpdffit2 package +================================================ + +.. automodule:: diffpy.pdffit2.src.extensions.libpdffit2 + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst b/doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst new file mode 100644 index 00000000..58f71017 --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst @@ -0,0 +1,10 @@ +:tocdepth: -1 + +diffpy.pdffit2.src.extensions.pdffit2module package +=================================================== + +.. automodule:: diffpy.pdffit2.src.extensions.pdffit2module + :members: + :undoc-members: + :show-inheritance: + diff --git a/doc/source/api/diffpy.pdffit2.src.extensions.rst b/doc/source/api/diffpy.pdffit2.src.extensions.rst new file mode 100644 index 00000000..1813199f --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.src.extensions.rst @@ -0,0 +1,19 @@ +:tocdepth: -1 + +diffpy.pdffit2.src.extensions package +===================================== + +.. automodule:: diffpy.pdffit2.src.extensions + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2.src.extensions.libpdffit2 + diffpy.pdffit2.src.extensions.pdffit2module + diff --git a/doc/source/api/diffpy.pdffit2.src.rst b/doc/source/api/diffpy.pdffit2.src.rst new file mode 100644 index 00000000..4d61d91a --- /dev/null +++ b/doc/source/api/diffpy.pdffit2.src.rst @@ -0,0 +1,20 @@ +:tocdepth: -1 + +diffpy.pdffit2.src package +========================== + +.. automodule:: diffpy.pdffit2.src + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :titlesonly: + + diffpy.pdffit2.src.diffpy + diffpy.pdffit2.src.diffpy.pdffit2.egg-info + diffpy.pdffit2.src.extensions + From a7be96bbc11fef4ba864acb362378d13155ff40c Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Fri, 26 Jul 2024 12:26:24 -0400 Subject: [PATCH 071/294] remove duplicate epydoc/ folder in doc/ --- doc/epydoc/Makefile | 17 -------------- doc/epydoc/epydoc.cfg | 54 ------------------------------------------- 2 files changed, 71 deletions(-) delete mode 100644 doc/epydoc/Makefile delete mode 100644 doc/epydoc/epydoc.cfg diff --git a/doc/epydoc/Makefile b/doc/epydoc/Makefile deleted file mode 100644 index 756095f5..00000000 --- a/doc/epydoc/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -PKGNAME = diffpy.pdffit2 -OUTPUT = html -WEBDOCDIR = login.cacr.caltech.edu:/cacr/home/proj/danse/docs.danse.us/docroot/diffraction - - -all: - epydoc --config=epydoc.cfg --output=$(OUTPUT) \ - --name=$(PKGNAME) $(PKGNAME) - - -clean: - /bin/rm -rf $(OUTPUT) - - -publish: - rsync -e /usr/bin/ssh -va --chmod=a+rwx,o-w,Dg+s,Fa-x \ - $(OUTPUT)/ $(WEBDOCDIR)/$(PKGNAME) diff --git a/doc/epydoc/epydoc.cfg b/doc/epydoc/epydoc.cfg deleted file mode 100644 index dddbcd90..00000000 --- a/doc/epydoc/epydoc.cfg +++ /dev/null @@ -1,54 +0,0 @@ -[epydoc] - -# docformat -# The default markup language for docstrings, for modules that do -# not define __docformat__. Defaults to epytext. -docformat: plaintext - -# The type of output that should be generated. Should be one -# of: html, text, latex, dvi, ps, pdf. -output: html - -# An integer indicating how verbose epydoc should be. The default -# value is 0; negative values will supress warnings and errors; -# positive values will give more verbose output. -verbosity: 0 - -# A boolean value indicating that Epydoc should show a tracaback -# in case of unexpected error. By default don't show tracebacks -debug: 0 - -# If True, don't try to use colors or cursor control when doing -# textual output. The default False assumes a rich text prompt -simple-term: 1 - -# The format for showing inheritance objects. -# It should be one of: 'grouped', 'listed', 'included'. -inheritance: grouped - -# Whether or not to inclue private variables. (Even if included, -# private variables will be hidden by default.) -private: yes - -# Whether or not to list each module's imports. -imports: yes - -# Whether or not to include syntax highlighted source code in -# the output (HTML only). -sourcecode: yes - -# Whether or not to includea a page with Epydoc log, containing -# effective option at the time of generation and the reported logs. -include-log: no - -### Output options - -# The documented project's name. -#name: diffpy.FIXME - -# The CSS stylesheet for HTML output. Can be the name of a builtin -# stylesheet, or the name of a file. -css: white - -# The documented project's URL. -url: http://www.diffpy.org/ From 0f460fd23398e69715843e30613f7f1ba830cb20 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Fri, 26 Jul 2024 12:34:30 -0400 Subject: [PATCH 072/294] prevent autodoc warning --- doc/source/conf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index c15e8639..7052bc79 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -18,6 +18,10 @@ from importlib.metadata import version from pathlib import Path + +# Eliminate autodoc warning +autodoc_mock_imports = ["diffpy.pdffit2"] + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use Path().resolve() to make it absolute, like shown here. From 856d6d2d5aae9e760809f8e5f713f2def36c6d5a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:49:07 +0000 Subject: [PATCH 073/294] [pre-commit.ci] auto fixes from pre-commit hooks --- doc/source/api/diffpy.pdffit2..git.branches.rst | 1 - doc/source/api/diffpy.pdffit2..git.hooks.rst | 1 - doc/source/api/diffpy.pdffit2..git.info.rst | 1 - doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst | 1 - doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst | 1 - doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst | 1 - doc/source/api/diffpy.pdffit2..git.logs.refs.rst | 1 - doc/source/api/diffpy.pdffit2..git.logs.rst | 1 - doc/source/api/diffpy.pdffit2..git.objects.info.rst | 1 - doc/source/api/diffpy.pdffit2..git.objects.pack.rst | 1 - doc/source/api/diffpy.pdffit2..git.objects.rst | 1 - doc/source/api/diffpy.pdffit2..git.refs.heads.rst | 1 - doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst | 1 - doc/source/api/diffpy.pdffit2..git.refs.remotes.rst | 1 - doc/source/api/diffpy.pdffit2..git.refs.rst | 1 - doc/source/api/diffpy.pdffit2..git.refs.tags.rst | 1 - doc/source/api/diffpy.pdffit2..git.rst | 1 - doc/source/api/diffpy.pdffit2..github.rst | 1 - doc/source/api/diffpy.pdffit2..github.workflows.rst | 1 - doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst | 1 - doc/source/api/diffpy.pdffit2..idea.rst | 1 - doc/source/api/diffpy.pdffit2.conda-recipe.rst | 1 - doc/source/api/diffpy.pdffit2.devutils.rst | 1 - doc/source/api/diffpy.pdffit2.dist.rst | 1 - doc/source/api/diffpy.pdffit2.doc.epydoc.rst | 1 - doc/source/api/diffpy.pdffit2.doc.examples.rst | 1 - doc/source/api/diffpy.pdffit2.doc.rst | 1 - doc/source/api/diffpy.pdffit2.doc.source._static.rst | 1 - doc/source/api/diffpy.pdffit2.doc.source.api.rst | 1 - doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst | 1 - doc/source/api/diffpy.pdffit2.doc.source.rst | 1 - doc/source/api/diffpy.pdffit2.news.rst | 1 - doc/source/api/diffpy.pdffit2.requirements.rst | 1 - doc/source/api/diffpy.pdffit2.rst | 1 - doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst | 1 - doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst | 1 - doc/source/api/diffpy.pdffit2.src.diffpy.rst | 1 - doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst | 1 - doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst | 1 - doc/source/api/diffpy.pdffit2.src.extensions.rst | 1 - doc/source/api/diffpy.pdffit2.src.rst | 1 - doc/source/conf.py | 1 - 42 files changed, 42 deletions(-) diff --git a/doc/source/api/diffpy.pdffit2..git.branches.rst b/doc/source/api/diffpy.pdffit2..git.branches.rst index e448ee3b..0c6e73ab 100644 --- a/doc/source/api/diffpy.pdffit2..git.branches.rst +++ b/doc/source/api/diffpy.pdffit2..git.branches.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..git.branches package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..git.hooks.rst b/doc/source/api/diffpy.pdffit2..git.hooks.rst index 21156bde..d3ff7bd8 100644 --- a/doc/source/api/diffpy.pdffit2..git.hooks.rst +++ b/doc/source/api/diffpy.pdffit2..git.hooks.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..git.hooks package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..git.info.rst b/doc/source/api/diffpy.pdffit2..git.info.rst index 6af4f94a..df4ba70f 100644 --- a/doc/source/api/diffpy.pdffit2..git.info.rst +++ b/doc/source/api/diffpy.pdffit2..git.info.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..git.info package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst index 1f33cefe..c488622f 100644 --- a/doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst +++ b/doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..git.logs.refs.heads package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst index 3d46f4d2..730c957e 100644 --- a/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst +++ b/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..git.logs.refs.remotes.origin package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst index c6b1133a..387272a7 100644 --- a/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst +++ b/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst @@ -15,4 +15,3 @@ Subpackages :titlesonly: diffpy.pdffit2..git.logs.refs.remotes.origin - diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.rst index f3f52bb6..725a8650 100644 --- a/doc/source/api/diffpy.pdffit2..git.logs.refs.rst +++ b/doc/source/api/diffpy.pdffit2..git.logs.refs.rst @@ -16,4 +16,3 @@ Subpackages diffpy.pdffit2..git.logs.refs.remotes diffpy.pdffit2..git.logs.refs.heads - diff --git a/doc/source/api/diffpy.pdffit2..git.logs.rst b/doc/source/api/diffpy.pdffit2..git.logs.rst index b0a95a07..9414abd1 100644 --- a/doc/source/api/diffpy.pdffit2..git.logs.rst +++ b/doc/source/api/diffpy.pdffit2..git.logs.rst @@ -15,4 +15,3 @@ Subpackages :titlesonly: diffpy.pdffit2..git.logs.refs - diff --git a/doc/source/api/diffpy.pdffit2..git.objects.info.rst b/doc/source/api/diffpy.pdffit2..git.objects.info.rst index e0d5cfd8..89d50d6d 100644 --- a/doc/source/api/diffpy.pdffit2..git.objects.info.rst +++ b/doc/source/api/diffpy.pdffit2..git.objects.info.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..git.objects.info package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..git.objects.pack.rst b/doc/source/api/diffpy.pdffit2..git.objects.pack.rst index e499b2ef..0193d5c0 100644 --- a/doc/source/api/diffpy.pdffit2..git.objects.pack.rst +++ b/doc/source/api/diffpy.pdffit2..git.objects.pack.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..git.objects.pack package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..git.objects.rst b/doc/source/api/diffpy.pdffit2..git.objects.rst index 51819b09..c498320d 100644 --- a/doc/source/api/diffpy.pdffit2..git.objects.rst +++ b/doc/source/api/diffpy.pdffit2..git.objects.rst @@ -16,4 +16,3 @@ Subpackages diffpy.pdffit2..git.objects.info diffpy.pdffit2..git.objects.pack - diff --git a/doc/source/api/diffpy.pdffit2..git.refs.heads.rst b/doc/source/api/diffpy.pdffit2..git.refs.heads.rst index 355dce1d..0d457843 100644 --- a/doc/source/api/diffpy.pdffit2..git.refs.heads.rst +++ b/doc/source/api/diffpy.pdffit2..git.refs.heads.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..git.refs.heads package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst b/doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst index 9c8826ef..c3ad19c3 100644 --- a/doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst +++ b/doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..git.refs.remotes.origin package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..git.refs.remotes.rst b/doc/source/api/diffpy.pdffit2..git.refs.remotes.rst index dd7dd110..dadf4c86 100644 --- a/doc/source/api/diffpy.pdffit2..git.refs.remotes.rst +++ b/doc/source/api/diffpy.pdffit2..git.refs.remotes.rst @@ -15,4 +15,3 @@ Subpackages :titlesonly: diffpy.pdffit2..git.refs.remotes.origin - diff --git a/doc/source/api/diffpy.pdffit2..git.refs.rst b/doc/source/api/diffpy.pdffit2..git.refs.rst index 8b77b9d1..86ab1649 100644 --- a/doc/source/api/diffpy.pdffit2..git.refs.rst +++ b/doc/source/api/diffpy.pdffit2..git.refs.rst @@ -17,4 +17,3 @@ Subpackages diffpy.pdffit2..git.refs.tags diffpy.pdffit2..git.refs.remotes diffpy.pdffit2..git.refs.heads - diff --git a/doc/source/api/diffpy.pdffit2..git.refs.tags.rst b/doc/source/api/diffpy.pdffit2..git.refs.tags.rst index 53acf633..c323a1ca 100644 --- a/doc/source/api/diffpy.pdffit2..git.refs.tags.rst +++ b/doc/source/api/diffpy.pdffit2..git.refs.tags.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..git.refs.tags package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..git.rst b/doc/source/api/diffpy.pdffit2..git.rst index 95e2b35b..c8c7eb31 100644 --- a/doc/source/api/diffpy.pdffit2..git.rst +++ b/doc/source/api/diffpy.pdffit2..git.rst @@ -20,4 +20,3 @@ Subpackages diffpy.pdffit2..git.objects diffpy.pdffit2..git.logs diffpy.pdffit2..git.refs - diff --git a/doc/source/api/diffpy.pdffit2..github.rst b/doc/source/api/diffpy.pdffit2..github.rst index 01859fde..3dc15783 100644 --- a/doc/source/api/diffpy.pdffit2..github.rst +++ b/doc/source/api/diffpy.pdffit2..github.rst @@ -15,4 +15,3 @@ Subpackages :titlesonly: diffpy.pdffit2..github.workflows - diff --git a/doc/source/api/diffpy.pdffit2..github.workflows.rst b/doc/source/api/diffpy.pdffit2..github.workflows.rst index 9f1daf12..cb2abea2 100644 --- a/doc/source/api/diffpy.pdffit2..github.workflows.rst +++ b/doc/source/api/diffpy.pdffit2..github.workflows.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..github.workflows package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst b/doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst index 929148cf..553c86d6 100644 --- a/doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst +++ b/doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst @@ -7,4 +7,3 @@ diffpy.pdffit2..idea.inspectionProfiles package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2..idea.rst b/doc/source/api/diffpy.pdffit2..idea.rst index 7cf242f0..a12d7ab7 100644 --- a/doc/source/api/diffpy.pdffit2..idea.rst +++ b/doc/source/api/diffpy.pdffit2..idea.rst @@ -15,4 +15,3 @@ Subpackages :titlesonly: diffpy.pdffit2..idea.inspectionProfiles - diff --git a/doc/source/api/diffpy.pdffit2.conda-recipe.rst b/doc/source/api/diffpy.pdffit2.conda-recipe.rst index c9da6edb..576bf96a 100644 --- a/doc/source/api/diffpy.pdffit2.conda-recipe.rst +++ b/doc/source/api/diffpy.pdffit2.conda-recipe.rst @@ -18,4 +18,3 @@ diffpy.pdffit2.conda-recipe.run_test module :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.devutils.rst b/doc/source/api/diffpy.pdffit2.devutils.rst index bfdb4551..672e2769 100644 --- a/doc/source/api/diffpy.pdffit2.devutils.rst +++ b/doc/source/api/diffpy.pdffit2.devutils.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.devutils package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.dist.rst b/doc/source/api/diffpy.pdffit2.dist.rst index 0baee332..92f64b29 100644 --- a/doc/source/api/diffpy.pdffit2.dist.rst +++ b/doc/source/api/diffpy.pdffit2.dist.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.dist package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.doc.epydoc.rst b/doc/source/api/diffpy.pdffit2.doc.epydoc.rst index 09cc3203..6805542b 100644 --- a/doc/source/api/diffpy.pdffit2.doc.epydoc.rst +++ b/doc/source/api/diffpy.pdffit2.doc.epydoc.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.doc.epydoc package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.doc.examples.rst b/doc/source/api/diffpy.pdffit2.doc.examples.rst index 70e0eb3a..a65270c0 100644 --- a/doc/source/api/diffpy.pdffit2.doc.examples.rst +++ b/doc/source/api/diffpy.pdffit2.doc.examples.rst @@ -34,4 +34,3 @@ diffpy.pdffit2.doc.examples.Ni_refinement module :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.doc.rst b/doc/source/api/diffpy.pdffit2.doc.rst index c7240e08..677d88a1 100644 --- a/doc/source/api/diffpy.pdffit2.doc.rst +++ b/doc/source/api/diffpy.pdffit2.doc.rst @@ -17,4 +17,3 @@ Subpackages diffpy.pdffit2.doc.epydoc diffpy.pdffit2.doc.source diffpy.pdffit2.doc.examples - diff --git a/doc/source/api/diffpy.pdffit2.doc.source._static.rst b/doc/source/api/diffpy.pdffit2.doc.source._static.rst index 74e4514d..91e43b85 100644 --- a/doc/source/api/diffpy.pdffit2.doc.source._static.rst +++ b/doc/source/api/diffpy.pdffit2.doc.source._static.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.doc.source._static package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.doc.source.api.rst b/doc/source/api/diffpy.pdffit2.doc.source.api.rst index f4fa7c73..ac900b93 100644 --- a/doc/source/api/diffpy.pdffit2.doc.source.api.rst +++ b/doc/source/api/diffpy.pdffit2.doc.source.api.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.doc.source.api package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst b/doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst index c3c73d02..42d5a199 100644 --- a/doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst +++ b/doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.doc.source.epydoc package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.doc.source.rst b/doc/source/api/diffpy.pdffit2.doc.source.rst index 56eebb22..7d962e6e 100644 --- a/doc/source/api/diffpy.pdffit2.doc.source.rst +++ b/doc/source/api/diffpy.pdffit2.doc.source.rst @@ -28,4 +28,3 @@ diffpy.pdffit2.doc.source.conf module :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.news.rst b/doc/source/api/diffpy.pdffit2.news.rst index eeef3a39..6eeeb455 100644 --- a/doc/source/api/diffpy.pdffit2.news.rst +++ b/doc/source/api/diffpy.pdffit2.news.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.news package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.requirements.rst b/doc/source/api/diffpy.pdffit2.requirements.rst index eb7c9dd3..c1174b54 100644 --- a/doc/source/api/diffpy.pdffit2.requirements.rst +++ b/doc/source/api/diffpy.pdffit2.requirements.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.requirements package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.rst index 98892ba0..01fff3d2 100644 --- a/doc/source/api/diffpy.pdffit2.rst +++ b/doc/source/api/diffpy.pdffit2.rst @@ -35,4 +35,3 @@ diffpy.pdffit2.setup module :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst b/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst index 566bf83f..1c4e8989 100644 --- a/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst +++ b/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.src.diffpy.pdffit2.egg-info package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst index e51749be..af492535 100644 --- a/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst +++ b/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst @@ -34,4 +34,3 @@ diffpy.pdffit2.src.diffpy.pdffit2.output module :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.src.diffpy.rst b/doc/source/api/diffpy.pdffit2.src.diffpy.rst index 7362896e..d49a5646 100644 --- a/doc/source/api/diffpy.pdffit2.src.diffpy.rst +++ b/doc/source/api/diffpy.pdffit2.src.diffpy.rst @@ -15,4 +15,3 @@ Subpackages :titlesonly: diffpy.pdffit2.src.diffpy.pdffit2 - diff --git a/doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst b/doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst index 7e55fcaa..7179332d 100644 --- a/doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst +++ b/doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.src.extensions.libpdffit2 package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst b/doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst index 58f71017..7cfa4606 100644 --- a/doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst +++ b/doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst @@ -7,4 +7,3 @@ diffpy.pdffit2.src.extensions.pdffit2module package :members: :undoc-members: :show-inheritance: - diff --git a/doc/source/api/diffpy.pdffit2.src.extensions.rst b/doc/source/api/diffpy.pdffit2.src.extensions.rst index 1813199f..83339b3a 100644 --- a/doc/source/api/diffpy.pdffit2.src.extensions.rst +++ b/doc/source/api/diffpy.pdffit2.src.extensions.rst @@ -16,4 +16,3 @@ Subpackages diffpy.pdffit2.src.extensions.libpdffit2 diffpy.pdffit2.src.extensions.pdffit2module - diff --git a/doc/source/api/diffpy.pdffit2.src.rst b/doc/source/api/diffpy.pdffit2.src.rst index 4d61d91a..2fbc5dbc 100644 --- a/doc/source/api/diffpy.pdffit2.src.rst +++ b/doc/source/api/diffpy.pdffit2.src.rst @@ -17,4 +17,3 @@ Subpackages diffpy.pdffit2.src.diffpy diffpy.pdffit2.src.diffpy.pdffit2.egg-info diffpy.pdffit2.src.extensions - diff --git a/doc/source/conf.py b/doc/source/conf.py index 7052bc79..e5e8dace 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -18,7 +18,6 @@ from importlib.metadata import version from pathlib import Path - # Eliminate autodoc warning autodoc_mock_imports = ["diffpy.pdffit2"] From 79fd7d05207fd15ab714f771dbec5a59df358168 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Fri, 26 Jul 2024 13:21:02 -0400 Subject: [PATCH 074/294] modify README.rst to be like cookiecutter --- README.rst | 138 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 96 insertions(+), 42 deletions(-) diff --git a/README.rst b/README.rst index 6bc9518f..e4ddb15e 100644 --- a/README.rst +++ b/README.rst @@ -1,10 +1,39 @@ +|Icon| |title|_ +=============== -.. image:: https://codecov.io/gh/diffpy/diffpy.pdffit2/branch/master/graph/badge.svg - :target: https://codecov.io/gh/diffpy/diffpy.pdffit2 +.. |title| replace:: diffpy.pdffit2 +.. _title: https://diffpy.github.io/diffpy.pdffit2 +.. |Icon| image:: https://avatars.githubusercontent.com/diffpy + :target: https://diffpy.github.io/diffpy.pdffit2 + :height: 100px -PDFfit2 -======================================================================== +|PyPi| |Forge| |PythonVersion| |PR| + +|CI| |Codecov| |Black| |Tracking| + +.. |Black| image:: https://img.shields.io/badge/code_style-black-black + :target: https://github.com/psf/black + +.. |CI| image:: https://github.com/diffpy/diffpy.pdffit2/actions/workflows/main.yml/badge.svg + :target: https://github.com/diffpy/diffpy.pdffit2/actions/workflows/main.yml + +.. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.pdffit2/branch/main/graph/badge.svg + :target: https://codecov.io/gh/diffpy/diffpy.pdffit2 + +.. |Forge| image:: https://img.shields.io/conda/vn/conda-forge/diffpy.pdffit2 + :target: https://anaconda.org/conda-forge/diffpy.pdffit2 + +.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff + +.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.pdffit2 + :target: https://pypi.org/project/diffpy.pdffit2/ + +.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.pdffit2 + :target: https://pypi.org/project/diffpy.pdffit2/ + +.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue + :target: https://github.com/diffpy/diffpy.pdffit2/issues Real space structure refinement to atomic pair distribution function. @@ -29,11 +58,18 @@ To learn more about diffpy.pdffit2 library, see the examples directory included in this distribution or the API documentation at http://www.diffpy.org/doc/pdffit2. +Citation +-------- + +If you use diffpy.pdffit2 in a scientific publication, we would like you to cite this package as + + diffpy.pdffit2 Package, https://github.com/diffpy/diffpy.pdffit2 -REQUIREMENTS ------------------------------------------------------------------------- -diffpy.pdffit2 requires Python 3.7 or later or 2.7 and +Installation +------------ + +diffpy.pdffit2 requires Python 3.10 or later and the following external software: * ``setuptools`` - software distribution tools for Python @@ -43,50 +79,44 @@ the following external software: * ``diffpy.structure`` - simple storage and manipulation of atomic structures, https://github.com/diffpy/diffpy.structure -We recommend to use `Anaconda Python `_ -as it allows to install all software dependencies together with -PDFfit2. For other Python distributions it is necessary to -install the required software separately. As an example, on Ubuntu -Linux some of the required software can be installed using :: - - sudo apt-get install \ - python-setuptools python-dev libgsl0-dev build-essential +---- +The preferred method is to use `Miniconda Python +`_ +and install from the "conda-forge" channel of Conda packages. -INSTALLATION ------------------------------------------------------------------------- +To add "conda-forge" to the conda channels, run the following in a terminal. :: -The preferred method is to use Anaconda Python and install from the -"conda-forge" channel of Anaconda packages :: + conda config --add channels conda-forge - conda install -c conda-forge diffpy.pdffit2 +We want to install our packages in a suitable conda environment. +The following creates and activates a new environment named ``diffpy.pdffit2_env`` :: -If you don't use Anaconda or prefer to install from sources, make -sure the required software is in place and run :: + conda create -n diffpy.pdffit2_env python=3 + conda activate diffpy.pdffit2_env - python setup.py install +Then, to fully install ``diffpy.pdffit2`` in our active environment, run :: -By default the files get installed to standard system directories, -which may require the use of ``sudo`` for write permissions. If -administrator (root) access is not available, consult the output from -``python setup.py install --help`` for options to install as a regular -user to other locations. The installation integrity can be -verified by changing to the HOME directory and running :: + conda install diffpy.pdffit2 - python -m diffpy.pdffit2.tests.rundeps +Another option is to use ``pip`` to download and install the latest release from +`Python Package Index `_. +To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, we will also have to install dependencies :: -Anaconda Python allows to later update PDFfit2 using :: + pip install -r https://raw.githubusercontent.com/diffpy/diffpy.pdffit2/main/requirements/run.txt - conda update diffpy.pdffit2 +and then install the package :: -With other Python distributions use the easy_install program to -upgraded to the latest version :: + pip install diffpy.pdffit2 - easy_install --upgrade diffpy.pdffit2 +If you prefer to install from sources, after installing the dependencies, obtain the source archive from +`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory +and run the following :: + pip install . -DEVELOPMENT ------------------------------------------------------------------------- +Support and Contribute +---------------------- PDFfit2 is not developed anymore and is only maintained due to its status of a sole computational engine for PDFgui. We don't expect any @@ -97,12 +127,36 @@ at https://github.com/diffpy/diffpy.pdffit2. For an actively developed codes for PDF simulations see the DiffPy-CMI framework at http://www.diffpy.org. +---- + +`Diffpy user group `_ is the discussion forum for general questions and discussions about the use of diffpy.pdffit2. Please join the diffpy.pdffit2 users community by joining the Google group. The diffpy.pdffit2 project welcomes your expertise and enthusiasm! + +If you see a bug or want to request a feature, please `report it as an issue `_ and/or `submit a fix as a PR `_. You can also post it to the `Diffpy user group `_. + +Feel free to fork the project and contribute. To install diffpy.pdffit2 +in a development mode, with its sources being directly used by Python +rather than copied to a package directory, use the following in the root +directory :: + + pip install -e . + +To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit +hooks. + +1. Install pre-commit in your working environment by running ``conda install pre-commit``. + +2. Initialize pre-commit (one time only) ``pre-commit install``. + +Thereafter your code will be linted by black and isort and checked against flake8 before you can commit. +If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should +pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before +trying to commit again. -CONTACTS ------------------------------------------------------------------------- +Improvements and fixes are always appreciated. -For more information on diffpy.pdffit2 please visit the project web-page: +Before contributing, please read our `Code of Conduct `_. -http://www.diffpy.org/ +Contact +------- -or email Prof. Simon Billinge at sb2896@columbia.edu. +For more information on diffpy.pdffit2 please visit the project `web-page `_ or email Prof. Simon Billinge at sb2896@columbia.edu. From d59c6ec50fa4d2aa0c19236b65b9216e6213135e Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Fri, 26 Jul 2024 13:32:43 -0400 Subject: [PATCH 075/294] cite paper instead of repo --- README.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index e4ddb15e..702131a4 100644 --- a/README.rst +++ b/README.rst @@ -61,10 +61,11 @@ http://www.diffpy.org/doc/pdffit2. Citation -------- -If you use diffpy.pdffit2 in a scientific publication, we would like you to cite this package as - - diffpy.pdffit2 Package, https://github.com/diffpy/diffpy.pdffit2 +If you use diffpy.pdffit2 in a scientific publication, we would like you to cite the following paper: + 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 (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) Installation ------------ From a70155143d60dc4f9923031427474fd0aaa3d2e8 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Fri, 26 Jul 2024 13:35:18 -0400 Subject: [PATCH 076/294] fix citation in LICENSE.rst --- LICENSE.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/LICENSE.rst b/LICENSE.rst index 9618d51a..daeacb69 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -5,10 +5,9 @@ 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. Juhas, J. W. Liu, D. Bryndin, E. S. Bozin, - 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) + 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 (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) Copyright 2006-2007, Board of Trustees of Michigan State University, Copyright 2008-2024, Board of Trustees of Columbia University in the From d6c6713ddfffbbd3eefb4098fcb76fa196e989c3 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 13:28:18 -0400 Subject: [PATCH 077/294] make docs.yml run on "cookie" branch (temp) --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a4661f5c..bbe70f33 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - cookie # to be removed during merge to main release: jobs: From 93d5839fb24a6d872289ad1ff49461bfc1f01039 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 13:31:48 -0400 Subject: [PATCH 078/294] make docs.yml run on PRs --- .github/workflows/docs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bbe70f33..0b130f3d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,6 +5,10 @@ on: branches: - main - cookie # to be removed during merge to main + pull_request: # to be removed during merge to main + branches: + - main + - cookie release: jobs: From 1fc8abdc2655b5b0c508c75bca91b4eb108cff8a Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 14:13:12 -0400 Subject: [PATCH 079/294] only use diffpy.utils.rst docs API file --- .../api/diffpy.pdffit2..git.branches.rst | 9 ---- doc/source/api/diffpy.pdffit2..git.hooks.rst | 9 ---- doc/source/api/diffpy.pdffit2..git.info.rst | 9 ---- .../diffpy.pdffit2..git.logs.refs.heads.rst | 9 ---- ....pdffit2..git.logs.refs.remotes.origin.rst | 9 ---- .../diffpy.pdffit2..git.logs.refs.remotes.rst | 17 -------- .../api/diffpy.pdffit2..git.logs.refs.rst | 18 -------- doc/source/api/diffpy.pdffit2..git.logs.rst | 17 -------- .../api/diffpy.pdffit2..git.objects.info.rst | 9 ---- .../api/diffpy.pdffit2..git.objects.pack.rst | 9 ---- .../api/diffpy.pdffit2..git.objects.rst | 18 -------- .../api/diffpy.pdffit2..git.refs.heads.rst | 9 ---- ...iffpy.pdffit2..git.refs.remotes.origin.rst | 9 ---- .../api/diffpy.pdffit2..git.refs.remotes.rst | 17 -------- doc/source/api/diffpy.pdffit2..git.refs.rst | 19 --------- .../api/diffpy.pdffit2..git.refs.tags.rst | 9 ---- doc/source/api/diffpy.pdffit2..git.rst | 22 ---------- doc/source/api/diffpy.pdffit2..github.rst | 17 -------- .../api/diffpy.pdffit2..github.workflows.rst | 9 ---- ...iffpy.pdffit2..idea.inspectionProfiles.rst | 9 ---- doc/source/api/diffpy.pdffit2..idea.rst | 17 -------- .../api/diffpy.pdffit2.conda-recipe.rst | 20 --------- doc/source/api/diffpy.pdffit2.devutils.rst | 9 ---- doc/source/api/diffpy.pdffit2.dist.rst | 9 ---- doc/source/api/diffpy.pdffit2.doc.epydoc.rst | 9 ---- .../api/diffpy.pdffit2.doc.examples.rst | 36 ---------------- doc/source/api/diffpy.pdffit2.doc.rst | 19 --------- .../api/diffpy.pdffit2.doc.source._static.rst | 9 ---- .../api/diffpy.pdffit2.doc.source.api.rst | 9 ---- .../api/diffpy.pdffit2.doc.source.epydoc.rst | 9 ---- doc/source/api/diffpy.pdffit2.doc.source.rst | 30 -------------- doc/source/api/diffpy.pdffit2.news.rst | 9 ---- .../api/diffpy.pdffit2.requirements.rst | 9 ---- doc/source/api/diffpy.pdffit2.rst | 41 +++++++++---------- ...py.pdffit2.src.diffpy.pdffit2.egg-info.rst | 9 ---- .../api/diffpy.pdffit2.src.diffpy.pdffit2.rst | 36 ---------------- doc/source/api/diffpy.pdffit2.src.diffpy.rst | 17 -------- ...ffpy.pdffit2.src.extensions.libpdffit2.rst | 9 ---- ...y.pdffit2.src.extensions.pdffit2module.rst | 9 ---- .../api/diffpy.pdffit2.src.extensions.rst | 18 -------- doc/source/api/diffpy.pdffit2.src.rst | 19 --------- 41 files changed, 20 insertions(+), 585 deletions(-) delete mode 100644 doc/source/api/diffpy.pdffit2..git.branches.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.hooks.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.info.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.logs.refs.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.logs.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.objects.info.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.objects.pack.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.objects.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.refs.heads.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.refs.remotes.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.refs.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.refs.tags.rst delete mode 100644 doc/source/api/diffpy.pdffit2..git.rst delete mode 100644 doc/source/api/diffpy.pdffit2..github.rst delete mode 100644 doc/source/api/diffpy.pdffit2..github.workflows.rst delete mode 100644 doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst delete mode 100644 doc/source/api/diffpy.pdffit2..idea.rst delete mode 100644 doc/source/api/diffpy.pdffit2.conda-recipe.rst delete mode 100644 doc/source/api/diffpy.pdffit2.devutils.rst delete mode 100644 doc/source/api/diffpy.pdffit2.dist.rst delete mode 100644 doc/source/api/diffpy.pdffit2.doc.epydoc.rst delete mode 100644 doc/source/api/diffpy.pdffit2.doc.examples.rst delete mode 100644 doc/source/api/diffpy.pdffit2.doc.rst delete mode 100644 doc/source/api/diffpy.pdffit2.doc.source._static.rst delete mode 100644 doc/source/api/diffpy.pdffit2.doc.source.api.rst delete mode 100644 doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst delete mode 100644 doc/source/api/diffpy.pdffit2.doc.source.rst delete mode 100644 doc/source/api/diffpy.pdffit2.news.rst delete mode 100644 doc/source/api/diffpy.pdffit2.requirements.rst delete mode 100644 doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst delete mode 100644 doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst delete mode 100644 doc/source/api/diffpy.pdffit2.src.diffpy.rst delete mode 100644 doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst delete mode 100644 doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst delete mode 100644 doc/source/api/diffpy.pdffit2.src.extensions.rst delete mode 100644 doc/source/api/diffpy.pdffit2.src.rst diff --git a/doc/source/api/diffpy.pdffit2..git.branches.rst b/doc/source/api/diffpy.pdffit2..git.branches.rst deleted file mode 100644 index 0c6e73ab..00000000 --- a/doc/source/api/diffpy.pdffit2..git.branches.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.branches package -==================================== - -.. automodule:: diffpy.pdffit2..git.branches - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..git.hooks.rst b/doc/source/api/diffpy.pdffit2..git.hooks.rst deleted file mode 100644 index d3ff7bd8..00000000 --- a/doc/source/api/diffpy.pdffit2..git.hooks.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.hooks package -================================= - -.. automodule:: diffpy.pdffit2..git.hooks - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..git.info.rst b/doc/source/api/diffpy.pdffit2..git.info.rst deleted file mode 100644 index df4ba70f..00000000 --- a/doc/source/api/diffpy.pdffit2..git.info.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.info package -================================ - -.. automodule:: diffpy.pdffit2..git.info - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst deleted file mode 100644 index c488622f..00000000 --- a/doc/source/api/diffpy.pdffit2..git.logs.refs.heads.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.logs.refs.heads package -=========================================== - -.. automodule:: diffpy.pdffit2..git.logs.refs.heads - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst deleted file mode 100644 index 730c957e..00000000 --- a/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.origin.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.logs.refs.remotes.origin package -==================================================== - -.. automodule:: diffpy.pdffit2..git.logs.refs.remotes.origin - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst deleted file mode 100644 index 387272a7..00000000 --- a/doc/source/api/diffpy.pdffit2..git.logs.refs.remotes.rst +++ /dev/null @@ -1,17 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.logs.refs.remotes package -============================================= - -.. automodule:: diffpy.pdffit2..git.logs.refs.remotes - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2..git.logs.refs.remotes.origin diff --git a/doc/source/api/diffpy.pdffit2..git.logs.refs.rst b/doc/source/api/diffpy.pdffit2..git.logs.refs.rst deleted file mode 100644 index 725a8650..00000000 --- a/doc/source/api/diffpy.pdffit2..git.logs.refs.rst +++ /dev/null @@ -1,18 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.logs.refs package -===================================== - -.. automodule:: diffpy.pdffit2..git.logs.refs - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2..git.logs.refs.remotes - diffpy.pdffit2..git.logs.refs.heads diff --git a/doc/source/api/diffpy.pdffit2..git.logs.rst b/doc/source/api/diffpy.pdffit2..git.logs.rst deleted file mode 100644 index 9414abd1..00000000 --- a/doc/source/api/diffpy.pdffit2..git.logs.rst +++ /dev/null @@ -1,17 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.logs package -================================ - -.. automodule:: diffpy.pdffit2..git.logs - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2..git.logs.refs diff --git a/doc/source/api/diffpy.pdffit2..git.objects.info.rst b/doc/source/api/diffpy.pdffit2..git.objects.info.rst deleted file mode 100644 index 89d50d6d..00000000 --- a/doc/source/api/diffpy.pdffit2..git.objects.info.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.objects.info package -======================================== - -.. automodule:: diffpy.pdffit2..git.objects.info - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..git.objects.pack.rst b/doc/source/api/diffpy.pdffit2..git.objects.pack.rst deleted file mode 100644 index 0193d5c0..00000000 --- a/doc/source/api/diffpy.pdffit2..git.objects.pack.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.objects.pack package -======================================== - -.. automodule:: diffpy.pdffit2..git.objects.pack - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..git.objects.rst b/doc/source/api/diffpy.pdffit2..git.objects.rst deleted file mode 100644 index c498320d..00000000 --- a/doc/source/api/diffpy.pdffit2..git.objects.rst +++ /dev/null @@ -1,18 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.objects package -=================================== - -.. automodule:: diffpy.pdffit2..git.objects - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2..git.objects.info - diffpy.pdffit2..git.objects.pack diff --git a/doc/source/api/diffpy.pdffit2..git.refs.heads.rst b/doc/source/api/diffpy.pdffit2..git.refs.heads.rst deleted file mode 100644 index 0d457843..00000000 --- a/doc/source/api/diffpy.pdffit2..git.refs.heads.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.refs.heads package -====================================== - -.. automodule:: diffpy.pdffit2..git.refs.heads - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst b/doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst deleted file mode 100644 index c3ad19c3..00000000 --- a/doc/source/api/diffpy.pdffit2..git.refs.remotes.origin.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.refs.remotes.origin package -=============================================== - -.. automodule:: diffpy.pdffit2..git.refs.remotes.origin - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..git.refs.remotes.rst b/doc/source/api/diffpy.pdffit2..git.refs.remotes.rst deleted file mode 100644 index dadf4c86..00000000 --- a/doc/source/api/diffpy.pdffit2..git.refs.remotes.rst +++ /dev/null @@ -1,17 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.refs.remotes package -======================================== - -.. automodule:: diffpy.pdffit2..git.refs.remotes - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2..git.refs.remotes.origin diff --git a/doc/source/api/diffpy.pdffit2..git.refs.rst b/doc/source/api/diffpy.pdffit2..git.refs.rst deleted file mode 100644 index 86ab1649..00000000 --- a/doc/source/api/diffpy.pdffit2..git.refs.rst +++ /dev/null @@ -1,19 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.refs package -================================ - -.. automodule:: diffpy.pdffit2..git.refs - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2..git.refs.tags - diffpy.pdffit2..git.refs.remotes - diffpy.pdffit2..git.refs.heads diff --git a/doc/source/api/diffpy.pdffit2..git.refs.tags.rst b/doc/source/api/diffpy.pdffit2..git.refs.tags.rst deleted file mode 100644 index c323a1ca..00000000 --- a/doc/source/api/diffpy.pdffit2..git.refs.tags.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git.refs.tags package -===================================== - -.. automodule:: diffpy.pdffit2..git.refs.tags - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..git.rst b/doc/source/api/diffpy.pdffit2..git.rst deleted file mode 100644 index c8c7eb31..00000000 --- a/doc/source/api/diffpy.pdffit2..git.rst +++ /dev/null @@ -1,22 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..git package -=========================== - -.. automodule:: diffpy.pdffit2..git - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2..git.hooks - diffpy.pdffit2..git.info - diffpy.pdffit2..git.branches - diffpy.pdffit2..git.objects - diffpy.pdffit2..git.logs - diffpy.pdffit2..git.refs diff --git a/doc/source/api/diffpy.pdffit2..github.rst b/doc/source/api/diffpy.pdffit2..github.rst deleted file mode 100644 index 3dc15783..00000000 --- a/doc/source/api/diffpy.pdffit2..github.rst +++ /dev/null @@ -1,17 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..github package -============================== - -.. automodule:: diffpy.pdffit2..github - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2..github.workflows diff --git a/doc/source/api/diffpy.pdffit2..github.workflows.rst b/doc/source/api/diffpy.pdffit2..github.workflows.rst deleted file mode 100644 index cb2abea2..00000000 --- a/doc/source/api/diffpy.pdffit2..github.workflows.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..github.workflows package -======================================== - -.. automodule:: diffpy.pdffit2..github.workflows - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst b/doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst deleted file mode 100644 index 553c86d6..00000000 --- a/doc/source/api/diffpy.pdffit2..idea.inspectionProfiles.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..idea.inspectionProfiles package -=============================================== - -.. automodule:: diffpy.pdffit2..idea.inspectionProfiles - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2..idea.rst b/doc/source/api/diffpy.pdffit2..idea.rst deleted file mode 100644 index a12d7ab7..00000000 --- a/doc/source/api/diffpy.pdffit2..idea.rst +++ /dev/null @@ -1,17 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2..idea package -============================ - -.. automodule:: diffpy.pdffit2..idea - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2..idea.inspectionProfiles diff --git a/doc/source/api/diffpy.pdffit2.conda-recipe.rst b/doc/source/api/diffpy.pdffit2.conda-recipe.rst deleted file mode 100644 index 576bf96a..00000000 --- a/doc/source/api/diffpy.pdffit2.conda-recipe.rst +++ /dev/null @@ -1,20 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.conda-recipe package -=================================== - -.. automodule:: diffpy.pdffit2.conda-recipe - :members: - :undoc-members: - :show-inheritance: - -Submodules ----------- - -diffpy.pdffit2.conda-recipe.run_test module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.pdffit2.conda-recipe.run_test - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.devutils.rst b/doc/source/api/diffpy.pdffit2.devutils.rst deleted file mode 100644 index 672e2769..00000000 --- a/doc/source/api/diffpy.pdffit2.devutils.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.devutils package -=============================== - -.. automodule:: diffpy.pdffit2.devutils - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.dist.rst b/doc/source/api/diffpy.pdffit2.dist.rst deleted file mode 100644 index 92f64b29..00000000 --- a/doc/source/api/diffpy.pdffit2.dist.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.dist package -=========================== - -.. automodule:: diffpy.pdffit2.dist - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.doc.epydoc.rst b/doc/source/api/diffpy.pdffit2.doc.epydoc.rst deleted file mode 100644 index 6805542b..00000000 --- a/doc/source/api/diffpy.pdffit2.doc.epydoc.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.doc.epydoc package -================================= - -.. automodule:: diffpy.pdffit2.doc.epydoc - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.doc.examples.rst b/doc/source/api/diffpy.pdffit2.doc.examples.rst deleted file mode 100644 index a65270c0..00000000 --- a/doc/source/api/diffpy.pdffit2.doc.examples.rst +++ /dev/null @@ -1,36 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.doc.examples package -=================================== - -.. automodule:: diffpy.pdffit2.doc.examples - :members: - :undoc-members: - :show-inheritance: - -Submodules ----------- - -diffpy.pdffit2.doc.examples.Ni_plot_pdf module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.pdffit2.doc.examples.Ni_plot_pdf - :members: - :undoc-members: - :show-inheritance: - -diffpy.pdffit2.doc.examples.Ni_calculation module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.pdffit2.doc.examples.Ni_calculation - :members: - :undoc-members: - :show-inheritance: - -diffpy.pdffit2.doc.examples.Ni_refinement module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.pdffit2.doc.examples.Ni_refinement - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.doc.rst b/doc/source/api/diffpy.pdffit2.doc.rst deleted file mode 100644 index 677d88a1..00000000 --- a/doc/source/api/diffpy.pdffit2.doc.rst +++ /dev/null @@ -1,19 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.doc package -========================== - -.. automodule:: diffpy.pdffit2.doc - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2.doc.epydoc - diffpy.pdffit2.doc.source - diffpy.pdffit2.doc.examples diff --git a/doc/source/api/diffpy.pdffit2.doc.source._static.rst b/doc/source/api/diffpy.pdffit2.doc.source._static.rst deleted file mode 100644 index 91e43b85..00000000 --- a/doc/source/api/diffpy.pdffit2.doc.source._static.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.doc.source._static package -========================================= - -.. automodule:: diffpy.pdffit2.doc.source._static - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.doc.source.api.rst b/doc/source/api/diffpy.pdffit2.doc.source.api.rst deleted file mode 100644 index ac900b93..00000000 --- a/doc/source/api/diffpy.pdffit2.doc.source.api.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.doc.source.api package -===================================== - -.. automodule:: diffpy.pdffit2.doc.source.api - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst b/doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst deleted file mode 100644 index 42d5a199..00000000 --- a/doc/source/api/diffpy.pdffit2.doc.source.epydoc.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.doc.source.epydoc package -======================================== - -.. automodule:: diffpy.pdffit2.doc.source.epydoc - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.doc.source.rst b/doc/source/api/diffpy.pdffit2.doc.source.rst deleted file mode 100644 index 7d962e6e..00000000 --- a/doc/source/api/diffpy.pdffit2.doc.source.rst +++ /dev/null @@ -1,30 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.doc.source package -================================= - -.. automodule:: diffpy.pdffit2.doc.source - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2.doc.source.epydoc - diffpy.pdffit2.doc.source._static - diffpy.pdffit2.doc.source.api - -Submodules ----------- - -diffpy.pdffit2.doc.source.conf module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.pdffit2.doc.source.conf - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.news.rst b/doc/source/api/diffpy.pdffit2.news.rst deleted file mode 100644 index 6eeeb455..00000000 --- a/doc/source/api/diffpy.pdffit2.news.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.news package -=========================== - -.. automodule:: diffpy.pdffit2.news - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.requirements.rst b/doc/source/api/diffpy.pdffit2.requirements.rst deleted file mode 100644 index c1174b54..00000000 --- a/doc/source/api/diffpy.pdffit2.requirements.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.requirements package -=================================== - -.. automodule:: diffpy.pdffit2.requirements - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.rst index 01fff3d2..67d7d4d9 100644 --- a/doc/source/api/diffpy.pdffit2.rst +++ b/doc/source/api/diffpy.pdffit2.rst @@ -1,37 +1,36 @@ :tocdepth: -1 diffpy.pdffit2 package -====================== +==================== -.. automodule:: diffpy.pdffit2 +.. automodule:: diffpy.utils :members: :undoc-members: :show-inheritance: -Subpackages ------------ +Submodules +---------- -.. toctree:: - :titlesonly: +diffpy.pdffit2.ipy_ext module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - diffpy.pdffit2.conda-recipe - diffpy.pdffit2.doc - diffpy.pdffit2.dist - diffpy.pdffit2..idea - diffpy.pdffit2.src - diffpy.pdffit2.news - diffpy.pdffit2..github - diffpy.pdffit2.devutils - diffpy.pdffit2.requirements - diffpy.pdffit2..git +.. automodule:: diffpy.pdffit2.ipy_ext + :members: + :undoc-members: + :show-inheritance: -Submodules ----------- +diffpy.pdffit2.pdffit module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.pdffit2.pdffit + :members: + :undoc-members: + :show-inheritance: -diffpy.pdffit2.setup module -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +diffpy.pdffit2.output module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. automodule:: diffpy.pdffit2.setup +.. automodule:: diffpy.pdffit2.output :members: :undoc-members: :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst b/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst deleted file mode 100644 index 1c4e8989..00000000 --- a/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.egg-info.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.src.diffpy.pdffit2.egg-info package -================================================== - -.. automodule:: diffpy.pdffit2.src.diffpy.pdffit2.egg-info - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst deleted file mode 100644 index af492535..00000000 --- a/doc/source/api/diffpy.pdffit2.src.diffpy.pdffit2.rst +++ /dev/null @@ -1,36 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.src.diffpy.pdffit2 package -========================================= - -.. automodule:: diffpy.pdffit2.src.diffpy.pdffit2 - :members: - :undoc-members: - :show-inheritance: - -Submodules ----------- - -diffpy.pdffit2.src.diffpy.pdffit2.ipy_ext module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.pdffit2.src.diffpy.pdffit2.ipy_ext - :members: - :undoc-members: - :show-inheritance: - -diffpy.pdffit2.src.diffpy.pdffit2.pdffit module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.pdffit2.src.diffpy.pdffit2.pdffit - :members: - :undoc-members: - :show-inheritance: - -diffpy.pdffit2.src.diffpy.pdffit2.output module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.pdffit2.src.diffpy.pdffit2.output - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.src.diffpy.rst b/doc/source/api/diffpy.pdffit2.src.diffpy.rst deleted file mode 100644 index d49a5646..00000000 --- a/doc/source/api/diffpy.pdffit2.src.diffpy.rst +++ /dev/null @@ -1,17 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.src.diffpy package -================================= - -.. automodule:: diffpy.pdffit2.src.diffpy - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2.src.diffpy.pdffit2 diff --git a/doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst b/doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst deleted file mode 100644 index 7179332d..00000000 --- a/doc/source/api/diffpy.pdffit2.src.extensions.libpdffit2.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.src.extensions.libpdffit2 package -================================================ - -.. automodule:: diffpy.pdffit2.src.extensions.libpdffit2 - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst b/doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst deleted file mode 100644 index 7cfa4606..00000000 --- a/doc/source/api/diffpy.pdffit2.src.extensions.pdffit2module.rst +++ /dev/null @@ -1,9 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.src.extensions.pdffit2module package -=================================================== - -.. automodule:: diffpy.pdffit2.src.extensions.pdffit2module - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/source/api/diffpy.pdffit2.src.extensions.rst b/doc/source/api/diffpy.pdffit2.src.extensions.rst deleted file mode 100644 index 83339b3a..00000000 --- a/doc/source/api/diffpy.pdffit2.src.extensions.rst +++ /dev/null @@ -1,18 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.src.extensions package -===================================== - -.. automodule:: diffpy.pdffit2.src.extensions - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2.src.extensions.libpdffit2 - diffpy.pdffit2.src.extensions.pdffit2module diff --git a/doc/source/api/diffpy.pdffit2.src.rst b/doc/source/api/diffpy.pdffit2.src.rst deleted file mode 100644 index 2fbc5dbc..00000000 --- a/doc/source/api/diffpy.pdffit2.src.rst +++ /dev/null @@ -1,19 +0,0 @@ -:tocdepth: -1 - -diffpy.pdffit2.src package -========================== - -.. automodule:: diffpy.pdffit2.src - :members: - :undoc-members: - :show-inheritance: - -Subpackages ------------ - -.. toctree:: - :titlesonly: - - diffpy.pdffit2.src.diffpy - diffpy.pdffit2.src.diffpy.pdffit2.egg-info - diffpy.pdffit2.src.extensions From 7425a8a802c634620b819bdf3fe889373febf7e2 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 14:14:41 -0400 Subject: [PATCH 080/294] give appropriate perms to docs.yml --- .github/workflows/docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b130f3d..52cfaffa 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,6 +14,9 @@ on: jobs: test: runs-on: ubuntu-latest + permissions: # to be removed during merge to main + contents: write + pages: write defaults: run: shell: bash -l {0} From a0770f0ae3eaf927bf7de0c30b5bbc91037425a4 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 14:15:34 -0400 Subject: [PATCH 081/294] use correct license in docs --- doc/source/license.rst | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/doc/source/license.rst b/doc/source/license.rst index cfab61c2..421a9ed7 100644 --- a/doc/source/license.rst +++ b/doc/source/license.rst @@ -2,38 +2,4 @@ .. index:: license -License -####### - -OPEN SOURCE LICENSE AGREEMENT -============================= -BSD 3-Clause License - -Copyright (c) 2024, The Trustees of Columbia University in -the City of New York. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. 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. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -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 HOLDER 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. +.. include:: ../../LICENSE.rst From 1fb7ed3034fc785068aaf92526a5920d9ceed45a Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Sat, 27 Jul 2024 14:18:39 -0400 Subject: [PATCH 082/294] Update PAT in docs.yml --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b130f3d..138a4da1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -44,5 +44,5 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GH_PAT }} publish_dir: ./doc/build/html From 50f6211ddacaee338b99ba0fe17a4638ffb85e06 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 14:20:34 -0400 Subject: [PATCH 083/294] add title to license --- LICENSE.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LICENSE.rst b/LICENSE.rst index 9618d51a..d92c65ab 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -1,3 +1,6 @@ +License +####### + This program is part of the DiffPy and DANSE open-source projects and is available subject to the conditions and terms laid out below. From 27cd30f86f5aea524fb78a86d0ae641d0b25eee4 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 14:24:17 -0400 Subject: [PATCH 084/294] minor doc api file reformatting --- doc/source/api/diffpy.pdffit2.rst | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/doc/source/api/diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.rst index 67d7d4d9..cd474770 100644 --- a/doc/source/api/diffpy.pdffit2.rst +++ b/doc/source/api/diffpy.pdffit2.rst @@ -1,18 +1,15 @@ :tocdepth: -1 diffpy.pdffit2 package -==================== +====================== -.. automodule:: diffpy.utils +.. automodule:: diffpy.pdffit2 :members: :undoc-members: :show-inheritance: -Submodules ----------- - diffpy.pdffit2.ipy_ext module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +----------------------------- .. automodule:: diffpy.pdffit2.ipy_ext :members: @@ -20,7 +17,7 @@ diffpy.pdffit2.ipy_ext module :show-inheritance: diffpy.pdffit2.pdffit module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +----------------------------- .. automodule:: diffpy.pdffit2.pdffit :members: @@ -28,7 +25,7 @@ diffpy.pdffit2.pdffit module :show-inheritance: diffpy.pdffit2.output module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +----------------------------- .. automodule:: diffpy.pdffit2.output :members: From 9d77b5e632e149506205dd594df795849bfe5a6d Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Sat, 27 Jul 2024 14:27:36 -0400 Subject: [PATCH 085/294] Update try reverting permissions in docs.yml --- .github/workflows/docs.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 06048b60..0b130f3d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,9 +14,6 @@ on: jobs: test: runs-on: ubuntu-latest - permissions: # to be removed during merge to main - contents: write - pages: write defaults: run: shell: bash -l {0} @@ -47,5 +44,5 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GH_PAT }} + github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./doc/build/html From cdda60207f3b05fac8598cb5b5b878fd4cce52fb Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Sat, 27 Jul 2024 14:32:42 -0400 Subject: [PATCH 086/294] remove on pr in docs.yml --- .github/workflows/docs.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b130f3d..bbe70f33 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,10 +5,6 @@ on: branches: - main - cookie # to be removed during merge to main - pull_request: # to be removed during merge to main - branches: - - main - - cookie release: jobs: From 26b9e2e2e215621cc55acc2e8e7f3e9f5e676939 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 15:11:36 -0400 Subject: [PATCH 087/294] multi-platform testing --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 00f20efe..3477e4f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: ["ubuntu-latest"] + os: ["ubuntu-latest", "windows-latest", "macos-latest"] steps: - name: check out diffpy.pdffit2 uses: actions/checkout@v3 From b97db665ee476d1d2270a8a9e99f549d15a93b66 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 15:13:14 -0400 Subject: [PATCH 088/294] test on multiple python versions --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3477e4f3..6b02aa61 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: + python-version: ['3.10', '3.11', '3.12'] os: ["ubuntu-latest", "windows-latest", "macos-latest"] steps: - name: check out diffpy.pdffit2 @@ -33,7 +34,7 @@ jobs: # maintain this but rather maintain the requirements files it just has # basic things in it like conda and pip environment-file: ./environment.yml - python-version: 3 + python-version: ${{ matrix.python-version }} auto-activate-base: false - name: install diffpy.pdffit2 requirements From 5bf577b17312aa8452fa47f4cecb8ba3f7b10b2d Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 15:22:56 -0400 Subject: [PATCH 089/294] update miniconda installation step --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b02aa61..f54dd8c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,8 +27,9 @@ jobs: - name: initialize miniconda # this uses a marketplace action that sets up miniconda in a way that makes # it easier to use. I tried setting it up without this and it was a pain - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: + miniconda-version: "latest" activate-environment: test # environment.yml file is needed by this action. Because I don't want # maintain this but rather maintain the requirements files it just has From 40594b8ba30a57054720691d1df79c9f75f116d0 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 15:25:00 -0400 Subject: [PATCH 090/294] add specific version and conda to environment.yml --- environment.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 0e55d589..804cd50c 100644 --- a/environment.yml +++ b/environment.yml @@ -2,8 +2,9 @@ name: diffpy.pdffit2 channels: - conda-forge dependencies: - - python=3 + - python=${{ matrix.python-version }} - pip + - conda - gsl - gcc - gxx From 384f7dd0633fd3cc397756fdf55f6a495e65f5e0 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 15:27:34 -0400 Subject: [PATCH 091/294] remove rever.xsh --- rever.xsh | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 rever.xsh diff --git a/rever.xsh b/rever.xsh deleted file mode 100644 index 2af270b9..00000000 --- a/rever.xsh +++ /dev/null @@ -1,14 +0,0 @@ -$PROJECT = 'diffpy.pdffit2' -$ACTIVITIES = [ - 'tag', # Creates a tag for the new version number - 'push_tag', # Pushes the tag up to the $TAG_REMOTE - 'pypi', # Sends the package to pypi - 'ghrelease' # Creates a Github release entry for the new tag - ] -$PUSH_TAG_REMOTE = 'git@github.com:diffpy/diffpy.pdffit2.git' # Repo to push tags to -$GITHUB_ORG = 'diffpy' # Github org for Github releases and conda-forge -$GITHUB_REPO = 'diffpy.pdffit2' # Github repo for Github releases and conda-forge -$GHRELEASE_PREPEND = """See [CHANGELOG.md](CHANGELOG.md) for detailed release notes. - -The release is also available at [PyPI](https://pypi.org/project/diffpy.pdffit2/) and [Conda](https://anaconda.org/conda-forge/diffpy.pdffit2). -""" # release message From b746b47729815ddf28fca516babf4c48d0a530f4 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 15:31:42 -0400 Subject: [PATCH 092/294] change environment.yml python version to range --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 804cd50c..6956a79d 100644 --- a/environment.yml +++ b/environment.yml @@ -2,7 +2,7 @@ name: diffpy.pdffit2 channels: - conda-forge dependencies: - - python=${{ matrix.python-version }} + - python>=3.10 - pip - conda - gsl From b4878cb70fd76436cd964bedba53678443206027 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Sat, 27 Jul 2024 15:34:17 -0400 Subject: [PATCH 093/294] remove mac support --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f54dd8c8..a49b7e63 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: python-version: ['3.10', '3.11', '3.12'] - os: ["ubuntu-latest", "windows-latest", "macos-latest"] + os: ["ubuntu-latest", "windows-latest"] steps: - name: check out diffpy.pdffit2 uses: actions/checkout@v3 From 5ed4cda8a6c2ae55ffc9e34e49963e063d5dc85f Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Mon, 29 Jul 2024 21:43:54 -0400 Subject: [PATCH 094/294] Add macos test --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a49b7e63..b0921bad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,7 @@ on: branches: - main - CI + - cookie pull_request: workflow_dispatch: @@ -15,7 +16,7 @@ jobs: strategy: matrix: python-version: ['3.10', '3.11', '3.12'] - os: ["ubuntu-latest", "windows-latest"] + os: ["macos-latest", "ubuntu-latest", "windows-latest"] steps: - name: check out diffpy.pdffit2 uses: actions/checkout@v3 From dbb35a028dcfdc4fcc22947b6a6e8c657958d718 Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Mon, 29 Jul 2024 21:53:32 -0400 Subject: [PATCH 095/294] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b0921bad..86c3c040 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: # environment.yml file is needed by this action. Because I don't want # maintain this but rather maintain the requirements files it just has # basic things in it like conda and pip - environment-file: ./environment.yml + environment-file: environment.yml python-version: ${{ matrix.python-version }} auto-activate-base: false From e764aadd486164c214983137872bfb4df501e408 Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Mon, 29 Jul 2024 21:55:10 -0400 Subject: [PATCH 096/294] Update environment.yml --- environment.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/environment.yml b/environment.yml index 6956a79d..5fb2f044 100644 --- a/environment.yml +++ b/environment.yml @@ -5,6 +5,3 @@ dependencies: - python>=3.10 - pip - conda - - gsl - - gcc - - gxx From b8cb8e78885b1bd454b8d6b592ef4c61e6876fa5 Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:38:45 -0400 Subject: [PATCH 097/294] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86c3c040..437a7e67 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,6 +45,7 @@ jobs: conda config --set always_yes yes --set changeps1 no conda config --add channels conda-forge conda activate test + conda install --file requirements/build.txt conda install --file requirements/run.txt conda install --file requirements/test.txt pip install . From 9e20621990662598b98150d2057edad22057e342 Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:38:59 -0400 Subject: [PATCH 098/294] Update build.txt --- requirements/build.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/build.txt b/requirements/build.txt index f72d870d..23094c91 100644 --- a/requirements/build.txt +++ b/requirements/build.txt @@ -1,2 +1,3 @@ python setuptools +gsl From 5789b7d260ea51895a19c87a2d02c6a17eb7322b Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Wed, 31 Jul 2024 07:21:24 -0400 Subject: [PATCH 099/294] don't test on push into cookie any more, linting coveragerc --- .coveragerc | 8 ++++---- .github/workflows/main.yml | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.coveragerc b/.coveragerc index e20b9438..13b71cd9 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,7 +2,7 @@ source = diffpy.pdffit2 omit = - ## exclude debug.py from codecov report + # exclude debug.py from codecov report */tests/debug.py [report] omit = @@ -13,14 +13,14 @@ omit = *_version.py # RE patterns for lines to be excluded from consideration. exclude_lines = - ## Have to re-enable the standard pragma + # Have to re-enable the standard pragma pragma: no cover - ## Don't complain if tests don't hit defensive assertion code: + # Don't complain if tests don't hit defensive assertion code: raise AssertionError raise NotImplementedError ^[ ]*assert False - ## Don't complain if non-runnable code isn't run: + # Don't complain if non-runnable code isn't run: ^[ ]*@unittest.skip\b ^[ ]{4}unittest.main() if __name__ == '__main__': diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 437a7e67..6ebff6a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,6 @@ on: branches: - main - CI - - cookie pull_request: workflow_dispatch: From 79b93f56767ee0ae5f0030fdec5012f1e39e688f Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Wed, 31 Jul 2024 11:59:55 -0400 Subject: [PATCH 100/294] Small edit --- setup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.py b/setup.py index 5cac1080..a623ecb3 100755 --- a/setup.py +++ b/setup.py @@ -16,9 +16,6 @@ from setuptools import Extension, find_packages, setup MYDIR = os.path.dirname(os.path.abspath(__file__)) -versioncfgfile = os.path.join(MYDIR, "src/diffpy/pdffit2/version.cfg") -gitarchivecfgfile = os.path.join(MYDIR, ".gitarchive.cfg") - # Helper functions ----------------------------------------------------------- From 5db7cf6ec82466e0d4b6dfa78904c73c10f6b19b Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Wed, 31 Jul 2024 12:37:17 -0400 Subject: [PATCH 101/294] remove unnecessary setuptools stuff --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 665112c4..6945ff83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,9 +36,6 @@ classifiers = [ Homepage = "https://github.com/diffpy/diffpy.pdffit2/" Issues = "https://github.com/diffpy/diffpy.pdffit2/issues/" -[tools.setuptools] -package-dir = {"" = "src"} - [tool.setuptools-git-versioning] enabled = true template = "{tag}" From 76545d006aac244c00290908c5a4b1fec00781e9 Mon Sep 17 00:00:00 2001 From: Sparks29032 Date: Wed, 31 Jul 2024 13:01:42 -0400 Subject: [PATCH 102/294] Match cookiecutter --- setup.py | 59 ++++++++++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/setup.py b/setup.py index a623ecb3..6842274d 100755 --- a/setup.py +++ b/setup.py @@ -11,10 +11,16 @@ import os import re import sys +import glob import warnings from setuptools import Extension, find_packages, setup + +# Use this version when git data are not available, like in git zip archive. +# Update when tagging a new release. +FALLBACK_VERSION = '1.4.3' + MYDIR = os.path.dirname(os.path.abspath(__file__)) # Helper functions ----------------------------------------------------------- @@ -98,50 +104,31 @@ def get_gsl_config_win(): library_dirs += gcfg["library_dirs"] # add optimization flags for other compilers if needed +# define extension arguments here +ext_kws = { + 'include_dirs': include_dirs, + 'libraries': libraries, + 'library_dirs': library_dirs, + 'define_macros': define_macros, + 'extra_compile_args': extra_compile_args, + 'extra_link_args': extra_link_args, + 'extra_objects': extra_objects, +} # define extension here -pdffit2module = Extension( +def create_extensions(): + ext = Extension( "diffpy.pdffit2.pdffit2", - [ - "src/extensions/pdffit2module/bindings.cc", - "src/extensions/pdffit2module/misc.cc", - "src/extensions/pdffit2module/pdffit2module.cc", - "src/extensions/pdffit2module/pyexceptions.cc", - "src/extensions/libpdffit2/Atom.cc", - "src/extensions/libpdffit2/LocalPeriodicTable.cc", - "src/extensions/libpdffit2/OutputStreams.cc", - "src/extensions/libpdffit2/PeriodicTable.cc", - "src/extensions/libpdffit2/PointsInSphere.cc", - "src/extensions/libpdffit2/StringUtils.cc", - "src/extensions/libpdffit2/fit.cc", - "src/extensions/libpdffit2/gaussj.cc", - "src/extensions/libpdffit2/metric.cc", - "src/extensions/libpdffit2/nrutil.cc", - "src/extensions/libpdffit2/output.cc", - "src/extensions/libpdffit2/parser.cc", - "src/extensions/libpdffit2/pdf.cc", - "src/extensions/libpdffit2/pdffit.cc", - "src/extensions/libpdffit2/pdflsmin.cc", - "src/extensions/libpdffit2/scatlen.cc", - "src/extensions/libpdffit2/stru.cc", - ], - include_dirs=include_dirs, - libraries=libraries, - library_dirs=library_dirs, - define_macros=define_macros, - extra_compile_args=extra_compile_args, - extra_link_args=extra_link_args, - extra_objects=extra_objects, -) + glob.glob('src/extensions/**/*.cc'), + **ext_kws) + return [ext] setup_args = dict( - packages=find_packages(where="src"), - package_dir={"": "src"}, - ext_modules=[pdffit2module], - # scripts=[] # place examples here + ext_modules = [], ) if __name__ == "__main__": + setup_args['ext_modules'] = create_extensions() setup(**setup_args) # End of file From 7ca10bc7fb4d95cfe1651704cf29b2d1955f85be Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:05:18 +0000 Subject: [PATCH 103/294] [pre-commit.ci] auto fixes from pre-commit hooks --- setup.py | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/setup.py b/setup.py index 6842274d..ec2d270f 100755 --- a/setup.py +++ b/setup.py @@ -8,18 +8,17 @@ Scripts: pdffit2 """ +import glob import os import re import sys -import glob import warnings from setuptools import Extension, find_packages, setup - # Use this version when git data are not available, like in git zip archive. # Update when tagging a new release. -FALLBACK_VERSION = '1.4.3' +FALLBACK_VERSION = "1.4.3" MYDIR = os.path.dirname(os.path.abspath(__file__)) @@ -106,29 +105,28 @@ def get_gsl_config_win(): # define extension arguments here ext_kws = { - 'include_dirs': include_dirs, - 'libraries': libraries, - 'library_dirs': library_dirs, - 'define_macros': define_macros, - 'extra_compile_args': extra_compile_args, - 'extra_link_args': extra_link_args, - 'extra_objects': extra_objects, + "include_dirs": include_dirs, + "libraries": libraries, + "library_dirs": library_dirs, + "define_macros": define_macros, + "extra_compile_args": extra_compile_args, + "extra_link_args": extra_link_args, + "extra_objects": extra_objects, } + # define extension here def create_extensions(): - ext = Extension( - "diffpy.pdffit2.pdffit2", - glob.glob('src/extensions/**/*.cc'), - **ext_kws) + ext = Extension("diffpy.pdffit2.pdffit2", glob.glob("src/extensions/**/*.cc"), **ext_kws) return [ext] + setup_args = dict( - ext_modules = [], + ext_modules=[], ) if __name__ == "__main__": - setup_args['ext_modules'] = create_extensions() + setup_args["ext_modules"] = create_extensions() setup(**setup_args) # End of file From 334ab8d412a65db03d61be6033cf48c2934e4b03 Mon Sep 17 00:00:00 2001 From: Sparks29032 Date: Wed, 31 Jul 2024 13:08:06 -0400 Subject: [PATCH 104/294] Flake8 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ec2d270f..a788e91e 100755 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ import sys import warnings -from setuptools import Extension, find_packages, setup +from setuptools import Extension, setup # Use this version when git data are not available, like in git zip archive. # Update when tagging a new release. From 2ef6e0b7258bb4207e1c1608cb409ea22b737fe2 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Wed, 31 Jul 2024 17:21:00 +0000 Subject: [PATCH 105/294] Update CHANGELOG.rst --- CHANGELOG.rst | 8 ++++++++ news/news.rst | 24 ------------------------ 2 files changed, 8 insertions(+), 24 deletions(-) delete mode 100644 news/news.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 55012a9d..b0a678ae 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -24,3 +24,11 @@ Removed Fixed ===== + +1.4.4rc0 +======== + +**Fixed:** + +* Code linted to group flake8 standards +* Package structure moved to diffpy standard structure diff --git a/news/news.rst b/news/news.rst deleted file mode 100644 index e9bf5d01..00000000 --- a/news/news.rst +++ /dev/null @@ -1,24 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* Code linted to group flake8 standards -* Package structure moved to diffpy standard structure - -**Security:** - -* From f1c49a2ab05d093fe9496fd2bc6f71009c59ae53 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Wed, 31 Jul 2024 17:28:31 +0000 Subject: [PATCH 106/294] Update CHANGELOG.rst --- CHANGELOG.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b0a678ae..f0c6ca45 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -32,3 +32,6 @@ Fixed * Code linted to group flake8 standards * Package structure moved to diffpy standard structure + +1.4.4rc0 +======== From 42eb1487b412492e13024744deb809bc5b5a22de Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Mon, 5 Aug 2024 18:37:52 -0400 Subject: [PATCH 107/294] Create pytest.ini --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 pytest.ini diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..2fbf7d55 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +python_files = *Test*.py From 58129cddfd0a9b200f50c983c146520742776b52 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Tue, 20 Aug 2024 16:43:05 -0400 Subject: [PATCH 108/294] clean changelog of rogue utf8 --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f0c6ca45..c2db4706 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,7 +5,7 @@ Release Notes No notable functional changes from 1.4.1 -------------------------- -Version 1.4.2 – 2023-12-09 +Version 1.4.2 - 2023-12-09 -------------------------- Added From 45e62e5a16db7c2b3c21443c61822ff71d33a10c Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Tue, 20 Aug 2024 16:50:31 -0400 Subject: [PATCH 109/294] change name of workflow to reflect python version and os in matrix --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ebff6a1..3e2f093e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ on: jobs: miniconda: - name: Miniconda ${{ matrix.os }} + name: Python ${{ matrix.python-version }}, OS ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: From 1274670afe860a4627298d7fb941bdea24004791 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Mon, 26 Aug 2024 01:38:45 -0400 Subject: [PATCH 110/294] remote epydoc and pdffit2 mock in conf --- doc/source/api/diffpy.pdffit2.rst | 17 ++++++---- doc/source/conf.py | 3 -- doc/source/epydoc/Makefile | 17 ---------- doc/source/epydoc/epydoc.cfg | 54 ------------------------------- 4 files changed, 10 insertions(+), 81 deletions(-) delete mode 100644 doc/source/epydoc/Makefile delete mode 100644 doc/source/epydoc/epydoc.cfg diff --git a/doc/source/api/diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.rst index cd474770..759fb63c 100644 --- a/doc/source/api/diffpy.pdffit2.rst +++ b/doc/source/api/diffpy.pdffit2.rst @@ -8,26 +8,29 @@ diffpy.pdffit2 package :undoc-members: :show-inheritance: -diffpy.pdffit2.ipy_ext module ------------------------------ +Submodules +---------- -.. automodule:: diffpy.pdffit2.ipy_ext +diffpy.pdffit2.output module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.pdffit2.output :members: :undoc-members: :show-inheritance: diffpy.pdffit2.pdffit module ------------------------------ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. automodule:: diffpy.pdffit2.pdffit :members: :undoc-members: :show-inheritance: -diffpy.pdffit2.output module ------------------------------ +diffpy.pdffit2.ipy_ext module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. automodule:: diffpy.pdffit2.output +.. automodule:: diffpy.pdffit2.ipy_ext :members: :undoc-members: :show-inheritance: diff --git a/doc/source/conf.py b/doc/source/conf.py index e5e8dace..c15e8639 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -18,9 +18,6 @@ from importlib.metadata import version from pathlib import Path -# Eliminate autodoc warning -autodoc_mock_imports = ["diffpy.pdffit2"] - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use Path().resolve() to make it absolute, like shown here. diff --git a/doc/source/epydoc/Makefile b/doc/source/epydoc/Makefile deleted file mode 100644 index 756095f5..00000000 --- a/doc/source/epydoc/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -PKGNAME = diffpy.pdffit2 -OUTPUT = html -WEBDOCDIR = login.cacr.caltech.edu:/cacr/home/proj/danse/docs.danse.us/docroot/diffraction - - -all: - epydoc --config=epydoc.cfg --output=$(OUTPUT) \ - --name=$(PKGNAME) $(PKGNAME) - - -clean: - /bin/rm -rf $(OUTPUT) - - -publish: - rsync -e /usr/bin/ssh -va --chmod=a+rwx,o-w,Dg+s,Fa-x \ - $(OUTPUT)/ $(WEBDOCDIR)/$(PKGNAME) diff --git a/doc/source/epydoc/epydoc.cfg b/doc/source/epydoc/epydoc.cfg deleted file mode 100644 index dddbcd90..00000000 --- a/doc/source/epydoc/epydoc.cfg +++ /dev/null @@ -1,54 +0,0 @@ -[epydoc] - -# docformat -# The default markup language for docstrings, for modules that do -# not define __docformat__. Defaults to epytext. -docformat: plaintext - -# The type of output that should be generated. Should be one -# of: html, text, latex, dvi, ps, pdf. -output: html - -# An integer indicating how verbose epydoc should be. The default -# value is 0; negative values will supress warnings and errors; -# positive values will give more verbose output. -verbosity: 0 - -# A boolean value indicating that Epydoc should show a tracaback -# in case of unexpected error. By default don't show tracebacks -debug: 0 - -# If True, don't try to use colors or cursor control when doing -# textual output. The default False assumes a rich text prompt -simple-term: 1 - -# The format for showing inheritance objects. -# It should be one of: 'grouped', 'listed', 'included'. -inheritance: grouped - -# Whether or not to inclue private variables. (Even if included, -# private variables will be hidden by default.) -private: yes - -# Whether or not to list each module's imports. -imports: yes - -# Whether or not to include syntax highlighted source code in -# the output (HTML only). -sourcecode: yes - -# Whether or not to includea a page with Epydoc log, containing -# effective option at the time of generation and the reported logs. -include-log: no - -### Output options - -# The documented project's name. -#name: diffpy.FIXME - -# The CSS stylesheet for HTML output. Can be the name of a builtin -# stylesheet, or the name of a file. -css: white - -# The documented project's URL. -url: http://www.diffpy.org/ From 05e1daf4530afa8e92af8863eac4c27c3b70cc62 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Mon, 26 Aug 2024 01:46:57 -0400 Subject: [PATCH 111/294] use latest workflow --- .github/workflows/codecov.yml | 53 +++++++++++++++++++++++++ .github/workflows/docs.yml | 48 ++++++++++++----------- .github/workflows/main.yml | 66 ++++++++++---------------------- .github/workflows/matrix.yml | 47 +++++++++++++++++++++++ .github/workflows/pre-commit.yml | 19 --------- 5 files changed, 147 insertions(+), 86 deletions(-) create mode 100644 .github/workflows/codecov.yml create mode 100644 .github/workflows/matrix.yml delete mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 00000000..f8f239c1 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,53 @@ +name: Gather coverage report and upload to codecov + +on: + push: + branches: + - main + release: + types: + - prereleased + - published + workflow_dispatch: + +defaults: + run: + shell: bash -l {0} + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - name: Check out diffpy.pdffit2 + 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 + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install diffpy.pdffit2 and requirements + run: | + conda install --file requirements/run.txt + conda install --file requirements/test.txt + python -m pip install -r requirements/pip.txt + python -m pip install . --no-deps + + - name: Validate diffpy.pdffit2 + run: | + coverage run -m pytest -vv -s + coverage report -m + codecov + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bbe70f33..89ff2948 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,44 +1,48 @@ -name: Build Documentation +name: Build and Deploy Documentation on: - push: - branches: - - main - - cookie # to be removed during merge to main release: + types: + - published + workflow_dispatch: + +defaults: + run: + shell: bash -l {0} jobs: - test: + docs: runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - name: Check out diffpy.pdffit2 + uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v2 + - name: Initialize miniconda + uses: conda-incubator/setup-miniconda@v3 with: activate-environment: build auto-update-conda: true + environment-file: environment.yml + auto-activate-base: false - - name: install requirements + - name: Conda config run: >- - conda install -n build -c conda-forge - --file requirements/build.txt - --file requirements/run.txt - --file requirements/docs.txt - --quiet --yes + conda config --set always_yes yes + --set changeps1 no - - name: install the package - run: python -m pip install . --no-deps + - name: Install diffpy.pdffit2 and build requirements + run: | + conda install --file requirements/build.txt + conda install --file requirements/run.txt + conda install --file requirements/docs.txt + python -m pip install -r requirements/pip.txt + python -m pip install . --no-deps - name: build documents run: make -C doc html - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./doc/build/html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e2f093e..c005f227 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,66 +1,42 @@ -name: CI +name: Test on: push: branches: - main - - CI pull_request: workflow_dispatch: +defaults: + run: + shell: bash -l {0} + jobs: - miniconda: - name: Python ${{ matrix.python-version }}, OS ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: ['3.10', '3.11', '3.12'] - os: ["macos-latest", "ubuntu-latest", "windows-latest"] + validate: + runs-on: ubuntu-latest steps: - - name: check out diffpy.pdffit2 - uses: actions/checkout@v3 - with: - repository: diffpy/diffpy.pdffit2 - path: . - fetch-depth: 0 # avoid shallow clone with no tags + - name: Check out diffpy.pdffit2 + uses: actions/checkout@v4 - - name: initialize miniconda - # this uses a marketplace action that sets up miniconda in a way that makes - # it easier to use. I tried setting it up without this and it was a pain + - name: Initialize miniconda uses: conda-incubator/setup-miniconda@v3 with: - miniconda-version: "latest" activate-environment: test - # environment.yml file is needed by this action. Because I don't want - # maintain this but rather maintain the requirements files it just has - # basic things in it like conda and pip + auto-update-conda: true environment-file: environment.yml - python-version: ${{ matrix.python-version }} auto-activate-base: false - - name: install diffpy.pdffit2 requirements - shell: bash -l {0} + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install diffpy.pdffit2 and requirements run: | - conda config --set always_yes yes --set changeps1 no - conda config --add channels conda-forge - conda activate test - conda install --file requirements/build.txt conda install --file requirements/run.txt conda install --file requirements/test.txt - pip install . - - name: Validate diffpy.pdffit2 - shell: bash -l {0} - run: | - conda activate test - coverage run src/diffpy/pdffit2/tests/run.py - coverage report -m - codecov + python -m pip install -r requirements/pip.txt + python -m pip install . --no-deps -# Use this after migrating to pytest -# - name: Validate diffpy.pdffit2 -# shell: bash -l {0} -# run: | -# conda activate test -# coverage run -m pytest -vv -s -# coverage report -m -# codecov + - name: Validate diffpy.pdffit2 + run: python -m pytest diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml new file mode 100644 index 00000000..3b563db1 --- /dev/null +++ b/.github/workflows/matrix.yml @@ -0,0 +1,47 @@ +name: Matrix test + +on: + push: + branches: + - main + workflow_dispatch: + +defaults: + run: + shell: bash -l {0} + +jobs: + test: + name: Python ${{ matrix.python-version }}, OS ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12'] + os: ["macos-latest", "ubuntu-latest", "windows-latest"] + steps: + - name: check out diffpy.pdffit2 + 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 + python-version: ${{ matrix.python-version }} + auto-activate-base: false + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install diffpy.pdffit2 and requirements + run: | + conda install --file requirements/run.txt + conda install --file requirements/test.txt + python -m pip install -r requirements/pip.txt + python -m pip install . --no-deps + + - name: Validate diffpy.pdffit2 + run: python -m pytest diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index f2ff7e42..00000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - workflow_dispatch: - -jobs: - pre-commit: - # pull requests are a duplicate of a branch push if within the same repo. - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - - uses: pre-commit/action@v3.0.0 - with: - extra_args: --all-files From 33424421196d0c69ba56295da3c840c94eae3ec3 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Mon, 26 Aug 2024 01:58:48 -0400 Subject: [PATCH 112/294] remove deps tests --- src/diffpy/pdffit2/tests/__init__.py | 23 --------------------- src/diffpy/pdffit2/tests/rundeps.py | 30 ---------------------------- 2 files changed, 53 deletions(-) delete mode 100644 src/diffpy/pdffit2/tests/rundeps.py diff --git a/src/diffpy/pdffit2/tests/__init__.py b/src/diffpy/pdffit2/tests/__init__.py index 4ffdb21c..c75200d9 100644 --- a/src/diffpy/pdffit2/tests/__init__.py +++ b/src/diffpy/pdffit2/tests/__init__.py @@ -79,27 +79,4 @@ def test(): result = runner.run(suite) return result - -def testdeps(): - """Execute all unit tests for diffpy.pdffit2 and its dependencies. - - Returns - ------- - result : `unittest.TestResult` - """ - from importlib import import_module - - modulenames = """ - diffpy.pdffit2.tests - diffpy.structure.tests - """.split() - suite = unittest.TestSuite() - for mname in modulenames: - mod = import_module(mname) - suite.addTests(mod.testsuite()) - runner = unittest.TextTestRunner() - result = runner.run(suite) - return result - - # End of file diff --git a/src/diffpy/pdffit2/tests/rundeps.py b/src/diffpy/pdffit2/tests/rundeps.py deleted file mode 100644 index 038475ae..00000000 --- a/src/diffpy/pdffit2/tests/rundeps.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.pdffit2 by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2012 Trustees of the Columbia University -# in the City of New York. All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Convenience module for executing unit tests for all pdffit2 dependencies - -python -m diffpy.pdffit2.tests.rundeps -""" - - -if __name__ == "__main__": - import sys - - from diffpy.pdffit2.tests import testdeps - - # produce zero exit code for a successful test - sys.exit(not testdeps().wasSuccessful()) - -# End of file From 5360df48ce84926d93f6019b6728ba8db68bb067 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Mon, 26 Aug 2024 01:59:40 -0400 Subject: [PATCH 113/294] fix pcmt --- src/diffpy/pdffit2/tests/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/diffpy/pdffit2/tests/__init__.py b/src/diffpy/pdffit2/tests/__init__.py index c75200d9..a27d592f 100644 --- a/src/diffpy/pdffit2/tests/__init__.py +++ b/src/diffpy/pdffit2/tests/__init__.py @@ -79,4 +79,5 @@ def test(): result = runner.run(suite) return result + # End of file From 05fd1b457a9e06bcae3ff800c7f8b0ff97fe82c5 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Mon, 26 Aug 2024 03:07:48 -0400 Subject: [PATCH 114/294] provide info in doc and write an example page --- doc/examples/Ni_calculation.py | 25 --- doc/source/examples.rst | 151 ++++++++++++++++++ doc/{ => source}/examples/Ni-xray.gr | 0 doc/{ => source}/examples/Ni.stru | 0 .../examples/Ni_calculation.py} | 19 +-- doc/{ => source}/examples/Ni_refinement.py | 24 +-- doc/source/index.rst | 46 +++++- 7 files changed, 216 insertions(+), 49 deletions(-) delete mode 100755 doc/examples/Ni_calculation.py create mode 100644 doc/source/examples.rst rename doc/{ => source}/examples/Ni-xray.gr (100%) rename doc/{ => source}/examples/Ni.stru (100%) rename doc/{examples/Ni_plot_pdf.py => source/examples/Ni_calculation.py} (65%) rename doc/{ => source}/examples/Ni_refinement.py (83%) diff --git a/doc/examples/Ni_calculation.py b/doc/examples/Ni_calculation.py deleted file mode 100755 index fd789c56..00000000 --- a/doc/examples/Ni_calculation.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python - -"""Calculate PDF of FCC nickel. Save data to Ni_calculation.cgr. -""" - -from diffpy.pdffit2 import PdfFit - -# create new PDF calculator object -P = PdfFit() - -# load structure file in PDFFIT or DISCUS format -P.read_struct("Ni.stru") - -radiation_type = "X" # x-rays -qmax = 30.0 # Q-cutoff used in PDF calculation in 1/A -qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay -rmin = 0.01 # minimum r-value -rmax = 30.0 # maximum r-value -npts = 3000 # number of points in the r-grid - -# allocate and configure PDF calculation -P.alloc(radiation_type, qmax, qdamp, rmin, rmax, npts) -P.calc() - -P.save_pdf(1, "Ni_calculation.cgr") diff --git a/doc/source/examples.rst b/doc/source/examples.rst new file mode 100644 index 00000000..00342582 --- /dev/null +++ b/doc/source/examples.rst @@ -0,0 +1,151 @@ +.. _examples: + +Examples +######## + +Welcome! This guide offers several examples to help you effectively utilize this package. + +Files needed: + + 1. :download:`Ni-xray.gr ` - experimental X-ray PDF data + 2. :download:`Ni.stru ` - Ni f.c.c. structure in PDFfit format + +====================================== +Example 1: Calculate PDF of FCC nickel +====================================== + +The first example shows how to calculates the PDF for FCC nickel and saves the resulting data to a file and plot it using matplotlib. + +1. Imports the PdfFit class from the diffpy.pdffit2 module:: + + from diffpy.pdffit2 import PdfFit + +2. Create a PDF calculator object and assigned to the variable ``P``. Make sure the ``Ni.stru`` file is in the same directory as the script and you've cd to the directory, load structure file. Then allocate and configure PDF calculation and run the calculation:: + + # create new PDF calculator object + P = PdfFit() + + # load structure file in PDFFIT or DISCUS format + P.read_struct("Ni.stru") + + radiation_type = "X" # x-rays + qmax = 30.0 # Q-cutoff used in PDF calculation in 1/A + qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay + rmin = 0.01 # minimum r-value + rmax = 30.0 # maximum r-value + npts = 3000 # number of points in the r-grid + + # allocate and configure PDF calculation + P.alloc(radiation_type, qmax, qdamp, rmin, rmax, npts) + P.calc() + +3. Save the refined result:: + + P.save_pdf(1, "Ni_calculation.cgr") + +4. We can also plot it using matplotlib:: + + import matplotlib.pyplot as plt + + # obtain list of r-points and corresponding G values + r = P.getR() + G = P.getpdf_fit() + + # matplotlib.pyplot is an matplotlib interface with an MATLAB-like way of plotting. + plt.plot(r, G) + pylab.xlabel("r (Å)") + pylab.ylabel("G (Å$^{-2}$)") + pylab.title("x-ray PDF of nickel simulated at Qmax = %g" % qmax) + + # display plot window, this must be the last command in the script + pylab.show() + +The scripts can be downloaded :download:`here `. + +======================================= +Example 2: Performing simple refinement +======================================= + +The second example shows how to perform simple refinement of Ni structure to the experimental x-ray PDF. The example uses the same data files as the first example. + +1. Imports the PdfFit class from the diffpy.pdffit2 module:: + + from diffpy.pdffit2 import PdfFit + +2. Load experimental x-ray PDF data and nickel structure file:: + + # Load experimental x-ray PDF data + qmax = 30.0 # Q-cutoff used in PDF calculation in 1/A + qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay + pf.read_data("Ni-xray.gr", "X", qmax, qdamp) + + # Load nickel structure, must be in PDFFIT or DISCUS format + pf.read_struct("Ni.stru") + +3. Configure refinement and refine:: + + # Refine lattice parameters a, b, c. + # Make them all equal to parameter @1. + pf.constrain(pf.lat(1), "@1") + pf.constrain(pf.lat(2), "@1") + pf.constrain(pf.lat(3), "@1") + # set initial value of parameter @1 + pf.setpar(1, pf.lat(1)) + + # Refine phase scale factor. Right side can have formulas. + pf.constrain("pscale", "@20 * 2") + pf.setpar(20, pf.getvar(pf.pscale) / 2.0) + + # Refine PDF damping due to instrument Q-resolution. + # Left side can be also passed as a reference to PdfFit object + pf.constrain(pf.qdamp, "@21") + pf.setpar(21, 0.03) + + # Refine sharpening factor for correlated motion of close atoms. + pf.constrain(pf.delta2, 22) + pf.setpar(22, 0.0003) + + # Set all temperature factors isotropic and equal to @4 + for idx in range(1, 5): + pf.constrain(pf.u11(idx), "@4") + pf.constrain(pf.u22(idx), "@4") + pf.constrain(pf.u33(idx), "@4") + pf.setpar(4, pf.u11(1)) + + # Refine all parameters + pf.pdfrange(1, 1.5, 19.99) + pf.refine() + +4. Save the refined result:: + + pf.save_pdf(1, "Ni_refinement.fgr") + pf.save_struct(1, "Ni_refinement.rstr") + pf.save_res("Ni_refinement.res") + +5. We can also plot it using matplotlib:: + + import matplotlib.pyplot as plt + import numpy + + # matplotlib.pyplot is an matplotlib interface with an MATLAB-like way of plotting. + # obtain data from PdfFit calculator object + r = pf.getR() + Gobs = pf.getpdf_obs() + Gfit = pf.getpdf_fit() + + # calculate difference curve + Gdiff = numpy.array(Gobs) - numpy.array(Gfit) + Gdiff_baseline = -10 + + plt.plot(r, Gobs, "ko") + plt.plot(r, Gfit, "b-") + plt.plot(r, Gdiff + Gdiff_baseline, "r-") + + plt.xlabel("r (Å)") + plt.ylabel("G (Å$^{-2}$)") + plt.title("Fit of nickel to x-ray experimental PDF") + + # display plot window, this must be the last command in the script + plt.show() + +The scripts can be downloaded :download:`here `. diff --git a/doc/examples/Ni-xray.gr b/doc/source/examples/Ni-xray.gr similarity index 100% rename from doc/examples/Ni-xray.gr rename to doc/source/examples/Ni-xray.gr diff --git a/doc/examples/Ni.stru b/doc/source/examples/Ni.stru similarity index 100% rename from doc/examples/Ni.stru rename to doc/source/examples/Ni.stru diff --git a/doc/examples/Ni_plot_pdf.py b/doc/source/examples/Ni_calculation.py similarity index 65% rename from doc/examples/Ni_plot_pdf.py rename to doc/source/examples/Ni_calculation.py index 603c65c9..84539b7b 100755 --- a/doc/examples/Ni_plot_pdf.py +++ b/doc/source/examples/Ni_calculation.py @@ -1,10 +1,9 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- -"""Calculate PDF of FCC nickel and plot it using matplotlib. +"""Calculate PDF of FCC nickel. Save data to Ni_calculation.cgr and plot it using matplotlib. """ -import pylab +import matplotlib.pyplot as plt from diffpy.pdffit2 import PdfFit @@ -25,15 +24,17 @@ P.alloc(radiation_type, qmax, qdamp, rmin, rmax, npts) P.calc() +P.save_pdf(1, "Ni_calculation.cgr") + # obtain list of r-points and corresponding G values r = P.getR() G = P.getpdf_fit() -# pylab is matplotlib interface with MATLAB-like plotting commands -pylab.plot(r, G) -pylab.xlabel("r (Å)") -pylab.ylabel("G (Å$^{-2}$)") -pylab.title("x-ray PDF of nickel simulated at Qmax = %g" % qmax) +# matplotlib.pyplot is an matplotlib interface with an MATLAB-like way of plotting. +plt.plot(r, G) +plt.xlabel("r (Å)") +plt.ylabel("G (Å$^{-2}$)") +plt.title("x-ray PDF of nickel simulated at Qmax = %g" % qmax) # display plot window, this must be the last command in the script -pylab.show() +plt.show() diff --git a/doc/examples/Ni_refinement.py b/doc/source/examples/Ni_refinement.py similarity index 83% rename from doc/examples/Ni_refinement.py rename to doc/source/examples/Ni_refinement.py index 665e92f4..3551023e 100755 --- a/doc/examples/Ni_refinement.py +++ b/doc/source/examples/Ni_refinement.py @@ -5,7 +5,8 @@ Save fitted curve, refined structure and results summary. """ -import pylab +import matplotlib.pyplot as plt +import numpy from diffpy.pdffit2 import PdfFit @@ -65,24 +66,23 @@ # Plot results --------------------------------------------------------------- -# pylab is matplotlib interface with MATLAB-like plotting commands +# matplotlib.pyplot is an matplotlib interface with an MATLAB-like way of plotting. # obtain data from PdfFit calculator object r = pf.getR() Gobs = pf.getpdf_obs() Gfit = pf.getpdf_fit() -# calculate difference curve, with pylab arrays it can be done -# without for loop -Gdiff = pylab.array(Gobs) - pylab.array(Gfit) +# calculate difference curve +Gdiff = numpy.array(Gobs) - numpy.array(Gfit) Gdiff_baseline = -10 -pylab.plot(r, Gobs, "ko") -pylab.plot(r, Gfit, "b-") -pylab.plot(r, Gdiff + Gdiff_baseline, "r-") +plt.plot(r, Gobs, "ko") +plt.plot(r, Gfit, "b-") +plt.plot(r, Gdiff + Gdiff_baseline, "r-") -pylab.xlabel("r (Å)") -pylab.ylabel("G (Å$^{-2}$)") -pylab.title("Fit of nickel to x-ray experimental PDF") +plt.xlabel("r (Å)") +plt.ylabel("G (Å$^{-2}$)") +plt.title("Fit of nickel to x-ray experimental PDF") # display plot window, this must be the last command in the script -pylab.show() +plt.show() diff --git a/doc/source/index.rst b/doc/source/index.rst index bc6f0043..3ff032fe 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -4,21 +4,60 @@ .. |title| replace:: diffpy.pdffit2 documentation -diffpy.pdffit2 - PDFfit2 - real space structure refinement program.. +diffpy.pdffit2 - PDFfit2 - real space structure refinement program. | Software version |release|. | Last updated |today|. +The diffpy.pdffit2 package provides functions for calculation and +refinement of atomic Pair Distribution Function (PDF) from crystal +structure model. It is used as a computational engine by PDFgui. All +refinements possible in PDFgui can be done with diffpy.pdffit2, +although less conveniently and with a fair knowledge of Python. +The package includes an extension for the interactive `IPython +`_ shell, which tries to mimic the old PDFFIT +program. To start IPython with this extension and also with plotting +functions enabled, use :: + + ipython --ext=diffpy.pdffit2.ipy_ext --pylab + +The IPython extension is suitable for interactive use, however +refinement scripts should be preferably written as a standard +Python code. This is more reliable and needs only a few extra +statements. + ======= Authors ======= -diffpy.pdffit2 is developed by Billinge Group -and its community contributors. +This code was derived from the first PDFFIT program by Thomas Proffen. +The sources were converted to C++ by Jacques Bloch and then extensively hacked, +extended and purged from most glaring bugs by Chris Farrow and Pavol Juhas. +This code is currently maintained as part of the DiffPy project to create +python modules for structure investigations from diffraction data. + +The DiffPy team is located in the Billinge-group at the Applied Physics +and Applied Mathematics Department of the Columbia University in New York. +Previous significant contributors to this code were + + Pavol Juhas, Chris Farrow, Jacques Bloch, Wenduo Zhou For a detailed list of contributors see https://github.com/diffpy/diffpy.pdffit2/graphs/contributors. + +========= +Reference +========= + +If you use this program for a 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 (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) + ============ Installation ============ @@ -34,6 +73,7 @@ Table of contents license release + examples Package API ======= From 58828056347adc18320102cccfded003bac55389 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Mon, 26 Aug 2024 18:58:47 -0400 Subject: [PATCH 115/294] fix the failing workflow --- .github/workflows/main.yml | 1 + .github/workflows/matrix.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c005f227..30f4e0a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,6 +35,7 @@ jobs: run: | conda install --file requirements/run.txt conda install --file requirements/test.txt + conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt python -m pip install . --no-deps diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index 3b563db1..3c8c0f0d 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -40,6 +40,7 @@ jobs: run: | conda install --file requirements/run.txt conda install --file requirements/test.txt + conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt python -m pip install . --no-deps From 7b10732df6d97586bce454136e8742947b90cb1c Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Tue, 27 Aug 2024 04:39:32 -0400 Subject: [PATCH 116/294] use -e for workflows --- .github/workflows/codecov.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/main.yml | 2 +- .github/workflows/matrix.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index f8f239c1..7c61a5f2 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -39,7 +39,7 @@ jobs: conda install --file requirements/run.txt conda install --file requirements/test.txt python -m pip install -r requirements/pip.txt - python -m pip install . --no-deps + python -m pip install -e . --no-deps - name: Validate diffpy.pdffit2 run: | diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 89ff2948..a6f0e236 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -36,7 +36,7 @@ jobs: conda install --file requirements/run.txt conda install --file requirements/docs.txt python -m pip install -r requirements/pip.txt - python -m pip install . --no-deps + python -m pip install -e . --no-deps - name: build documents run: make -C doc html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 30f4e0a4..6b42f847 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,7 @@ jobs: conda install --file requirements/test.txt conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt - python -m pip install . --no-deps + python -m pip install -e . --no-deps - name: Validate diffpy.pdffit2 run: python -m pytest diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index 3c8c0f0d..a4f39eca 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -42,7 +42,7 @@ jobs: conda install --file requirements/test.txt conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt - python -m pip install . --no-deps + python -m pip install -e . --no-deps - name: Validate diffpy.pdffit2 run: python -m pytest From b702d739aa3296d45e5bb195030443d41461b163 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Tue, 27 Aug 2024 04:42:51 -0400 Subject: [PATCH 117/294] add install build in codecov workflow (gsl) --- .github/workflows/codecov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 7c61a5f2..66a8baa5 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -38,6 +38,7 @@ jobs: run: | conda install --file requirements/run.txt conda install --file requirements/test.txt + conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt python -m pip install -e . --no-deps From 953325bfc50df7ff9b6244089859d4baca01bd8b Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Tue, 27 Aug 2024 22:55:17 -0400 Subject: [PATCH 118/294] remove matplotlib comment --- doc/source/examples.rst | 2 -- doc/source/examples/Ni_calculation.py | 13 ++++++++++++- doc/source/examples/Ni_refinement.py | 1 - 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/source/examples.rst b/doc/source/examples.rst index 00342582..5424382d 100644 --- a/doc/source/examples.rst +++ b/doc/source/examples.rst @@ -51,7 +51,6 @@ The first example shows how to calculates the PDF for FCC nickel and saves the r r = P.getR() G = P.getpdf_fit() - # matplotlib.pyplot is an matplotlib interface with an MATLAB-like way of plotting. plt.plot(r, G) pylab.xlabel("r (Å)") pylab.ylabel("G (Å$^{-2}$)") @@ -127,7 +126,6 @@ The second example shows how to perform simple refinement of Ni structure to the import matplotlib.pyplot as plt import numpy - # matplotlib.pyplot is an matplotlib interface with an MATLAB-like way of plotting. # obtain data from PdfFit calculator object r = pf.getR() Gobs = pf.getpdf_obs() diff --git a/doc/source/examples/Ni_calculation.py b/doc/source/examples/Ni_calculation.py index 84539b7b..dfd26adc 100755 --- a/doc/source/examples/Ni_calculation.py +++ b/doc/source/examples/Ni_calculation.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- """Calculate PDF of FCC nickel. Save data to Ni_calculation.cgr and plot it using matplotlib. """ @@ -10,9 +11,13 @@ # create new PDF calculator object P = PdfFit() +# Load data ------------------------------------------------------------------ + # load structure file in PDFFIT or DISCUS format P.read_struct("Ni.stru") +# Configure calculation ------------------------------------------------------ + radiation_type = "X" # x-rays qmax = 30.0 # Q-cutoff used in PDF calculation in 1/A qdamp = 0.01 # instrument Q-resolution factor, responsible for PDF decay @@ -22,15 +27,21 @@ # allocate and configure PDF calculation P.alloc(radiation_type, qmax, qdamp, rmin, rmax, npts) + +# Calculate ------------------------------------------------------------------- + P.calc() +# Save results --------------------------------------------------------------- + P.save_pdf(1, "Ni_calculation.cgr") +# Plot results --------------------------------------------------------------- + # obtain list of r-points and corresponding G values r = P.getR() G = P.getpdf_fit() -# matplotlib.pyplot is an matplotlib interface with an MATLAB-like way of plotting. plt.plot(r, G) plt.xlabel("r (Å)") plt.ylabel("G (Å$^{-2}$)") diff --git a/doc/source/examples/Ni_refinement.py b/doc/source/examples/Ni_refinement.py index 3551023e..8c81cf1b 100755 --- a/doc/source/examples/Ni_refinement.py +++ b/doc/source/examples/Ni_refinement.py @@ -66,7 +66,6 @@ # Plot results --------------------------------------------------------------- -# matplotlib.pyplot is an matplotlib interface with an MATLAB-like way of plotting. # obtain data from PdfFit calculator object r = pf.getR() Gobs = pf.getpdf_obs() From 13ba9d398ebc62ce1e45877495584759738f2c6e Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 29 Aug 2024 10:29:49 -0400 Subject: [PATCH 119/294] update examples.rst pyplot --- doc/source/examples.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/examples.rst b/doc/source/examples.rst index 5424382d..0a963ee2 100644 --- a/doc/source/examples.rst +++ b/doc/source/examples.rst @@ -52,12 +52,12 @@ The first example shows how to calculates the PDF for FCC nickel and saves the r G = P.getpdf_fit() plt.plot(r, G) - pylab.xlabel("r (Å)") - pylab.ylabel("G (Å$^{-2}$)") - pylab.title("x-ray PDF of nickel simulated at Qmax = %g" % qmax) + plt.xlabel("r (Å)") + plt.ylabel("G (Å$^{-2}$)") + plt.title("x-ray PDF of nickel simulated at Qmax = %g" % qmax) # display plot window, this must be the last command in the script - pylab.show() + plt.show() The scripts can be downloaded :download:`here `. From 3bb7a1ea4b5e5067ce3bb1b23ab4ad8cbf9a12e9 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Fri, 30 Aug 2024 08:47:45 -0400 Subject: [PATCH 120/294] correct rst code --- doc/source/examples.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/source/examples.rst b/doc/source/examples.rst index 0a963ee2..f793e585 100644 --- a/doc/source/examples.rst +++ b/doc/source/examples.rst @@ -71,7 +71,10 @@ The second example shows how to perform simple refinement of Ni structure to the from diffpy.pdffit2 import PdfFit -2. Load experimental x-ray PDF data and nickel structure file:: +2. Create a PDF calculator object and assigned to the variable ``pf``. Load experimental x-ray PDF data and nickel structure file:: + + # Create new PDF calculator object. + pf = PdfFit() # Load experimental x-ray PDF data qmax = 30.0 # Q-cutoff used in PDF calculation in 1/A From 7962a0d72279a0709dab6b3b74366f76b77d27a5 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 14:15:46 -0400 Subject: [PATCH 121/294] Move tests files to top --- src/diffpy/pdffit2/tests/__init__.py | 83 ------------------- src/diffpy/pdffit2/tests/debug.py | 35 -------- src/diffpy/pdffit2/tests/run.py | 56 ------------- .../pdffit2/tests => tests}/ExceptionsTest.py | 0 .../pdffit2/tests => tests}/TestPdfFit.py | 0 .../tests => tests}/TestPhaseFractions.py | 0 .../tests => tests}/TestShapeFactors.py | 0 .../pdffit2/tests => tests}/conftest.py | 0 .../tests => tests}/pdffit2testutils.py | 0 .../pdffit2/tests => tests}/testdata/300K.gr | 0 .../pdffit2/tests => tests}/testdata/Ni.dat | 0 .../pdffit2/tests => tests}/testdata/Ni.stru | 0 .../tests => tests}/testdata/PbScW25TiO3.stru | 0 .../tests => tests}/testdata/badNi.dat | 0 .../tests => tests}/testdata/badNi.stru | 0 .../testdata/badNiZeroVolume.stru | 0 .../tests => tests}/testdata/noLattice.stru | 0 17 files changed, 174 deletions(-) delete mode 100644 src/diffpy/pdffit2/tests/__init__.py delete mode 100644 src/diffpy/pdffit2/tests/debug.py delete mode 100644 src/diffpy/pdffit2/tests/run.py rename {src/diffpy/pdffit2/tests => tests}/ExceptionsTest.py (100%) rename {src/diffpy/pdffit2/tests => tests}/TestPdfFit.py (100%) rename {src/diffpy/pdffit2/tests => tests}/TestPhaseFractions.py (100%) rename {src/diffpy/pdffit2/tests => tests}/TestShapeFactors.py (100%) rename {src/diffpy/pdffit2/tests => tests}/conftest.py (100%) rename {src/diffpy/pdffit2/tests => tests}/pdffit2testutils.py (100%) rename {src/diffpy/pdffit2/tests => tests}/testdata/300K.gr (100%) rename {src/diffpy/pdffit2/tests => tests}/testdata/Ni.dat (100%) rename {src/diffpy/pdffit2/tests => tests}/testdata/Ni.stru (100%) rename {src/diffpy/pdffit2/tests => tests}/testdata/PbScW25TiO3.stru (100%) rename {src/diffpy/pdffit2/tests => tests}/testdata/badNi.dat (100%) rename {src/diffpy/pdffit2/tests => tests}/testdata/badNi.stru (100%) rename {src/diffpy/pdffit2/tests => tests}/testdata/badNiZeroVolume.stru (100%) rename {src/diffpy/pdffit2/tests => tests}/testdata/noLattice.stru (100%) diff --git a/src/diffpy/pdffit2/tests/__init__.py b/src/diffpy/pdffit2/tests/__init__.py deleted file mode 100644 index a27d592f..00000000 --- a/src/diffpy/pdffit2/tests/__init__.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# (c) 2012 Trustees of the Columbia University in the City of New York. -# All rights reserved. -# (c) 2024 The Trustees of Columbia University in the City of New York. -# All rights reserved. -# -# File coded by: Billinge Group members and community contributors. -# -# See GitHub contributions for a more detailed list of contributors. -# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors -# -# See LICENSE.rst for license information. -# -############################################################################## - -"""Unit tests for the diffpy.pdffit2 package. -""" - -import unittest - - -def testsuite(pattern=""): - """Create a unit tests suite for the diffpy.pdffit2 package. - - Parameters - ---------- - pattern : str, optional - Regular expression pattern for selecting test cases. - Select all tests when empty. Ignore the pattern when - any of unit test modules fails to import. - - Returns - ------- - suite : `unittest.TestSuite` - The TestSuite object containing the matching tests. - """ - import re - from itertools import chain - from os.path import dirname - - from pkg_resources import resource_filename - - loader = unittest.defaultTestLoader - thisdir = resource_filename(__name__, "") - depth = __name__.count(".") + 1 - topdir = thisdir - for i in range(depth): - topdir = dirname(topdir) - suite_all = loader.discover(thisdir, pattern="*Test*.py", top_level_dir=topdir) - # always filter the suite by pattern to test-cover the selection code. - suite = unittest.TestSuite() - rx = re.compile(pattern) - tsuites = list(chain.from_iterable(suite_all)) - tsok = all(isinstance(ts, unittest.TestSuite) for ts in tsuites) - if not tsok: # pragma: no cover - return suite_all - tcases = chain.from_iterable(tsuites) - for tc in tcases: - tcwords = tc.id().split(".") - shortname = ".".join(tcwords[-3:]) - if rx.search(shortname): - suite.addTest(tc) - # verify all tests are found for an empty pattern. - assert pattern or suite_all.countTestCases() == suite.countTestCases() - return suite - - -def test(): - """Execute all unit tests for the diffpy.pdffit2 package. - - Returns - ------- - result : `unittest.TestResult` - """ - suite = testsuite() - runner = unittest.TextTestRunner() - result = runner.run(suite) - return result - - -# End of file diff --git a/src/diffpy/pdffit2/tests/debug.py b/src/diffpy/pdffit2/tests/debug.py deleted file mode 100644 index 3e30239f..00000000 --- a/src/diffpy/pdffit2/tests/debug.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# (c) 2024 The Trustees of Columbia University in the City of New York. -# All rights reserved. -# -# File coded by: Billinge Group members and community contributors. -# -# See GitHub contributions for a more detailed list of contributors. -# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors -# -# See LICENSE.rst for license information. -# -############################################################################## - -""" -Convenience module for debugging the unit tests using - -python -m diffpy.pdffit2.tests.debug - -Exceptions raised by failed tests or other errors are not caught. -""" - - -if __name__ == "__main__": - import sys - - from diffpy.pdffit2.tests import testsuite - - pattern = sys.argv[1] if len(sys.argv) > 1 else "" - suite = testsuite(pattern) - suite.debug() - - -# End of file diff --git a/src/diffpy/pdffit2/tests/run.py b/src/diffpy/pdffit2/tests/run.py deleted file mode 100644 index d5c4ea41..00000000 --- a/src/diffpy/pdffit2/tests/run.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# (c) 2012 Trustees of the Columbia University in the City of New York. -# All rights reserved. -# (c) 2024 The Trustees of Columbia University in the City of New York. -# All rights reserved. -# -# File coded by: Billinge Group members and community contributors. -# -# See GitHub contributions for a more detailed list of contributors. -# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors -# -# See LICENSE.rst for license information. -# -############################################################################## - -"""Convenience module for executing all unit tests with -python -m diffpy.pdffit2.tests.run -""" - - -if __name__ == "__main__": - import sys - - # show warnings by default - if not sys.warnoptions: - import os - import warnings - - warnings.simplefilter("default") - # also affect subprocesses - os.environ["PYTHONWARNINGS"] = "default" - from diffpy.pdffit2.tests import test - - # produce zero exit code for a successful test - sys.exit(not test().wasSuccessful()) - - -# Consider upgrading to pytest -# import sys -# -# import pytest -# -# if __name__ == "__main__": -# # show output results from every test function -# args = ["-v"] -# # show the message output for skipped and expected failure tests -# if len(sys.argv) > 1: -# args.extend(sys.argv[1:]) -# print("pytest arguments: {}".format(args)) -# # call pytest and exit with the return code from pytest -# exit_res = pytest.main(args) -# sys.exit(exit_res) - -# End of file diff --git a/src/diffpy/pdffit2/tests/ExceptionsTest.py b/tests/ExceptionsTest.py similarity index 100% rename from src/diffpy/pdffit2/tests/ExceptionsTest.py rename to tests/ExceptionsTest.py diff --git a/src/diffpy/pdffit2/tests/TestPdfFit.py b/tests/TestPdfFit.py similarity index 100% rename from src/diffpy/pdffit2/tests/TestPdfFit.py rename to tests/TestPdfFit.py diff --git a/src/diffpy/pdffit2/tests/TestPhaseFractions.py b/tests/TestPhaseFractions.py similarity index 100% rename from src/diffpy/pdffit2/tests/TestPhaseFractions.py rename to tests/TestPhaseFractions.py diff --git a/src/diffpy/pdffit2/tests/TestShapeFactors.py b/tests/TestShapeFactors.py similarity index 100% rename from src/diffpy/pdffit2/tests/TestShapeFactors.py rename to tests/TestShapeFactors.py diff --git a/src/diffpy/pdffit2/tests/conftest.py b/tests/conftest.py similarity index 100% rename from src/diffpy/pdffit2/tests/conftest.py rename to tests/conftest.py diff --git a/src/diffpy/pdffit2/tests/pdffit2testutils.py b/tests/pdffit2testutils.py similarity index 100% rename from src/diffpy/pdffit2/tests/pdffit2testutils.py rename to tests/pdffit2testutils.py diff --git a/src/diffpy/pdffit2/tests/testdata/300K.gr b/tests/testdata/300K.gr similarity index 100% rename from src/diffpy/pdffit2/tests/testdata/300K.gr rename to tests/testdata/300K.gr diff --git a/src/diffpy/pdffit2/tests/testdata/Ni.dat b/tests/testdata/Ni.dat similarity index 100% rename from src/diffpy/pdffit2/tests/testdata/Ni.dat rename to tests/testdata/Ni.dat diff --git a/src/diffpy/pdffit2/tests/testdata/Ni.stru b/tests/testdata/Ni.stru similarity index 100% rename from src/diffpy/pdffit2/tests/testdata/Ni.stru rename to tests/testdata/Ni.stru diff --git a/src/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru b/tests/testdata/PbScW25TiO3.stru similarity index 100% rename from src/diffpy/pdffit2/tests/testdata/PbScW25TiO3.stru rename to tests/testdata/PbScW25TiO3.stru diff --git a/src/diffpy/pdffit2/tests/testdata/badNi.dat b/tests/testdata/badNi.dat similarity index 100% rename from src/diffpy/pdffit2/tests/testdata/badNi.dat rename to tests/testdata/badNi.dat diff --git a/src/diffpy/pdffit2/tests/testdata/badNi.stru b/tests/testdata/badNi.stru similarity index 100% rename from src/diffpy/pdffit2/tests/testdata/badNi.stru rename to tests/testdata/badNi.stru diff --git a/src/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru b/tests/testdata/badNiZeroVolume.stru similarity index 100% rename from src/diffpy/pdffit2/tests/testdata/badNiZeroVolume.stru rename to tests/testdata/badNiZeroVolume.stru diff --git a/src/diffpy/pdffit2/tests/testdata/noLattice.stru b/tests/testdata/noLattice.stru similarity index 100% rename from src/diffpy/pdffit2/tests/testdata/noLattice.stru rename to tests/testdata/noLattice.stru From 8cff34c65343f3f44a9b393ec312ef2f98abaa34 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 14:42:16 -0400 Subject: [PATCH 122/294] Add confests --- conda-recipe/run_test.py | 5 ----- pytest.ini | 2 -- tests/conftest.py | 28 ++++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 7 deletions(-) delete mode 100644 conda-recipe/run_test.py delete mode 100644 pytest.ini diff --git a/conda-recipe/run_test.py b/conda-recipe/run_test.py deleted file mode 100644 index 1432eed6..00000000 --- a/conda-recipe/run_test.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python - -import diffpy.pdffit2.tests - -assert diffpy.pdffit2.tests.test().wasSuccessful() diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 2fbf7d55..00000000 --- a/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -python_files = *Test*.py diff --git a/tests/conftest.py b/tests/conftest.py index e3b63139..9ff54bf3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,8 +2,12 @@ from pathlib import Path import pytest +import six +import diffpy.pdffit2.output # assuming this is the correct import path +import diffpy.pdffit2 + @pytest.fixture def user_filesystem(tmp_path): base_dir = Path(tmp_path) @@ -17,3 +21,27 @@ def user_filesystem(tmp_path): json.dump(home_config_data, f) yield tmp_path + +@pytest.fixture +def datafile(): + """Fixture to dynamically load any test file.""" + + def _load(filename): + return "tests/testdata/" + filename + + return _load + +@pytest.fixture +def capture_output(): + """Capture output from pdffit2 engine produced in function call.""" + + def _capture(f, *args, **kwargs): + savestdout = diffpy.pdffit2.output.stdout + fp = six.StringIO() + diffpy.pdffit2.redirect_stdout(fp) + try: + f(*args, **kwargs) + finally: + diffpy.pdffit2.redirect_stdout(savestdout) + return fp.getvalue() + return _capture From d24079dfd84566c28c0745331131e63a19b6d3ba Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 14:42:42 -0400 Subject: [PATCH 123/294] Rename test files and apply fixture --- tests/pdffit2testutils.py | 53 ----- .../{ExceptionsTest.py => test_exceptions.py} | 212 +++++++++++++----- tests/{TestPdfFit.py => test_pdffit.py} | 112 ++++----- ...seFractions.py => test_phase_fractions.py} | 11 +- ...tShapeFactors.py => test_shape_factors.py} | 46 ++-- 5 files changed, 247 insertions(+), 187 deletions(-) delete mode 100644 tests/pdffit2testutils.py rename tests/{ExceptionsTest.py => test_exceptions.py} (79%) rename tests/{TestPdfFit.py => test_pdffit.py} (87%) rename tests/{TestPhaseFractions.py => test_phase_fractions.py} (94%) rename tests/{TestShapeFactors.py => test_shape_factors.py} (87%) diff --git a/tests/pdffit2testutils.py b/tests/pdffit2testutils.py deleted file mode 100644 index ce61aa16..00000000 --- a/tests/pdffit2testutils.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# diffpy.srreal by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2010 Trustees of the Columbia University -# in the City of New York. All rights reserved. -# -# File coded by: Pavol Juhas -# -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. -# -############################################################################## - -"""Helper routines for running other unit tests. -Import of this module suppresses the chatty output from the C++ extension. -""" - - -import os.path - -import six - -import diffpy.pdffit2 - -# silence the C++ engine output -diffpy.pdffit2.redirect_stdout(open(os.path.devnull, "w")) - -# path variables -thisfile = locals().get("__file__", "file.py") -tests_dir = os.path.dirname(os.path.abspath(thisfile)) -testdata_dir = os.path.join(tests_dir, "testdata") - - -def datafile(filename): - """prepend testdata_dir to filename.""" - return os.path.join(testdata_dir, filename) - - -def capture_output(f, *args, **kwargs): - """Capture output from pdffit2 engine produced in function call.""" - savestdout = diffpy.pdffit2.output.stdout - fp = six.StringIO() - diffpy.pdffit2.redirect_stdout(fp) - try: - f(*args, **kwargs) - finally: - diffpy.pdffit2.redirect_stdout(savestdout) - return fp.getvalue() - - -# End of file diff --git a/tests/ExceptionsTest.py b/tests/test_exceptions.py similarity index 79% rename from tests/ExceptionsTest.py rename to tests/test_exceptions.py index 5dee1b75..917326ff 100644 --- a/tests/ExceptionsTest.py +++ b/tests/test_exceptions.py @@ -15,12 +15,16 @@ import unittest +import pytest from diffpy.pdffit2 import PdfFit, pdffit2 -from diffpy.pdffit2.tests.pdffit2testutils import datafile class read_structExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() @@ -33,15 +37,19 @@ def test_IOError(self): def test_structureError(self): """raise pdffit2.structureError when structure is malformed""" - self.assertRaises(pdffit2.structureError, self.P.read_struct, datafile("badNi.stru")) + self.assertRaises(pdffit2.structureError, self.P.read_struct, self.datafile("badNi.stru")) def test_structureErrorZeroVolume(self): """raise pdffit2.structureError when unit cell volume is negative""" # I don't know how to test for this, but it's in the library code - self.assertRaises(pdffit2.structureError, self.P.read_struct, datafile("badNiZeroVolume.stru")) + self.assertRaises(pdffit2.structureError, self.P.read_struct, self.datafile("badNiZeroVolume.stru")) class read_dataExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() @@ -54,10 +62,14 @@ def test_IOError(self): def test_dataError(self): """raise pdffit2.dataError when data has improper spacing""" - self.assertRaises(pdffit2.dataError, self.P.read_data, datafile("badNi.dat"), "X", 25.0, 0.5) + self.assertRaises(pdffit2.dataError, self.P.read_data, self.datafile("badNi.dat"), "X", 25.0, 0.5) class read_data_listsExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.r_data = [0.1, 0.2] @@ -95,6 +107,10 @@ def test_dataError(self): class pdfrangeExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.iset = 1 @@ -110,16 +126,20 @@ def test_ValueError1(self): def test_ValueError2(self): """raise ValueError when rmax < rmin""" - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.5) self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmax, self.rmin) def test_ValueError3(self): """raise ValueError when range outside of data""" - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.5) self.assertRaises(ValueError, self.P.pdfrange, self.iset, -self.rmin, self.rmax) class allocExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.qmax = 25 @@ -133,44 +153,48 @@ def tearDown(self): def test_ValueError1(self): """raise ValueError when qmax < 0""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", -self.qmax, self.qdamp, self.rmin, self.rmax, self.bin) def test_ValueError2(self): """raise ValueError when qdamp < 0""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, -self.qdamp, self.rmin, self.rmax, self.bin) def test_ValueError3(self): """raise ValueError when rmin < 0""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, -self.rmin, self.rmax, self.bin) def test_ValueError4(self): """raise ValueError when rmax < 0""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, -self.rmax, self.bin) def test_ValueError5(self): """raise ValueError when bin < 0""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) def test_ValueError6(self): """raise ValueError when rmax < rmin""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmax, self.rmin, self.bin) def test_ValueError7(self): """raise ValueError when qdamp < 0""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) class calcExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) def tearDown(self): del self.P @@ -224,6 +248,10 @@ def test_unassignedError(self): class save_pdfExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.strufile = "temp.pdf" @@ -233,7 +261,7 @@ def tearDown(self): def test_IOError(self): """raise IOError when structure cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 30.0, 0.05, 2, 10, 100) self.P.calc() self.assertRaises(IOError, self.P.save_pdf, 1, "nodir183160/" + self.strufile) @@ -244,6 +272,10 @@ def test_unassignedError(self): class save_difExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.strufile = "temp.dif" @@ -253,10 +285,10 @@ def tearDown(self): def test_IOError(self): """raise IOError when dif cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 30.0, 0.05, 2, 10, 100) self.P.calc() - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.5) self.assertRaises(IOError, self.P.save_dif, 1, "nodir183160/" + self.strufile) def test_unassignedError(self): @@ -265,6 +297,10 @@ def test_unassignedError(self): class save_resExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.resfile = "temp.res" @@ -274,8 +310,8 @@ def tearDown(self): def test_IOError(self): """raise IOError when residual file cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 30.0, 0.0) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_data(self.datafile("Ni.dat"), "X", 30.0, 0.0) self.P.constrain(self.P.lat(1), 1) self.P.setpar(1, 3.0) self.P.pdfrange(1, 2.0, 10.0) @@ -288,6 +324,10 @@ def test_unassignedError(self): class save_structExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + # Same code as show_struct def setUp(self): @@ -299,7 +339,7 @@ def tearDown(self): def test_IOError(self): """raise IOError when structure cannot be saved""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(IOError, self.P.save_struct, 1, "nodir183160/" + self.strufile) def test_unassignedError(self): @@ -308,6 +348,10 @@ def test_unassignedError(self): class constrainExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.par = 1 @@ -319,8 +363,8 @@ def tearDown(self): def test_constraintError(self): """raise constraintError when constraint is bad""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.constrain("x(1)", "junk+@1") self.P.setpar(1, 0.01) self.assertRaises(pdffit2.constraintError, self.P.calc) @@ -334,14 +378,14 @@ def test_unassignedError(self): def test_ValueError(self): """raise ValueError when a variable index does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.constrain, self.P.x(6), self.par) return def test_constrainNonRefVar(self): "raise constraintError when attempting to constrain non-refinables" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", "@7") self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", 13) self.assertRaises(pdffit2.constraintError, self.P.constrain, "stepcut", "@17") @@ -349,6 +393,10 @@ def test_constrainNonRefVar(self): class setvarExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.val = 3.0 @@ -362,11 +410,15 @@ def test_unassignedError(self): def test_ValueError(self): """raise ValueError when a variable index does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.setvar, self.P.lat(7), self.val) class getvarExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() @@ -379,7 +431,7 @@ def test_unassignedError(self): def test_ValueError(self): """raise ValueError when a variable index does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.getvar, self.P.lat(7)) @@ -444,6 +496,10 @@ def test_unassignedError(self): class getparExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() @@ -456,7 +512,7 @@ def test_unassignedError1(self): def test_unassignedError2(self): """raise pdffit2.unassignedError when parameter does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.constrain(self.P.lat(1), 2) self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) @@ -479,6 +535,10 @@ def test_unassignedError2(self): class pdeselExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.ip = 1 @@ -492,11 +552,15 @@ def test_unassignedError1(self): def test_unassignedError2(self): """raise pdffit2.unassignedError when phase does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) class selectAtomTypeExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.iset = 1 @@ -511,9 +575,9 @@ def test_unassignedError1(self): def test_unassignedError2(self): """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) # selectAtomType should pass with one phase defined - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.selectAtomType(self.iset, "i", "Ni", True) self.P.selectAtomType(self.iset, "j", "Ni", False) # but fail for phase 2 which is not present @@ -521,14 +585,18 @@ def test_unassignedError2(self): def test_ijcharValueError(self): """raise ValueError when ijchar is neither 'i' nor 'j'""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.selectAtomType(self.iset, "i", "Ni", True) self.P.selectAtomType(self.iset, "j", "Ni", True) self.assertRaises(ValueError, self.P.selectAtomType, self.iset, "k", "Ni", True) class selectAtomIndexExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.iset = 1 @@ -543,9 +611,9 @@ def test_unassignedError1(self): def test_unassignedError2(self): """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) # pass for phase 1 - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.selectAtomIndex(self.iset, "i", 1, True) self.P.selectAtomIndex(self.iset, "i", 2, False) # fail for phase 2 @@ -553,12 +621,16 @@ def test_unassignedError2(self): def test_ValueError(self): """raise ValueError when selected atom does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(ValueError, self.P.selectAtomIndex, self.iset, "i", 6, True) class selectAllExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.iset = 1 @@ -573,11 +645,11 @@ def test_unassignedError1(self): def test_unassignedError2(self): """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) # fail when there is no dataset self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") # pass with dataset - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.selectAll(self.iset, "i") self.P.selectAll(self.iset, "j") # fail for phase 2 @@ -586,6 +658,10 @@ def test_unassignedError2(self): class selectNoneExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.iset = 1 @@ -600,11 +676,11 @@ def test_unassignedError1(self): def test_unassignedError2(self): """raise pdffit2.unassignedError when set does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) # fail when there is no dataset self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") # pass with dataset - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.selectNone(self.iset, "i") self.P.selectNone(self.iset, "j") # fail for phase 2 @@ -613,6 +689,10 @@ def test_unassignedError2(self): class bangExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.a1 = 1 @@ -628,22 +708,26 @@ def test_unassignedError(self): def test_ValueError1(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(ValueError, self.P.bang, 0, self.a2, self.a3) def test_ValueError2(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.bang, self.a1, -1, self.a3) def test_ValueError3(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.bang, self.a1, self.a2, 6) class blenExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() self.a1 = 1 @@ -658,17 +742,17 @@ def test_unassignedError(self): def test_ValueError1(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.blen, 0, self.a2) def test_ValueError2(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.blen, self.a1, 6) def test_ValueError3(self): """raise ValueError when selected atom(s) does not exist""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.blen, 0, 6) @@ -716,6 +800,10 @@ def test_unassignedError(self): class fixparExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() @@ -724,12 +812,16 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when parameter does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.fixpar, 1) class freeparExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() @@ -738,12 +830,16 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when parameter does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.freepar, 1) class setphaseExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() @@ -752,12 +848,16 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when phase does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.setphase, 2) class setdataExceptions(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() @@ -766,8 +866,8 @@ def tearDown(self): def test_unassignedError(self): """raise pdffit2.unassignedError when data set does not exist""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.setdata, 2) diff --git a/tests/TestPdfFit.py b/tests/test_pdffit.py similarity index 87% rename from tests/TestPdfFit.py rename to tests/test_pdffit.py index 70712356..ed389978 100644 --- a/tests/TestPdfFit.py +++ b/tests/test_pdffit.py @@ -4,9 +4,8 @@ """ import unittest - +import pytest from diffpy.pdffit2 import PdfFit, pdffit2 -from diffpy.pdffit2.tests.pdffit2testutils import capture_output, datafile from diffpy.structure import loadStructure # ---------------------------------------------------------------------------- @@ -15,6 +14,11 @@ class TestPdfFit(unittest.TestCase): places = 6 + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile, capture_output): + self.datafile = datafile + self.capture_output = capture_output + def setUp(self): self.P = PdfFit() return @@ -42,7 +46,7 @@ def test__exportAll(self): def test_add_structure(self): """check PdfFit.add_structure()""" - ni = loadStructure(datafile("Ni.stru")) + ni = loadStructure(self.datafile("Ni.stru")) self.P.add_structure(ni) self.assertEqual(4, self.P.num_atoms()) return @@ -65,7 +69,7 @@ def test_add_structure(self): def test_read_data_string(self): """check PdfFit.read_data_string()""" pf = self.P - with open(datafile("300K.gr")) as fp: + with open(self.datafile("300K.gr")) as fp: s = fp.read() self.assertEqual([], pf.data_files) pf.read_data_string(s, "N", 32, 0.03, "lmo") @@ -99,7 +103,7 @@ def test_alloc(self): self.P.calc() Gzero = self.P.getpdf_fit() self.assertEqual(1000 * [0.0], Gzero) - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.calc() # check r-values r = self.P.getR() @@ -109,7 +113,7 @@ def test_alloc(self): Gfit_alloc_read = self.P.getpdf_fit() # now try the other order self.P.reset() - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 25, 0.0, 0.01, 10, 1000) self.P.calc() Gfit_read_alloc = self.P.getpdf_fit() @@ -164,8 +168,8 @@ def test_alloc(self): def test_get_structure(self): """check PdfFit.get_structure()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) stru1 = self.P.get_structure(1) self.assertEqual(4, len(stru1)) self.assertEqual("Ni", stru1[0].element) @@ -197,7 +201,7 @@ def test_get_structure(self): def test_setpar(self): """check PdfFit.setpar()""" pf = self.P - pf.read_struct(datafile("Ni.stru")) + pf.read_struct(self.datafile("Ni.stru")) pf.setpar(1, "lat(1)") self.assertEqual(3.52, pf.getpar(1)) pf.setpar(1, 4.0) @@ -209,7 +213,7 @@ def test_setpar(self): def test_setvar(self): """check PdfFit.setvar()""" pf = self.P - pf.read_struct(datafile("Ni.stru")) + pf.read_struct(self.datafile("Ni.stru")) pf.setvar(pf.delta1, 1.2) self.assertEqual(1.2, pf.getvar(pf.delta1)) pf.setvar("delta1", 1.7) @@ -248,8 +252,8 @@ def test_setvar(self): def test_get_atoms(self): """check PdfFit.get_atoms()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.setphase(1) a1 = self.P.get_atoms() a2 = self.P.get_atoms(2) @@ -259,8 +263,8 @@ def test_get_atoms(self): def test_get_atom_types(self): """check PdfFit.get_atom_types()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.setphase(1) atp1 = self.P.get_atom_types() atp2 = self.P.get_atom_types(2) @@ -271,9 +275,9 @@ def test_get_atom_types(self): def test_num_phases(self): """check PdfFit.num_phases()""" self.assertEqual(0, self.P.num_phases()) - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertEqual(1, self.P.num_phases()) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.assertEqual(2, self.P.num_phases()) self.P.reset() self.assertEqual(0, self.P.num_phases()) @@ -282,17 +286,17 @@ def test_num_phases(self): def test_num_datasets(self): """check PdfFit.num_datasets()""" self.assertEqual(0, self.P.num_datasets()) - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.5) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.5) self.assertEqual(1, self.P.num_datasets()) # failed data should not increase num_datasets try: - self.P.read_data(datafile("badNi.dat")) + self.P.read_data(self.datafile("badNi.dat")) except (RuntimeError, TypeError, NameError, ValueError, IOError): pass self.assertEqual(1, self.P.num_datasets()) # alloc should increase number of datasets # alloc requires a loaded structure - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 30.0, 0.05, 2, 10, 100) self.assertEqual(2, self.P.num_datasets()) self.P.reset() @@ -306,10 +310,10 @@ def test_getcrw(self): self.assertEqual(0, self.P.num_datasets()) # Setting qmax=0 so that partial crw are not disturbed by # termination ripples. - self.P.read_data(datafile("Ni.dat"), "X", 0.0, 0.0) + self.P.read_data(self.datafile("Ni.dat"), "X", 0.0, 0.0) # crw is empty before data refinement self.assertEqual([], self.P.getcrw()) - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.pdfrange(1, 2, 19) self.P.refine() crw19 = numpy.array(self.P.getcrw()) @@ -334,11 +338,11 @@ def test_getcrw(self): def test_getcrw_two_datasets(self): """check that getcrw() and getrw() are consistent for two datasets.""" - self.P.read_data(datafile("Ni.dat"), "X", 25.0, 0.0) + self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.pdfrange(1, 2, 8) - self.P.read_data(datafile("300K.gr"), "N", 32.0, 0.0) + self.P.read_data(self.datafile("300K.gr"), "N", 32.0, 0.0) self.P.pdfrange(2, 1, 11) - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) # mess lattice parameters to have comparable Rw contributions self.P.setvar("lat(1)", 3) self.P.setvar("lat(2)", 3) @@ -389,18 +393,18 @@ def doalloc(): self.assertRaises(pdffit2.unassignedError, self.P.psel, 0) self.assertRaises(pdffit2.unassignedError, self.P.psel, 1) - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) doalloc() self.P.calc() G1 = self.P.getpdf_fit() self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) doalloc() self.P.calc() G2 = self.P.getpdf_fit() self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) doalloc() self.P.pdesel("ALL") self.P.psel(1) @@ -429,18 +433,18 @@ def doalloc(): self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 0) self.assertRaises(pdffit2.unassignedError, self.P.pdesel, 1) - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) doalloc() self.P.calc() G1 = self.P.getpdf_fit() self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) doalloc() self.P.calc() G2 = self.P.getpdf_fit() self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) doalloc() self.P.psel("ALL") self.P.pdesel(2) @@ -482,7 +486,7 @@ def doalloc(): def test_bond_angle(self): """check PdfFit.bond_angle()""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) a, e = self.P.bond_angle(1, 2, 3) self.assertAlmostEqual(60.0, a, self.places) self.assertRaises(ValueError, self.P.bond_angle, 0, 1, 2) @@ -491,16 +495,16 @@ def test_bond_angle(self): def test_bang(self): "check PdfFit.bang() function" - self.P.read_struct(datafile("Ni.stru")) - out = capture_output(self.P.bang, 1, 2, 3).strip() + self.P.read_struct(self.datafile("Ni.stru")) + out = self.capture_output(self.P.bang, 1, 2, 3).strip() self.assertTrue(out.endswith("60 degrees")) self.assertTrue(out.startswith("NI (#1) - NI (#2) - NI (#3)")) return def test_bond_length_atoms(self): """check PdfFit.bond_length_atoms()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) dij, ddij = self.P.bond_length_atoms(1, 5) self.assertAlmostEqual(4.03635, dij, self.places) self.P.setphase(1) @@ -509,8 +513,8 @@ def test_bond_length_atoms(self): def test_bond_length_types(self): """check PdfFit.bond_length_types()""" - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) dPbO = self.P.bond_length_types("Pb", "O", 0.1, 3.0) # check if keys are present self.assertTrue("dij" in dPbO) @@ -551,19 +555,19 @@ def test_bond_length_types(self): def test_blen(self): """check PdfFit.blen()""" - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) blen = self.P.blen - o = capture_output(blen, 1, 5).strip() + o = self.capture_output(blen, 1, 5).strip() self.assertTrue(o.endswith("4.03635 A")) self.assertTrue("PB (#1)" in o) self.assertTrue("PB (#5)" in o) self.assertRaises(ValueError, blen, 1, 99) self.assertRaises(ValueError, blen, 0, 1) - o1 = capture_output(blen, 1, 1, 0.1, 1) + o1 = self.capture_output(blen, 1, 1, 0.1, 1) self.assertTrue("No pairs found" in o1) - o2 = capture_output(blen, 1, 50, 0.1, 1) + o2 = self.capture_output(blen, 1, 50, 0.1, 1) self.assertEqual("", o2) - o3 = capture_output(blen, "Sc", "O", 0.5, 2.3).strip() + o3 = self.capture_output(blen, "Sc", "O", 0.5, 2.3).strip() self.assertEqual(1 + 48, len(o3.split("\n"))) self.assertEqual(6, o3.count("SC (#33)")) self.assertEqual(2, o3.count("O (#9)")) @@ -604,11 +608,11 @@ def test_set_scat(self): # check if it is local to phase fPb = self.P.get_scat("X", "Pb") bPb = self.P.get_scat("N", "Pb") - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.set_scat("X", "Pb", 142) self.assertEqual(142, self.P.get_scat("X", "Pb")) self.assertEqual(bPb, self.P.get_scat("N", "Pb")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.assertEqual(fPb, self.P.get_scat("X", "Pb")) self.P.setphase(1) self.assertEqual(142, self.P.get_scat("X", "Pb")) @@ -626,9 +630,9 @@ def test_reset_scat(self): # check if it is local to phase fPb = self.P.get_scat("X", "Pb") bPb = self.P.get_scat("N", "Pb") - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.set_scat("X", "Pb", 142) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.set_scat("N", "Pb", -17) self.P.setphase(1) self.assertNotEqual(fPb, self.P.get_scat("X", "Pb")) @@ -644,9 +648,9 @@ def test_reset_scat(self): def test_num_atoms(self): """check PdfFit.num_atoms()""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertEqual(4, self.P.num_atoms()) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.assertEqual(56, self.P.num_atoms()) self.P.setphase(1) self.assertEqual(4, self.P.num_atoms()) @@ -657,7 +661,7 @@ def test_num_atoms(self): def test_lat(self): """check PdfFit.lat()""" pf = self.P - pf.read_struct(datafile("Ni.stru")) + pf.read_struct(self.datafile("Ni.stru")) for i in ("a", "b", "c", 1, 2, 3): self.assertEqual(3.52, pf.getvar(pf.lat(i))) for i in ("alpha", "beta", "gamma", 4, 5, 6): @@ -667,7 +671,7 @@ def test_lat(self): def test_xyz(self): """check PdfFit.x() PdfFit.y(), PdfFit.z()""" pf = self.P - pf.read_struct(datafile("Ni.stru")) + pf.read_struct(self.datafile("Ni.stru")) self.assertEqual(0.5, pf.getvar(pf.x(3))) self.assertEqual(0, pf.getvar(pf.y(3))) self.assertEqual(0.5, pf.getvar(pf.z(3))) @@ -675,7 +679,7 @@ def test_xyz(self): def test_uij(self): """check PdfFit.uij()""" - ni = loadStructure(datafile("Ni.stru")) + ni = loadStructure(self.datafile("Ni.stru")) ni[2].anisotropy = True ni[2].U11, ni[2].U22, ni[2].U33 = 1, 2, 3 ni[2].U12, ni[2].U13, ni[2].U23 = 4, 5, 6 @@ -692,7 +696,7 @@ def test_uij(self): def test_occ(self): """check PdfFit.occ()""" pf = self.P - pf.read_struct(datafile("Ni.stru")) + pf.read_struct(self.datafile("Ni.stru")) for i in range(1, 5): self.assertEqual(1, pf.getvar(pf.occ(i))) return diff --git a/tests/TestPhaseFractions.py b/tests/test_phase_fractions.py similarity index 94% rename from tests/TestPhaseFractions.py rename to tests/test_phase_fractions.py index afc57c06..3870c12f 100644 --- a/tests/TestPhaseFractions.py +++ b/tests/test_phase_fractions.py @@ -4,19 +4,22 @@ """ import unittest - +import pytest from diffpy.pdffit2 import PdfFit -from diffpy.pdffit2.tests.pdffit2testutils import datafile ############################################################################## class TestPhaseFractions(unittest.TestCase): places = 4 + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + def setUp(self): self.P = PdfFit() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.alloc("N", 0.0, 0.05, 0.1, 10, 200) return diff --git a/tests/TestShapeFactors.py b/tests/test_shape_factors.py similarity index 87% rename from tests/TestShapeFactors.py rename to tests/test_shape_factors.py index 1eaa9711..e59e4225 100644 --- a/tests/TestShapeFactors.py +++ b/tests/test_shape_factors.py @@ -5,11 +5,10 @@ import unittest - +import pytest import numpy from diffpy.pdffit2 import PdfFit, pdffit2 -from diffpy.pdffit2.tests.pdffit2testutils import datafile def spherefactor(r, d): @@ -30,6 +29,9 @@ def spherefactor(r, d): class TestSphereEnvelope(unittest.TestCase): places = 6 + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile def setUp(self): self.P = PdfFit() @@ -41,7 +43,7 @@ def tearDown(self): def test_calculation(self): """check calculation of sphere envelope factor""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.calc() d = 8.0 @@ -59,7 +61,7 @@ def test_refinement(self): """check refinement of sphere envelope factor""" dcheck = 8.0 dstart = 12.0 - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setvar("spdiameter", dcheck) self.P.calc() @@ -69,7 +71,7 @@ def test_refinement(self): Gd8noise[::2] += 0.01 Gd8noise[1::2] -= 0.01 self.P.reset() - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data_lists("X", 0.0, 0.05, list(r), list(Gd8noise)) self.P.constrain("spdiameter", "@8") self.P.setpar(8, dstart) @@ -82,20 +84,20 @@ def test_twophase_calculation(self): """check PDF calculation for 2 phases with different spdiameters""" d1 = 6 d2 = 9 - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setvar("spdiameter", d1) self.P.calc() G1 = numpy.array(self.P.getpdf_fit()) self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setvar("spdiameter", d2) self.P.calc() G2 = numpy.array(self.P.getpdf_fit()) self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setphase(1) self.P.setvar("spdiameter", d1) @@ -115,13 +117,13 @@ def test_twophase_refinement(self): dstart1 = 8.2 dcheck2 = 6.0 dstart2 = 5.5 - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setvar("spdiameter", dcheck1) self.P.calc() G1 = numpy.array(self.P.getpdf_fit()) self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setvar("spdiameter", dcheck2) self.P.calc() @@ -131,8 +133,8 @@ def test_twophase_refinement(self): Gnoise[::2] += 0.01 Gnoise[1::2] -= 0.01 self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.read_data_lists("X", 0.0, 0.05, list(r), list(Gnoise)) self.P.setphase(1) self.P.constrain("spdiameter", "@11") @@ -152,7 +154,7 @@ def test_spdiameter_io(self): """Check reading and writing of spdiameter from structure file.""" import re - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertEqual(0.0, self.P.getvar("spdiameter")) # engine should not write shape factor when not defined spdnone = self.P.save_struct_string(1) @@ -180,6 +182,10 @@ def test_spdiameter_io(self): ############################################################################## class TestStepCutEnvelope(unittest.TestCase): + @pytest.fixture(autouse=True) + def prepare_fixture(self, datafile): + self.datafile = datafile + places = 6 def setUp(self): @@ -192,7 +198,7 @@ def tearDown(self): def test_stepcut_calculation(self): """check calculation of sphere envelope factor""" - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.calc() stepcut = 8.0 @@ -211,20 +217,20 @@ def test_twophase_stepcut_calculation(self): """check PDF calculation for 2 phases with different spdiameters""" d1 = 6 d2 = 9 - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setvar("stepcut", d1) self.P.calc() G1 = numpy.array(self.P.getpdf_fit()) self.P.reset() - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setvar("stepcut", d2) self.P.calc() G2 = numpy.array(self.P.getpdf_fit()) self.P.reset() - self.P.read_struct(datafile("Ni.stru")) - self.P.read_struct(datafile("PbScW25TiO3.stru")) + self.P.read_struct(self.datafile("Ni.stru")) + self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.setphase(1) self.P.setvar("stepcut", d1) @@ -244,7 +250,7 @@ def test_stepcut_io(self): """Check reading and writing of stepcut from structure file.""" import re - self.P.read_struct(datafile("Ni.stru")) + self.P.read_struct(self.datafile("Ni.stru")) self.assertEqual(0.0, self.P.getvar("stepcut")) # engine should not write shape factor when not defined sscnone = self.P.save_struct_string(1) From 45304fabec2aedb871d188039f5d82120a37c460 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 14:44:37 -0400 Subject: [PATCH 124/294] Apply pre-commit --- tests/conftest.py | 7 +++-- tests/test_exceptions.py | 51 ++++++++++++++++++----------------- tests/test_pdffit.py | 4 ++- tests/test_phase_fractions.py | 2 ++ tests/test_shape_factors.py | 4 ++- 5 files changed, 39 insertions(+), 29 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9ff54bf3..5407f543 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,10 +3,10 @@ import pytest import six -import diffpy.pdffit2.output # assuming this is the correct import path - import diffpy.pdffit2 +import diffpy.pdffit2.output # assuming this is the correct import path + @pytest.fixture def user_filesystem(tmp_path): @@ -22,6 +22,7 @@ def user_filesystem(tmp_path): yield tmp_path + @pytest.fixture def datafile(): """Fixture to dynamically load any test file.""" @@ -31,6 +32,7 @@ def _load(filename): return _load + @pytest.fixture def capture_output(): """Capture output from pdffit2 engine produced in function call.""" @@ -44,4 +46,5 @@ def _capture(f, *args, **kwargs): finally: diffpy.pdffit2.redirect_stdout(savestdout) return fp.getvalue() + return _capture diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index 917326ff..f2f245ce 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -15,6 +15,7 @@ import unittest + import pytest from diffpy.pdffit2 import PdfFit, pdffit2 @@ -24,7 +25,7 @@ class read_structExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() @@ -49,7 +50,7 @@ class read_dataExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() @@ -69,7 +70,7 @@ class read_data_listsExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.r_data = [0.1, 0.2] @@ -110,7 +111,7 @@ class pdfrangeExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.iset = 1 @@ -139,7 +140,7 @@ class allocExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.qmax = 25 @@ -191,7 +192,7 @@ class calcExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.P.read_struct(self.datafile("Ni.stru")) @@ -251,7 +252,7 @@ class save_pdfExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.strufile = "temp.pdf" @@ -275,7 +276,7 @@ class save_difExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.strufile = "temp.dif" @@ -300,7 +301,7 @@ class save_resExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.resfile = "temp.res" @@ -327,7 +328,7 @@ class save_structExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + # Same code as show_struct def setUp(self): @@ -351,7 +352,7 @@ class constrainExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.par = 1 @@ -396,7 +397,7 @@ class setvarExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.val = 3.0 @@ -418,7 +419,7 @@ class getvarExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() @@ -499,7 +500,7 @@ class getparExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() @@ -538,7 +539,7 @@ class pdeselExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.ip = 1 @@ -560,7 +561,7 @@ class selectAtomTypeExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.iset = 1 @@ -596,7 +597,7 @@ class selectAtomIndexExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.iset = 1 @@ -630,7 +631,7 @@ class selectAllExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.iset = 1 @@ -661,7 +662,7 @@ class selectNoneExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.iset = 1 @@ -692,7 +693,7 @@ class bangExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.a1 = 1 @@ -727,7 +728,7 @@ class blenExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() self.a1 = 1 @@ -803,7 +804,7 @@ class fixparExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() @@ -821,7 +822,7 @@ class freeparExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() @@ -839,7 +840,7 @@ class setphaseExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() @@ -857,7 +858,7 @@ class setdataExceptions(unittest.TestCase): @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile - + def setUp(self): self.P = PdfFit() diff --git a/tests/test_pdffit.py b/tests/test_pdffit.py index ed389978..68c06833 100644 --- a/tests/test_pdffit.py +++ b/tests/test_pdffit.py @@ -4,7 +4,9 @@ """ import unittest + import pytest + from diffpy.pdffit2 import PdfFit, pdffit2 from diffpy.structure import loadStructure @@ -18,7 +20,7 @@ class TestPdfFit(unittest.TestCase): def prepare_fixture(self, datafile, capture_output): self.datafile = datafile self.capture_output = capture_output - + def setUp(self): self.P = PdfFit() return diff --git a/tests/test_phase_fractions.py b/tests/test_phase_fractions.py index 3870c12f..d4df1c60 100644 --- a/tests/test_phase_fractions.py +++ b/tests/test_phase_fractions.py @@ -4,7 +4,9 @@ """ import unittest + import pytest + from diffpy.pdffit2 import PdfFit diff --git a/tests/test_shape_factors.py b/tests/test_shape_factors.py index e59e4225..dd0a0e9c 100644 --- a/tests/test_shape_factors.py +++ b/tests/test_shape_factors.py @@ -5,8 +5,9 @@ import unittest -import pytest + import numpy +import pytest from diffpy.pdffit2 import PdfFit, pdffit2 @@ -29,6 +30,7 @@ def spherefactor(r, d): class TestSphereEnvelope(unittest.TestCase): places = 6 + @pytest.fixture(autouse=True) def prepare_fixture(self, datafile): self.datafile = datafile From 2abcc8be9c776c0e7cd1c8e44da9353d3b8c6331 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 14:57:53 -0400 Subject: [PATCH 125/294] Remove gitarchive and attributes --- .gitarchive.cfg | 5 ----- .gitattributes | 7 ------- 2 files changed, 12 deletions(-) delete mode 100644 .gitarchive.cfg delete mode 100644 .gitattributes diff --git a/.gitarchive.cfg b/.gitarchive.cfg deleted file mode 100644 index 95e1448c..00000000 --- a/.gitarchive.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[DEFAULT] -commit = $Format:%H$ -date = $Format:%ci$ -timestamp = $Format:%ct$ -refnames = $Format:%D$ diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 9d58a8cd..00000000 --- a/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -/.gitattributes export-ignore -/.gitignore export-ignore -/.travis.yml export-ignore -/conda-recipe/ export-ignore -/devutils export-ignore -.gitarchive.cfg export-subst -*.bat text eol=crlf From dda5025d837c1e7b79b9e4556db89e769deaa538 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 14:58:20 -0400 Subject: [PATCH 126/294] Standarlize manifest,proproject to current cookiecutter --- MANIFEST.in | 40 ++++++++++++---------------------------- pyproject.toml | 7 +++++-- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 9902cd57..0990402a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,28 +1,12 @@ -recursive-include src/diffpy * -recursive-exclude src/diffpy *.py[co] *.so -recursive-include docs *.rst conf.py Makefile make.bat - -recursive-include src/extensions/libpdffit2 *.[ch]* -recursive-include src/extensions/pdffit2module *.[ch]* -recursive-include src/examples * -include AUTHORS.rst -include diffpy.pdffit2/version.py -include LICENSE.rst -include README.rst -include requirements/ -prune src/extensions/libpdffit2/tests -global-exclude .gitattributes .gitignore .gitarchive.cfg -global-exclude .DS_Store -recursive-exclude * __pycache__ -recursive-exclude * *.py[co] - -# If including data files in the package, add them like: -# include path/to/data_file - -# Avoid user content in setup.cfg to make distribution reproducible. -exclude setup.cfg - -# Exclude git-tracked files spuriously added by setuptools_scm -exclude .coveragerc -prune devutils -prune doc +graft src +graft tests +graft requirements + +include AUTHORS.rst LICENSE*.rst README.rst + +# Exclude all bytecode files and __pycache__ directories +global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files. +global-exclude .DS_Store # Exclude Mac filesystem artifacts. +global-exclude __pycache__ # Exclude Python cache directories. +global-exclude .git* # Exclude git files and directories. +global-exclude .idea # Exclude PyCharm project settings. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6945ff83..0ee80217 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["setuptools>=62.0", "setuptools-git-versioning<2"] +requires = ["setuptools>=62.0", "setuptools-git-versioning>=2.0"] build-backend = "setuptools.build_meta" [project] name = "diffpy.pdffit2" -dynamic=['version'] +dynamic=['version', 'dependencies'] authors = [ { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, ] @@ -48,6 +48,9 @@ include = ["*"] # package names should match these glob patterns (["*"] by defa exclude = ["diffpy.pdffit2.tests*"] # 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"]} + [tool.black] line-length = 115 include = '\.pyi?$' From 6c0b5e38fa25f1ea50b44a91f46f144e78c25a1d Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 14:58:27 -0400 Subject: [PATCH 127/294] Remove devutils --- devutils/makesdist | 60 ---------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100755 devutils/makesdist diff --git a/devutils/makesdist b/devutils/makesdist deleted file mode 100755 index dccfaa99..00000000 --- a/devutils/makesdist +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python - -"""Create source distribution tar.gz archive, where each file belongs -to a root user and modification time is set to the git commit time. -""" - -import glob -import gzip -import os -import subprocess -import sys -import tarfile - -from setup import FALLBACK_VERSION, versiondata - -BASEDIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) -sys.path.insert(0, BASEDIR) - -timestamp = versiondata.getint("DEFAULT", "timestamp") - -vfb = versiondata.get("DEFAULT", "version").split(".post")[0] + ".post0" -emsg = "Invalid FALLBACK_VERSION. Expected %r got %r." -assert vfb == FALLBACK_VERSION, emsg % (vfb, FALLBACK_VERSION) - - -def inform(s): - sys.stdout.write(s) - sys.stdout.flush() - return - - -inform('Run "setup.py sdist --formats=tar" ') -cmd_sdist = [sys.executable] + "setup.py sdist --formats=tar".split() -ec = subprocess.call(cmd_sdist, cwd=BASEDIR, stdout=open(os.devnull, "w")) -if ec: - sys.exit(ec) -inform("[done]\n") - -tarname = max(glob.glob(BASEDIR + "/dist/*.tar"), key=os.path.getmtime) - -tfin = tarfile.open(tarname) -fpout = gzip.GzipFile(tarname + ".gz", "w", mtime=0) -tfout = tarfile.open(fileobj=fpout, mode="w") - - -def fixtarinfo(tinfo): - tinfo.uid = tinfo.gid = 0 - tinfo.uname = tinfo.gname = "root" - tinfo.mtime = timestamp - tinfo.mode &= ~0o022 - return tinfo - - -inform("Filter %s --> %s.gz " % (2 * (os.path.basename(tarname),))) -for ti in tfin: - tfout.addfile(fixtarinfo(ti), tfin.extractfile(ti)) - -tfin.close() -os.remove(tarname) -inform("[done]\n") From c0ed31bc271dfd9cfa4ab44681cc3c2b39bc78a5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 18:59:21 +0000 Subject: [PATCH 128/294] [pre-commit.ci] auto fixes from pre-commit hooks --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 0990402a..f1a78eec 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,4 +9,4 @@ global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files. global-exclude .DS_Store # Exclude Mac filesystem artifacts. global-exclude __pycache__ # Exclude Python cache directories. global-exclude .git* # Exclude git files and directories. -global-exclude .idea # Exclude PyCharm project settings. \ No newline at end of file +global-exclude .idea # Exclude PyCharm project settings. From f89dcc087540157ac5847e50795e76bc7f3a3b6e Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 15:51:20 -0400 Subject: [PATCH 129/294] Remove -e build --- .github/workflows/codecov.yml | 2 +- .github/workflows/docs.yml | 2 +- .github/workflows/main.yml | 2 +- .github/workflows/matrix.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 66a8baa5..b2b039f2 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -40,7 +40,7 @@ jobs: conda install --file requirements/test.txt conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt - python -m pip install -e . --no-deps + python -m pip install . --no-deps - name: Validate diffpy.pdffit2 run: | diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a6f0e236..89ff2948 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -36,7 +36,7 @@ jobs: conda install --file requirements/run.txt conda install --file requirements/docs.txt python -m pip install -r requirements/pip.txt - python -m pip install -e . --no-deps + python -m pip install . --no-deps - name: build documents run: make -C doc html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b42f847..30f4e0a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,7 @@ jobs: conda install --file requirements/test.txt conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt - python -m pip install -e . --no-deps + python -m pip install . --no-deps - name: Validate diffpy.pdffit2 run: python -m pytest diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index a4f39eca..3c8c0f0d 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -42,7 +42,7 @@ jobs: conda install --file requirements/test.txt conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt - python -m pip install -e . --no-deps + python -m pip install . --no-deps - name: Validate diffpy.pdffit2 run: python -m pytest From 5cb4cb5a81c3b793f276d258942773df95379e70 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 15:58:26 -0400 Subject: [PATCH 130/294] Remove -e --- .github/workflows/matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index a4f39eca..3c8c0f0d 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -42,7 +42,7 @@ jobs: conda install --file requirements/test.txt conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt - python -m pip install -e . --no-deps + python -m pip install . --no-deps - name: Validate diffpy.pdffit2 run: python -m pytest From f3e16358462452ce8a608c8cf9db805a62918327 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 15:58:38 -0400 Subject: [PATCH 131/294] Remove -e in main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b42f847..30f4e0a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,7 +37,7 @@ jobs: conda install --file requirements/test.txt conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt - python -m pip install -e . --no-deps + python -m pip install . --no-deps - name: Validate diffpy.pdffit2 run: python -m pytest From 84411db21564f3416d07ce0359e6faeb47b953fd Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 15:58:50 -0400 Subject: [PATCH 132/294] Remove -e in docs.yml --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a6f0e236..89ff2948 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -36,7 +36,7 @@ jobs: conda install --file requirements/run.txt conda install --file requirements/docs.txt python -m pip install -r requirements/pip.txt - python -m pip install -e . --no-deps + python -m pip install . --no-deps - name: build documents run: make -C doc html From f9cae2c58154dcc5b0b940bd410d9d9276949946 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 22 Sep 2024 15:59:01 -0400 Subject: [PATCH 133/294] Remove -e in codecov.yml --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 66a8baa5..b2b039f2 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -40,7 +40,7 @@ jobs: conda install --file requirements/test.txt conda install --file requirements/build.txt python -m pip install -r requirements/pip.txt - python -m pip install -e . --no-deps + python -m pip install . --no-deps - name: Validate diffpy.pdffit2 run: | From 0d07c78116c5269c215dd6d46f4326572a839d67 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Mon, 23 Sep 2024 08:28:21 -0400 Subject: [PATCH 134/294] Add news for moving tests dir and pip install . --- news/tests-dir.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 news/tests-dir.rst diff --git a/news/tests-dir.rst b/news/tests-dir.rst new file mode 100644 index 00000000..2d0e6711 --- /dev/null +++ b/news/tests-dir.rst @@ -0,0 +1,25 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Moved the tests directory from src to the root using conftest.py. +* Fixed a circular import bug during " pip install ." in GitHub CI. +* Renamed .py files under tests to snake_case. + +**Security:** + +* From 44922208411c45503ef48b4fe5e0b7b5a4cada8a Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 00:24:47 -0400 Subject: [PATCH 135/294] Add github workflows --- .github/workflows/check-news-item.yml | 12 +++++ .github/workflows/codecov.yml | 54 ------------------- .github/workflows/docs.yml | 48 ----------------- .github/workflows/main.yml | 43 --------------- .../matrix-and-codecov-on-merge-to-main.yml | 21 ++++++++ .github/workflows/matrix.yml | 48 ----------------- .github/workflows/publish-docs-on-release.yml | 14 +++++ .github/workflows/tests-on-pr.yml | 16 ++++++ 8 files changed, 63 insertions(+), 193 deletions(-) create mode 100644 .github/workflows/check-news-item.yml delete mode 100644 .github/workflows/codecov.yml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/matrix-and-codecov-on-merge-to-main.yml delete mode 100644 .github/workflows/matrix.yml create mode 100644 .github/workflows/publish-docs-on-release.yml create mode 100644 .github/workflows/tests-on-pr.yml diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml new file mode 100644 index 00000000..1301ca85 --- /dev/null +++ b/.github/workflows/check-news-item.yml @@ -0,0 +1,12 @@ +name: Check for News + +on: + pull_request_target: + branches: + - main + +jobs: + build: + uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0 + with: + project: diffpy.structure diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index b2b039f2..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Gather coverage report and upload to codecov - -on: - push: - branches: - - main - release: - types: - - prereleased - - published - workflow_dispatch: - -defaults: - run: - shell: bash -l {0} - -jobs: - coverage: - runs-on: ubuntu-latest - steps: - - name: Check out diffpy.pdffit2 - 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 - - - name: Conda config - run: >- - conda config --set always_yes yes - --set changeps1 no - - - name: Install diffpy.pdffit2 and requirements - run: | - conda install --file requirements/run.txt - conda install --file requirements/test.txt - conda install --file requirements/build.txt - python -m pip install -r requirements/pip.txt - python -m pip install . --no-deps - - - name: Validate diffpy.pdffit2 - run: | - coverage run -m pytest -vv -s - coverage report -m - codecov - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 89ff2948..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build and Deploy Documentation - -on: - release: - types: - - published - workflow_dispatch: - -defaults: - run: - shell: bash -l {0} - -jobs: - docs: - runs-on: ubuntu-latest - steps: - - name: Check out diffpy.pdffit2 - uses: actions/checkout@v4 - - - name: Initialize miniconda - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: build - auto-update-conda: true - environment-file: environment.yml - auto-activate-base: false - - - name: Conda config - run: >- - conda config --set always_yes yes - --set changeps1 no - - - name: Install diffpy.pdffit2 and build requirements - run: | - conda install --file requirements/build.txt - conda install --file requirements/run.txt - conda install --file requirements/docs.txt - python -m pip install -r requirements/pip.txt - python -m pip install . --no-deps - - - name: build documents - run: make -C doc html - - - name: Deploy - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./doc/build/html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 30f4e0a4..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Test - -on: - push: - branches: - - main - pull_request: - workflow_dispatch: - -defaults: - run: - shell: bash -l {0} - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - name: Check out diffpy.pdffit2 - 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 - - - name: Conda config - run: >- - conda config --set always_yes yes - --set changeps1 no - - - name: Install diffpy.pdffit2 and requirements - run: | - conda install --file requirements/run.txt - conda install --file requirements/test.txt - conda install --file requirements/build.txt - python -m pip install -r requirements/pip.txt - python -m pip install . --no-deps - - - name: Validate diffpy.pdffit2 - run: python -m pytest diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml new file mode 100644 index 00000000..c1905e0d --- /dev/null +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -0,0 +1,21 @@ +name: CI + +on: + push: + branches: + - main + release: + types: + - prereleased + - published + workflow_dispatch: null + +jobs: + coverage: + uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 + with: + project: diffpy.structure + c_extension: false + headless: false + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml deleted file mode 100644 index 3c8c0f0d..00000000 --- a/.github/workflows/matrix.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Matrix test - -on: - push: - branches: - - main - workflow_dispatch: - -defaults: - run: - shell: bash -l {0} - -jobs: - test: - name: Python ${{ matrix.python-version }}, OS ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: ['3.10', '3.11', '3.12'] - os: ["macos-latest", "ubuntu-latest", "windows-latest"] - steps: - - name: check out diffpy.pdffit2 - 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 - python-version: ${{ matrix.python-version }} - auto-activate-base: false - - - name: Conda config - run: >- - conda config --set always_yes yes - --set changeps1 no - - - name: Install diffpy.pdffit2 and requirements - run: | - conda install --file requirements/run.txt - conda install --file requirements/test.txt - conda install --file requirements/build.txt - python -m pip install -r requirements/pip.txt - python -m pip install . --no-deps - - - name: Validate diffpy.pdffit2 - run: python -m pytest diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml new file mode 100644 index 00000000..ea18f1f0 --- /dev/null +++ b/.github/workflows/publish-docs-on-release.yml @@ -0,0 +1,14 @@ +name: Build and Deploy Docs + +on: + release: + types: + - published + workflow_dispatch: + +jobs: + docs: + uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 + with: + project: diffpy.pdffit2 + c_extension: true diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml new file mode 100644 index 00000000..31ad817a --- /dev/null +++ b/.github/workflows/tests-on-pr.yml @@ -0,0 +1,16 @@ +name: Tests on PR + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + validate: + uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0 + with: + project: diffpy.pdffit2 + c_extension: true + headless: false From 12d0c5aa565b2ab2835bc84151febf3bae28e968 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 00:26:22 -0400 Subject: [PATCH 136/294] Add .codecov, coverage, gitignore, remove gitattributes --- .codecov.yml | 3 -- .coveragerc | 17 ++------- .gitattributes | 1 + .gitignore | 94 ++++++++++++++++++++++++++++++++++++++------------ 4 files changed, 75 insertions(+), 40 deletions(-) create mode 100644 .gitattributes diff --git a/.codecov.yml b/.codecov.yml index 505809d2..04dd6510 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -2,9 +2,6 @@ # the root folder. #comment: false -fixes: - - ".*/site-packages/::src/" - codecov: notify: require_ci_to_pass: no diff --git a/.coveragerc b/.coveragerc index 13b71cd9..34ea3e4c 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,9 +1,6 @@ [run] source = - diffpy.pdffit2 -omit = - # exclude debug.py from codecov report - */tests/debug.py + diffpy.structure [report] omit = */python?.?/* @@ -11,16 +8,6 @@ omit = # ignore _version.py and versioneer.py .*version.* *_version.py -# RE patterns for lines to be excluded from consideration. -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - ^[ ]*assert False - # Don't complain if non-runnable code isn't run: - ^[ ]*@unittest.skip\b - ^[ ]{4}unittest.main() +exclude_lines = if __name__ == '__main__': diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..de811ba3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +diffpy.structure/_version.py export-subst diff --git a/.gitignore b/.gitignore index 3298c515..a25212ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,49 +1,99 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ *.py[cod] +*$py.class # C extensions *.so -# Packages -*.egg -*.egg-info -*.eggs -dist -build -eggs -parts -bin -var -sdist -temp -develop-eggs +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +venv/ +*.egg-info/ .installed.cfg -lib -lib64 -tags +*.egg +bin/ +temp/ +tags/ errors.err -# IDE configs -.idea -.vscode +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec # Installer logs pip-log.txt +pip-delete-this-directory.txt MANIFEST # Unit test / coverage reports +htmlcov/ +.tox/ .coverage -.tox +.coverage.* +.cache nosetests.xml -/libpdffit2/tests/alltests +coverage.xml +*,cover +.hypothesis/ # Translations *.mo +*.pot # Mr Developer .mr.developer.cfg .project .pydevproject +# Django stuff: +*.log + +# Sphinx documentation +docs/build/ +docs/source/generated/ + +# pytest +.pytest_cache/ + +# PyBuilder +target/ + +# Editor files +# mac +.DS_Store +*~ + +# vim +*.swp +*.swo + +# pycharm +.idea/ + +# VSCode +.vscode/ + +# Ipython Notebook +.ipynb_checkpoints + # version information setup.cfg -/diffpy/pdffit2/version.cfg +/src/diffpy/*/version.cfg + +# Rever +rever/ From 031809bb15facc74109a4c06340752b6c9c30202 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 00:26:29 -0400 Subject: [PATCH 137/294] Add news --- news/recut.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/recut.rst diff --git a/news/recut.rst b/news/recut.rst new file mode 100644 index 00000000..e006ae7b --- /dev/null +++ b/news/recut.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Re-cookiecutter to group's package standard + +**Security:** + +* From f8827b81868e53b1551add405d288222e5445839 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 00:26:39 -0400 Subject: [PATCH 138/294] Add version test --- tests/test_version.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/test_version.py diff --git a/tests/test_version.py b/tests/test_version.py new file mode 100644 index 00000000..e3ac3668 --- /dev/null +++ b/tests/test_version.py @@ -0,0 +1,10 @@ +"""Unit tests for __version__.py +""" + +import diffpy.pdffit2 + + +def test_package_version(): + """Ensure the package version is defined and not set to the initial placeholder.""" + assert hasattr(diffpy.pdffit2, "__version__") + assert diffpy.pdffit2.__version__ != "0.0.0" From f644142ab902d77c74ec1ae335573d143d0256cd Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 00:26:55 -0400 Subject: [PATCH 139/294] Add pytest-cov test --- requirements/test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/test.txt b/requirements/test.txt index 6f9ccf84..a7277865 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -2,4 +2,5 @@ flake8 pytest codecov coverage +pytest-cov pytest-env From 90658de86205e25791693d325dbd4925547d09a5 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 00:27:25 -0400 Subject: [PATCH 140/294] Add readme, doc, project.toml --- .pre-commit-config.yaml | 45 ------------- Makefile | 106 ------------------------------ README.rst | 18 +++-- doc/make.bat | 72 ++++++++++---------- doc/source/api/diffpy.pdffit2.rst | 1 + doc/source/index.rst | 6 +- doc/source/license.rst | 53 ++++++++++++++- environment.yml | 3 +- pyproject.toml | 2 +- 9 files changed, 102 insertions(+), 204 deletions(-) delete mode 100644 .pre-commit-config.yaml delete mode 100644 Makefile diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 8aedd156..00000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,45 +0,0 @@ -default_language_version: - 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 -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 - hooks: - - id: check-yaml - exclude: ^conda-recipe/meta\.yaml$ - - id: end-of-file-fixer - - id: trailing-whitespace - exclude: '\.(rst|txt)$' - - repo: https://github.com/psf/black - rev: 24.4.2 - hooks: - - id: black - - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 - hooks: - - id: flake8 - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - args: ["--profile", "black", "--order-by-type"] - exclude: ^src/diffpy/pdffit2/__init__\.py$ - - repo: https://github.com/kynan/nbstripout - rev: 0.7.1 - hooks: - - id: nbstripout - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: no-commit-to-branch - name: Prevent Commit to Main Branch - args: ["--branch", "main"] - stages: [pre-commit] diff --git a/Makefile b/Makefile deleted file mode 100644 index dffbb2ca..00000000 --- a/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -######################################################################## -# This Makefile should be used only for debugging purposes and is -# intended for strong-hearted developers. End users should use the -# setup.py script instead. -# -# Variables: -# -# DEBUG when defined, compile with debug options -# USESHARED when defined, link with shared gsl library -# PYTHON_INCLUDE path to Python include files used for compilation -# -######################################################################## - -ifndef PYTHON_INCLUDE -PYTHON_INCLUDE := $(shell python -c \ - 'from distutils import sysconfig; print(sysconfig.get_python_inc())') -endif - -######################################################################## - -INCLUDE = \ - -I$(PYTHON_INCLUDE) \ - -Ilibpdffit2 \ - -Ipdffit2module \ - -Ibuild -I. \ - $(GSL_INCLUDE) - -GSL_INCLUDE = $(shell gsl-config --cflags) - -GSL_LIBS_CONFIG = $(shell gsl-config --libs-without-cblas) -ifdef USESHARED -GSL_LIBS = $(GSL_LIBS_CONFIG) -else -GSL_LIBS = $(subst -L,,$(filter -L%, $(GSL_LIBS_CONFIG)))/libgsl.a -endif - -ifneq (,$(findstring darwin,$(OSTYPE))) -LDFLAGS = -bundle -undefined dynamic_lookup -else -LDFLAGS = -shared -endif - -COMMONFLAGS = -std=c++11 -Wall -Wno-write-strings -fPIC -OPTIMFLAGS = -O3 -funroll-loops -ffast-math $(COMMONFLAGS) -DEBUGFLAGS = -g $(COMMONFLAGS) - -ifdef DEBUG -CPPFLAGS = $(DEBUGFLAGS) $(INCLUDE) $(DEFINES) -else -CPPFLAGS = $(OPTIMFLAGS) $(INCLUDE) $(DEFINES) -endif - -PYTHON_XY := $(shell python -c 'import sys; print(sys.version[:3])') -BDIR := build/$(PYTHON_XY) - -.PHONY: all module clean test - -all: module - -module: $(BDIR)/pdffit2module.so - @test $< -ef diffpy/pdffit2/pdffit2.so || \ - ln -vf $< diffpy/pdffit2/pdffit2.so - -clean: - rm -rf -- build/$(PYTHON_XY) diffpy/pdffit2/pdffit2.so - -test: module - python -m diffpy.pdffit2.tests.run - -OBJS = \ - $(BDIR)/bindings.o \ - $(BDIR)/misc.o \ - $(BDIR)/pdffit2module.o \ - $(BDIR)/pyexceptions.o \ - $(BDIR)/Atom.o \ - $(BDIR)/LocalPeriodicTable.o \ - $(BDIR)/OutputStreams.o \ - $(BDIR)/PeriodicTable.o \ - $(BDIR)/PointsInSphere.o \ - $(BDIR)/StringUtils.o \ - $(BDIR)/fit.o \ - $(BDIR)/gaussj.o \ - $(BDIR)/metric.o \ - $(BDIR)/nrutil.o \ - $(BDIR)/output.o \ - $(BDIR)/parser.o \ - $(BDIR)/pdf.o \ - $(BDIR)/pdffit.o \ - $(BDIR)/pdflsmin.o \ - $(BDIR)/scatlen.o \ - $(BDIR)/stru.o \ - - -$(BDIR): - mkdir -p $@ - -$(BDIR)/pdffit2module.so: $(BDIR) $(OBJS) - $(CXX) -o $@ $(LDFLAGS) $(OBJS) $(GSL_LIBS) - -$(BDIR)/%.o : libpdffit2/%.cc - $(CXX) -c $(CPPFLAGS) -o $@ $< - -$(BDIR)/%.o : pdffit2module/%.cc - $(CXX) -c $(CPPFLAGS) -o $@ $< - -# End of file diff --git a/README.rst b/README.rst index 702131a4..f6bb4499 100644 --- a/README.rst +++ b/README.rst @@ -15,8 +15,8 @@ .. |Black| image:: https://img.shields.io/badge/code_style-black-black :target: https://github.com/psf/black -.. |CI| image:: https://github.com/diffpy/diffpy.pdffit2/actions/workflows/main.yml/badge.svg - :target: https://github.com/diffpy/diffpy.pdffit2/actions/workflows/main.yml +.. |CI| image:: https://github.com/diffpy/diffpy.pdffit2/actions/workflows/matrix-and-codecov-on-merge-to-main.yml/badge.svg + :target: https://github.com/diffpy/diffpy.pdffit2/actions/workflows/matrix-and-codecov-on-merge-to-main.yml .. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.pdffit2/branch/main/graph/badge.svg :target: https://codecov.io/gh/diffpy/diffpy.pdffit2 @@ -35,7 +35,7 @@ .. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue :target: https://github.com/diffpy/diffpy.pdffit2/issues -Real space structure refinement to atomic pair distribution function. +PDFfit2 - space structure refinement to atomic pair distribution function The diffpy.pdffit2 package provides functions for calculation and refinement of atomic Pair Distribution Function (PDF) from crystal @@ -58,6 +58,8 @@ To learn more about diffpy.pdffit2 library, see the examples directory included in this distribution or the API documentation at http://www.diffpy.org/doc/pdffit2. +For more information about the diffpy.pdffit2 library, please consult our `online documentation `_. + Citation -------- @@ -102,11 +104,7 @@ Then, to fully install ``diffpy.pdffit2`` in our active environment, run :: Another option is to use ``pip`` to download and install the latest release from `Python Package Index `_. -To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, we will also have to install dependencies :: - - pip install -r https://raw.githubusercontent.com/diffpy/diffpy.pdffit2/main/requirements/run.txt - -and then install the package :: +To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, type :: pip install diffpy.pdffit2 @@ -155,9 +153,9 @@ trying to commit again. Improvements and fixes are always appreciated. -Before contributing, please read our `Code of Conduct `_. +Before contribuing, please read our `Code of Conduct `_. Contact ------- -For more information on diffpy.pdffit2 please visit the project `web-page `_ or email Prof. Simon Billinge at sb2896@columbia.edu. +For more information on diffpy.pdffit2 please visit the project `web-page `_ or email Prof. Simon Billinge at sb2896@columbia.edu. \ No newline at end of file diff --git a/doc/make.bat b/doc/make.bat index 2be83069..ac53d5bd 100644 --- a/doc/make.bat +++ b/doc/make.bat @@ -1,36 +1,36 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build -set SPHINXPROJ=PackagingScientificPython - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build +set SPHINXPROJ=PackagingScientificPython + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% + +:end +popd diff --git a/doc/source/api/diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.rst index 759fb63c..a9b0ad5a 100644 --- a/doc/source/api/diffpy.pdffit2.rst +++ b/doc/source/api/diffpy.pdffit2.rst @@ -34,3 +34,4 @@ diffpy.pdffit2.ipy_ext module :members: :undoc-members: :show-inheritance: + diff --git a/doc/source/index.rst b/doc/source/index.rst index 3ff032fe..7ae9b3aa 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -50,14 +50,14 @@ https://github.com/diffpy/diffpy.pdffit2/graphs/contributors. Reference ========= -If you use this program for a scientific research that leads to publication, -we ask that you acknowledge use of the program by citing the following paper +If you use this program for a 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 (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) - + ============ Installation ============ diff --git a/doc/source/license.rst b/doc/source/license.rst index 421a9ed7..a5af2d41 100644 --- a/doc/source/license.rst +++ b/doc/source/license.rst @@ -2,4 +2,55 @@ .. index:: license -.. include:: ../../LICENSE.rst +License +####### + +This program is part of the DiffPy and DANSE open-source projects +and is available subject to the conditions and terms laid out below. + +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 (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) + +Copyright 2006-2007, Board of Trustees of Michigan State University, +Copyright 2008-2024, Board of Trustees of Columbia University in the +city of New York. (Copyright holder indicated in each source file). + +For more information please visit the project web-page: + http://www.diffpy.org/ +or email Prof. Simon Billinge at sb2896@columbia.edu + +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 name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS". COPYRIGHT HOLDER +EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EITHER +EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS, ADEQUACY OR SUITABILITY +FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF FREEDOM FROM +INFRINGEMENT OF ANY DOMESTIC OR FOREIGN PATENT, COPYRIGHTS, TRADE +SECRETS OR OTHER PROPRIETARY RIGHTS OF ANY PARTY. IN NO EVENT SHALL +COPYRIGHT HOLDER BE LIABLE TO ANY PARTY 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 OR RELATING TO THIS AGREEMENT, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/environment.yml b/environment.yml index 5fb2f044..3979d3cb 100644 --- a/environment.yml +++ b/environment.yml @@ -2,6 +2,5 @@ name: diffpy.pdffit2 channels: - conda-forge dependencies: - - python>=3.10 + - python=3 - pip - - conda diff --git a/pyproject.toml b/pyproject.toml index 0ee80217..56742459 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ dirty_template = "{tag}" [tool.setuptools.packages.find] where = ["src"] # list of folders that contain the packages (["."] by default) include = ["*"] # package names should match these glob patterns (["*"] by default) -exclude = ["diffpy.pdffit2.tests*"] # exclude packages matching these glob patterns (empty by default) +exclude = [] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) [tool.setuptools.dynamic] From 3987b18f6f00cac584c7575861ee8523337661cb Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 00:29:20 -0400 Subject: [PATCH 141/294] meta.yml to meta.txt --- conda-recipe/{meta.yaml => meta.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename conda-recipe/{meta.yaml => meta.txt} (100%) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.txt similarity index 100% rename from conda-recipe/meta.yaml rename to conda-recipe/meta.txt From 05b15ce20c6b8fd6438222965afa1e00ab36f1d5 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 00:30:06 -0400 Subject: [PATCH 142/294] Apply precomit --- .pre-commit-config.yaml | 43 +++++++++++++++++++++++++++++++ README.rst | 2 +- doc/source/api/diffpy.pdffit2.rst | 1 - src/diffpy/pdffit2/__init__.py | 2 +- 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..c4588061 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,43 @@ +default_language_version: + 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 +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + exclude: '\.(rst|txt)$' + - repo: https://github.com/psf/black + rev: 24.4.2 + hooks: + - id: black + - repo: https://github.com/pycqa/flake8 + rev: 7.0.0 + hooks: + - id: flake8 + - repo: https://github.com/pycqa/isort + rev: 5.13.2 + hooks: + - id: isort + args: ["--profile", "black"] + - repo: https://github.com/kynan/nbstripout + rev: 0.7.1 + hooks: + - id: nbstripout + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: no-commit-to-branch + name: Prevent Commit to Main Branch + args: ["--branch", "main"] + stages: [pre-commit] diff --git a/README.rst b/README.rst index f6bb4499..03fa3a05 100644 --- a/README.rst +++ b/README.rst @@ -158,4 +158,4 @@ Before contribuing, please read our `Code of Conduct `_ or email Prof. Simon Billinge at sb2896@columbia.edu. \ No newline at end of file +For more information on diffpy.pdffit2 please visit the project `web-page `_ or email Prof. Simon Billinge at sb2896@columbia.edu. diff --git a/doc/source/api/diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.rst index a9b0ad5a..759fb63c 100644 --- a/doc/source/api/diffpy.pdffit2.rst +++ b/doc/source/api/diffpy.pdffit2.rst @@ -34,4 +34,3 @@ diffpy.pdffit2.ipy_ext module :members: :undoc-members: :show-inheritance: - diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index fe3fbce3..6a1e2c50 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -19,9 +19,9 @@ # package version from diffpy.pdffit2.output import redirect_stdout -from diffpy.pdffit2.version import __version__, __date__ from diffpy.pdffit2.pdffit import PdfFit from diffpy.pdffit2.pdffit2 import is_element +from diffpy.pdffit2.version import __date__, __version__ # silence the pyflakes syntax checker assert __version__ or True From 304f0d6be46c28971626fc394b3aed4464eca2e3 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 00:46:03 -0400 Subject: [PATCH 143/294] Ensure ordering of import in __init__.py --- .flake8 | 1 + src/diffpy/pdffit2/__init__.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.flake8 b/.flake8 index 2d2cb168..535044c9 100644 --- a/.flake8 +++ b/.flake8 @@ -4,6 +4,7 @@ exclude = __pycache__, build, dist, + __init__.py doc/source/conf.py max-line-length = 115 # Ignore some style 'errors' produced while formatting by 'black' diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index 6a1e2c50..9afc9bc6 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -17,15 +17,19 @@ """PDFfit2 - real space structure refinement program.""" -# package version +# Import package version to be used by with C++ extensions from diffpy.pdffit2.output import redirect_stdout -from diffpy.pdffit2.pdffit import PdfFit -from diffpy.pdffit2.pdffit2 import is_element from diffpy.pdffit2.version import __date__, __version__ -# silence the pyflakes syntax checker +# Ensure the version and date variables are initialized assert __version__ or True assert __date__ or True + +# Import C++ related modules after version info is initialized +from diffpy.pdffit2.pdffit import PdfFit +from diffpy.pdffit2.pdffit2 import is_element # Import element check functionality + +# Ensure all necessary components are imported and initialized assert all((PdfFit, redirect_stdout, is_element)) # End of file From 43b31a5c63315d480122a43946a42e64973db106 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 00:46:39 -0400 Subject: [PATCH 144/294] Fix typo --- src/diffpy/pdffit2/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index 9afc9bc6..74631682 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -17,7 +17,7 @@ """PDFfit2 - real space structure refinement program.""" -# Import package version to be used by with C++ extensions +# Import package version to be used by C++ extensions from diffpy.pdffit2.output import redirect_stdout from diffpy.pdffit2.version import __date__, __version__ @@ -27,7 +27,7 @@ # Import C++ related modules after version info is initialized from diffpy.pdffit2.pdffit import PdfFit -from diffpy.pdffit2.pdffit2 import is_element # Import element check functionality +from diffpy.pdffit2.pdffit2 import is_element # Ensure all necessary components are imported and initialized assert all((PdfFit, redirect_stdout, is_element)) From 47fd5a7ab3bd11bb551cbe5729753419643aaf67 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 08:41:19 -0400 Subject: [PATCH 145/294] rm mention of diffpy.structure, add c extensions --- .coveragerc | 2 +- .gitattributes | 1 - .github/workflows/check-news-item.yml | 2 +- .github/workflows/matrix-and-codecov-on-merge-to-main.yml | 6 +++--- 4 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 .gitattributes diff --git a/.coveragerc b/.coveragerc index 34ea3e4c..edd0c0ba 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,6 @@ [run] source = - diffpy.structure + diffpy.pdffit2 [report] omit = */python?.?/* diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index de811ba3..00000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -diffpy.structure/_version.py export-subst diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index 1301ca85..6a842da5 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -9,4 +9,4 @@ jobs: build: uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0 with: - project: diffpy.structure + project: diffpy.pdffit2 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 c1905e0d..0270fdf4 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -8,14 +8,14 @@ on: types: - prereleased - published - workflow_dispatch: null + workflow_dispatch: jobs: coverage: uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 with: - project: diffpy.structure - c_extension: false + project: diffpy.pdffit2 + c_extension: true headless: false secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 226fef0922f5754b3596f6046f4cf1d0aeea954e Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 08:41:32 -0400 Subject: [PATCH 146/294] rm rogue dash --- LICENSE.rst | 2 +- doc/source/license.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.rst b/LICENSE.rst index 0a1d4f66..5862f0d6 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -8,7 +8,7 @@ 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 + 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 (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) diff --git a/doc/source/license.rst b/doc/source/license.rst index a5af2d41..38f918c6 100644 --- a/doc/source/license.rst +++ b/doc/source/license.rst @@ -12,7 +12,7 @@ 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 + 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 (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) From 3016fc5abd88b6728037264badab010785df1ca0 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 08:41:59 -0400 Subject: [PATCH 147/294] Fix contributing typo --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 03fa3a05..a4983c09 100644 --- a/README.rst +++ b/README.rst @@ -35,7 +35,7 @@ .. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue :target: https://github.com/diffpy/diffpy.pdffit2/issues -PDFfit2 - space structure refinement to atomic pair distribution function +PDFfit2 - real space structure refinement to atomic pair distribution function The diffpy.pdffit2 package provides functions for calculation and refinement of atomic Pair Distribution Function (PDF) from crystal @@ -153,7 +153,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 ------- From b9530410557c9bc164260105c4a6cd7135e58f3a Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 08:47:37 -0400 Subject: [PATCH 148/294] remove rogue slash in citation --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index a4983c09..dee96bf1 100644 --- a/README.rst +++ b/README.rst @@ -65,7 +65,7 @@ Citation If you use diffpy.pdffit2 in a scientific publication, we would like you to cite the following paper: - C\. L. Farrow, P. Juhás, J. W. Liu, D. Bryndin, E. S. Božin, J. Bloch, Th. Proffen + 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 (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) From 1ba7042e775cbbb24ce851c37ee4525cccc82300 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:05:40 -0400 Subject: [PATCH 149/294] Remove avoid flake8 in __init__ and add clear directions with isort tags --- .flake8 | 1 - src/diffpy/pdffit2/__init__.py | 17 +++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.flake8 b/.flake8 index 535044c9..2d2cb168 100644 --- a/.flake8 +++ b/.flake8 @@ -4,7 +4,6 @@ exclude = __pycache__, build, dist, - __init__.py doc/source/conf.py max-line-length = 115 # Ignore some style 'errors' produced while formatting by 'black' diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index 74631682..61af1f1d 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -17,19 +17,24 @@ """PDFfit2 - real space structure refinement program.""" -# Import package version to be used by C++ extensions +# WARNING: Do NOT remove the isort: off/on comments in this file. +# These tags are used to prevent isort from reordering imports in this file. +# __version__ must be initialized before importing C++ extensions. + +# isort: off +# Import the package version before C++ extensions are loaded. from diffpy.pdffit2.output import redirect_stdout from diffpy.pdffit2.version import __date__, __version__ -# Ensure the version and date variables are initialized -assert __version__ or True -assert __date__ or True - -# Import C++ related modules after version info is initialized +# Import C++ related modules since the __version__ attribute is used. from diffpy.pdffit2.pdffit import PdfFit from diffpy.pdffit2.pdffit2 import is_element +# isort: on + # Ensure all necessary components are imported and initialized +assert __version__ or True +assert __date__ or True assert all((PdfFit, redirect_stdout, is_element)) # End of file From 1b091b536692b900168ad512b17388a2703ce120 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:26:40 -0400 Subject: [PATCH 150/294] Add pip source install step in readme --- README.rst | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index dee96bf1..5cb15a49 100644 --- a/README.rst +++ b/README.rst @@ -108,9 +108,23 @@ To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, type :: pip install diffpy.pdffit2 -If you prefer to install from sources, after installing the dependencies, obtain the source archive from -`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory -and run the following :: +If you prefer to install from sources, obtain the source archive from +`GitHub `_. + +Ensure that you have a C++ compiler and the necessary dependencies installed mentioned above: + +For macOS: :: + + brew install gsl + brew install gcc + +For Ubuntu: :: + + sudo apt-get update + sudo apt-get install libgsl-dev + sudo apt install g++ + +Next, ``cd`` into your ``diffpy.pdffit2`` directory and run the following command: :: pip install . From a225c8b3bdf8daf2471ceb308e1b559046938e76 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:28:46 -0400 Subject: [PATCH 151/294] Fix Ubuntu command for g++ --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5cb15a49..d22e8fe7 100644 --- a/README.rst +++ b/README.rst @@ -122,7 +122,7 @@ For Ubuntu: :: sudo apt-get update sudo apt-get install libgsl-dev - sudo apt install g++ + sudo apt-get install g++ Next, ``cd`` into your ``diffpy.pdffit2`` directory and run the following command: :: From a9aa591f14b4273db97e0cfcfaaf2d0014fc16c6 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:34:20 -0400 Subject: [PATCH 152/294] Add compiler download for pip install --- README.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index d22e8fe7..d52f8f93 100644 --- a/README.rst +++ b/README.rst @@ -104,12 +104,6 @@ Then, to fully install ``diffpy.pdffit2`` in our active environment, run :: Another option is to use ``pip`` to download and install the latest release from `Python Package Index `_. -To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, type :: - - pip install diffpy.pdffit2 - -If you prefer to install from sources, obtain the source archive from -`GitHub `_. Ensure that you have a C++ compiler and the necessary dependencies installed mentioned above: @@ -124,7 +118,13 @@ For Ubuntu: :: sudo apt-get install libgsl-dev sudo apt-get install g++ -Next, ``cd`` into your ``diffpy.pdffit2`` directory and run the following command: :: +To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, type :: + + pip install diffpy.pdffit2 + +If you prefer to install from sources, after installing the dependencies above, obtain the source archive from +`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory +and run the following :: pip install . From 9fabfc425434d05f8cb5b87dc84bde84561de2e6 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:36:46 -0400 Subject: [PATCH 153/294] Use conda to download dependencies --- README.rst | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index d52f8f93..8efb289f 100644 --- a/README.rst +++ b/README.rst @@ -107,18 +107,14 @@ Another option is to use ``pip`` to download and install the latest release from Ensure that you have a C++ compiler and the necessary dependencies installed mentioned above: -For macOS: :: - - brew install gsl - brew install gcc - -For Ubuntu: :: +To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, type :: - sudo apt-get update - sudo apt-get install libgsl-dev - sudo apt-get install g++ + conda install \ + --file requirements/test.txt \ + --file requirements/run.txt \ + --file requirements/build.txt -To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, type :: +And then type :: pip install diffpy.pdffit2 From 693414db59e5df29bc24dee70eb45009ff58fd36 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:40:51 -0400 Subject: [PATCH 154/294] add testing for version prompt --- README.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 8efb289f..a046fb81 100644 --- a/README.rst +++ b/README.rst @@ -105,12 +105,9 @@ Then, to fully install ``diffpy.pdffit2`` in our active environment, run :: Another option is to use ``pip`` to download and install the latest release from `Python Package Index `_. -Ensure that you have a C++ compiler and the necessary dependencies installed mentioned above: - -To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, type :: +To install the C++ compiler and required dependencies in you ``diffpy.pdffit2_env`` environment, type :: conda install \ - --file requirements/test.txt \ --file requirements/run.txt \ --file requirements/build.txt @@ -118,12 +115,16 @@ And then type :: pip install diffpy.pdffit2 -If you prefer to install from sources, after installing the dependencies above, obtain the source archive from +If you prefer to install from sources, after installing the dependencies above in the ``diffpy.pdffit2_env`` , obtain the source archive from `GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory and run the following :: pip install . +To confirm that the installation was successful, run the following in a terminal :: + + python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" + Support and Contribute ---------------------- From 3ba006eb4ce83f266b3ce066700ccfdcccded367 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:46:51 -0400 Subject: [PATCH 155/294] Fix indention for conda install --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index a046fb81..249e0998 100644 --- a/README.rst +++ b/README.rst @@ -107,15 +107,15 @@ Another option is to use ``pip`` to download and install the latest release from To install the C++ compiler and required dependencies in you ``diffpy.pdffit2_env`` environment, type :: - conda install \ - --file requirements/run.txt \ - --file requirements/build.txt + conda install \ + --file requirements/run.txt \ + --file requirements/build.txt And then type :: pip install diffpy.pdffit2 -If you prefer to install from sources, after installing the dependencies above in the ``diffpy.pdffit2_env`` , obtain the source archive from +If you prefer to install from sources, after the dependencies in `run.txt` and `build.txt` above in the ``diffpy.pdffit2_env`` , obtain the source archive from `GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory and run the following :: From dd71f7fbae963be7a96dc5b2b16a9d78dc57eecd Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:47:54 -0400 Subject: [PATCH 156/294] you to your --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 249e0998..a6e19af0 100644 --- a/README.rst +++ b/README.rst @@ -105,7 +105,7 @@ Then, to fully install ``diffpy.pdffit2`` in our active environment, run :: Another option is to use ``pip`` to download and install the latest release from `Python Package Index `_. -To install the C++ compiler and required dependencies in you ``diffpy.pdffit2_env`` environment, type :: +To install the C++ compiler and required dependencies in your ``diffpy.pdffit2_env`` environment, type :: conda install \ --file requirements/run.txt \ From d0ea0b950a88bf188897b4cb3ae1e5a40edb3132 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:48:27 -0400 Subject: [PATCH 157/294] Add double quote for pre --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index a6e19af0..55cd1336 100644 --- a/README.rst +++ b/README.rst @@ -115,7 +115,7 @@ And then type :: pip install diffpy.pdffit2 -If you prefer to install from sources, after the dependencies in `run.txt` and `build.txt` above in the ``diffpy.pdffit2_env`` , obtain the source archive from +If you prefer to install from sources, after the dependencies in ``run.txt`` and ``build.txt`` above in the ``diffpy.pdffit2_env`` , obtain the source archive from `GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory and run the following :: From 9d5fad518cb51cbc31036016c3287e815e8a9625 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:49:12 -0400 Subject: [PATCH 158/294] Remove the next to env --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 55cd1336..f2c82ac5 100644 --- a/README.rst +++ b/README.rst @@ -115,7 +115,7 @@ And then type :: pip install diffpy.pdffit2 -If you prefer to install from sources, after the dependencies in ``run.txt`` and ``build.txt`` above in the ``diffpy.pdffit2_env`` , obtain the source archive from +If you prefer to install from sources, after the dependencies in ``run.txt`` and ``build.txt`` above in ``diffpy.pdffit2_env`` , obtain the source archive from `GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory and run the following :: From 39be2ba17d91fbc0995a320017ae80109d281d71 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:51:53 -0400 Subject: [PATCH 159/294] Improve instruction for conda install --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f2c82ac5..13c41094 100644 --- a/README.rst +++ b/README.rst @@ -115,7 +115,7 @@ And then type :: pip install diffpy.pdffit2 -If you prefer to install from sources, after the dependencies in ``run.txt`` and ``build.txt`` above in ``diffpy.pdffit2_env`` , obtain the source archive from +If you prefer to install from sources, use the above `conda install \ ..` instruction to install the dependencies in ``run.txt`` and ``build.txt`` in ``diffpy.pdffit2_env`` , obtain the source archive from `GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory and run the following :: From e0407395c29d1a29f237fb9cb8ec36b23cdd35e5 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 09:53:45 -0400 Subject: [PATCH 160/294] Add double quote for pre --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 13c41094..132c0b6f 100644 --- a/README.rst +++ b/README.rst @@ -115,7 +115,7 @@ And then type :: pip install diffpy.pdffit2 -If you prefer to install from sources, use the above `conda install \ ..` instruction to install the dependencies in ``run.txt`` and ``build.txt`` in ``diffpy.pdffit2_env`` , obtain the source archive from +If you prefer to install from sources, use the above ``conda install \ ..`` instruction to install the dependencies in ``run.txt`` and ``build.txt`` in ``diffpy.pdffit2_env`` , obtain the source archive from `GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory and run the following :: From 8eba00877c8860346008d9d62e0b3a849f3849a4 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Tue, 24 Sep 2024 13:17:36 -0400 Subject: [PATCH 161/294] Include Billinge's recommended instruction for pip source install --- README.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 132c0b6f..fa90b318 100644 --- a/README.rst +++ b/README.rst @@ -102,8 +102,7 @@ Then, to fully install ``diffpy.pdffit2`` in our active environment, run :: conda install diffpy.pdffit2 -Another option is to use ``pip`` to download and install the latest release from -`Python Package Index `_. +The less preferred approach is the install using ``pip`` to download and install the latest release from `Python Package Index `_. In this case you currently have to build the codes on your computer from the sources and you will have to have a C++ installer available. To install the C++ compiler and required dependencies in your ``diffpy.pdffit2_env`` environment, type :: From 82b4f30b941fba7f49dedc539f81012d4030432e Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Mon, 30 Sep 2024 16:04:36 -0400 Subject: [PATCH 162/294] Remove conda-recipe in repo --- conda-recipe/bld.bat | 7 ---- conda-recipe/build.sh | 25 ------------ conda-recipe/conda_build_config.yaml | 11 ----- conda-recipe/meta.txt | 60 ---------------------------- 4 files changed, 103 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/meta.txt diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat deleted file mode 100644 index 3038f794..00000000 --- a/conda-recipe/bld.bat +++ /dev/null @@ -1,7 +0,0 @@ -%PYTHON% -m easy_install --no-deps . -if errorlevel 1 exit 1 - -:: 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/build.sh b/conda-recipe/build.sh deleted file mode 100644 index 70ddaf82..00000000 --- a/conda-recipe/build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# Produce stripped binaries on Linux. -if [[ "$(uname)" == Linux ]]; then - # conda-build does not set LDFLAGS on Linux. - export LDFLAGS="-s" -fi - -# allow use of default SDK on travis -if [[ "$(id -un)" == travis ]]; then - unset CONDA_BUILD_SYSROOT -# print informative message if SDK is not installed -elif [[ "$(uname)" == Darwin ]]; then - if [[ ! -e $CONDA_BUILD_SYSROOT ]]; then - echo "Please install macOS SDK to $CONDA_BUILD_SYSROOT" - exit 2 - fi -fi - -$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 4244b05c..00000000 --- a/conda-recipe/conda_build_config.yaml +++ /dev/null @@ -1,11 +0,0 @@ -python: - - 3.12 - - 3.11 - - 3.10 - - 3.9 - - 3.8 - - 3.7 - - 2.7 - -gsl: - - 2.4 diff --git a/conda-recipe/meta.txt b/conda-recipe/meta.txt deleted file mode 100644 index 9296ff4e..00000000 --- a/conda-recipe/meta.txt +++ /dev/null @@ -1,60 +0,0 @@ -{% set setupdata = load_setup_py_data() %} - -package: - name: diffpy.pdffit2 - version: {{ setupdata['version'] }} - -source: - # git_url: https://github.com/diffpy/diffpy.pdffit2.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 - -requirements: - build: - - {{ compiler('cxx') }} # [py3k or not win] - - gsl {{ gsl }} - host: - - python {{ python }} - - pip - - setuptools - - run: - - python - - setuptools - - six - - diffpy.structure >=3 - -test: - # Python imports - imports: - - diffpy - - diffpy.pdffit2 - - diffpy.pdffit2.ipy_ext - - diffpy.pdffit2.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 run_test.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.pdffit2 - summary: PDFfit2 - real space structure refinement program - license: Modified BSD License - license_file: LICENSE.txt - -# See http://docs.continuum.io/conda/build.html -# for more information about meta.yaml. From e02598fb340d4cd539efb9a75df2771acc1fa71f Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Mon, 30 Sep 2024 16:20:44 -0400 Subject: [PATCH 163/294] Create rm-recipe --- news/rm-recipe | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/rm-recipe diff --git a/news/rm-recipe b/news/rm-recipe new file mode 100644 index 00000000..3af76e88 --- /dev/null +++ b/news/rm-recipe @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* remove older conda-recipe files + +**Security:** + +* From 2605e9af99cc548f3321557cdb6b6ba07c618e26 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Mon, 30 Sep 2024 16:21:35 -0400 Subject: [PATCH 164/294] Rename rm-recipe to rm-recipe.rst --- news/{rm-recipe => rm-recipe.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{rm-recipe => rm-recipe.rst} (100%) diff --git a/news/rm-recipe b/news/rm-recipe.rst similarity index 100% rename from news/rm-recipe rename to news/rm-recipe.rst From 68d3ba88a798d240fc746a583af00381c004c97c Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Thu, 3 Oct 2024 13:42:47 -0400 Subject: [PATCH 165/294] use pip.txt for pypi packages --- news/pip.rst | 23 +++++++++++++++++++++++ news/recut.rst | 2 +- news/tests-dir.rst | 6 +++--- pyproject.toml | 2 +- requirements/{run.txt => conda.txt} | 0 requirements/pip.txt | 2 ++ 6 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 news/pip.rst rename requirements/{run.txt => conda.txt} (100%) diff --git a/news/pip.rst b/news/pip.rst new file mode 100644 index 00000000..01c61661 --- /dev/null +++ b/news/pip.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* add PyPI packages under pip.txt + +**Security:** + +* diff --git a/news/recut.rst b/news/recut.rst index e006ae7b..919a742e 100644 --- a/news/recut.rst +++ b/news/recut.rst @@ -16,7 +16,7 @@ **Fixed:** -* Re-cookiecutter to group's package standard +* re-cookiecutter to group's package standard **Security:** diff --git a/news/tests-dir.rst b/news/tests-dir.rst index 2d0e6711..91531047 100644 --- a/news/tests-dir.rst +++ b/news/tests-dir.rst @@ -16,9 +16,9 @@ **Fixed:** -* Moved the tests directory from src to the root using conftest.py. -* Fixed a circular import bug during " pip install ." in GitHub CI. -* Renamed .py files under tests to snake_case. +* moved the tests directory from src to the root using conftest.py. +* fixed a circular import bug during " pip install ." in GitHub CI. +* renamed .py files under tests to snake_case. **Security:** diff --git a/pyproject.toml b/pyproject.toml index 56742459..a25ee157 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,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/run.txt b/requirements/conda.txt similarity index 100% rename from requirements/run.txt rename to requirements/conda.txt diff --git a/requirements/pip.txt b/requirements/pip.txt index e69de29b..33133cd6 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -0,0 +1,2 @@ +diffpy.structure +six From 4f5224475cb83e27940724e6b550ad02f4c27724 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 6 Oct 2024 20:58:11 -0400 Subject: [PATCH 166/294] Cookiecutter CHANGELOG.rst --- CHANGELOG.rst | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c2db4706..f6c0f22b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,36 +2,23 @@ Release Notes ============= -No notable functional changes from 1.4.1 +.. current developments --------------------------- -Version 1.4.2 - 2023-12-09 --------------------------- - -Added +1.4.2 ===== -- Support for Python 3.11, 3.12 - -Changed -======= +**Added:** -Deprecated -========== +* Support for Python 3.11, 3.12 -Removed -======= +**Changed:** -Fixed -===== +* No notable functional changes from 1.4.1 1.4.4rc0 -======== +===== **Fixed:** * Code linted to group flake8 standards * Package structure moved to diffpy standard structure - -1.4.4rc0 -======== From 254ea6b622fea8f79ccb8f3d89c450f4d17aaf87 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Wed, 13 Nov 2024 21:09:00 -0500 Subject: [PATCH 167/294] update setup.py for ci build wheel --- setup.py | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/setup.py b/setup.py index a788e91e..402249a9 100755 --- a/setup.py +++ b/setup.py @@ -64,16 +64,23 @@ def get_gsl_config(): def get_gsl_config_win(): - """Return dictionary with paths to GSL library, windwows version. - This version is installed with conda. - """ - conda_prefix = os.environ["CONDA_PREFIX"] - inc = os.path.join(conda_prefix, "Library", "include") - lib = os.path.join(conda_prefix, "Library", "lib") - rv = {"include_dirs": [], "library_dirs": []} - rv["include_dirs"] += [inc] - rv["library_dirs"] += [lib] - return rv + """Return dictionary with paths to GSL library on Windows.""" + gsl_path = os.environ.get("GSL_PATH") + if gsl_path: + inc = os.path.join(gsl_path, "include") + lib = os.path.join(gsl_path, "lib") + else: + conda_prefix = os.environ.get("CONDA_PREFIX") + if conda_prefix: + inc = os.path.join(conda_prefix, "Library", "include") + lib = os.path.join(conda_prefix, "Library", "lib") + else: + raise EnvironmentError( + "Neither GSL_PATH nor CONDA_PREFIX environment variables are set. " + "Please ensure GSL is installed and GSL_PATH is correctly set." + ) + + return {"include_dirs": [inc], "library_dirs": [lib]} # ---------------------------------------------------------------------------- @@ -87,7 +94,10 @@ def get_gsl_config_win(): gcfg = get_gsl_config() include_dirs = [MYDIR] + gcfg["include_dirs"] library_dirs = [] -libraries = [] +if sys.platform == "darwin": + libraries = [] +else: + libraries = ["gsl"] extra_objects = [] extra_compile_args = [] extra_link_args = [] @@ -95,11 +105,12 @@ def get_gsl_config_win(): compiler_type = get_compiler_type() if compiler_type in ("unix", "cygwin", "mingw32"): extra_compile_args = ["-std=c++11", "-Wall", "-Wno-write-strings", "-O3", "-funroll-loops", "-ffast-math"] - extra_objects += ((p + "/libgsl.a") for p in gcfg["library_dirs"]) + extra_objects += [ + os.path.join(p, "libgsl.a") for p in gcfg["library_dirs"] if os.path.isfile(os.path.join(p, "libgsl.a")) + ] elif compiler_type == "msvc": define_macros += [("_USE_MATH_DEFINES", None)] extra_compile_args = ["/EHs"] - libraries += ["gsl"] library_dirs += gcfg["library_dirs"] # add optimization flags for other compilers if needed From 2dc1893889ec2ef139270049c742baee41d1d5a3 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Sun, 17 Nov 2024 01:30:17 -0500 Subject: [PATCH 168/294] Add build wheel upload release --- .../workflows/build-wheel-release-upload.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/build-wheel-release-upload.yml diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml new file mode 100644 index 00000000..b7f96290 --- /dev/null +++ b/.github/workflows/build-wheel-release-upload.yml @@ -0,0 +1,20 @@ +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: + permissions: + contents: write + uses: bobleesj/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 + with: + project: diffpy.pdffit2 + c_extension: true + + secrets: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + PAT_TOKEN: ${{ secrets.PAT_TOKEN }} From 9f52ef5810eeb2ca8bae01326ff8b8d8679b6941 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 22 Nov 2024 07:54:02 -0500 Subject: [PATCH 169/294] Add codespell --- .codespell/ignore_lines.txt | 2 ++ .codespell/ignore_words.txt | 11 ++++++ .github/ISSUE_TEMPLATE/bug_feature.md | 16 +++++++++ .github/ISSUE_TEMPLATE/release_checklist.md | 35 +++++++++++++++++++ .../workflows/build-wheel-release-upload.yml | 8 ++--- .github/workflows/check-news-item.yml | 2 +- .../matrix-and-codecov-on-merge-to-main.yml | 2 +- .github/workflows/publish-docs-on-release.yml | 14 -------- .github/workflows/tests-on-pr.yml | 4 ++- 9 files changed, 71 insertions(+), 23 deletions(-) create mode 100644 .codespell/ignore_lines.txt create mode 100644 .codespell/ignore_words.txt create mode 100644 .github/ISSUE_TEMPLATE/bug_feature.md create mode 100644 .github/ISSUE_TEMPLATE/release_checklist.md delete mode 100644 .github/workflows/publish-docs-on-release.yml 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..9757d7c0 --- /dev/null +++ b/.codespell/ignore_words.txt @@ -0,0 +1,11 @@ +;; 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 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..0f560278 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -0,0 +1,35 @@ +--- +name: Release +about: Checklist and communication channel for PyPI and GitHub release +title: "Ready for PyPI/GitHub release" +labels: "release" +assignees: "" +--- + +### PyPI/GitHub release 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. +- [ ] Successfully run any tutorial examples or do functional testing with the latest Python version. +- [ ] Grammar and writing quality are checked (no typos). + +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: + +### conda-forge release checklist: + + + +- [ ] New package dependencies listed in `conda.txt` and `test.txt` are added to `meta.yaml` in the feedstock. +- [ ] All relevant issues in the feedstock are addressed in the release PR. + +### 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 b7f96290..546bbe6d 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: @@ -8,13 +8,9 @@ on: jobs: release: - permissions: - contents: write - uses: bobleesj/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 + uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: diffpy.pdffit2 - c_extension: true - 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 6a842da5..7a766a5c 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.pdffit2 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 0270fdf4..0f2caa54 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -11,7 +11,7 @@ on: workflow_dispatch: jobs: - coverage: + matrix-coverage: uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 with: project: diffpy.pdffit2 diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml deleted file mode 100644 index ea18f1f0..00000000 --- a/.github/workflows/publish-docs-on-release.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Build and Deploy Docs - -on: - release: - types: - - published - workflow_dispatch: - -jobs: - docs: - uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 - with: - project: diffpy.pdffit2 - c_extension: true diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 31ad817a..06a55303 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -8,9 +8,11 @@ on: workflow_dispatch: jobs: - validate: + tests-on-pr: uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0 with: project: diffpy.pdffit2 c_extension: true headless: false + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 4f658eb05950351d2681c767ae0a5c77bcee99b8 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 22 Nov 2024 07:54:41 -0500 Subject: [PATCH 170/294] remove coveragerc, add codecov.yml --- .codecov.yml | 42 +++++++++++------------------------------ .coveragerc | 13 ------------- .pre-commit-config.yaml | 11 ++++++++++- 3 files changed, 21 insertions(+), 45 deletions(-) delete mode 100644 .coveragerc 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/.coveragerc b/.coveragerc deleted file mode 100644 index edd0c0ba..00000000 --- a/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -source = - diffpy.pdffit2 -[report] -omit = - */python?.?/* - */site-packages/nose/* - # ignore _version.py and versioneer.py - .*version.* - *_version.py - -exclude_lines = - if __name__ == '__main__': diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c4588061..9cf0556f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,10 @@ repos: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - exclude: '\.(rst|txt)$' + - id: check-case-conflict + - id: check-merge-conflict + - id: check-toml + - id: check-added-large-files - repo: https://github.com/psf/black rev: 24.4.2 hooks: @@ -41,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 From 1fa25fcb21d1ba3d543318d53758d04fb83c53dc Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 22 Nov 2024 07:56:43 -0500 Subject: [PATCH 171/294] Modify pyproject to support 3.13 --- pyproject.toml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a25ee157..c5f692de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,9 +12,9 @@ maintainers = [ { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, ] description = "PDFfit2 - real space structure refinement program." -keywords = ['PDF structure refinement'] +keywords = ["PDF", "structure refinement"] readme = "README.rst" -requires-python = ">=3.10" +requires-python = ">=3.11, <3.14" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -25,9 +25,9 @@ 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', + 'Programming Language :: Python :: 3.13', 'Topic :: Scientific/Engineering :: Physics', 'Topic :: Scientific/Engineering :: Chemistry', ] @@ -51,6 +51,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" + [tool.black] line-length = 115 include = '\.pyi?$' From 1445d9f6c29827737f4867f4134abb22f7620537 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 22 Nov 2024 08:03:25 -0500 Subject: [PATCH 172/294] Fix typo --- .codespell/ignore_words.txt | 6 ++++++ AUTHORS.rst | 4 ++-- README.rst | 2 +- doc/source/examples.rst | 2 +- pyproject.toml | 2 +- src/diffpy/pdffit2/pdffit.py | 14 +++++++------- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt index 9757d7c0..186fda9d 100644 --- a/.codespell/ignore_words.txt +++ b/.codespell/ignore_words.txt @@ -9,3 +9,9 @@ socio-economic ;; Frobenius norm used in np.linalg.norm fro + +;; class name within distutils module +ccompiler + +;; structure file format +discus diff --git a/AUTHORS.rst b/AUTHORS.rst index d6679278..23ef2b2f 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -1,7 +1,7 @@ Authors ======= -Billinge Group and community contibutors. +Billinge Group and community contributors. ---- @@ -17,7 +17,7 @@ Previous significant contributors to this code were Pavol Juhas, Chris Farrow, Jacques Bloch, Wenduo Zhou -Please see the github contributions and the header of each source file +Please see the github contributions and the header of each source file for a detailed list of contributors. This is an open-source project and we hope and expect that the list of contributors will expand with time. Many thanks to diff --git a/README.rst b/README.rst index fa90b318..d9f026af 100644 --- a/README.rst +++ b/README.rst @@ -121,7 +121,7 @@ and run the following :: pip install . To confirm that the installation was successful, run the following in a terminal :: - + python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" Support and Contribute diff --git a/doc/source/examples.rst b/doc/source/examples.rst index f793e585..300cc54c 100644 --- a/doc/source/examples.rst +++ b/doc/source/examples.rst @@ -59,7 +59,7 @@ The first example shows how to calculates the PDF for FCC nickel and saves the r # display plot window, this must be the last command in the script plt.show() -The scripts can be downloaded :download:`here `. +The scripts can be downloaded :download:`here `. ======================================= Example 2: Performing simple refinement diff --git a/pyproject.toml b/pyproject.toml index c5f692de..8a1b15c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ dependencies = {file = ["requirements/pip.txt"]} [tool.codespell] exclude-file = ".codespell/ignore_lines.txt" ignore-words = ".codespell/ignore_words.txt" -skip = "*.cif,*.dat" +skip = "*.cif,*.dat,*.cc,*.h" [tool.black] line-length = 115 diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py index 255e8b0f..11f6f253 100644 --- a/src/diffpy/pdffit2/pdffit.py +++ b/src/diffpy/pdffit2/pdffit.py @@ -301,7 +301,7 @@ def calc(self): Raises: pdffit2.calculationError when allocated space cannot - accomodate calculation + accommodate calculation pdffit.unassignedError when space for calculation has not been allocated """ @@ -572,7 +572,7 @@ def getR(self): This function should only be called after data has been loaded or calculated. Before a refinement, the list of r-points will reflect the - data. Afterwords, they will reflect the fit range. + data. Afterwards, they will reflect the fit range. Raises: pdffit2.unassignedError if no data exists @@ -599,7 +599,7 @@ def getpdf_obs(self): This function should only be called after data has been loaded or calculated. Before a refinement, the list of r-points will reflect the - data. Afterwords, they will reflect the fit range. + data. Afterwards, they will reflect the fit range. Raises: pdffit2.unassignedError if no data exists @@ -613,7 +613,7 @@ def getpdf_diff(self): This function should only be called after data has been loaded or calculated. Before a refinement, the list of r-points will reflect the - data. Afterwords, they will reflect the fit range. + data. Afterwards, they will reflect the fit range. Raises: pdffit2.unassignedError if no data exists @@ -880,7 +880,7 @@ def blen(self, *args): if isinstance(a2, numbers.Integral): a2 = atom_types[a2 - 1] except IndexError: - # index of non-existant atom type + # index of non-existent atom type return # arguments are OK here, get bond length dictionary bld = pdffit2.bond_length_types(self._handle, a1, a2, lb, ub) @@ -930,8 +930,8 @@ def bond_length_types(self, a1, a2, lb, ub): Return a dictionary of distance data containing - dij : list of bond lenghts within given bounds - ddij : list of bond legnth standard deviations + dij : list of bond lengths within given bounds + ddij : list of bond length standard deviations ij0 : pairs of atom indices starting from 0 ij1 : pairs of atom indices starting from 1 From 5b4bb35a7ff287b0a3fc278ef098b27e521bce31 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 22 Nov 2024 08:05:51 -0500 Subject: [PATCH 173/294] use latest release checklist containing rc pypi release --- .github/ISSUE_TEMPLATE/release_checklist.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 0f560278..ba1d40ce 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -6,7 +6,7 @@ labels: "release" assignees: "" --- -### PyPI/GitHub release checklist: +### PyPI/GitHub rc-release preparation checklist: - [ ] All PRs/issues attached to the release are merged. - [ ] All the badges on the README are passing. @@ -17,15 +17,24 @@ assignees: "" - [ ] Successfully run any tutorial examples or do functional testing with the latest Python version. - [ ] Grammar and writing quality are checked (no typos). -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: +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: -### conda-forge release checklist: +### PyPI/GitHub full-release preparation checklist: +- [ ] Create a new conda environment and install the rc from pypi (`pip install =??`) +- [ ] License information at Pypi is verified as correct. +- [ ] Docs deployed successfully to `.github.io` +- [ ] Successfully run all tests, tutorial examples or do functional testing + +Please let @sbillinge know that all checks are done and 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. -- [ ] All relevant issues in the feedstock are addressed in the release PR. +- [ ] Close any open issues on the feedstock. Reach out to @bobleesj if you have questions +- [ ] let @sbillinge and @bobleesj when this is ready ### Post-release checklist From 363c356f66e8a786805a73f5bb1c0129b423c8ff Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 22 Nov 2024 08:10:16 -0500 Subject: [PATCH 174/294] Add news --- news/py313.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/py313.rst diff --git a/news/py313.rst b/news/py313.rst new file mode 100644 index 00000000..899bc269 --- /dev/null +++ b/news/py313.rst @@ -0,0 +1,23 @@ +**Added:** + +* Python 3.13 support + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* Python 3.10 support + +**Fixed:** + +* + +**Security:** + +* From 7c8023c0c25905fd8728ec5c9ffaa82ee55e9160 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:20:13 -0500 Subject: [PATCH 175/294] build doc on release --- .github/workflows/publish-docs-on-release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/publish-docs-on-release.yml diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml new file mode 100644 index 00000000..b517f2bb --- /dev/null +++ b/.github/workflows/publish-docs-on-release.yml @@ -0,0 +1,15 @@ +name: Deploy Documentation on Release + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + docs: + permissions: + contents: write + uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 + with: + project: diffpy.pdffit2 + c_extension: true From 788b7f9cb2f2a9cca96bb69c122dbd4cfdf2b96c Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:22:34 -0500 Subject: [PATCH 176/294] Use latest macos to build doc --- .github/workflows/publish-docs-on-release.yml | 46 ++++++++++++++++--- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index b517f2bb..7e9c5a6c 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -7,9 +7,43 @@ on: jobs: docs: - permissions: - contents: write - uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 - with: - project: diffpy.pdffit2 - c_extension: true + defaults: + run: + shell: bash -l {0} + + runs-on: macos-latest + steps: + - name: Check out diffpy.pdffit2 + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetches branches and tags + + - name: Initialize miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: build + auto-update-conda: true + environment-file: environment.yml + auto-activate-base: false + python-version: 3.13 + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install diffpy.pdffit2 and docs requirements + run: | + conda install --file requirements/conda.txt + conda install --file requirements/docs.txt + conda install --file requirements/build.txt + python -m pip install . --no-deps + + - name: build documents + run: make -C doc html + + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doc/build/html \ No newline at end of file From fa5677464b471b3409b475296b3d32bef9540da4 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:30:04 -0500 Subject: [PATCH 177/294] Use py3.10 to 3.12 matrix CI --- .../matrix-and-codecov-on-merge-to-main.yml | 64 ++++++++++++++++--- 1 file changed, 56 insertions(+), 8 deletions(-) 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 0f2caa54..9ed76e72 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -11,11 +11,59 @@ on: workflow_dispatch: jobs: - matrix-coverage: - uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 - with: - project: diffpy.pdffit2 - c_extension: true - headless: false - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + coverage: + 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.10", "3.11", "3.12"] + env: + LATEST_PYTHON_VERSION: "3.12" + steps: + - name: Check out diffpy.pdffit2 + 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.pdffit2 and requirements + run: | + conda install --file requirements/conda.txt + conda install --file requirements/test.txt + conda install --file requirements/build.txt + 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.pdfffit2 + run: | + 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 }} \ No newline at end of file From a5fe28ecc62e758aa1a5637dc3cbb4afa1c29a71 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:33:47 -0500 Subject: [PATCH 178/294] Remove support for py 3.13, add support for 3.10 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8a1b15c5..4f02b7d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ description = "PDFfit2 - real space structure refinement program." keywords = ["PDF", "structure refinement"] readme = "README.rst" -requires-python = ">=3.11, <3.14" +requires-python = ">=3.10, <3.13" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -25,9 +25,9 @@ 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', - 'Programming Language :: Python :: 3.13', 'Topic :: Scientific/Engineering :: Physics', 'Topic :: Scientific/Engineering :: Chemistry', ] From 8a05f92739018689ed68602f4dbc52c9b14e6b5c Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:35:04 -0500 Subject: [PATCH 179/294] Use py 3.12 for doc building --- .github/workflows/publish-docs-on-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index 7e9c5a6c..02137b83 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -25,7 +25,7 @@ jobs: auto-update-conda: true environment-file: environment.yml auto-activate-base: false - python-version: 3.13 + python-version: 3.12 - name: Conda config run: >- From a3e5da12b3b19a81e01e05e5d7357c7b7e170f8b Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:48:07 -0500 Subject: [PATCH 180/294] Use py 3.12 for test on pr --- .github/workflows/tests-on-pr.yml | 52 ++++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 06a55303..71b672d9 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -8,11 +8,47 @@ on: workflow_dispatch: jobs: - tests-on-pr: - uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0 - with: - project: diffpy.pdffit2 - c_extension: true - headless: false - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + validate: + defaults: + run: + shell: bash -l {0} + + runs-on: ubuntu-latest + steps: + - name: Check out diffpy.pdffit2 + 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.pdffit2 and requirements + run: | + conda install --file requirements/conda.txt + conda install --file requirements/test.txt + conda install --file requirements/build.txt + python -m pip install . --no-deps + + + - name: Validate diffpy.pdffit2 + run: | + 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 }} \ No newline at end of file From 7086a6fe6a8ffb53b4d3ee1977a770b9f2c93bb8 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:50:09 -0500 Subject: [PATCH 181/294] Add news --- news/{py313.rst => py312.rst} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename news/{py313.rst => py312.rst} (71%) diff --git a/news/py313.rst b/news/py312.rst similarity index 71% rename from news/py313.rst rename to news/py312.rst index 899bc269..301a9fdb 100644 --- a/news/py313.rst +++ b/news/py312.rst @@ -1,6 +1,6 @@ **Added:** -* Python 3.13 support +* Python 3.10, 3.11, 3.12 support **Changed:** @@ -12,7 +12,7 @@ **Removed:** -* Python 3.10 support +* Python <= 3.9 support **Fixed:** From 73179b990c5a9f5ff0dedf7cf2d828e2eabc5ad4 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 27 Nov 2024 15:50:51 -0500 Subject: [PATCH 182/294] Apply pre-commit --- .github/workflows/matrix-and-codecov-on-merge-to-main.yml | 2 +- .github/workflows/publish-docs-on-release.yml | 2 +- .github/workflows/tests-on-pr.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 9ed76e72..429bc44d 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -66,4 +66,4 @@ jobs: if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION uses: codecov/codecov-action@v4 env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index 02137b83..f65a1b46 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -46,4 +46,4 @@ jobs: uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./doc/build/html \ No newline at end of file + publish_dir: ./doc/build/html diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 71b672d9..13a2d17e 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -51,4 +51,4 @@ jobs: with: verbose: true fail_ci_if_error: true - token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} From f893b50b0b1ca14c1a7500e449089ebb069e857a Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Mon, 2 Dec 2024 15:49:45 -0500 Subject: [PATCH 183/294] remove py 3.10 support --- .github/workflows/matrix-and-codecov-on-merge-to-main.yml | 2 +- README.rst | 2 +- news/py312.rst | 4 ++-- pyproject.toml | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) 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 429bc44d..091c71be 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-13, macos-14] - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.11", "3.12"] env: LATEST_PYTHON_VERSION: "3.12" steps: diff --git a/README.rst b/README.rst index d9f026af..88ee7fae 100644 --- a/README.rst +++ b/README.rst @@ -72,7 +72,7 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite Installation ------------ -diffpy.pdffit2 requires Python 3.10 or later and +diffpy.pdffit2 requires Python 3.11 or later and the following external software: * ``setuptools`` - software distribution tools for Python diff --git a/news/py312.rst b/news/py312.rst index 301a9fdb..2897ff09 100644 --- a/news/py312.rst +++ b/news/py312.rst @@ -1,6 +1,6 @@ **Added:** -* Python 3.10, 3.11, 3.12 support +* Python 3.11, 3.12 support **Changed:** @@ -12,7 +12,7 @@ **Removed:** -* Python <= 3.9 support +* Python <= 3.10 support **Fixed:** diff --git a/pyproject.toml b/pyproject.toml index 4f02b7d0..7df539b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ description = "PDFfit2 - real space structure refinement program." keywords = ["PDF", "structure refinement"] readme = "README.rst" -requires-python = ">=3.10, <3.13" +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', From d40458daab7380d787bfe89fe0d5d0821135c54d Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 4 Dec 2024 10:50:12 -0500 Subject: [PATCH 184/294] Add separate instructions for macOS arm64 in readme --- README.rst | 52 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/README.rst b/README.rst index 88ee7fae..163c3f6b 100644 --- a/README.rst +++ b/README.rst @@ -72,7 +72,7 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite Installation ------------ -diffpy.pdffit2 requires Python 3.11 or later and +diffpy.pdffit2 supports Python 3.11 and 3.12 the following external software: * ``setuptools`` - software distribution tools for Python @@ -82,47 +82,59 @@ the following external software: * ``diffpy.structure`` - simple storage and manipulation of atomic structures, https://github.com/diffpy/diffpy.structure ----- +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.pdffit2_env`` :: +Create a new environment named ``diffpy.pdffit2_env`` and install ``diffpy.pdffit2`` :: + + conda create -n diffpy.pdffit2_env diffpy.pdffit2 + +Activate the environment :: - conda create -n diffpy.pdffit2_env python=3 conda activate diffpy.pdffit2_env -Then, to fully install ``diffpy.pdffit2`` in our active environment, run :: +Confirm that the installation was successful :: - conda install diffpy.pdffit2 + python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" -The less preferred approach is the install using ``pip`` to download and install the latest release from `Python Package Index `_. In this case you currently have to build the codes on your computer from the sources and you will have to have a C++ installer available. +macOS (Arm64) +~~~~~~~~~~~ -To install the C++ compiler and required dependencies in your ``diffpy.pdffit2_env`` environment, type :: +Create a new conda environment ``diffpy.pdffit2_env`` :: - conda install \ - --file requirements/run.txt \ - --file requirements/build.txt + conda create -n diffpy.pdffit2_env python=3.12 -And then type :: +Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_ :: pip install diffpy.pdffit2 -If you prefer to install from sources, use the above ``conda install \ ..`` instruction to install the dependencies in ``run.txt`` and ``build.txt`` in ``diffpy.pdffit2_env`` , obtain the source archive from -`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory -and run the following :: +Confirm that the installation was successful :: + + python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" - pip install . +Build from source +~~~~~~~~~~~~~~~~ -To confirm that the installation was successful, run the following in a terminal :: +For advanced users, obtain the source archive, and in the ``diffpy.pdffit2`` directory, run :: - python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" + conda create -n diffpy.pdffit2_env python=3.12 \ + --file requirements/test.txt \ + --file requirements/conda.txt \ + --file requirements/build.txt + +Run the following commands sequentially to activate the environment, build the package, and run unit tests :: + + conda activate diffpy.pdffit2_env + pip install . --no-deps + pytest Support and Contribute ---------------------- From a064fb1d32bb01c2c232677edcc37aca74c839f0 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 4 Dec 2024 10:53:35 -0500 Subject: [PATCH 185/294] Add news --- news/readme-install.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/readme-install.rst diff --git a/news/readme-install.rst b/news/readme-install.rst new file mode 100644 index 00000000..0ad7f576 --- /dev/null +++ b/news/readme-install.rst @@ -0,0 +1,23 @@ +**Added:** + +* Separate installation instruction for macOS (Arm64) in READEM + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 41a2231e2dc42cfed37b8c26b80f0b1551357aaa Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 4 Dec 2024 10:57:42 -0500 Subject: [PATCH 186/294] Fix syntax and wording to improve readability --- README.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 163c3f6b..b52b9a6b 100644 --- a/README.rst +++ b/README.rst @@ -93,30 +93,30 @@ Add the "conda-forge" channel by running the following command in a terminal: conda config --add channels conda-forge -Create a new environment named ``diffpy.pdffit2_env`` and install ``diffpy.pdffit2`` :: +Create a new environment named ``diffpy.pdffit2_env`` and install ``diffpy.pdffit2``: :: conda create -n diffpy.pdffit2_env diffpy.pdffit2 -Activate the environment :: +Activate the environment: :: conda activate diffpy.pdffit2_env -Confirm that the installation was successful :: +Confirm that the installation was successful: :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" macOS (Arm64) ~~~~~~~~~~~ -Create a new conda environment ``diffpy.pdffit2_env`` :: +Create a new conda environment ``diffpy.pdffit2_env``: :: conda create -n diffpy.pdffit2_env python=3.12 -Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_ :: +Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_: :: pip install diffpy.pdffit2 -Confirm that the installation was successful :: +Confirm that the installation was successful: :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" @@ -130,7 +130,7 @@ For advanced users, obtain the source archive, and in the ``diffpy.pdffit2`` dir --file requirements/conda.txt \ --file requirements/build.txt -Run the following commands sequentially to activate the environment, build the package, and run unit tests :: +Activate the environment, build the package, and run unit tests by following commands sequentially: :: conda activate diffpy.pdffit2_env pip install . --no-deps From 9595eff035c19808bbe38a45660a776d02214931 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 4 Dec 2024 11:05:23 -0500 Subject: [PATCH 187/294] Re-run empty commit to see if codecov passes From 207fb45b940709bcf6b5b18732ec604fff8d8ae2 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Wed, 4 Dec 2024 22:04:38 -0500 Subject: [PATCH 188/294] Remove build dependencies in readme --- README.rst | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.rst b/README.rst index b52b9a6b..0dddaf34 100644 --- a/README.rst +++ b/README.rst @@ -73,14 +73,6 @@ Installation ------------ diffpy.pdffit2 supports Python 3.11 and 3.12 -the following external software: - -* ``setuptools`` - software distribution tools for Python -* ``python-dev`` - header files for interfacing Python with C -* ``GSL`` - GNU Scientific Library for C -* ``g++`` - GNU C++ compiler -* ``diffpy.structure`` - simple storage and manipulation of atomic - structures, https://github.com/diffpy/diffpy.structure Windows, macOS (non-Arm64), Linux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -89,7 +81,7 @@ The preferred method is to use `Miniconda Python `_ and install from the "conda-forge" channel of Conda packages. -Add the "conda-forge" channel by running the following command in a terminal: +Add the "conda-forge" channel by running the following command in a terminal: :: conda config --add channels conda-forge From 335af77e393c3b867a25277fde2f357988e8438d Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Thu, 5 Dec 2024 14:53:50 -0500 Subject: [PATCH 189/294] Add activate env --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 0dddaf34..c138dd6f 100644 --- a/README.rst +++ b/README.rst @@ -104,6 +104,10 @@ Create a new conda environment ``diffpy.pdffit2_env``: :: conda create -n diffpy.pdffit2_env python=3.12 +Activate the environment: :: + + conda activate diffpy.pdffit2_env + Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_: :: pip install diffpy.pdffit2 From 65029aab72d054a70cec315dffe3afa900e6c54d Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Thu, 5 Dec 2024 14:54:34 -0500 Subject: [PATCH 190/294] Add period after supporting 3.11, 3.12 --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index c138dd6f..ccbc574c 100644 --- a/README.rst +++ b/README.rst @@ -72,7 +72,7 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite Installation ------------ -diffpy.pdffit2 supports Python 3.11 and 3.12 +diffpy.pdffit2 supports Python 3.11 and 3.12. Windows, macOS (non-Arm64), Linux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 0995e850dc00e9a20ce731e503fa1b3aac69cb9f Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Thu, 5 Dec 2024 16:56:15 -0500 Subject: [PATCH 191/294] Add c_extension to `true` in build-wheel release --- .github/workflows/build-wheel-release-upload.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 546bbe6d..76aa3e49 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -11,6 +11,7 @@ jobs: uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: diffpy.pdffit2 + c_extension: true secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} PAT_TOKEN: ${{ secrets.PAT_TOKEN }} From a0f9e65a0cac0138b8aa4ae7ac41835478f3aca4 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Thu, 5 Dec 2024 17:08:52 -0500 Subject: [PATCH 192/294] Fix header lenght for mac64 --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index ccbc574c..fa2c6cc1 100644 --- a/README.rst +++ b/README.rst @@ -75,7 +75,7 @@ Installation diffpy.pdffit2 supports Python 3.11 and 3.12. Windows, macOS (non-Arm64), Linux -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The preferred method is to use `Miniconda Python `_ @@ -98,7 +98,7 @@ Confirm that the installation was successful: :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" macOS (Arm64) -~~~~~~~~~~~ +~~~~~~~~~~~~~ Create a new conda environment ``diffpy.pdffit2_env``: :: @@ -117,7 +117,7 @@ Confirm that the installation was successful: :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" Build from source -~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~ For advanced users, obtain the source archive, and in the ``diffpy.pdffit2`` directory, run :: From 1cfd013356cffd61b69ff7e3e2913d33a9d41979 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 6 Dec 2024 09:18:47 -0500 Subject: [PATCH 193/294] Use resuable workflow for test on PR and build doc with Python 3.12 --- .github/workflows/publish-docs-on-release.yml | 47 +++-------------- .github/workflows/tests-on-pr.yml | 51 +++---------------- 2 files changed, 15 insertions(+), 83 deletions(-) diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index f65a1b46..af598c7b 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -7,43 +7,10 @@ on: jobs: docs: - defaults: - run: - shell: bash -l {0} - - runs-on: macos-latest - steps: - - name: Check out diffpy.pdffit2 - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetches branches and tags - - - name: Initialize miniconda - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: build - 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.pdffit2 and docs requirements - run: | - conda install --file requirements/conda.txt - conda install --file requirements/docs.txt - conda install --file requirements/build.txt - python -m pip install . --no-deps - - - name: build documents - run: make -C doc html - - - name: Deploy - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./doc/build/html + permissions: + contents: write + uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 + with: + project: diffpy.pdffit2 + c_extension: true + headless: false diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 13a2d17e..93bc219e 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -9,46 +9,11 @@ on: jobs: validate: - defaults: - run: - shell: bash -l {0} - - runs-on: ubuntu-latest - steps: - - name: Check out diffpy.pdffit2 - 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.pdffit2 and requirements - run: | - conda install --file requirements/conda.txt - conda install --file requirements/test.txt - conda install --file requirements/build.txt - python -m pip install . --no-deps - - - - name: Validate diffpy.pdffit2 - run: | - 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 }} + uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0 + with: + project: diffpy.pdffi2 + c_extension: false + headless: true + pythno_version: 3.12 + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From d106c70a18d32bbcf96606e8230710dfa07641a3 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 6 Dec 2024 09:19:32 -0500 Subject: [PATCH 194/294] Fix typo for python --- .github/workflows/publish-docs-on-release.yml | 1 + .github/workflows/tests-on-pr.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index af598c7b..be60ce19 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -14,3 +14,4 @@ jobs: project: diffpy.pdffit2 c_extension: true headless: false + python_version: 3.12 diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 93bc219e..cd5b0433 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -14,6 +14,6 @@ jobs: project: diffpy.pdffi2 c_extension: false headless: true - pythno_version: 3.12 + python_version: 3.12 secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 90b31feb44e5789b46c524dd0965e7d7632ef67e Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Wed, 1 Jan 2025 23:02:04 -0500 Subject: [PATCH 195/294] build windows wheel --- .github/workflows/wheel.yml | 84 +++++++++++++++++++++++++++++++++++++ setup.py | 13 ++++++ 2 files changed, 97 insertions(+) create mode 100644 .github/workflows/wheel.yml diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml new file mode 100644 index 00000000..be7d237d --- /dev/null +++ b/.github/workflows/wheel.yml @@ -0,0 +1,84 @@ +name: Wheel builder + +on: + pull_request: + push: + workflow_dispatch: + +jobs: + build_wheels: + + defaults: + run: + shell: bash -l {0} + + name: Build wheel ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }} + runs-on: ${{ matrix.buildplat[0] }} + strategy: + fail-fast: false + matrix: + buildplat: + - [ubuntu-latest, manylinux_x86_64] + - [macos-13, macosx_x86_64] + - [macos-14, macosx_arm64] + - [windows-latest, win_amd64] + python: + - ["3.11", "cp311"] + - ["3.12", "cp312"] + + steps: + - name: Check out #${{ inputs.project }} + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python[0] }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python[0] }} + + - name: Build wheels for Linux + if: runner.os == 'Linux' + uses: pypa/cibuildwheel@v2.21.1 + env: + CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} + CIBW_BEFORE_BUILD: yum install -y gsl-devel && pip install -e . + with: + output-dir: wheelhouse + + - name: Build wheels for macOS + if: runner.os == 'macOS' + uses: pypa/cibuildwheel@v2.21.1 + env: + CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} + MACOSX_DEPLOYMENT_TARGET: 13.0 + CIBW_BEFORE_BUILD: brew install gsl && pip install -e . + with: + output-dir: wheelhouse + + - name: Set up conda for Windows + if: runner.os == 'Windows' + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: gsl + auto-update-conda: true + environment-file: environment.yml + auto-activate-base: false + + - name: install gsl for Windows + if: runner.os == 'Windows' + run: | + conda config --set always_yes yes --set changeps1 no + conda install gsl + + - name: Build wheels for Windows + if: runner.os == 'Windows' + uses: pypa/cibuildwheel@v2.21.1 + env: + CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} + CONDA_PREFIX: ${{ env.CONDA_PREFIX }} + with: + output-dir: wheelhouse + + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }} + path: ./wheelhouse/*.whl diff --git a/setup.py b/setup.py index 402249a9..4319aa96 100755 --- a/setup.py +++ b/setup.py @@ -12,6 +12,7 @@ import os import re import sys +import shutil import warnings from setuptools import Extension, setup @@ -82,6 +83,17 @@ def get_gsl_config_win(): return {"include_dirs": [inc], "library_dirs": [lib]} +class CustomBuildExt(build_ext): + def run(self): + super().run() + gsl_path = os.environ.get("GSL_PATH") or os.path.join(os.environ.get("CONDA_PREFIX", ""), "Library") + + bin_path = os.path.join(gsl_path, "bin") + dest_path = os.path.join(self.build_lib, "diffpy", "pdffit2") + os.makedirs(dest_path, exist_ok=True) + + for dll_file in glob.glob(os.path.join(bin_path, "gsl*.dll")): + shutil.copy(dll_file, dest_path) # ---------------------------------------------------------------------------- @@ -134,6 +146,7 @@ def create_extensions(): setup_args = dict( ext_modules=[], + cmdclass={"build_ext": CustomBuildExt}, ) if __name__ == "__main__": From 2d020a690280964c0a5104c3bc255a3c9f5e86e2 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Wed, 1 Jan 2025 23:07:02 -0500 Subject: [PATCH 196/294] import build_ext --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 4319aa96..2b8bd434 100755 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ import warnings from setuptools import Extension, setup +from setuptools.command.build_ext import build_ext # Use this version when git data are not available, like in git zip archive. # Update when tagging a new release. From e05d8b0e1ad609b5725b5f1d425fd6741a4dbfd7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 04:48:31 +0000 Subject: [PATCH 197/294] [pre-commit.ci] auto fixes from pre-commit hooks --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2b8bd434..50248381 100755 --- a/setup.py +++ b/setup.py @@ -11,8 +11,8 @@ import glob import os import re -import sys import shutil +import sys import warnings from setuptools import Extension, setup @@ -84,11 +84,12 @@ def get_gsl_config_win(): return {"include_dirs": [inc], "library_dirs": [lib]} + class CustomBuildExt(build_ext): def run(self): super().run() gsl_path = os.environ.get("GSL_PATH") or os.path.join(os.environ.get("CONDA_PREFIX", ""), "Library") - + bin_path = os.path.join(gsl_path, "bin") dest_path = os.path.join(self.build_lib, "diffpy", "pdffit2") os.makedirs(dest_path, exist_ok=True) @@ -96,6 +97,7 @@ def run(self): for dll_file in glob.glob(os.path.join(bin_path, "gsl*.dll")): shutil.copy(dll_file, dest_path) + # ---------------------------------------------------------------------------- # compile and link options From 0a57be39dcea02f6e36a5aab75aa7b3dcf1607f5 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Wed, 1 Jan 2025 23:59:42 -0500 Subject: [PATCH 198/294] fix typo in pr test workflow file --- .github/workflows/tests-on-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index cd5b0433..6d008cdc 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -12,8 +12,8 @@ jobs: uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0 with: project: diffpy.pdffi2 - c_extension: false - headless: true + c_extension: true + headless: false python_version: 3.12 secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 3b75f60aeb920f3562269254541158ba7037137d Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 2 Jan 2025 00:03:29 -0500 Subject: [PATCH 199/294] add news --- news/wftypo.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/wftypo.rst diff --git a/news/wftypo.rst b/news/wftypo.rst new file mode 100644 index 00000000..622844e0 --- /dev/null +++ b/news/wftypo.rst @@ -0,0 +1,23 @@ +**Added:** + +* no news: modification on CI workflow + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 7e12bebe436a4ef27fbbfedb1534d6b8c92bac8d Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sat, 4 Jan 2025 03:18:09 -0500 Subject: [PATCH 200/294] change to pathlib and small improvements --- setup.py | 81 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/setup.py b/setup.py index 50248381..afe2a0c1 100755 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ import shutil import sys import warnings +from pathlib import Path from setuptools import Extension, setup from setuptools.command.build_ext import build_ext @@ -22,101 +23,99 @@ # Update when tagging a new release. FALLBACK_VERSION = "1.4.3" -MYDIR = os.path.dirname(os.path.abspath(__file__)) +MYDIR = str(Path(__file__).parent.resolve()) # Helper functions ----------------------------------------------------------- def get_compiler_type(): - """find compiler used for building extensions.""" + """Find compiler used for building extensions.""" cc_arg = [a for a in sys.argv if a.startswith("--compiler=")] if cc_arg: - compiler_type = cc_arg[-1].split("=", 1)[1] - else: - from distutils.ccompiler import new_compiler + return cc_arg[-1].split("=", 1)[1] + from distutils.ccompiler import new_compiler - compiler_type = new_compiler().compiler_type - return compiler_type + return new_compiler().compiler_type def get_gsl_config(): """Return dictionary with paths to GSL library.""" - gslcfgpaths = [os.path.join(p, "gsl-config") for p in ([MYDIR] + os.environ["PATH"].split(os.pathsep))] - gslcfgpaths = [p for p in gslcfgpaths if os.path.isfile(p)] + gslcfgpaths = [Path(p) / "gsl-config" for p in ([MYDIR] + os.environ["PATH"].split(os.pathsep))] + gslcfgpaths = [p for p in gslcfgpaths if p.is_file()] rv = {"include_dirs": [], "library_dirs": []} if not gslcfgpaths: - wmsg = "Cannot find gsl-config in {!r} nor in system PATH." - warnings.warn(wmsg.format(MYDIR)) + warnings.warn(f"Cannot find gsl-config in {MYDIR} nor in system PATH.") return rv gslcfg = gslcfgpaths[0] - with open(gslcfg) as fp: - txt = fp.read() - mprefix = re.search("(?m)^prefix=(.+)", txt) + txt = gslcfg.read_text() + mprefix = re.search(r"(?m)^prefix=(.+)", txt) minclude = re.search(r"(?m)^[^#]*\s-I(\S+)", txt) mlibpath = re.search(r"(?m)^[^#]*\s-L(\S+)", txt) if not mprefix: - emsg = "Cannot find 'prefix=' line in {}." - raise RuntimeError(emsg.format(gslcfg)) - p = mprefix.group(1) - inc = minclude.group(1) if minclude else (p + "/include") - lib = mlibpath.group(1) if mlibpath else (p + "/lib") - rv["include_dirs"] += [inc] - rv["library_dirs"] += [lib] + raise RuntimeError(f"Cannot find 'prefix=' line in {gslcfg}.") + p = Path(mprefix.group(1)) + rv["include_dirs"].append(str(minclude.group(1) if minclude else p / "include")) + rv["library_dirs"].append(str(mlibpath.group(1) if mlibpath else p / "lib")) return rv def get_gsl_config_win(): """Return dictionary with paths to GSL library on Windows.""" - gsl_path = os.environ.get("GSL_PATH") + gsl_path = os.environ.get("GSL_PATH", "") if gsl_path: - inc = os.path.join(gsl_path, "include") - lib = os.path.join(gsl_path, "lib") + inc = Path(gsl_path) / "include" + lib = Path(gsl_path) / "lib" else: conda_prefix = os.environ.get("CONDA_PREFIX") if conda_prefix: - inc = os.path.join(conda_prefix, "Library", "include") - lib = os.path.join(conda_prefix, "Library", "lib") + inc = Path(conda_prefix) / "Library" / "include" + lib = Path(conda_prefix) / "Library" / "lib" else: raise EnvironmentError( "Neither GSL_PATH nor CONDA_PREFIX environment variables are set. " "Please ensure GSL is installed and GSL_PATH is correctly set." ) - - return {"include_dirs": [inc], "library_dirs": [lib]} + return {"include_dirs": [str(inc)], "library_dirs": [str(lib)]} class CustomBuildExt(build_ext): def run(self): super().run() - gsl_path = os.environ.get("GSL_PATH") or os.path.join(os.environ.get("CONDA_PREFIX", ""), "Library") - - bin_path = os.path.join(gsl_path, "bin") - dest_path = os.path.join(self.build_lib, "diffpy", "pdffit2") - os.makedirs(dest_path, exist_ok=True) + gsl_path = ( + Path(os.environ.get("GSL_PATH")) + if os.environ.get("GSL_PATH") + else Path(os.environ.get("CONDA_PREFIX", "")) / "Library" + ) + bin_path = gsl_path / "bin" + dest_path = Path(self.build_lib) / "diffpy" / "pdffit2" + dest_path.mkdir(parents=True, exist_ok=True) - for dll_file in glob.glob(os.path.join(bin_path, "gsl*.dll")): - shutil.copy(dll_file, dest_path) + for dll_file in bin_path.glob("gsl*.dll"): + shutil.copy(str(dll_file), str(dest_path)) # ---------------------------------------------------------------------------- -# compile and link options -define_macros = [] +# Compile and link options os_name = os.name if os_name == "nt": gcfg = get_gsl_config_win() else: gcfg = get_gsl_config() -include_dirs = [MYDIR] + gcfg["include_dirs"] -library_dirs = [] + if sys.platform == "darwin": libraries = [] else: libraries = ["gsl"] + +include_dirs = [MYDIR] + gcfg["include_dirs"] +library_dirs = [] +define_macros = [] extra_objects = [] extra_compile_args = [] extra_link_args = [] + compiler_type = get_compiler_type() if compiler_type in ("unix", "cygwin", "mingw32"): extra_compile_args = ["-std=c++11", "-Wall", "-Wno-write-strings", "-O3", "-funroll-loops", "-ffast-math"] @@ -129,7 +128,7 @@ def run(self): library_dirs += gcfg["library_dirs"] # add optimization flags for other compilers if needed -# define extension arguments here +# Define extension arguments ext_kws = { "include_dirs": include_dirs, "libraries": libraries, @@ -141,7 +140,7 @@ def run(self): } -# define extension here +# Define extensions def create_extensions(): ext = Extension("diffpy.pdffit2.pdffit2", glob.glob("src/extensions/**/*.cc"), **ext_kws) return [ext] From 18dd3b09fb60e93962615c4451d07f4db6541b22 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Tue, 7 Jan 2025 20:48:11 -0500 Subject: [PATCH 201/294] refactor: remove six --- requirements/conda.txt | 1 - requirements/pip.txt | 1 - src/diffpy/pdffit2/pdffit.py | 36 +++++++++++++++++------------------- tests/conftest.py | 4 ++-- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/requirements/conda.txt b/requirements/conda.txt index 33133cd6..9cc306b0 100644 --- a/requirements/conda.txt +++ b/requirements/conda.txt @@ -1,2 +1 @@ diffpy.structure -six diff --git a/requirements/pip.txt b/requirements/pip.txt index 33133cd6..9cc306b0 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,2 +1 @@ diffpy.structure -six diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py index 11f6f253..aaeeedda 100644 --- a/src/diffpy/pdffit2/pdffit.py +++ b/src/diffpy/pdffit2/pdffit.py @@ -20,8 +20,6 @@ import itertools import numbers -import six - # Load pdffit2 and output modules to the current namespace. # Note that "import diffpy.pdffit2.output as output" would # crash with AttributeError when executed during imports of @@ -213,7 +211,7 @@ def read_data(self, data, stype, qmax, qdamp): Raises: IOError when the file cannot be read from disk """ - pdffit2.read_data(self._handle, data, six.b(stype), qmax, qdamp) + pdffit2.read_data(self._handle, data, stype.encode(), qmax, qdamp) self.data_files.append(data) return @@ -228,7 +226,7 @@ def read_data_string(self, data, stype, qmax, qdamp, name=""): qdamp -- instrumental Q-resolution factor name -- tag with which to label data """ - pdffit2.read_data_string(self._handle, data, six.b(stype), qmax, qdamp, name) + pdffit2.read_data_string(self._handle, data, stype.encode(), qmax, qdamp, name) name = data self.data_files.append(name) return @@ -249,7 +247,7 @@ def read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, na Raises: ValueError when the data lists are of different length """ - pdffit2.read_data_arrays(self._handle, six.b(stype), qmax, qdamp, r_data, Gr_data, dGr_data, name) + pdffit2.read_data_arrays(self._handle, stype.encode(), qmax, qdamp, r_data, Gr_data, dGr_data, name) self.data_files.append(name) return @@ -290,7 +288,7 @@ def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): ValueError for bad input values pdffit.unassignedError when no structure has been loaded """ - pdffit2.alloc(self._handle, six.b(stype), qmax, qdamp, rmin, rmax, bin) + pdffit2.alloc(self._handle, stype.encode(), qmax, qdamp, rmin, rmax, bin) return def calc(self): @@ -495,7 +493,7 @@ def constrain(self, var, par, fcon=None): if fcon: fc = self.FCON[fcon] pdffit2.constrain_int(self._handle, var_ref, varnc, par, fc) - elif isinstance(par, six.string_types): + elif isinstance(par, str): pdffit2.constrain_str(self._handle, var_ref, varnc, par) else: pdffit2.constrain_int(self._handle, var_ref, varnc, par) @@ -674,7 +672,7 @@ def fixpar(self, par): Raises: pdffit.unassignedError when parameter has not been assigned """ - if isinstance(par, six.string_types) and par.upper() in self.selalias: + if isinstance(par, str) and par.upper() in self.selalias: par = self.selalias[par.upper()] pdffit2.fixpar(self._handle, par) return @@ -687,7 +685,7 @@ def freepar(self, par): Raises: pdffit.unassignedError when parameter has not been assigned """ - if isinstance(par, six.string_types) and par.upper() in self.selalias: + if isinstance(par, str) and par.upper() in self.selalias: par = self.selalias[par.upper()] pdffit2.freepar(self._handle, par) return @@ -722,7 +720,7 @@ def psel(self, ip): Raises: pdffit2.unassignedError if selected phase does not exist """ - if isinstance(ip, six.string_types) and ip.upper() in self.selalias: + if isinstance(ip, str) and ip.upper() in self.selalias: ip = self.selalias[ip.upper()] pdffit2.psel(self._handle, ip) return @@ -734,7 +732,7 @@ def pdesel(self, ip): Raises: pdffit2.unassignedError if selected phase does not exist """ - if isinstance(ip, six.string_types) and ip.upper() in self.selalias: + if isinstance(ip, str) and ip.upper() in self.selalias: ip = self.selalias[ip.upper()] pdffit2.pdesel(self._handle, ip) return @@ -753,7 +751,7 @@ def selectAtomType(self, ip, ijchar, symbol, flag): pdffit2.unassignedError if selected phase does not exist ValueError for invalid value of ijchar """ - pdffit2.selectAtomType(self._handle, ip, six.b(ijchar), symbol, flag) + pdffit2.selectAtomType(self._handle, ip, ijchar.encode(), symbol, flag) return def selectAtomIndex(self, ip, ijchar, aidx, flag): @@ -770,7 +768,7 @@ def selectAtomIndex(self, ip, ijchar, aidx, flag): pdffit2.unassignedError if selected phase does not exist ValueError if atom index or ijchar are invalid """ - pdffit2.selectAtomIndex(self._handle, ip, six.b(ijchar), aidx, flag) + pdffit2.selectAtomIndex(self._handle, ip, ijchar.encode(), aidx, flag) return def selectAll(self, ip, ijchar): @@ -784,7 +782,7 @@ def selectAll(self, ip, ijchar): pdffit2.unassignedError if selected phase does not exist ValueError if ijchar is invalid """ - pdffit2.selectAll(self._handle, ip, six.b(ijchar)) + pdffit2.selectAll(self._handle, ip, ijchar.encode()) return def selectNone(self, ip, ijchar): @@ -798,7 +796,7 @@ def selectNone(self, ip, ijchar): pdffit2.unassignedError if selected phase does not exist ValueError if ijchar is invalid """ - pdffit2.selectNone(self._handle, ip, six.b(ijchar)) + pdffit2.selectNone(self._handle, ip, ijchar.encode()) return def bang(self, i, j, k): @@ -963,7 +961,7 @@ def get_scat_string(self, stype): Returns: string with all scattering factors. """ - return pdffit2.get_scat_string(self._handle, six.b(stype)) + return pdffit2.get_scat_string(self._handle, stype.encode()) def get_scat(self, stype, element): """get_scat(stype, element) --> Get active scattering factor for @@ -979,7 +977,7 @@ def get_scat(self, stype, element): Raises: ValueError if element is not known. """ - rv = pdffit2.get_scat(self._handle, six.b(stype), element) + rv = pdffit2.get_scat(self._handle, stype.encode(), element) return rv def set_scat(self, stype, element, value): @@ -999,7 +997,7 @@ def set_scat(self, stype, element, value): See also reset_scat, get_scat. """ - pdffit2.set_scat(self._handle, six.b(stype), element, value) + pdffit2.set_scat(self._handle, stype.encode(), element, value) return def reset_scat(self, element): @@ -1074,7 +1072,7 @@ def lat(n): 6 <==> 'gamma' """ LatParams = {"a": 1, "b": 2, "c": 3, "alpha": 4, "beta": 5, "gamma": 6} - if isinstance(n, six.string_types): + if isinstance(n, str): n = LatParams[n] return "lat(%i)" % n diff --git a/tests/conftest.py b/tests/conftest.py index 5407f543..6a142536 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,8 +1,8 @@ +import io import json from pathlib import Path import pytest -import six import diffpy.pdffit2 import diffpy.pdffit2.output # assuming this is the correct import path @@ -39,7 +39,7 @@ def capture_output(): def _capture(f, *args, **kwargs): savestdout = diffpy.pdffit2.output.stdout - fp = six.StringIO() + fp = io.StringIO() diffpy.pdffit2.redirect_stdout(fp) try: f(*args, **kwargs) From 8ef84a7a53ad0bf4c46f23f5c2b43123c958390a Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Tue, 7 Jan 2025 20:51:26 -0500 Subject: [PATCH 202/294] add news --- news/remove_six.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/remove_six.rst diff --git a/news/remove_six.rst b/news/remove_six.rst new file mode 100644 index 00000000..668d44ce --- /dev/null +++ b/news/remove_six.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* Six dependency and py2 support + +**Fixed:** + +* + +**Security:** + +* From aec6ded3e31bbd863362888bbebe79d1547f8d80 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Tue, 7 Jan 2025 21:26:23 -0500 Subject: [PATCH 203/294] ci: use integrated wheel build and matrix test --- .../matrix-and-codecov-on-merge-to-main.yml | 65 ++------------ .github/workflows/wheel.yml | 84 ------------------- 2 files changed, 9 insertions(+), 140 deletions(-) delete mode 100644 .github/workflows/wheel.yml 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 091c71be..c1be0beb 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -11,59 +11,12 @@ on: workflow_dispatch: jobs: - coverage: - 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.pdffit2 - 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.pdffit2 and requirements - run: | - conda install --file requirements/conda.txt - conda install --file requirements/test.txt - conda install --file requirements/build.txt - 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.pdfffit2 - run: | - 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 }} + matrix-coverage: + uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 + with: + project: diffpy.pdffit2 + python_versions: "3.11, 3.12" + c_extension: true + headless: false + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml deleted file mode 100644 index be7d237d..00000000 --- a/.github/workflows/wheel.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Wheel builder - -on: - pull_request: - push: - workflow_dispatch: - -jobs: - build_wheels: - - defaults: - run: - shell: bash -l {0} - - name: Build wheel ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }} - runs-on: ${{ matrix.buildplat[0] }} - strategy: - fail-fast: false - matrix: - buildplat: - - [ubuntu-latest, manylinux_x86_64] - - [macos-13, macosx_x86_64] - - [macos-14, macosx_arm64] - - [windows-latest, win_amd64] - python: - - ["3.11", "cp311"] - - ["3.12", "cp312"] - - steps: - - name: Check out #${{ inputs.project }} - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python[0] }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python[0] }} - - - name: Build wheels for Linux - if: runner.os == 'Linux' - uses: pypa/cibuildwheel@v2.21.1 - env: - CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} - CIBW_BEFORE_BUILD: yum install -y gsl-devel && pip install -e . - with: - output-dir: wheelhouse - - - name: Build wheels for macOS - if: runner.os == 'macOS' - uses: pypa/cibuildwheel@v2.21.1 - env: - CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} - MACOSX_DEPLOYMENT_TARGET: 13.0 - CIBW_BEFORE_BUILD: brew install gsl && pip install -e . - with: - output-dir: wheelhouse - - - name: Set up conda for Windows - if: runner.os == 'Windows' - uses: conda-incubator/setup-miniconda@v3 - with: - activate-environment: gsl - auto-update-conda: true - environment-file: environment.yml - auto-activate-base: false - - - name: install gsl for Windows - if: runner.os == 'Windows' - run: | - conda config --set always_yes yes --set changeps1 no - conda install gsl - - - name: Build wheels for Windows - if: runner.os == 'Windows' - uses: pypa/cibuildwheel@v2.21.1 - env: - CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }} - CONDA_PREFIX: ${{ env.CONDA_PREFIX }} - with: - output-dir: wheelhouse - - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }} - path: ./wheelhouse/*.whl From 518ff7dfd132dd28996f573b02452cc4197fd428 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Tue, 7 Jan 2025 21:43:40 -0500 Subject: [PATCH 204/294] style: using new pcmt --- .codecov.yml | 8 +- .github/ISSUE_TEMPLATE/release_checklist.md | 13 +- .../workflows/build-wheel-release-upload.yml | 2 +- .github/workflows/check-news-item.yml | 2 +- .pre-commit-config.yaml | 38 ++-- doc/source/examples/Ni_calculation.py | 3 +- doc/source/examples/Ni_refinement.py | 2 +- setup.py | 1 - src/diffpy/__init__.py | 1 - src/diffpy/pdffit2/__init__.py | 1 - src/diffpy/pdffit2/ipy_ext.py | 4 +- src/diffpy/pdffit2/output.py | 3 +- src/diffpy/pdffit2/pdffit.py | 179 +++++++++--------- src/diffpy/pdffit2/version.py | 1 - tests/test_exceptions.py | 142 +++++++------- tests/test_pdffit.py | 59 +++--- tests/test_phase_fractions.py | 3 +- tests/test_shape_factors.py | 17 +- tests/test_version.py | 6 +- 19 files changed, 247 insertions(+), 238 deletions(-) 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/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index ba1d40ce..f2df0e96 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -12,20 +12,21 @@ 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 on 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). 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: +### PyPI/GitHub full-release preparation checklist: + - [ ] Create a new conda environment and install the rc from pypi (`pip install =??`) - [ ] License information at Pypi is verified as correct. - [ ] Docs deployed successfully to `.github.io` - [ ] Successfully run all tests, tutorial examples or do functional testing -Please let @sbillinge know that all checks are done and package is ready for full release. +Please let @sbillinge know that all checks are done and package is ready for full release. ### conda-forge release preparation checklist: @@ -33,12 +34,12 @@ Please let @sbillinge know that all checks are done and package is ready for fu - [ ] 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 +- [ ] Close any open issues on the feedstock. Reach out to @bobleesj if you have questions - [ ] let @sbillinge and @bobleesj when this is ready ### 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. +- [ ] 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 76aa3e49..c6ed1365 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -4,7 +4,7 @@ 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: diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index 7a766a5c..01849907 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/.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/source/examples/Ni_calculation.py b/doc/source/examples/Ni_calculation.py index dfd26adc..8aff35d1 100755 --- a/doc/source/examples/Ni_calculation.py +++ b/doc/source/examples/Ni_calculation.py @@ -1,7 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +"""Calculate PDF of FCC nickel. -"""Calculate PDF of FCC nickel. Save data to Ni_calculation.cgr and plot it using matplotlib. +Save data to Ni_calculation.cgr and plot it using matplotlib. """ import matplotlib.pyplot as plt diff --git a/doc/source/examples/Ni_refinement.py b/doc/source/examples/Ni_refinement.py index 8c81cf1b..67d93a3a 100755 --- a/doc/source/examples/Ni_refinement.py +++ b/doc/source/examples/Ni_refinement.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- - """Perform simple refinement of Ni structure to the experimental x-ray PDF. + Save fitted curve, refined structure and results summary. """ diff --git a/setup.py b/setup.py index afe2a0c1..5a8b756d 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # Extensions script for diffpy.pdffit2 - """PDFfit2 - real space structure refinement engine Packages: diffpy.pdffit2 diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index e1ae0400..5b3ab1b5 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -14,7 +14,6 @@ # See LICENSE.rst for license information. # ############################################################################## - """diffpy - tools for structure analysis by diffraction. Blank namespace package for module diffpy.""" diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index 61af1f1d..dc8aec45 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -14,7 +14,6 @@ # See LICENSE.rst for license information. # ############################################################################## - """PDFfit2 - real space structure refinement program.""" # WARNING: Do NOT remove the isort: off/on comments in this file. diff --git a/src/diffpy/pdffit2/ipy_ext.py b/src/diffpy/pdffit2/ipy_ext.py index 4546967e..ac2b5475 100644 --- a/src/diffpy/pdffit2/ipy_ext.py +++ b/src/diffpy/pdffit2/ipy_ext.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -"""This module defines functions within IPython session to simulate -the old pdffit2 interactive session. +"""This module defines functions within IPython session to simulate the old +pdffit2 interactive session. Usage: %load_ext diffpy.pdffit2.ipy_ext """ diff --git a/src/diffpy/pdffit2/output.py b/src/diffpy/pdffit2/output.py index 6d1247cf..f24c28e9 100644 --- a/src/diffpy/pdffit2/output.py +++ b/src/diffpy/pdffit2/output.py @@ -12,8 +12,8 @@ # See LICENSE.txt for license information. # ############################################################################## - """Take care of sending engine output to given file-like object. + The output file is stored in local module variable stdout. """ @@ -28,6 +28,7 @@ def redirect_stdout(dst): """Redirect PDFfit2 standard output to a file-like object dst. + The dst value is stored in module variable stdout. """ from diffpy.pdffit2.pdffit2 import redirect_stdout diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py index 11f6f253..4d683a90 100644 --- a/src/diffpy/pdffit2/pdffit.py +++ b/src/diffpy/pdffit2/pdffit.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """PdfFit class for fitting pdf data to a model.""" from __future__ import print_function @@ -119,12 +118,13 @@ class PdfFit(object): def _exportAll(self, namespace): """_exportAll(self, namespace) --> Export all 'public' class methods - into namespace. + into namespace. - This function allows for a module-level PdfFit object which doesn't have - to be referenced when calling a method. This function makes old (python) - scripts compatible with this class. At the top of the script, create a - pdffit object, and then call this method. Usually, namespace = locals(). + This function allows for a module-level PdfFit object which + doesn't have to be referenced when calling a method. This + function makes old (python) scripts compatible with this class. + At the top of the script, create a pdffit object, and then call + this method. Usually, namespace = locals(). """ # string aliases (var = "var") for a in itertools.chain(self.selalias, self.FCON, self.Sctp): @@ -186,8 +186,8 @@ def read_struct(self, struct): return def read_struct_string(self, struct, name=""): - """read_struct_string(struct, name = "") --> Read structure from - a string into memory. + """read_struct_string(struct, name = "") --> Read structure from a + string into memory. struct -- string containing the contents of the structure file name -- tag with which to label structure @@ -218,8 +218,8 @@ def read_data(self, data, stype, qmax, qdamp): return def read_data_string(self, data, stype, qmax, qdamp, name=""): - """read_data_string(data, stype, qmax, qdamp, name = "") --> Read - pdf data from a string into memory. + """read_data_string(data, stype, qmax, qdamp, name = "") --> Read pdf + data from a string into memory. data -- string containing the contents of the data file stype -- 'X' (xray) or 'N' (neutron) @@ -254,7 +254,7 @@ def read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, na return def pdfrange(self, iset, rmin, rmax): - """pdfrange(iset, rmin, rmax) --> Set the range of the fit. + """Pdfrange(iset, rmin, rmax) --> Set the range of the fit. iset -- data set to consider rmin -- minimum r-value of fit @@ -266,15 +266,15 @@ def pdfrange(self, iset, rmin, rmax): return def reset(self): - """reset() --> Clear all stored fit, structure, and parameter data.""" + """Reset() --> Clear all stored fit, structure, and parameter data.""" self.stru_files = [] self.data_files = [] pdffit2.reset(self._handle) return def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): - """alloc(stype, qmax, qdamp, rmin, rmax, bin) --> Allocate space - for a PDF calculation. + """Alloc(stype, qmax, qdamp, rmin, rmax, bin) --> Allocate space for a + PDF calculation. The structure from which to calculate the PDF must first be imported with the read_struct() or read_struct_string() method. @@ -294,7 +294,7 @@ def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): return def calc(self): - """calc() --> Calculate the PDF of the imported structure. + """Calc() --> Calculate the PDF of the imported structure. Space for the calculation must first be allocated with the alloc() method. @@ -309,7 +309,7 @@ def calc(self): return def refine(self, toler=0.00000001): - """refine(toler = 0.00000001) --> Fit the theory to the imported data. + """Refine(toler = 0.00000001) --> Fit the theory to the imported data. toler -- tolerance of the fit @@ -433,8 +433,8 @@ def get_structure(self, ip): return stru def save_struct(self, ip, fname): - """save_struct(ip, fname) --> Save structure resulting from fit - to file. + """save_struct(ip, fname) --> Save structure resulting from fit to + file. ip -- phase to save @@ -469,7 +469,7 @@ def show_struct(self, ip): return def constrain(self, var, par, fcon=None): - """constrain(var, par[, fcon]) --> Constrain a variable to a parameter. + """Constrain(var, par[, fcon]) --> Constrain a variable to a parameter. A variable can be constrained to a number or equation string. var -- variable to constrain, such as x(1) @@ -502,7 +502,7 @@ def constrain(self, var, par, fcon=None): return def setpar(self, par, val): - """setpar(par, val) --> Set value of constrained parameter. + """Setpar(par, val) --> Set value of constrained parameter. val -- Either a numerical value or a reference to a variable @@ -521,7 +521,7 @@ def setpar(self, par, val): return def setvar(self, var, val): - """setvar(var, val) --> Set the value of a variable. + """Setvar(var, val) --> Set the value of a variable. Raises: pdffit2.unassignedError if variable does not yet exist @@ -532,7 +532,7 @@ def setvar(self, var, val): return def getvar(self, var): - """getvar(var) --> Get stored value of a variable. + """Getvar(var) --> Get stored value of a variable. Raises: pdffit2.unassignedError if variable does not yet exist @@ -543,9 +543,10 @@ def getvar(self, var): return retval def getrw(self): - """getrw() --> Get normalized total error of the fit rw. + """Getrw() --> Get normalized total error of the fit rw. - getrw calculates total fit error summed for all datasets in the fit. + getrw calculates total fit error summed for all datasets in the + fit. Return float. """ @@ -553,7 +554,7 @@ def getrw(self): return rw def getcrw(self): - """getcrw() --> Get cumulative Rw for the current dataset. + """Getcrw() --> Get cumulative Rw for the current dataset. Cumulative Rw is a list of Rw partial sums cost values evaluated against observed PDF data in the error sums evaluated against @@ -568,7 +569,7 @@ def getcrw(self): return crw def getR(self): - """getR() --> Get r-points used in the fit. + """GetR() --> Get r-points used in the fit. This function should only be called after data has been loaded or calculated. Before a refinement, the list of r-points will reflect the @@ -641,7 +642,8 @@ def get_atoms(self, ip=None): return rv def get_atom_types(self, ip=None): - """get_atom_types() --> Ordered unique element symbols in the structure. + """get_atom_types() --> Ordered unique element symbols in the + structure. ip -- index of phase to get the elements from (starting from 1) when ip is not given, use current phase @@ -660,14 +662,14 @@ def get_atom_types(self, ip=None): return rv def getpar(self, par): - """getpar(par) --> Get value of parameter. + """Getpar(par) --> Get value of parameter. Raises: ValueError if parameter does not exists """ return pdffit2.getpar(self._handle, par) def fixpar(self, par): - """fixpar(par) --> Fix a parameter. + """Fixpar(par) --> Fix a parameter. Fixed parameters are not fitted in a refinement. Passed parameter can be 'ALL', in which case all parameters are fixed. @@ -680,7 +682,7 @@ def fixpar(self, par): return def freepar(self, par): - """freepar(par) --> Free a parameter. + """Freepar(par) --> Free a parameter. Freed parameters are fitted in a refinement. Passed parameter can be 'ALL', in which case all parameters are freed. @@ -693,7 +695,7 @@ def freepar(self, par): return def setphase(self, ip): - """setphase(ip) --> Switch to phase ip. + """Setphase(ip) --> Switch to phase ip. ip -- index of the phase starting at 1. @@ -706,7 +708,7 @@ def setphase(self, ip): return def setdata(self, iset): - """setdata(iset) --> Set the data set in focus. + """Setdata(iset) --> Set the data set in focus. iset -- integer index of data set starting at 1. @@ -716,7 +718,7 @@ def setdata(self, iset): return def psel(self, ip): - """psel(ip) --> Include phase ip in calculation of total PDF + """Psel(ip) --> Include phase ip in calculation of total PDF. psel('ALL') selects all phases for PDF calculation. @@ -728,7 +730,7 @@ def psel(self, ip): return def pdesel(self, ip): - """pdesel(ip) --> Exclude phase ip from calculation of total PDF. + """Pdesel(ip) --> Exclude phase ip from calculation of total PDF. pdesel('ALL') excludes all phases from PDF calculation. @@ -802,7 +804,7 @@ def selectNone(self, ip, ijchar): return def bang(self, i, j, k): - """bang(i, j, k) --> Show bond angle defined by atoms i, j, k. + """Bang(i, j, k) --> Show bond angle defined by atoms i, j, k. No return value. Use bond_angle() to get the result. @@ -825,9 +827,9 @@ def bang(self, i, j, k): return def bond_angle(self, i, j, k): - """bond_angle(i, j, k) --> bond angle defined by atoms i, j, k. - Angle is calculated using the shortest ji and jk lengths with - respect to periodic boundary conditions. + """bond_angle(i, j, k) --> bond angle defined by atoms i, j, k. Angle + is calculated using the shortest ji and jk lengths with respect to + periodic boundary conditions. i, j, k -- atom indices starting at 1 @@ -840,7 +842,7 @@ def bond_angle(self, i, j, k): return rv def blen(self, *args): - """blen(i, j) --> Show bond length defined by atoms i and j. + """Blen(i, j) --> Show bond length defined by atoms i and j. i -- index of the first atom starting at 1 j -- index of the second atom starting at 1 @@ -942,8 +944,8 @@ def bond_length_types(self, a1, a2, lb, ub): return rv def show_scat(self, stype): - """show_scat(stype) --> Print scattering length for all atoms in - the current phase. + """show_scat(stype) --> Print scattering length for all atoms in the + current phase. stype -- 'X' (xray) or 'N' (neutron). @@ -953,8 +955,8 @@ def show_scat(self, stype): return def get_scat_string(self, stype): - """get_scat_string(stype) --> Get string with scattering factors - of all atoms in the current phase. + """get_scat_string(stype) --> Get string with scattering factors of all + atoms in the current phase. stype -- 'X' (xray) or 'N' (neutron). @@ -966,10 +968,10 @@ def get_scat_string(self, stype): return pdffit2.get_scat_string(self._handle, six.b(stype)) def get_scat(self, stype, element): - """get_scat(stype, element) --> Get active scattering factor for - given element. If scattering factor has been changed using - set_scat the result may depend on the active phase. When no - phase has been loaded, return the standard value. + """get_scat(stype, element) --> Get active scattering factor for given + element. If scattering factor has been changed using set_scat the + result may depend on the active phase. When no phase has been loaded, + return the standard value. stype -- 'X' (xray) or 'N' (neutron). element -- case-insensitive element symbol such as "Na" or "CL" @@ -983,9 +985,9 @@ def get_scat(self, stype, element): return rv def set_scat(self, stype, element, value): - """set_scat(stype, element, value) --> Set custom scattering factor - for given element. The new scattering factor applies only for the - current phase, in other phases it keeps its default value. + """set_scat(stype, element, value) --> Set custom scattering factor for + given element. The new scattering factor applies only for the current + phase, in other phases it keeps its default value. stype -- 'X' (xray) or 'N' (neutron). element -- case-insensitive element symbol such as "Na" or "CL" @@ -1003,9 +1005,9 @@ def set_scat(self, stype, element, value): return def reset_scat(self, element): - """reset_scat(stype, element) --> Reset scattering factors for - given element to their standard values. The reset_scat applies - only for the current phase. + """reset_scat(stype, element) --> Reset scattering factors for given + element to their standard values. The reset_scat applies only for the + current phase. element -- case-insensitive element symbol such as "Na" or "CL" Raises: @@ -1063,15 +1065,11 @@ def phase_fractions(self): # Begin refinable variables. def lat(n): - """lat(n) --> Get reference to lattice variable n. + """Lat(n) --> Get reference to lattice variable n. - n can be an integer or a string representing the lattice variable. - 1 <==> 'a' - 2 <==> 'b' - 3 <==> 'c' - 4 <==> 'alpha' - 5 <==> 'beta' - 6 <==> 'gamma' + n can be an integer or a string representing the lattice + variable. 1 <==> 'a' 2 <==> 'b' 3 <==> 'c' 4 <==> 'alpha' 5 <==> + 'beta' 6 <==> 'gamma' """ LatParams = {"a": 1, "b": 2, "c": 3, "alpha": 4, "beta": 5, "gamma": 6} if isinstance(n, six.string_types): @@ -1081,25 +1079,25 @@ def lat(n): lat = staticmethod(lat) def x(i): - """x(i) --> Get reference to x-value of atom i.""" + """X(i) --> Get reference to x-value of atom i.""" return "x(%i)" % i x = staticmethod(x) def y(i): - """y(i) --> Get reference to y-value of atom i.""" + """Y(i) --> Get reference to y-value of atom i.""" return "y(%i)" % i y = staticmethod(y) def z(i): - """z(i) --> Get reference to z-value of atom i.""" + """Z(i) --> Get reference to z-value of atom i.""" return "z(%i)" % i z = staticmethod(z) def u11(i): - """u11(i) --> Get reference to U(1,1) for atom i. + """U11(i) --> Get reference to U(1,1) for atom i. U is the anisotropic thermal factor tensor. """ @@ -1108,7 +1106,7 @@ def u11(i): u11 = staticmethod(u11) def u22(i): - """u22(i) --> Get reference to U(2,2) for atom i. + """U22(i) --> Get reference to U(2,2) for atom i. U is the anisotropic thermal factor tensor. """ @@ -1117,7 +1115,7 @@ def u22(i): u22 = staticmethod(u22) def u33(i): - """u33(i) --> Get reference to U(3,3) for atom i. + """U33(i) --> Get reference to U(3,3) for atom i. U is the anisotropic thermal factor tensor. """ @@ -1126,7 +1124,7 @@ def u33(i): u33 = staticmethod(u33) def u12(i): - """u12(i) --> Get reference to U(1,2) for atom i. + """U12(i) --> Get reference to U(1,2) for atom i. U is the anisotropic thermal factor tensor. """ @@ -1135,7 +1133,7 @@ def u12(i): u12 = staticmethod(u12) def u13(i): - """u13(i) --> Get reference to U(1,3) for atom i. + """U13(i) --> Get reference to U(1,3) for atom i. U is the anisotropic thermal factor tensor. """ @@ -1144,7 +1142,7 @@ def u13(i): u13 = staticmethod(u13) def u23(i): - """u23(i) --> Get reference to U(2,3) for atom i. + """U23(i) --> Get reference to U(2,3) for atom i. U is the anisotropic thermal factor tensor. """ @@ -1153,48 +1151,49 @@ def u23(i): u23 = staticmethod(u23) def occ(i): - """occ(i) --> Get reference to occupancy of atom i.""" + """Occ(i) --> Get reference to occupancy of atom i.""" return "occ(%i)" % i occ = staticmethod(occ) def pscale(): - """pscale() --> Get reference to pscale. + """Pscale() --> Get reference to pscale. - pscale is the fraction of the total structure that the current phase - represents. + pscale is the fraction of the total structure that the current + phase represents. """ return "pscale" pscale = staticmethod(pscale) def sratio(): - """sratio() --> Get reference to sigma ratio. + """Sratio() --> Get reference to sigma ratio. - The sigma ratio determines the reduction in the Debye-Waller factor for - distances below rcut. + The sigma ratio determines the reduction in the Debye-Waller + factor for distances below rcut. """ return "sratio" sratio = staticmethod(sratio) def delta1(): - """delta1() --> Get reference to 1/R peak sharpening factor.""" + """Delta1() --> Get reference to 1/R peak sharpening factor.""" return "delta1" delta1 = staticmethod(delta1) def delta2(): - """delta2() --> Reference to (1/R^2) sharpening factor. - The phenomenological correlation constant in the Debye-Waller factor. - The (1/R^2) peak sharpening factor. + """Delta2() --> Reference to (1/R^2) sharpening factor. + + The phenomenological correlation constant in the Debye-Waller + factor. The (1/R^2) peak sharpening factor. """ return "delta2" delta2 = staticmethod(delta2) def dscale(): - """dscale() --> Get reference to dscale. + """Dscale() --> Get reference to dscale. The data scale factor. """ @@ -1203,7 +1202,7 @@ def dscale(): dscale = staticmethod(dscale) def qdamp(): - """qdamp() --> Get reference to qdamp. + """Qdamp() --> Get reference to qdamp. Qdamp controls PDF damping due to instrument Q-resolution. """ @@ -1212,7 +1211,7 @@ def qdamp(): qdamp = staticmethod(qdamp) def qbroad(): - """qbroad() --> Get reference to qbroad. + """Qbroad() --> Get reference to qbroad. Quadratic peak broadening factor. """ @@ -1221,7 +1220,7 @@ def qbroad(): qbroad = staticmethod(qbroad) def spdiameter(): - """spdiameter() --> Get reference to spdiameter (phase property). + """Spdiameter() --> Get reference to spdiameter (phase property). Diameter value for the spherical particle PDF correction. Spherical envelope is not applied when spdiameter equals 0. @@ -1231,11 +1230,11 @@ def spdiameter(): spdiameter = staticmethod(spdiameter) def stepcut(): - """stepcut() --> Get reference to stepcut (phase property). + """Stepcut() --> Get reference to stepcut (phase property). - stepcut is cutoff radius for empirical step-function PDF envelope. - stepcut can be used to approximate loss of pair correlations - in amorphous phase. stepcut cannot be refined. + stepcut is cutoff radius for empirical step-function PDF + envelope. stepcut can be used to approximate loss of pair + correlations in amorphous phase. stepcut cannot be refined. Step cutoff is not applied when stepcut equals 0. """ @@ -1244,7 +1243,7 @@ def stepcut(): stepcut = staticmethod(stepcut) def rcut(): - """rcut() --> Get reference to rcut. + """Rcut() --> Get reference to rcut. rcut is the value of r below which peak sharpening, defined by the sigma ratio (sratio), applies. rcut cannot be refined. diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 60d34a97..2ed4ab87 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/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_exceptions.py b/tests/test_exceptions.py index f2f245ce..012b76d3 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -33,15 +33,15 @@ def tearDown(self): del self.P def test_IOError(self): - """raise IOError when structure file does not exist""" + """Raise IOError when structure file does not exist.""" self.assertRaises(IOError, self.P.read_struct, "Nofile.stru") def test_structureError(self): - """raise pdffit2.structureError when structure is malformed""" + """Raise pdffit2.structureError when structure is malformed.""" self.assertRaises(pdffit2.structureError, self.P.read_struct, self.datafile("badNi.stru")) def test_structureErrorZeroVolume(self): - """raise pdffit2.structureError when unit cell volume is negative""" + """Raise pdffit2.structureError when unit cell volume is negative.""" # I don't know how to test for this, but it's in the library code self.assertRaises(pdffit2.structureError, self.P.read_struct, self.datafile("badNiZeroVolume.stru")) @@ -58,11 +58,11 @@ def tearDown(self): del self.P def test_IOError(self): - """raise IOError when data file does not exist""" + """Raise IOError when data file does not exist.""" self.assertRaises(IOError, self.P.read_data, "Nofile.dat", "X", 25.0, 0.5) def test_dataError(self): - """raise pdffit2.dataError when data has improper spacing""" + """Raise pdffit2.dataError when data has improper spacing.""" self.assertRaises(pdffit2.dataError, self.P.read_data, self.datafile("badNi.dat"), "X", 25.0, 0.5) @@ -82,25 +82,25 @@ def tearDown(self): del self.P def test_ValueError1(self): - """raise ValueError when lists are of different length""" + """Raise ValueError when lists are of different length.""" self.assertRaises( ValueError, self.P.read_data_lists, "X", self.qmax, self.qdamp, self.r_data, self.Gr_data ) def test_ValueError2(self): - """raise ValueError when qmax < 0""" + """Raise ValueError when qmax < 0.""" self.assertRaises( ValueError, self.P.read_data_lists, "X", -self.qmax, self.qdamp, self.r_data, self.Gr_data ) def test_ValueError3(self): - """raise ValueError when qdamp < 0""" + """Raise ValueError when qdamp < 0.""" self.assertRaises( ValueError, self.P.read_data_lists, "X", self.qmax, -self.qdamp, self.r_data, self.Gr_data ) def test_dataError(self): - """raise pdffit2.dataError when data has improper spacing""" + """Raise pdffit2.dataError when data has improper spacing.""" r_data = [0.1, 0.52, 0.2] self.assertRaises( pdffit2.dataError, self.P.read_data_lists, "X", self.qmax, self.qdamp, r_data, self.Gr_data @@ -122,16 +122,16 @@ def tearDown(self): del self.P def test_ValueError1(self): - """raise ValueError when iset does not exist""" + """Raise ValueError when iset does not exist.""" self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmin, self.rmax) def test_ValueError2(self): - """raise ValueError when rmax < rmin""" + """Raise ValueError when rmax < rmin.""" self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.5) self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmax, self.rmin) def test_ValueError3(self): - """raise ValueError when range outside of data""" + """Raise ValueError when range outside of data.""" self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.5) self.assertRaises(ValueError, self.P.pdfrange, self.iset, -self.rmin, self.rmax) @@ -153,37 +153,37 @@ def tearDown(self): del self.P def test_ValueError1(self): - """raise ValueError when qmax < 0""" + """Raise ValueError when qmax < 0.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", -self.qmax, self.qdamp, self.rmin, self.rmax, self.bin) def test_ValueError2(self): - """raise ValueError when qdamp < 0""" + """Raise ValueError when qdamp < 0.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, -self.qdamp, self.rmin, self.rmax, self.bin) def test_ValueError3(self): - """raise ValueError when rmin < 0""" + """Raise ValueError when rmin < 0.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, -self.rmin, self.rmax, self.bin) def test_ValueError4(self): - """raise ValueError when rmax < 0""" + """Raise ValueError when rmax < 0.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, -self.rmax, self.bin) def test_ValueError5(self): - """raise ValueError when bin < 0""" + """Raise ValueError when bin < 0.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) def test_ValueError6(self): - """raise ValueError when rmax < rmin""" + """Raise ValueError when rmax < rmin.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmax, self.rmin, self.bin) def test_ValueError7(self): - """raise ValueError when qdamp < 0""" + """Raise ValueError when qdamp < 0.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) @@ -201,7 +201,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when no space has been allocated""" + """Raise pdffit2.unassignedError when no space has been allocated.""" self.assertRaises(pdffit2.unassignedError, self.P.calc) @@ -261,14 +261,14 @@ def tearDown(self): del self.P def test_IOError(self): - """raise IOError when structure cannot be saved""" + """Raise IOError when structure cannot be saved.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 30.0, 0.05, 2, 10, 100) self.P.calc() self.assertRaises(IOError, self.P.save_pdf, 1, "nodir183160/" + self.strufile) def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" + """Raise pdffit2.unassignedError when structure is undefined.""" self.assertRaises(pdffit2.unassignedError, self.P.save_pdf, 1, self.strufile) @@ -285,7 +285,7 @@ def tearDown(self): del self.P def test_IOError(self): - """raise IOError when dif cannot be saved""" + """Raise IOError when dif cannot be saved.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 30.0, 0.05, 2, 10, 100) self.P.calc() @@ -293,7 +293,7 @@ def test_IOError(self): self.assertRaises(IOError, self.P.save_dif, 1, "nodir183160/" + self.strufile) def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" + """Raise pdffit2.unassignedError when structure is undefined.""" self.assertRaises(pdffit2.unassignedError, self.P.save_dif, 1, self.strufile) @@ -310,7 +310,7 @@ def tearDown(self): del self.P def test_IOError(self): - """raise IOError when residual file cannot be saved""" + """Raise IOError when residual file cannot be saved.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 30.0, 0.0) self.P.constrain(self.P.lat(1), 1) @@ -320,7 +320,7 @@ def test_IOError(self): self.assertRaises(IOError, self.P.save_res, "nodir183160/" + self.resfile) def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" + """Raise pdffit2.unassignedError when structure is undefined.""" self.assertRaises(pdffit2.unassignedError, self.P.save_res, self.resfile) @@ -339,12 +339,12 @@ def tearDown(self): del self.P def test_IOError(self): - """raise IOError when structure cannot be saved""" + """Raise IOError when structure cannot be saved.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(IOError, self.P.save_struct, 1, "nodir183160/" + self.strufile) def test_unassignedError(self): - """raise pdffit2.unassignedError when structure is undefined""" + """Raise pdffit2.unassignedError when structure is undefined.""" self.assertRaises(pdffit2.unassignedError, self.P.save_struct, 1, self.strufile) @@ -363,7 +363,7 @@ def tearDown(self): return def test_constraintError(self): - """raise constraintError when constraint is bad""" + """Raise constraintError when constraint is bad.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.constrain("x(1)", "junk+@1") @@ -373,12 +373,12 @@ def test_constraintError(self): return def test_unassignedError(self): - """raise pdffit2.unassignedError when variable is undefined""" + """Raise pdffit2.unassignedError when variable is undefined.""" self.assertRaises(pdffit2.unassignedError, self.P.constrain, self.P.x(1), self.par) return def test_ValueError(self): - """raise ValueError when a variable index does not exist""" + """Raise ValueError when a variable index does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.constrain, self.P.x(6), self.par) return @@ -406,11 +406,11 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when variable is undefined""" + """Raise pdffit2.unassignedError when variable is undefined.""" self.assertRaises(pdffit2.unassignedError, self.P.setvar, self.P.lat(1), self.val) def test_ValueError(self): - """raise ValueError when a variable index does not exist""" + """Raise ValueError when a variable index does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.setvar, self.P.lat(7), self.val) @@ -427,11 +427,11 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when variable is undefined""" + """Raise pdffit2.unassignedError when variable is undefined.""" self.assertRaises(pdffit2.unassignedError, self.P.getvar, self.P.pscale()) def test_ValueError(self): - """raise ValueError when a variable index does not exist""" + """Raise ValueError when a variable index does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.getvar, self.P.lat(7)) @@ -444,7 +444,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" + """Raise pdffit2.unassignedError when data does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.getR) @@ -456,7 +456,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" + """Raise pdffit2.unassignedError when data does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.getpdf_fit) @@ -468,7 +468,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" + """Raise pdffit2.unassignedError when data does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.getpdf_obs) @@ -480,7 +480,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" + """Raise pdffit2.unassignedError when data does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.getpdf_diff) @@ -492,7 +492,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" + """Raise pdffit2.unassignedError when data does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.get_atoms) @@ -508,11 +508,11 @@ def tearDown(self): del self.P def test_unassignedError1(self): - """raise pdffit2.unassignedError when parameter does not exist""" + """Raise pdffit2.unassignedError when parameter does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) def test_unassignedError2(self): - """raise pdffit2.unassignedError when parameter does not exist""" + """Raise pdffit2.unassignedError when parameter does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.constrain(self.P.lat(1), 2) self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) @@ -527,11 +527,11 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" + """Raise pdffit2.unassignedError when phase does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) def test_unassignedError2(self): - """raise pdffit2.unassignedError when phase does not exist""" + """Raise pdffit2.unassignedError when phase does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) @@ -548,11 +548,11 @@ def tearDown(self): del self.P def test_unassignedError1(self): - """raise pdffit2.unassignedError when phase does not exist""" + """Raise pdffit2.unassignedError when phase does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) def test_unassignedError2(self): - """raise pdffit2.unassignedError when phase does not exist""" + """Raise pdffit2.unassignedError when phase does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(pdffit2.unassignedError, self.P.pdesel, self.ip) @@ -571,11 +571,11 @@ def tearDown(self): del self.P def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" + """Raise pdffit2.unassignedError when set does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, self.iset, "i", "Ni", True) def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" + """Raise pdffit2.unassignedError when set does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) # selectAtomType should pass with one phase defined self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) @@ -585,7 +585,7 @@ def test_unassignedError2(self): self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, 2, "i", "Ca", True) def test_ijcharValueError(self): - """raise ValueError when ijchar is neither 'i' nor 'j'""" + """Raise ValueError when ijchar is neither 'i' nor 'j'.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.selectAtomType(self.iset, "i", "Ni", True) @@ -607,11 +607,11 @@ def tearDown(self): del self.P def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" + """Raise pdffit2.unassignedError when set does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, self.iset, "i", self.i, True) def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" + """Raise pdffit2.unassignedError when set does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) # pass for phase 1 self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) @@ -621,7 +621,7 @@ def test_unassignedError2(self): self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, 2, "i", 1, True) def test_ValueError(self): - """raise ValueError when selected atom does not exist""" + """Raise ValueError when selected atom does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(ValueError, self.P.selectAtomIndex, self.iset, "i", 6, True) @@ -641,11 +641,11 @@ def tearDown(self): del self.P def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" + """Raise pdffit2.unassignedError when set does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" + """Raise pdffit2.unassignedError when set does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) # fail when there is no dataset self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") @@ -672,11 +672,11 @@ def tearDown(self): del self.P def test_unassignedError1(self): - """raise pdffit2.unassignedError when set does not exist""" + """Raise pdffit2.unassignedError when set does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") def test_unassignedError2(self): - """raise pdffit2.unassignedError when set does not exist""" + """Raise pdffit2.unassignedError when set does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) # fail when there is no dataset self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") @@ -704,22 +704,22 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" + """Raise pdffit2.unassignedError when phase does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.bang, self.a1, self.a2, self.a3) def test_ValueError1(self): - """raise ValueError when selected atom(s) does not exist""" + """Raise ValueError when selected atom(s) does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(ValueError, self.P.bang, 0, self.a2, self.a3) def test_ValueError2(self): - """raise ValueError when selected atom(s) does not exist""" + """Raise ValueError when selected atom(s) does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.bang, self.a1, -1, self.a3) def test_ValueError3(self): - """raise ValueError when selected atom(s) does not exist""" + """Raise ValueError when selected atom(s) does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.bang, self.a1, self.a2, 6) @@ -738,21 +738,21 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when no data exists""" + """Raise pdffit2.unassignedError when no data exists.""" self.assertRaises(pdffit2.unassignedError, self.P.blen, self.a1, self.a2) def test_ValueError1(self): - """raise ValueError when selected atom(s) does not exist""" + """Raise ValueError when selected atom(s) does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.blen, 0, self.a2) def test_ValueError2(self): - """raise ValueError when selected atom(s) does not exist""" + """Raise ValueError when selected atom(s) does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.blen, self.a1, 6) def test_ValueError3(self): - """raise ValueError when selected atom(s) does not exist""" + """Raise ValueError when selected atom(s) does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.assertRaises(ValueError, self.P.blen, 0, 6) @@ -765,7 +765,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" + """Raise pdffit2.unassignedError when phase does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.show_scat, "X") @@ -796,7 +796,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when no atoms exist""" + """Raise pdffit2.unassignedError when no atoms exist.""" self.assertRaises(pdffit2.unassignedError, self.P.num_atoms) @@ -812,7 +812,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when parameter does not exist""" + """Raise pdffit2.unassignedError when parameter does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.fixpar, 1) @@ -830,7 +830,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when parameter does not exist""" + """Raise pdffit2.unassignedError when parameter does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.freepar, 1) @@ -848,7 +848,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when phase does not exist""" + """Raise pdffit2.unassignedError when phase does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.setphase, 2) @@ -866,7 +866,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when data set does not exist""" + """Raise pdffit2.unassignedError when data set does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.setdata, 2) @@ -880,7 +880,7 @@ def tearDown(self): del self.P def test_unassignedError(self): - """raise pdffit2.unassignedError when data does not exist""" + """Raise pdffit2.unassignedError when data does not exist.""" self.assertRaises(pdffit2.unassignedError, self.P.getcrw) diff --git a/tests/test_pdffit.py b/tests/test_pdffit.py index 68c06833..508f29f5 100644 --- a/tests/test_pdffit.py +++ b/tests/test_pdffit.py @@ -1,7 +1,6 @@ #!/usr/bin/env python -"""Unit tests for PdfFit.py -""" +"""Unit tests for PdfFit.py.""" import unittest @@ -47,7 +46,7 @@ def test__exportAll(self): # return def test_add_structure(self): - """check PdfFit.add_structure()""" + """Check PdfFit.add_structure()""" ni = loadStructure(self.datafile("Ni.stru")) self.P.add_structure(ni) self.assertEqual(4, self.P.num_atoms()) @@ -69,7 +68,7 @@ def test_add_structure(self): # return def test_read_data_string(self): - """check PdfFit.read_data_string()""" + """Check PdfFit.read_data_string()""" pf = self.P with open(self.datafile("300K.gr")) as fp: s = fp.read() @@ -98,7 +97,7 @@ def test_read_data_string(self): # return def test_alloc(self): - """check PdfFit.alloc()""" + """Check PdfFit.alloc()""" # alloc and read_struct can be called in any order. self.P.alloc("X", 25, 0.0, 0.01, 10, 1000) # without a structure calculated PDF is all zero @@ -169,7 +168,7 @@ def test_alloc(self): # return def test_get_structure(self): - """check PdfFit.get_structure()""" + """Check PdfFit.get_structure()""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_struct(self.datafile("PbScW25TiO3.stru")) stru1 = self.P.get_structure(1) @@ -201,7 +200,7 @@ def test_get_structure(self): # return def test_setpar(self): - """check PdfFit.setpar()""" + """Check PdfFit.setpar()""" pf = self.P pf.read_struct(self.datafile("Ni.stru")) pf.setpar(1, "lat(1)") @@ -213,7 +212,7 @@ def test_setpar(self): return def test_setvar(self): - """check PdfFit.setvar()""" + """Check PdfFit.setvar()""" pf = self.P pf.read_struct(self.datafile("Ni.stru")) pf.setvar(pf.delta1, 1.2) @@ -253,7 +252,7 @@ def test_setvar(self): # return def test_get_atoms(self): - """check PdfFit.get_atoms()""" + """Check PdfFit.get_atoms()""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.setphase(1) @@ -264,7 +263,7 @@ def test_get_atoms(self): return def test_get_atom_types(self): - """check PdfFit.get_atom_types()""" + """Check PdfFit.get_atom_types()""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_struct(self.datafile("PbScW25TiO3.stru")) self.P.setphase(1) @@ -275,7 +274,7 @@ def test_get_atom_types(self): return def test_num_phases(self): - """check PdfFit.num_phases()""" + """Check PdfFit.num_phases()""" self.assertEqual(0, self.P.num_phases()) self.P.read_struct(self.datafile("Ni.stru")) self.assertEqual(1, self.P.num_phases()) @@ -286,7 +285,7 @@ def test_num_phases(self): return def test_num_datasets(self): - """check PdfFit.num_datasets()""" + """Check PdfFit.num_datasets()""" self.assertEqual(0, self.P.num_datasets()) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.5) self.assertEqual(1, self.P.num_datasets()) @@ -306,7 +305,7 @@ def test_num_datasets(self): return def test_getcrw(self): - """check PdfFit.getcrw()""" + """Check PdfFit.getcrw()""" import numpy self.assertEqual(0, self.P.num_datasets()) @@ -339,7 +338,7 @@ def test_getcrw(self): return def test_getcrw_two_datasets(self): - """check that getcrw() and getrw() are consistent for two datasets.""" + """Check that getcrw() and getrw() are consistent for two datasets.""" self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.pdfrange(1, 2, 8) self.P.read_data(self.datafile("300K.gr"), "N", 32.0, 0.0) @@ -365,13 +364,13 @@ def test_getcrw_two_datasets(self): # return def test_fixpar(self): - """check PdfFit.fixpar()""" + """Check PdfFit.fixpar()""" self.P.fixpar("all") self.assertRaises(TypeError, self.P.fixpar, "x") return def test_freepar(self): - """check PdfFit.freepar()""" + """Check PdfFit.freepar()""" self.P.freepar("all") self.assertRaises(TypeError, self.P.freepar, "x") return @@ -387,7 +386,7 @@ def test_freepar(self): # return # def test_psel(self): - """check PdfFit.psel()""" + """Check PdfFit.psel()""" def doalloc(): self.P.alloc("X", 30.0, 0.05, 2, 10, 100) @@ -427,7 +426,7 @@ def doalloc(): return def test_pdesel(self): - """check PdfFit.pdesel()""" + """Check PdfFit.pdesel()""" def doalloc(): self.P.alloc("X", 30.0, 0.05, 2, 10, 100) @@ -487,7 +486,7 @@ def doalloc(): # return def test_bond_angle(self): - """check PdfFit.bond_angle()""" + """Check PdfFit.bond_angle()""" self.P.read_struct(self.datafile("Ni.stru")) a, e = self.P.bond_angle(1, 2, 3) self.assertAlmostEqual(60.0, a, self.places) @@ -504,7 +503,7 @@ def test_bang(self): return def test_bond_length_atoms(self): - """check PdfFit.bond_length_atoms()""" + """Check PdfFit.bond_length_atoms()""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_struct(self.datafile("PbScW25TiO3.stru")) dij, ddij = self.P.bond_length_atoms(1, 5) @@ -514,7 +513,7 @@ def test_bond_length_atoms(self): return def test_bond_length_types(self): - """check PdfFit.bond_length_types()""" + """Check PdfFit.bond_length_types()""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_struct(self.datafile("PbScW25TiO3.stru")) dPbO = self.P.bond_length_types("Pb", "O", 0.1, 3.0) @@ -556,7 +555,7 @@ def test_bond_length_types(self): return def test_blen(self): - """check PdfFit.blen()""" + """Check PdfFit.blen()""" self.P.read_struct(self.datafile("PbScW25TiO3.stru")) blen = self.P.blen o = self.capture_output(blen, 1, 5).strip() @@ -587,7 +586,7 @@ def test_blen(self): # return def test_get_scat(self): - """check PdfFit.get_scat()""" + """Check PdfFit.get_scat()""" # x-ray scattering factors fPb = self.P.get_scat("X", "Pb") self.assertEqual(82.0, fPb) @@ -604,7 +603,7 @@ def test_get_scat(self): return def test_set_scat(self): - """check PdfFit.set_scat()""" + """Check PdfFit.set_scat()""" # raises exception when no phase exists self.assertRaises(pdffit2.unassignedError, self.P.set_scat, "N", "Ti", -11) # check if it is local to phase @@ -626,7 +625,7 @@ def test_set_scat(self): return def test_reset_scat(self): - """check PdfFit.reset_scat()""" + """Check PdfFit.reset_scat()""" # raises exception when no phase exists self.assertRaises(pdffit2.unassignedError, self.P.reset_scat, "Ti") # check if it is local to phase @@ -649,7 +648,7 @@ def test_reset_scat(self): return def test_num_atoms(self): - """check PdfFit.num_atoms()""" + """Check PdfFit.num_atoms()""" self.P.read_struct(self.datafile("Ni.stru")) self.assertEqual(4, self.P.num_atoms()) self.P.read_struct(self.datafile("PbScW25TiO3.stru")) @@ -661,7 +660,7 @@ def test_num_atoms(self): return def test_lat(self): - """check PdfFit.lat()""" + """Check PdfFit.lat()""" pf = self.P pf.read_struct(self.datafile("Ni.stru")) for i in ("a", "b", "c", 1, 2, 3): @@ -671,7 +670,7 @@ def test_lat(self): return def test_xyz(self): - """check PdfFit.x() PdfFit.y(), PdfFit.z()""" + """Check PdfFit.x() PdfFit.y(), PdfFit.z()""" pf = self.P pf.read_struct(self.datafile("Ni.stru")) self.assertEqual(0.5, pf.getvar(pf.x(3))) @@ -680,7 +679,7 @@ def test_xyz(self): return def test_uij(self): - """check PdfFit.uij()""" + """Check PdfFit.uij()""" ni = loadStructure(self.datafile("Ni.stru")) ni[2].anisotropy = True ni[2].U11, ni[2].U22, ni[2].U33 = 1, 2, 3 @@ -696,7 +695,7 @@ def test_uij(self): return def test_occ(self): - """check PdfFit.occ()""" + """Check PdfFit.occ()""" pf = self.P pf.read_struct(self.datafile("Ni.stru")) for i in range(1, 5): diff --git a/tests/test_phase_fractions.py b/tests/test_phase_fractions.py index d4df1c60..62c9c8e5 100644 --- a/tests/test_phase_fractions.py +++ b/tests/test_phase_fractions.py @@ -1,7 +1,6 @@ #!/usr/bin/env python -"""Unit tests for phase fraction calculations. -""" +"""Unit tests for phase fraction calculations.""" import unittest diff --git a/tests/test_shape_factors.py b/tests/test_shape_factors.py index dd0a0e9c..62d13844 100644 --- a/tests/test_shape_factors.py +++ b/tests/test_shape_factors.py @@ -1,7 +1,6 @@ #!/usr/bin/env python -"""Unit tests for particle shape envelope factors. -""" +"""Unit tests for particle shape envelope factors.""" import unittest @@ -13,7 +12,7 @@ def spherefactor(r, d): - """Calculate spherical envelope correction + """Calculate spherical envelope correction. r -- PDF radius d -- diameter of spherical particle @@ -44,7 +43,7 @@ def tearDown(self): return def test_calculation(self): - """check calculation of sphere envelope factor""" + """Check calculation of sphere envelope factor.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.calc() @@ -60,7 +59,7 @@ def test_calculation(self): return def test_refinement(self): - """check refinement of sphere envelope factor""" + """Check refinement of sphere envelope factor.""" dcheck = 8.0 dstart = 12.0 self.P.read_struct(self.datafile("Ni.stru")) @@ -83,7 +82,7 @@ def test_refinement(self): return def test_twophase_calculation(self): - """check PDF calculation for 2 phases with different spdiameters""" + """Check PDF calculation for 2 phases with different spdiameters.""" d1 = 6 d2 = 9 self.P.read_struct(self.datafile("Ni.stru")) @@ -114,7 +113,7 @@ def test_twophase_calculation(self): return def test_twophase_refinement(self): - """check PDF refinement of 2 phases that have different spdiameter.""" + """Check PDF refinement of 2 phases that have different spdiameter.""" dcheck1 = 8.0 dstart1 = 8.2 dcheck2 = 6.0 @@ -199,7 +198,7 @@ def tearDown(self): return def test_stepcut_calculation(self): - """check calculation of sphere envelope factor""" + """Check calculation of sphere envelope factor.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 0.0, 0.05, 0.1, 10, 200) self.P.calc() @@ -216,7 +215,7 @@ def test_stepcut_calculation(self): return def test_twophase_stepcut_calculation(self): - """check PDF calculation for 2 phases with different spdiameters""" + """Check PDF calculation for 2 phases with different spdiameters.""" d1 = 6 d2 = 9 self.P.read_struct(self.datafile("Ni.stru")) diff --git a/tests/test_version.py b/tests/test_version.py index e3ac3668..b9b25b07 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.pdffit2 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.pdffit2, "__version__") assert diffpy.pdffit2.__version__ != "0.0.0" From b1e694429c9a435d502f8f561ca0395fc1e16ee2 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Tue, 7 Jan 2025 21:50:01 -0500 Subject: [PATCH 205/294] more pcmt --- .github/workflows/matrix-and-codecov-on-merge-to-main.yml | 2 +- .github/workflows/wheel.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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 091c71be..f9edf589 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -23,7 +23,7 @@ jobs: os: [ubuntu-latest, windows-latest, macos-13, macos-14] python-version: ["3.11", "3.12"] env: - LATEST_PYTHON_VERSION: "3.12" + LATEST_PYTHON_VERSION: "3.12" steps: - name: Check out diffpy.pdffit2 uses: actions/checkout@v4 diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index be7d237d..48bca0d4 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -7,10 +7,9 @@ on: jobs: build_wheels: - defaults: - run: - shell: bash -l {0} + run: + shell: bash -l {0} name: Build wheel ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }} runs-on: ${{ matrix.buildplat[0] }} From 3f64916e43d50d12db8f1e3005e9a0ce766c4e0c Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Tue, 7 Jan 2025 21:51:41 -0500 Subject: [PATCH 206/294] add news --- news/wf.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/wf.rst diff --git a/news/wf.rst b/news/wf.rst new file mode 100644 index 00000000..622844e0 --- /dev/null +++ b/news/wf.rst @@ -0,0 +1,23 @@ +**Added:** + +* no news: modification on CI workflow + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 3c42e8c71df6563d8099d691133e029615fc23f1 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Tue, 7 Jan 2025 21:52:42 -0500 Subject: [PATCH 207/294] add news --- news/pcmt.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/pcmt.rst diff --git a/news/pcmt.rst b/news/pcmt.rst new file mode 100644 index 00000000..0c23f0f0 --- /dev/null +++ b/news/pcmt.rst @@ -0,0 +1,23 @@ +**Added:** + +* no news: precommit and style check + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 3d40d9ba6c91c41b7811f00fe6e2e017489f07a4 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Wed, 8 Jan 2025 13:55:15 -0500 Subject: [PATCH 208/294] Revert "more pcmt" This reverts commit b1e694429c9a435d502f8f561ca0395fc1e16ee2. --- .github/workflows/matrix-and-codecov-on-merge-to-main.yml | 2 +- .github/workflows/wheel.yml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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 f9edf589..091c71be 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -23,7 +23,7 @@ jobs: os: [ubuntu-latest, windows-latest, macos-13, macos-14] python-version: ["3.11", "3.12"] env: - LATEST_PYTHON_VERSION: "3.12" + LATEST_PYTHON_VERSION: "3.12" steps: - name: Check out diffpy.pdffit2 uses: actions/checkout@v4 diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 48bca0d4..be7d237d 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -7,9 +7,10 @@ on: jobs: build_wheels: + defaults: - run: - shell: bash -l {0} + run: + shell: bash -l {0} name: Build wheel ${{ matrix.python[0] }}-${{ matrix.buildplat[0] }} runs-on: ${{ matrix.buildplat[0] }} From d612b7c8a734f08a2cac6e6edbec496b37aea16d Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 9 Jan 2025 20:56:37 -0500 Subject: [PATCH 209/294] fix: correct release date --- src/diffpy/pdffit2/version.py | 45 +++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 2ed4ab87..afe31d84 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -14,15 +14,46 @@ ############################################################################## """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 datetime +from importlib.metadata import distribution, version +from pathlib import Path +import urllib.request +import json + + +def get_pypi_release_date(package_name, timeout=5): + package_file = Path(__file__).resolve() + + try: + with open(package_file, "r", encoding="utf-8") as f: + lines = f.readlines() + for line in reversed(lines): + if line.startswith("# Release date:"): + return line.split(":", 1)[1].strip() + + url = f"https://pypi.org/pypi/{package_name}/json" + with urllib.request.urlopen(url, timeout=timeout) as response: + data = json.loads(response.read().decode('utf-8')) + + installed_version = version(package_name) + release_data = data["releases"].get(installed_version, []) + if not release_data: + raise ValueError(f"No release data found for version {installed_version}") + + release_date_str = release_data[-1]["upload_time"] + release_date = datetime.datetime.fromisoformat(release_date_str).date() + + with open(package_file, "a", encoding="utf-8") as f: + f.write(f"\n# Release date: {release_date}") + + except (ValueError, OSError) as e: + print(f"Warning: Could not fetch release date from PyPI: {e}") + release_date = datetime.datetime.fromtimestamp(package_file.stat().st_ctime).isoformat() + + return str(release_date) -# obtain version information -from importlib.metadata import version __version__ = version("diffpy.pdffit2") -__date__ = __all__[0] -__git_commit__ = __all__[1] -__timestamp__ = __all__[2] +__date__ = get_pypi_release_date("diffpy.pdffit2") # End of file From 19d4a8364556f1de9764c9f13f5c8a51ca1fa808 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 9 Jan 2025 21:14:59 -0500 Subject: [PATCH 210/294] pcmt --- src/diffpy/pdffit2/version.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index afe31d84..9cf65758 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -15,10 +15,10 @@ """Definition of __version__.""" import datetime +import json +import urllib.request from importlib.metadata import distribution, version from pathlib import Path -import urllib.request -import json def get_pypi_release_date(package_name, timeout=5): @@ -33,7 +33,7 @@ def get_pypi_release_date(package_name, timeout=5): url = f"https://pypi.org/pypi/{package_name}/json" with urllib.request.urlopen(url, timeout=timeout) as response: - data = json.loads(response.read().decode('utf-8')) + data = json.loads(response.read().decode("utf-8")) installed_version = version(package_name) release_data = data["releases"].get(installed_version, []) From 07bfe2ce0b5faa3363a4105c1f028e7525bd6e22 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 9 Jan 2025 21:16:25 -0500 Subject: [PATCH 211/294] more pcmt --- src/diffpy/pdffit2/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 9cf65758..6847d8e4 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -17,7 +17,7 @@ import datetime import json import urllib.request -from importlib.metadata import distribution, version +from importlib.metadata import version from pathlib import Path From 22f4f123a3102e7f03d7f9a68b8d2d9b8bdc912a Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 9 Jan 2025 21:20:53 -0500 Subject: [PATCH 212/294] feat: add option to skip copyright header --- src/diffpy/pdffit2/pdffit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py index 392ef078..1ecd6ae9 100644 --- a/src/diffpy/pdffit2/pdffit.py +++ b/src/diffpy/pdffit2/pdffit.py @@ -1252,13 +1252,14 @@ def rcut(): # End refinable variables. - def __init__(self): + def __init__(self, intro=True): self.stru_files = [] self.data_files = [] self._handle = pdffit2.create() - self.intro() + if intro: + self.intro() return def __getRef(self, var_string): From a1531a00e99fdf5ad082046b5185cd9500396de9 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Fri, 10 Jan 2025 21:25:48 -0500 Subject: [PATCH 213/294] add news --- news/date.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/date.rst diff --git a/news/date.rst b/news/date.rst new file mode 100644 index 00000000..7f556beb --- /dev/null +++ b/news/date.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fix missing `__date__`, use PyPI release date. + +**Security:** + +* From ee05250d754e0a456ee871e928c10826bb4e144a Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Fri, 10 Jan 2025 22:40:43 -0500 Subject: [PATCH 214/294] add PdfFit class __init__ docstring and tests --- src/diffpy/pdffit2/pdffit.py | 17 +++++- tests/test_pdffit.py | 111 +++++++++++++++++++---------------- 2 files changed, 78 insertions(+), 50 deletions(-) diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py index 1ecd6ae9..383fbac0 100644 --- a/src/diffpy/pdffit2/pdffit.py +++ b/src/diffpy/pdffit2/pdffit.py @@ -104,7 +104,6 @@ def _convertCallable(var): class PdfFit(object): - """Create PdfFit object.""" # constants and enumerators from pdffit.h: # selection of all atoms @@ -1253,6 +1252,22 @@ def rcut(): # End refinable variables. def __init__(self, intro=True): + """Initialize the Pdffit class, create a new PdfFit object. + + Parameters + ---------- + intro : bool, optional + If True, display an introduction message. Default is True. + + Attributes + ---------- + stru_files : list + A list to store structure files. + data_files : list + A list to store data files. + _handle : PyCapsule + A python capsules to retrieve the printer to PdfFit object. + """ self.stru_files = [] self.data_files = [] diff --git a/tests/test_pdffit.py b/tests/test_pdffit.py index 508f29f5..a5085cc3 100644 --- a/tests/test_pdffit.py +++ b/tests/test_pdffit.py @@ -702,56 +702,69 @@ def test_occ(self): self.assertEqual(1, pf.getvar(pf.occ(i))) return + # def test_pscale(self): + # """check PdfFit.pscale() + # """ + # return + # + # def test_pscale(self): + # """check PdfFit.pscale() + # """ + # return + # + # def test_sratio(self): + # """check PdfFit.sratio() + # """ + # return + # + # def test_delta1(self): + # """check PdfFit.delta1() + # """ + # return + # + # def test_delta2(self): + # """check PdfFit.delta2() + # """ + # return + # + # def test_dscale(self): + # """check PdfFit.dscale() + # """ + # return + # + # def test_qdamp(self): + # """check PdfFit.qdamp() + # """ + # return + # + # def test_qbroad(self): + # """check PdfFit.qbroad() + # """ + # return + # + # def test_rcut(self): + # """check PdfFit.rcut() + # """ + # return + # + + def test___init__(self): + """Check PdfFit.__init__()""" + P = PdfFit() + self.assertEqual([], P.stru_files) + self.assertEqual([], P.data_files) + + output_true = self.capture_output(PdfFit, intro=True).strip() + output_false = self.capture_output(PdfFit, intro=False).strip() + + import diffpy.pdffit2.pdffit as pdffit + + self.assertEqual(len(output_true), len(pdffit.__intro_message__.strip())) + self.assertEqual(len(output_false), 0) + + return + -# def test_pscale(self): -# """check PdfFit.pscale() -# """ -# return -# -# def test_pscale(self): -# """check PdfFit.pscale() -# """ -# return -# -# def test_sratio(self): -# """check PdfFit.sratio() -# """ -# return -# -# def test_delta1(self): -# """check PdfFit.delta1() -# """ -# return -# -# def test_delta2(self): -# """check PdfFit.delta2() -# """ -# return -# -# def test_dscale(self): -# """check PdfFit.dscale() -# """ -# return -# -# def test_qdamp(self): -# """check PdfFit.qdamp() -# """ -# return -# -# def test_qbroad(self): -# """check PdfFit.qbroad() -# """ -# return -# -# def test_rcut(self): -# """check PdfFit.rcut() -# """ -# return -# -# def test___init__(self): -# """check PdfFit.__init__() -# """ -# return # # def test__PdfFit__getRef(self): # """check PdfFit._PdfFit__getRef() From 6b413a19b298e70e625f3e9bccc0c139391710b6 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Fri, 10 Jan 2025 22:45:58 -0500 Subject: [PATCH 215/294] add news --- news/intro.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/intro.rst diff --git a/news/intro.rst b/news/intro.rst new file mode 100644 index 00000000..0d3f259e --- /dev/null +++ b/news/intro.rst @@ -0,0 +1,23 @@ +**Added:** + +* Add skip intro option when initializing the `PdfFit` class, with related docstrings and tests. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 93c88be938441a24eb2a0985db5d8f4553867a4d Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Sat, 11 Jan 2025 05:36:36 -0500 Subject: [PATCH 216/294] Simon's tweak to news. --- news/intro.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/intro.rst b/news/intro.rst index 0d3f259e..d0a911b3 100644 --- a/news/intro.rst +++ b/news/intro.rst @@ -1,6 +1,6 @@ **Added:** -* Add skip intro option when initializing the `PdfFit` class, with related docstrings and tests. +* Option to skip printing of introductory information when initializing the `PdfFit` class. **Changed:** From 537f9e94d5b2283bb81950c395550e3235adf0a1 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sat, 11 Jan 2025 21:31:37 -0500 Subject: [PATCH 217/294] perf: improve gsl linking --- setup.py | 137 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 91 insertions(+), 46 deletions(-) diff --git a/setup.py b/setup.py index 5a8b756d..504267bd 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def get_compiler_type(): - """Find compiler used for building extensions.""" + """Return the compiler type used during the build.""" cc_arg = [a for a in sys.argv if a.startswith("--compiler=")] if cc_arg: return cc_arg[-1].split("=", 1)[1] @@ -38,48 +38,97 @@ def get_compiler_type(): def get_gsl_config(): - """Return dictionary with paths to GSL library.""" - gslcfgpaths = [Path(p) / "gsl-config" for p in ([MYDIR] + os.environ["PATH"].split(os.pathsep))] - gslcfgpaths = [p for p in gslcfgpaths if p.is_file()] + """ + Determine the GSL include and library directories by trying in order: + 1) CONDA_PREFIX, + 2) GSL_PATH, + 3) gsl-config (for Unix-like systems). + Raises EnvironmentError if none are found. + """ rv = {"include_dirs": [], "library_dirs": []} - if not gslcfgpaths: - warnings.warn(f"Cannot find gsl-config in {MYDIR} nor in system PATH.") - return rv - gslcfg = gslcfgpaths[0] - txt = gslcfg.read_text() - mprefix = re.search(r"(?m)^prefix=(.+)", txt) - minclude = re.search(r"(?m)^[^#]*\s-I(\S+)", txt) - mlibpath = re.search(r"(?m)^[^#]*\s-L(\S+)", txt) - if not mprefix: - raise RuntimeError(f"Cannot find 'prefix=' line in {gslcfg}.") - p = Path(mprefix.group(1)) - rv["include_dirs"].append(str(minclude.group(1) if minclude else p / "include")) - rv["library_dirs"].append(str(mlibpath.group(1) if mlibpath else p / "lib")) - return rv - - -def get_gsl_config_win(): - """Return dictionary with paths to GSL library on Windows.""" + + # 1. Check using CONDA_PREFIX. + conda_prefix = os.environ.get("CONDA_PREFIX", "") + if conda_prefix: + if os.name == "nt": + inc = Path(conda_prefix) / "Library" / "include" + lib = Path(conda_prefix) / "Library" / "lib" + else: + inc = Path(conda_prefix) / "include" + lib = Path(conda_prefix) / "lib" + if inc.is_dir() and lib.is_dir(): + rv["include_dirs"].append(str(inc)) + rv["library_dirs"].append(str(lib)) + return rv + else: + warnings.warn( + f"CONDA_PREFIX is set to {conda_prefix}, " "but GSL not found at those paths. Proceeding..." + ) + + # 2. Check using GSL_PATH. gsl_path = os.environ.get("GSL_PATH", "") if gsl_path: inc = Path(gsl_path) / "include" lib = Path(gsl_path) / "lib" - else: - conda_prefix = os.environ.get("CONDA_PREFIX") - if conda_prefix: - inc = Path(conda_prefix) / "Library" / "include" - lib = Path(conda_prefix) / "Library" / "lib" + if inc.is_dir() and lib.is_dir(): + rv["include_dirs"].append(str(inc)) + rv["library_dirs"].append(str(lib)) + return rv else: raise EnvironmentError( - "Neither GSL_PATH nor CONDA_PREFIX environment variables are set. " - "Please ensure GSL is installed and GSL_PATH is correctly set." + f"GSL_PATH={gsl_path} is set, but {inc} or {lib} not found. " "Please verify your GSL_PATH." ) - return {"include_dirs": [str(inc)], "library_dirs": [str(lib)]} + + # 3. Try using the gsl-config executable (only on Unix-like systems). + if os.name != "nt": + path_dirs = os.environ.get("PATH", "").split(os.pathsep) + gslcfg_paths = [Path(p) / "gsl-config" for p in path_dirs if p] + gslcfg_paths = [p for p in gslcfg_paths if p.is_file()] + if gslcfg_paths: + gslcfg = gslcfg_paths[0] + txt = gslcfg.read_text() + prefix_match = re.search(r"(?m)^prefix=(.+)", txt) + include_match = re.search(r"(?m)^[^#]*\s-I(\S+)", txt) + lib_match = re.search(r"(?m)^[^#]*\s-L(\S+)", txt) + if prefix_match: + prefix_path = Path(prefix_match.group(1)) + inc_dir = include_match.group(1) if include_match else (prefix_path / "include") + lib_dir = lib_match.group(1) if lib_match else (prefix_path / "lib") + rv["include_dirs"].append(str(inc_dir)) + rv["library_dirs"].append(str(lib_dir)) + return rv + else: + raise RuntimeError(f"Cannot parse 'prefix=' from {gslcfg}.") + else: + warnings.warn( + "No gsl-config found in PATH. GSL may not be installed or not in PATH. " + "Proceeding without GSL configuration." + ) + + # 4. Nothing found: raise error. + raise EnvironmentError( + "Unable to locate GSL:\n" + "1) CONDA_PREFIX not set or no GSL there\n" + "2) GSL_PATH not set or invalid\n" + "3) gsl-config not available\n" + "Please set GSL_PATH or use a conda environment with GSL." + ) class CustomBuildExt(build_ext): def run(self): + # Retrieve the GSL library directories and append them to each extension. + gsl_cfg = get_gsl_config() + lib_dirs = gsl_cfg.get("library_dirs", []) + for ext in self.extensions: + # Add gsl lib for linking. + ext.library_dirs.extend(lib_dirs) + # Embed RPATH flags, runtime linking without LD_LIBRARY_PATH. + ext.extra_link_args = ext.extra_link_args or [] + for lib in lib_dirs: + ext.extra_link_args.append(f"-Wl,-rpath,{lib}") super().run() + # Avoid dll error gsl_path = ( Path(os.environ.get("GSL_PATH")) if os.environ.get("GSL_PATH") @@ -88,46 +137,44 @@ def run(self): bin_path = gsl_path / "bin" dest_path = Path(self.build_lib) / "diffpy" / "pdffit2" dest_path.mkdir(parents=True, exist_ok=True) - for dll_file in bin_path.glob("gsl*.dll"): shutil.copy(str(dll_file), str(dest_path)) -# ---------------------------------------------------------------------------- +# Compile and link options---------------------------------------------------- -# Compile and link options os_name = os.name -if os_name == "nt": - gcfg = get_gsl_config_win() -else: - gcfg = get_gsl_config() +gcfg = get_gsl_config() +# On macOS, dynamic linking may not be needed if sys.platform == "darwin": libraries = [] else: libraries = ["gsl"] include_dirs = [MYDIR] + gcfg["include_dirs"] -library_dirs = [] +library_dirs = gcfg["library_dirs"] define_macros = [] extra_objects = [] extra_compile_args = [] extra_link_args = [] - compiler_type = get_compiler_type() if compiler_type in ("unix", "cygwin", "mingw32"): extra_compile_args = ["-std=c++11", "-Wall", "-Wno-write-strings", "-O3", "-funroll-loops", "-ffast-math"] - extra_objects += [ + # Check for static GSL libraries and add them if found. + static_libs = [ os.path.join(p, "libgsl.a") for p in gcfg["library_dirs"] if os.path.isfile(os.path.join(p, "libgsl.a")) ] + if static_libs: + extra_objects += static_libs + # Use static linking: remove "-lgsl" to avoid dynamic linking conflicts. + libraries = [] elif compiler_type == "msvc": define_macros += [("_USE_MATH_DEFINES", None)] extra_compile_args = ["/EHs"] - library_dirs += gcfg["library_dirs"] -# add optimization flags for other compilers if needed -# Define extension arguments +# Extension keyword arguments. ext_kws = { "include_dirs": include_dirs, "libraries": libraries, @@ -139,8 +186,8 @@ def run(self): } -# Define extensions def create_extensions(): + """Create the list of Extension objects for the build.""" ext = Extension("diffpy.pdffit2.pdffit2", glob.glob("src/extensions/**/*.cc"), **ext_kws) return [ext] @@ -153,5 +200,3 @@ def create_extensions(): if __name__ == "__main__": setup_args["ext_modules"] = create_extensions() setup(**setup_args) - -# End of file From 4c4d5579c6b4aa05bc384a28f892a5c50474184c Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sat, 11 Jan 2025 21:57:31 -0500 Subject: [PATCH 218/294] add news --- news/setup.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 news/setup.rst diff --git a/news/setup.rst b/news/setup.rst new file mode 100644 index 00000000..968cdae5 --- /dev/null +++ b/news/setup.rst @@ -0,0 +1,24 @@ +**Added:** + +* Added additional runtime linker flags in `CustomBuildExt.run` to embed the `RPATH` flags for the built extensions. +* Support for retrieving GSL configuration from `CONDA_PREFIX`/ `GSL_PATH` on all platforms. + +**Changed:** + +* Merged the GSL configuration logic in `setup.py`. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 154691f91016c89c7c8073f48d5d2f29fb8e36c6 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sun, 12 Jan 2025 02:14:02 -0500 Subject: [PATCH 219/294] implement restore_stdout --- src/extensions/pdffit2module/bindings.cc | 4 ++++ src/extensions/pdffit2module/misc.cc | 30 ++++++++++++++++++++++++ src/extensions/pdffit2module/misc.h | 6 +++++ 3 files changed, 40 insertions(+) diff --git a/src/extensions/pdffit2module/bindings.cc b/src/extensions/pdffit2module/bindings.cc index 568e1dd1..3a542aed 100644 --- a/src/extensions/pdffit2module/bindings.cc +++ b/src/extensions/pdffit2module/bindings.cc @@ -330,6 +330,10 @@ struct PyMethodDef pypdffit2_methods[] = { {pypdffit2_redirect_stdout__name__, pypdffit2_redirect_stdout, METH_VARARGS, pypdffit2_redirect_stdout__doc__}, + //restore_stdout + {pypdffit2_restore_stdout__name__, pypdffit2_restore_stdout, + METH_VARARGS, pypdffit2_restore_stdout__doc__}, + //is_element {pypdffit2_is_element__name__, pypdffit2_is_element, METH_VARARGS, pypdffit2_is_element__doc__}, diff --git a/src/extensions/pdffit2module/misc.cc b/src/extensions/pdffit2module/misc.cc index 17e0833d..9bc0340a 100644 --- a/src/extensions/pdffit2module/misc.cc +++ b/src/extensions/pdffit2module/misc.cc @@ -2201,6 +2201,36 @@ PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *args) return Py_None; } +// restore_stdout +char pypdffit2_restore_stdout__doc__[] = + "Restore engine output to the default stream (std::cout)."; +char pypdffit2_restore_stdout__name__[] = + "restore_stdout"; + +PyObject * pypdffit2_restore_stdout(PyObject *, PyObject *args) +{ + // no arguments. + if (!PyArg_ParseTuple(args, "")) + return 0; + + // If the global output stream pointer is not std::cout, then delete the custom stream. + if (NS_PDFFIT2::pout != &std::cout) + { + delete NS_PDFFIT2::pout; + NS_PDFFIT2::pout = &std::cout; + } + + // Clean up the custom stream buffer + if (py_stdout_streambuf) + { + delete py_stdout_streambuf; + py_stdout_streambuf = nullptr; + } + + Py_INCREF(Py_None); + return Py_None; +} + // is_element char pypdffit2_is_element__doc__[] = "Check if element or isotope is defined in the built-in periodic table."; char pypdffit2_is_element__name__[] = "is_element"; diff --git a/src/extensions/pdffit2module/misc.h b/src/extensions/pdffit2module/misc.h index f8782307..2ccec0fa 100644 --- a/src/extensions/pdffit2module/misc.h +++ b/src/extensions/pdffit2module/misc.h @@ -477,6 +477,12 @@ extern char pypdffit2_redirect_stdout__name__[]; extern "C" PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *); +// restore_stdout +extern char pypdffit2_restore_stdout__doc__[]; +extern char pypdffit2_restore_stdout__name__[]; +extern "C" +PyObject * pypdffit2_restore_stdout(PyObject *, PyObject *); + // is_element extern char pypdffit2_is_element__doc__[]; extern char pypdffit2_is_element__name__[]; From 93e9fd369441d98e5c490d0bfec4e44ff68e7b0f Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sun, 12 Jan 2025 02:14:26 -0500 Subject: [PATCH 220/294] pywrap and fix tests --- src/diffpy/pdffit2/output.py | 8 ++++++++ tests/conftest.py | 1 + 2 files changed, 9 insertions(+) diff --git a/src/diffpy/pdffit2/output.py b/src/diffpy/pdffit2/output.py index f24c28e9..164cb689 100644 --- a/src/diffpy/pdffit2/output.py +++ b/src/diffpy/pdffit2/output.py @@ -38,5 +38,13 @@ def redirect_stdout(dst): stdout = dst return +def restore_stdout(): + """Restore the standard output.""" + from diffpy.pdffit2.pdffit2 import restore_stdout + + restore_stdout() + global stdout + return + # End of file diff --git a/tests/conftest.py b/tests/conftest.py index 6a142536..2192452a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -45,6 +45,7 @@ def _capture(f, *args, **kwargs): f(*args, **kwargs) finally: diffpy.pdffit2.redirect_stdout(savestdout) + diffpy.pdffit2.output.restore_stdout() return fp.getvalue() return _capture From 6d2a016ed868e33f2ac90446a48964551b4fc695 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sun, 12 Jan 2025 02:21:14 -0500 Subject: [PATCH 221/294] support 3.13 --- .github/workflows/matrix-and-codecov-on-merge-to-main.yml | 2 +- .github/workflows/publish-docs-on-release.yml | 2 +- .github/workflows/tests-on-pr.yml | 2 +- README.rst | 6 +++--- pyproject.toml | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) 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 c1be0beb..ee58ec41 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -15,7 +15,7 @@ jobs: uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 with: project: diffpy.pdffit2 - python_versions: "3.11, 3.12" + python_versions: "3.11, 3.12, 3.13" c_extension: true headless: false secrets: diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index be60ce19..a9b26da9 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -14,4 +14,4 @@ jobs: project: diffpy.pdffit2 c_extension: true headless: false - python_version: 3.12 + python_version: 3.13 diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 6d008cdc..198624a4 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -14,6 +14,6 @@ jobs: project: diffpy.pdffi2 c_extension: true headless: false - python_version: 3.12 + python_version: 3.13 secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.rst b/README.rst index fa2c6cc1..35d810db 100644 --- a/README.rst +++ b/README.rst @@ -72,7 +72,7 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite Installation ------------ -diffpy.pdffit2 supports Python 3.11 and 3.12. +diffpy.pdffit2 supports Python 3.11, 3.12, and 3.13. Windows, macOS (non-Arm64), Linux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -102,7 +102,7 @@ macOS (Arm64) Create a new conda environment ``diffpy.pdffit2_env``: :: - conda create -n diffpy.pdffit2_env python=3.12 + conda create -n diffpy.pdffit2_env python=3.13 Activate the environment: :: @@ -121,7 +121,7 @@ Build from source For advanced users, obtain the source archive, and in the ``diffpy.pdffit2`` directory, run :: - conda create -n diffpy.pdffit2_env python=3.12 \ + conda create -n diffpy.pdffit2_env python=3.13 \ --file requirements/test.txt \ --file requirements/conda.txt \ --file requirements/build.txt diff --git a/pyproject.toml b/pyproject.toml index 7df539b9..8a1b15c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ description = "PDFfit2 - real space structure refinement program." keywords = ["PDF", "structure refinement"] 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 ca76fde206092c132fe94c7c896c2d014e8fae5a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 12 Jan 2025 07:26:26 +0000 Subject: [PATCH 222/294] [pre-commit.ci] auto fixes from pre-commit hooks --- src/diffpy/pdffit2/output.py | 1 + src/extensions/pdffit2module/misc.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/diffpy/pdffit2/output.py b/src/diffpy/pdffit2/output.py index 164cb689..9fc55eea 100644 --- a/src/diffpy/pdffit2/output.py +++ b/src/diffpy/pdffit2/output.py @@ -38,6 +38,7 @@ def redirect_stdout(dst): stdout = dst return + def restore_stdout(): """Restore the standard output.""" from diffpy.pdffit2.pdffit2 import restore_stdout diff --git a/src/extensions/pdffit2module/misc.cc b/src/extensions/pdffit2module/misc.cc index 9bc0340a..20547a23 100644 --- a/src/extensions/pdffit2module/misc.cc +++ b/src/extensions/pdffit2module/misc.cc @@ -2219,14 +2219,14 @@ PyObject * pypdffit2_restore_stdout(PyObject *, PyObject *args) delete NS_PDFFIT2::pout; NS_PDFFIT2::pout = &std::cout; } - + // Clean up the custom stream buffer if (py_stdout_streambuf) { delete py_stdout_streambuf; py_stdout_streambuf = nullptr; } - + Py_INCREF(Py_None); return Py_None; } From d6129aa2c147f2a1df55097bad1a3273bb892157 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sun, 12 Jan 2025 02:34:31 -0500 Subject: [PATCH 223/294] add news --- news/win_memory.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 news/win_memory.rst diff --git a/news/win_memory.rst b/news/win_memory.rst new file mode 100644 index 00000000..4fc4fdb4 --- /dev/null +++ b/news/win_memory.rst @@ -0,0 +1,24 @@ +**Added:** + +* Added `restore_stdout` function and wrapper. +* Added Python 3.13 support. + +**Changed:** + +* Changed `pytest` `capture_output` fixture. Now automatically restores `sys.stdout`. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fixed `SystemError` when running `pytest` on Windows with Python 3.13. + +**Security:** + +* From a89102c13846efaf76b4d7a445c0748766632bf3 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Sun, 12 Jan 2025 15:20:44 -0500 Subject: [PATCH 224/294] chore: update release checklist --- .github/ISSUE_TEMPLATE/release_checklist.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index f2df0e96..fa94779e 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -12,30 +12,31 @@ 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. -- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated. + 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 at Pypi is verified as correct. -- [ ] Docs deployed successfully to `.github.io` -- [ ] Successfully run all tests, tutorial examples or do functional testing +- [ ] 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 package is ready for full release. +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 +- [ ] 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 -- [ ] let @sbillinge and @bobleesj when this is ready +- [ ] 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 From 2b748378f2c248541ce33ebe17583ca50ace2776 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Sun, 12 Jan 2025 15:24:21 -0500 Subject: [PATCH 225/294] news --- news/rls_tmpl.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/rls_tmpl.rst diff --git a/news/rls_tmpl.rst b/news/rls_tmpl.rst new file mode 100644 index 00000000..8e30442c --- /dev/null +++ b/news/rls_tmpl.rst @@ -0,0 +1,23 @@ +**Added:** + +* no news needed: just updating release template + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From b3b654f5bc7e81e65677a0aced373b8dfbfa6a15 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sun, 12 Jan 2025 15:58:21 -0500 Subject: [PATCH 226/294] doc: docstring to numpy style --- src/diffpy/pdffit2/pdffit.py | 27 ++++++++++++++------------- tests/test_pdffit.py | 12 +++--------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py index 383fbac0..43e9763e 100644 --- a/src/diffpy/pdffit2/pdffit.py +++ b/src/diffpy/pdffit2/pdffit.py @@ -104,6 +104,15 @@ def _convertCallable(var): class PdfFit(object): + """Class for PdfFit. + + Attributes + ---------- + stru_files : list + The list to store structure files. + data_files : list + The list to store data files. + """ # constants and enumerators from pdffit.h: # selection of all atoms @@ -1251,29 +1260,21 @@ def rcut(): # End refinable variables. - def __init__(self, intro=True): + def __init__(self, create_intro=True): """Initialize the Pdffit class, create a new PdfFit object. Parameters ---------- - intro : bool, optional - If True, display an introduction message. Default is True. - - Attributes - ---------- - stru_files : list - A list to store structure files. - data_files : list - A list to store data files. - _handle : PyCapsule - A python capsules to retrieve the printer to PdfFit object. + create_intro : bool, optional + The flag to control the display of an introduction message. + If True, display an introduction message, else not. Default is True. """ self.stru_files = [] self.data_files = [] self._handle = pdffit2.create() - if intro: + if create_intro: self.intro() return diff --git a/tests/test_pdffit.py b/tests/test_pdffit.py index a5085cc3..ee1e7152 100644 --- a/tests/test_pdffit.py +++ b/tests/test_pdffit.py @@ -750,16 +750,10 @@ def test_occ(self): def test___init__(self): """Check PdfFit.__init__()""" - P = PdfFit() - self.assertEqual([], P.stru_files) - self.assertEqual([], P.data_files) + output_true = self.capture_output(PdfFit, create_intro=True).strip() + output_false = self.capture_output(PdfFit, create_intro=False).strip() - output_true = self.capture_output(PdfFit, intro=True).strip() - output_false = self.capture_output(PdfFit, intro=False).strip() - - import diffpy.pdffit2.pdffit as pdffit - - self.assertEqual(len(output_true), len(pdffit.__intro_message__.strip())) + self.assertGreater(len(output_true), 0) self.assertEqual(len(output_false), 0) return From 5af093b850d0d9fb27f5b2af452a1a75e006b01c Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Sun, 12 Jan 2025 16:32:25 -0500 Subject: [PATCH 227/294] fix: release username added to release workflow --- .github/workflows/build-wheel-release-upload.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index c6ed1365..a6621511 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -11,7 +11,8 @@ jobs: uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: diffpy.pdffit2 - c_extension: true + github_admin_username: sbillinge + secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} PAT_TOKEN: ${{ secrets.PAT_TOKEN }} From a4cee8fafbe87f0a9c33730373c30cb400b340e2 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Sun, 12 Jan 2025 16:35:43 -0500 Subject: [PATCH 228/294] fix: add c extension back --- .github/workflows/build-wheel-release-upload.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index a6621511..beb05b36 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -11,6 +11,7 @@ jobs: uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: diffpy.pdffit2 + c_extension: true github_admin_username: sbillinge secrets: From 5384126ded7194b1c8c3a0cd3d6342206d5c672c Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sun, 12 Jan 2025 18:33:20 -0500 Subject: [PATCH 229/294] lazy setup --- news/sdist.rst | 23 +++++++++++++ setup.py | 91 +++++++++++++++++++++++++------------------------- 2 files changed, 69 insertions(+), 45 deletions(-) create mode 100644 news/sdist.rst diff --git a/news/sdist.rst b/news/sdist.rst new file mode 100644 index 00000000..a2d80957 --- /dev/null +++ b/news/sdist.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Changed setup.py to lazy evaluate gsl installation. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/setup.py b/setup.py index 504267bd..4633f1a8 100755 --- a/setup.py +++ b/setup.py @@ -141,53 +141,54 @@ def run(self): shutil.copy(str(dll_file), str(dest_path)) -# Compile and link options---------------------------------------------------- - -os_name = os.name -gcfg = get_gsl_config() - -# On macOS, dynamic linking may not be needed -if sys.platform == "darwin": - libraries = [] -else: - libraries = ["gsl"] - -include_dirs = [MYDIR] + gcfg["include_dirs"] -library_dirs = gcfg["library_dirs"] -define_macros = [] -extra_objects = [] -extra_compile_args = [] -extra_link_args = [] - -compiler_type = get_compiler_type() -if compiler_type in ("unix", "cygwin", "mingw32"): - extra_compile_args = ["-std=c++11", "-Wall", "-Wno-write-strings", "-O3", "-funroll-loops", "-ffast-math"] - # Check for static GSL libraries and add them if found. - static_libs = [ - os.path.join(p, "libgsl.a") for p in gcfg["library_dirs"] if os.path.isfile(os.path.join(p, "libgsl.a")) - ] - if static_libs: - extra_objects += static_libs - # Use static linking: remove "-lgsl" to avoid dynamic linking conflicts. - libraries = [] -elif compiler_type == "msvc": - define_macros += [("_USE_MATH_DEFINES", None)] - extra_compile_args = ["/EHs"] - -# Extension keyword arguments. -ext_kws = { - "include_dirs": include_dirs, - "libraries": libraries, - "library_dirs": library_dirs, - "define_macros": define_macros, - "extra_compile_args": extra_compile_args, - "extra_link_args": extra_link_args, - "extra_objects": extra_objects, -} - - def create_extensions(): """Create the list of Extension objects for the build.""" + # lazy evaluation prevents build sdist failure + try: + gcfg = get_gsl_config() + except EnvironmentError: + return [] + + # On macOS, dynamic linking may not be needed + if sys.platform == "darwin": + libraries = [] + else: + libraries = ["gsl"] + + include_dirs = [MYDIR] + gcfg["include_dirs"] + library_dirs = gcfg["library_dirs"] + define_macros = [] + extra_objects = [] + extra_compile_args = [] + extra_link_args = [] + + compiler_type = get_compiler_type() + if compiler_type in ("unix", "cygwin", "mingw32"): + extra_compile_args = ["-std=c++11", "-Wall", "-Wno-write-strings", "-O3", "-funroll-loops", "-ffast-math"] + # Check for static GSL libraries and add them if found. + static_libs = [ + os.path.join(p, "libgsl.a") + for p in gcfg["library_dirs"] + if os.path.isfile(os.path.join(p, "libgsl.a")) + ] + if static_libs: + extra_objects += static_libs + # Use static linking: remove "-lgsl" to avoid dynamic linking conflicts. + libraries = [] + elif compiler_type == "msvc": + define_macros += [("_USE_MATH_DEFINES", None)] + extra_compile_args = ["/EHs"] + + # Extension keyword arguments. + ext_kws = { + "include_dirs": include_dirs, + "libraries": libraries, + "library_dirs": library_dirs, + "define_macros": define_macros, + "extra_compile_args": extra_compile_args, + "extra_link_args": extra_link_args, + "extra_objects": extra_objects, + } ext = Extension("diffpy.pdffit2.pdffit2", glob.glob("src/extensions/**/*.cc"), **ext_kws) return [ext] From 66d21c4c17325e93a84447a18a55ab51b82ce6bc Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sun, 12 Jan 2025 18:33:41 -0500 Subject: [PATCH 230/294] sdist test workflow --- .github/workflows/sdist.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/sdist.yml diff --git a/.github/workflows/sdist.yml b/.github/workflows/sdist.yml new file mode 100644 index 00000000..fed37dfa --- /dev/null +++ b/.github/workflows/sdist.yml @@ -0,0 +1,23 @@ +name: Tests build sdist + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + build_sdist: + name: Build diffpy.pdffit2 sdist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: ./dist/*.tar.gz From 8008d20ac2f0afe5f18fa361fcc8fe0701b4a117 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Sun, 12 Jan 2025 18:43:01 -0500 Subject: [PATCH 231/294] Revert "sdist test workflow" --- .github/workflows/sdist.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/sdist.yml diff --git a/.github/workflows/sdist.yml b/.github/workflows/sdist.yml deleted file mode 100644 index fed37dfa..00000000 --- a/.github/workflows/sdist.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Tests build sdist - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - build_sdist: - name: Build diffpy.pdffit2 sdist - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.ref }} - - - name: Build sdist - run: pipx run build --sdist - - - uses: actions/upload-artifact@v4 - with: - name: cibw-sdist - path: ./dist/*.tar.gz From bfb5b17e29958208fcf3e5a3932611d8cc9b4db2 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Mon, 13 Jan 2025 09:09:31 -0500 Subject: [PATCH 232/294] edited and cleaned docs for 1.5.0 release --- doc/source/examples.rst | 59 ++++++++++++++++++++++++++++++++--------- doc/source/index.rst | 31 +++++++++++++++------- doc/source/license.rst | 2 +- 3 files changed, 69 insertions(+), 23 deletions(-) diff --git a/doc/source/examples.rst b/doc/source/examples.rst index 300cc54c..7b1eb62b 100644 --- a/doc/source/examples.rst +++ b/doc/source/examples.rst @@ -14,13 +14,23 @@ Files needed: Example 1: Calculate PDF of FCC nickel ====================================== -The first example shows how to calculates the PDF for FCC nickel and saves the resulting data to a file and plot it using matplotlib. +The first example shows how to calculate the PDF for FCC nickel and save the resulting data +to a file and plot it using matplotlib. -1. Imports the PdfFit class from the diffpy.pdffit2 module:: +1. Import the ``PdfFit`` class from the ``diffpy.pdffit2`` module + +.. code-block:: python from diffpy.pdffit2 import PdfFit -2. Create a PDF calculator object and assigned to the variable ``P``. Make sure the ``Ni.stru`` file is in the same directory as the script and you've cd to the directory, load structure file. Then allocate and configure PDF calculation and run the calculation:: +2. Create a PDF calculator object and assign it to the variable ``P``. +Make sure the ``Ni.stru`` file is in the same directory as the script (or specify +the relative path to where it resides) +and you are currently in this directory. Then use ``read_struct`` to read the structure +file, ``alloc`` to configure the PDF +calculation, and then use ``calc`` to carry out the the calculation. + +.. code-block:: python # create new PDF calculator object P = PdfFit() @@ -39,11 +49,15 @@ The first example shows how to calculates the PDF for FCC nickel and saves the r P.alloc(radiation_type, qmax, qdamp, rmin, rmax, npts) P.calc() -3. Save the refined result:: +3. Save the calculated PDF. + +.. code-block:: python P.save_pdf(1, "Ni_calculation.cgr") -4. We can also plot it using matplotlib:: +4. We can also plot it using matplotlib + +.. code-block:: python import matplotlib.pyplot as plt @@ -59,19 +73,27 @@ The first example shows how to calculates the PDF for FCC nickel and saves the r # display plot window, this must be the last command in the script plt.show() -The scripts can be downloaded :download:`here `. +The scripts used in this example can be +downloaded :download:`here `. ======================================= Example 2: Performing simple refinement ======================================= -The second example shows how to perform simple refinement of Ni structure to the experimental x-ray PDF. The example uses the same data files as the first example. +The second example shows how to perform a simple refinement of the Ni structure to +the experimental x-ray PDF. The example uses the same data files as the first example. + +1. Import the PdfFit class from the diffpy.pdffit2 module -1. Imports the PdfFit class from the diffpy.pdffit2 module:: +.. code-block:: python from diffpy.pdffit2 import PdfFit -2. Create a PDF calculator object and assigned to the variable ``pf``. Load experimental x-ray PDF data and nickel structure file:: +2. Create a PDF calculator object and assign it to the variable ``pf``. +Load the experimental x-ray PDF data using ``read_data`` and also load +the nickel structure file. + +.. code-block:: python # Create new PDF calculator object. pf = PdfFit() @@ -84,7 +106,13 @@ The second example shows how to perform simple refinement of Ni structure to the # Load nickel structure, must be in PDFFIT or DISCUS format pf.read_struct("Ni.stru") -3. Configure refinement and refine:: +3. Configure the refinement, assigning structural parameters to variables. For more +information on how to do this correctly, please read the PDFgui documentation. +Set initial values for the variables using ``setpar``. +Finally, you can configure the range over which to refine (``pdfrange``) and +run the refinement (``refine``). + +.. code-block:: python # Refine lattice parameters a, b, c. # Make them all equal to parameter @1. @@ -118,13 +146,18 @@ The second example shows how to perform simple refinement of Ni structure to the pf.pdfrange(1, 1.5, 19.99) pf.refine() -4. Save the refined result:: +4. Save the refined result. ``save_struct`` saves the new, refined, structure to a +``.stru`` format file. ``save_res`` saves the outputs in a structured text file. + +.. code-block:: python pf.save_pdf(1, "Ni_refinement.fgr") pf.save_struct(1, "Ni_refinement.rstr") pf.save_res("Ni_refinement.res") -5. We can also plot it using matplotlib:: +5. We can also plot it using matplotlib + +.. code-block:: python import matplotlib.pyplot as plt import numpy @@ -149,4 +182,4 @@ The second example shows how to perform simple refinement of Ni structure to the # display plot window, this must be the last command in the script plt.show() -The scripts can be downloaded :download:`here `. +The scripts can be downloaded from :download:`here `. diff --git a/doc/source/index.rst b/doc/source/index.rst index 7ae9b3aa..622bfac2 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -10,12 +10,18 @@ diffpy.pdffit2 - PDFfit2 - real space structure refinement program. | Last updated |today|. The diffpy.pdffit2 package provides functions for calculation and -refinement of atomic Pair Distribution Function (PDF) from crystal -structure model. It is used as a computational engine by PDFgui. All -refinements possible in PDFgui can be done with diffpy.pdffit2, +refinement of atomic Pair Distribution Functions (PDF) from crystal +structure models. It is used as a computational engine by PDFgui. All +refinements possible in PDFgui can be done by writing python scripts +directly with diffpy.pdffit2, although less conveniently and with a fair knowledge of Python. -The package includes an extension for the interactive `IPython -`_ shell, which tries to mimic the old PDFFIT +However, we recommend using `diffpy-cmi +`_ for carrying +out more advanced, python-scripted refinements of nanosctructre. + +The PDFfit2 package includes an extension for the interactive `IPython +`_ shell, these days commonly used within +Jupyter notebooks, which tries to mimic the old PDFFIT program. To start IPython with this extension and also with plotting functions enabled, use :: @@ -30,7 +36,13 @@ statements. Authors ======= -This code was derived from the first PDFFIT program by Thomas Proffen. +This code was derived from the first `PDFFIT +`_ program written by Thomas Proffen +and Simon Billinge, which was a FORTRAN implementation of the original +"Real-space Rietveld" code +written by Simon Billinge (Billinge, S. J. L. “Real-space Rietveld: full profile structure refinement of the atomic pair distribution +function”. In: Local Structure from Diffraction. Ed. by S. J. L. Billinge and M. F. Thorpe. New York: +Plenum, 1998, p. 137). The sources were converted to C++ by Jacques Bloch and then extensively hacked, extended and purged from most glaring bugs by Chris Farrow and Pavol Juhas. This code is currently maintained as part of the DiffPy project to create @@ -38,11 +50,12 @@ python modules for structure investigations from diffraction data. The DiffPy team is located in the Billinge-group at the Applied Physics and Applied Mathematics Department of the Columbia University in New York. -Previous significant contributors to this code were +Previous significant contributors to this code were made by Pavol Juhas, Chris Farrow, Jacques Bloch, Wenduo Zhou -For a detailed list of contributors see +with more recent contributions from Billinge-group members. +For a more detailed list of contributors see https://github.com/diffpy/diffpy.pdffit2/graphs/contributors. @@ -62,7 +75,7 @@ in your publication: Installation ============ -See the `README `_ +Please see the `README `_ file included with the distribution. ================= diff --git a/doc/source/license.rst b/doc/source/license.rst index 38f918c6..e8729103 100644 --- a/doc/source/license.rst +++ b/doc/source/license.rst @@ -17,7 +17,7 @@ the following paper in your publication: in crystals (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) Copyright 2006-2007, Board of Trustees of Michigan State University, -Copyright 2008-2024, Board of Trustees of Columbia University in the +Copyright 2008-|year|, Board of Trustees of Columbia University in the city of New York. (Copyright holder indicated in each source file). For more information please visit the project web-page: From a32bc32c21e99481aa29976e110d36bff7bdffb7 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Mon, 13 Jan 2025 10:41:27 -0500 Subject: [PATCH 233/294] dynamic year in docs --- README.rst | 20 +++++++++++++------- doc/source/index.rst | 4 ++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index 35d810db..dbc10c66 100644 --- a/README.rst +++ b/README.rst @@ -35,15 +35,21 @@ .. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue :target: https://github.com/diffpy/diffpy.pdffit2/issues -PDFfit2 - real space structure refinement to atomic pair distribution function +PDFfit2 - real space structure refinement of the atomic pair distribution function -The diffpy.pdffit2 package provides functions for calculation and -refinement of atomic Pair Distribution Function (PDF) from crystal -structure model. It is used as a computational engine by PDFgui. All -refinements possible in PDFgui can be done with diffpy.pdffit2, +The diffpy.pdffit2 package provides functions for the calculation and +refinement of atomic Pair Distribution Functions (PDF) from crystal +structure models. It is used as a computational engine by PDFgui. All +refinements possible in PDFgui can be done by writing python scripts +directly with diffpy.pdffit2, although less conveniently and with a fair knowledge of Python. -The package includes an extension for the interactive `IPython -`__ shell, which tries to mimic the old PDFFIT +However, we recommend using `diffpy-cmi +`_ for carrying +out more advanced, python-scripted refinements of nanostructure. + +The PDFfit2 package includes an extension for the interactive `IPython +`_ shell, these days commonly used within +Jupyter notebooks, which tries to mimic the old PDFFIT program. To start IPython with this extension and also with plotting functions enabled, use :: diff --git a/doc/source/index.rst b/doc/source/index.rst index 622bfac2..a7eff2a9 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -9,7 +9,7 @@ diffpy.pdffit2 - PDFfit2 - real space structure refinement program. | Software version |release|. | Last updated |today|. -The diffpy.pdffit2 package provides functions for calculation and +The diffpy.pdffit2 package provides functions for the calculation and refinement of atomic Pair Distribution Functions (PDF) from crystal structure models. It is used as a computational engine by PDFgui. All refinements possible in PDFgui can be done by writing python scripts @@ -17,7 +17,7 @@ directly with diffpy.pdffit2, although less conveniently and with a fair knowledge of Python. However, we recommend using `diffpy-cmi `_ for carrying -out more advanced, python-scripted refinements of nanosctructre. +out more advanced, python-scripted refinements of nanostructure. The PDFfit2 package includes an extension for the interactive `IPython `_ shell, these days commonly used within From f6c38cbade3d8fb872678e337af1f5826b909f91 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Mon, 13 Jan 2025 11:42:04 -0500 Subject: [PATCH 234/294] news --- news/docs.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/docs.rst diff --git a/news/docs.rst b/news/docs.rst new file mode 100644 index 00000000..66061f0e --- /dev/null +++ b/news/docs.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Documentation brought up to date + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 4b0878c35411bd5f00a799ba4e2042fc946a4825 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Mon, 13 Jan 2025 11:52:52 -0500 Subject: [PATCH 235/294] tweak to docstrings to make docs read better --- src/diffpy/pdffit2/pdffit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py index 43e9763e..984d67c9 100644 --- a/src/diffpy/pdffit2/pdffit.py +++ b/src/diffpy/pdffit2/pdffit.py @@ -12,7 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## -"""PdfFit class for fitting pdf data to a model.""" +"""PdfFit class for fitting a structural model to PDF data.""" from __future__ import print_function @@ -104,7 +104,7 @@ def _convertCallable(var): class PdfFit(object): - """Class for PdfFit. + """Class for handling PdfFit calculations and refinements. Attributes ---------- From 6180000ee3dce0d983526078e65c31f6392c92b6 Mon Sep 17 00:00:00 2001 From: sbillinge <4254545+sbillinge@users.noreply.github.com> Date: Tue, 14 Jan 2025 21:27:28 +0000 Subject: [PATCH 236/294] update changelog --- CHANGELOG.rst | 37 +++++++++++++++++++++++++++++++++++++ news/date.rst | 23 ----------------------- news/docs.rst | 23 ----------------------- news/intro.rst | 23 ----------------------- news/pcmt.rst | 23 ----------------------- news/pip.rst | 23 ----------------------- news/py312.rst | 23 ----------------------- news/readme-install.rst | 23 ----------------------- news/recut.rst | 23 ----------------------- news/remove_six.rst | 23 ----------------------- news/rls_tmpl.rst | 23 ----------------------- news/rm-recipe.rst | 23 ----------------------- news/sdist.rst | 23 ----------------------- news/setup.rst | 24 ------------------------ news/tests-dir.rst | 25 ------------------------- news/wf.rst | 23 ----------------------- news/wftypo.rst | 23 ----------------------- news/win_memory.rst | 24 ------------------------ 18 files changed, 37 insertions(+), 395 deletions(-) delete mode 100644 news/date.rst delete mode 100644 news/docs.rst delete mode 100644 news/intro.rst delete mode 100644 news/pcmt.rst delete mode 100644 news/pip.rst delete mode 100644 news/py312.rst delete mode 100644 news/readme-install.rst delete mode 100644 news/recut.rst delete mode 100644 news/remove_six.rst delete mode 100644 news/rls_tmpl.rst delete mode 100644 news/rm-recipe.rst delete mode 100644 news/sdist.rst delete mode 100644 news/setup.rst delete mode 100644 news/tests-dir.rst delete mode 100644 news/wf.rst delete mode 100644 news/wftypo.rst delete mode 100644 news/win_memory.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f6c0f22b..d3387012 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,43 @@ Release Notes .. current developments +1.5.0 +===== + +**Added:** + +* Python 3.11, 3.12 support +* Option to skip printing of introductory information when initializing the `PdfFit` class. +* Added additional runtime linker flags in `CustomBuildExt.run` to embed the `RPATH` flags for the built extensions. +* Support for retrieving GSL configuration from `CONDA_PREFIX`/ `GSL_PATH` on all platforms. +* Separate installation instruction for macOS (Arm64) in READEM +* Added `restore_stdout` function and wrapper. +* Added Python 3.13 support. + +**Changed:** + +* Changed setup.py to lazy evaluate gsl installation. +* Documentation brought up to date +* Merged the GSL configuration logic in `setup.py`. +* Changed `pytest` `capture_output` fixture. Now automatically restores `sys.stdout`. + +**Fixed:** + +* remove older conda-recipe files +* moved the tests directory from src to the root using conftest.py. +* fixed a circular import bug during " pip install ." in GitHub CI. +* renamed .py files under tests to snake_case. +* add PyPI packages under pip.txt +* re-cookiecutter to group's package standard +* Fix missing `__date__`, use PyPI release date. +* Fixed `SystemError` when running `pytest` on Windows with Python 3.13. + +**Removed:** + +* Python <= 3.10 support +* Six dependency and py2 support + + 1.4.2 ===== diff --git a/news/date.rst b/news/date.rst deleted file mode 100644 index 7f556beb..00000000 --- a/news/date.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* Fix missing `__date__`, use PyPI release date. - -**Security:** - -* diff --git a/news/docs.rst b/news/docs.rst deleted file mode 100644 index 66061f0e..00000000 --- a/news/docs.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* Documentation brought up to date - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/intro.rst b/news/intro.rst deleted file mode 100644 index d0a911b3..00000000 --- a/news/intro.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* Option to skip printing of introductory information when initializing the `PdfFit` class. - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/pcmt.rst b/news/pcmt.rst deleted file mode 100644 index 0c23f0f0..00000000 --- a/news/pcmt.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* no news: precommit and style check - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/pip.rst b/news/pip.rst deleted file mode 100644 index 01c61661..00000000 --- a/news/pip.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* add PyPI packages under pip.txt - -**Security:** - -* diff --git a/news/py312.rst b/news/py312.rst deleted file mode 100644 index 2897ff09..00000000 --- a/news/py312.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* Python 3.11, 3.12 support - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* Python <= 3.10 support - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/readme-install.rst b/news/readme-install.rst deleted file mode 100644 index 0ad7f576..00000000 --- a/news/readme-install.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* Separate installation instruction for macOS (Arm64) in READEM - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/recut.rst b/news/recut.rst deleted file mode 100644 index 919a742e..00000000 --- a/news/recut.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* re-cookiecutter to group's package standard - -**Security:** - -* diff --git a/news/remove_six.rst b/news/remove_six.rst deleted file mode 100644 index 668d44ce..00000000 --- a/news/remove_six.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* Six dependency and py2 support - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/rls_tmpl.rst b/news/rls_tmpl.rst deleted file mode 100644 index 8e30442c..00000000 --- a/news/rls_tmpl.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* no news needed: just updating release template - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/rm-recipe.rst b/news/rm-recipe.rst deleted file mode 100644 index 3af76e88..00000000 --- a/news/rm-recipe.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* remove older conda-recipe files - -**Security:** - -* diff --git a/news/sdist.rst b/news/sdist.rst deleted file mode 100644 index a2d80957..00000000 --- a/news/sdist.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* Changed setup.py to lazy evaluate gsl installation. - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/setup.rst b/news/setup.rst deleted file mode 100644 index 968cdae5..00000000 --- a/news/setup.rst +++ /dev/null @@ -1,24 +0,0 @@ -**Added:** - -* Added additional runtime linker flags in `CustomBuildExt.run` to embed the `RPATH` flags for the built extensions. -* Support for retrieving GSL configuration from `CONDA_PREFIX`/ `GSL_PATH` on all platforms. - -**Changed:** - -* Merged the GSL configuration logic in `setup.py`. - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/tests-dir.rst b/news/tests-dir.rst deleted file mode 100644 index 91531047..00000000 --- a/news/tests-dir.rst +++ /dev/null @@ -1,25 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* moved the tests directory from src to the root using conftest.py. -* fixed a circular import bug during " pip install ." in GitHub CI. -* renamed .py files under tests to snake_case. - -**Security:** - -* diff --git a/news/wf.rst b/news/wf.rst deleted file mode 100644 index 622844e0..00000000 --- a/news/wf.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* no news: modification on CI workflow - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/wftypo.rst b/news/wftypo.rst deleted file mode 100644 index 622844e0..00000000 --- a/news/wftypo.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* no news: modification on CI workflow - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/win_memory.rst b/news/win_memory.rst deleted file mode 100644 index 4fc4fdb4..00000000 --- a/news/win_memory.rst +++ /dev/null @@ -1,24 +0,0 @@ -**Added:** - -* Added `restore_stdout` function and wrapper. -* Added Python 3.13 support. - -**Changed:** - -* Changed `pytest` `capture_output` fixture. Now automatically restores `sys.stdout`. - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* Fixed `SystemError` when running `pytest` on Windows with Python 3.13. - -**Security:** - -* From 88b6f923f2d65f9fba57682ecc24f1f438c7f8ea Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 30 Jan 2025 02:04:06 -0500 Subject: [PATCH 237/294] remove temparory fix --- src/diffpy/pdffit2/output.py | 9 ------- src/extensions/pdffit2module/bindings.cc | 4 ---- src/extensions/pdffit2module/misc.cc | 30 ------------------------ src/extensions/pdffit2module/misc.h | 5 ---- tests/conftest.py | 1 - 5 files changed, 49 deletions(-) diff --git a/src/diffpy/pdffit2/output.py b/src/diffpy/pdffit2/output.py index 9fc55eea..f24c28e9 100644 --- a/src/diffpy/pdffit2/output.py +++ b/src/diffpy/pdffit2/output.py @@ -39,13 +39,4 @@ def redirect_stdout(dst): return -def restore_stdout(): - """Restore the standard output.""" - from diffpy.pdffit2.pdffit2 import restore_stdout - - restore_stdout() - global stdout - return - - # End of file diff --git a/src/extensions/pdffit2module/bindings.cc b/src/extensions/pdffit2module/bindings.cc index 3a542aed..568e1dd1 100644 --- a/src/extensions/pdffit2module/bindings.cc +++ b/src/extensions/pdffit2module/bindings.cc @@ -330,10 +330,6 @@ struct PyMethodDef pypdffit2_methods[] = { {pypdffit2_redirect_stdout__name__, pypdffit2_redirect_stdout, METH_VARARGS, pypdffit2_redirect_stdout__doc__}, - //restore_stdout - {pypdffit2_restore_stdout__name__, pypdffit2_restore_stdout, - METH_VARARGS, pypdffit2_restore_stdout__doc__}, - //is_element {pypdffit2_is_element__name__, pypdffit2_is_element, METH_VARARGS, pypdffit2_is_element__doc__}, diff --git a/src/extensions/pdffit2module/misc.cc b/src/extensions/pdffit2module/misc.cc index 20547a23..17e0833d 100644 --- a/src/extensions/pdffit2module/misc.cc +++ b/src/extensions/pdffit2module/misc.cc @@ -2201,36 +2201,6 @@ PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *args) return Py_None; } -// restore_stdout -char pypdffit2_restore_stdout__doc__[] = - "Restore engine output to the default stream (std::cout)."; -char pypdffit2_restore_stdout__name__[] = - "restore_stdout"; - -PyObject * pypdffit2_restore_stdout(PyObject *, PyObject *args) -{ - // no arguments. - if (!PyArg_ParseTuple(args, "")) - return 0; - - // If the global output stream pointer is not std::cout, then delete the custom stream. - if (NS_PDFFIT2::pout != &std::cout) - { - delete NS_PDFFIT2::pout; - NS_PDFFIT2::pout = &std::cout; - } - - // Clean up the custom stream buffer - if (py_stdout_streambuf) - { - delete py_stdout_streambuf; - py_stdout_streambuf = nullptr; - } - - Py_INCREF(Py_None); - return Py_None; -} - // is_element char pypdffit2_is_element__doc__[] = "Check if element or isotope is defined in the built-in periodic table."; char pypdffit2_is_element__name__[] = "is_element"; diff --git a/src/extensions/pdffit2module/misc.h b/src/extensions/pdffit2module/misc.h index 2ccec0fa..3374fa5f 100644 --- a/src/extensions/pdffit2module/misc.h +++ b/src/extensions/pdffit2module/misc.h @@ -477,11 +477,6 @@ extern char pypdffit2_redirect_stdout__name__[]; extern "C" PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *); -// restore_stdout -extern char pypdffit2_restore_stdout__doc__[]; -extern char pypdffit2_restore_stdout__name__[]; -extern "C" -PyObject * pypdffit2_restore_stdout(PyObject *, PyObject *); // is_element extern char pypdffit2_is_element__doc__[]; diff --git a/tests/conftest.py b/tests/conftest.py index 2192452a..6a142536 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -45,7 +45,6 @@ def _capture(f, *args, **kwargs): f(*args, **kwargs) finally: diffpy.pdffit2.redirect_stdout(savestdout) - diffpy.pdffit2.output.restore_stdout() return fp.getvalue() return _capture From 2fb631e931eb4e17f92fc3b08e7db1e0ec2078f9 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 30 Jan 2025 03:12:59 -0500 Subject: [PATCH 238/294] fix buffer --- src/extensions/pdffit2module/PyFileStreambuf.h | 13 +++++++++---- src/extensions/pdffit2module/misc.cc | 9 ++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/extensions/pdffit2module/PyFileStreambuf.h b/src/extensions/pdffit2module/PyFileStreambuf.h index 3a2bc383..38d8abb1 100644 --- a/src/extensions/pdffit2module/PyFileStreambuf.h +++ b/src/extensions/pdffit2module/PyFileStreambuf.h @@ -67,16 +67,21 @@ class PyFileStreambuf : public std::streambuf virtual int_type overflow( int_type c) { - PyObject* rv; - rv = PyObject_CallMethod(py_file, "write", "(s#)", &c, 1); + char ch = static_cast(c); + PyObject* py_str = PyUnicode_FromStringAndSize(&ch, 1); + if (!py_str) { return traits_type::eof(); } + PyObject* rv = PyObject_CallMethod(py_file, "write", "O", py_str); + Py_DECREF(py_str); if (rv) { Py_DECREF(rv); } return c; } virtual std::streamsize xsputn(const char_type* s, std::streamsize n) { - PyObject* rv; - rv = PyObject_CallMethod(py_file, "write", "(s#)", s, n); + PyObject* py_str = PyUnicode_DecodeUTF8(s, n, "replace"); + if (!py_str) { return 0; } + PyObject* rv = PyObject_CallMethod(py_file, "write", "O", py_str); + Py_DECREF(py_str); if (rv) { Py_DECREF(rv); } return n; } diff --git a/src/extensions/pdffit2module/misc.cc b/src/extensions/pdffit2module/misc.cc index 17e0833d..f3f22a21 100644 --- a/src/extensions/pdffit2module/misc.cc +++ b/src/extensions/pdffit2module/misc.cc @@ -2176,15 +2176,14 @@ char pypdffit2_redirect_stdout__name__[] = "redirect_stdout"; PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *args) { // instance of PyFileStreambuf which takes care of redirection - PyObject *py_file = 0; - int ok = PyArg_ParseTuple(args, "O", &py_file); - if (!ok) return 0; + PyObject *py_file = nullptr; + if (!PyArg_ParseTuple(args, "O", &py_file)) return nullptr; // check if py_file has write and flush attributes if ( !PyObject_HasAttrString(py_file, "write") || !PyObject_HasAttrString(py_file, "flush") ) { PyErr_SetString(PyExc_TypeError, "expected file-like argument"); - return 0; + return nullptr; } // create py_stdout_streambuf if necessary if (!py_stdout_streambuf) @@ -2195,7 +2194,7 @@ PyObject * pypdffit2_redirect_stdout(PyObject *, PyObject *args) // on first redirection we need to assign new ostream to NS_PDFFIT2::pout if (NS_PDFFIT2::pout == &std::cout) { - NS_PDFFIT2::pout = new ostream(py_stdout_streambuf); + NS_PDFFIT2::pout = new std::ostream(py_stdout_streambuf); } Py_INCREF(Py_None); return Py_None; From 864b183dce755a353d3e14d3e5dae0f79c5fc0fc Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 30 Jan 2025 03:27:09 -0500 Subject: [PATCH 239/294] add news and pcmt --- news/fix_win.rst | 23 +++++++++++++++++++ .../pdffit2module/PyFileStreambuf.h | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 news/fix_win.rst diff --git a/news/fix_win.rst b/news/fix_win.rst new file mode 100644 index 00000000..f74cd809 --- /dev/null +++ b/news/fix_win.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* Removed `restore_stdout` function and wrapper. + +**Fixed:** + +* Fixed `SystemError` and `MemoryError` for `redirect_stdout` on Windows with Python 3.13. + +**Security:** + +* diff --git a/src/extensions/pdffit2module/PyFileStreambuf.h b/src/extensions/pdffit2module/PyFileStreambuf.h index 38d8abb1..cc8588bc 100644 --- a/src/extensions/pdffit2module/PyFileStreambuf.h +++ b/src/extensions/pdffit2module/PyFileStreambuf.h @@ -80,7 +80,7 @@ class PyFileStreambuf : public std::streambuf { PyObject* py_str = PyUnicode_DecodeUTF8(s, n, "replace"); if (!py_str) { return 0; } - PyObject* rv = PyObject_CallMethod(py_file, "write", "O", py_str); + PyObject* rv = PyObject_CallMethod(py_file, "write", "O", py_str); Py_DECREF(py_str); if (rv) { Py_DECREF(rv); } return n; From 94b53fc5cfc8548ac6fe113b95f5e238c4fa86b0 Mon Sep 17 00:00:00 2001 From: sbillinge <4254545+sbillinge@users.noreply.github.com> Date: Fri, 7 Feb 2025 20:43:22 +0000 Subject: [PATCH 240/294] update changelog --- CHANGELOG.rst | 12 ++++++++++++ news/fix_win.rst | 23 ----------------------- 2 files changed, 12 insertions(+), 23 deletions(-) delete mode 100644 news/fix_win.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d3387012..40492b28 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,18 @@ Release Notes .. current developments +1.5.1 +===== + +**Fixed:** + +* Fixed `SystemError` and `MemoryError` for `redirect_stdout` on Windows with Python 3.13. + +**Removed:** + +* Removed `restore_stdout` function and wrapper. + + 1.5.0 ===== diff --git a/news/fix_win.rst b/news/fix_win.rst deleted file mode 100644 index f74cd809..00000000 --- a/news/fix_win.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* Removed `restore_stdout` function and wrapper. - -**Fixed:** - -* Fixed `SystemError` and `MemoryError` for `redirect_stdout` on Windows with Python 3.13. - -**Security:** - -* From eabf1709eb0501bc02cd7fbdf1322231f9798f99 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 11 Jun 2025 14:53:05 -0400 Subject: [PATCH 241/294] skpkg: fix misspelled words --- .codespell/ignore_words.txt | 24 +++++++++++++++------ src/extensions/libpdffit2/PointsInSphere.cc | 4 ++-- src/extensions/libpdffit2/fit.cc | 2 +- src/extensions/libpdffit2/metric.cc | 2 +- src/extensions/libpdffit2/nrutil.cc | 2 +- src/extensions/libpdffit2/pdf.cc | 4 ++-- src/extensions/libpdffit2/pdflsmin.cc | 2 +- src/extensions/libpdffit2/stru.cc | 4 ++-- src/extensions/pdffit2module/misc.cc | 4 ++-- 9 files changed, 29 insertions(+), 19 deletions(-) diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt index 186fda9d..c04b74aa 100644 --- a/.codespell/ignore_words.txt +++ b/.codespell/ignore_words.txt @@ -4,14 +4,24 @@ ;; abbreviation for "materials" often used in a journal title mater -;; alternative use of socioeconomic -socio-economic - ;; Frobenius norm used in np.linalg.norm fro -;; class name within distutils module -ccompiler +;; dum as a C variable +dum + +;; gaus used for gaussian +gaus + +;; DISCUS is a software +DISCUS -;; structure file format -discus +;; Periodic table elements +Te +Nd + +;; Ois +Ois + +;; ccompiler +ccompiler diff --git a/src/extensions/libpdffit2/PointsInSphere.cc b/src/extensions/libpdffit2/PointsInSphere.cc index 8e51c575..881812a0 100644 --- a/src/extensions/libpdffit2/PointsInSphere.cc +++ b/src/extensions/libpdffit2/PointsInSphere.cc @@ -14,7 +14,7 @@ * * classes PointsInSphere, ReflectionsInQminQmax, ReflectionsInDmaxDmin * -* Comments: sequencers for lattice points insided 3D sphere +* Comments: sequencers for lattice points inside 3D sphere * ***********************************************************************/ @@ -117,7 +117,7 @@ void PointsInSphere::rewind() mHalfSpan = Rmax*latpar.ar; hi_m = int(ceil(mHalfSpan)); m = -hi_m; - // make indices n, o invalid, reset the neares point + // make indices n, o invalid, reset the nearest point n = hi_n = 0; o = hi_o = outside_o = 0; n0plane = o0plane = o0line = 0.0; diff --git a/src/extensions/libpdffit2/fit.cc b/src/extensions/libpdffit2/fit.cc index 4426aa29..9bcda15f 100644 --- a/src/extensions/libpdffit2/fit.cc +++ b/src/extensions/libpdffit2/fit.cc @@ -15,7 +15,7 @@ * Mixed definitions of several DataSet, Fit and PdfFit methods * * Comments: Up to date with 1.3.10 Fortran version. -* What a spagetti. +* What a spaghetti. * ***********************************************************************/ diff --git a/src/extensions/libpdffit2/metric.cc b/src/extensions/libpdffit2/metric.cc index 5f696495..5c06c4f5 100644 --- a/src/extensions/libpdffit2/metric.cc +++ b/src/extensions/libpdffit2/metric.cc @@ -302,7 +302,7 @@ void Phase::dtensor(double vec[3], double win[3], double dten[3][3], } /******************************************************** - Calulates the SCALARPRODUCT of two vectors + Calculates the SCALARPRODUCT of two vectors 1/D**2 = H(I)*K(J)*RTEN(I,J) uses the phase's metric *********************************************************/ diff --git a/src/extensions/libpdffit2/nrutil.cc b/src/extensions/libpdffit2/nrutil.cc index 34c6060c..ab466359 100644 --- a/src/extensions/libpdffit2/nrutil.cc +++ b/src/extensions/libpdffit2/nrutil.cc @@ -12,7 +12,7 @@ * ************************************************************************ * -* Utilities from numerical recipies. +* Utilities from numerical recipes. * * Comments: * diff --git a/src/extensions/libpdffit2/pdf.cc b/src/extensions/libpdffit2/pdf.cc index 0ab857b6..595fee96 100644 --- a/src/extensions/libpdffit2/pdf.cc +++ b/src/extensions/libpdffit2/pdf.cc @@ -15,7 +15,7 @@ * Mixed methods for PDF calculation from PdfFit, DataSet and Phase * * Comments: Up to date with 1.3.10 Fortran version. -* What a spagetti. +* What a spaghetti. * ***********************************************************************/ @@ -1387,7 +1387,7 @@ bool isRegular(Iterator first, Iterator last) /* Wed Oct 12 2005 - CLF * Using read_data_arrays adds functionality - * to pdffit2, allowing one to read data that is alread stored as arrays. + * to pdffit2, allowing one to read data that is already stored as arrays. */ void DataSet::read_data_arrays(int _iset, char tp, double _qmax, double _qdamp, int length, double * r_data, double * Gr_data, diff --git a/src/extensions/libpdffit2/pdflsmin.cc b/src/extensions/libpdffit2/pdflsmin.cc index 078d2754..74c7d075 100644 --- a/src/extensions/libpdffit2/pdflsmin.cc +++ b/src/extensions/libpdffit2/pdflsmin.cc @@ -65,7 +65,7 @@ void PdfFit::mrqmin(vector &a, vector &ia, matrix &covar, // Levenberg-Marquardt method, attempting to reduce the value Chi2 of a fit // between a set of data points x[1..ndata], y[1..ndata] with individual // standard deviations sig[1..ndata], and a nonlinear function dependent on ma -// coeffcients a[1..ma]. The input array ia[1..ma] indicates by nonzero +// coefficients a[1..ma]. The input array ia[1..ma] indicates by nonzero // entries those components of a that should be fitted for, and by zero entries // those components that should be held fixed at their input values. The // program re- turns current best-fit values for the parameters a[1..ma], and diff --git a/src/extensions/libpdffit2/stru.cc b/src/extensions/libpdffit2/stru.cc index f9022f23..4f1a6a60 100644 --- a/src/extensions/libpdffit2/stru.cc +++ b/src/extensions/libpdffit2/stru.cc @@ -106,7 +106,7 @@ string lstrip(const string &line) return naked; } -// substitute all occurences of literal pattern with new string +// substitute all occurrences of literal pattern with new string void substitute(string& s, const string& pat, const string& sub) { string::size_type p; @@ -230,7 +230,7 @@ void Phase::read_struct_stream(int _iphase, istream& fstruct) /****************************************************************** This subroutine reads the header of a structure file Wed Oct 12 2005 - CLF - Changed ifstream to istream to accomodate stringstreams + Changed ifstream to istream to accommodate stringstreams as well. ********************************************************************/ diff --git a/src/extensions/pdffit2module/misc.cc b/src/extensions/pdffit2module/misc.cc index f3f22a21..10f2cf41 100644 --- a/src/extensions/pdffit2module/misc.cc +++ b/src/extensions/pdffit2module/misc.cc @@ -1381,8 +1381,8 @@ char pypdffit2_bond_length_types__doc__[] = "\n" "Return a dictionary of distance data containing:\n" "\n" - "dij : list of bond lenghts within given bounds\n" - "ddij : list of bond legnth standard deviations\n" + "dij : list of bond lengths within given bounds\n" + "ddij : list of bond lengths standard deviations\n" "ij0 : list of tupled pairs of indices starting at 0\n" "ij1 : list of tupled pairs of indices starting at 1"; char pypdffit2_bond_length_types__name__[] = "bond_length_types"; From 43a80f5f3fed2c49e7d4bedb743576dd1ca1ac88 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 11 Jun 2025 14:55:40 -0400 Subject: [PATCH 242/294] skpkg: update to ignore words --- .codespell/ignore_words.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt index c04b74aa..f91947db 100644 --- a/.codespell/ignore_words.txt +++ b/.codespell/ignore_words.txt @@ -7,13 +7,16 @@ mater ;; Frobenius norm used in np.linalg.norm fro +;; class name within distutils module +ccompiler + ;; dum as a C variable dum ;; gaus used for gaussian gaus -;; DISCUS is a software +;; structure file format DISCUS ;; Periodic table elements @@ -22,6 +25,3 @@ Nd ;; Ois Ois - -;; ccompiler -ccompiler From 51263ea22c11880c5b29b95cf6c8e4bcdda1f38e Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 11 Jun 2025 14:58:36 -0400 Subject: [PATCH 243/294] skpkg: fix socioeconomic spelling --- CODE_OF_CONDUCT.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst index ff9c3561..e8199ca5 100644 --- a/CODE_OF_CONDUCT.rst +++ b/CODE_OF_CONDUCT.rst @@ -8,7 +8,7 @@ Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, +identity and expression, level of experience, education, socioeconomic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. From 2346bbf71a1fc1bd8581c7cf199f73cfd21249ab Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 11 Jun 2025 15:02:03 -0400 Subject: [PATCH 244/294] skpkg: misspelling of word recipes --- src/extensions/libpdffit2/nrutil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/libpdffit2/nrutil.h b/src/extensions/libpdffit2/nrutil.h index ee1bd4cb..fca40510 100644 --- a/src/extensions/libpdffit2/nrutil.h +++ b/src/extensions/libpdffit2/nrutil.h @@ -12,7 +12,7 @@ * ************************************************************************ * -* Utilities from numerical recipies. +* Utilities from numerical recipes. * * Comments: * From a9c5498881eea60da7aa194be9730060575bb3fe Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 11 Jun 2025 15:02:45 -0400 Subject: [PATCH 245/294] skpkg: change lengths to length --- src/extensions/pdffit2module/misc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/pdffit2module/misc.cc b/src/extensions/pdffit2module/misc.cc index 10f2cf41..6d3bf4f6 100644 --- a/src/extensions/pdffit2module/misc.cc +++ b/src/extensions/pdffit2module/misc.cc @@ -1382,7 +1382,7 @@ char pypdffit2_bond_length_types__doc__[] = "Return a dictionary of distance data containing:\n" "\n" "dij : list of bond lengths within given bounds\n" - "ddij : list of bond lengths standard deviations\n" + "ddij : list of bond length standard deviations\n" "ij0 : list of tupled pairs of indices starting at 0\n" "ij1 : list of tupled pairs of indices starting at 1"; char pypdffit2_bond_length_types__name__[] = "bond_length_types"; From 504c711021ff99862fc0fe74c0a948f2c794f09e Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 11 Jun 2025 15:12:52 -0400 Subject: [PATCH 246/294] skpkg: remove environment.yml --- environment.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 environment.yml diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 3979d3cb..00000000 --- a/environment.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: diffpy.pdffit2 -channels: - - conda-forge -dependencies: - - python=3 - - pip From 25fe3cc5c8bae8a30fd45527909930f9c7f2bcfa Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 11 Jun 2025 15:16:08 -0400 Subject: [PATCH 247/294] chore: news --- news/pre-commit-codespell.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/pre-commit-codespell.rst diff --git a/news/pre-commit-codespell.rst b/news/pre-commit-codespell.rst new file mode 100644 index 00000000..7958fb2c --- /dev/null +++ b/news/pre-commit-codespell.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fix misspelled words in source code comments. + +**Security:** + +* From d81642c59e6016fc1e94dbfc14b9b659104530f8 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 12 Jun 2025 10:30:20 -0400 Subject: [PATCH 248/294] skpkg: add necessary dependencies to requirements --- requirements/conda.txt | 1 + requirements/docs.txt | 1 + requirements/pip.txt | 1 + 3 files changed, 3 insertions(+) diff --git a/requirements/conda.txt b/requirements/conda.txt index 9cc306b0..4278ea13 100644 --- a/requirements/conda.txt +++ b/requirements/conda.txt @@ -1 +1,2 @@ diffpy.structure +numpy diff --git a/requirements/docs.txt b/requirements/docs.txt index ab17b1c8..5f34c6ed 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,4 +1,5 @@ sphinx sphinx_rtd_theme +sphinx-copybutton doctr m2r diff --git a/requirements/pip.txt b/requirements/pip.txt index 9cc306b0..4278ea13 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1 +1,2 @@ diffpy.structure +numpy From 9bf31f2949670c56850eb10596a29b36ecb6e8e5 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 12 Jun 2025 10:32:06 -0400 Subject: [PATCH 249/294] skpkg: gh workflows updated by skpkg --- .github/ISSUE_TEMPLATE/release_checklist.md | 14 +++++++------- .../pull_request_template.md | 15 +++++++++++++++ .github/workflows/build-wheel-release-upload.yml | 5 ++--- .github/workflows/check-news-item.yml | 2 +- .../matrix-and-codecov-on-merge-to-main.yml | 3 +-- .github/workflows/publish-docs-on-release.yml | 7 +------ .github/workflows/tests-on-pr.yml | 10 +++------- .readthedocs.yaml | 13 +++++++++++++ 8 files changed, 43 insertions(+), 26 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md create mode 100644 .readthedocs.yaml diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index fa94779e..6107962c 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -13,30 +13,30 @@ assignees: "" - [ ] 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 the website (e.g., diffpy.org) are updated. +- [ ] Installation instructions in the README, documentation, and the website 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: +Please tag the maintainer (e.g., @username) in the comment here when you are ready for the 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/`. +- [ ] Docs are deployed successfully to `https:///`. - [ ] 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. +Please let the maintainer 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. +- [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions. +- [ ] Tag the maintainer for conda-forge release. ### Post-release checklist diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 00000000..1099d862 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,15 @@ +### What problem does this PR address? + + + +### What should the reviewer(s) do? + + + + diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index beb05b36..5d80dac2 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -8,12 +8,11 @@ on: jobs: release: - uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 + uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: diffpy.pdffit2 c_extension: true - github_admin_username: sbillinge - + maintainer_GITHUB_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 01849907..bb86a929 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -7,6 +7,6 @@ on: jobs: check-news-item: - uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0 + uses: scikit-package/release-scripts/.github/workflows/_check-news-item.yml@v0 with: project: diffpy.pdffit2 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 ee58ec41..16e00724 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,9 @@ on: jobs: matrix-coverage: - uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 + uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 with: project: diffpy.pdffit2 - python_versions: "3.11, 3.12, 3.13" c_extension: true headless: false secrets: diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index a9b26da9..4af0c50e 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -1,17 +1,12 @@ name: Deploy Documentation on Release on: - release: - types: [published] workflow_dispatch: jobs: docs: - permissions: - contents: write - uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 + uses: scikit-package/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 with: project: diffpy.pdffit2 c_extension: true headless: false - python_version: 3.13 diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 198624a4..b0489e02 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -1,19 +1,15 @@ name: Tests on PR on: - push: - branches: - - main pull_request: workflow_dispatch: jobs: - validate: - uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0 + tests-on-pr: + uses: scikit-package/release-scripts/.github/workflows/_tests-on-pr.yml@v0 with: - project: diffpy.pdffi2 + project: diffpy.pdffit2 c_extension: true headless: false - python_version: 3.13 secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..47f7a017 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,13 @@ +version: 2 + +build: + os: "ubuntu-22.04" + tools: + python: "latest" + +python: + install: + - requirements: requirements/docs.txt + +sphinx: + configuration: doc/source/conf.py From 4e8518641a2e78ee02e4cd83a4bfcfc610e69bd7 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 12 Jun 2025 10:34:14 -0400 Subject: [PATCH 250/294] skpkg: setup.py and pyproject.toml files --- pyproject.toml | 8 ++++---- setup.py | 33 +++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 10 deletions(-) mode change 100755 => 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 8a1b15c5..af52ce04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,13 +6,13 @@ build-backend = "setuptools.build_meta" name = "diffpy.pdffit2" dynamic=['version', 'dependencies'] authors = [ - { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, + { name="Simon Billinge", email="sb2896@columbia.edu" }, ] maintainers = [ - { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, + { name="Simon Billinge", email="sb2896@columbia.edu" }, ] description = "PDFfit2 - real space structure refinement program." -keywords = ["PDF", "structure refinement"] +keywords = ['PDF', 'structure refinement'] readme = "README.rst" requires-python = ">=3.11, <3.14" classifiers = [ @@ -57,7 +57,7 @@ ignore-words = ".codespell/ignore_words.txt" skip = "*.cif,*.dat,*.cc,*.h" [tool.black] -line-length = 115 +line-length = 79 include = '\.pyi?$' exclude = ''' /( diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 index 4633f1a8..57e28713 --- a/setup.py +++ b/setup.py @@ -62,7 +62,8 @@ def get_gsl_config(): return rv else: warnings.warn( - f"CONDA_PREFIX is set to {conda_prefix}, " "but GSL not found at those paths. Proceeding..." + f"CONDA_PREFIX is set to {conda_prefix}, " + "but GSL not found at those paths. Proceeding..." ) # 2. Check using GSL_PATH. @@ -76,7 +77,8 @@ def get_gsl_config(): return rv else: raise EnvironmentError( - f"GSL_PATH={gsl_path} is set, but {inc} or {lib} not found. " "Please verify your GSL_PATH." + f"GSL_PATH={gsl_path} is set, but {inc} or {lib} not found. " + "Please verify your GSL_PATH." ) # 3. Try using the gsl-config executable (only on Unix-like systems). @@ -92,8 +94,14 @@ def get_gsl_config(): lib_match = re.search(r"(?m)^[^#]*\s-L(\S+)", txt) if prefix_match: prefix_path = Path(prefix_match.group(1)) - inc_dir = include_match.group(1) if include_match else (prefix_path / "include") - lib_dir = lib_match.group(1) if lib_match else (prefix_path / "lib") + inc_dir = ( + include_match.group(1) + if include_match + else (prefix_path / "include") + ) + lib_dir = ( + lib_match.group(1) if lib_match else (prefix_path / "lib") + ) rv["include_dirs"].append(str(inc_dir)) rv["library_dirs"].append(str(lib_dir)) return rv @@ -164,7 +172,14 @@ def create_extensions(): compiler_type = get_compiler_type() if compiler_type in ("unix", "cygwin", "mingw32"): - extra_compile_args = ["-std=c++11", "-Wall", "-Wno-write-strings", "-O3", "-funroll-loops", "-ffast-math"] + extra_compile_args = [ + "-std=c++11", + "-Wall", + "-Wno-write-strings", + "-O3", + "-funroll-loops", + "-ffast-math", + ] # Check for static GSL libraries and add them if found. static_libs = [ os.path.join(p, "libgsl.a") @@ -189,15 +204,21 @@ def create_extensions(): "extra_link_args": extra_link_args, "extra_objects": extra_objects, } - ext = Extension("diffpy.pdffit2.pdffit2", glob.glob("src/extensions/**/*.cc"), **ext_kws) + ext = Extension( + "diffpy.pdffit2.pdffit2", + glob.glob("src/extensions/**/*.cc"), + **ext_kws, + ) return [ext] +# Extensions not included in pyproject.toml setup_args = dict( ext_modules=[], cmdclass={"build_ext": CustomBuildExt}, ) + if __name__ == "__main__": setup_args["ext_modules"] = create_extensions() setup(**setup_args) From 419745553d02332f8ded292a70079f5b5a076ad4 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 12 Jun 2025 10:36:23 -0400 Subject: [PATCH 251/294] skpkg: update copyrights in init files --- src/diffpy/__init__.py | 2 +- src/diffpy/pdffit2/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 5b3ab1b5..2efe9395 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -3,7 +3,7 @@ # # (c) 2008 trustees of the Michigan State University. # All rights reserved. -# (c) 2024 The Trustees of Columbia University in the City of New York. +# (c) 2025 The Trustees of Columbia University in the City of New York. # All rights reserved. # # File coded by: Billinge Group members and community contributors. diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index dc8aec45..527477a5 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -3,7 +3,7 @@ # # (c) 2006 trustees of the Michigan State University. # All rights reserved. -# (c) 2024 The Trustees of Columbia University in the City of New York. +# (c) 2025 The Trustees of Columbia University in the City of New York. # All rights reserved. # # File coded by: Billinge Group members and community contributors. From b87f9af42c52add33d6e390a9327a3f1d7bc6a81 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 12 Jun 2025 10:42:57 -0400 Subject: [PATCH 252/294] skpkg: linelength fixes and some copyright updates --- doc/source/conf.py | 42 +++++- src/diffpy/pdffit2/pdffit.py | 42 ++++-- src/diffpy/pdffit2/version.py | 10 +- tests/test_exceptions.py | 260 ++++++++++++++++++++++++++++------ tests/test_pdffit.py | 16 ++- tests/test_phase_fractions.py | 72 ++++++++-- tests/test_shape_factors.py | 8 +- 7 files changed, 371 insertions(+), 79 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index c15e8639..8125a5c7 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# diffpy.pdffit2 documentation build configuration file, created by +# diffpy.pdffit2 documentation build configuration file, created by # noqa: E501 # sphinx-quickstart on Thu Jan 30 15:49:41 2014. # # This file is execfile()d with the current directory set to its @@ -18,6 +18,12 @@ from importlib.metadata import version from pathlib import Path +# Attempt to import the version dynamically from GitHub tag. +try: + fullversion = version("diffpy.pdffit2") +except Exception: + fullversion = "No version found. The correct version will appear in the released version." + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use Path().resolve() to make it absolute, like shown here. @@ -26,7 +32,7 @@ sys.path.insert(0, str(Path("../../src").resolve())) # abbreviations -ab_authors = "Billinge Group members and community contributors" +ab_authors = "Billinge group and community members." # -- General configuration ------------------------------------------------ @@ -43,6 +49,7 @@ "sphinx.ext.viewcode", "sphinx.ext.intersphinx", "sphinx_rtd_theme", + "sphinx_copybutton", "m2r", ] @@ -88,6 +95,11 @@ # substitute YEAR in the copyright string copyright = copyright.replace("%Y", year) +# For sphinx_copybutton extension. +# Do not copy "$" for shell commands in code-blocks. +copybutton_prompt_text = r"^\$ " +copybutton_prompt_is_regexp = True + # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ["build"] @@ -123,6 +135,14 @@ # html_theme = "sphinx_rtd_theme" +html_context = { + "display_github": True, + "github_user": "diffpy", + "github_repo": "diffpy.pdffit2", + "github_version": "main", + "conf_py_path": "/doc/source/", +} + # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. @@ -221,7 +241,13 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ("index", "diffpy.pdffit2.tex", "diffpy.pdffit2 Documentation", ab_authors, "manual"), + ( + "index", + "diffpy.pdffit2.tex", + "diffpy.pdffit2 Documentation", + ab_authors, + "manual", + ), ] # The name of an image file (relative to this directory) to place at the top of @@ -249,7 +275,15 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("index", "diffpy.pdffit2", "diffpy.pdffit2 Documentation", ab_authors, 1)] +man_pages = [ + ( + "index", + "diffpy.pdffit2", + "diffpy.pdffit2 Documentation", + ab_authors, + 1, + ) +] # If true, show URL addresses after external links. # man_show_urls = False diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py index 984d67c9..2e7ce748 100644 --- a/src/diffpy/pdffit2/pdffit.py +++ b/src/diffpy/pdffit2/pdffit.py @@ -138,7 +138,8 @@ def _exportAll(self, namespace): public = [ a for a in dir(self) - if "__" not in a and a not in ["_handle", "_exportAll", "selalias", "FCON", "Sctp"] + if "__" not in a + and a not in ["_handle", "_exportAll", "selalias", "FCON", "Sctp"] ] for funcname in public: namespace[funcname] = getattr(self, funcname) @@ -234,12 +235,16 @@ def read_data_string(self, data, stype, qmax, qdamp, name=""): qdamp -- instrumental Q-resolution factor name -- tag with which to label data """ - pdffit2.read_data_string(self._handle, data, stype.encode(), qmax, qdamp, name) + pdffit2.read_data_string( + self._handle, data, stype.encode(), qmax, qdamp, name + ) name = data self.data_files.append(name) return - def read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, name="list"): + def read_data_lists( + self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, name="list" + ): """read_data_lists(stype, qmax, qdamp, r_data, Gr_data, dGr_data = None, name = "list") --> Read pdf data into memory from lists. @@ -255,7 +260,16 @@ def read_data_lists(self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, na Raises: ValueError when the data lists are of different length """ - pdffit2.read_data_arrays(self._handle, stype.encode(), qmax, qdamp, r_data, Gr_data, dGr_data, name) + pdffit2.read_data_arrays( + self._handle, + stype.encode(), + qmax, + qdamp, + r_data, + Gr_data, + dGr_data, + name, + ) self.data_files.append(name) return @@ -296,7 +310,9 @@ def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): ValueError for bad input values pdffit.unassignedError when no structure has been loaded """ - pdffit2.alloc(self._handle, stype.encode(), qmax, qdamp, rmin, rmax, bin) + pdffit2.alloc( + self._handle, stype.encode(), qmax, qdamp, rmin, rmax, bin + ) return def calc(self): @@ -876,8 +892,13 @@ def blen(self, *args): ij = (args[0], args[1]) # indices were already checked in bond_length_atoms call assert (0 <= min(ij) - 1) and (max(ij) - 1 < len(atom_symbols)) - symij = (atom_symbols[ij[0] - 1].upper(), atom_symbols[ij[1] - 1].upper()) - print(_format_bond_length(dij, ddij, ij, symij), file=output.stdout) + symij = ( + atom_symbols[ij[0] - 1].upper(), + atom_symbols[ij[1] - 1].upper(), + ) + print( + _format_bond_length(dij, ddij, ij, symij), file=output.stdout + ) # second form elif len(args) == 4: a1, a2, lb, ub = args @@ -892,7 +913,12 @@ def blen(self, *args): return # arguments are OK here, get bond length dictionary bld = pdffit2.bond_length_types(self._handle, a1, a2, lb, ub) - s = "(%s,%s) bond lengths in [%gA,%gA] for current phase :" % (a1, a2, lb, ub) + s = "(%s,%s) bond lengths in [%gA,%gA] for current phase :" % ( + a1, + a2, + lb, + ub, + ) print(s, file=output.stdout) atom_symbols = self.get_atoms() npts = len(bld["dij"]) diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 6847d8e4..a09785ea 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################## # -# (c) 2024 The Trustees of Columbia University in the City of New York. +# (c) 2025 The Trustees of Columbia University in the City of New York. # All rights reserved. # # File coded by: Billinge Group members and community contributors. @@ -38,7 +38,9 @@ def get_pypi_release_date(package_name, timeout=5): installed_version = version(package_name) release_data = data["releases"].get(installed_version, []) if not release_data: - raise ValueError(f"No release data found for version {installed_version}") + raise ValueError( + f"No release data found for version {installed_version}" + ) release_date_str = release_data[-1]["upload_time"] release_date = datetime.datetime.fromisoformat(release_date_str).date() @@ -48,7 +50,9 @@ def get_pypi_release_date(package_name, timeout=5): except (ValueError, OSError) as e: print(f"Warning: Could not fetch release date from PyPI: {e}") - release_date = datetime.datetime.fromtimestamp(package_file.stat().st_ctime).isoformat() + release_date = datetime.datetime.fromtimestamp( + package_file.stat().st_ctime + ).isoformat() return str(release_date) diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index 012b76d3..83f2b375 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -38,12 +38,20 @@ def test_IOError(self): def test_structureError(self): """Raise pdffit2.structureError when structure is malformed.""" - self.assertRaises(pdffit2.structureError, self.P.read_struct, self.datafile("badNi.stru")) + self.assertRaises( + pdffit2.structureError, + self.P.read_struct, + self.datafile("badNi.stru"), + ) def test_structureErrorZeroVolume(self): """Raise pdffit2.structureError when unit cell volume is negative.""" # I don't know how to test for this, but it's in the library code - self.assertRaises(pdffit2.structureError, self.P.read_struct, self.datafile("badNiZeroVolume.stru")) + self.assertRaises( + pdffit2.structureError, + self.P.read_struct, + self.datafile("badNiZeroVolume.stru"), + ) class read_dataExceptions(unittest.TestCase): @@ -59,11 +67,20 @@ def tearDown(self): def test_IOError(self): """Raise IOError when data file does not exist.""" - self.assertRaises(IOError, self.P.read_data, "Nofile.dat", "X", 25.0, 0.5) + self.assertRaises( + IOError, self.P.read_data, "Nofile.dat", "X", 25.0, 0.5 + ) def test_dataError(self): """Raise pdffit2.dataError when data has improper spacing.""" - self.assertRaises(pdffit2.dataError, self.P.read_data, self.datafile("badNi.dat"), "X", 25.0, 0.5) + self.assertRaises( + pdffit2.dataError, + self.P.read_data, + self.datafile("badNi.dat"), + "X", + 25.0, + 0.5, + ) class read_data_listsExceptions(unittest.TestCase): @@ -84,26 +101,50 @@ def tearDown(self): def test_ValueError1(self): """Raise ValueError when lists are of different length.""" self.assertRaises( - ValueError, self.P.read_data_lists, "X", self.qmax, self.qdamp, self.r_data, self.Gr_data + ValueError, + self.P.read_data_lists, + "X", + self.qmax, + self.qdamp, + self.r_data, + self.Gr_data, ) def test_ValueError2(self): """Raise ValueError when qmax < 0.""" self.assertRaises( - ValueError, self.P.read_data_lists, "X", -self.qmax, self.qdamp, self.r_data, self.Gr_data + ValueError, + self.P.read_data_lists, + "X", + -self.qmax, + self.qdamp, + self.r_data, + self.Gr_data, ) def test_ValueError3(self): """Raise ValueError when qdamp < 0.""" self.assertRaises( - ValueError, self.P.read_data_lists, "X", self.qmax, -self.qdamp, self.r_data, self.Gr_data + ValueError, + self.P.read_data_lists, + "X", + self.qmax, + -self.qdamp, + self.r_data, + self.Gr_data, ) def test_dataError(self): """Raise pdffit2.dataError when data has improper spacing.""" r_data = [0.1, 0.52, 0.2] self.assertRaises( - pdffit2.dataError, self.P.read_data_lists, "X", self.qmax, self.qdamp, r_data, self.Gr_data + pdffit2.dataError, + self.P.read_data_lists, + "X", + self.qmax, + self.qdamp, + r_data, + self.Gr_data, ) @@ -123,17 +164,23 @@ def tearDown(self): def test_ValueError1(self): """Raise ValueError when iset does not exist.""" - self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmin, self.rmax) + self.assertRaises( + ValueError, self.P.pdfrange, self.iset, self.rmin, self.rmax + ) def test_ValueError2(self): """Raise ValueError when rmax < rmin.""" self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertRaises(ValueError, self.P.pdfrange, self.iset, self.rmax, self.rmin) + self.assertRaises( + ValueError, self.P.pdfrange, self.iset, self.rmax, self.rmin + ) def test_ValueError3(self): """Raise ValueError when range outside of data.""" self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertRaises(ValueError, self.P.pdfrange, self.iset, -self.rmin, self.rmax) + self.assertRaises( + ValueError, self.P.pdfrange, self.iset, -self.rmin, self.rmax + ) class allocExceptions(unittest.TestCase): @@ -155,37 +202,100 @@ def tearDown(self): def test_ValueError1(self): """Raise ValueError when qmax < 0.""" self.P.read_struct(self.datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", -self.qmax, self.qdamp, self.rmin, self.rmax, self.bin) + self.assertRaises( + ValueError, + self.P.alloc, + "X", + -self.qmax, + self.qdamp, + self.rmin, + self.rmax, + self.bin, + ) def test_ValueError2(self): """Raise ValueError when qdamp < 0.""" self.P.read_struct(self.datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, -self.qdamp, self.rmin, self.rmax, self.bin) + self.assertRaises( + ValueError, + self.P.alloc, + "X", + self.qmax, + -self.qdamp, + self.rmin, + self.rmax, + self.bin, + ) def test_ValueError3(self): """Raise ValueError when rmin < 0.""" self.P.read_struct(self.datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, -self.rmin, self.rmax, self.bin) + self.assertRaises( + ValueError, + self.P.alloc, + "X", + self.qmax, + self.qdamp, + -self.rmin, + self.rmax, + self.bin, + ) def test_ValueError4(self): """Raise ValueError when rmax < 0.""" self.P.read_struct(self.datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, -self.rmax, self.bin) + self.assertRaises( + ValueError, + self.P.alloc, + "X", + self.qmax, + self.qdamp, + self.rmin, + -self.rmax, + self.bin, + ) def test_ValueError5(self): """Raise ValueError when bin < 0.""" self.P.read_struct(self.datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) + self.assertRaises( + ValueError, + self.P.alloc, + "X", + self.qmax, + self.qdamp, + self.rmin, + self.rmax, + -self.bin, + ) def test_ValueError6(self): """Raise ValueError when rmax < rmin.""" self.P.read_struct(self.datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmax, self.rmin, self.bin) + self.assertRaises( + ValueError, + self.P.alloc, + "X", + self.qmax, + self.qdamp, + self.rmax, + self.rmin, + self.bin, + ) def test_ValueError7(self): """Raise ValueError when qdamp < 0.""" self.P.read_struct(self.datafile("Ni.stru")) - self.assertRaises(ValueError, self.P.alloc, "X", self.qmax, self.qdamp, self.rmin, self.rmax, -self.bin) + self.assertRaises( + ValueError, + self.P.alloc, + "X", + self.qmax, + self.qdamp, + self.rmin, + self.rmax, + -self.bin, + ) class calcExceptions(unittest.TestCase): @@ -265,11 +375,15 @@ def test_IOError(self): self.P.read_struct(self.datafile("Ni.stru")) self.P.alloc("X", 30.0, 0.05, 2, 10, 100) self.P.calc() - self.assertRaises(IOError, self.P.save_pdf, 1, "nodir183160/" + self.strufile) + self.assertRaises( + IOError, self.P.save_pdf, 1, "nodir183160/" + self.strufile + ) def test_unassignedError(self): """Raise pdffit2.unassignedError when structure is undefined.""" - self.assertRaises(pdffit2.unassignedError, self.P.save_pdf, 1, self.strufile) + self.assertRaises( + pdffit2.unassignedError, self.P.save_pdf, 1, self.strufile + ) class save_difExceptions(unittest.TestCase): @@ -290,11 +404,15 @@ def test_IOError(self): self.P.alloc("X", 30.0, 0.05, 2, 10, 100) self.P.calc() self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.5) - self.assertRaises(IOError, self.P.save_dif, 1, "nodir183160/" + self.strufile) + self.assertRaises( + IOError, self.P.save_dif, 1, "nodir183160/" + self.strufile + ) def test_unassignedError(self): """Raise pdffit2.unassignedError when structure is undefined.""" - self.assertRaises(pdffit2.unassignedError, self.P.save_dif, 1, self.strufile) + self.assertRaises( + pdffit2.unassignedError, self.P.save_dif, 1, self.strufile + ) class save_resExceptions(unittest.TestCase): @@ -317,11 +435,15 @@ def test_IOError(self): self.P.setpar(1, 3.0) self.P.pdfrange(1, 2.0, 10.0) self.P.refine_step() - self.assertRaises(IOError, self.P.save_res, "nodir183160/" + self.resfile) + self.assertRaises( + IOError, self.P.save_res, "nodir183160/" + self.resfile + ) def test_unassignedError(self): """Raise pdffit2.unassignedError when structure is undefined.""" - self.assertRaises(pdffit2.unassignedError, self.P.save_res, self.resfile) + self.assertRaises( + pdffit2.unassignedError, self.P.save_res, self.resfile + ) class save_structExceptions(unittest.TestCase): @@ -341,11 +463,15 @@ def tearDown(self): def test_IOError(self): """Raise IOError when structure cannot be saved.""" self.P.read_struct(self.datafile("Ni.stru")) - self.assertRaises(IOError, self.P.save_struct, 1, "nodir183160/" + self.strufile) + self.assertRaises( + IOError, self.P.save_struct, 1, "nodir183160/" + self.strufile + ) def test_unassignedError(self): """Raise pdffit2.unassignedError when structure is undefined.""" - self.assertRaises(pdffit2.unassignedError, self.P.save_struct, 1, self.strufile) + self.assertRaises( + pdffit2.unassignedError, self.P.save_struct, 1, self.strufile + ) class constrainExceptions(unittest.TestCase): @@ -374,7 +500,9 @@ def test_constraintError(self): def test_unassignedError(self): """Raise pdffit2.unassignedError when variable is undefined.""" - self.assertRaises(pdffit2.unassignedError, self.P.constrain, self.P.x(1), self.par) + self.assertRaises( + pdffit2.unassignedError, self.P.constrain, self.P.x(1), self.par + ) return def test_ValueError(self): @@ -387,9 +515,15 @@ def test_constrainNonRefVar(self): "raise constraintError when attempting to constrain non-refinables" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", "@7") - self.assertRaises(pdffit2.constraintError, self.P.constrain, "rcut", 13) - self.assertRaises(pdffit2.constraintError, self.P.constrain, "stepcut", "@17") + self.assertRaises( + pdffit2.constraintError, self.P.constrain, "rcut", "@7" + ) + self.assertRaises( + pdffit2.constraintError, self.P.constrain, "rcut", 13 + ) + self.assertRaises( + pdffit2.constraintError, self.P.constrain, "stepcut", "@17" + ) return @@ -407,7 +541,9 @@ def tearDown(self): def test_unassignedError(self): """Raise pdffit2.unassignedError when variable is undefined.""" - self.assertRaises(pdffit2.unassignedError, self.P.setvar, self.P.lat(1), self.val) + self.assertRaises( + pdffit2.unassignedError, self.P.setvar, self.P.lat(1), self.val + ) def test_ValueError(self): """Raise ValueError when a variable index does not exist.""" @@ -428,7 +564,9 @@ def tearDown(self): def test_unassignedError(self): """Raise pdffit2.unassignedError when variable is undefined.""" - self.assertRaises(pdffit2.unassignedError, self.P.getvar, self.P.pscale()) + self.assertRaises( + pdffit2.unassignedError, self.P.getvar, self.P.pscale() + ) def test_ValueError(self): """Raise ValueError when a variable index does not exist.""" @@ -572,7 +710,14 @@ def tearDown(self): def test_unassignedError1(self): """Raise pdffit2.unassignedError when set does not exist.""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, self.iset, "i", "Ni", True) + self.assertRaises( + pdffit2.unassignedError, + self.P.selectAtomType, + self.iset, + "i", + "Ni", + True, + ) def test_unassignedError2(self): """Raise pdffit2.unassignedError when set does not exist.""" @@ -582,7 +727,9 @@ def test_unassignedError2(self): self.P.selectAtomType(self.iset, "i", "Ni", True) self.P.selectAtomType(self.iset, "j", "Ni", False) # but fail for phase 2 which is not present - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomType, 2, "i", "Ca", True) + self.assertRaises( + pdffit2.unassignedError, self.P.selectAtomType, 2, "i", "Ca", True + ) def test_ijcharValueError(self): """Raise ValueError when ijchar is neither 'i' nor 'j'.""" @@ -590,7 +737,9 @@ def test_ijcharValueError(self): self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.selectAtomType(self.iset, "i", "Ni", True) self.P.selectAtomType(self.iset, "j", "Ni", True) - self.assertRaises(ValueError, self.P.selectAtomType, self.iset, "k", "Ni", True) + self.assertRaises( + ValueError, self.P.selectAtomType, self.iset, "k", "Ni", True + ) class selectAtomIndexExceptions(unittest.TestCase): @@ -608,7 +757,14 @@ def tearDown(self): def test_unassignedError1(self): """Raise pdffit2.unassignedError when set does not exist.""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, self.iset, "i", self.i, True) + self.assertRaises( + pdffit2.unassignedError, + self.P.selectAtomIndex, + self.iset, + "i", + self.i, + True, + ) def test_unassignedError2(self): """Raise pdffit2.unassignedError when set does not exist.""" @@ -618,13 +774,17 @@ def test_unassignedError2(self): self.P.selectAtomIndex(self.iset, "i", 1, True) self.P.selectAtomIndex(self.iset, "i", 2, False) # fail for phase 2 - self.assertRaises(pdffit2.unassignedError, self.P.selectAtomIndex, 2, "i", 1, True) + self.assertRaises( + pdffit2.unassignedError, self.P.selectAtomIndex, 2, "i", 1, True + ) def test_ValueError(self): """Raise ValueError when selected atom does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) - self.assertRaises(ValueError, self.P.selectAtomIndex, self.iset, "i", 6, True) + self.assertRaises( + ValueError, self.P.selectAtomIndex, self.iset, "i", 6, True + ) class selectAllExceptions(unittest.TestCase): @@ -642,13 +802,17 @@ def tearDown(self): def test_unassignedError1(self): """Raise pdffit2.unassignedError when set does not exist.""" - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") + self.assertRaises( + pdffit2.unassignedError, self.P.selectAll, self.iset, "i" + ) def test_unassignedError2(self): """Raise pdffit2.unassignedError when set does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) # fail when there is no dataset - self.assertRaises(pdffit2.unassignedError, self.P.selectAll, self.iset, "i") + self.assertRaises( + pdffit2.unassignedError, self.P.selectAll, self.iset, "i" + ) # pass with dataset self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.selectAll(self.iset, "i") @@ -673,13 +837,17 @@ def tearDown(self): def test_unassignedError1(self): """Raise pdffit2.unassignedError when set does not exist.""" - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") + self.assertRaises( + pdffit2.unassignedError, self.P.selectNone, self.iset, "i" + ) def test_unassignedError2(self): """Raise pdffit2.unassignedError when set does not exist.""" self.P.read_struct(self.datafile("Ni.stru")) # fail when there is no dataset - self.assertRaises(pdffit2.unassignedError, self.P.selectNone, self.iset, "i") + self.assertRaises( + pdffit2.unassignedError, self.P.selectNone, self.iset, "i" + ) # pass with dataset self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.selectNone(self.iset, "i") @@ -705,7 +873,9 @@ def tearDown(self): def test_unassignedError(self): """Raise pdffit2.unassignedError when phase does not exist.""" - self.assertRaises(pdffit2.unassignedError, self.P.bang, self.a1, self.a2, self.a3) + self.assertRaises( + pdffit2.unassignedError, self.P.bang, self.a1, self.a2, self.a3 + ) def test_ValueError1(self): """Raise ValueError when selected atom(s) does not exist.""" @@ -739,7 +909,9 @@ def tearDown(self): def test_unassignedError(self): """Raise pdffit2.unassignedError when no data exists.""" - self.assertRaises(pdffit2.unassignedError, self.P.blen, self.a1, self.a2) + self.assertRaises( + pdffit2.unassignedError, self.P.blen, self.a1, self.a2 + ) def test_ValueError1(self): """Raise ValueError when selected atom(s) does not exist.""" diff --git a/tests/test_pdffit.py b/tests/test_pdffit.py index ee1e7152..7336f0e6 100644 --- a/tests/test_pdffit.py +++ b/tests/test_pdffit.py @@ -259,7 +259,9 @@ def test_get_atoms(self): a1 = self.P.get_atoms() a2 = self.P.get_atoms(2) self.assertEqual(4 * ["NI"], a1) - self.assertEqual(8 * ["PB"] + 24 * ["O"] + 8 * ["SC"] + 8 * ["W"] + 8 * ["TI"], a2) + self.assertEqual( + 8 * ["PB"] + 24 * ["O"] + 8 * ["SC"] + 8 * ["W"] + 8 * ["TI"], a2 + ) return def test_get_atom_types(self): @@ -418,7 +420,9 @@ def doalloc(): self.P.psel("ALL") self.P.calc() Gall = self.P.getpdf_fit() - dGmax = max([abs(g1 + g2 - gall) for g1, g2, gall in zip(G1, G2, Gall)]) + dGmax = max( + [abs(g1 + g2 - gall) for g1, g2, gall in zip(G1, G2, Gall)] + ) self.assertAlmostEqual(0, dGmax, self.places) self.assertRaises(pdffit2.unassignedError, self.P.psel, 10) self.assertRaises(pdffit2.unassignedError, self.P.psel, 0) @@ -534,7 +538,9 @@ def test_bond_length_types(self): # 4 Ni atoms with coordination 12 self.assertEqual(4 * 12, len(dfcc["dij"])) # invalid element - self.assertRaises(ValueError, self.P.bond_length_types, "Ni", "Nix", 0.1, 5.0) + self.assertRaises( + ValueError, self.P.bond_length_types, "Ni", "Nix", 0.1, 5.0 + ) # check indices ij0 allij0 = sum(dfcc["ij0"], tuple()) self.assertEqual(0, min(allij0)) @@ -605,7 +611,9 @@ def test_get_scat(self): def test_set_scat(self): """Check PdfFit.set_scat()""" # raises exception when no phase exists - self.assertRaises(pdffit2.unassignedError, self.P.set_scat, "N", "Ti", -11) + self.assertRaises( + pdffit2.unassignedError, self.P.set_scat, "N", "Ti", -11 + ) # check if it is local to phase fPb = self.P.get_scat("X", "Pb") bPb = self.P.get_scat("N", "Pb") diff --git a/tests/test_phase_fractions.py b/tests/test_phase_fractions.py index 62c9c8e5..ac33ec61 100644 --- a/tests/test_phase_fractions.py +++ b/tests/test_phase_fractions.py @@ -38,11 +38,21 @@ def test_xray_fractions(self): self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) self.assertAlmostEqual(1.0, sum(ph["mass"]), self.places) - self.assertAlmostEqual(bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places) - self.assertAlmostEqual(bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places) + self.assertAlmostEqual( + bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places + ) + self.assertAlmostEqual( + bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places + ) mavg1 = 58.69 - mavg2 = (8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90) / 40.0 - self.assertAlmostEqual(bb2 / bb1 * mavg1 / mavg2, ph["mass"][0] / ph["mass"][1], self.places) + mavg2 = ( + 8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90 + ) / 40.0 + self.assertAlmostEqual( + bb2 / bb1 * mavg1 / mavg2, + ph["mass"][0] / ph["mass"][1], + self.places, + ) self.assertEqual(0.0, sum(ph["stdatom"])) self.assertEqual(0.0, sum(ph["stdcell"])) self.assertEqual(0.0, sum(ph["stdmass"])) @@ -52,9 +62,21 @@ def test_xray_fractions(self): self.assertAlmostEqual(1.0, sum(ph2["atom"]), self.places) self.assertAlmostEqual(1.0, sum(ph2["cell"]), self.places) self.assertAlmostEqual(1.0, sum(ph2["mass"]), self.places) - self.assertAlmostEqual(2.0, ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), self.places) + self.assertAlmostEqual( + 2.0, + ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), + self.places, + ) + self.assertAlmostEqual( + 2.0, + ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), + self.places, + ) + self.assertAlmostEqual( + 2.0, + ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), + self.places, + ) return def test_neutron_fractions(self): @@ -71,11 +93,21 @@ def test_neutron_fractions(self): self.assertAlmostEqual(1.0, sum(ph["atom"]), self.places) self.assertAlmostEqual(1.0, sum(ph["cell"]), self.places) self.assertAlmostEqual(1.0, sum(ph["mass"]), self.places) - self.assertAlmostEqual(bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places) - self.assertAlmostEqual(bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places) + self.assertAlmostEqual( + bb2 / bb1, ph["atom"][0] / ph["atom"][1], self.places + ) + self.assertAlmostEqual( + bb2 / bb1 * 40.0 / 4.0, ph["cell"][0] / ph["cell"][1], self.places + ) mavg1 = 58.69 - mavg2 = (8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90) / 40.0 - self.assertAlmostEqual(bb2 / bb1 * mavg1 / mavg2, ph["mass"][0] / ph["mass"][1], self.places) + mavg2 = ( + 8 * 207.19 + 24 * 15.994 + 4 * 44.956 + 2 * 183.85 + 2 * 47.90 + ) / 40.0 + self.assertAlmostEqual( + bb2 / bb1 * mavg1 / mavg2, + ph["mass"][0] / ph["mass"][1], + self.places, + ) self.assertEqual(0.0, sum(ph["stdatom"])) self.assertEqual(0.0, sum(ph["stdcell"])) self.assertEqual(0.0, sum(ph["stdmass"])) @@ -85,9 +117,21 @@ def test_neutron_fractions(self): self.assertAlmostEqual(1.0, sum(ph2["atom"]), self.places) self.assertAlmostEqual(1.0, sum(ph2["cell"]), self.places) self.assertAlmostEqual(1.0, sum(ph2["mass"]), self.places) - self.assertAlmostEqual(2.0, ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), self.places) - self.assertAlmostEqual(2.0, ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), self.places) + self.assertAlmostEqual( + 2.0, + ph2["atom"][0] / ph2["atom"][1] / (ph["atom"][0] / ph["atom"][1]), + self.places, + ) + self.assertAlmostEqual( + 2.0, + ph2["cell"][0] / ph2["cell"][1] / (ph["cell"][0] / ph["cell"][1]), + self.places, + ) + self.assertAlmostEqual( + 2.0, + ph2["mass"][0] / ph2["mass"][1] / (ph["mass"][0] / ph["mass"][1]), + self.places, + ) return diff --git a/tests/test_shape_factors.py b/tests/test_shape_factors.py index 62d13844..110ce553 100644 --- a/tests/test_shape_factors.py +++ b/tests/test_shape_factors.py @@ -173,7 +173,9 @@ def test_spdiameter_io(self): self.assertEqual(14.0, self.P.getvar("spdiameter")) # try to read invalid shape data sinvalid = re.sub("(?m)^shape .*", "shape invalid, 1", spd7) - self.assertRaises(pdffit2.structureError, self.P.read_struct_string, sinvalid) + self.assertRaises( + pdffit2.structureError, self.P.read_struct_string, sinvalid + ) return @@ -269,7 +271,9 @@ def test_stepcut_io(self): self.assertEqual(14.0, self.P.getvar("stepcut")) # try to read invalid shape data sinvalid = re.sub("(?m)^shape .*", "shape invalid, 1", ssc7) - self.assertRaises(pdffit2.structureError, self.P.read_struct_string, sinvalid) + self.assertRaises( + pdffit2.structureError, self.P.read_struct_string, sinvalid + ) return From e129280d7c3737c19771e0b1e6887c4eedf725d9 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 12 Jun 2025 10:45:22 -0400 Subject: [PATCH 253/294] skpkg: remove noqa --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 8125a5c7..742d3a53 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# diffpy.pdffit2 documentation build configuration file, created by # noqa: E501 +# diffpy.pdffit2 documentation build configuration file, created by # sphinx-quickstart on Thu Jan 30 15:49:41 2014. # # This file is execfile()d with the current directory set to its From 74add763886c968cd7b77af624a37d366f1ae812 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 12 Jun 2025 10:49:51 -0400 Subject: [PATCH 254/294] chore: news --- news/setup-CI.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/setup-CI.rst diff --git a/news/setup-CI.rst b/news/setup-CI.rst new file mode 100644 index 00000000..4017a8ed --- /dev/null +++ b/news/setup-CI.rst @@ -0,0 +1,23 @@ +**Added:** + +* No news needed: line length fixes and other adjustments to copyright year. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 11fb1656fa6e196e04abc5eaa854d1be5b88c49d Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 12 Jun 2025 13:49:00 -0400 Subject: [PATCH 255/294] skpkg: gitignore update --- .gitignore | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a25212ea..099e2948 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__/ .Python env/ build/ +_build/ develop-eggs/ dist/ downloads/ @@ -90,10 +91,3 @@ target/ # Ipython Notebook .ipynb_checkpoints - -# version information -setup.cfg -/src/diffpy/*/version.cfg - -# Rever -rever/ From 106ffb7c4f7854d7689fe3f979087e346081113a Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 12 Jun 2025 16:37:35 -0400 Subject: [PATCH 256/294] remove numpy from dependencies --- requirements/conda.txt | 1 - requirements/pip.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/requirements/conda.txt b/requirements/conda.txt index 4278ea13..9cc306b0 100644 --- a/requirements/conda.txt +++ b/requirements/conda.txt @@ -1,2 +1 @@ diffpy.structure -numpy diff --git a/requirements/pip.txt b/requirements/pip.txt index 4278ea13..9cc306b0 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,2 +1 @@ diffpy.structure -numpy From c6d13b01d7824a20e996a3368c42f3e54a82215f Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Fri, 13 Jun 2025 10:48:30 -0400 Subject: [PATCH 257/294] skpkg: small changes to rst file formating in docs, changelog, and readme --- CHANGELOG.rst | 4 +-- README.rst | 42 +++++++++++++++---------------- doc/source/api/diffpy.pdffit2.rst | 6 +++-- doc/source/index.rst | 16 ++++++++---- news/rst-migration.rst | 23 +++++++++++++++++ src/diffpy/pdffit2/version.py | 2 ++ 6 files changed, 62 insertions(+), 31 deletions(-) create mode 100644 news/rst-migration.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 40492b28..1253f933 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,5 @@ ============= -Release Notes +Release notes ============= .. current developments @@ -65,7 +65,7 @@ Release Notes * No notable functional changes from 1.4.1 1.4.4rc0 -===== +======== **Fixed:** diff --git a/README.rst b/README.rst index dbc10c66..4c90e849 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ :target: https://diffpy.github.io/diffpy.pdffit2 :height: 100px -|PyPi| |Forge| |PythonVersion| |PR| +|PyPI| |Forge| |PythonVersion| |PR| |CI| |Codecov| |Black| |Tracking| @@ -26,7 +26,7 @@ .. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff -.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.pdffit2 +.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.pdffit2 :target: https://pypi.org/project/diffpy.pdffit2/ .. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.pdffit2 @@ -87,19 +87,17 @@ The preferred method is to use `Miniconda Python `_ and install from the "conda-forge" channel of Conda packages. -Add the "conda-forge" channel by running the following command in a terminal: :: +To add "conda-forge" to the conda channels, run the following in a terminal. :: conda config --add channels conda-forge -Create a new environment named ``diffpy.pdffit2_env`` and install ``diffpy.pdffit2``: :: +We want to install our packages in a suitable conda environment. +The following creates and activates a new environment named ``diffpy.pdffit2_env`` :: conda create -n diffpy.pdffit2_env diffpy.pdffit2 - -Activate the environment: :: - conda activate diffpy.pdffit2_env -Confirm that the installation was successful: :: +To confirm that the installation was successful, type :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" @@ -118,25 +116,20 @@ Install pdffit2 using ``pip`` to download and install the latest version from `P pip install diffpy.pdffit2 -Confirm that the installation was successful: :: +To confirm that the installation was successful, type :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" -Build from source -~~~~~~~~~~~~~~~~~ +If you prefer to install from sources, after installing the dependencies, obtain the source archive from +`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory +and run the following :: -For advanced users, obtain the source archive, and in the ``diffpy.pdffit2`` directory, run :: + pip install . - conda create -n diffpy.pdffit2_env python=3.13 \ - --file requirements/test.txt \ - --file requirements/conda.txt \ - --file requirements/build.txt +Getting Started +--------------- -Activate the environment, build the package, and run unit tests by following commands sequentially: :: - - conda activate diffpy.pdffit2_env - pip install . --no-deps - pytest +You may consult our `online documentation `_ for tutorials and API references. Support and Contribute ---------------------- @@ -182,4 +175,9 @@ Before contributing, please read our `Code of Conduct `_ or email Prof. Simon Billinge at sb2896@columbia.edu. +For more information on diffpy.pdffit2 please visit the project `web-page `_ or email Simon Billinge at sb2896@columbia.edu. + +Acknowledgements +---------------- + +``diffpy.pdffit2`` is built and maintained with `scikit-package `_. diff --git a/doc/source/api/diffpy.pdffit2.rst b/doc/source/api/diffpy.pdffit2.rst index 759fb63c..9bbc4637 100644 --- a/doc/source/api/diffpy.pdffit2.rst +++ b/doc/source/api/diffpy.pdffit2.rst @@ -1,7 +1,9 @@ :tocdepth: -1 -diffpy.pdffit2 package -====================== +|title| +======= + +.. |title| replace:: diffpy.pdffit2 package .. automodule:: diffpy.pdffit2 :members: diff --git a/doc/source/index.rst b/doc/source/index.rst index a7eff2a9..866af1a9 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -4,9 +4,9 @@ .. |title| replace:: diffpy.pdffit2 documentation -diffpy.pdffit2 - PDFfit2 - real space structure refinement program. +``diffpy.pdffit2`` - PDFfit2 - real space structure refinement program. -| Software version |release|. +| Software version |release| | Last updated |today|. The diffpy.pdffit2 package provides functions for the calculation and @@ -75,19 +75,25 @@ in your publication: Installation ============ -Please see the `README `_ +See the `README `_ file included with the distribution. +================ +Acknowledgements +================ + +``diffpy.pdffit2`` is built and maintained with `scikit-package `_. + ================= Table of contents ================= .. toctree:: :titlesonly: - license - release examples Package API + release + license ======= Indices diff --git a/news/rst-migration.rst b/news/rst-migration.rst new file mode 100644 index 00000000..e010dcad --- /dev/null +++ b/news/rst-migration.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Migrate documentation to `scikit-package 0.1.0` standards, including a mock import for API rendering. + +**Security:** + +* diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index a09785ea..86159280 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -61,3 +61,5 @@ def get_pypi_release_date(package_name, timeout=5): __date__ = get_pypi_release_date("diffpy.pdffit2") # End of file + +# Release date: 2025-02-07 From 1aef0912573c1b6bc8182ad9abbd01f7d3a7f5d8 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Fri, 13 Jun 2025 10:48:58 -0400 Subject: [PATCH 258/294] skpkg: change copyright to 2025 in LICENSE.rst --- LICENSE.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.rst b/LICENSE.rst index 5862f0d6..040c880d 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -13,7 +13,7 @@ the following paper in your publication: in crystals (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) Copyright 2006-2007, Board of Trustees of Michigan State University, -Copyright 2008-2024, Board of Trustees of Columbia University in the +Copyright 2008-2025, Board of Trustees of Columbia University in the city of New York. (Copyright holder indicated in each source file). For more information please visit the project web-page: From a921646b132bc51f54356263c2fe5cbd4cf428cb Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Fri, 13 Jun 2025 10:49:35 -0400 Subject: [PATCH 259/294] docs: autodoc mock imports for doc rendering --- doc/source/conf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 742d3a53..58fb11f6 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -53,6 +53,10 @@ "m2r", ] +autodoc_mock_imports = [ + "diffpy.pdffit2.pdffit2", +] + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] From 4f5d7a7a263ac6e59d612b5ab1fe81a890145a77 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Fri, 13 Jun 2025 10:50:31 -0400 Subject: [PATCH 260/294] skpkg: update copyright to 2025 in license.rst --- doc/source/license.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/license.rst b/doc/source/license.rst index e8729103..fbdd3edc 100644 --- a/doc/source/license.rst +++ b/doc/source/license.rst @@ -17,7 +17,7 @@ the following paper in your publication: in crystals (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) Copyright 2006-2007, Board of Trustees of Michigan State University, -Copyright 2008-|year|, Board of Trustees of Columbia University in the +Copyright 2008-2025, Board of Trustees of Columbia University in the city of New York. (Copyright holder indicated in each source file). For more information please visit the project web-page: From b7021fe463ad54c090d2f77e03a7e25c1e243906 Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 18 Sep 2025 20:39:05 -0500 Subject: [PATCH 261/294] Remove mac static GSL linking logic, use shared. Add gsl to conda requirements. Change doc to docs for skpkg standard. --- {doc => docs}/Makefile | 0 {doc => docs}/make.bat | 0 {doc => docs}/source/_static/.placeholder | 0 {doc => docs}/source/api/diffpy.pdffit2.rst | 0 {doc => docs}/source/conf.py | 0 {doc => docs}/source/examples.rst | 0 {doc => docs}/source/examples/Ni-xray.gr | 0 {doc => docs}/source/examples/Ni.stru | 0 .../source/examples/Ni_calculation.py | 0 .../source/examples/Ni_refinement.py | 0 {doc => docs}/source/index.rst | 0 {doc => docs}/source/license.rst | 0 {doc => docs}/source/release.rst | 0 news/build.rst | 24 +++++++++++++++++++ requirements/conda.txt | 1 + setup.py | 16 +------------ 16 files changed, 26 insertions(+), 15 deletions(-) rename {doc => docs}/Makefile (100%) rename {doc => docs}/make.bat (100%) rename {doc => docs}/source/_static/.placeholder (100%) rename {doc => docs}/source/api/diffpy.pdffit2.rst (100%) rename {doc => docs}/source/conf.py (100%) rename {doc => docs}/source/examples.rst (100%) rename {doc => docs}/source/examples/Ni-xray.gr (100%) rename {doc => docs}/source/examples/Ni.stru (100%) rename {doc => docs}/source/examples/Ni_calculation.py (100%) rename {doc => docs}/source/examples/Ni_refinement.py (100%) rename {doc => docs}/source/index.rst (100%) rename {doc => docs}/source/license.rst (100%) rename {doc => docs}/source/release.rst (100%) create mode 100644 news/build.rst diff --git a/doc/Makefile b/docs/Makefile similarity index 100% rename from doc/Makefile rename to docs/Makefile diff --git a/doc/make.bat b/docs/make.bat similarity index 100% rename from doc/make.bat rename to docs/make.bat diff --git a/doc/source/_static/.placeholder b/docs/source/_static/.placeholder similarity index 100% rename from doc/source/_static/.placeholder rename to docs/source/_static/.placeholder diff --git a/doc/source/api/diffpy.pdffit2.rst b/docs/source/api/diffpy.pdffit2.rst similarity index 100% rename from doc/source/api/diffpy.pdffit2.rst rename to docs/source/api/diffpy.pdffit2.rst diff --git a/doc/source/conf.py b/docs/source/conf.py similarity index 100% rename from doc/source/conf.py rename to docs/source/conf.py diff --git a/doc/source/examples.rst b/docs/source/examples.rst similarity index 100% rename from doc/source/examples.rst rename to docs/source/examples.rst diff --git a/doc/source/examples/Ni-xray.gr b/docs/source/examples/Ni-xray.gr similarity index 100% rename from doc/source/examples/Ni-xray.gr rename to docs/source/examples/Ni-xray.gr diff --git a/doc/source/examples/Ni.stru b/docs/source/examples/Ni.stru similarity index 100% rename from doc/source/examples/Ni.stru rename to docs/source/examples/Ni.stru diff --git a/doc/source/examples/Ni_calculation.py b/docs/source/examples/Ni_calculation.py similarity index 100% rename from doc/source/examples/Ni_calculation.py rename to docs/source/examples/Ni_calculation.py diff --git a/doc/source/examples/Ni_refinement.py b/docs/source/examples/Ni_refinement.py similarity index 100% rename from doc/source/examples/Ni_refinement.py rename to docs/source/examples/Ni_refinement.py diff --git a/doc/source/index.rst b/docs/source/index.rst similarity index 100% rename from doc/source/index.rst rename to docs/source/index.rst diff --git a/doc/source/license.rst b/docs/source/license.rst similarity index 100% rename from doc/source/license.rst rename to docs/source/license.rst diff --git a/doc/source/release.rst b/docs/source/release.rst similarity index 100% rename from doc/source/release.rst rename to docs/source/release.rst diff --git a/news/build.rst b/news/build.rst new file mode 100644 index 00000000..3e18e755 --- /dev/null +++ b/news/build.rst @@ -0,0 +1,24 @@ +**Added:** + +* Add gsl to conda requirements. + +**Changed:** + +* Remove mac static GSL linking; always link to shared GSL. +* Change doc to docs for skpkg standard. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/requirements/conda.txt b/requirements/conda.txt index 9cc306b0..0668b5ee 100644 --- a/requirements/conda.txt +++ b/requirements/conda.txt @@ -1 +1,2 @@ diffpy.structure +gsl diff --git a/setup.py b/setup.py index 57e28713..9a334a8e 100644 --- a/setup.py +++ b/setup.py @@ -157,11 +157,7 @@ def create_extensions(): except EnvironmentError: return [] - # On macOS, dynamic linking may not be needed - if sys.platform == "darwin": - libraries = [] - else: - libraries = ["gsl"] + libraries = ["gsl"] include_dirs = [MYDIR] + gcfg["include_dirs"] library_dirs = gcfg["library_dirs"] @@ -180,16 +176,6 @@ def create_extensions(): "-funroll-loops", "-ffast-math", ] - # Check for static GSL libraries and add them if found. - static_libs = [ - os.path.join(p, "libgsl.a") - for p in gcfg["library_dirs"] - if os.path.isfile(os.path.join(p, "libgsl.a")) - ] - if static_libs: - extra_objects += static_libs - # Use static linking: remove "-lgsl" to avoid dynamic linking conflicts. - libraries = [] elif compiler_type == "msvc": define_macros += [("_USE_MATH_DEFINES", None)] extra_compile_args = ["/EHs"] From adc03f4e466e02878bd32d96f94c75a509f0c20a Mon Sep 17 00:00:00 2001 From: Tieqiong Zhang Date: Thu, 18 Sep 2025 21:53:22 -0500 Subject: [PATCH 262/294] rename requirements/test.txt to tests --- requirements/{test.txt => tests.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename requirements/{test.txt => tests.txt} (100%) diff --git a/requirements/test.txt b/requirements/tests.txt similarity index 100% rename from requirements/test.txt rename to requirements/tests.txt From b23c4bb1abafde1db59948c88e68f1cb0764aec8 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Wed, 19 Nov 2025 11:50:33 -0500 Subject: [PATCH 263/294] skpkg: skpkg update without manual edits --- .flake8 | 4 +- .github/ISSUE_TEMPLATE/release_checklist.md | 2 +- .../workflows/build-wheel-release-upload.yml | 2 +- .isort.cfg | 1 + .readthedocs.yaml | 2 +- CODE-OF-CONDUCT.rst | 133 ++++++++++++++++++ LICENSE.rst | 52 +++---- cookiecutter.json | 18 +++ docs/source/conf.py | 15 +- src/diffpy/pdffit2/pdffit2_app.py | 33 +++++ tests/test_version.py | 2 +- 11 files changed, 220 insertions(+), 44 deletions(-) create mode 100644 CODE-OF-CONDUCT.rst create mode 100644 cookiecutter.json create mode 100644 src/diffpy/pdffit2/pdffit2_app.py diff --git a/.flake8 b/.flake8 index 2d2cb168..a5105116 100644 --- a/.flake8 +++ b/.flake8 @@ -1,10 +1,12 @@ +# As of now, flake8 does not natively support configuration via pyproject.toml +# https://github.com/microsoft/vscode-flake8/issues/135 [flake8] exclude = .git, __pycache__, build, dist, - doc/source/conf.py + docs/source/conf.py max-line-length = 115 # Ignore some style 'errors' produced while formatting by 'black' # https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 6107962c..56bcd015 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -34,7 +34,7 @@ Please let the maintainer know that all checks are done and the package is ready - [ ] 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. +- [ ] New package dependencies listed in `conda.txt` and `tests.txt` are added to `meta.yaml` in the feedstock. - [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions. - [ ] Tag the maintainer for conda-forge release. diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 5d80dac2..5dec5f6e 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -7,7 +7,7 @@ on: - "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml jobs: - release: + build-release: uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: diffpy.pdffit2 diff --git a/.isort.cfg b/.isort.cfg index e0926f42..7ce0fb1f 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,4 +1,5 @@ [settings] +# Keep import statement below line_length character limit line_length = 115 multi_line_output = 3 include_trailing_comma = True diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 47f7a017..aaa88895 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,4 +10,4 @@ python: - requirements: requirements/docs.txt sphinx: - configuration: doc/source/conf.py + configuration: docs/source/conf.py diff --git a/CODE-OF-CONDUCT.rst b/CODE-OF-CONDUCT.rst new file mode 100644 index 00000000..e8199ca5 --- /dev/null +++ b/CODE-OF-CONDUCT.rst @@ -0,0 +1,133 @@ +===================================== + Contributor Covenant Code of Conduct +===================================== + +Our Pledge +---------- + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socioeconomic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +Our Standards +------------- + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +Enforcement Responsibilities +---------------------------- + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +Scope +----- + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +Enforcement +----------- + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +sb2896@columbia.edu. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +Enforcement Guidelines +---------------------- + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +1. Correction +**************** + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +2. Warning +************* + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +3. Temporary Ban +****************** + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +4. Permanent Ban +****************** + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +Attribution +----------- + +This Code of Conduct is adapted from the `Contributor Covenant `_. + +Community Impact Guidelines were inspired by `Mozilla's code of conduct enforcement ladder `_. + +For answers to common questions about this code of conduct, see the `FAQ `_. `Translations are available `_ diff --git a/LICENSE.rst b/LICENSE.rst index 040c880d..092e90c5 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -21,32 +21,26 @@ For more information please visit the project web-page: or email Prof. Simon Billinge at sb2896@columbia.edu 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 name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS". COPYRIGHT HOLDER -EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EITHER -EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS, ADEQUACY OR SUITABILITY -FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF FREEDOM FROM -INFRINGEMENT OF ANY DOMESTIC OR FOREIGN PATENT, COPYRIGHTS, TRADE -SECRETS OR OTHER PROPRIETARY RIGHTS OF ANY PARTY. IN NO EVENT SHALL -COPYRIGHT HOLDER BE LIABLE TO ANY PARTY 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 OR RELATING TO THIS AGREEMENT, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +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 HOLDER 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. diff --git a/cookiecutter.json b/cookiecutter.json new file mode 100644 index 00000000..9fad4e41 --- /dev/null +++ b/cookiecutter.json @@ -0,0 +1,18 @@ +{ + "maintainer_name": "Simon Billinge", + "maintainer_email": "sb2896@columbia.edu", + "maintainer_github_username": "sbillinge", + "contributors": "Sangjoon Lee, Simon Billinge, Billinge Group members", + "license_holders": "The Trustees of Columbia University in the City of New York", + "project_name": "diffpy.pdffit2", + "github_username_or_orgname": "diffpy", + "github_repo_name": "diffpy.pdffit2", + "conda_pypi_package_dist_name": "diffpy.pdffit2", + "package_dir_name": "diffpy.pdffit2", + "project_short_description": "PDFfit2 - real space structure refinement program.", + "project_keywords": "PDF, structure refinement", + "minimum_supported_python_version": "3.11", + "maximum_supported_python_version": "3.13", + "project_needs_c_code_compiled": "Yes", + "project_has_gui_tests": "No" +} diff --git a/docs/source/conf.py b/docs/source/conf.py index 58fb11f6..16935deb 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# diffpy.pdffit2 documentation build configuration file, created by +# diffpy.pdffit2 documentation build configuration file, created by # noqa: E501 # sphinx-quickstart on Thu Jan 30 15:49:41 2014. # # This file is execfile()d with the current directory set to its @@ -22,17 +22,17 @@ try: fullversion = version("diffpy.pdffit2") except Exception: - fullversion = "No version found. The correct version will appear in the released version." + fullversion = "No version found. The correct version will appear in the released version." # noqa: E501 # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the -# documentation root, use Path().resolve() to make it absolute, like shown here. +# documentation root, use Path().resolve() to make it absolute, like shown here. # noqa: E501 # sys.path.insert(0, str(Path(".").resolve())) sys.path.insert(0, str(Path("../..").resolve())) sys.path.insert(0, str(Path("../../src").resolve())) # abbreviations -ab_authors = "Billinge group and community members." +ab_authors = "Sangjoon Lee, Simon Billinge, Billinge Group members" # -- General configuration ------------------------------------------------ @@ -53,10 +53,6 @@ "m2r", ] -autodoc_mock_imports = [ - "diffpy.pdffit2.pdffit2", -] - # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -79,7 +75,6 @@ # |version| and |release|, also used in various other places throughout the # built documents. -fullversion = version(project) # The short X.Y version. version = "".join(fullversion.split(".post")[:1]) # The full version, including alpha/beta/rc tags. @@ -144,7 +139,7 @@ "github_user": "diffpy", "github_repo": "diffpy.pdffit2", "github_version": "main", - "conf_py_path": "/doc/source/", + "conf_py_path": "/docs/source/", } # Theme options are theme-specific and customize the look and feel of a theme diff --git a/src/diffpy/pdffit2/pdffit2_app.py b/src/diffpy/pdffit2/pdffit2_app.py new file mode 100644 index 00000000..d8ff2fd0 --- /dev/null +++ b/src/diffpy/pdffit2/pdffit2_app.py @@ -0,0 +1,33 @@ +import argparse + +from diffpy.pdffit2.version import __version__ # noqa + + +def main(): + parser = argparse.ArgumentParser( + prog="diffpy.pdffit2", + description=( + "PDFfit2 - real space structure refinement program.\n\n" + "For more information, visit: " + "https://github.com/diffpy/diffpy.pdffit2/" + ), + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + + parser.add_argument( + "--version", + action="store_true", + help="Show the program's version number and exit", + ) + + args = parser.parse_args() + + if args.version: + print(f"diffpy.pdffit2 {__version__}") + else: + # Default behavior when no arguments are given + parser.print_help() + + +if __name__ == "__main__": + main() diff --git a/tests/test_version.py b/tests/test_version.py index b9b25b07..a232202f 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,6 +1,6 @@ """Unit tests for __version__.py.""" -import diffpy.pdffit2 +import diffpy.pdffit2 # noqa def test_package_version(): From 5ea24ed43edf6c7ac14f0cbf30f11eeca51f4373 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Wed, 19 Nov 2025 18:09:42 -0500 Subject: [PATCH 264/294] fix: fix author and required variable back. --- cookiecutter.json | 2 +- docs/source/conf.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 9fad4e41..174c2873 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -2,7 +2,7 @@ "maintainer_name": "Simon Billinge", "maintainer_email": "sb2896@columbia.edu", "maintainer_github_username": "sbillinge", - "contributors": "Sangjoon Lee, Simon Billinge, Billinge Group members", + "contributors": "Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members", "license_holders": "The Trustees of Columbia University in the City of New York", "project_name": "diffpy.pdffit2", "github_username_or_orgname": "diffpy", diff --git a/docs/source/conf.py b/docs/source/conf.py index 16935deb..56af88a3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -32,7 +32,7 @@ sys.path.insert(0, str(Path("../../src").resolve())) # abbreviations -ab_authors = "Sangjoon Lee, Simon Billinge, Billinge Group members" +ab_authors = "Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members" # -- General configuration ------------------------------------------------ @@ -53,6 +53,9 @@ "m2r", ] +autodoc_mock_imports = [ + "diffpy.pdffit2.pdffit2", +] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -75,6 +78,7 @@ # |version| and |release|, also used in various other places throughout the # built documents. +fullversion = version(project) # The short X.Y version. version = "".join(fullversion.split(".post")[:1]) # The full version, including alpha/beta/rc tags. From 1ab04aecec0393f9af96310f035188f65e7b4034 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 19 Nov 2025 23:10:01 +0000 Subject: [PATCH 265/294] [pre-commit.ci] auto fixes from pre-commit hooks --- docs/source/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 56af88a3..cf1514d6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -32,7 +32,9 @@ sys.path.insert(0, str(Path("../../src").resolve())) # abbreviations -ab_authors = "Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members" +ab_authors = ( + "Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members" +) # -- General configuration ------------------------------------------------ From d6fc863acbeb524e3b94ec5fed3181e784699991 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Thu, 20 Nov 2025 12:36:53 -0500 Subject: [PATCH 266/294] skpkg: add CHAGELOG.rst, README.rst, license, update pyproject.toml --- CHANGELOG.rst | 68 ----------------------------------------- README.rst | 40 +++++++++++------------- docs/source/license.rst | 52 ++++++++++++++----------------- pyproject.toml | 3 ++ 4 files changed, 43 insertions(+), 120 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1253f933..f29d3b53 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,71 +3,3 @@ Release notes ============= .. current developments - -1.5.1 -===== - -**Fixed:** - -* Fixed `SystemError` and `MemoryError` for `redirect_stdout` on Windows with Python 3.13. - -**Removed:** - -* Removed `restore_stdout` function and wrapper. - - -1.5.0 -===== - -**Added:** - -* Python 3.11, 3.12 support -* Option to skip printing of introductory information when initializing the `PdfFit` class. -* Added additional runtime linker flags in `CustomBuildExt.run` to embed the `RPATH` flags for the built extensions. -* Support for retrieving GSL configuration from `CONDA_PREFIX`/ `GSL_PATH` on all platforms. -* Separate installation instruction for macOS (Arm64) in READEM -* Added `restore_stdout` function and wrapper. -* Added Python 3.13 support. - -**Changed:** - -* Changed setup.py to lazy evaluate gsl installation. -* Documentation brought up to date -* Merged the GSL configuration logic in `setup.py`. -* Changed `pytest` `capture_output` fixture. Now automatically restores `sys.stdout`. - -**Fixed:** - -* remove older conda-recipe files -* moved the tests directory from src to the root using conftest.py. -* fixed a circular import bug during " pip install ." in GitHub CI. -* renamed .py files under tests to snake_case. -* add PyPI packages under pip.txt -* re-cookiecutter to group's package standard -* Fix missing `__date__`, use PyPI release date. -* Fixed `SystemError` when running `pytest` on Windows with Python 3.13. - -**Removed:** - -* Python <= 3.10 support -* Six dependency and py2 support - - -1.4.2 -===== - -**Added:** - -* Support for Python 3.11, 3.12 - -**Changed:** - -* No notable functional changes from 1.4.1 - -1.4.4rc0 -======== - -**Fixed:** - -* Code linted to group flake8 standards -* Package structure moved to diffpy standard structure diff --git a/README.rst b/README.rst index 4c90e849..dfbcd71c 100644 --- a/README.rst +++ b/README.rst @@ -25,6 +25,7 @@ :target: https://anaconda.org/conda-forge/diffpy.pdffit2 .. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff + :target: https://github.com/diffpy/diffpy.pdffit2/pulls .. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.pdffit2 :target: https://pypi.org/project/diffpy.pdffit2/ @@ -78,11 +79,6 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite Installation ------------ -diffpy.pdffit2 supports Python 3.11, 3.12, and 3.13. - -Windows, macOS (non-Arm64), Linux -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - The preferred method is to use `Miniconda Python `_ and install from the "conda-forge" channel of Conda packages. @@ -97,34 +93,32 @@ The following creates and activates a new environment named ``diffpy.pdffit2_env conda create -n diffpy.pdffit2_env diffpy.pdffit2 conda activate diffpy.pdffit2_env -To confirm that the installation was successful, type :: - - python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" - -macOS (Arm64) -~~~~~~~~~~~~~ +The output should print the latest version displayed on the badges above. -Create a new conda environment ``diffpy.pdffit2_env``: :: +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.pdffit2_env`` environment, type :: - conda create -n diffpy.pdffit2_env python=3.13 + pip install diffpy.pdffit2 -Activate the environment: :: +If you prefer to install from sources, after installing the dependencies, obtain the source archive from +`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory +and run the following :: - conda activate diffpy.pdffit2_env + pip install . -Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_: :: +This package also provides command-line utilities. To check the software has been installed correctly, type :: - pip install diffpy.pdffit2 + diffpy.pdffit2 --version -To confirm that the installation was successful, type :: +You can also type the following command to verify the installation. :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" -If you prefer to install from sources, after installing the dependencies, obtain the source archive from -`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory -and run the following :: - pip install . +To view the basic usage and available commands, type :: + + diffpy.pdffit2 -h Getting Started --------------- @@ -170,7 +164,7 @@ trying to commit again. Improvements and fixes are always appreciated. -Before contributing, please read our `Code of Conduct `_. +Before contributing, please read our `Code of Conduct `_. Contact ------- diff --git a/docs/source/license.rst b/docs/source/license.rst index fbdd3edc..5cdf347a 100644 --- a/docs/source/license.rst +++ b/docs/source/license.rst @@ -25,32 +25,26 @@ For more information please visit the project web-page: or email Prof. Simon Billinge at sb2896@columbia.edu 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 name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS". COPYRIGHT HOLDER -EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EITHER -EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS, ADEQUACY OR SUITABILITY -FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF FREEDOM FROM -INFRINGEMENT OF ANY DOMESTIC OR FOREIGN PATENT, COPYRIGHTS, TRADE -SECRETS OR OTHER PROPRIETARY RIGHTS OF ANY PARTY. IN NO EVENT SHALL -COPYRIGHT HOLDER BE LIABLE TO ANY PARTY 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 OR RELATING TO THIS AGREEMENT, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +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 HOLDER 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. diff --git a/pyproject.toml b/pyproject.toml index af52ce04..959054dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,9 @@ include = ["*"] # package names should match these glob patterns (["*"] by defa exclude = [] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) +[project.scripts] +diffpy-pdffit2 = "diffpy.pdffit2_app:main" + [tool.setuptools.dynamic] dependencies = {file = ["requirements/pip.txt"]} From a0d4c2c4ebb3de19351167b7297cc41c2ccccddd Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Thu, 20 Nov 2025 13:24:55 -0500 Subject: [PATCH 267/294] chore: Add instructions back to README.rst and revert history of CHANGELOG.rst --- CHANGELOG.rst | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.rst | 25 ++++++++++++------- 2 files changed, 84 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f29d3b53..1253f933 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,3 +3,71 @@ Release notes ============= .. current developments + +1.5.1 +===== + +**Fixed:** + +* Fixed `SystemError` and `MemoryError` for `redirect_stdout` on Windows with Python 3.13. + +**Removed:** + +* Removed `restore_stdout` function and wrapper. + + +1.5.0 +===== + +**Added:** + +* Python 3.11, 3.12 support +* Option to skip printing of introductory information when initializing the `PdfFit` class. +* Added additional runtime linker flags in `CustomBuildExt.run` to embed the `RPATH` flags for the built extensions. +* Support for retrieving GSL configuration from `CONDA_PREFIX`/ `GSL_PATH` on all platforms. +* Separate installation instruction for macOS (Arm64) in READEM +* Added `restore_stdout` function and wrapper. +* Added Python 3.13 support. + +**Changed:** + +* Changed setup.py to lazy evaluate gsl installation. +* Documentation brought up to date +* Merged the GSL configuration logic in `setup.py`. +* Changed `pytest` `capture_output` fixture. Now automatically restores `sys.stdout`. + +**Fixed:** + +* remove older conda-recipe files +* moved the tests directory from src to the root using conftest.py. +* fixed a circular import bug during " pip install ." in GitHub CI. +* renamed .py files under tests to snake_case. +* add PyPI packages under pip.txt +* re-cookiecutter to group's package standard +* Fix missing `__date__`, use PyPI release date. +* Fixed `SystemError` when running `pytest` on Windows with Python 3.13. + +**Removed:** + +* Python <= 3.10 support +* Six dependency and py2 support + + +1.4.2 +===== + +**Added:** + +* Support for Python 3.11, 3.12 + +**Changed:** + +* No notable functional changes from 1.4.1 + +1.4.4rc0 +======== + +**Fixed:** + +* Code linted to group flake8 standards +* Package structure moved to diffpy standard structure diff --git a/README.rst b/README.rst index dfbcd71c..9ca91b8b 100644 --- a/README.rst +++ b/README.rst @@ -79,6 +79,11 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite Installation ------------ +diffpy.pdffit2 supports Python 3.11, 3.12, and 3.13. + +Windows, macOS (non-Arm64), Linux +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + The preferred method is to use `Miniconda Python `_ and install from the "conda-forge" channel of Conda packages. @@ -93,7 +98,16 @@ The following creates and activates a new environment named ``diffpy.pdffit2_env conda create -n diffpy.pdffit2_env diffpy.pdffit2 conda activate diffpy.pdffit2_env -The output should print the latest version displayed on the badges above. +To confirm that the installation was successful, type :: + + python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" + +macOS (Arm64) +~~~~~~~~~~~~~ + +Create a new conda environment ``diffpy.pdffit2_env``: :: + + conda create -n diffpy.pdffit2_env python=3.13 If the above does not work, you can use ``pip`` to download and install the latest release from `Python Package Index `_. @@ -107,19 +121,12 @@ and run the following :: pip install . -This package also provides command-line utilities. To check the software has been installed correctly, type :: - - diffpy.pdffit2 --version -You can also type the following command to verify the installation. :: +You can type the following command to verify the installation is successful. :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" -To view the basic usage and available commands, type :: - - diffpy.pdffit2 -h - Getting Started --------------- From f795440d588e1d52f8c9e4153cd3730f8404c28f Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Thu, 20 Nov 2025 13:30:28 -0500 Subject: [PATCH 268/294] chore: add activate for env to make consistent. --- README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 9ca91b8b..0adcc4b1 100644 --- a/README.rst +++ b/README.rst @@ -109,9 +109,11 @@ Create a new conda environment ``diffpy.pdffit2_env``: :: conda create -n diffpy.pdffit2_env python=3.13 -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.pdffit2_env`` environment, type :: +Activate the environment: :: + + conda activate diffpy.pdffit2_env + +Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_: :: pip install diffpy.pdffit2 From eae357eaf83c94fea2a1fa903b0b167a80a33820 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Thu, 20 Nov 2025 15:26:17 -0500 Subject: [PATCH 269/294] skpkg: change version build file. --- src/diffpy/__init__.py | 10 ------ src/diffpy/pdffit2/__init__.py | 20 ++---------- src/diffpy/pdffit2/version.py | 57 ++++++---------------------------- 3 files changed, 12 insertions(+), 75 deletions(-) diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 2efe9395..04d8ace2 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -14,13 +14,3 @@ # See LICENSE.rst for license information. # ############################################################################## -"""diffpy - tools for structure analysis by diffraction. - -Blank namespace package for module diffpy.""" - - -from pkgutil import extend_path - -__path__ = extend_path(__path__, __name__) - -# End of file diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index 527477a5..fceee947 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -16,24 +16,10 @@ ############################################################################## """PDFfit2 - real space structure refinement program.""" -# WARNING: Do NOT remove the isort: off/on comments in this file. -# These tags are used to prevent isort from reordering imports in this file. -# __version__ must be initialized before importing C++ extensions. +# package version +from diffpy.pdffit2.version import __version__ # noqa -# isort: off -# Import the package version before C++ extensions are loaded. -from diffpy.pdffit2.output import redirect_stdout -from diffpy.pdffit2.version import __date__, __version__ - -# Import C++ related modules since the __version__ attribute is used. -from diffpy.pdffit2.pdffit import PdfFit -from diffpy.pdffit2.pdffit2 import is_element - -# isort: on - -# Ensure all necessary components are imported and initialized +# silence the pyflakes syntax checker assert __version__ or True -assert __date__ or True -assert all((PdfFit, redirect_stdout, is_element)) # End of file diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 86159280..0ade3955 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -7,59 +7,20 @@ # File coded by: Billinge Group members and community contributors. # # See GitHub contributions for a more detailed list of contributors. -# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors +# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors # noqa: E501 # # See LICENSE.rst for license information. # ############################################################################## """Definition of __version__.""" -import datetime -import json -import urllib.request -from importlib.metadata import version -from pathlib import Path +# We do not use the other three variables, but can be added back if needed. +# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] +# obtain version information +from importlib.metadata import PackageNotFoundError, version -def get_pypi_release_date(package_name, timeout=5): - package_file = Path(__file__).resolve() - - try: - with open(package_file, "r", encoding="utf-8") as f: - lines = f.readlines() - for line in reversed(lines): - if line.startswith("# Release date:"): - return line.split(":", 1)[1].strip() - - url = f"https://pypi.org/pypi/{package_name}/json" - with urllib.request.urlopen(url, timeout=timeout) as response: - data = json.loads(response.read().decode("utf-8")) - - installed_version = version(package_name) - release_data = data["releases"].get(installed_version, []) - if not release_data: - raise ValueError( - f"No release data found for version {installed_version}" - ) - - release_date_str = release_data[-1]["upload_time"] - release_date = datetime.datetime.fromisoformat(release_date_str).date() - - with open(package_file, "a", encoding="utf-8") as f: - f.write(f"\n# Release date: {release_date}") - - except (ValueError, OSError) as e: - print(f"Warning: Could not fetch release date from PyPI: {e}") - release_date = datetime.datetime.fromtimestamp( - package_file.stat().st_ctime - ).isoformat() - - return str(release_date) - - -__version__ = version("diffpy.pdffit2") -__date__ = get_pypi_release_date("diffpy.pdffit2") - -# End of file - -# Release date: 2025-02-07 +try: + __version__ = version("diffpy.pdffit2") +except PackageNotFoundError: + __version__ = "unknown" From 8b93472f93ce0f75a24a1f1539acae2eb3e8b23d Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Thu, 20 Nov 2025 20:26:12 -0500 Subject: [PATCH 270/294] skpkg: package update command with no manual edits. --- setup.py | 197 +++------------------------------------------- tests/conftest.py | 31 -------- 2 files changed, 12 insertions(+), 216 deletions(-) diff --git a/setup.py b/setup.py index 9a334a8e..9c1e69cf 100644 --- a/setup.py +++ b/setup.py @@ -1,199 +1,27 @@ #!/usr/bin/env python # Extensions script for diffpy.pdffit2 -"""PDFfit2 - real space structure refinement engine - -Packages: diffpy.pdffit2 -Scripts: pdffit2 -""" import glob -import os -import re -import shutil -import sys -import warnings -from pathlib import Path +import os # noqa +import re # noqa +import sys # noqa from setuptools import Extension, setup -from setuptools.command.build_ext import build_ext - -# Use this version when git data are not available, like in git zip archive. -# Update when tagging a new release. -FALLBACK_VERSION = "1.4.3" - -MYDIR = str(Path(__file__).parent.resolve()) - -# Helper functions ----------------------------------------------------------- - - -def get_compiler_type(): - """Return the compiler type used during the build.""" - cc_arg = [a for a in sys.argv if a.startswith("--compiler=")] - if cc_arg: - return cc_arg[-1].split("=", 1)[1] - from distutils.ccompiler import new_compiler - - return new_compiler().compiler_type - - -def get_gsl_config(): - """ - Determine the GSL include and library directories by trying in order: - 1) CONDA_PREFIX, - 2) GSL_PATH, - 3) gsl-config (for Unix-like systems). - Raises EnvironmentError if none are found. - """ - rv = {"include_dirs": [], "library_dirs": []} - - # 1. Check using CONDA_PREFIX. - conda_prefix = os.environ.get("CONDA_PREFIX", "") - if conda_prefix: - if os.name == "nt": - inc = Path(conda_prefix) / "Library" / "include" - lib = Path(conda_prefix) / "Library" / "lib" - else: - inc = Path(conda_prefix) / "include" - lib = Path(conda_prefix) / "lib" - if inc.is_dir() and lib.is_dir(): - rv["include_dirs"].append(str(inc)) - rv["library_dirs"].append(str(lib)) - return rv - else: - warnings.warn( - f"CONDA_PREFIX is set to {conda_prefix}, " - "but GSL not found at those paths. Proceeding..." - ) - # 2. Check using GSL_PATH. - gsl_path = os.environ.get("GSL_PATH", "") - if gsl_path: - inc = Path(gsl_path) / "include" - lib = Path(gsl_path) / "lib" - if inc.is_dir() and lib.is_dir(): - rv["include_dirs"].append(str(inc)) - rv["library_dirs"].append(str(lib)) - return rv - else: - raise EnvironmentError( - f"GSL_PATH={gsl_path} is set, but {inc} or {lib} not found. " - "Please verify your GSL_PATH." - ) - - # 3. Try using the gsl-config executable (only on Unix-like systems). - if os.name != "nt": - path_dirs = os.environ.get("PATH", "").split(os.pathsep) - gslcfg_paths = [Path(p) / "gsl-config" for p in path_dirs if p] - gslcfg_paths = [p for p in gslcfg_paths if p.is_file()] - if gslcfg_paths: - gslcfg = gslcfg_paths[0] - txt = gslcfg.read_text() - prefix_match = re.search(r"(?m)^prefix=(.+)", txt) - include_match = re.search(r"(?m)^[^#]*\s-I(\S+)", txt) - lib_match = re.search(r"(?m)^[^#]*\s-L(\S+)", txt) - if prefix_match: - prefix_path = Path(prefix_match.group(1)) - inc_dir = ( - include_match.group(1) - if include_match - else (prefix_path / "include") - ) - lib_dir = ( - lib_match.group(1) if lib_match else (prefix_path / "lib") - ) - rv["include_dirs"].append(str(inc_dir)) - rv["library_dirs"].append(str(lib_dir)) - return rv - else: - raise RuntimeError(f"Cannot parse 'prefix=' from {gslcfg}.") - else: - warnings.warn( - "No gsl-config found in PATH. GSL may not be installed or not in PATH. " - "Proceeding without GSL configuration." - ) - - # 4. Nothing found: raise error. - raise EnvironmentError( - "Unable to locate GSL:\n" - "1) CONDA_PREFIX not set or no GSL there\n" - "2) GSL_PATH not set or invalid\n" - "3) gsl-config not available\n" - "Please set GSL_PATH or use a conda environment with GSL." - ) - - -class CustomBuildExt(build_ext): - def run(self): - # Retrieve the GSL library directories and append them to each extension. - gsl_cfg = get_gsl_config() - lib_dirs = gsl_cfg.get("library_dirs", []) - for ext in self.extensions: - # Add gsl lib for linking. - ext.library_dirs.extend(lib_dirs) - # Embed RPATH flags, runtime linking without LD_LIBRARY_PATH. - ext.extra_link_args = ext.extra_link_args or [] - for lib in lib_dirs: - ext.extra_link_args.append(f"-Wl,-rpath,{lib}") - super().run() - # Avoid dll error - gsl_path = ( - Path(os.environ.get("GSL_PATH")) - if os.environ.get("GSL_PATH") - else Path(os.environ.get("CONDA_PREFIX", "")) / "Library" - ) - bin_path = gsl_path / "bin" - dest_path = Path(self.build_lib) / "diffpy" / "pdffit2" - dest_path.mkdir(parents=True, exist_ok=True) - for dll_file in bin_path.glob("gsl*.dll"): - shutil.copy(str(dll_file), str(dest_path)) +# Define extension arguments here +ext_kws = { + "libraries": [], + "extra_compile_args": [], + "extra_link_args": [], + "include_dirs": [], +} def create_extensions(): - """Create the list of Extension objects for the build.""" - # lazy evaluation prevents build sdist failure - try: - gcfg = get_gsl_config() - except EnvironmentError: - return [] - - libraries = ["gsl"] - - include_dirs = [MYDIR] + gcfg["include_dirs"] - library_dirs = gcfg["library_dirs"] - define_macros = [] - extra_objects = [] - extra_compile_args = [] - extra_link_args = [] - - compiler_type = get_compiler_type() - if compiler_type in ("unix", "cygwin", "mingw32"): - extra_compile_args = [ - "-std=c++11", - "-Wall", - "-Wno-write-strings", - "-O3", - "-funroll-loops", - "-ffast-math", - ] - elif compiler_type == "msvc": - define_macros += [("_USE_MATH_DEFINES", None)] - extra_compile_args = ["/EHs"] - - # Extension keyword arguments. - ext_kws = { - "include_dirs": include_dirs, - "libraries": libraries, - "library_dirs": library_dirs, - "define_macros": define_macros, - "extra_compile_args": extra_compile_args, - "extra_link_args": extra_link_args, - "extra_objects": extra_objects, - } + "Initialize Extension objects for the setup function." ext = Extension( - "diffpy.pdffit2.pdffit2", - glob.glob("src/extensions/**/*.cc"), - **ext_kws, + "diffpy.pdffit2.pdffit2", glob.glob("src/extensions/*.cpp"), **ext_kws ) return [ext] @@ -201,7 +29,6 @@ def create_extensions(): # Extensions not included in pyproject.toml setup_args = dict( ext_modules=[], - cmdclass={"build_ext": CustomBuildExt}, ) diff --git a/tests/conftest.py b/tests/conftest.py index 6a142536..e3b63139 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,12 +1,8 @@ -import io import json from pathlib import Path import pytest -import diffpy.pdffit2 -import diffpy.pdffit2.output # assuming this is the correct import path - @pytest.fixture def user_filesystem(tmp_path): @@ -21,30 +17,3 @@ def user_filesystem(tmp_path): json.dump(home_config_data, f) yield tmp_path - - -@pytest.fixture -def datafile(): - """Fixture to dynamically load any test file.""" - - def _load(filename): - return "tests/testdata/" + filename - - return _load - - -@pytest.fixture -def capture_output(): - """Capture output from pdffit2 engine produced in function call.""" - - def _capture(f, *args, **kwargs): - savestdout = diffpy.pdffit2.output.stdout - fp = io.StringIO() - diffpy.pdffit2.redirect_stdout(fp) - try: - f(*args, **kwargs) - finally: - diffpy.pdffit2.redirect_stdout(savestdout) - return fp.getvalue() - - return _capture From f7bc156cc7997be7f311034162ccd6328deb1cd4 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Fri, 21 Nov 2025 13:12:09 -0500 Subject: [PATCH 271/294] fix: revert setup.py and conftest.py to original --- setup.py | 192 +++++++++++++++++++++++++++++++++++++++++++--- tests/conftest.py | 31 ++++++++ 2 files changed, 211 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 9c1e69cf..d808441b 100644 --- a/setup.py +++ b/setup.py @@ -3,25 +3,192 @@ # Extensions script for diffpy.pdffit2 import glob -import os # noqa -import re # noqa -import sys # noqa +import os +import re +import shutil +import sys +import warnings +from pathlib import Path from setuptools import Extension, setup +from setuptools.command.build_ext import build_ext -# Define extension arguments here -ext_kws = { - "libraries": [], - "extra_compile_args": [], - "extra_link_args": [], - "include_dirs": [], -} +# Use this version when git data are not available, like in git zip archive. +# Update when tagging a new release. +FALLBACK_VERSION = "1.4.3" + +MYDIR = str(Path(__file__).parent.resolve()) + +# Helper functions ----------------------------------------------------------- + + +def get_compiler_type(): + """Return the compiler type used during the build.""" + cc_arg = [a for a in sys.argv if a.startswith("--compiler=")] + if cc_arg: + return cc_arg[-1].split("=", 1)[1] + from distutils.ccompiler import new_compiler + + return new_compiler().compiler_type + + +def get_gsl_config(): + """ + Determine the GSL include and library directories by trying in order: + 1) CONDA_PREFIX, + 2) GSL_PATH, + 3) gsl-config (for Unix-like systems). + Raises EnvironmentError if none are found. + """ + rv = {"include_dirs": [], "library_dirs": []} + + # 1. Check using CONDA_PREFIX. + conda_prefix = os.environ.get("CONDA_PREFIX", "") + if conda_prefix: + if os.name == "nt": + inc = Path(conda_prefix) / "Library" / "include" + lib = Path(conda_prefix) / "Library" / "lib" + else: + inc = Path(conda_prefix) / "include" + lib = Path(conda_prefix) / "lib" + if inc.is_dir() and lib.is_dir(): + rv["include_dirs"].append(str(inc)) + rv["library_dirs"].append(str(lib)) + return rv + else: + warnings.warn( + f"CONDA_PREFIX is set to {conda_prefix}, " + "but GSL not found at those paths. Proceeding..." + ) + + # 2. Check using GSL_PATH. + gsl_path = os.environ.get("GSL_PATH", "") + if gsl_path: + inc = Path(gsl_path) / "include" + lib = Path(gsl_path) / "lib" + if inc.is_dir() and lib.is_dir(): + rv["include_dirs"].append(str(inc)) + rv["library_dirs"].append(str(lib)) + return rv + else: + raise EnvironmentError( + f"GSL_PATH={gsl_path} is set, but {inc} or {lib} not found. " + "Please verify your GSL_PATH." + ) + + # 3. Try using the gsl-config executable (only on Unix-like systems). + if os.name != "nt": + path_dirs = os.environ.get("PATH", "").split(os.pathsep) + gslcfg_paths = [Path(p) / "gsl-config" for p in path_dirs if p] + gslcfg_paths = [p for p in gslcfg_paths if p.is_file()] + if gslcfg_paths: + gslcfg = gslcfg_paths[0] + txt = gslcfg.read_text() + prefix_match = re.search(r"(?m)^prefix=(.+)", txt) + include_match = re.search(r"(?m)^[^#]*\s-I(\S+)", txt) + lib_match = re.search(r"(?m)^[^#]*\s-L(\S+)", txt) + if prefix_match: + prefix_path = Path(prefix_match.group(1)) + inc_dir = ( + include_match.group(1) + if include_match + else (prefix_path / "include") + ) + lib_dir = ( + lib_match.group(1) if lib_match else (prefix_path / "lib") + ) + rv["include_dirs"].append(str(inc_dir)) + rv["library_dirs"].append(str(lib_dir)) + return rv + else: + raise RuntimeError(f"Cannot parse 'prefix=' from {gslcfg}.") + else: + warnings.warn( + "No gsl-config found in PATH. GSL may not be installed or not in PATH. " + "Proceeding without GSL configuration." + ) + + # 4. Nothing found: raise error. + raise EnvironmentError( + "Unable to locate GSL:\n" + "1) CONDA_PREFIX not set or no GSL there\n" + "2) GSL_PATH not set or invalid\n" + "3) gsl-config not available\n" + "Please set GSL_PATH or use a conda environment with GSL." + ) + + +class CustomBuildExt(build_ext): + def run(self): + # Retrieve the GSL library directories and append them to each extension. + gsl_cfg = get_gsl_config() + lib_dirs = gsl_cfg.get("library_dirs", []) + for ext in self.extensions: + # Add gsl lib for linking. + ext.library_dirs.extend(lib_dirs) + # Embed RPATH flags, runtime linking without LD_LIBRARY_PATH. + ext.extra_link_args = ext.extra_link_args or [] + for lib in lib_dirs: + ext.extra_link_args.append(f"-Wl,-rpath,{lib}") + super().run() + # Avoid dll error + gsl_path = ( + Path(os.environ.get("GSL_PATH")) + if os.environ.get("GSL_PATH") + else Path(os.environ.get("CONDA_PREFIX", "")) / "Library" + ) + bin_path = gsl_path / "bin" + dest_path = Path(self.build_lib) / "diffpy" / "pdffit2" + dest_path.mkdir(parents=True, exist_ok=True) + for dll_file in bin_path.glob("gsl*.dll"): + shutil.copy(str(dll_file), str(dest_path)) def create_extensions(): - "Initialize Extension objects for the setup function." + """Create the list of Extension objects for the build.""" + # lazy evaluation prevents build sdist failure + try: + gcfg = get_gsl_config() + except EnvironmentError: + return [] + + libraries = ["gsl"] + + include_dirs = [MYDIR] + gcfg["include_dirs"] + library_dirs = gcfg["library_dirs"] + define_macros = [] + extra_objects = [] + extra_compile_args = [] + extra_link_args = [] + + compiler_type = get_compiler_type() + if compiler_type in ("unix", "cygwin", "mingw32"): + extra_compile_args = [ + "-std=c++11", + "-Wall", + "-Wno-write-strings", + "-O3", + "-funroll-loops", + "-ffast-math", + ] + elif compiler_type == "msvc": + define_macros += [("_USE_MATH_DEFINES", None)] + extra_compile_args = ["/EHs"] + + # Extension keyword arguments. + ext_kws = { + "include_dirs": include_dirs, + "libraries": libraries, + "library_dirs": library_dirs, + "define_macros": define_macros, + "extra_compile_args": extra_compile_args, + "extra_link_args": extra_link_args, + "extra_objects": extra_objects, + } ext = Extension( - "diffpy.pdffit2.pdffit2", glob.glob("src/extensions/*.cpp"), **ext_kws + "diffpy.pdffit2.pdffit2", + glob.glob("src/extensions/**/*.cc"), + **ext_kws, ) return [ext] @@ -29,6 +196,7 @@ def create_extensions(): # Extensions not included in pyproject.toml setup_args = dict( ext_modules=[], + cmdclass={"build_ext": CustomBuildExt}, ) diff --git a/tests/conftest.py b/tests/conftest.py index e3b63139..6a142536 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,8 +1,12 @@ +import io import json from pathlib import Path import pytest +import diffpy.pdffit2 +import diffpy.pdffit2.output # assuming this is the correct import path + @pytest.fixture def user_filesystem(tmp_path): @@ -17,3 +21,30 @@ def user_filesystem(tmp_path): json.dump(home_config_data, f) yield tmp_path + + +@pytest.fixture +def datafile(): + """Fixture to dynamically load any test file.""" + + def _load(filename): + return "tests/testdata/" + filename + + return _load + + +@pytest.fixture +def capture_output(): + """Capture output from pdffit2 engine produced in function call.""" + + def _capture(f, *args, **kwargs): + savestdout = diffpy.pdffit2.output.stdout + fp = io.StringIO() + diffpy.pdffit2.redirect_stdout(fp) + try: + f(*args, **kwargs) + finally: + diffpy.pdffit2.redirect_stdout(savestdout) + return fp.getvalue() + + return _capture From a8689bf450fcc6343a3958b30601c10c291bdc82 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Fri, 21 Nov 2025 13:52:20 -0500 Subject: [PATCH 272/294] chore: add docstring back to setup.py --- setup.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.py b/setup.py index d808441b..9a334a8e 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,11 @@ #!/usr/bin/env python # Extensions script for diffpy.pdffit2 +"""PDFfit2 - real space structure refinement engine + +Packages: diffpy.pdffit2 +Scripts: pdffit2 +""" import glob import os From 7293c68d63c908fbc550f12700a18535f85c91a6 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Fri, 21 Nov 2025 16:04:35 -0500 Subject: [PATCH 273/294] fix: change import directory --- tests/test_exceptions.py | 3 ++- tests/test_pdffit.py | 3 ++- tests/test_phase_fractions.py | 2 +- tests/test_shape_factors.py | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index 83f2b375..07a4f4ea 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -18,7 +18,8 @@ import pytest -from diffpy.pdffit2 import PdfFit, pdffit2 +from diffpy.pdffit2 import pdffit2 +from diffpy.pdffit2.pdffit import PdfFit class read_structExceptions(unittest.TestCase): diff --git a/tests/test_pdffit.py b/tests/test_pdffit.py index 7336f0e6..54b1a1c8 100644 --- a/tests/test_pdffit.py +++ b/tests/test_pdffit.py @@ -6,7 +6,8 @@ import pytest -from diffpy.pdffit2 import PdfFit, pdffit2 +from diffpy.pdffit2 import pdffit2 +from diffpy.pdffit2.pdffit import PdfFit from diffpy.structure import loadStructure # ---------------------------------------------------------------------------- diff --git a/tests/test_phase_fractions.py b/tests/test_phase_fractions.py index ac33ec61..c86961e4 100644 --- a/tests/test_phase_fractions.py +++ b/tests/test_phase_fractions.py @@ -6,7 +6,7 @@ import pytest -from diffpy.pdffit2 import PdfFit +from diffpy.pdffit2.pdffit import PdfFit ############################################################################## diff --git a/tests/test_shape_factors.py b/tests/test_shape_factors.py index 110ce553..70424e58 100644 --- a/tests/test_shape_factors.py +++ b/tests/test_shape_factors.py @@ -8,7 +8,8 @@ import numpy import pytest -from diffpy.pdffit2 import PdfFit, pdffit2 +from diffpy.pdffit2 import pdffit2 +from diffpy.pdffit2.pdffit import PdfFit def spherefactor(r, d): From 3acf21ea80f8cb4d8ab450f4d4743ef42431c1da Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Fri, 21 Nov 2025 17:34:12 -0500 Subject: [PATCH 274/294] fix: revert the get release date function. --- src/diffpy/pdffit2/__init__.py | 2 +- src/diffpy/pdffit2/version.py | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index fceee947..2e143ec8 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -17,7 +17,7 @@ """PDFfit2 - real space structure refinement program.""" # package version -from diffpy.pdffit2.version import __version__ # noqa +from diffpy.pdffit2.version import __date__, __version__ # noqa # silence the pyflakes syntax checker assert __version__ or True diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 0ade3955..7a1eaaaa 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -17,8 +17,52 @@ # We do not use the other three variables, but can be added back if needed. # __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] +import datetime +import json +import urllib.request + # obtain version information from importlib.metadata import PackageNotFoundError, version +from pathlib import Path + + +def get_pypi_release_date(package_name, timeout=5): + package_file = Path(__file__).resolve() + + try: + with open(package_file, "r", encoding="utf-8") as f: + lines = f.readlines() + for line in reversed(lines): + if line.startswith("# Release date:"): + return line.split(":", 1)[1].strip() + + url = f"https://pypi.org/pypi/{package_name}/json" + with urllib.request.urlopen(url, timeout=timeout) as response: + data = json.loads(response.read().decode("utf-8")) + + installed_version = version(package_name) + release_data = data["releases"].get(installed_version, []) + if not release_data: + raise ValueError( + f"No release data found for version {installed_version}" + ) + + release_date_str = release_data[-1]["upload_time"] + release_date = datetime.datetime.fromisoformat(release_date_str).date() + + with open(package_file, "a", encoding="utf-8") as f: + f.write(f"\n# Release date: {release_date}") + + except (ValueError, OSError) as e: + print(f"Warning: Could not fetch release date from PyPI: {e}") + release_date = datetime.datetime.fromtimestamp( + package_file.stat().st_ctime + ).isoformat() + + return str(release_date) + + +__date__ = get_pypi_release_date("diffpy.pdffit2") try: __version__ = version("diffpy.pdffit2") From 3ec420e41009ed61fd8147c533d15ddce13b24d7 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Fri, 21 Nov 2025 17:43:04 -0500 Subject: [PATCH 275/294] revert the import of redirect_stdout --- src/diffpy/pdffit2/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index 2e143ec8..048588ee 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -18,6 +18,7 @@ # package version from diffpy.pdffit2.version import __date__, __version__ # noqa +from diffpy.pdffit2.output import redirect_stdout # silence the pyflakes syntax checker assert __version__ or True From 07635d0d1581c4e207de965f46ea1e92b17ae973 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 22:43:22 +0000 Subject: [PATCH 276/294] [pre-commit.ci] auto fixes from pre-commit hooks --- src/diffpy/pdffit2/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index 048588ee..f6f617fc 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -16,9 +16,10 @@ ############################################################################## """PDFfit2 - real space structure refinement program.""" +from diffpy.pdffit2.output import redirect_stdout + # package version from diffpy.pdffit2.version import __date__, __version__ # noqa -from diffpy.pdffit2.output import redirect_stdout # silence the pyflakes syntax checker assert __version__ or True From ce191940c74e614ff0d58b91fef23bc16c7cdcfd Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Fri, 21 Nov 2025 17:47:38 -0500 Subject: [PATCH 277/294] chore: suppress flake8 since it is used in C++ --- src/diffpy/pdffit2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index f6f617fc..1b818238 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -16,7 +16,7 @@ ############################################################################## """PDFfit2 - real space structure refinement program.""" -from diffpy.pdffit2.output import redirect_stdout +from diffpy.pdffit2.output import redirect_stdout # noqa # package version from diffpy.pdffit2.version import __date__, __version__ # noqa From 29005904ac9793d53ddf78284f1ea0e56d2af9a2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 22:47:57 +0000 Subject: [PATCH 278/294] [pre-commit.ci] auto fixes from pre-commit hooks --- src/diffpy/pdffit2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index 1b818238..f22d9cba 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -16,7 +16,7 @@ ############################################################################## """PDFfit2 - real space structure refinement program.""" -from diffpy.pdffit2.output import redirect_stdout # noqa +from diffpy.pdffit2.output import redirect_stdout # noqa # package version from diffpy.pdffit2.version import __date__, __version__ # noqa From d352c0964b621f964d50568099396a081acac24a Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Fri, 21 Nov 2025 23:56:02 -0500 Subject: [PATCH 279/294] fix: revert original code to import --- src/diffpy/pdffit2/__init__.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index f22d9cba..527477a5 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -16,12 +16,24 @@ ############################################################################## """PDFfit2 - real space structure refinement program.""" -from diffpy.pdffit2.output import redirect_stdout # noqa +# WARNING: Do NOT remove the isort: off/on comments in this file. +# These tags are used to prevent isort from reordering imports in this file. +# __version__ must be initialized before importing C++ extensions. -# package version -from diffpy.pdffit2.version import __date__, __version__ # noqa +# isort: off +# Import the package version before C++ extensions are loaded. +from diffpy.pdffit2.output import redirect_stdout +from diffpy.pdffit2.version import __date__, __version__ -# silence the pyflakes syntax checker +# Import C++ related modules since the __version__ attribute is used. +from diffpy.pdffit2.pdffit import PdfFit +from diffpy.pdffit2.pdffit2 import is_element + +# isort: on + +# Ensure all necessary components are imported and initialized assert __version__ or True +assert __date__ or True +assert all((PdfFit, redirect_stdout, is_element)) # End of file From 122fecf4ed533fea6670c43afe3defd7d810c4e5 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Sat, 22 Nov 2025 13:34:59 -0500 Subject: [PATCH 280/294] chore: delete duplicated file --- CODE_OF_CONDUCT.rst | 133 -------------------------------------------- 1 file changed, 133 deletions(-) delete mode 100644 CODE_OF_CONDUCT.rst diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst deleted file mode 100644 index e8199ca5..00000000 --- a/CODE_OF_CONDUCT.rst +++ /dev/null @@ -1,133 +0,0 @@ -===================================== - Contributor Covenant Code of Conduct -===================================== - -Our Pledge ----------- - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socioeconomic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -Our Standards -------------- - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or advances of - any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, - without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -Enforcement Responsibilities ----------------------------- - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -Scope ------ - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official email address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -Enforcement ------------ - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -sb2896@columbia.edu. All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -Enforcement Guidelines ----------------------- - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -1. Correction -**************** - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -2. Warning -************* - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -3. Temporary Ban -****************** - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -4. Permanent Ban -****************** - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -Attribution ------------ - -This Code of Conduct is adapted from the `Contributor Covenant `_. - -Community Impact Guidelines were inspired by `Mozilla's code of conduct enforcement ladder `_. - -For answers to common questions about this code of conduct, see the `FAQ `_. `Translations are available `_ From 9d752a7476666c7558583128d1ec32230fb5ee55 Mon Sep 17 00:00:00 2001 From: Yuchen Xiao Date: Sun, 23 Nov 2025 19:02:19 -0500 Subject: [PATCH 281/294] fix: add `libcblas.dll` to build pypi wheel in windows --- news/win-libcblas.rst | 23 +++++++++++++++++++++++ setup.py | 16 ++++++++++++---- src/diffpy/pdffit2/libcblas.dll | Bin 0 -> 317724 bytes 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 news/win-libcblas.rst create mode 100644 src/diffpy/pdffit2/libcblas.dll diff --git a/news/win-libcblas.rst b/news/win-libcblas.rst new file mode 100644 index 00000000..96ada262 --- /dev/null +++ b/news/win-libcblas.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Add ``libsblas.dll`` to build pypi wheel in windows. + +**Security:** + +* diff --git a/setup.py b/setup.py index 9a334a8e..7c3b12dd 100644 --- a/setup.py +++ b/setup.py @@ -199,10 +199,18 @@ def create_extensions(): # Extensions not included in pyproject.toml -setup_args = dict( - ext_modules=[], - cmdclass={"build_ext": CustomBuildExt}, -) + +if sys.platform.startswith("win"): + setup_args = dict( + ext_modules=[], + cmdclass={"build_ext": CustomBuildExt}, + package_data={"diffpy.pdffit2": ["libcblas.dll"]}, + ) +else: + setup_args = dict( + ext_modules=[], + cmdclass={"build_ext": CustomBuildExt}, + ) if __name__ == "__main__": diff --git a/src/diffpy/pdffit2/libcblas.dll b/src/diffpy/pdffit2/libcblas.dll new file mode 100644 index 0000000000000000000000000000000000000000..66a20b90d689790053f4e3d42cf7954e858f850f GIT binary patch literal 317724 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 KFTS*{z9%yXI@qWuyq|3rgQ-k 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ċZ4uEUo^Z@7&KBqb3!KO;~{S;J00t3 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 literal 0 HcmV?d00001 From 0b1b8ec54abbb5b8a5c6cf91f140b8f3143ce87c Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Sun, 23 Nov 2025 21:17:09 -0500 Subject: [PATCH 282/294] fix: update fallback version to latest one. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7c3b12dd..a263a64e 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ # Use this version when git data are not available, like in git zip archive. # Update when tagging a new release. -FALLBACK_VERSION = "1.4.3" +FALLBACK_VERSION = "1.5.1" MYDIR = str(Path(__file__).parent.resolve()) From 69d4594d21d9d4c704b8f584c863b672148a5b9c Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Sun, 23 Nov 2025 21:19:12 -0500 Subject: [PATCH 283/294] chore: add news item --- news/fallback-version.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/fallback-version.rst diff --git a/news/fallback-version.rst b/news/fallback-version.rst new file mode 100644 index 00000000..2d58bfcd --- /dev/null +++ b/news/fallback-version.rst @@ -0,0 +1,23 @@ +**Added:** + +* No News Added: Update to latest `FALLBACK_VERSION` + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From d6f4d4d3210b3034403f4f2a8213f9741d61e28e Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Sun, 23 Nov 2025 22:06:35 -0500 Subject: [PATCH 284/294] chore:Add RELEASE_VERSION check on pre-release stage. --- .github/ISSUE_TEMPLATE/release_checklist.md | 1 + news/release_checkout.rst | 23 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 news/release_checkout.rst diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 56bcd015..c382844b 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -11,6 +11,7 @@ assignees: "" - [ ] 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. +- [ ] The `FALLBACK_VERSION` in `setup.py` has been updated to the latest version on PyPI. - [ ] 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 the website are updated. diff --git a/news/release_checkout.rst b/news/release_checkout.rst new file mode 100644 index 00000000..8d62d050 --- /dev/null +++ b/news/release_checkout.rst @@ -0,0 +1,23 @@ +**Added:** + +* No News Added: Add item to check `FALLBACK_VERSION` to latest version on PyPI + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 06d159263dbf514b77055b25cf03956e2ebd4cc9 Mon Sep 17 00:00:00 2001 From: sbillinge <4254545+sbillinge@users.noreply.github.com> Date: Fri, 5 Dec 2025 15:14:05 +0000 Subject: [PATCH 285/294] update changelog --- CHANGELOG.rst | 19 +++++++++++++++++++ news/build.rst | 24 ------------------------ news/fallback-version.rst | 23 ----------------------- news/pre-commit-codespell.rst | 23 ----------------------- news/release_checkout.rst | 23 ----------------------- news/rst-migration.rst | 23 ----------------------- news/setup-CI.rst | 23 ----------------------- news/win-libcblas.rst | 23 ----------------------- 8 files changed, 19 insertions(+), 162 deletions(-) delete mode 100644 news/build.rst delete mode 100644 news/fallback-version.rst delete mode 100644 news/pre-commit-codespell.rst delete mode 100644 news/release_checkout.rst delete mode 100644 news/rst-migration.rst delete mode 100644 news/setup-CI.rst delete mode 100644 news/win-libcblas.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1253f933..4d78e4e3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,25 @@ Release notes .. current developments +1.5.2 +===== + +**Added:** + +* Add gsl to conda requirements. + +**Changed:** + +* Remove mac static GSL linking; always link to shared GSL. +* Change doc to docs for skpkg standard. + +**Fixed:** + +* Fix misspelled words in source code comments. +* Migrate documentation to `scikit-package 0.1.0` standards, including a mock import for API rendering. +* Add ``libsblas.dll`` to build pypi wheel in windows. + + 1.5.1 ===== diff --git a/news/build.rst b/news/build.rst deleted file mode 100644 index 3e18e755..00000000 --- a/news/build.rst +++ /dev/null @@ -1,24 +0,0 @@ -**Added:** - -* Add gsl to conda requirements. - -**Changed:** - -* Remove mac static GSL linking; always link to shared GSL. -* Change doc to docs for skpkg standard. - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/fallback-version.rst b/news/fallback-version.rst deleted file mode 100644 index 2d58bfcd..00000000 --- a/news/fallback-version.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* No News Added: Update to latest `FALLBACK_VERSION` - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/pre-commit-codespell.rst b/news/pre-commit-codespell.rst deleted file mode 100644 index 7958fb2c..00000000 --- a/news/pre-commit-codespell.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* Fix misspelled words in source code comments. - -**Security:** - -* diff --git a/news/release_checkout.rst b/news/release_checkout.rst deleted file mode 100644 index 8d62d050..00000000 --- a/news/release_checkout.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* No News Added: Add item to check `FALLBACK_VERSION` to latest version on PyPI - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/rst-migration.rst b/news/rst-migration.rst deleted file mode 100644 index e010dcad..00000000 --- a/news/rst-migration.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* Migrate documentation to `scikit-package 0.1.0` standards, including a mock import for API rendering. - -**Security:** - -* diff --git a/news/setup-CI.rst b/news/setup-CI.rst deleted file mode 100644 index 4017a8ed..00000000 --- a/news/setup-CI.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* No news needed: line length fixes and other adjustments to copyright year. - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/win-libcblas.rst b/news/win-libcblas.rst deleted file mode 100644 index 96ada262..00000000 --- a/news/win-libcblas.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* Add ``libsblas.dll`` to build pypi wheel in windows. - -**Security:** - -* From 72c233dc8d6daf59b47217b7102b39adc22c9318 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Fri, 5 Dec 2025 13:49:23 -0500 Subject: [PATCH 286/294] docs: fix sphinx build for manual part fix --- docs/source/license.rst | 16 +++++++----- src/diffpy/pdffit2/pdffit.py | 50 +++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/docs/source/license.rst b/docs/source/license.rst index 5cdf347a..a60278a8 100644 --- a/docs/source/license.rst +++ b/docs/source/license.rst @@ -12,17 +12,19 @@ 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 (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) +``` +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 (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) +``` Copyright 2006-2007, Board of Trustees of Michigan State University, -Copyright 2008-2025, Board of Trustees of Columbia University in the -city of New York. (Copyright holder indicated in each source file). +Copyright 2008-2025, Board of Trustees of Columbia University in the city of New York. +(Copyright holder indicated in each source file). For more information please visit the project web-page: - http://www.diffpy.org/ -or email Prof. Simon Billinge at sb2896@columbia.edu +[http://www.diffpy.org/](http://www.diffpy.org/) +or email Prof. Simon Billinge at [sb2896@columbia.edu](mailto:sb2896@columbia.edu) Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py index 2e7ce748..1785b381 100644 --- a/src/diffpy/pdffit2/pdffit.py +++ b/src/diffpy/pdffit2/pdffit.py @@ -214,8 +214,7 @@ def read_data(self, data, stype, qmax, qdamp): data -- name of file from which to read data stype -- 'X' (xray) or 'N' (neutron) - qmax -- Q-value cutoff used in PDF calculation. - Use qmax=0 to neglect termination ripples. + qmax -- Q-value cutoff used in PDF calculation. Use qmax=0 to neglect termination ripples. qdamp -- instrumental Q-resolution factor Raises: IOError when the file cannot be read from disk @@ -230,8 +229,7 @@ def read_data_string(self, data, stype, qmax, qdamp, name=""): data -- string containing the contents of the data file stype -- 'X' (xray) or 'N' (neutron) - qmax -- Q-value cutoff used in PDF calculation. - Use qmax=0 to neglect termination ripples. + qmax -- Q-value cutoff used in PDF calculation. Use qmax=0 to neglect termination ripples. qdamp -- instrumental Q-resolution factor name -- tag with which to label data """ @@ -250,8 +248,7 @@ def read_data_lists( All lists must be of the same length. stype -- 'X' (xray) or 'N' (neutron) - qmax -- Q-value cutoff used in PDF calculation. - Use qmax=0 to neglect termination ripples. + qmax -- Q-value cutoff used in PDF calculation. Use qmax=0 to neglect termination ripples. qdamp -- instrumental Q-resolution factor r_data -- list of r-values Gr_data -- list of G(r) values @@ -298,9 +295,9 @@ def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): The structure from which to calculate the PDF must first be imported with the read_struct() or read_struct_string() method. + stype -- 'X' (xray) or 'N' (neutron) - qmax -- Q-value cutoff used in PDF calculation. - Use qmax=0 to neglect termination ripples. + qmax -- Q-value cutoff used in PDF calculation. Use qmax=0 to neglect termination ripples. qdamp -- instrumental Q-resolution factor rmin -- minimum r-value of calculation rmax -- maximum r-value of calculation @@ -494,24 +491,29 @@ def constrain(self, var, par, fcon=None): """Constrain(var, par[, fcon]) --> Constrain a variable to a parameter. A variable can be constrained to a number or equation string. - var -- variable to constrain, such as x(1) - par -- parameter which to constrain the variable. This can be - an integer or an equation string containing a reference - to another parameter. Equation strings use standard c++ - syntax. The value of a constrained parameter is accessed - as @p in an equation string, where p is the parameter. - e.g. - >>> constrain(x(1), 1) - >>> constrain(x(2), "0.5+@1") - fcon -- 'USER', 'IDENT', 'FCOMP', or 'FSQR' - this is an optional parameter, and I don't know how it is - used! - Raises: - pdffit2.constraintError if a constraint is bad - pdffit2.unassignedError if variable does not yet exist - ValueError if variable index does not exist (e.g. lat(7)) + :param var: variable to constrain, such as x(1) + :param par: parameter which to constrain the variable. This can be an + integer or an equation string containing a reference to + another parameter. Equation strings use standard C++ + syntax. The value of a constrained parameter is accessed + as ``@p`` in an equation string, where ``p`` is the + parameter. + :type par: int or str + :param fcon: 'USER', 'IDENT', 'FCOMP', or 'FSQR'. This is an optional + parameter; usage is currently unclear. + :type fcon: str + + Example:: + + >>> constrain(x(1), 1) + >>> constrain(x(2), "0.5+@1") + + :raises pdffit2.constraintError: if a constraint is bad + :raises pdffit2.unassignedError: if variable does not yet exist + :raises ValueError: if variable index does not exist (e.g. lat(7)) """ + var_ref = self.__getRef(var) varnc = _convertCallable(var) if fcon: From b9ae998ecad6b4c28bbe07360d2b07e64893f0fd Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Fri, 5 Dec 2025 13:53:50 -0500 Subject: [PATCH 287/294] chore: add news item --- news/docs-fix.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/docs-fix.rst diff --git a/news/docs-fix.rst b/news/docs-fix.rst new file mode 100644 index 00000000..2f89e68c --- /dev/null +++ b/news/docs-fix.rst @@ -0,0 +1,23 @@ +**Added:** + +* No News Added: Fix sphinx warning with manual fix + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 7963db69d5c90a58f4a2189a47eef14a9a3398cc Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Wed, 25 Mar 2026 22:35:21 -0400 Subject: [PATCH 288/294] skpkg: use package update to run skpkg on files --- .github/ISSUE_TEMPLATE/release_checklist.md | 10 +-- .../build-and-publish-docs-on-dispatch.yml | 18 ++++++ .../workflows/build-wheel-release-upload.yml | 64 ++++++++++++++++++- .github/workflows/check-news-item.yml | 2 +- .github/workflows/matrix-and-codecov.yml | 21 ++++++ AUTHORS.rst | 2 +- CODE-OF-CONDUCT.rst | 2 +- LICENSE.rst | 2 +- README.rst | 2 +- cookiecutter.json | 12 ++-- docs/source/api/diffpy.pdffit2.rst | 24 +++++++ docs/source/conf.py | 6 +- docs/source/index.rst | 8 ++- pyproject.toml | 17 +++-- src/diffpy/__init__.py | 2 +- src/diffpy/pdffit2/__init__.py | 4 +- src/diffpy/pdffit2/version.py | 2 +- 17 files changed, 165 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/build-and-publish-docs-on-dispatch.yml create mode 100644 .github/workflows/matrix-and-codecov.yml diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index c382844b..9b287caf 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -1,9 +1,11 @@ ---- + --- + name: Release about: Checklist and communication channel for PyPI and GitHub release title: "Ready for PyPI/GitHub release" labels: "release" assignees: "" + --- ### PyPI/GitHub rc-release preparation checklist: @@ -11,13 +13,13 @@ assignees: "" - [ ] 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. -- [ ] The `FALLBACK_VERSION` in `setup.py` has been updated to the latest version on PyPI. -- [ ] 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. +- [ ] Locally rendered documentation contains all appropriate pages, tutorials, and other human-written text is up-to-date with any changes in the code. +- [ ] All API references are included. To check this, run `conda install scikit-package` and then `package build api-doc`. Review any edits made by rerendering the docs locally. - [ ] Installation instructions in the README, documentation, and the website 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. +- [ ] Dispatch matrix testing to test the release on all Python versions and systems. If you do not have permission to run this workflow, tag the maintainer and say `@maintainer, please dispatch matrix testing workflow`. Please tag the maintainer (e.g., @username) in the comment here when you are ready for the PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here: diff --git a/.github/workflows/build-and-publish-docs-on-dispatch.yml b/.github/workflows/build-and-publish-docs-on-dispatch.yml new file mode 100644 index 00000000..406f5514 --- /dev/null +++ b/.github/workflows/build-and-publish-docs-on-dispatch.yml @@ -0,0 +1,18 @@ +name: Build and Publish Docs on Dispatch + +on: + workflow_dispatch: + +jobs: + get-python-version: + uses: scikit-package/release-scripts/.github/workflows/_get-python-version-latest.yml@v0 + with: + python_version: 0 + + docs: + uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0 + with: + project: diffpy.pdffit2 + c_extension: true + headless: false + python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }} diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 5dec5f6e..28358806 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -1,18 +1,76 @@ -name: Release (GitHub/PyPI) and Deploy Docs +name: Build Wheel and Release +# Trigger on tag push or manual dispatch. +# Tag and release privilege are verified inside the reusable workflow. on: workflow_dispatch: push: tags: - - "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml + - "*" + +# ── Release modality ────────────────────────────────────────────────────────── +# Three options are provided below. Only ONE job should be active at a time. +# To switch: comment out the active job and uncomment your preferred option, +# then commit the change to main before tagging a release. +# ───────────────────────────────────────────────────────────────────────────── jobs: + # Option 1 (default): Release to GitHub, publish to PyPI, and deploy docs. + # + # The wheel is uploaded to PyPI so users can install with `pip install`. + # A GitHub release is created with the changelog as the release body, and + # the Sphinx documentation is rebuilt and deployed to GitHub Pages. + # + # Choose this for open-source packages distributed via PyPI and/or + # conda-forge where broad public availability is the goal. build-release: uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: diffpy.pdffit2 c_extension: true - maintainer_GITHUB_username: sbillinge + maintainer_github_username: sbillinge secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + + # Option 2: Release to GitHub and deploy docs, without publishing to PyPI. + # + # A GitHub release is created and the Sphinx docs are deployed, but the + # wheel is not uploaded to PyPI. The source code remains publicly visible + # on GitHub and can be installed directly from there. + # + # Choose this when the package is public but you prefer to keep it off the + # default pip index — for example, if you distribute via conda-forge only, + # or if the package is not yet ready for a permanent PyPI presence. + # + # To use: comment out Option 1 above and uncomment the lines below. + # build-release-no-pypi: + # uses: scikit-package/release-scripts/.github/workflows/_build-release-github-no-pypi.yml@v0 + # with: + # project: diffpy.pdffit2 + # c_extension: true + # maintainer_github_username: sbillinge + # secrets: + # PAT_TOKEN: ${{ secrets.PAT_TOKEN }} + + # Option 3: Release to GitHub with wheel, license, and instructions bundled + # as a downloadable zip attached to the GitHub release asset. + # + # The wheel is built and packaged together with INSTRUCTIONS.txt and the + # LICENSE file into a zip that is attached directly to the GitHub release. + # Users with access to the (private) repo download the zip, follow the + # instructions inside, and install locally with pip. No PyPI or conda-forge + # upload occurs, and no docs are deployed. + # + # Choose this for private or restricted packages where distribution must be + # controlled: only users with repo access can download the release asset, + # making the GitHub release itself the distribution channel. + # + # To use: comment out Option 1 above and uncomment the lines below. + # build-release-private: + # uses: scikit-package/release-scripts/.github/workflows/_build-release-github-private-pure.yml@v0 + # with: + # project: diffpy.pdffit2 + # maintainer_github_username: sbillinge + # secrets: + # PAT_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index bb86a929..32130bee 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 # GitHub does not evaluate expressions in trigger filters; edit this value if your base branch is not main jobs: check-news-item: diff --git a/.github/workflows/matrix-and-codecov.yml b/.github/workflows/matrix-and-codecov.yml new file mode 100644 index 00000000..4a5a830d --- /dev/null +++ b/.github/workflows/matrix-and-codecov.yml @@ -0,0 +1,21 @@ +name: Matrix and Codecov + +on: + # push: + # branches: + # - main + release: + types: + - prereleased + - published + workflow_dispatch: + +jobs: + matrix-coverage: + uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 + with: + project: diffpy.pdffit2 + c_extension: true + headless: false + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/AUTHORS.rst b/AUTHORS.rst index 23ef2b2f..291f8356 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -23,7 +23,7 @@ contributors. This is an open-source project and we hope and expect that the list of contributors will expand with time. Many thanks to all current and future contributors! -For more information on the DiffPy project email sb2896@columbia.edu +For more information on the DiffPy project email sb2896@ucsb.edu DiffPy was initiated as part of the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) project, funded by the National Science diff --git a/CODE-OF-CONDUCT.rst b/CODE-OF-CONDUCT.rst index e8199ca5..25fafe27 100644 --- a/CODE-OF-CONDUCT.rst +++ b/CODE-OF-CONDUCT.rst @@ -67,7 +67,7 @@ Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -sb2896@columbia.edu. All complaints will be reviewed and investigated promptly and fairly. +sbillinge@ucsb.edu. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. diff --git a/LICENSE.rst b/LICENSE.rst index 092e90c5..725077f9 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -13,7 +13,7 @@ the following paper in your publication: in crystals (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007) Copyright 2006-2007, Board of Trustees of Michigan State University, -Copyright 2008-2025, Board of Trustees of Columbia University in the +Copyright 2008-2026, Board of Trustees of Columbia University in the city of New York. (Copyright holder indicated in each source file). For more information please visit the project web-page: diff --git a/README.rst b/README.rst index 0adcc4b1..f308a906 100644 --- a/README.rst +++ b/README.rst @@ -79,7 +79,7 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite Installation ------------ -diffpy.pdffit2 supports Python 3.11, 3.12, and 3.13. +diffpy.pdffit2 supports Python 3.12, 3.13, and 3.14. Windows, macOS (non-Arm64), Linux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/cookiecutter.json b/cookiecutter.json index 174c2873..8cf6acc5 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -1,7 +1,9 @@ { - "maintainer_name": "Simon Billinge", - "maintainer_email": "sb2896@columbia.edu", - "maintainer_github_username": "sbillinge", + "author_names": "Simon Billinge", + "author_emails": "sbillinge@ucsb.edu", + "maintainer_names": "Simon Billinge", + "maintainer_emails": "sbillinge@ucsb.edu", + "maintainer_github_usernames": "sbillinge", "contributors": "Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members", "license_holders": "The Trustees of Columbia University in the City of New York", "project_name": "diffpy.pdffit2", @@ -11,8 +13,8 @@ "package_dir_name": "diffpy.pdffit2", "project_short_description": "PDFfit2 - real space structure refinement program.", "project_keywords": "PDF, structure refinement", - "minimum_supported_python_version": "3.11", - "maximum_supported_python_version": "3.13", + "minimum_supported_python_version": "3.12", + "maximum_supported_python_version": "3.14", "project_needs_c_code_compiled": "Yes", "project_has_gui_tests": "No" } diff --git a/docs/source/api/diffpy.pdffit2.rst b/docs/source/api/diffpy.pdffit2.rst index 9bbc4637..c36a919e 100644 --- a/docs/source/api/diffpy.pdffit2.rst +++ b/docs/source/api/diffpy.pdffit2.rst @@ -13,6 +13,21 @@ Submodules ---------- +|module|:tocdepth: -1 + +|title| +======= + +.. |title| replace:: diffpy.pdffit2 package + +.. automodule:: diffpy.pdffit2 + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + diffpy.pdffit2.output module ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -36,3 +51,12 @@ diffpy.pdffit2.ipy_ext module :members: :undoc-members: :show-inheritance: + +-------- + +.. |module| replace:: diffpy.pdffit2.example_submodule module + +.. automodule:: diffpy.pdffit2.example_submodule + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/conf.py b/docs/source/conf.py index cf1514d6..63a8d305 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -52,12 +52,9 @@ "sphinx.ext.intersphinx", "sphinx_rtd_theme", "sphinx_copybutton", - "m2r", + "m2r2", ] -autodoc_mock_imports = [ - "diffpy.pdffit2.pdffit2", -] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -80,7 +77,6 @@ # |version| and |release|, also used in various other places throughout the # built documents. -fullversion = version(project) # The short X.Y version. version = "".join(fullversion.split(".post")[:1]) # The full version, including alpha/beta/rc tags. diff --git a/docs/source/index.rst b/docs/source/index.rst index 866af1a9..e4d7d320 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -9,6 +9,12 @@ | Software version |release| | Last updated |today|. +=============== +Getting started +=============== + +Welcome to the ``diffpy.pdffit2`` documentation! + The diffpy.pdffit2 package provides functions for the calculation and refinement of atomic Pair Distribution Functions (PDF) from crystal structure models. It is used as a computational engine by PDFgui. All @@ -88,7 +94,7 @@ Acknowledgements Table of contents ================= .. toctree:: - :titlesonly: + :maxdepth: 2 examples Package API diff --git a/pyproject.toml b/pyproject.toml index 959054dd..37a27a9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,15 +6,15 @@ build-backend = "setuptools.build_meta" name = "diffpy.pdffit2" dynamic=['version', 'dependencies'] authors = [ - { name="Simon Billinge", email="sb2896@columbia.edu" }, + {name='Simon Billinge', email='sbillinge@ucsb.edu'}, ] maintainers = [ - { name="Simon Billinge", email="sb2896@columbia.edu" }, + {name='Simon Billinge', email='sbillinge@ucsb.edu'}, ] description = "PDFfit2 - real space structure refinement program." keywords = ['PDF', 'structure refinement'] readme = "README.rst" -requires-python = ">=3.11, <3.14" +requires-python = ">=3.12, <3.15" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -25,9 +25,9 @@ classifiers = [ 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Operating System :: Unix', - 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', 'Topic :: Scientific/Engineering :: Physics', 'Topic :: Scientific/Engineering :: Chemistry', ] @@ -49,7 +49,7 @@ exclude = [] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) [project.scripts] -diffpy-pdffit2 = "diffpy.pdffit2_app:main" +diffpy-pdffit2 = "diffpy.pdffit2.app:main" [tool.setuptools.dynamic] dependencies = {file = ["requirements/pip.txt"]} @@ -57,7 +57,12 @@ dependencies = {file = ["requirements/pip.txt"]} [tool.codespell] exclude-file = ".codespell/ignore_lines.txt" ignore-words = ".codespell/ignore_words.txt" -skip = "*.cif,*.dat,*.cc,*.h" +skip = "*.cif,*.dat" + +[tool.docformatter] +recursive = true +wrap-summaries = 72 +wrap-descriptions = 72 [tool.black] line-length = 79 diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 04d8ace2..0f59515b 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -3,7 +3,7 @@ # # (c) 2008 trustees of the Michigan State University. # All rights reserved. -# (c) 2025 The Trustees of Columbia University in the City of New York. +# (c) 2025-2026 The Trustees of Columbia University in the City of New York. # All rights reserved. # # File coded by: Billinge Group members and community contributors. diff --git a/src/diffpy/pdffit2/__init__.py b/src/diffpy/pdffit2/__init__.py index 527477a5..07339c9e 100644 --- a/src/diffpy/pdffit2/__init__.py +++ b/src/diffpy/pdffit2/__init__.py @@ -3,10 +3,10 @@ # # (c) 2006 trustees of the Michigan State University. # All rights reserved. -# (c) 2025 The Trustees of Columbia University in the City of New York. +# (c) 2025-2026 The Trustees of Columbia University in the City of New York. # All rights reserved. # -# File coded by: Billinge Group members and community contributors. +# File coded by: Billinge group members and community contributors. # # See GitHub contributions for a more detailed list of contributors. # https://github.com/diffpy/diffpy.pdffit2/graphs/contributors diff --git a/src/diffpy/pdffit2/version.py b/src/diffpy/pdffit2/version.py index 7a1eaaaa..ee14bcd3 100644 --- a/src/diffpy/pdffit2/version.py +++ b/src/diffpy/pdffit2/version.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################## # -# (c) 2025 The Trustees of Columbia University in the City of New York. +# (c) 2025-2026 The Trustees of Columbia University in the City of New York. # All rights reserved. # # File coded by: Billinge Group members and community contributors. From 78854a43de2371383ed3a266afd1a368ea907f05 Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Wed, 25 Mar 2026 22:39:10 -0400 Subject: [PATCH 289/294] chore: run pre-commit on the repository --- docs/source/examples/Ni_refinement.py | 3 +- src/diffpy/pdffit2/ipy_ext.py | 4 +- src/diffpy/pdffit2/pdffit.py | 124 +++++++++++++++----------- tests/test_exceptions.py | 21 +++-- tests/test_pdffit.py | 3 +- tests/test_shape_factors.py | 12 ++- 6 files changed, 98 insertions(+), 69 deletions(-) diff --git a/docs/source/examples/Ni_refinement.py b/docs/source/examples/Ni_refinement.py index 67d93a3a..d4d5d582 100755 --- a/docs/source/examples/Ni_refinement.py +++ b/docs/source/examples/Ni_refinement.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -"""Perform simple refinement of Ni structure to the experimental x-ray PDF. +"""Perform simple refinement of Ni structure to the experimental x-ray +PDF. Save fitted curve, refined structure and results summary. """ diff --git a/src/diffpy/pdffit2/ipy_ext.py b/src/diffpy/pdffit2/ipy_ext.py index ac2b5475..c21f00d9 100644 --- a/src/diffpy/pdffit2/ipy_ext.py +++ b/src/diffpy/pdffit2/ipy_ext.py @@ -1,7 +1,7 @@ #!/usr/bin/env python -"""This module defines functions within IPython session to simulate the old -pdffit2 interactive session. +"""This module defines functions within IPython session to simulate the +old pdffit2 interactive session. Usage: %load_ext diffpy.pdffit2.ipy_ext """ diff --git a/src/diffpy/pdffit2/pdffit.py b/src/diffpy/pdffit2/pdffit.py index 1785b381..38ddde5d 100644 --- a/src/diffpy/pdffit2/pdffit.py +++ b/src/diffpy/pdffit2/pdffit.py @@ -46,7 +46,8 @@ def _format_value_std(value, stdev): def _format_bond_length(dij, ddij, ij1, symij): - """Return string with formatted bond length info for a pair of atoms. + """Return string with formatted bond length info for a pair of + atoms. dij -- distance between atoms i and j ddij -- standard deviation of dij. Ignored when small relative to dij. @@ -123,8 +124,8 @@ class PdfFit(object): Sctp = {"X": 0, "N": 1} def _exportAll(self, namespace): - """_exportAll(self, namespace) --> Export all 'public' class methods - into namespace. + """_exportAll(self, namespace) --> Export all 'public' class + methods into namespace. This function allows for a module-level PdfFit object which doesn't have to be referenced when calling a method. This @@ -193,8 +194,8 @@ def read_struct(self, struct): return def read_struct_string(self, struct, name=""): - """read_struct_string(struct, name = "") --> Read structure from a - string into memory. + """read_struct_string(struct, name = "") --> Read structure from + a string into memory. struct -- string containing the contents of the structure file name -- tag with which to label structure @@ -209,8 +210,8 @@ def read_struct_string(self, struct, name=""): return def read_data(self, data, stype, qmax, qdamp): - """read_data(data, stype, qmax, qdamp) --> Read pdf data from file into - memory. + """read_data(data, stype, qmax, qdamp) --> Read pdf data from + file into memory. data -- name of file from which to read data stype -- 'X' (xray) or 'N' (neutron) @@ -224,8 +225,8 @@ def read_data(self, data, stype, qmax, qdamp): return def read_data_string(self, data, stype, qmax, qdamp, name=""): - """read_data_string(data, stype, qmax, qdamp, name = "") --> Read pdf - data from a string into memory. + """read_data_string(data, stype, qmax, qdamp, name = "") --> + Read pdf data from a string into memory. data -- string containing the contents of the data file stype -- 'X' (xray) or 'N' (neutron) @@ -243,8 +244,8 @@ def read_data_string(self, data, stype, qmax, qdamp, name=""): def read_data_lists( self, stype, qmax, qdamp, r_data, Gr_data, dGr_data=None, name="list" ): - """read_data_lists(stype, qmax, qdamp, r_data, Gr_data, dGr_data = - None, name = "list") --> Read pdf data into memory from lists. + """read_data_lists(stype, qmax, qdamp, r_data, Gr_data, dGr_data + = None, name = "list") --> Read pdf data into memory from lists. All lists must be of the same length. stype -- 'X' (xray) or 'N' (neutron) @@ -283,15 +284,16 @@ def pdfrange(self, iset, rmin, rmax): return def reset(self): - """Reset() --> Clear all stored fit, structure, and parameter data.""" + """Reset() --> Clear all stored fit, structure, and parameter + data.""" self.stru_files = [] self.data_files = [] pdffit2.reset(self._handle) return def alloc(self, stype, qmax, qdamp, rmin, rmax, bin): - """Alloc(stype, qmax, qdamp, rmin, rmax, bin) --> Allocate space for a - PDF calculation. + """Alloc(stype, qmax, qdamp, rmin, rmax, bin) --> Allocate space + for a PDF calculation. The structure from which to calculate the PDF must first be imported with the read_struct() or read_struct_string() method. @@ -328,7 +330,8 @@ def calc(self): return def refine(self, toler=0.00000001): - """Refine(toler = 0.00000001) --> Fit the theory to the imported data. + """Refine(toler = 0.00000001) --> Fit the theory to the imported + data. toler -- tolerance of the fit @@ -347,7 +350,8 @@ def refine(self, toler=0.00000001): return def refine_step(self, toler=0.00000001): - """refine_step(toler = 0.00000001) --> Run a single step of the fit. + """refine_step(toler = 0.00000001) --> Run a single step of the + fit. toler -- tolerance of the fit @@ -364,7 +368,8 @@ def refine_step(self, toler=0.00000001): return self.finished def save_pdf(self, iset, fname): - """save_pdf(iset, fname) --> Save calculated or fitted PDF to file. + """save_pdf(iset, fname) --> Save calculated or fitted PDF to + file. iset -- data set to save @@ -376,7 +381,8 @@ def save_pdf(self, iset, fname): return def save_pdf_string(self, iset): - """save_pdf_string(iset) --> Save calculated or fitted PDF to string. + """save_pdf_string(iset) --> Save calculated or fitted PDF to + string. iset -- data set to save @@ -389,8 +395,8 @@ def save_pdf_string(self, iset): return pdffilestring def save_dif(self, iset, fname): - """save_dif(iset, fname) --> Save data and fitted PDF difference to - file. + """save_dif(iset, fname) --> Save data and fitted PDF difference + to file. iset -- data set to save @@ -402,8 +408,8 @@ def save_dif(self, iset, fname): return def save_dif_string(self, iset): - """save_dif_string(iset) --> Save data and fitted PDF difference to - string. + """save_dif_string(iset) --> Save data and fitted PDF difference + to string. iset -- data set to save @@ -452,8 +458,8 @@ def get_structure(self, ip): return stru def save_struct(self, ip, fname): - """save_struct(ip, fname) --> Save structure resulting from fit to - file. + """save_struct(ip, fname) --> Save structure resulting from fit + to file. ip -- phase to save @@ -465,7 +471,8 @@ def save_struct(self, ip, fname): return def save_struct_string(self, ip): - """save_struct(ip) --> Save structure resulting from fit to string. + """save_struct(ip) --> Save structure resulting from fit to + string. ip -- phase to save @@ -488,7 +495,8 @@ def show_struct(self, ip): return def constrain(self, var, par, fcon=None): - """Constrain(var, par[, fcon]) --> Constrain a variable to a parameter. + """Constrain(var, par[, fcon]) --> Constrain a variable to a + parameter. A variable can be constrained to a number or equation string. @@ -648,7 +656,8 @@ def getpdf_diff(self): return Gdiff def get_atoms(self, ip=None): - """get_atoms() --> Get element symbols of all atoms in the structure. + """get_atoms() --> Get element symbols of all atoms in the + structure. ip -- index of phase to get the elements from (starting from 1) when ip is not given, use current phase @@ -754,7 +763,8 @@ def psel(self, ip): return def pdesel(self, ip): - """Pdesel(ip) --> Exclude phase ip from calculation of total PDF. + """Pdesel(ip) --> Exclude phase ip from calculation of total + PDF. pdesel('ALL') excludes all phases from PDF calculation. @@ -851,9 +861,9 @@ def bang(self, i, j, k): return def bond_angle(self, i, j, k): - """bond_angle(i, j, k) --> bond angle defined by atoms i, j, k. Angle - is calculated using the shortest ji and jk lengths with respect to - periodic boundary conditions. + """bond_angle(i, j, k) --> bond angle defined by atoms i, j, k. + Angle is calculated using the shortest ji and jk lengths with + respect to periodic boundary conditions. i, j, k -- atom indices starting at 1 @@ -942,8 +952,9 @@ def blen(self, *args): return def bond_length_atoms(self, i, j): - """bond_length_atoms(i, j) --> shortest distance between atoms i, j. - Periodic boundary conditions are applied to find the shortest bond. + """bond_length_atoms(i, j) --> shortest distance between atoms + i, j. Periodic boundary conditions are applied to find the + shortest bond. i -- index of the first atom starting at 1 j -- index of the second atom starting at 1 @@ -957,7 +968,8 @@ def bond_length_atoms(self, i, j): return rv def bond_length_types(self, a1, a2, lb, ub): - """bond_length_types(a1, a2, lb, ub) --> get all a1-a2 distances. + """bond_length_types(a1, a2, lb, ub) --> get all a1-a2 + distances. a1 -- symbol of the first element in pair or "ALL" a2 -- symbol of the second element in pair or "ALL" @@ -978,8 +990,8 @@ def bond_length_types(self, a1, a2, lb, ub): return rv def show_scat(self, stype): - """show_scat(stype) --> Print scattering length for all atoms in the - current phase. + """show_scat(stype) --> Print scattering length for all atoms in + the current phase. stype -- 'X' (xray) or 'N' (neutron). @@ -989,8 +1001,8 @@ def show_scat(self, stype): return def get_scat_string(self, stype): - """get_scat_string(stype) --> Get string with scattering factors of all - atoms in the current phase. + """get_scat_string(stype) --> Get string with scattering factors + of all atoms in the current phase. stype -- 'X' (xray) or 'N' (neutron). @@ -1002,10 +1014,10 @@ def get_scat_string(self, stype): return pdffit2.get_scat_string(self._handle, stype.encode()) def get_scat(self, stype, element): - """get_scat(stype, element) --> Get active scattering factor for given - element. If scattering factor has been changed using set_scat the - result may depend on the active phase. When no phase has been loaded, - return the standard value. + """get_scat(stype, element) --> Get active scattering factor for + given element. If scattering factor has been changed using + set_scat the result may depend on the active phase. When no + phase has been loaded, return the standard value. stype -- 'X' (xray) or 'N' (neutron). element -- case-insensitive element symbol such as "Na" or "CL" @@ -1019,9 +1031,10 @@ def get_scat(self, stype, element): return rv def set_scat(self, stype, element, value): - """set_scat(stype, element, value) --> Set custom scattering factor for - given element. The new scattering factor applies only for the current - phase, in other phases it keeps its default value. + """set_scat(stype, element, value) --> Set custom scattering + factor for given element. The new scattering factor applies + only for the current phase, in other phases it keeps its default + value. stype -- 'X' (xray) or 'N' (neutron). element -- case-insensitive element symbol such as "Na" or "CL" @@ -1039,9 +1052,9 @@ def set_scat(self, stype, element, value): return def reset_scat(self, element): - """reset_scat(stype, element) --> Reset scattering factors for given - element to their standard values. The reset_scat applies only for the - current phase. + """reset_scat(stype, element) --> Reset scattering factors for + given element to their standard values. The reset_scat applies + only for the current phase. element -- case-insensitive element symbol such as "Na" or "CL" Raises: @@ -1069,7 +1082,8 @@ def num_phases(self): return n def num_datasets(self): - """num_datasets() --> Number of datasets loaded in PdfFit instance. + """num_datasets() --> Number of datasets loaded in PdfFit + instance. Use setdata to bring a specific dataset in focus. @@ -1079,9 +1093,9 @@ def num_datasets(self): return n def phase_fractions(self): - """phase_fractions() --> relative phase fractions for current dataset. - Convert phase scale factors to relative phase fractions given the - scattering type of current dataset. + """phase_fractions() --> relative phase fractions for current + dataset. Convert phase scale factors to relative phase fractions + given the scattering type of current dataset. Return a dictionary of phase fractions with following keys: @@ -1254,7 +1268,8 @@ def qbroad(): qbroad = staticmethod(qbroad) def spdiameter(): - """Spdiameter() --> Get reference to spdiameter (phase property). + """Spdiameter() --> Get reference to spdiameter (phase + property). Diameter value for the spherical particle PDF correction. Spherical envelope is not applied when spdiameter equals 0. @@ -1307,7 +1322,8 @@ def __init__(self, create_intro=True): return def __getRef(self, var_string): - """Return the actual reference to the variable in the var_string. + """Return the actual reference to the variable in the + var_string. This function must be called before trying to actually reference an internal variable. See the constrain method for an example. diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py index 07a4f4ea..58272d92 100644 --- a/tests/test_exceptions.py +++ b/tests/test_exceptions.py @@ -46,7 +46,8 @@ def test_structureError(self): ) def test_structureErrorZeroVolume(self): - """Raise pdffit2.structureError when unit cell volume is negative.""" + """Raise pdffit2.structureError when unit cell volume is + negative.""" # I don't know how to test for this, but it's in the library code self.assertRaises( pdffit2.structureError, @@ -312,7 +313,8 @@ def tearDown(self): del self.P def test_unassignedError(self): - """Raise pdffit2.unassignedError when no space has been allocated.""" + """Raise pdffit2.unassignedError when no space has been + allocated.""" self.assertRaises(pdffit2.unassignedError, self.P.calc) @@ -647,11 +649,13 @@ def tearDown(self): del self.P def test_unassignedError1(self): - """Raise pdffit2.unassignedError when parameter does not exist.""" + """Raise pdffit2.unassignedError when parameter does not + exist.""" self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) def test_unassignedError2(self): - """Raise pdffit2.unassignedError when parameter does not exist.""" + """Raise pdffit2.unassignedError when parameter does not + exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.constrain(self.P.lat(1), 2) self.assertRaises(pdffit2.unassignedError, self.P.getpar, 1) @@ -985,7 +989,8 @@ def tearDown(self): del self.P def test_unassignedError(self): - """Raise pdffit2.unassignedError when parameter does not exist.""" + """Raise pdffit2.unassignedError when parameter does not + exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.fixpar, 1) @@ -1003,7 +1008,8 @@ def tearDown(self): del self.P def test_unassignedError(self): - """Raise pdffit2.unassignedError when parameter does not exist.""" + """Raise pdffit2.unassignedError when parameter does not + exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.freepar, 1) @@ -1039,7 +1045,8 @@ def tearDown(self): del self.P def test_unassignedError(self): - """Raise pdffit2.unassignedError when data set does not exist.""" + """Raise pdffit2.unassignedError when data set does not + exist.""" self.P.read_struct(self.datafile("Ni.stru")) self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.assertRaises(pdffit2.unassignedError, self.P.setdata, 2) diff --git a/tests/test_pdffit.py b/tests/test_pdffit.py index 54b1a1c8..e6823da7 100644 --- a/tests/test_pdffit.py +++ b/tests/test_pdffit.py @@ -341,7 +341,8 @@ def test_getcrw(self): return def test_getcrw_two_datasets(self): - """Check that getcrw() and getrw() are consistent for two datasets.""" + """Check that getcrw() and getrw() are consistent for two + datasets.""" self.P.read_data(self.datafile("Ni.dat"), "X", 25.0, 0.0) self.P.pdfrange(1, 2, 8) self.P.read_data(self.datafile("300K.gr"), "N", 32.0, 0.0) diff --git a/tests/test_shape_factors.py b/tests/test_shape_factors.py index 70424e58..ee61c9ac 100644 --- a/tests/test_shape_factors.py +++ b/tests/test_shape_factors.py @@ -83,7 +83,8 @@ def test_refinement(self): return def test_twophase_calculation(self): - """Check PDF calculation for 2 phases with different spdiameters.""" + """Check PDF calculation for 2 phases with different + spdiameters.""" d1 = 6 d2 = 9 self.P.read_struct(self.datafile("Ni.stru")) @@ -114,7 +115,8 @@ def test_twophase_calculation(self): return def test_twophase_refinement(self): - """Check PDF refinement of 2 phases that have different spdiameter.""" + """Check PDF refinement of 2 phases that have different + spdiameter.""" dcheck1 = 8.0 dstart1 = 8.2 dcheck2 = 6.0 @@ -153,7 +155,8 @@ def test_twophase_refinement(self): return def test_spdiameter_io(self): - """Check reading and writing of spdiameter from structure file.""" + """Check reading and writing of spdiameter from structure + file.""" import re self.P.read_struct(self.datafile("Ni.stru")) @@ -218,7 +221,8 @@ def test_stepcut_calculation(self): return def test_twophase_stepcut_calculation(self): - """Check PDF calculation for 2 phases with different spdiameters.""" + """Check PDF calculation for 2 phases with different + spdiameters.""" d1 = 6 d2 = 9 self.P.read_struct(self.datafile("Ni.stru")) From 511fc9f76b62c78487dcd9b35f3e89492280990a Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Wed, 25 Mar 2026 22:47:45 -0400 Subject: [PATCH 290/294] chore: make minor fixes --- AUTHORS.rst | 2 +- docs/source/api/diffpy.pdffit2.rst | 24 ------------------------ pyproject.toml | 2 +- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 291f8356..21affc26 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -23,7 +23,7 @@ contributors. This is an open-source project and we hope and expect that the list of contributors will expand with time. Many thanks to all current and future contributors! -For more information on the DiffPy project email sb2896@ucsb.edu +For more information on the DiffPy project email sbillinge@ucsb.edu DiffPy was initiated as part of the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) project, funded by the National Science diff --git a/docs/source/api/diffpy.pdffit2.rst b/docs/source/api/diffpy.pdffit2.rst index c36a919e..9bbc4637 100644 --- a/docs/source/api/diffpy.pdffit2.rst +++ b/docs/source/api/diffpy.pdffit2.rst @@ -13,21 +13,6 @@ Submodules ---------- -|module|:tocdepth: -1 - -|title| -======= - -.. |title| replace:: diffpy.pdffit2 package - -.. automodule:: diffpy.pdffit2 - :members: - :undoc-members: - :show-inheritance: - -Submodules ----------- - diffpy.pdffit2.output module ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -51,12 +36,3 @@ diffpy.pdffit2.ipy_ext module :members: :undoc-members: :show-inheritance: - --------- - -.. |module| replace:: diffpy.pdffit2.example_submodule module - -.. automodule:: diffpy.pdffit2.example_submodule - :members: - :undoc-members: - :show-inheritance: diff --git a/pyproject.toml b/pyproject.toml index 37a27a9c..0722d4e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ exclude = [] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) [project.scripts] -diffpy-pdffit2 = "diffpy.pdffit2.app:main" +diffpy-pdffit2 = "diffpy.pdffit2_app:main" [tool.setuptools.dynamic] dependencies = {file = ["requirements/pip.txt"]} From 94cabbe4cc90af4cf2533f273b0c08251b7a6a5e Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Thu, 26 Mar 2026 14:34:33 -0400 Subject: [PATCH 291/294] chore: add back autodoc and .cc and .h skips for codespell --- docs/source/conf.py | 4 ++++ pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 63a8d305..9de6b62e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -55,6 +55,10 @@ "m2r2", ] +autodoc_mock_imports = [ + "diffpy.pdffit2.pdffit2", +] + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/pyproject.toml b/pyproject.toml index 0722d4e6..394308b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ dependencies = {file = ["requirements/pip.txt"]} [tool.codespell] exclude-file = ".codespell/ignore_lines.txt" ignore-words = ".codespell/ignore_words.txt" -skip = "*.cif,*.dat" +skip = "*.cif,*.dat,*.cc,*.h" [tool.docformatter] recursive = true From 3ff049b50dba2f2be77bf1ac33defcbf1cb05cf7 Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Fri, 27 Mar 2026 04:05:08 -0400 Subject: [PATCH 292/294] fix: fix formatting error in issue template and add m2r2 as docs dependency --- .github/ISSUE_TEMPLATE/release_checklist.md | 4 +--- requirements/docs.txt | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 9b287caf..56c5fca3 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -1,11 +1,9 @@ - --- - +--- name: Release about: Checklist and communication channel for PyPI and GitHub release title: "Ready for PyPI/GitHub release" labels: "release" assignees: "" - --- ### PyPI/GitHub rc-release preparation checklist: diff --git a/requirements/docs.txt b/requirements/docs.txt index 5f34c6ed..1de813f9 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -2,4 +2,4 @@ sphinx sphinx_rtd_theme sphinx-copybutton doctr -m2r +m2r2 From 60e05b3223db70063484ee1aef57101e555194ab Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Fri, 27 Mar 2026 04:07:53 -0400 Subject: [PATCH 293/294] skpkg: add news file --- news/quick-fixes.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/quick-fixes.rst diff --git a/news/quick-fixes.rst b/news/quick-fixes.rst new file mode 100644 index 00000000..c4a40ff2 --- /dev/null +++ b/news/quick-fixes.rst @@ -0,0 +1,23 @@ +**Added:** + +* No news added: Minor fixes for requirements folder and release issue template. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From bb19f61a18c0fd36686992a2e22d6fba952436fc Mon Sep 17 00:00:00 2001 From: sbillinge <4254545+sbillinge@users.noreply.github.com> Date: Fri, 27 Mar 2026 10:36:49 +0000 Subject: [PATCH 294/294] update changelog --- CHANGELOG.rst | 4 ++++ news/docs-fix.rst | 23 ----------------------- news/quick-fixes.rst | 23 ----------------------- 3 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 news/docs-fix.rst delete mode 100644 news/quick-fixes.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4d78e4e3..feba9007 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,10 @@ Release notes .. current developments +1.6.0 +===== + + 1.5.2 ===== diff --git a/news/docs-fix.rst b/news/docs-fix.rst deleted file mode 100644 index 2f89e68c..00000000 --- a/news/docs-fix.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* No News Added: Fix sphinx warning with manual fix - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* diff --git a/news/quick-fixes.rst b/news/quick-fixes.rst deleted file mode 100644 index c4a40ff2..00000000 --- a/news/quick-fixes.rst +++ /dev/null @@ -1,23 +0,0 @@ -**Added:** - -* No news added: Minor fixes for requirements folder and release issue template. - -**Changed:** - -* - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -*