From 0355b6127d961affe5574216625f80057ed8f6a9 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Tue, 28 Jul 2026 19:18:34 +0800 Subject: [PATCH 1/8] skpkg: recut morph package --- .github/ISSUE_TEMPLATE/release_checklist.md | 7 +- .../build-and-publish-docs-on-dispatch.yml | 18 ++++ .../workflows/build-wheel-release-upload.yml | 66 +++++++++++++- .github/workflows/check-news-item.yml | 2 +- .github/workflows/matrix-and-codecov.yml | 21 +++++ AUTHORS.rst | 2 +- CODE-OF-CONDUCT.rst | 2 +- LICENSE.rst | 1 + README.rst | 91 ++++--------------- cookiecutter.json | 20 ++++ docs/source/api/diffpy.morph.rst | 6 +- docs/source/conf.py | 8 +- docs/source/img/.placeholder | 0 docs/source/index.rst | 10 +- docs/source/license.rst | 1 + docs/source/snippets/.placeholder | 0 news/skpkg.rst | 23 +++++ pyproject.toml | 10 +- requirements/docs.txt | 2 +- src/diffpy/__init__.py | 1 + src/diffpy/morph/__init__.py | 4 +- src/diffpy/morph/version.py | 12 ++- 22 files changed, 200 insertions(+), 107 deletions(-) create mode 100644 .github/workflows/build-and-publish-docs-on-dispatch.yml create mode 100644 .github/workflows/matrix-and-codecov.yml create mode 100644 cookiecutter.json create mode 100644 docs/source/img/.placeholder create mode 100644 docs/source/snippets/.placeholder create mode 100644 news/skpkg.rst diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 6107962c..56c5fca3 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -11,12 +11,13 @@ assignees: "" - [ ] 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. +- [ ] Locally rendered documentation contains all appropriate pages, tutorials, and other human-written text is up-to-date with any changes in the code. +- [ ] All API references are included. To check this, run `conda install scikit-package` and then `package build api-doc`. Review any edits made by rerendering the docs locally. - [ ] Installation instructions in the README, documentation, and the website 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. +- [ ] Dispatch matrix testing to test the release on all Python versions and systems. If you do not have permission to run this workflow, tag the maintainer and say `@maintainer, please dispatch matrix testing workflow`. Please tag the maintainer (e.g., @username) in the comment here when you are ready for the PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here: @@ -34,7 +35,7 @@ Please let the maintainer know that all checks are done and the package is ready - [ ] 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. +- [ ] New package dependencies listed in `conda.txt` and `tests.txt` are added to `meta.yaml` in the feedstock. - [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions. - [ ] Tag the maintainer for conda-forge release. diff --git a/.github/workflows/build-and-publish-docs-on-dispatch.yml b/.github/workflows/build-and-publish-docs-on-dispatch.yml new file mode 100644 index 00000000..4b80df2d --- /dev/null +++ b/.github/workflows/build-and-publish-docs-on-dispatch.yml @@ -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.morph + c_extension: false + headless: false + python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }} diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 27fe04c1..e1241896 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -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: - release: + # 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.morph 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.morph + # 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.morph + # maintainer_github_username: sbillinge + # secrets: + # PAT_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index b999887f..a21f42d3 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -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: diff --git a/.github/workflows/matrix-and-codecov.yml b/.github/workflows/matrix-and-codecov.yml new file mode 100644 index 00000000..832dbccb --- /dev/null +++ b/.github/workflows/matrix-and-codecov.yml @@ -0,0 +1,21 @@ +name: Matrix and Codecov + +on: + # push: + # branches: + # - main + release: + types: + - prereleased + - published + workflow_dispatch: + +jobs: + matrix-coverage: + uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 + with: + project: diffpy.morph + c_extension: false + headless: false + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/AUTHORS.rst b/AUTHORS.rst index f7aca6d3..3297936f 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -1,7 +1,7 @@ Authors ======= -Billinge Group and community contributors. +Simon Billinge, Billinge Group members Contributors ------------ diff --git a/CODE-OF-CONDUCT.rst b/CODE-OF-CONDUCT.rst index e8199ca5..3cb14de2 100644 --- a/CODE-OF-CONDUCT.rst +++ b/CODE-OF-CONDUCT.rst @@ -67,7 +67,7 @@ Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -sb2896@columbia.edu. All complaints will be reviewed and investigated promptly and fairly. +simon.billinge@gmail.com. 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. diff --git a/LICENSE.rst b/LICENSE.rst index 748d7e06..e1d1cc27 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -1,6 +1,7 @@ BSD 3-Clause License Copyright (c) 2024-2025, The Trustees of Columbia University in the City of New York. +Copyright (c) 2026, diffpy.morph contributors. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.rst b/README.rst index c2e2bb27..51da5613 100644 --- a/README.rst +++ b/README.rst @@ -15,8 +15,8 @@ .. |Black| image:: https://img.shields.io/badge/code_style-black-black :target: https://github.com/psf/black -.. |CI| image:: https://github.com/diffpy/diffpy.morph/actions/workflows/matrix-and-codecov-on-merge-to-main.yml/badge.svg - :target: https://github.com/diffpy/diffpy.morph/actions/workflows/matrix-and-codecov-on-merge-to-main.yml +.. |CI| image:: https://github.com/diffpy/diffpy.morph/actions/workflows/matrix-and-codecov.yml/badge.svg + :target: https://github.com/diffpy/diffpy.morph/actions/workflows/matrix-and-codecov.yml .. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.morph/branch/main/graph/badge.svg :target: https://codecov.io/gh/diffpy/diffpy.morph @@ -25,6 +25,7 @@ :target: https://anaconda.org/conda-forge/diffpy.morph .. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff + :target: https://github.com/diffpy/diffpy.morph/pulls .. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.morph :target: https://pypi.org/project/diffpy.morph/ @@ -35,36 +36,9 @@ .. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue :target: https://github.com/diffpy/diffpy.morph/issues -Python package for manipulating and comparing diffraction data. - -``diffpy.morph`` is a Python software package designed to increase the insight -researchers can obtain from measured data including diffraction data -and atomic pair distribution functions -(PDFs) in a model-independent way. For example, the program was designed to help a -researcher answer the question: "Has my material undergone a phase -transition between these two measurements?" - -One approach is to compare the two diffraction patterns in a plot -and view the difference curve underneath. However, significant signal can -be seen in the difference curve from benign effects such as thermal expansion -(peak shifts) and increased thermal motion (peak broadening) or a change in -scale due to differences in incident flux, for example. ``diffpy.morph`` will -do its best to correct for these benign effects before computing and -plotting the difference curve. One measured function (typically that collected -at higher temperature) is identified as the target function and the second -function is then morphed by "stretching" (changing the r-axis to simulate a -uniform lattice expansion), "smearing" (broadening peaks through a -uniform convolution to simulate increased thermal motion), and "scaling" -(self-explanatory). ``diffpy.morph`` will vary the amplitude of the morphing -transformations to obtain the best fit between the morphed and the target -functions, then plot them on top of each other with the difference plotted -below. - -There are also a few other morphing transformations in the program. - -Finally, we note that ``diffpy.morph`` should work on other spectra, -though it has not been extensively tested beyond spectral data and the PDF. +Python package for manipulating and comparing 1D signals. +* LONGER DESCRIPTION HERE For more information about the diffpy.morph library, please consult our `online documentation `_. @@ -73,13 +47,7 @@ Citation If you use diffpy.morph in a scientific publication, we would like you to cite this package as - Yang, A., Farrow, C. L., Juhás, P., Iglesias, L. K., Liu, C.-H., - Marks, S. D., Wall, V. R. K., Safin, J., Drewry, S. M., Myers, C., - Hanlon, D. F., Leonard, N., Petrovic, C., Jeong, A., Talapin, D. V., - Nazar, L. F., Zhou, H., Teitelbaum, S. W., van Driel, T. B., - Banerjee, S., Bozin, E. S., Toney, M. F., Page, K., Ginsberg, N. S., - and Billinge, S. J. L. (2026). *diffpy.morph: Python tools for model - independent comparisons between sets of 1D functions*. arXiv:2602.06987. + diffpy.morph Package, https://github.com/diffpy/diffpy.morph Installation ------------ @@ -98,19 +66,11 @@ The following creates and activates a new environment named ``diffpy.morph_env`` conda create -n diffpy.morph_env diffpy.morph conda activate diffpy.morph_env -To confirm that the installation was successful, type :: - - python -c "import diffpy.morph; print(diffpy.morph.__version__)" - 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.morph_env`` environment, we will also have to install dependencies :: - - pip install -r https://raw.githubusercontent.com/diffpy/diffpy.morph/main/requirements/pip.txt - -and then install the package :: +To install using ``pip`` into your ``diffpy.morph_env`` environment, type :: pip install diffpy.morph @@ -120,43 +80,28 @@ and run the following :: pip install . -Getting Started ---------------- +This package also provides command-line utilities. To check the software has been installed correctly, type :: -You may consult our `online documentation `_ for tutorials and API references. + diffpy.morph --version -USING diffpy.morph ------------------- +You can also type the following command to verify the installation. :: -For detailed instructions and full tutorial, see our `website `. - -Once the required software, including ``diffpy.morph`` is all installed, open -up a terminal and check installation has worked properly by running :: - - conda activate diffpy.morph_env #if the environment isn't already active - diffpy.morph -h #get some helpful information - diffpy.morph --version + python -c "import diffpy.morph; print(diffpy.morph.__version__)" -If installed correctly, this last command should return the version -of ``diffpy.morph`` that you have installed on your system. To begin using -``diffpy.morph``, run a command like :: - diffpy.morph +To view the basic usage and available commands, type :: -where both files are text files which contain two-column data, such as ``.gr`` -or ``.cgr`` files that are produced by ``PDFgetX2``, ``PDFgetX3``, -or ``PDFgui``. File extensions other than ``.gr`` or ``.cgr``, -but with the same content structure, also work with ``diffpy.morph``. + diffpy.morph -h -Enjoy! +Getting Started +--------------- +You may consult our `online documentation `_ for tutorials and API references. Support and Contribute ---------------------- -`Diffpy user group `_ is the discussion forum for general questions and discussions about the use of diffpy.morph. Please join the diffpy.morph users community by joining the Google group. The diffpy.morph project welcomes your expertise and enthusiasm! - -If you see a bug or want to request a feature, please `report it as an issue `_ and/or `submit a fix as a PR `_. You can also post it to the `Diffpy user group `_. +If you see a bug or want to request a feature, please `report it as an issue `_ and/or `submit a fix as a PR `_. Feel free to fork the project and contribute. To install diffpy.morph in a development mode, with its sources being directly used by Python @@ -184,7 +129,7 @@ Before contributing, please read our `Code of Conduct `_ or email Simon J.L. Billinge group at sbillinge@ucsb.edu. +For more information on diffpy.morph please visit the project `web-page `_ or email the maintainers ``Simon J.L. Billinge group(simon.billinge@gmail.com)``. Acknowledgements ---------------- diff --git a/cookiecutter.json b/cookiecutter.json new file mode 100644 index 00000000..33bed68c --- /dev/null +++ b/cookiecutter.json @@ -0,0 +1,20 @@ +{ + "author_names": "Simon J.L. Billinge group", + "author_emails": "simon.billinge@gmail.com", + "maintainer_names": "Simon J.L. Billinge group", + "maintainer_emails": "simon.billinge@gmail.com", + "maintainer_github_usernames": "sbillinge", + "contributors": "Simon Billinge, Billinge Group members", + "project_name": "diffpy.morph", + "license_holders": "diffpy.morph contributors", + "github_username_or_orgname": "diffpy", + "github_repo_name": "diffpy.morph", + "conda_pypi_package_dist_name": "diffpy.morph", + "package_dir_name": "diffpy.morph", + "project_short_description": "Python package for manipulating and comparing 1D signals.", + "project_keywords": "diffpy, pdf, data interpretation", + "minimum_supported_python_version": "3.12", + "maximum_supported_python_version": "3.14", + "project_needs_c_code_compiled": "No", + "project_has_gui_tests": "No" +} diff --git a/docs/source/api/diffpy.morph.rst b/docs/source/api/diffpy.morph.rst index 0c2381a8..d78d49ad 100644 --- a/docs/source/api/diffpy.morph.rst +++ b/docs/source/api/diffpy.morph.rst @@ -1,7 +1,9 @@ :tocdepth: -1 -diffpy.morph package -==================== +|title| +======= + +.. |title| replace:: diffpy.morph package .. automodule:: diffpy.morph :members: diff --git a/docs/source/conf.py b/docs/source/conf.py index 64a5c046..c9c502b7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -38,7 +38,7 @@ sys.path.insert(0, str(Path("../../src").resolve())) # abbreviations -ab_authors = "Sangjoon Lee, Simon Billinge, Billinge Group members" +ab_authors = "Simon Billinge, Billinge Group members" # -- General configuration ------------------------------------------------ @@ -56,7 +56,7 @@ "sphinx.ext.intersphinx", "sphinx_rtd_theme", "sphinx_copybutton", - "m2r", + "m2r2", ] # Add any paths that contain templates here, relative to this directory. @@ -75,7 +75,7 @@ # General information about the project. project = "diffpy.morph" -copyright = "%Y, The Trustees of Columbia University in the City of New York" +copyright = "%Y, diffpy.morph contributors" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -145,7 +145,7 @@ "github_user": "diffpy", "github_repo": "diffpy.morph", "github_version": "main", - "conf_py_path": "/doc/source/", + "conf_py_path": "/docs/source/", } # Theme options are theme-specific and customize the look and feel of a theme diff --git a/docs/source/img/.placeholder b/docs/source/img/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/docs/source/index.rst b/docs/source/index.rst index 59936edd..c2a1cbaa 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,8 +1,10 @@ -########################## -diffpy.morph documentation -########################## +####### +|title| +####### -``diffpy.morph`` - Tools for manipulating and comparing 1D signals. +.. |title| replace:: diffpy.morph documentation + +``diffpy.morph`` - Python package for manipulating and comparing 1D signals. | Software version |release| | Last updated |today|. diff --git a/docs/source/license.rst b/docs/source/license.rst index a03a8fb8..fcae433c 100644 --- a/docs/source/license.rst +++ b/docs/source/license.rst @@ -10,6 +10,7 @@ OPEN SOURCE LICENSE AGREEMENT BSD 3-Clause License Copyright (c) 2024-2025, The Trustees of Columbia University in the City of New York. +Copyright (c) 2026, diffpy.morph contributors. All Rights Reserved. Redistribution and use in source and binary forms, with or without diff --git a/docs/source/snippets/.placeholder b/docs/source/snippets/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/news/skpkg.rst b/news/skpkg.rst new file mode 100644 index 00000000..26c2051d --- /dev/null +++ b/news/skpkg.rst @@ -0,0 +1,23 @@ +**Added:** + +* No News Added: Recut with the latest skpkg version + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/pyproject.toml b/pyproject.toml index ec58db60..4c6e3c79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,10 +6,10 @@ build-backend = "setuptools.build_meta" name = "diffpy.morph" dynamic=['version', 'dependencies'] authors = [ - { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, + {name='Simon J.L. Billinge group', email='simon.billinge@gmail.com'}, ] maintainers = [ - { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, + {name='Simon J.L. Billinge group', email='simon.billinge@gmail.com'}, ] description = "Python package for manipulating and comparing 1D signals." keywords = ['diffpy', 'pdf', 'data interpretation'] @@ -32,9 +32,6 @@ classifiers = [ 'Topic :: Scientific/Engineering :: Chemistry', ] -[project.scripts] -"diffpy.morph" = "diffpy.morph.morphapp:main" - [project.urls] Homepage = "https://github.com/diffpy/diffpy.morph/" Issues = "https://github.com/diffpy/diffpy.morph/issues/" @@ -51,6 +48,9 @@ include = ["*"] # package names should match these glob patterns (["*"] by defa exclude = [] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) +[project.scripts] +diffpy-morph = "diffpy.morph.morphapp:main" + [tool.setuptools.dynamic] dependencies = {file = ["requirements/pip.txt"]} diff --git a/requirements/docs.txt b/requirements/docs.txt index 5f34c6ed..1de813f9 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -2,4 +2,4 @@ sphinx sphinx_rtd_theme sphinx-copybutton doctr -m2r +m2r2 diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index d8e13db0..b5c872e2 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -2,6 +2,7 @@ ############################################################################## # # (c) 2025 The Trustees of Columbia University in the City of New York. +# (c) 2026 diffpy.morph contributors. # All rights reserved. # # File coded by: Billinge Group members and community contributors. diff --git a/src/diffpy/morph/__init__.py b/src/diffpy/morph/__init__.py index c2baddb1..5182dbf0 100644 --- a/src/diffpy/morph/__init__.py +++ b/src/diffpy/morph/__init__.py @@ -2,6 +2,7 @@ ############################################################################## # # (c) 2025 The Trustees of Columbia University in the City of New York. +# (c) 2026 diffpy.morph contributors. # All rights reserved. # # File coded by: Sangjoon Lee, Simon Billinge, Billinge Group members. @@ -14,9 +15,6 @@ ############################################################################## """Python package for manipulating and comparing 1D signals.""" -# key used when saving multiple morphs -__save_morph_as__ = "save_morph_as" - # package version from diffpy.morph.version import __version__ # noqa diff --git a/src/diffpy/morph/version.py b/src/diffpy/morph/version.py index f40af37f..62a436fa 100644 --- a/src/diffpy/morph/version.py +++ b/src/diffpy/morph/version.py @@ -2,9 +2,10 @@ ############################################################################## # # (c) 2025 The Trustees of Columbia University in the City of New York. +# (c) 2026 diffpy.morph contributors. # All rights reserved. # -# File coded by: Sangjoon Lee, Simon Billinge, Billinge Group members. +# File coded by:Sangjoon Lee, Simon Billinge, Billinge Group members. # # See GitHub contributions for a more detailed list of contributors. # https://github.com/diffpy/diffpy.morph/graphs/contributors # noqa: E501 @@ -18,8 +19,9 @@ # __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] # obtain version information -from importlib.metadata import version +from importlib.metadata import PackageNotFoundError, version -__version__ = version("diffpy.morph") - -# End of file +try: + __version__ = version("diffpy.morph") +except PackageNotFoundError: + __version__ = "unknown" From f9f0762f8e0b906292c2bb135d0a9fb6a9a13ee8 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Tue, 28 Jul 2026 19:22:24 +0800 Subject: [PATCH 2/8] chore: delete outdated workflow items --- .../matrix-and-codecov-on-merge-to-main.yml | 18 ------------------ .github/workflows/publish-docs.yml | 13 ------------- 2 files changed, 31 deletions(-) delete mode 100644 .github/workflows/matrix-and-codecov-on-merge-to-main.yml delete mode 100644 .github/workflows/publish-docs.yml diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml deleted file mode 100644 index 44a8a179..00000000 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: CI - -on: - release: - types: - - prereleased - - published - workflow_dispatch: - -jobs: - matrix-coverage: - uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 - with: - project: diffpy.morph - c_extension: false - headless: false - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml deleted file mode 100644 index 91ed4241..00000000 --- a/.github/workflows/publish-docs.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Deploy Documentation on Release - -on: - workflow_dispatch: - -jobs: - docs: - uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0 - with: - project: diffpy.morph - python_version: 3.13 - c_extension: false - headless: false From 8bfeae88221cf2de274983e8691e37fdbb21b201 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Tue, 28 Jul 2026 19:28:42 +0800 Subject: [PATCH 3/8] chore: add original description back --- README.rst | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 51da5613..0e65a656 100644 --- a/README.rst +++ b/README.rst @@ -36,9 +36,35 @@ .. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue :target: https://github.com/diffpy/diffpy.morph/issues -Python package for manipulating and comparing 1D signals. - -* LONGER DESCRIPTION HERE +Python package for manipulating and comparing diffraction data. + +``diffpy.morph`` is a Python software package designed to increase the insight +researchers can obtain from measured data including diffraction data +and atomic pair distribution functions +(PDFs) in a model-independent way. For example, the program was designed to help a +researcher answer the question: "Has my material undergone a phase +transition between these two measurements?" + +One approach is to compare the two diffraction patterns in a plot +and view the difference curve underneath. However, significant signal can +be seen in the difference curve from benign effects such as thermal expansion +(peak shifts) and increased thermal motion (peak broadening) or a change in +scale due to differences in incident flux, for example. ``diffpy.morph`` will +do its best to correct for these benign effects before computing and +plotting the difference curve. One measured function (typically that collected +at higher temperature) is identified as the target function and the second +function is then morphed by "stretching" (changing the r-axis to simulate a +uniform lattice expansion), "smearing" (broadening peaks through a +uniform convolution to simulate increased thermal motion), and "scaling" +(self-explanatory). ``diffpy.morph`` will vary the amplitude of the morphing +transformations to obtain the best fit between the morphed and the target +functions, then plot them on top of each other with the difference plotted +below. + +There are also a few other morphing transformations in the program. + +Finally, we note that ``diffpy.morph`` should work on other spectra, +though it has not been extensively tested beyond spectral data and the PDF. For more information about the diffpy.morph library, please consult our `online documentation `_. @@ -47,7 +73,13 @@ Citation If you use diffpy.morph in a scientific publication, we would like you to cite this package as - diffpy.morph Package, https://github.com/diffpy/diffpy.morph + Yang, A., Farrow, C. L., Juhás, P., Iglesias, L. K., Liu, C.-H., + Marks, S. D., Wall, V. R. K., Safin, J., Drewry, S. M., Myers, C., + Hanlon, D. F., Leonard, N., Petrovic, C., Jeong, A., Talapin, D. V., + Nazar, L. F., Zhou, H., Teitelbaum, S. W., van Driel, T. B., + Banerjee, S., Bozin, E. S., Toney, M. F., Page, K., Ginsberg, N. S., + and Billinge, S. J. L. (2026). *diffpy.morph: Python tools for model + independent comparisons between sets of 1D functions*. arXiv:2602.06987. Installation ------------ @@ -98,6 +130,31 @@ Getting Started You may consult our `online documentation `_ for tutorials and API references. + +USING diffpy.morph +------------------ + +For detailed instructions and full tutorial, see our `website `. + +Once the required software, including ``diffpy.morph`` is all installed, open +up a terminal and check installation has worked properly by running :: + + conda activate diffpy.morph_env #if the environment isn't already active + diffpy.morph -h #get some helpful information + diffpy.morph --version + +If installed correctly, this last command should return the version +of ``diffpy.morph`` that you have installed on your system. To begin using +``diffpy.morph``, run a command like :: + + diffpy.morph + +where both files are text files which contain two-column data, such as ``.gr`` +or ``.cgr`` files that are produced by ``PDFgetX2``, ``PDFgetX3``, +or ``PDFgui``. File extensions other than ``.gr`` or ``.cgr``, +but with the same content structure, also work with ``diffpy.morph``. + +Enjoy! Support and Contribute ---------------------- From a488365362c0171e7333bd47555386f789ae7acb Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Tue, 28 Jul 2026 19:31:23 +0800 Subject: [PATCH 4/8] cli name revert and README format revert --- README.rst | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 0e65a656..6b890068 100644 --- a/README.rst +++ b/README.rst @@ -155,6 +155,8 @@ or ``PDFgui``. File extensions other than ``.gr`` or ``.cgr``, but with the same content structure, also work with ``diffpy.morph``. Enjoy! + + Support and Contribute ---------------------- diff --git a/pyproject.toml b/pyproject.toml index 4c6e3c79..6c8e26ee 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-morph = "diffpy.morph.morphapp:main" +"diffpy.morph" = "diffpy.morph.morphapp:main" [tool.setuptools.dynamic] dependencies = {file = ["requirements/pip.txt"]} From 31eda5f16a74d3e32ad01fec8c58b0653609bff9 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Tue, 28 Jul 2026 19:35:15 +0800 Subject: [PATCH 5/8] chore:revert installation guide --- README.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 6b890068..d6a67651 100644 --- a/README.rst +++ b/README.rst @@ -102,7 +102,11 @@ 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.morph_env`` environment, type :: +To install using ``pip`` into your ``diffpy.morph_env`` environment, we will also have to install dependencies :: + + pip install -r https://raw.githubusercontent.com/diffpy/diffpy.morph/main/requirements/pip.txt + +and then install the package :: pip install diffpy.morph From 817663a13ba90ecd807469cad622c012a21196a5 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Tue, 28 Jul 2026 20:25:41 +0800 Subject: [PATCH 6/8] chore: revert key defined globally --- src/diffpy/morph/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/diffpy/morph/__init__.py b/src/diffpy/morph/__init__.py index 5182dbf0..6543105a 100644 --- a/src/diffpy/morph/__init__.py +++ b/src/diffpy/morph/__init__.py @@ -15,6 +15,10 @@ ############################################################################## """Python package for manipulating and comparing 1D signals.""" + +# key used when saving multiple morphs +__save_morph_as__ = "save_morph_as" + # package version from diffpy.morph.version import __version__ # noqa From 292fd7a713be62aec683fa4151136d3fea47d2de Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 12:26:07 +0000 Subject: [PATCH 7/8] [pre-commit.ci] auto fixes from pre-commit hooks --- src/diffpy/morph/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/diffpy/morph/__init__.py b/src/diffpy/morph/__init__.py index 6543105a..a1644f8e 100644 --- a/src/diffpy/morph/__init__.py +++ b/src/diffpy/morph/__init__.py @@ -15,7 +15,6 @@ ############################################################################## """Python package for manipulating and comparing 1D signals.""" - # key used when saving multiple morphs __save_morph_as__ = "save_morph_as" From 5a8f02ef4bff248a7892d44eef25c83d6ab94f6c Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Wed, 29 Jul 2026 13:06:18 +0800 Subject: [PATCH 8/8] chore: replace emails --- CODE-OF-CONDUCT.rst | 2 +- README.rst | 2 +- pyproject.toml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CODE-OF-CONDUCT.rst b/CODE-OF-CONDUCT.rst index 3cb14de2..25fafe27 100644 --- a/CODE-OF-CONDUCT.rst +++ b/CODE-OF-CONDUCT.rst @@ -67,7 +67,7 @@ Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -simon.billinge@gmail.com. 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. diff --git a/README.rst b/README.rst index d6a67651..5adaf051 100644 --- a/README.rst +++ b/README.rst @@ -192,7 +192,7 @@ Before contributing, please read our `Code of Conduct `_ or email the maintainers ``Simon J.L. Billinge group(simon.billinge@gmail.com)``. +For more information on diffpy.morph please visit the project `web-page `_ or email the maintainers ``Simon J.L. Billinge group(sbillinge@ucsb.edu)``. Acknowledgements ---------------- diff --git a/pyproject.toml b/pyproject.toml index 6c8e26ee..ff569a98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,10 +6,10 @@ build-backend = "setuptools.build_meta" name = "diffpy.morph" dynamic=['version', 'dependencies'] authors = [ - {name='Simon J.L. Billinge group', email='simon.billinge@gmail.com'}, + {name='Simon J.L. Billinge group', email='sbillinge@ucsb.edu'}, ] maintainers = [ - {name='Simon J.L. Billinge group', email='simon.billinge@gmail.com'}, + {name='Simon J.L. Billinge group', email='sbillinge@ucsb.edu'}, ] description = "Python package for manipulating and comparing 1D signals." keywords = ['diffpy', 'pdf', 'data interpretation']