From 80783da056688a6aacc9e9361d7385cf48ecb2c8 Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Fri, 7 Nov 2025 15:24:36 -0500 Subject: [PATCH 1/4] chore: update cookiecutter, pyproject, srxplanar_app from skpkg, and add srxconfutils to conda.txt --- cookiecutter.json | 8 +++---- pyproject.toml | 2 +- requirements/conda.txt | 1 + src/diffpy/srxplanar/srxplanar_app.py | 33 +++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 src/diffpy/srxplanar/srxplanar_app.py diff --git a/cookiecutter.json b/cookiecutter.json index 9c24d55..1bfa80e 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -2,17 +2,17 @@ "maintainer_name": "Simon Billinge", "maintainer_email": "sb2896@columbia.edu", "maintainer_github_username": "sbillinge", - "contributors": "Simon Billinge, Billinge Group members", + "contributors": "Xiaohao Yang and Billinge Group members", "license_holders": "The Trustees of Columbia University in the City of New York", "project_name": "diffpy.srxplanar", "github_username_or_orgname": "diffpy", "github_repo_name": "diffpy.srxplanar", "conda_pypi_package_dist_name": "diffpy.srxplanar", "package_dir_name": "diffpy.srxplanar", - "project_short_description": "Distance Printer, calculate the inter atomic distances. Part of xPDFsuite", + "project_short_description": "2D diffraction image integration using non splitting pixel algorithm", "project_keywords": "diffpy, pdf, data interpretation", - "minimum_supported_python_version": "3.12", - "maximum_supported_python_version": "3.14", + "minimum_supported_python_version": "3.11", + "maximum_supported_python_version": "3.13", "project_needs_c_code_compiled": "No", "project_has_gui_tests": "No" } diff --git a/pyproject.toml b/pyproject.toml index 82caca3..759efc0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ exclude = [] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) [project.scripts] -diffpy-srxplanar = "diffpy.srxplanar_app:main" +diffpy-srxplanar = "diffpy.srxplanar.srxplanar_app:main" [tool.setuptools.dynamic] dependencies = {file = ["requirements/pip.txt"]} diff --git a/requirements/conda.txt b/requirements/conda.txt index 3b5f87d..9db6f8e 100644 --- a/requirements/conda.txt +++ b/requirements/conda.txt @@ -3,3 +3,4 @@ scipy fabio tifffile configparser +diffpy.srxconfutils diff --git a/src/diffpy/srxplanar/srxplanar_app.py b/src/diffpy/srxplanar/srxplanar_app.py new file mode 100644 index 0000000..0d48c30 --- /dev/null +++ b/src/diffpy/srxplanar/srxplanar_app.py @@ -0,0 +1,33 @@ +import argparse + +from diffpy.srxplanar.version import __version__ # noqa + + +def main(): + parser = argparse.ArgumentParser( + prog="diffpy.srxplanar", + description=( + "2D diffraction image integration using non " + "splitting pixel algorithm\n\nFor more information, visit: " + "https://github.com/diffpy/diffpy.srxplanar/" + ), + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + + parser.add_argument( + "--version", + action="store_true", + help="Show the program's version number and exit", + ) + + args = parser.parse_args() + + if args.version: + print(f"diffpy.srxplanar {__version__}") + else: + # Default behavior when no arguments are given + parser.print_help() + + +if __name__ == "__main__": + main() From c919b31dad692db1a2deb815f1f3e0102b2df409 Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Fri, 7 Nov 2025 15:25:01 -0500 Subject: [PATCH 2/4] chore: update installation instructions in readme --- README.rst | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index fda7bb6..35c983d 100644 --- a/README.rst +++ b/README.rst @@ -63,12 +63,33 @@ by citing the following paper in your publication: Installation ------------ -The preferred method is to be installed with `xpdfsuite` package or the wheel file. +The preferred method is to use `Miniconda Python +`_ +and install from the "conda-forge" channel of Conda packages. -To install the package with the wheel file, you can first download the wheel file, then type +To add "conda-forge" to the conda channels, run the following in a terminal. :: -`pip install /path/to/diffpy.srxplanar-X.Y.Z-py3-none-any.whl`. + conda config --add channels conda-forge +We want to install our packages in a suitable conda environment. +The following creates and activates a new environment named ``diffpy.srxplanar_env`` :: + + conda create -n diffpy.srxplanar_env diffpy.srxplanar + conda activate diffpy.srxplanar_env + +The output should print the latest version displayed on the badges above. + +If the above does not work, you can use ``pip`` to download and install the latest release from +`Python Package Index `_. +To install using ``pip`` into your ``diffpy.srxplanar_env`` environment, type :: + + pip install diffpy.srxplanar + +If you prefer to install from sources, after installing the dependencies, obtain the source archive from +`GitHub `_. Once installed, ``cd`` into your ``diffpy.srxplanar`` directory +and run the following :: + + pip install . This package also provides command-line utilities. To check the software has been installed correctly, type :: From e061a6176ecd0d95f96e9e186e43dc2452d75eaf Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Fri, 7 Nov 2025 15:28:59 -0500 Subject: [PATCH 3/4] chore: delete publish-docs, delete srxconfutils install in build-wheel --- .github/workflows/build-wheel-release-upload.yml | 2 -- .github/workflows/publish-docs-on-release.yml | 12 ------------ 2 files changed, 14 deletions(-) delete mode 100644 .github/workflows/publish-docs-on-release.yml diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index ba11489..d4ccc73 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -13,8 +13,6 @@ jobs: project: diffpy.srxplanar c_extension: false maintainer_GITHUB_username: sbillinge - run: | - pip install diffpy.srxconfutils secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml deleted file mode 100644 index 625eb6c..0000000 --- a/.github/workflows/publish-docs-on-release.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Deploy Documentation on Release - -on: - workflow_dispatch: - -jobs: - docs: - uses: scikit-package/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 - with: - project: diffpy.srxplanar - c_extension: false - headless: false From 160c9026bdfb929a2c7f1f67d0e11b02c9ab6559 Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Fri, 7 Nov 2025 15:29:46 -0500 Subject: [PATCH 4/4] skpkg: add news file --- news/update-workflows.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/update-workflows.rst diff --git a/news/update-workflows.rst b/news/update-workflows.rst new file mode 100644 index 0000000..d329e5f --- /dev/null +++ b/news/update-workflows.rst @@ -0,0 +1,23 @@ +**Added:** + +* No news added: Update installation instructions in README.rst and other minor fixes. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +*