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
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Authors
=======
-------

Christopher Farrow, Pavol Juhas, Caden Myers, Simon J. L. Billinge, and members of the Billinge Group

Expand Down
7 changes: 5 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
napoleon_custom_sections = [
("Managed Parameters", "Attributes"),
("Usable Metadata", "Attributes"),
("General Metadata", "Attributes"),
("General Metadata", "params_style"),
("Metadata", "Attributes"),
("Properties", "Attributes"),
("Operator Attributes", "Attributes"),
Expand Down Expand Up @@ -334,4 +334,7 @@


# Example configuration for intersphinx: refer to the Python standard library.
# intersphinx_mapping = {'http://docs.python.org/': None}
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
}
23 changes: 23 additions & 0 deletions news/clean-python-3.14.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Support for Python 3.14

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* Support for Python 3.11

**Fixed:**

* <news item>

**Security:**

* <news item>
23 changes: 23 additions & 0 deletions news/documentation-metadata.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No News Added: rebuild the documentation with proper metadata handling

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
23 changes: 23 additions & 0 deletions news/fix-qmax-update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Fixed load new parsed data with updated `Qmax` attribute

**Security:**

* <news item>
23 changes: 23 additions & 0 deletions news/fix-test-package.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Added `diffpy.structure` back to the requirements and run the test

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
23 changes: 23 additions & 0 deletions news/sync-w-main-v2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No news needed: merge main into v3.3.0.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
23 changes: 23 additions & 0 deletions news/update_pre-commit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No news needed: updating docformatter not user facing

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
1 change: 1 addition & 0 deletions requirements/conda.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ numpy
scipy
bg-mpl-stylesheets
diffpy.utils
diffpy.structure
1 change: 1 addition & 0 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ numpy
scipy
bg-mpl-stylesheets
diffpy.utils
diffpy.structure
3 changes: 3 additions & 0 deletions src/diffpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@
# See LICENSE.rst for license information.
#
##############################################################################
from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)
4 changes: 1 addition & 3 deletions src/diffpy/srfit/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
# See LICENSE.txt for license information.
#
##############################################################################
"""
Exceptions used for SrFit - specific errors.
"""
"""Exceptions used for SrFit - specific errors."""

# FIXME: remove this line when black and docformatter agree.

Expand Down
24 changes: 13 additions & 11 deletions src/diffpy/srfit/fitbase/fitrecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,10 @@ def residual(self, p=[]):
----------
p : list or numpy.ndarray
The list of current variable values, provided in the same order
as the '_parameters' list. If p is an empty iterable (default),
then it is assumed that the parameters have already been
updated in some other way, and the explicit update within this
function is skipped.
as the ``_parameters`` list. If ``p`` is an empty iterable
(default), then it is assumed that the parameters have already
been updated in some other way, and the explicit update within
this function is skipped.

Return
------
Expand Down Expand Up @@ -541,15 +541,17 @@ def scalar_residual(self, p=[]):
----------
p : list or numpy.ndarray
The list of current variable values, provided in the same order
as the '_parameters' list. If p is an empty iterable (default),
then it is assumed that the parameters have already been
updated in some other way, and the explicit update within this
function is skipped.
as the ``_parameters`` list. If ``p`` is an empty iterable
(default), then it is assumed that the parameters have already
been updated in some other way, and the explicit update within
this function is skipped.

Notes
-----
The residual is by default the weighted concatenation of each
FitContribution's residual, plus the value of each restraint. The array
returned, denoted chiv, is such that
dot(chiv, chiv) = chi^2 + restraints.
:class:`FitContribution` residual, plus the value of each restraint.
The returned array, denoted ``chiv``, is such that
``dot(chiv, chiv) = chi^2 + restraints``.
"""
chiv = self.residual(p)
return dot(chiv, chiv)
Expand Down
17 changes: 11 additions & 6 deletions src/diffpy/srfit/fitbase/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,16 @@ def set_observed_profile(self, xobs, yobs, dyobs=None):
Numpy array of the observed signal.
dyobs
Numpy array of the uncertainty in the observed signal. If
dyobs is None (default), it will be set to 1 at each
observed xobs.
`dyobs` is None (default), it will be set to 1 at each
observed `xobs`.

Raises ValueError if len(yobs) != len(xobs)
Raises ValueError if dyobs != None and len(dyobs) != len(xobs)

Raises
-----------
ValueError
if len(yobs) != len(xobs)
ValueError
if dyobs != None and len(dyobs) != len(xobs)
"""
if len(yobs) != len(xobs):
raise ValueError("xobs and yobs are different lengths")
Expand Down Expand Up @@ -247,8 +252,8 @@ def set_calculation_range(self, xmin=None, xmax=None, dx=None):
The sample spacing in the independent variable. When different
from the data, resample the ``x`` as anchored at ``xmin``.

Note that xmin is always inclusive (unless clipped). xmax is inclusive
if it is within the bounds of the observed data.
Note that ``xmin`` is always inclusive (unless clipped).
``xmax`` is inclusive if it is within the bounds of the observed data.

Raises
------
Expand Down
19 changes: 15 additions & 4 deletions src/diffpy/srfit/fitbase/profileparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ def parseString(self, patstring):
patstring
A string containing the pattern

Raises ParseError if the string cannot be parsed
Raises
----------
ParseError if the string cannot be parsed
"""
raise NotImplementedError()

Expand All @@ -170,8 +172,12 @@ def parseFile(self, filename):
filename
The name of the file to parse

Raises IOError if the file cannot be read
Raises ParseError if the file cannot be parsed
Raises
----------
IOError
if the file cannot be read
ParseError
if the file cannot be parsed
"""
infile = open(filename, "r")
self._banks = []
Expand Down Expand Up @@ -339,7 +345,10 @@ def select_bank(self, index):
index
index of bank (integer, starting at 0).

Raises IndexError if requesting a bank that does not exist
Raises
----------
IndexError
if requesting a bank that does not exist
"""
if index is None:
index = self._meta.get("bank", 0)
Expand Down Expand Up @@ -384,6 +393,8 @@ def get_data(self, index=None):
index of bank (integer, starting at 0, default None). If
index is None then the currently selected bank is used.

Returns
----------
This returns (x, y, dx, dy) tuple for the bank. dx is 0 if it cannot
be determined from the data format.
"""
Expand Down
19 changes: 11 additions & 8 deletions src/diffpy/srfit/fitbase/simplerecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,12 @@ def set_observed_profile(self, xobs, yobs, dyobs=None):
dyobs is None (default), it will be set to 1 at each
observed xobs.


Raises ValueError if len(yobs) != len(xobs)
Raises ValueError if dyobs != None and len(dyobs) != len(xobs)
Raises
----------
ValueError
if len(yobs) != len(xobs)
ValueError
if dyobs != None and len(dyobs) != len(xobs)
"""
return self.profile.set_observed_profile(xobs, yobs, dyobs)

Expand All @@ -222,20 +225,20 @@ def set_calculation_range(self, xmin=None, xmax=None, dx=None):
Parameters
----------

xmin : float or "obs", optional
xmin : float or `obs`, optional
The minimum value of the independent variable. Keep the
current minimum when not specified. If specified as "obs"
reset to the minimum observed value.
xmax : float or "obs", optional
xmax : float or `obs`, optional
The maximum value of the independent variable. Keep the
current maximum when not specified. If specified as "obs"
reset to the maximum observed value.
dx : float or "obs", optional
dx : float or `obs`, optional
The sample spacing in the independent variable. When different
from the data, resample the ``x`` as anchored at ``xmin``.

Note that xmin is always inclusive (unless clipped). xmax is inclusive
if it is within the bounds of the observed data.
Note that ``xmin`` is always inclusive (unless clipped).
``xmax`` is inclusive if it is within the bounds of the observed data.

Raises
------
Expand Down
10 changes: 5 additions & 5 deletions src/diffpy/srfit/pdf/pdfcontribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,20 @@ def setCalculationRange(self, xmin=None, xmax=None, dx=None):
Parameters
----------
xmin : float or "obs", optional
xmin : float or `obs`, optional
The minimum value of the independent variable. Keep the
current minimum when not specified. If specified as "obs"
reset to the minimum observed value.
xmax : float or "obs", optional
xmax : float or `obs`, optional
The maximum value of the independent variable. Keep the
current maximum when not specified. If specified as "obs"
reset to the maximum observed value.
dx : float or "obs", optional
dx : float or `obs`, optional
The sample spacing in the independent variable. When different
from the data, resample the ``x`` as anchored at ``xmin``.
Note that xmin is always inclusive (unless clipped). xmax is inclusive
if it is within the bounds of the observed data.
Note that ``xmin`` is always inclusive (unless clipped).
``xmax`` is inclusive if it is within the bounds of the observed data.
Raises
------
Expand Down
5 changes: 4 additions & 1 deletion src/diffpy/srfit/pdf/pdfparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ def parseString(self, patstring):
patstring
A string containing the pattern

Raises ParseError if the string cannot be parsed
Raises
----------
ParseError
if the string cannot be parsed
"""
# useful regex patterns:
rx = {"f": r"[-+]?(\d+(\.\d*)?|\d*\.\d+)([eE][-+]?\d+)?"}
Expand Down
Loading
Loading