Skip to content
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
42 changes: 11 additions & 31 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
# codecov can find this file anywhere in the repo, so we don't need to clutter
# the root folder.
#comment: false

codecov:
notify:
require_ci_to_pass: no

coverage:
status:
patch:
project: # more options at https://docs.codecov.com/docs/commit-status
default:
target: '70'
if_no_uploads: error
if_not_found: success
if_ci_failed: failure
project:
default: false
library:
target: auto
if_no_uploads: error
if_not_found: success
if_ci_failed: error
paths: '!*/tests/.*'

tests:
target: 97.9%
paths: '*/tests/.*'
if_not_found: success

flags:
tests:
paths:
- tests/
target: auto # use the coverage from the base commit, fail if coverage is lower
threshold: 0% # allow the coverage to drop by

comment:
layout: " diff, flags, files"
behavior: default
require_changes: false
require_base: false # [true :: must have a base report to post]
require_head: false # [true :: must have a head report to post]
hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage]
2 changes: 2 additions & 0 deletions .codespell/ignore_lines.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
;; Please include filenames and explanations for each ignored line.
;; See https://docs.openverse.org/meta/codespell.html for docs.
20 changes: 20 additions & 0 deletions .codespell/ignore_words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
;; Please include explanations for each ignored word (lowercase).
;; See https://docs.openverse.org/meta/codespell.html for docs.

;; abbreviation for "materials" often used in a journal title
mater

;; alternative use of socioeconomic
socio-economic

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

;; abbreviation for "structure"
struc

;; method name within JournalPanel class
onText

;; a method name within JournalPanel class
delt
13 changes: 0 additions & 13 deletions .coveragerc

This file was deleted.

42 changes: 33 additions & 9 deletions .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,41 @@ labels: "release"
assignees: ""
---

### Release checklist for GitHub contributors
### PyPI/GitHub rc-release preparation checklist:

- [ ] All PRs/issues attached to the release are merged.
- [ ] All the badges on the README are passing.
- [ ] 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 on the website (e.g., diffpy.org) are updated and
tested
- [ ] Successfully run any tutorial examples or do functional testing in some other way.
- [ ] Grammar and writing quality have been checked (no typos).

Please mention @sbillinge when you are ready for release. Include any additional comments necessary, such as
version information and details about the pre-release.
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.
- [ ] 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:

### 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>`.
- [ ] 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.

### conda-forge release preparation checklist:

<!-- After @sbillinge 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.

### Post-release checklist

<!-- Before closing this issue, please complete the following: -->

- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments.
- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures.
2 changes: 1 addition & 1 deletion .github/workflows/build-wheel-release-upload.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release (GitHub/PyPI)
name: Release (GitHub/PyPI) and Deploy Docs

on:
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-news-item.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
build:
check-news-item:
uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0
with:
project: diffpy.pdfgui
65 changes: 58 additions & 7 deletions .github/workflows/matrix-and-codecov-on-merge-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,61 @@ on:

jobs:
coverage:
uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
with:
project: diffpy.pdfgui
c_extension: false
headless: true
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
defaults:
run:
shell: bash -l {0}

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python-version: ["3.11", "3.12"]
env:
LATEST_PYTHON_VERSION: "3.12"
steps:
- name: Check out diffpy.pdfgui
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false
python-version: ${{ matrix.python-version }}

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Install diffpy.pdfgui and requirements
run: |
conda install --file requirements/test.txt
conda install wxpython diffpy.utils matplotlib-base
pip install diffpy.pdffit2==1.4.4rc6
python -m pip install . --no-deps

- name: Start Xvfb for ubuntu-latest only
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y xvfb
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x16 &

- name: Validate diffpy.pdfgui
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
export DISPLAY=:99
fi
pytest --cov
coverage report -m
codecov

- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
7 changes: 4 additions & 3 deletions .github/workflows/publish-docs-on-release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Build and Deploy Docs
name: Deploy Documentation on Release

on:
release:
types:
- published
types: [published]
workflow_dispatch:

jobs:
Expand All @@ -12,3 +11,5 @@ jobs:
with:
project: diffpy.pdfgui
c_extension: false
headless: true
python_version: 3.12
54 changes: 49 additions & 5 deletions .github/workflows/tests-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,52 @@ on:

jobs:
validate:
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
with:
project: diffpy.pdfgui
c_extension: false
headless: true
defaults:
run:
shell: bash -l {0}

runs-on: ubuntu-latest
steps:
- name: Check out diffpy.pdfgui
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false
python-version: 3.12

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Install diffpy.pdfgui and requirements
run: |
conda install --file requirements/test.txt
conda install wxpython diffpy.utils matplotlib-base
pip install diffpy.pdffit2==1.4.4rc6
Copy link
Contributor Author

@bobleesj bobleesj Dec 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are testing pdfgui with pdffit rc, we conda install wxpython, diffpy.utils, and matplotlib-base

and then we pip install pdffit2 rc

Once we have pdfgui tested with pdffit2 rc, we could try to find an approach to use the reusable workflow? @sbillinge

python -m pip install . --no-deps

- name: Start Xvfb
run: |
sudo apt-get install -y xvfb
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x16 &

- name: Validate diffpy.pdfgui
run: |
export DISPLAY=:99
pytest --cov
coverage report -m
codecov

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ repos:
name: Prevent Commit to Main Branch
args: ["--branch", "main"]
stages: [pre-commit]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ trying to commit again.

Improvements and fixes are always appreciated.

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

Contact
-------
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/html/readme.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
This directory need to be relativly the same as doc/build/html/manual from
This directory need to be relatively the same as doc/build/html/manual from
doc/source/_static/images
2 changes: 1 addition & 1 deletion doc/manual/pdfgui.texinfo
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ requirements. This can be done either for all atoms in the structure or for an
arbitrary subset - for example when it is known that only a certain species
show a local distortion. The code for space group definitions was provided by
the Python Macromolecular Library (mmLib,
@url{http://pymmlib.sourceforge.net}). This was extened to include
@url{http://pymmlib.sourceforge.net}). This was extended to include
non-standard space groups using the Computational Crystallography Toolbox
(cctbx, @uref{https://cctbx.github.io}). PDFgui also supports supercell
expansion of a normal unit cell.
Expand Down
24 changes: 24 additions & 0 deletions news/codecov.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Added:**

* Codecov coverage report in PRs
* Spelling check with Codespell in pre-commit

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ maintainers = [
description = "GUI for PDF simulation and structure refinement."
keywords = ['PDF structure refinement GUI']
readme = "README.rst"
requires-python = ">=3.10"
requires-python = ">=3.11, <3.13"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
Expand All @@ -25,7 +25,6 @@ classifiers = [
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering :: Physics',
Expand Down Expand Up @@ -54,6 +53,11 @@ namespaces = false # to disable scanning PEP 420 namespaces (true by default)
[tool.setuptools.dynamic]
dependencies = {file = ["requirements/pip.txt"]}

[tool.codespell]
exclude-file = ".codespell/ignore_lines.txt"
ignore-words = ".codespell/ignore_words.txt"
skip = "*.cif,*.dat,*.html,*.m,*.textinfo"

[tool.black]
line-length = 115
include = '\.pyi?$'
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/pdfgui/control/calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def load(self, z, subpath):
z -- zipped project file
subpath -- path to its own storage within project file

returns a tree of internal hierachy
returns a tree of internal hierarchy
"""
config = pickle.loads(z.read(subpath + "config"), encoding="latin1")
self.rmin = config["rmin"]
Expand Down
2 changes: 1 addition & 1 deletion src/diffpy/pdfgui/control/fitstructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class FitStructure(PDFStructure):
Class data members:
symposeps -- tolerance for recognizing site as symmetry position

Data members (in adition to those in PDFStructure):
Data members (in addition to those in PDFStructure):
owner -- instance of parent Fitting (set in Organizer.add())
initial -- initial structure, same as self
refined -- refined structure when available or None
Expand Down
Loading
Loading