Skip to content

Commit 45d87f5

Browse files
authored
Merge pull request #160 from stevenhua0320/docs-fix
docs: fix sphinx build for manual part fix
2 parents 06d1592 + b9ae998 commit 45d87f5

File tree

3 files changed

+58
-31
lines changed

3 files changed

+58
-31
lines changed

docs/source/license.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ If you use this program to do productive scientific research that leads
1212
to publication, we ask that you acknowledge use of the program by citing
1313
the following paper in your publication:
1414

15-
C. L. Farrow, P. Juhás, J. W. Liu, D. Bryndin, E. S. Božin, J. Bloch, Th. Proffen
16-
and S. J. L. Billinge, PDFfit2 and PDFgui: computer programs for studying nanostructure
17-
in crystals (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007)
15+
```
16+
C. L. Farrow, P. Juhás, J. W. Liu, D. Bryndin, E. S. Božin, J. Bloch, Th. Proffen
17+
and S. J. L. Billinge, PDFfit2 and PDFgui: computer programs for studying nanostructure
18+
in crystals (https://stacks.iop.org/0953-8984/19/335219), *J. Phys.: Condens. Matter*, 19, 335219 (2007)
19+
```
1820

1921
Copyright 2006-2007, Board of Trustees of Michigan State University,
20-
Copyright 2008-2025, Board of Trustees of Columbia University in the
21-
city of New York. (Copyright holder indicated in each source file).
22+
Copyright 2008-2025, Board of Trustees of Columbia University in the city of New York.
23+
(Copyright holder indicated in each source file).
2224

2325
For more information please visit the project web-page:
24-
http://www.diffpy.org/
25-
or email Prof. Simon Billinge at [email protected]
26+
[http://www.diffpy.org/](http://www.diffpy.org/)
27+
or email Prof. Simon Billinge at [[email protected]](mailto:[email protected])
2628

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

news/docs-fix.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* No News Added: Fix sphinx warning with manual fix
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

src/diffpy/pdffit2/pdffit.py

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ def read_data(self, data, stype, qmax, qdamp):
214214
215215
data -- name of file from which to read data
216216
stype -- 'X' (xray) or 'N' (neutron)
217-
qmax -- Q-value cutoff used in PDF calculation.
218-
Use qmax=0 to neglect termination ripples.
217+
qmax -- Q-value cutoff used in PDF calculation. Use qmax=0 to neglect termination ripples.
219218
qdamp -- instrumental Q-resolution factor
220219
221220
Raises: IOError when the file cannot be read from disk
@@ -230,8 +229,7 @@ def read_data_string(self, data, stype, qmax, qdamp, name=""):
230229
231230
data -- string containing the contents of the data file
232231
stype -- 'X' (xray) or 'N' (neutron)
233-
qmax -- Q-value cutoff used in PDF calculation.
234-
Use qmax=0 to neglect termination ripples.
232+
qmax -- Q-value cutoff used in PDF calculation. Use qmax=0 to neglect termination ripples.
235233
qdamp -- instrumental Q-resolution factor
236234
name -- tag with which to label data
237235
"""
@@ -250,8 +248,7 @@ def read_data_lists(
250248
251249
All lists must be of the same length.
252250
stype -- 'X' (xray) or 'N' (neutron)
253-
qmax -- Q-value cutoff used in PDF calculation.
254-
Use qmax=0 to neglect termination ripples.
251+
qmax -- Q-value cutoff used in PDF calculation. Use qmax=0 to neglect termination ripples.
255252
qdamp -- instrumental Q-resolution factor
256253
r_data -- list of r-values
257254
Gr_data -- list of G(r) values
@@ -298,9 +295,9 @@ def alloc(self, stype, qmax, qdamp, rmin, rmax, bin):
298295
299296
The structure from which to calculate the PDF must first be imported
300297
with the read_struct() or read_struct_string() method.
298+
301299
stype -- 'X' (xray) or 'N' (neutron)
302-
qmax -- Q-value cutoff used in PDF calculation.
303-
Use qmax=0 to neglect termination ripples.
300+
qmax -- Q-value cutoff used in PDF calculation. Use qmax=0 to neglect termination ripples.
304301
qdamp -- instrumental Q-resolution factor
305302
rmin -- minimum r-value of calculation
306303
rmax -- maximum r-value of calculation
@@ -494,24 +491,29 @@ def constrain(self, var, par, fcon=None):
494491
"""Constrain(var, par[, fcon]) --> Constrain a variable to a parameter.
495492
496493
A variable can be constrained to a number or equation string.
497-
var -- variable to constrain, such as x(1)
498-
par -- parameter which to constrain the variable. This can be
499-
an integer or an equation string containing a reference
500-
to another parameter. Equation strings use standard c++
501-
syntax. The value of a constrained parameter is accessed
502-
as @p in an equation string, where p is the parameter.
503-
e.g.
504-
>>> constrain(x(1), 1)
505-
>>> constrain(x(2), "0.5+@1")
506-
fcon -- 'USER', 'IDENT', 'FCOMP', or 'FSQR'
507-
this is an optional parameter, and I don't know how it is
508-
used!
509494
510-
Raises:
511-
pdffit2.constraintError if a constraint is bad
512-
pdffit2.unassignedError if variable does not yet exist
513-
ValueError if variable index does not exist (e.g. lat(7))
495+
:param var: variable to constrain, such as x(1)
496+
:param par: parameter which to constrain the variable. This can be an
497+
integer or an equation string containing a reference to
498+
another parameter. Equation strings use standard C++
499+
syntax. The value of a constrained parameter is accessed
500+
as ``@p`` in an equation string, where ``p`` is the
501+
parameter.
502+
:type par: int or str
503+
:param fcon: 'USER', 'IDENT', 'FCOMP', or 'FSQR'. This is an optional
504+
parameter; usage is currently unclear.
505+
:type fcon: str
506+
507+
Example::
508+
509+
>>> constrain(x(1), 1)
510+
>>> constrain(x(2), "0.5+@1")
511+
512+
:raises pdffit2.constraintError: if a constraint is bad
513+
:raises pdffit2.unassignedError: if variable does not yet exist
514+
:raises ValueError: if variable index does not exist (e.g. lat(7))
514515
"""
516+
515517
var_ref = self.__getRef(var)
516518
varnc = _convertCallable(var)
517519
if fcon:

0 commit comments

Comments
 (0)