Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions docs/source/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
23 changes: 23 additions & 0 deletions news/docs-fix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No News Added: Fix sphinx warning with manual fix

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
50 changes: 26 additions & 24 deletions src/diffpy/pdffit2/pdffit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
"""
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Loading