Skip to content

Commit 64ad577

Browse files
authored
Merge pull request #369 from stevenhua0320/scikit-package-1
scikit:recut diffpy.utils using latest scikit-package.
2 parents 52702e2 + f0d2a4d commit 64ad577

File tree

16 files changed

+152
-56
lines changed

16 files changed

+152
-56
lines changed

.github/ISSUE_TEMPLATE/release_checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Please let the maintainer know that all checks are done and the package is ready
3434
<!-- After the maintainer releases the PyPI package, please check the following when creating a PR for conda-forge release.-->
3535

3636
- [ ] Ensure that the full release has appeared on PyPI successfully.
37-
- [ ] New package dependencies listed in `conda.txt` and `test.txt` are added to `meta.yaml` in the feedstock.
37+
- [ ] New package dependencies listed in `conda.txt` and `tests.txt` are added to `meta.yaml` in the feedstock.
3838
- [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions.
3939
- [ ] Tag the maintainer for conda-forge release.
4040

.github/workflows/build-wheel-release-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml
88

99
jobs:
10-
release:
10+
build-release:
1111
uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
1212
with:
1313
project: diffpy.utils

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
:target: https://anaconda.org/conda-forge/diffpy.utils
2626

2727
.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
28+
:target: https://github.com/diffpy/diffpy.utils/pulls
2829

2930
.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.utils
3031
:target: https://pypi.org/project/diffpy.utils/
@@ -35,8 +36,7 @@
3536
.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
3637
:target: https://github.com/diffpy/diffpy.utils/issues
3738

38-
diffpy.utils Package
39-
========================================================================
39+
Shared utilities for diffpy packages.
4040

4141
General utilities for analyzing diffraction data
4242

cookiecutter.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"maintainer_name": "Simon Billinge",
3+
"maintainer_email": "[email protected]",
4+
"maintainer_github_username": "sbillinge",
5+
"contributors": "Timur Davis, Chris Farrow, Pavol Juhas",
6+
"license_holders": "The Trustees of Columbia University in the City of New York",
7+
"project_name": "diffpy.utils",
8+
"github_username_or_orgname": "diffpy",
9+
"github_repo_name": "diffpy.utils",
10+
"conda_pypi_package_dist_name": "diffpy.utils",
11+
"package_dir_name": "diffpy.utils",
12+
"project_short_description": "Shared utilities for diffpy packages.",
13+
"project_keywords": "text data parsers, wx grid, diffraction objects",
14+
"minimum_supported_python_version": "3.11",
15+
"maximum_supported_python_version": "3.13",
16+
"project_needs_c_code_compiled": "No",
17+
"project_has_gui_tests": "No"
18+
}

docs/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
diffpy.utils - General utilities for analyzing diffraction data
88

9-
| Software version |release|.
9+
| Software version |release|
1010
| Last updated |today|.
1111
1212
The diffpy.utils package provides a number of functions and classes designed to help
@@ -33,7 +33,7 @@ Illustrations of when and how one would use various diffpy.utils functions.
3333
Authors
3434
=======
3535

36-
diffpy.utils is developed by members of the Billinge Group at
36+
``diffpy.utils`` is developed by members of the Billinge Group at
3737
Columbia University and at Brookhaven National Laboratory including
3838
Pavol Juhás, Christopher L. Farrow, Simon J. L. Billinge, Andrew Yang,
3939
with contributions from many Billinge Group members and

news/scikit-package.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: recut diffpy.utils using latest scikit-package
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>

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ include = ["*"] # package names should match these glob patterns (["*"] by defa
4848
exclude = [] # exclude packages matching these glob patterns (empty by default)
4949
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
5050

51+
[project.scripts]
52+
diffpy-utils = "diffpy.utils_app:main"
53+
5154
[tool.setuptools.dynamic]
5255
dependencies = {file = ["requirements/pip.txt"]}
5356

@@ -56,6 +59,11 @@ exclude-file = ".codespell/ignore_lines.txt"
5659
ignore-words = ".codespell/ignore_words.txt"
5760
skip = "*.cif,*.dat"
5861

62+
[tool.docformatter]
63+
recursive = true
64+
wrap-summaries = 72
65+
wrap-descriptions = 72
66+
5967
[tool.black]
6068
line-length = 79
6169
include = '\.pyi?$'

src/diffpy/utils/_deprecator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212

1313
def deprecated(message, *, category=DeprecationWarning, stacklevel=1):
14-
"""Deprecation decorator for functions and classes that is compatible with
15-
Python versions prior to 3.13.
14+
"""Deprecation decorator for functions and classes that is
15+
compatible with Python versions prior to 3.13.
1616
1717
Examples
1818
--------

src/diffpy/utils/diffraction_objects.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def __eq__(self, other):
211211
return True
212212

213213
def __add__(self, other):
214-
"""Add a scalar value or another DiffractionObject to the yarray of the
215-
DiffractionObject.
214+
"""Add a scalar value or another DiffractionObject to the yarray
215+
of the DiffractionObject.
216216
217217
Parameters
218218
----------
@@ -262,8 +262,8 @@ def __add__(self, other):
262262
__radd__ = __add__
263263

264264
def __sub__(self, other):
265-
"""Subtract scalar value or another DiffractionObject to the yarray of
266-
the DiffractionObject.
265+
"""Subtract scalar value or another DiffractionObject to the
266+
yarray of the DiffractionObject.
267267
268268
This method behaves similarly to the `__add__` method, but performs
269269
subtraction instead of addition. For details on parameters, returns
@@ -290,8 +290,8 @@ def __sub__(self, other):
290290
__rsub__ = __sub__
291291

292292
def __mul__(self, other):
293-
"""Multiply a scalar value or another DiffractionObject with the yarray
294-
of this DiffractionObject.
293+
"""Multiply a scalar value or another DiffractionObject with the
294+
yarray of this DiffractionObject.
295295
296296
This method behaves similarly to the `__add__` method, but performs
297297
multiplication instead of addition. For details on parameters,
@@ -318,8 +318,8 @@ def __mul__(self, other):
318318
__rmul__ = __mul__
319319

320320
def __truediv__(self, other):
321-
"""Divide the yarray of this DiffractionObject by a scalar value or
322-
another DiffractionObject.
321+
"""Divide the yarray of this DiffractionObject by a scalar value
322+
or another DiffractionObject.
323323
324324
This method behaves similarly to the `__add__` method, but performs
325325
division instead of addition. For details on parameters, returns,
@@ -474,7 +474,8 @@ def _get_original_array(self):
474474
return self.on_d(), "d"
475475

476476
def on_q(self):
477-
"""Return the tuple of two 1D numpy arrays containing q and y data.
477+
"""Return the tuple of two 1D numpy arrays containing q and y
478+
data.
478479
479480
Returns
480481
-------
@@ -484,7 +485,8 @@ def on_q(self):
484485
return [self.all_arrays[:, 1], self.all_arrays[:, 0]]
485486

486487
def on_tth(self):
487-
"""Return the tuple of two 1D numpy arrays containing tth and y data.
488+
"""Return the tuple of two 1D numpy arrays containing tth and y
489+
data.
488490
489491
Returns
490492
-------
@@ -494,7 +496,8 @@ def on_tth(self):
494496
return [self.all_arrays[:, 2], self.all_arrays[:, 0]]
495497

496498
def on_d(self):
497-
"""Return the tuple of two 1D numpy arrays containing d and y data.
499+
"""Return the tuple of two 1D numpy arrays containing d and y
500+
data.
498501
499502
Returns
500503
-------
@@ -506,8 +509,8 @@ def on_d(self):
506509
def scale_to(
507510
self, target_diff_object, q=None, tth=None, d=None, offset=None
508511
):
509-
"""Return a new diffraction object which is the current object but
510-
rescaled in y to the target.
512+
"""Return a new diffraction object which is the current object
513+
but rescaled in y to the target.
511514
512515
By default, if `q`, `tth`, or `d` are not provided, scaling is
513516
based on the max intensity from each object. Otherwise, y-value in
@@ -568,7 +571,8 @@ def scale_to(
568571
return scaled_do
569572

570573
def on_xtype(self, xtype):
571-
"""Return a tuple of two 1D numpy arrays containing x and y data.
574+
"""Return a tuple of two 1D numpy arrays containing x and y
575+
data.
572576
573577
Parameters
574578
----------
@@ -597,8 +601,9 @@ def on_xtype(self, xtype):
597601
raise ValueError(_xtype_wmsg(xtype))
598602

599603
def dump(self, filepath, xtype=None):
600-
"""Dump the xarray and yarray of the diffraction object to a two-column
601-
file, with the associated information included in the header.
604+
"""Dump the xarray and yarray of the diffraction object to a
605+
two-column file, with the associated information included in the
606+
header.
602607
603608
Parameters
604609
----------

src/diffpy/utils/parsers/serialization.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ def serialize_data(
3333
show_path=True,
3434
serial_file=None,
3535
):
36-
"""Serialize file data into a dictionary. Can also save dictionary into a
37-
serial language file. Dictionary is formatted as {filename: data}.
36+
"""Serialize file data into a dictionary. Can also save dictionary
37+
into a serial language file. Dictionary is formatted as {filename:
38+
data}.
3839
3940
Requires hdata and data_table (can be generated by loadData).
4041

0 commit comments

Comments
 (0)