Skip to content

Commit 134c810

Browse files
authored
Merge pull request #151 from bobleesj/recut-cov
Recut - codecov in PR, Codespell, release checklist
2 parents d7a9d30 + 46c0697 commit 134c810

20 files changed

+104
-94
lines changed

.codecov.yml

+11-31
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,14 @@
1-
# codecov can find this file anywhere in the repo, so we don't need to clutter
2-
# the root folder.
3-
#comment: false
4-
5-
codecov:
6-
notify:
7-
require_ci_to_pass: no
8-
91
coverage:
102
status:
11-
patch:
3+
project: # more options at https://docs.codecov.com/docs/commit-status
124
default:
13-
target: '70'
14-
if_no_uploads: error
15-
if_not_found: success
16-
if_ci_failed: failure
17-
project:
18-
default: false
19-
library:
20-
target: auto
21-
if_no_uploads: error
22-
if_not_found: success
23-
if_ci_failed: error
24-
paths: '!*/tests/.*'
25-
26-
tests:
27-
target: 97.9%
28-
paths: '*/tests/.*'
29-
if_not_found: success
30-
31-
flags:
32-
tests:
33-
paths:
34-
- tests/
5+
target: auto # use the coverage from the base commit, fail if coverage is lower
6+
threshold: 0% # allow the coverage to drop by
7+
8+
comment:
9+
layout: " diff, flags, files"
10+
behavior: default
11+
require_changes: false
12+
require_base: false # [true :: must have a base report to post]
13+
require_head: false # [true :: must have a head report to post]
14+
hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage]

.codespell/ignore_lines.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
;; Please include filenames and explanations for each ignored line.
2+
;; See https://docs.openverse.org/meta/codespell.html for docs.

.codespell/ignore_words.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
;; Please include explanations for each ignored word (lowercase).
2+
;; See https://docs.openverse.org/meta/codespell.html for docs.
3+
4+
;; abbreviation for "materials" often used in a journal title
5+
mater
6+
7+
;; alternative use of socioeconomic
8+
socio-economic
9+
10+
;; Frobenius norm used in np.linalg.norm
11+
fro
12+
13+
;; library used for Python package release, no longer used
14+
rever

.coveragerc

-13
This file was deleted.

.gitattributes

-1
This file was deleted.

.github/ISSUE_TEMPLATE/release_checklist.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ assignees: ""
1313
- [ ] License information is verified as correct. If you are unsure, please comment below.
1414
- [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are
1515
missing), tutorials, and other human written text is up-to-date with any changes in the code.
16-
- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated and
17-
tested
18-
- [ ] Successfully run any tutorial examples or do functional testing in some other way.
16+
- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) updated.
17+
- [ ] Successfully run any tutorial examples or do functional testing with the latest Python version
1918
- [ ] Grammar and writing quality have been checked (no typos).
2019

2120
Please mention @sbillinge when you are ready for release. Include any additional comments necessary, such as
22-
version information and details about the pre-release.
21+
version information and details about the pre-release here:
22+
23+
### Post-release checklist
24+
25+
Before closing this issue, please complete the following:
26+
27+
- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README.
28+
- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release (GitHub/PyPI)
1+
name: Release (GitHub/PyPI) and Deploy Docs
22

33
on:
44
workflow_dispatch:

.github/workflows/publish-docs-on-release.yml

-14
This file was deleted.

.github/workflows/tests-on-pr.yml

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ jobs:
1414
project: diffpy.pdfmorph
1515
c_extension: false
1616
headless: false
17+
secrets:
18+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ repos:
4444
name: Prevent Commit to Main Branch
4545
args: ["--branch", "main"]
4646
stages: [pre-commit]
47+
- repo: https://github.com/codespell-project/codespell
48+
rev: v2.3.0
49+
hooks:
50+
- id: codespell
51+
additional_dependencies:
52+
- tomli

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ trying to commit again.
190190

191191
Improvements and fixes are always appreciated.
192192

193-
Before contribuing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.pdfmorph/blob/main/CODE_OF_CONDUCT.rst>`_.
193+
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.pdfmorph/blob/main/CODE_OF_CONDUCT.rst>`_.
194194

195195
Contact
196196
-------

TUTORIAL.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Basic PDFmorph Workflow
148148

149149
We are getting closer to an acceptably close fit to our data!
150150

151-
8. Finally, we will examine the stretch factor. Provide an intial
151+
8. Finally, we will examine the stretch factor. Provide an initial
152152
guess by typing ::
153153

154154
pdfmorph --scale=0.8 --smear=-0.08 --stretch=0.5 --rmin=1.5 --rmax=30 -a darkSub_rh20_C_01.gr darkSub_rh20_C_44.gr
@@ -183,5 +183,5 @@ Enjoy the software!
183183
Bug Reports
184184
-----------
185185

186-
Please enjoy using our software! If you come accross any bugs in the
186+
Please enjoy using our software! If you come across any bugs in the
187187
application, please report them to [email protected]

doc/manual/acknowledgements.texinfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The PDFmorph app was developed by the Billinge group at Columbia University.
22
The examples in the tutorial part of the manual were made possible by data
33
collected by Soham Banerjee at Brookhaven National Laboratory,
4-
Benjamin Frandsen during his PhD at Columbia Unversity,
4+
Benjamin Frandsen during his PhD at Columbia University,
55
and Long Yang from Tonji University.
66

77
The DiffPy development team is the set of all contributors to DiffPy projects.

doc/manual/pdfmorph.texinfo

+12-12
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ it has not been extensively tested beyond the PDF.
156156
It runs on Windows, Mac OS, Linux, and all major Unix systems.
157157
The source code is freely available at @url{https://github.com/diffpy/diffpy.pdfmorph}.
158158

159-
If you come accross any bugs in the application, please open an
159+
If you come across any bugs in the application, please open an
160160
@url{https://github.com/diffpy/diffpy.pdfmorph/issues, issue} or email
161161
diffpy-dev@@googlegroups.com.
162162

@@ -440,8 +440,8 @@ extra tutorial data @code{additionalData.zip}} before proceeding.
440440
@cindex performing multiple morphs
441441

442442
It may be useful to morph a PDF against multiple targets: for example, you may want
443-
to morph a PDF against a sequence of PDFs measured at various temepratures to determine
444-
whether a phase change has occured. PDFmorph currently allows users to morph a PDF
443+
to morph a PDF against a sequence of PDFs measured at various temperatures to determine
444+
whether a phase change has occurred. PDFmorph currently allows users to morph a PDF
445445
against all files in a selected directory and plot resulting @math{R_W} values from each morph.
446446
It is advised that the lowest temperature PDF be that morphed and the higher temperature PDFs
447447
act as targets as the smear morph is only able to account for increases in thermal motion.
@@ -619,15 +619,15 @@ Again, we can begin by plotting the bulk material against our nanoparticle.
619619
@example
620620
pdfmorph Ni_bulk.gr Ni_nano_spheroid.cgr
621621
@end example
622-
@item The nanoparticle shape of the calculated PDF is an oblate spheroid with equitorial
622+
@item The nanoparticle shape of the calculated PDF is an oblate spheroid with equatorial
623623
radius of about @math{12} and polar radius of about @math{6} (this information is contained
624624
within the @code{Ni_nano_spheroid.cgr} file). To apply the spheroidal shape effects onto the
625625
bulk, run
626626
@example
627627
pdfmorph Ni_bulk.gr Ni_nano_spheroid.cgr --radius=12 --pradius=6 -a
628628
@end example
629629
@itemize
630-
@item The @code{--radius} option corresponds to the equitorial radius.
630+
@item The @code{--radius} option corresponds to the equatorial radius.
631631
@item The @code{--pradius} option corresponds to the polar radius.
632632
@end itemize
633633
@item Run the same command without @code{-a} to refine. Refining should give
@@ -792,24 +792,24 @@ using atomic pair distribution function analysis. Phys. Rev. B, 76(11), 115413.
792792
The available shape morphs are listed below:
793793
@itemize
794794
@item @code{--radius=RADIUS} - Multiply the PDF by the nanoparticle form factor for a sphere of radius @code{RADIUS}.
795-
If used with @code{--pradius}, multiply the PDF by the nanoparticle form factor for a spheroid of equitorial radius
795+
If used with @code{--pradius}, multiply the PDF by the nanoparticle form factor for a spheroid of equatorial radius
796796
@code{RADIUS} and polar radius @code{PRADIUS}.
797797
@itemize
798798
@item The sphere form factor was computed by Kodama et al. @footnote{Kodama, K., Iikubo, S., Taguchi, T., &
799799
Shamoto, S. (2006). Finite size effects of nanoparticles on the atomic pair distribution functions.
800800
Acta Crystallographica Section A, 62(6), 444–453. @url{https://doi.org/10.1107/S0108767306034635}}.
801801
@end itemize
802-
@item @code{--pradius=PRADIUS} - Multiply the PDF by the nanoparticle form factor for a spheroid of equitorial radius
802+
@item @code{--pradius=PRADIUS} - Multiply the PDF by the nanoparticle form factor for a spheroid of equatorial radius
803803
@code{RADIUS} and polar radius @code{PRADIUS}.
804804
@itemize
805805
@item The spheroid form factor was computed by Lei et al. @footnote{Lei, M., de Graff, A. M. R., Thorpe, M. F., Wells,
806806
S. A., & Sartbaeva, A. (2009). Uncovering the intrinsic geometry from the atomic pair distribution function of
807807
nanomaterials. Phys. Rev. B, 80(2), 024118. @url{https://doi.org/10.1103/PhysRevB.80.024118}}.
808808
@end itemize
809809
@item @code{--iradius=IRADIUS} - Divide the PDF by the nanoparticle form factor for a sphere of radius @code{IRADIUS}.
810-
If used with @code{--ipradius}, divide the PDF by the nanoparticle form factor for a spheroid of equitorial radius
810+
If used with @code{--ipradius}, divide the PDF by the nanoparticle form factor for a spheroid of equatorial radius
811811
@code{IRADIUS} and polar radius @code{IPRADIUS}.
812-
@item @code{--ipradius=IPRADIUS} - Divide the PDF by the nanoparticle form factor for a spheroid of equitorial radius
812+
@item @code{--ipradius=IPRADIUS} - Divide the PDF by the nanoparticle form factor for a spheroid of equatorial radius
813813
@code{IRADIUS} and polar radius @code{IPRADIUS}.
814814
@end itemize
815815

@@ -842,7 +842,7 @@ post-expansion. The volume of the nanoparticle also increases by a factor @math{
842842
@displaymath
843843
\gamma'_0(\vec{r}) = {1 \over {\alpha^3 V}} \int \int \int s'(\vec{r}')s'(\vec{r}'+\vec{r})d\vec{r}'.
844844
@end displaymath
845-
Aplying a change of variables @math{\vec{r}' \rightarrow \vec{r}' / \alpha} gives
845+
Applying a change of variables @math{\vec{r}' \rightarrow \vec{r}' / \alpha} gives
846846
@displaymath
847847
\gamma'_0(\vec{r}) = {1 \over {\alpha^3 V}} \int \int \int s'(\alpha \vec{r}')s'(\alpha \vec{r}'+\vec{r})\alpha^3d\vec{r}',
848848
@end displaymath
@@ -963,7 +963,7 @@ requires us to apply a Gaussian dampening envelope centered at @math{r=0} with w
963963
@noindent @code{--radius=RADIUS}
964964
@* @indent Apply the nanoparticle form factor @math{\gamma_0} for a sphere of radius @code{RADIUS}.
965965
If @code{PRADIUS} is also specified, instead apply the characteristic function of a spheroid with
966-
equitorial radius @code{RADIUS} and polar radius @code{PRADIUS}.
966+
equatorial radius @code{RADIUS} and polar radius @code{PRADIUS}.
967967

968968
@noindent @code{--pradius=PRADIUS}
969969
@* @indent If @code{RADIUS} is also specified, see @code{--radius}. Otherwise, apply the characteristic
@@ -972,7 +972,7 @@ function of a sphere with radius @code{PRADIUS}.
972972
@noindent @code{--iradius=IRADIUS}
973973
@* @indent Apply the inverse characteristic function @math{1/\gamma_0} of a sphere of radius @code{IRADIUS}/
974974
If @code{IPRADIUS} is also specified, instead apply the characteristic function of a spheroid with
975-
equitorial radius @code{IRADIUS} and polar radius @code{PRADIUS}.
975+
equatorial radius @code{IRADIUS} and polar radius @code{PRADIUS}.
976976

977977
@noindent @code{--ipradius=IPRADIUS}
978978
@* @indent If @code{IRADIUS} is also specified, see @code{--iradius}. Otherwise, apply the characteristic

doc/source/quickstart.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Basic PDFmorph Workflow
150150

151151
We are getting closer to an acceptably close fit to our data!
152152

153-
8. Finally, we will examine the stretch factor. Provide an intial
153+
8. Finally, we will examine the stretch factor. Provide an initial
154154
guess by typing ::
155155

156156
pdfmorph --scale=0.8 --smear=-0.08 --stretch=0.5 --rmin=1.5 --rmax=30 -a darkSub_rh20_C_01.gr darkSub_rh20_C_44.gr
@@ -193,7 +193,7 @@ Performing Multiple Morphs
193193

194194
It may be useful to morph a PDF against multiple targets:
195195
for example, you may want to morph a PDF against multiple PDFs measured
196-
at various temepratures to determine whether a phase change has occured.
196+
at various temperatures to determine whether a phase change has occurred.
197197
PDFmorph currently allows users to morph a PDF against all files in a
198198
selected directory and plot resulting :math:`R_w` values from each morph.
199199

@@ -285,7 +285,7 @@ Currently, the supported nanoparticle shapes include: spheres and spheroids.
285285

286286
pdfmorph Ni_bulk.gr Ni_nano_spheroid.cgr --radius=12 --pradius=6 -a
287287

288-
Note that the equitorial radius corresponds to the ``--radius`` parameter and polar radius to ``--pradius``.
288+
Note that the equatorial radius corresponds to the ``--radius`` parameter and polar radius to ``--pradius``.
289289
3. Remove the ``-a`` tag to refine.
290290

291291
There is also support for morphing from a nanoparticle to a bulk. When applying the inverse morphs,
@@ -294,5 +294,5 @@ it is recommended to set ``--rmax=psize`` where ``psize`` is the longest diamete
294294
Bug Reports
295295
===========
296296

297-
Please enjoy using our software! If you come accross any bugs in the
297+
Please enjoy using our software! If you come across any bugs in the
298298
application, please report them to [email protected].

news/codecov.rst

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
**Added:**
2+
3+
* Spelling check via Codespell in pre-commit
4+
* Coverage report in each PR
5+
6+
**Changed:**
7+
8+
* <news item>
9+
10+
**Deprecated:**
11+
12+
* <news item>
13+
14+
**Removed:**
15+
16+
* <news item>
17+
18+
**Fixed:**
19+
20+
* <news item>
21+
22+
**Security:**
23+
24+
* <news item>

pyproject.toml

+8-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ authors = [
1111
maintainers = [
1212
{ name="Simon J.L. Billinge group", email="[email protected]" },
1313
]
14-
description = "Tools for manipulating and comparing PDF profiles"
14+
description = "Python package for manipulating and comparing PDF profiles"
1515
keywords = ['diffpy', 'pdf', 'data interpretation']
1616
readme = "README.rst"
17-
requires-python = ">=3.10, <3.14"
17+
requires-python = ">=3.11, <3.14"
1818
classifiers = [
1919
'Development Status :: 5 - Production/Stable',
2020
'Environment :: Console',
@@ -25,7 +25,6 @@ classifiers = [
2525
'Operating System :: Microsoft :: Windows',
2626
'Operating System :: POSIX',
2727
'Operating System :: Unix',
28-
'Programming Language :: Python :: 3.10',
2928
'Programming Language :: Python :: 3.11',
3029
'Programming Language :: Python :: 3.12',
3130
'Programming Language :: Python :: 3.13',
@@ -49,12 +48,17 @@ dirty_template = "{tag}"
4948
[tool.setuptools.packages.find]
5049
where = ["src"] # list of folders that contain the packages (["."] by default)
5150
include = ["*"] # package names should match these glob patterns (["*"] by default)
52-
exclude = ["tests"] # exclude packages matching these glob patterns (empty by default)
51+
exclude = [] # exclude packages matching these glob patterns (empty by default)
5352
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
5453

5554
[tool.setuptools.dynamic]
5655
dependencies = {file = ["requirements/pip.txt"]}
5756

57+
[tool.codespell]
58+
exclude-file = ".codespell/ignore_lines.txt"
59+
ignore-words = ".codespell/ignore_words.txt"
60+
skip = "*.cif,*.dat,*agr"
61+
5862
[tool.black]
5963
line-length = 115
6064
include = '\.pyi?$'

src/diffpy/pdfmorph/pdfmorph_api.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def pdfmorph(
8686
verbose=False,
8787
**kwargs,
8888
):
89-
"""function to perfom PDF morphing.
89+
"""function to perform PDF morphing.
9090
9191
Parameters
9292
----------
@@ -142,7 +142,7 @@ def pdfmorph(
142142
- morph_chain: diffpy.pdfmorph.morphs.morphchain.MorphChain
143143
The instance of processed morph chain.
144144
Calling ``x_morph, y_morph, x_target, y_target = morph_chain.xyallout``
145-
will conviniently retrun morphed data and reference data
145+
will conveniently return morphed data and reference data
146146
- morphed_cfg: dict
147147
A dictionary of refined morphing parameters
148148
- rw: float
@@ -248,11 +248,11 @@ def plot_morph(chain, ax=None, **kwargs):
248248
----------
249249
chain: diffpy.pdfmorph.morphs.morphchain.MorphChain
250250
An instance of processed morph chain.
251-
ax: matplotlib.axes.Axes, optinal
251+
ax: matplotlib.axes.Axes, optional
252252
An instance of Axes class to plot the morphing result.
253253
If ax is None, instances of new Figure and Axes will be created. Default to None.
254254
kwargs:
255-
Additional keyword arguements will be passed to ``ax.plot(...**kwargs)``
255+
Additional keyword arguments will be passed to ``ax.plot(...**kwargs)``
256256
257257
Returns
258258
-------

0 commit comments

Comments
 (0)