Skip to content

Commit 195b302

Browse files
committed
chore: re-scikit-packaged diffpy.srmise
1 parent d9e435d commit 195b302

41 files changed

Lines changed: 628 additions & 181 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exclude =
66
__pycache__,
77
build,
88
dist,
9-
doc/source/conf.py
9+
docs/source/conf.py
1010
max-line-length = 115
1111
# Ignore some style 'errors' produced while formatting by 'black'
1212
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings

.github/ISSUE_TEMPLATE/release_checklist.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ assignees: ""
1111
- [ ] All PRs/issues attached to the release are merged.
1212
- [ ] All the badges on the README are passing.
1313
- [ ] License information is verified as correct. If you are unsure, please comment below.
14-
- [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are
15-
missing), tutorials, and other human-written text is up-to-date with any changes in the code.
14+
- [ ] Locally rendered documentation contains all appropriate pages, tutorials, and other human-written text is up-to-date with any changes in the code.
15+
- [ ] All API references are included. To check this, run `conda install scikit-package` and then `package build api-doc`. Review any edits made by rerendering the docs locally.
1616
- [ ] Installation instructions in the README, documentation, and the website are updated.
1717
- [ ] Successfully run any tutorial examples or do functional testing with the latest Python version.
1818
- [ ] Grammar and writing quality are checked (no typos).
1919
- [ ] Install `pip install build twine`, run `python -m build` and `twine check dist/*` to ensure that the package can be built and is correctly formatted for PyPI release.
20+
- [ ] Dispatch matrix testing to test the release on all Python versions and systems. If you do not have permission to run this workflow, tag the maintainer and say `@maintainer, please dispatch matrix testing workflow`.
2021

2122
Please tag the maintainer (e.g., @username) in the comment here when you are ready for the PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here:
2223

@@ -34,7 +35,7 @@ Please let the maintainer know that all checks are done and the package is ready
3435
<!-- After the maintainer releases the PyPI package, please check the following when creating a PR for conda-forge release.-->
3536

3637
- [ ] 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.
38+
- [ ] New package dependencies listed in `conda.txt` and `tests.txt` are added to `meta.yaml` in the feedstock.
3839
- [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions.
3940
- [ ] Tag the maintainer for conda-forge release.
4041

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build and Publish Docs on Dispatch
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
get-python-version:
8+
uses: scikit-package/release-scripts/.github/workflows/_get-python-version-latest.yml@v0
9+
with:
10+
python_version: 0
11+
12+
docs:
13+
uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0
14+
with:
15+
project: diffpy.srmise
16+
c_extension: false
17+
headless: false
18+
python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }}
Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,76 @@
1-
name: Release (GitHub/PyPI) and Deploy Docs
1+
name: Build Wheel and Release
22

3+
# Trigger on tag push or manual dispatch.
4+
# Tag and release privilege are verified inside the reusable workflow.
35
on:
46
workflow_dispatch:
57
push:
68
tags:
7-
- "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml
9+
- "*"
10+
11+
# ── Release modality ──────────────────────────────────────────────────────────
12+
# Three options are provided below. Only ONE job should be active at a time.
13+
# To switch: comment out the active job and uncomment your preferred option,
14+
# then commit the change to main before tagging a release.
15+
# ─────────────────────────────────────────────────────────────────────────────
816

917
jobs:
10-
release:
18+
# Option 1 (default): Release to GitHub, publish to PyPI, and deploy docs.
19+
#
20+
# The wheel is uploaded to PyPI so users can install with `pip install`.
21+
# A GitHub release is created with the changelog as the release body, and
22+
# the Sphinx documentation is rebuilt and deployed to GitHub Pages.
23+
#
24+
# Choose this for open-source packages distributed via PyPI and/or
25+
# conda-forge where broad public availability is the goal.
26+
build-release:
1127
uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
1228
with:
1329
project: diffpy.srmise
1430
c_extension: false
15-
maintainer_GITHUB_username: sbillinge
31+
maintainer_github_username: sbillinge
1632
secrets:
1733
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
1834
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
35+
36+
# Option 2: Release to GitHub and deploy docs, without publishing to PyPI.
37+
#
38+
# A GitHub release is created and the Sphinx docs are deployed, but the
39+
# wheel is not uploaded to PyPI. The source code remains publicly visible
40+
# on GitHub and can be installed directly from there.
41+
#
42+
# Choose this when the package is public but you prefer to keep it off the
43+
# default pip index — for example, if you distribute via conda-forge only,
44+
# or if the package is not yet ready for a permanent PyPI presence.
45+
#
46+
# To use: comment out Option 1 above and uncomment the lines below.
47+
# build-release-no-pypi:
48+
# uses: scikit-package/release-scripts/.github/workflows/_build-release-github-no-pypi.yml@v0
49+
# with:
50+
# project: diffpy.srmise
51+
# c_extension: false
52+
# maintainer_github_username: sbillinge, Ainamacar
53+
# secrets:
54+
# PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
55+
56+
# Option 3: Release to GitHub with wheel, license, and instructions bundled
57+
# as a downloadable zip attached to the GitHub release asset.
58+
#
59+
# The wheel is built and packaged together with INSTRUCTIONS.txt and the
60+
# LICENSE file into a zip that is attached directly to the GitHub release.
61+
# Users with access to the (private) repo download the zip, follow the
62+
# instructions inside, and install locally with pip. No PyPI or conda-forge
63+
# upload occurs, and no docs are deployed.
64+
#
65+
# Choose this for private or restricted packages where distribution must be
66+
# controlled: only users with repo access can download the release asset,
67+
# making the GitHub release itself the distribution channel.
68+
#
69+
# To use: comment out Option 1 above and uncomment the lines below.
70+
# build-release-private:
71+
# uses: scikit-package/release-scripts/.github/workflows/_build-release-github-private-pure.yml@v0
72+
# with:
73+
# project: diffpy.srmise
74+
# maintainer_github_username: sbillinge, Ainamacar
75+
# secrets:
76+
# PAT_TOKEN: ${{ secrets.PAT_TOKEN }}

.github/workflows/check-news-item.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Check for News
33
on:
44
pull_request_target:
55
branches:
6-
- main
6+
- main # GitHub does not evaluate expressions in trigger filters; edit this value if your base branch is not main
77

88
jobs:
99
check-news-item:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Matrix and Codecov
2+
3+
on:
4+
# push:
5+
# branches:
6+
# - main
7+
release:
8+
types:
9+
- prereleased
10+
- published
11+
workflow_dispatch:
12+
13+
jobs:
14+
matrix-coverage:
15+
uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
16+
with:
17+
project: diffpy.srmise
18+
c_extension: false
19+
headless: false
20+
secrets:
21+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ python:
1010
- requirements: requirements/docs.txt
1111

1212
sphinx:
13-
configuration: doc/source/conf.py
13+
configuration: docs/source/conf.py

AUTHORS.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Authors
22
=======
33

4-
Luke Granlund
5-
Billinge Group and community contributors.
4+
Luke Granlund, Simon Billinge, Billinge Group members
65

76
Contributors
87
------------
File renamed without changes.

README.rst

Lines changed: 29 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
:target: https://diffpy.github.io/diffpy.srmise
99
:height: 100px
1010

11-
|PyPi| |Forge| |PythonVersion| |PR|
11+
|PyPI| |Forge| |PythonVersion| |PR|
1212

1313
|CI| |Codecov| |Black| |Tracking|
1414

@@ -25,8 +25,9 @@
2525
:target: https://anaconda.org/conda-forge/diffpy.srmise
2626

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

29-
.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.srmise
30+
.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.srmise
3031
:target: https://pypi.org/project/diffpy.srmise/
3132

3233
.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.srmise
@@ -35,54 +36,18 @@
3536
.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
3637
:target: https://github.com/diffpy/diffpy.srmise/issues
3738

38-
Implementation of the ParSCAPE algorithm for peak extraction from atomic pair distribution functions (PDFs)
39-
40-
SrMise is an implementation of the `ParSCAPE algorithm
41-
<https://dx.doi.org/10.1107/S2053273315005276>`_ for peak extraction from
42-
atomic pair distribution functions (PDFs). It is designed to function even
43-
when *a priori* knowledge of the physical sample is limited, utilizing the
44-
Akaike Information Criterion (AIC) to estimate whether peaks are
45-
statistically justified relative to alternate models. Three basic use cases
46-
are anticipated for SrMise. The first is peak fitting a user-supplied
47-
collections of peaks. The second is peak extraction from a PDF with no (or
48-
only partial) user-supplied peaks. The third is an AIC-driven multimodeling
49-
analysis where the output of multiple SrMise trials are ranked.
50-
51-
The framework for peak extraction defines peak-like clusters within the data,
52-
extracts a single peak within each cluster, and iteratively combines nearby
53-
clusters while performing a recursive search on the residual to identify
54-
occluded peaks. Eventually this results in a single global cluster
55-
containing many peaks fit over all the data. Over- and underfitting are
56-
discouraged by use of the AIC when adding or, during a pruning step, removing
57-
peaks. Termination effects, which can lead to physically spurious peaks in
58-
the PDF, are incorporated in the mathematical peak model and the pruning step
59-
attempts to remove peaks which are fit better as termination ripples due to
60-
another peak.
61-
62-
Where possible, SrMise provides physically reasonable default values
63-
for extraction parameters. However, the PDF baseline should be estimated by
64-
the user before extraction, or by performing provisional peak extraction with
65-
varying baseline parameters. The package defines a linear (crystalline)
66-
baseline, arbitrary polynomial baseline, a spherical nanoparticle baseline,
67-
and an arbitrary baseline interpolated from a list of user-supplied values.
68-
In addition, PDFs with accurate experimentally-determined uncertainties are
69-
necessary to provide the most reliable results, but historically such PDFs
70-
are rare. In the absence of accurate uncertainties an *ad hoc* uncertainty
71-
must be specified.
39+
Peak extraction and peak fitting tool for atomic pair distribution functions.
40+
41+
* LONGER DESCRIPTION HERE
7242

7343
For more information about the diffpy.srmise library, please consult our `online documentation <https://diffpy.github.io/diffpy.srmise>`_.
7444

7545
Citation
7646
--------
7747

78-
If you use this program for a scientific research that leads
79-
to publication, we ask that you acknowledge use of the program
80-
by citing the following paper in your publication:
48+
If you use diffpy.srmise in a scientific publication, we would like you to cite this package as
8149

82-
L. Granlund, S. J. L. Billinge and P. M. Duxbury,
83-
`Algorithm for systematic peak extraction from atomic pair distribution functions
84-
<http://dx.doi.org/10.1107/S2053273315005276>`__,
85-
*Acta Crystallogr. A* **4**, 392-409 (2015).
50+
diffpy.srmise Package, https://github.com/diffpy/diffpy.srmise
8651

8752
Installation
8853
------------
@@ -101,10 +66,6 @@ The following creates and activates a new environment named ``diffpy.srmise_env`
10166
conda create -n diffpy.srmise_env diffpy.srmise
10267
conda activate diffpy.srmise_env
10368

104-
To confirm that the installation was successful, type ::
105-
106-
python -c "import diffpy.srmise; print(diffpy.srmise.__version__)"
107-
10869
The output should print the latest version displayed on the badges above.
10970

11071
If the above does not work, you can use ``pip`` to download and install the latest release from
@@ -119,6 +80,19 @@ and run the following ::
11980

12081
pip install .
12182

83+
This package also provides command-line utilities. To check the software has been installed correctly, type ::
84+
85+
diffpy.srmise --version
86+
87+
You can also type the following command to verify the installation. ::
88+
89+
python -c "import diffpy.srmise; print(diffpy.srmise.__version__)"
90+
91+
92+
To view the basic usage and available commands, type ::
93+
94+
diffpy.srmise -h
95+
12296
Getting Started
12397
---------------
12498

@@ -127,9 +101,7 @@ You may consult our `online documentation <https://diffpy.github.io/diffpy.srmis
127101
Support and Contribute
128102
----------------------
129103

130-
`Diffpy user group <https://groups.google.com/g/diffpy-users>`_ is the discussion forum for general questions and discussions about the use of diffpy.srmise. Please join the diffpy.srmise users community by joining the Google group. The diffpy.srmise project welcomes your expertise and enthusiasm!
131-
132-
If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.srmise/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.srmise/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_.
104+
If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.srmise/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.srmise/pulls>`_.
133105

134106
Feel free to fork the project and contribute. To install diffpy.srmise
135107
in a development mode, with its sources being directly used by Python
@@ -152,9 +124,14 @@ trying to commit again.
152124

153125
Improvements and fixes are always appreciated.
154126

155-
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.srmise/blob/main/CODE_OF_CONDUCT.rst>`_.
127+
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.srmise/blob/main/CODE-OF-CONDUCT.rst>`_.
156128

157129
Contact
158130
-------
159131

160-
For more information on diffpy.srmise please visit the project `web-page <https://diffpy.github.io/>`_ or email Prof. Simon Billinge at sb2896@columbia.edu.
132+
For more information on diffpy.srmise please visit the project `web-page <https://diffpy.github.io/>`_ or email the maintainers ``Simon Billinge(sbillinge@ucsb.edu)``.
133+
134+
Acknowledgements
135+
----------------
136+
137+
``diffpy.srmise`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.

0 commit comments

Comments
 (0)