From 72c233dc8d6daf59b47217b7102b39adc22c9318 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Fri, 5 Dec 2025 13:49:23 -0500 Subject: [PATCH 1/2] 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 5cdf347..a60278a 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 2e7ce74..1785b38 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 2/2] 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 0000000..2f89e68 --- /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:** + +*