Skip to content

uMigration #288

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 26 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fb5a9fa
skpkg: list dependencies in requirements folder
ycexiao Jun 10, 2025
bc908d2
skpkg: add CI and issue/PR templates
ycexiao Jun 10, 2025
97a2453
skpkg: add pyproject.toml
ycexiao Jun 10, 2025
9e7efc4
skpkg: add config files for pre-commit
ycexiao Jun 10, 2025
4027429
skpkg: add config files readthedocs, codecov, GitHub
ycexiao Jun 10, 2025
b974e79
skpkg: migrate documentation
ycexiao Jun 10, 2025
0929828
skpkg: skpkg: add README.rst
ycexiao Jun 10, 2025
8c23dff
skpkg: add config files for authors, changelog, code of conduct, license
ycexiao Jun 10, 2025
24a9128
skpkg: add news files
ycexiao Jun 10, 2025
2ec518f
tmp
ycexiao Jun 10, 2025
9a9f4a1
chore: change the description
ycexiao Jun 10, 2025
5839102
Merge pull request #282 from ycexiao/config
sbillinge Jun 10, 2025
9f89747
chore: change description in `README.rst`
ycexiao Jun 10, 2025
847d45a
Merge pull request #281 from ycexiao/setup-CI
sbillinge Jun 10, 2025
a9e4894
chore: change package description in `index.rst`
ycexiao Jun 10, 2025
e0e456c
chore: keep the deleted paragraph
ycexiao Jun 10, 2025
d57fbcc
chore: keep the old license.rst
ycexiao Jun 10, 2025
d8ee2b0
chore: keep the old `index.rst`
ycexiao Jun 10, 2025
1cc30b2
chore: remove unwanted files
ycexiao Jun 10, 2025
daf5c8b
docs: remove example_package.rst
ycexiao Jun 11, 2025
4af7868
Merge pull request #283 from ycexiao/doc
sbillinge Jun 11, 2025
bb697b4
ci: add docformatter
ycexiao Jun 16, 2025
df988d7
chore: docformatter fix
ycexiao Jun 16, 2025
4b2e0ea
Merge pull request #285 from ycexiao/add-docformatter
sbillinge Jun 16, 2025
a25d800
docs: fix typos
ycexiao Jun 17, 2025
c51c499
Merge pull request #287 from ycexiao/fix-typo
sbillinge Jun 18, 2025
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
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# As of now, flake8 does not natively support configuration via pyproject.toml
# https://github.com/microsoft/vscode-flake8/issues/135
[flake8]
exclude =
.git,
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.pdfgui
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.pdfgui
67 changes: 8 additions & 59 deletions .github/workflows/matrix-and-codecov-on-merge-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,62 +11,11 @@ on:
workflow_dispatch:

jobs:
coverage:
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", "3.13"]
env:
LATEST_PYTHON_VERSION: "3.13"
steps:
- name: Check out diffpy.pdfgui
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
miniforge-version: latest
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.5.0rc1
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 }}
matrix-coverage:
uses: scikit-package/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 }}
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 @@ -7,7 +7,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.pdfgui
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
13 changes: 9 additions & 4 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.pdfgui
: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.pdfgui
.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.pdfgui
:target: https://pypi.org/project/diffpy.pdfgui/

.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.pdfgui
Expand All @@ -35,7 +35,7 @@
.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
:target: https://github.com/diffpy/diffpy.pdfgui/issues

Graphical user interface program for structure refinements to atomic
Graphical user interface program for structure refinements to the atomic
pair distribution function.

For users who do not have the expertise or necessity for command
Expand Down Expand Up @@ -167,4 +167,9 @@ Before contributing, please read our `Code of Conduct <https://github.com/diffpy
Contact
-------

For more information on diffpy.pdfgui please visit the project `web-page <https://diffpy.github.io/>`_ or email Prof. Simon Billinge at [email protected].
For more information on diffpy.pdfgui please visit the project `web-page <https://diffpy.github.io/>`_ or email Simon Billinge at [email protected].

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

``diffpy.pdfgui`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.
40 changes: 37 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

# Attempt to import the version dynamically from GitHub tag.
try:
fullversion = version("diffpy.pdfgui")
except Exception:
fullversion = "No version found. The correct version will appear in the released version." # noqa: E501

import sys
import time
from importlib.metadata import version
Expand Down Expand Up @@ -42,6 +48,7 @@
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"sphinx_copybutton",
"sphinx_rtd_theme",
"m2r",
]
Expand All @@ -64,6 +71,11 @@
project = "diffpy.pdfgui"
copyright = "%Y, The Trustees of Columbia University in the City of New York"

# For sphinx_copybutton extension.
# Do not copy "$" for shell commands in code-blocks.
copybutton_prompt_text = r"^\$ "
copybutton_prompt_is_regexp = True

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
Expand Down Expand Up @@ -123,6 +135,14 @@
#
html_theme = "sphinx_rtd_theme"

html_context = {
"display_github": True,
"github_user": "diffpy",
"github_repo": "diffpy.pdfgui",
"github_version": "main",
"conf_py_path": "/doc/source/",
}

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
Expand Down Expand Up @@ -158,7 +178,7 @@
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
html_extra_path = ["../manual"]
html_extra_path = []

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down Expand Up @@ -221,7 +241,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
("index", "diffpy.pdfgui.tex", "diffpy.pdfgui Documentation", ab_authors, "manual"),
(
"index",
"diffpy.pdfgui.tex",
"diffpy.pdfgui Documentation",
ab_authors,
"manual",
),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -249,7 +275,15 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("index", "diffpy.pdfgui", "diffpy.pdfgui Documentation", ab_authors, 1)]
man_pages = [
(
"index",
"diffpy.pdfgui",
"diffpy.pdfgui Documentation",
ab_authors,
1,
)
]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ approx- imately 3nm in size.

Input files:

- :download:`Doping data series <manual_resources/Nanoparticle structure.zip>` containing:
- :download:`Nanoparticle structure<manual_resources/Nanoparticle structure.zip>` containing:

1. two PDF data collected from the bulk and naoparticle material.
2. a project named ``CdSe-nano.ddp``
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

.. |title| replace:: diffpy.pdfgui documentation

diffpy.pdfgui - GUI for PDF simulation and structure refinement.
``diffpy.pdfgui`` - Graphical user interface program for structure refinements to the atomic pair distribution function.

| Software version |release|
| Last updated |today|
Expand Down
3 changes: 2 additions & 1 deletion doc/source/manual_resources/tui_mno_bond_lengths.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

"""Extract the shortest Mn-O bond lengths from all fits in PDFgui project.
"""Extract the shortest Mn-O bond lengths from all fits in PDFgui
project.

This script loops through all refined phases in PDFgui project and
calculates their shortest Mn-O bond lengths using diffpy.pdffit2
Expand Down
2 changes: 1 addition & 1 deletion doc/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Procedure:
factor, and a set of parameters intended to be used to account for
correlated atomic motion effects that typically sharpen the nearest
neighbor PDF peak. These are ``delta1``, ``delta2``, ``sratio``, and
``rcut ``. The ``spdiameter`` and ``stepcut`` parameters include scatterer
``rcut``. The ``spdiameter`` and ``stepcut`` parameters include scatterer
size effects in the PDF. These parameters will be described later. The
bottom part of the panel contains standard unit cell content related
information such as atomic species, their fractional coordinates,
Expand Down
23 changes: 23 additions & 0 deletions news/doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Support ``scikit-package`` Level 5 standard (https://scikit-package.github.io/scikit-package/).

**Security:**

* <news item>
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ build-backend = "setuptools.build_meta"
name = "diffpy.pdfgui"
dynamic=['version', 'dependencies']
authors = [
{ name="Simon J.L. Billinge group", email="[email protected]" },
{ name="Simon J.L. Billinge group", email="[email protected]" },
]
maintainers = [
{ name="Simon J.L. Billinge group", email="[email protected]" },
{ name="Simon J.L. Billinge group", email="[email protected]" },
]
description = "GUI for PDF simulation and structure refinement."
description = "Graphical user interface program for structure refinements to the atomic pair distribution function."
keywords = ['PDF structure refinement GUI']
readme = "README.rst"
requires-python = ">=3.11, <3.14"
Expand Down Expand Up @@ -81,3 +81,7 @@ exclude = '''
| tests/data
)/
'''
[tool.docformatter]
recursive = true
wrap-summaries = 72
wrap-descriptions = 72
Empty file removed requirements/build.txt
Empty file.
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
6 changes: 3 additions & 3 deletions src/diffpy/pdfgui/applications/pdfgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def version():


def processArguments(argv1):
"""Process command line arguments and store results in pdfguiglobals. This
method updates cmdopts, cmdargs and dbopts attributes in the pdfguiglobals
module.
"""Process command line arguments and store results in
pdfguiglobals. This method updates cmdopts, cmdargs and dbopts
attributes in the pdfguiglobals module.

argv1 -- list of command line arguments excluding the executable

Expand Down
Loading
Loading