Skip to content

skpkg (redo): setup CI after migrating tests, src, requirements, and .github folder #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 18, 2025
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
6 changes: 0 additions & 6 deletions .codespell/ignore_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,5 @@
;; abbreviation for "materials" often used in a journal title
mater

;; alternative use of socioeconomic
socio-economic

;; Frobenius norm used in np.linalg.norm
fro

;; cutted used as attribute in unit_test.py and fourigui.py
cutted
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@ assignees: ""
- [ ] License information is verified as correct. If you are unsure, please comment below.
- [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are
missing), tutorials, and other human-written text is up-to-date with any changes in the code.
- [ ] Installation instructions in the README, documentation, and the website (e.g., diffpy.org) are updated.
- [ ] Installation instructions in the README, documentation, and the website are updated.
- [ ] Successfully run any tutorial examples or do functional testing with the latest Python version.
- [ ] Grammar and writing quality are checked (no typos).
- [ ] 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.

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:
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:

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

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

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

### conda-forge release preparation checklist:

<!-- After @sbillinge releases the PyPI package, please check the following when creating a PR for conda-forge release.-->
<!-- After the maintainer releases the PyPI package, please check the following when creating a PR for conda-forge release.-->

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

### Post-release checklist

Expand Down
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### What problem does this PR address?

<!-- Provide a brief overview and link to the issue. Attach outputs, including screenshots (before/after), if helpful for the reviewer. -->

### What should the reviewer(s) do?

<!-- Merge the code, provide feedback, initiate a discussion, etc. -->

<!--
Use the following checklist items when applicable (select only what applies):
- [ ] This PR introduces a public-facing change (e.g., figures, CLI input/output, API).
- [ ] Documentation (e.g., tutorials, examples, README) has been updated.
- [ ] A tracking issue or plan to update documentation exists.
- [ ] This PR affects internal functionality only (no user-facing change).
-->
4 changes: 2 additions & 2 deletions .github/workflows/build-wheel-release-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:

jobs:
release:
uses: Billingegroup/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
with:
project: diffpy.fourigui
c_extension: false
github_admin_username: sbillinge
maintainer_GITHUB_username: sbillinge
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/check-news-item.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
check-news-item:
uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0
uses: scikit-package/release-scripts/.github/workflows/_check-news-item.yml@v0
with:
project: diffpy.fourigui
2 changes: 1 addition & 1 deletion .github/workflows/matrix-and-codecov-on-merge-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
matrix-coverage:
uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
with:
project: diffpy.fourigui
c_extension: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
docs:
uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0
uses: scikit-package/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0
with:
project: diffpy.fourigui
c_extension: false
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/tests-on-pr.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Tests on PR

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
tests-on-pr:
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
uses: scikit-package/release-scripts/.github/workflows/_tests-on-pr.yml@v0
with:
project: diffpy.fourigui
c_extension: false
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ __pycache__/
.Python
env/
build/
_build/
develop-eggs/
dist/
downloads/
Expand Down
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "latest"

python:
install:
- requirements: requirements/docs.txt

sphinx:
configuration: doc/source/conf.py
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=============
Release Notes
Release notes
=============

.. current developments
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

Expand Down
11 changes: 8 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:target: https://diffpy.github.io/diffpy.fourigui
:height: 100px

|PyPi| |Forge| |PythonVersion| |PR|
|PyPI| |Forge| |PythonVersion| |PR|

|CI| |Codecov| |Black| |Tracking|

Expand All @@ -26,7 +26,7 @@

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

.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.fourigui
.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.fourigui
:target: https://pypi.org/project/diffpy.fourigui/

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

For more information on diffpy.fourigui please visit the project `web-page <https://diffpy.github.io/>`_ or email Prof. Simon Billinge at sb2896@columbia.edu.
For more information on diffpy.fourigui please visit the project `web-page <https://diffpy.github.io/>`_ or email Simon Billinge at sb2896@columbia.edu.

Acknowledgements
----------------

``diffpy.fourigui`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.
File renamed without changes.
Empty file.
6 changes: 0 additions & 6 deletions environment.yml

This file was deleted.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ exclude-file = ".codespell/ignore_lines.txt"
ignore-words = ".codespell/ignore_words.txt"
skip = "*.cif,*.dat"

[tool.docformatter]
recursive = true
wrap-summaries = 72
wrap-descriptions = 72

[tool.black]
line-length = 79
include = '\.pyi?$'
Expand Down
1 change: 1 addition & 0 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx
sphinx_rtd_theme
sphinx-copybutton
doctr
m2r
2 changes: 1 addition & 1 deletion src/diffpy/fourigui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""Tool for visualizing 3D diffraction and PDF images."""

# package version
from diffpy.fourigui.version import __version__
from diffpy.fourigui.version import __version__ # noqa

# silence the pyflakes syntax checker
assert __version__ or True
Expand Down
37 changes: 20 additions & 17 deletions src/diffpy/fourigui/fourigui.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ def initUI(self):
) # , height=HEIGHT//2, width=WIDTH//2)

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

filename = self.filename_entry.get()
f = h5py.File(filename, "r")
Expand Down Expand Up @@ -397,8 +397,8 @@ def colorrange_upd(self):
self.plot_plane()

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

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

def fft(self):
"""Fourier transform 3D array from reciprocal to real space the origin
of reciprocal and real space is expected to be the central voxel."""
"""Fourier transform 3D array from reciprocal to real space the
origin of reciprocal and real space is expected to be the
central voxel."""

def perform_fft(fftholder):
fftholder = np.nan_to_num(fftholder)
Expand Down Expand Up @@ -487,9 +489,9 @@ def perform_fft(fftholder):
self.intensity_upd_global()

def ifft(self):
"""Inverse Fourier transform 3D array from real to reciprocal space the
origin of real and reciprocal space is expected to be the central
voxel."""
"""Inverse Fourier transform 3D array from real to reciprocal
space the origin of real and reciprocal space is expected to be
the central voxel."""
if not self.cutoff.get():
self.cube_real = self.cube
self.cube = self.cube_reci
Expand Down Expand Up @@ -562,8 +564,8 @@ def applycutoff(self):
self.intensity_upd_global()

def redocutuff(self):
"""Redo the cutoff operation depending on the current space (real or
reciprocal)."""
"""Redo the cutoff operation depending on the current space
(real or reciprocal)."""
if self.space.get(): # in real space
self.cube_realcut = self.cube
if not self.transformed:
Expand All @@ -588,8 +590,8 @@ def newcutoff(self):
self.applycutoff()

def plot_next_plane(self):
"""Plot the next plane in the dataset, looping back to the first if at
the end."""
"""Plot the next plane in the dataset, looping back to the first
if at the end."""
n = self.plane_num.get()
if n == len(self.cube[self.axis.get()]) - 1:
n = 0
Expand All @@ -616,7 +618,8 @@ def animation(self):
self.plot_next_plane()

def multiple_funcs(*funcs):
"""Executes multiple functions passed as arguments in sequence."""
"""Executes multiple functions passed as arguments in
sequence."""
for func in funcs:
func

Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/fourigui/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# File coded by: Billinge Group members and community contributors.
#
# See GitHub contributions for a more detailed list of contributors.
# https://github.com/diffpy/diffpy.fourigui/graphs/contributors
# https://github.com/diffpy/diffpy.fourigui/graphs/contributors # noqa: E501
#
# See LICENSE.rst for license information.
#
Expand Down
2 changes: 1 addition & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Unit tests for __version__.py."""

import diffpy.fourigui
import diffpy.fourigui # noqa


def test_package_version():
Expand Down
Loading