Skip to content

Commit 59c5551

Browse files
authored
Merge branch 'main' into gt2
2 parents 5e74c0b + 908992d commit 59c5551

17 files changed

+142
-58
lines changed

Diff for: .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]

Diff for: .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.

Diff for: .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+
;; cutted used as attribute in unit_test.py and fourigui.py
14+
cutted

Diff for: .coveragerc

-13
This file was deleted.

Diff for: .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.

Diff for: .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:

Diff for: .github/workflows/tests-on-pr.yml

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

Diff for: .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

Diff for: README.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ If you use diffpy.fourigui in a scientific publication, we would like you to cit
5656
`Real-Space Texture and Pole-Figure Analysis Using the 3D Pair Distribution
5757
Function on a Platinum Thin Film <https://doi.org/10.1107/S2052252522006674>`_. *IUCrJ* **9 (5)**, 594–603 (2022).
5858

59-
6059
Installation
6160
------------
6261

@@ -125,7 +124,7 @@ trying to commit again.
125124

126125
Improvements and fixes are always appreciated.
127126

128-
Before contribuing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.fourigui/blob/main/CODE_OF_CONDUCT.rst>`_.
127+
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.fourigui/blob/main/CODE_OF_CONDUCT.rst>`_.
129128

130129
Contact
131130
-------

Diff for: news/codespell.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* Added `codespell` for spell check on all files.
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>

Diff for: news/numpy_dep.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
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+
* Fixed deprecation warning presented by numpy2
20+
21+
**Security:**
22+
23+
* <news item>

Diff for: news/pythonversion.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* Removed support for python `<3.11`
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

Diff for: news/test.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
**Fixed:**
1818

19-
* Surpress `RuntimeWarning` in tests for the `applycutoff` function
19+
* Suppress the `RuntimeWarning` in tests for the `applycutoff` function
2020

2121
**Security:**
2222

Diff for: news/APItutorial.rst renamed to news/tutorialdoc.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**Added:**
22

3-
* Add tutorial to API
3+
* Add tutorial to documentation
44

55
**Changed:**
66

Diff for: pyproject.toml

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ maintainers = [
1414
description = "Tool for visualizing 3D diffraction and PDF Images."
1515
keywords = ['diffraction', 'pdf', 'pair distribution function', 'gui']
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,9 +25,9 @@ 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',
30+
'Programming Language :: Python :: 3.13',
3131
'Topic :: Scientific/Engineering :: Physics',
3232
'Topic :: Scientific/Engineering :: Chemistry',
3333
]
@@ -54,6 +54,11 @@ namespaces = false # to disable scanning PEP 420 namespaces (true by default)
5454
[tool.setuptools.dynamic]
5555
dependencies = {file = ["requirements/pip.txt"]}
5656

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

Diff for: src/diffpy/fourigui/fourigui.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ def initUI(self):
155155
anibutton.grid(row=8, column=4)
156156

157157
# row 10-12 Fourier transformation
158-
seperator = tk.Label(
158+
separator = tk.Label(
159159
frame00, text=" "
160160
) # __________________________________________________________________")
161-
seperator.grid(row=9, column=0, columnspan=5)
161+
separator.grid(row=9, column=0, columnspan=5)
162162
cutofflabel = tk.Label(frame00, text="cutoff frequency")
163163
cutofflabel.grid(row=10, column=2, columnspan=2)
164164
qminlabel = tk.Label(frame00, text="qmin [px]:")
@@ -390,8 +390,9 @@ def fft(self):
390390
def perform_fft(fftholder):
391391
fftholder = np.nan_to_num(fftholder)
392392
size = list(fftholder.shape)
393+
axes = list(range(fftholder.ndim))
393394
fftholder = np.fft.ifftshift(fftholder)
394-
fftholder = np.fft.fftn(fftholder, s=size, norm="ortho")
395+
fftholder = np.fft.fftn(fftholder, s=size, axes=axes, norm="ortho")
395396
fftholder = np.fft.fftshift(fftholder)
396397
fftholder = fftholder.real
397398
return fftholder

Diff for: tests/integration_test.py

+13
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,19 @@ def test_fft_testdataset3(self):
9797
# then
9898
self.assertTrue(np.allclose(result, self.test_gofr_cut_15to35px))
9999

100+
# Desired behavior is nans in the arrays below qmin and above qmax. As a result, np.nanmax will generate
101+
# runtimewarnings when it # encounters slices that are all nans. capture these so tests pass cleanly
102+
# without warnings
103+
with warnings.catch_warnings():
104+
warnings.simplefilter("ignore", category=RuntimeWarning)
105+
# when
106+
self.test_gui.applycutoff()
107+
result = self.test_gui.cube
108+
109+
# then
110+
# with self.assertWarns(RuntimeWarning):
111+
self.assertTrue(np.allclose(np.nan_to_num(result), np.nan_to_num(self.test_sofq_cut_15to35px)))
112+
100113

101114
if __name__ == "__main__":
102115
unittest.main()

0 commit comments

Comments
 (0)