Skip to content

Commit 79eba50

Browse files
authored
Merge pull request #82 from tinatn29/setup-CI-redo
skpkg (redo): setup CI after migrating tests, src, requirements, and .github folder
2 parents c17c8e3 + 966bb4b commit 79eba50

23 files changed

+81
-54
lines changed

.codespell/ignore_words.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,5 @@
44
;; abbreviation for "materials" often used in a journal title
55
mater
66

7-
;; alternative use of socioeconomic
8-
socio-economic
9-
107
;; Frobenius norm used in np.linalg.norm
118
fro
12-
13-
;; cutted used as attribute in unit_test.py and fourigui.py
14-
cutted

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/ISSUE_TEMPLATE/release_checklist.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,30 @@ 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 the website (e.g., diffpy.org) are updated.
16+
- [ ] 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.
2020

21-
Please mention @sbillinge here when you are ready for PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here:
21+
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:
2222

2323
### PyPI/GitHub full-release preparation checklist:
2424

2525
- [ ] Create a new conda environment and install the rc from PyPI (`pip install <package-name>==??`)
2626
- [ ] License information on PyPI is correct.
27-
- [ ] Docs are deployed successfully to `https://www.diffpy.org/<package-name>`.
27+
- [ ] Docs are deployed successfully to `https://<github-username-or-orgname>/<package-name>`.
2828
- [ ] Successfully run all tests, tutorial examples or do functional testing.
2929

30-
Please let @sbillinge know that all checks are done and the package is ready for full release.
30+
Please let the maintainer know that all checks are done and the package is ready for full release.
3131

3232
### conda-forge release preparation checklist:
3333

34-
<!-- After @sbillinge releases the PyPI package, please check the following when creating a PR for conda-forge release.-->
34+
<!-- 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.
3737
- [ ] New package dependencies listed in `conda.txt` and `test.txt` are added to `meta.yaml` in the feedstock.
38-
- [ ] Close any open issues on the feedstock. Reach out to @bobleesj if you have questions.
39-
- [ ] Tag @sbillinge and @bobleesj for conda-forge release.
38+
- [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions.
39+
- [ ] Tag the maintainer for conda-forge release.
4040

4141
### Post-release checklist
4242

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### What problem does this PR address?
2+
3+
<!-- Provide a brief overview and link to the issue. Attach outputs, including screenshots (before/after), if helpful for the reviewer. -->
4+
5+
### What should the reviewer(s) do?
6+
7+
<!-- Merge the code, provide feedback, initiate a discussion, etc. -->
8+
9+
<!--
10+
Use the following checklist items when applicable (select only what applies):
11+
- [ ] This PR introduces a public-facing change (e.g., figures, CLI input/output, API).
12+
- [ ] Documentation (e.g., tutorials, examples, README) has been updated.
13+
- [ ] A tracking issue or plan to update documentation exists.
14+
- [ ] This PR affects internal functionality only (no user-facing change).
15+
-->

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

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

99
jobs:
1010
release:
11-
uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
11+
uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
1212
with:
1313
project: diffpy.fourigui
1414
c_extension: false
15-
github_admin_username: sbillinge
15+
maintainer_GITHUB_username: sbillinge
1616
secrets:
1717
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
1818
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
@@ -7,6 +7,6 @@ on:
77

88
jobs:
99
check-news-item:
10-
uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0
10+
uses: scikit-package/release-scripts/.github/workflows/_check-news-item.yml@v0
1111
with:
1212
project: diffpy.fourigui

.github/workflows/matrix-and-codecov-on-merge-to-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
matrix-coverage:
15-
uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
15+
uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
1616
with:
1717
project: diffpy.fourigui
1818
c_extension: false

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
docs:
8-
uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0
8+
uses: scikit-package/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0
99
with:
1010
project: diffpy.fourigui
1111
c_extension: false

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
name: Tests on PR
22

33
on:
4-
push:
5-
branches:
6-
- main
74
pull_request:
85
workflow_dispatch:
96

107
jobs:
118
tests-on-pr:
12-
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
9+
uses: scikit-package/release-scripts/.github/workflows/_tests-on-pr.yml@v0
1310
with:
1411
project: diffpy.fourigui
1512
c_extension: false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ __pycache__/
1010
.Python
1111
env/
1212
build/
13+
_build/
1314
develop-eggs/
1415
dist/
1516
downloads/

.readthedocs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-22.04"
5+
tools:
6+
python: "latest"
7+
8+
python:
9+
install:
10+
- requirements: requirements/docs.txt
11+
12+
sphinx:
13+
configuration: doc/source/conf.py

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
=============
2-
Release Notes
2+
Release notes
33
=============
44

55
.. current developments

CODE_OF_CONDUCT.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Our Pledge
88
We as members, contributors, and leaders pledge to make participation in our
99
community a harassment-free experience for everyone, regardless of age, body
1010
size, visible or invisible disability, ethnicity, sex characteristics, gender
11-
identity and expression, level of experience, education, socio-economic status,
11+
identity and expression, level of experience, education, socioeconomic status,
1212
nationality, personal appearance, race, caste, color, religion, or sexual
1313
identity and orientation.
1414

README.rst

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

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

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

@@ -26,7 +26,7 @@
2626

2727
.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
2828

29-
.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.fourigui
29+
.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.fourigui
3030
:target: https://pypi.org/project/diffpy.fourigui/
3131

3232
.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.fourigui
@@ -129,4 +129,9 @@ Before contributing, please read our `Code of Conduct <https://github.com/diffpy
129129
Contact
130130
-------
131131

132-
For more information on diffpy.fourigui please visit the project `web-page <https://diffpy.github.io/>`_ or email Prof. Simon Billinge at [email protected].
132+
For more information on diffpy.fourigui please visit the project `web-page <https://diffpy.github.io/>`_ or email Simon Billinge at [email protected].
133+
134+
Acknowledgements
135+
----------------
136+
137+
``diffpy.fourigui`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.
File renamed without changes.

doc/source/snippets/.placeholder

Whitespace-only changes.

environment.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ exclude-file = ".codespell/ignore_lines.txt"
5959
ignore-words = ".codespell/ignore_words.txt"
6060
skip = "*.cif,*.dat"
6161

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

requirements/docs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sphinx
22
sphinx_rtd_theme
3+
sphinx-copybutton
34
doctr
45
m2r

src/diffpy/fourigui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"""Tool for visualizing 3D diffraction and PDF images."""
1616

1717
# package version
18-
from diffpy.fourigui.version import __version__
18+
from diffpy.fourigui.version import __version__ # noqa
1919

2020
# silence the pyflakes syntax checker
2121
assert __version__ or True

src/diffpy/fourigui/fourigui.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ def initUI(self):
285285
) # , height=HEIGHT//2, width=WIDTH//2)
286286

287287
def load_cube(self):
288-
"""Loads 3D array in h5py file format from the filename input panel 3D
289-
array is expected to be a reconstructed reciprocal scattering volume
290-
when executed, one slide perpendicular to the selected axis will be
291-
plotted in the plot panel."""
288+
"""Loads 3D array in h5py file format from the filename input
289+
panel 3D array is expected to be a reconstructed reciprocal
290+
scattering volume when executed, one slide perpendicular to the
291+
selected axis will be plotted in the plot panel."""
292292

293293
filename = self.filename_entry.get()
294294
f = h5py.File(filename, "r")
@@ -397,8 +397,8 @@ def colorrange_upd(self):
397397
self.plot_plane()
398398

399399
def intensity_upd_local(self):
400-
"""Show local intensity minimum, maximum and sum of current plotted
401-
plane."""
400+
"""Show local intensity minimum, maximum and sum of current
401+
plotted plane."""
402402
if self.axis.get() == 0:
403403
plane = self.cube[self.plane_num.get(), :, :]
404404
elif self.axis.get() == 1:
@@ -418,7 +418,8 @@ def intensity_upd_local(self):
418418
self.localnanratio["text"] = f"{round(nan_ratio, 2)}"
419419

420420
def intensity_upd_global(self):
421-
"""Load global intensity minimum, maximum and sum of 3D array."""
421+
"""Load global intensity minimum, maximum and sum of 3D
422+
array."""
422423
self.intensity_upd_local()
423424
nan_ratio = np.count_nonzero(np.isnan(self.cube)) / self.cube.size
424425
self.globalmax["text"] = (
@@ -433,8 +434,9 @@ def intensity_upd_global(self):
433434
self.globalnanratio["text"] = "{}".format(round(nan_ratio, 2))
434435

435436
def fft(self):
436-
"""Fourier transform 3D array from reciprocal to real space the origin
437-
of reciprocal and real space is expected to be the central voxel."""
437+
"""Fourier transform 3D array from reciprocal to real space the
438+
origin of reciprocal and real space is expected to be the
439+
central voxel."""
438440

439441
def perform_fft(fftholder):
440442
fftholder = np.nan_to_num(fftholder)
@@ -487,9 +489,9 @@ def perform_fft(fftholder):
487489
self.intensity_upd_global()
488490

489491
def ifft(self):
490-
"""Inverse Fourier transform 3D array from real to reciprocal space the
491-
origin of real and reciprocal space is expected to be the central
492-
voxel."""
492+
"""Inverse Fourier transform 3D array from real to reciprocal
493+
space the origin of real and reciprocal space is expected to be
494+
the central voxel."""
493495
if not self.cutoff.get():
494496
self.cube_real = self.cube
495497
self.cube = self.cube_reci
@@ -562,8 +564,8 @@ def applycutoff(self):
562564
self.intensity_upd_global()
563565

564566
def redocutuff(self):
565-
"""Redo the cutoff operation depending on the current space (real or
566-
reciprocal)."""
567+
"""Redo the cutoff operation depending on the current space
568+
(real or reciprocal)."""
567569
if self.space.get(): # in real space
568570
self.cube_realcut = self.cube
569571
if not self.transformed:
@@ -588,8 +590,8 @@ def newcutoff(self):
588590
self.applycutoff()
589591

590592
def plot_next_plane(self):
591-
"""Plot the next plane in the dataset, looping back to the first if at
592-
the end."""
593+
"""Plot the next plane in the dataset, looping back to the first
594+
if at the end."""
593595
n = self.plane_num.get()
594596
if n == len(self.cube[self.axis.get()]) - 1:
595597
n = 0
@@ -616,7 +618,8 @@ def animation(self):
616618
self.plot_next_plane()
617619

618620
def multiple_funcs(*funcs):
619-
"""Executes multiple functions passed as arguments in sequence."""
621+
"""Executes multiple functions passed as arguments in
622+
sequence."""
620623
for func in funcs:
621624
func
622625

src/diffpy/fourigui/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# File coded by: Billinge Group members and community contributors.
88
#
99
# See GitHub contributions for a more detailed list of contributors.
10-
# https://github.com/diffpy/diffpy.fourigui/graphs/contributors
10+
# https://github.com/diffpy/diffpy.fourigui/graphs/contributors # noqa: E501
1111
#
1212
# See LICENSE.rst for license information.
1313
#

tests/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Unit tests for __version__.py."""
22

3-
import diffpy.fourigui
3+
import diffpy.fourigui # noqa
44

55

66
def test_package_version():

0 commit comments

Comments
 (0)