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
18 changes: 18 additions & 0 deletions .github/workflows/build-and-publish-docs-on-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build and Publish Docs on Dispatch

on:
workflow_dispatch:

jobs:
get-python-version:
uses: scikit-package/release-scripts/.github/workflows/_get-python-version-latest.yml@v0
with:
python_version: 0

docs:
uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0
with:
project: diffpy.apps
c_extension: false
headless: false
python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }}
64 changes: 61 additions & 3 deletions .github/workflows/build-wheel-release-upload.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,76 @@
name: Release (GitHub/PyPI) and Deploy Docs
name: Build Wheel and Release

# Trigger on tag push or manual dispatch.
# Tag and release privilege are verified inside the reusable workflow.
on:
workflow_dispatch:
push:
tags:
- "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml
- "*"

# ── Release modality ──────────────────────────────────────────────────────────
# Three options are provided below. Only ONE job should be active at a time.
# To switch: comment out the active job and uncomment your preferred option,
# then commit the change to main before tagging a release.
# ─────────────────────────────────────────────────────────────────────────────

jobs:
# Option 1 (default): Release to GitHub, publish to PyPI, and deploy docs.
#
# The wheel is uploaded to PyPI so users can install with `pip install`.
# A GitHub release is created with the changelog as the release body, and
# the Sphinx documentation is rebuilt and deployed to GitHub Pages.
#
# Choose this for open-source packages distributed via PyPI and/or
# conda-forge where broad public availability is the goal.
build-release:
uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
with:
project: diffpy.apps
c_extension: false
maintainer_GITHUB_username: sbillinge
maintainer_github_username: sbillinge
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}

# Option 2: Release to GitHub and deploy docs, without publishing to PyPI.
#
# A GitHub release is created and the Sphinx docs are deployed, but the
# wheel is not uploaded to PyPI. The source code remains publicly visible
# on GitHub and can be installed directly from there.
#
# Choose this when the package is public but you prefer to keep it off the
# default pip index — for example, if you distribute via conda-forge only,
# or if the package is not yet ready for a permanent PyPI presence.
#
# To use: comment out Option 1 above and uncomment the lines below.
# build-release-no-pypi:
# uses: scikit-package/release-scripts/.github/workflows/_build-release-github-no-pypi.yml@v0
# with:
# project: diffpy.apps
# c_extension: false
# maintainer_github_username: sbillinge
# secrets:
# PAT_TOKEN: ${{ secrets.PAT_TOKEN }}

# Option 3: Release to GitHub with wheel, license, and instructions bundled
# as a downloadable zip attached to the GitHub release asset.
#
# The wheel is built and packaged together with INSTRUCTIONS.txt and the
# LICENSE file into a zip that is attached directly to the GitHub release.
# Users with access to the (private) repo download the zip, follow the
# instructions inside, and install locally with pip. No PyPI or conda-forge
# upload occurs, and no docs are deployed.
#
# Choose this for private or restricted packages where distribution must be
# controlled: only users with repo access can download the release asset,
# making the GitHub release itself the distribution channel.
#
# To use: comment out Option 1 above and uncomment the lines below.
# build-release-private:
# uses: scikit-package/release-scripts/.github/workflows/_build-release-github-private-pure.yml@v0
# with:
# project: diffpy.apps
# maintainer_github_username: sbillinge
# secrets:
# 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 @@ -3,7 +3,7 @@ name: Check for News
on:
pull_request_target:
branches:
- main
- main # GitHub does not evaluate expressions in trigger filters; edit this value if your base branch is not main

jobs:
check-news-item:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: CI
name: Matrix and Codecov

on:
# push:
# branches:
# - main
release:
types:
- prereleased
Expand All @@ -14,6 +17,5 @@ jobs:
project: diffpy.apps
c_extension: false
headless: false
python_versions: 3.12, 3.13
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
11 changes: 0 additions & 11 deletions .github/workflows/release-docs.yml

This file was deleted.

17 changes: 9 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default_language_version:
python: python3
python: python3.13
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
Expand Down Expand Up @@ -29,7 +29,7 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 8.0.1
rev: 9.0.0a3
hooks:
- id: isort
args: ["--profile", "black"]
Expand Down Expand Up @@ -57,10 +57,11 @@ repos:
- id: prettier
additional_dependencies:
- "prettier@^3.2.4"
types: [yaml, markdown, json]
# ruff - An extremely fast Python linter and code formatter, written in Rust.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
# docformatter - PEP 257 compliant docstring formatter
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.8
hooks:
- id: ruff-check
args: [--fix, --config=pyproject.toml]
- id: docformatter
additional_dependencies: [tomli]
args: [--in-place, --config, ./pyproject.toml]
exclude: ^tests/test_runmacro\.py$
2 changes: 1 addition & 1 deletion CODE-OF-CONDUCT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
yx2924@columbia.edu and sbillinge@ucsb.edu. All complaints will be reviewed and investigated promptly and fairly.
sbillinge@ucsb.edu. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
Expand Down
8 changes: 4 additions & 4 deletions cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"author_names": "Yuchen Xiao, Simon Billinge",
"author_emails": "yx2924@columbia.edu, sbillinge@ucsb.edu",
"maintainer_names": "Yuchen Xiao, Simon Billinge",
"maintainer_emails": "yx2924@columbia.edu, sbillinge@ucsb.edu",
"author_emails": "xiaoyuch@msu.edu, sbillinge@ucsb.edu",
"maintainer_names": "Simon Billinge",
"maintainer_emails": "sbillinge@ucsb.edu",
"maintainer_github_usernames": "sbillinge",
"contributors": "Yuchen Xiao, Simon Billinge and members of the Billinge group",
"license_holders": "diffpy.apps contributors",
"project_name": "diffpy.apps",
"license_holders": "diffpy.apps contributors",
"github_username_or_orgname": "diffpy",
"github_repo_name": "diffpy.apps",
"conda_pypi_package_dist_name": "diffpy.apps",
Expand Down
72 changes: 36 additions & 36 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=PackagingScientificPython

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=PackagingScientificPython
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
:end
popd
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To get started, please visit the :ref:`Getting started <getting-started>` page.
Authors
=======

``diffpy.apps`` is developed by Yuchen Xiao, Simon Billinge and members of the Billinge group. This project is maintained by Yuchen Xiao and Simon Billinge. For a detailed list of contributors see
``diffpy.apps`` is developed by Yuchen Xiao, Simon Billinge and members of the Billinge group. This project is maintained by Simon Billinge. For a detailed list of contributors see
https://github.com/diffpy/diffpy.apps/graphs/contributors.

============
Expand Down
23 changes: 23 additions & 0 deletions news/skpkg-update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No news added: scikit-package update this repo.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ build-backend = "setuptools.build_meta"
name = "diffpy.apps"
dynamic=['version', 'dependencies']
authors = [
{name='Yuchen Xiao', email='yx2924@columbia.edu'},
{name='Yuchen Xiao', email='xiaoyuch@msu.edu'},
{name='Simon Billinge', email='sbillinge@ucsb.edu'},
]
maintainers = [
{name='Yuchen Xiao', email='yx2924@columbia.edu'},
{name='Simon Billinge', email='sbillinge@ucsb.edu'},
]
description = "User applications to help with tasks using diffpy packages"
Expand Down
14 changes: 14 additions & 0 deletions src/diffpy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python
##############################################################################
#
# (c) 2026 diffpy.apps contributors.
# All rights reserved.
#
# File coded by: Billinge Group members and community contributors.
#
# See GitHub contributions for a more detailed list of contributors.
# https://github.com/diffpy/diffpy.apps/graphs/contributors
#
# See LICENSE.rst for license information.
#
##############################################################################
1 change: 0 additions & 1 deletion src/diffpy/apps/pdfadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def initialize_recipe(
delta1 and delta2 variables, and structure parameters
constrained by the space group.
"""

recipe = FitRecipe()
recipe.add_contribution(self.contribution)
qdamp = recipe.create_new_variable("qdamp", fixed=False, value=0.04)
Expand Down
13 changes: 6 additions & 7 deletions src/diffpy/apps/refinebase/parametric_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ def residual(self):

class ParametricModelFunction(ParametricModel):
def __init__(self, name, function, argnames=None):
"""
Initialize a ParametricModelFunction instance.
"""Initialize a ParametricModelFunction instance.

function can be either a callable or a string representing
the pre-defined function.
Expand Down Expand Up @@ -254,8 +253,7 @@ def __init__(
finite=False,
run_parallel=True,
):
"""
Create a ParametricModelPDF instance from a structure object.
"""Create a ParametricModelPDF instance from a structure object.

structure can be a raw diffpy.structure/pyobjcryst structure, or
an existing DiffpyStructureParSet/ObjCrystCrystalParSet phase
Expand Down Expand Up @@ -615,10 +613,11 @@ def create_pdf_model_from_code(
finite=False,
run_parallel=True,
):
"""Create a ParametricModelPDF by executing code that builds a structure.
"""Create a ParametricModelPDF by executing code that builds a
structure.

The code must assign the structure/crystal object to a variable named
structure_name (default "structure") in its local namespace.
The code must assign the structure/crystal object to a variable
named structure_name (default "structure") in its local namespace.
"""
local_namespace = {}
exec(code, global_namespace, local_namespace)
Expand Down
Loading
Loading