From c1003ac5b508a01cb4af7737c53ff51032585c3b Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 24 Jun 2025 14:05:56 -0400 Subject: [PATCH 01/15] skpkg: gitignore, code of conduct updates, rm env.yml and prettierignore --- .gitignore | 1 + .prettierignore | 1 - CODE_OF_CONDUCT.rst | 2 +- environment.yml | 6 ------ 4 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 .prettierignore delete mode 100644 environment.yml diff --git a/.gitignore b/.gitignore index d418364..099e294 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__/ .Python env/ build/ +_build/ develop-eggs/ dist/ downloads/ diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 7f39add..0000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -/conda-recipe/* diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst index ff9c356..e8199ca 100644 --- a/CODE_OF_CONDUCT.rst +++ b/CODE_OF_CONDUCT.rst @@ -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. diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 680bfd9..0000000 --- a/environment.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: diffpy.srreal -channels: - - conda-forge -dependencies: - - python=3 - - pip From 63005979a5aa896e31e5763be93693176d0587d1 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 24 Jun 2025 14:08:27 -0400 Subject: [PATCH 02/15] skpkg: ignore_words.txt and pyproject.toml --- .codespell/ignore_words.txt | 3 --- pyproject.toml | 14 +++++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.codespell/ignore_words.txt b/.codespell/ignore_words.txt index 63971de..7ca2aea 100644 --- a/.codespell/ignore_words.txt +++ b/.codespell/ignore_words.txt @@ -4,9 +4,6 @@ ;; abbreviation for "materials" often used in a journal title mater -;; alternative use of socioeconomic -socio-economic - ;; Frobenius norm used in np.linalg.norm fro diff --git a/pyproject.toml b/pyproject.toml index 38694f2..840710d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,10 +6,10 @@ build-backend = "setuptools.build_meta" name = "diffpy.srreal" dynamic=['version', 'dependencies'] authors = [ - { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, + { name="Simon Billinge", email="sb2896@columbia.edu" }, ] maintainers = [ - { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, + { name="Simon Billinge", email="sb2896@columbia.edu" }, ] description = "Calculators for PDF, bond valence sum, and other quantities based on atom pair interaction." keywords = ['PDF', 'BVS', 'atom', 'overlap', 'calculator', 'real-space'] @@ -56,6 +56,11 @@ exclude-file = ".codespell/ignore_lines.txt" ignore-words = ".codespell/ignore_words.txt" skip = "*.cif,*.dat" +[tool.docformatter] +recursive = true +wrap-summaries = 72 +wrap-descriptions = 72 + [tool.black] line-length = 79 include = '\.pyi?$' @@ -78,8 +83,3 @@ exclude = ''' | tests/data )/ ''' - -[tool.docformatter] -recursive = true -wrap-summaries = 72 -wrap-descriptions = 72 From 462a18c09d2105087f9b19d11457789acead366a Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 24 Jun 2025 14:10:20 -0400 Subject: [PATCH 03/15] skpkg: github workflows dir --- .github/ISSUE_TEMPLATE/release_checklist.md | 14 +++--- .../pull_request_template.md | 15 ++++++ .../workflows/build-wheel-release-upload.yml | 4 +- .github/workflows/check-news-item.yml | 2 +- .../matrix-and-codecov-on-merge-to-main.yml | 2 +- .github/workflows/publish-docs-on-release.yml | 2 +- .github/workflows/tests-on-pr.yml | 50 +++---------------- 7 files changed, 35 insertions(+), 54 deletions(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index fa94779..6107962 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -13,30 +13,30 @@ assignees: "" - [ ] 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 the website (e.g., diffpy.org) are updated. +- [ ] 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. -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: +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: ### PyPI/GitHub full-release preparation checklist: - [ ] Create a new conda environment and install the rc from PyPI (`pip install ==??`) - [ ] License information on PyPI is correct. -- [ ] Docs are deployed successfully to `https://www.diffpy.org/`. +- [ ] Docs are deployed successfully to `https:///`. - [ ] 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. +Please let the maintainer know that all checks are done and the package is ready for full release. ### conda-forge release preparation checklist: - + - [ ] 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. +- [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions. +- [ ] Tag the maintainer for conda-forge release. ### Post-release checklist diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 0000000..1099d86 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,15 @@ +### What problem does this PR address? + + + +### What should the reviewer(s) do? + + + + diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index f751e84..caaf5a0 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -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.srreal c_extension: true - github_admin_username: sbillinge + maintainer_GITHUB_username: sbillinge secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} PAT_TOKEN: ${{ secrets.PAT_TOKEN }} diff --git a/.github/workflows/check-news-item.yml b/.github/workflows/check-news-item.yml index 2610872..88908d6 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -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.srreal diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml index ea2983b..9d2881b 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -12,7 +12,7 @@ on: jobs: matrix-coverage: - uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 + uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 with: project: diffpy.srreal c_extension: true diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml index 8daf162..108cc18 100644 --- a/.github/workflows/publish-docs-on-release.yml +++ b/.github/workflows/publish-docs-on-release.yml @@ -5,7 +5,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.srreal c_extension: true diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index ed07dd1..3deb95d 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -1,49 +1,15 @@ name: Tests on PR on: - push: - branches: - - main - - cookie pull_request: workflow_dispatch: jobs: - validate: - 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] - - steps: - - name: Check out diffpy.srreal - 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.srreal and requirements - run: | - conda install --file requirements/conda.txt - conda install --file requirements/test.txt - python -m pip install . --no-deps - - - name: Validate diffpy.pdfgui - run: pytest tests + tests-on-pr: + uses: scikit-package/release-scripts/.github/workflows/_tests-on-pr.yml@v0 + with: + project: diffpy.srreal + c_extension: true + headless: false + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From b24e60a709a0a2e25dd3d5dde8eb44f27d657f4c Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 24 Jun 2025 14:10:45 -0400 Subject: [PATCH 04/15] skpkg: change log header --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6f96d25..79c75d7 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,5 @@ ============= -Release Notes +Release notes ============= .. current developments From b84b8d87195adcef372293dabd3dff0bbaacd2b1 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 24 Jun 2025 14:11:23 -0400 Subject: [PATCH 05/15] skpkg: readme --- README.rst | 45 ++++++++++----------------------------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/README.rst b/README.rst index a6d2ff8..116f2d1 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ :target: https://diffpy.github.io/diffpy.srreal :height: 100px -|PyPi| |Forge| |PythonVersion| |PR| +|PyPI| |Forge| |PythonVersion| |PR| |CI| |Codecov| |Black| |Tracking| @@ -26,7 +26,7 @@ .. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff -.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.srreal +.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.srreal :target: https://pypi.org/project/diffpy.srreal/ .. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.srreal @@ -37,35 +37,7 @@ Calculators for PDF, bond valence sum, and other quantities based on atom pair interaction. -The diffpy.srreal package provides calculators for atomic pair distribution -function (PDF), bond valence sums (BVS), atom overlaps for a hard-sphere -model, bond distances and directions up to specified maximum distance. The -atomic structure models are represented with internal classes as non-periodic, -periodic or structures with space group symmetries. The package provides -implicit adapters from diffpy.structure classes or from Crystal or Molecule -objects from pyobjcryst. Adapters can be easily defined for any other -structure representations in Python allowing their direct use with the -calculators. Calculators support two evaluation models - BASIC, which -performs a full pair-summation every time, and OPTIMIZED, which updates only -pair contributions that have changed since the last evaluation. Calculations -can be split among parallel jobs using Python multiprocessing package or any -other library that provides parallel map function. PDF calculations can -be done in two modes - either as a real-space summation of peak profiles -(PDFCalculator) or as a reciprocal-space Debye summation and Fourier -transform of the total scattering structure function (DebyePDFCalculator). - -The diffpy.srreal package is a Python binding to the C++ library libdiffpy -(https://github.com/diffpy/libdiffpy). Calculators are created as -objects of a given calculator type and so multiple instances of the same -calculator type can exist with different configurations. Calculators are -composed of other objects that perform lower-level tasks, such as calculating -peak profile or looking up atom scattering factors. These objects can be -re-assigned at runtime allowing to easily customize the calculation procedure. -New classes can be defined using object inheritance either in Python or in C++ -and used with the existing calculators; as an example, this allows to -calculate PDF with a user-defined profile function. A new calculator class -can be also defined for any quantity that is obtained by iteration over atom -pairs, by defining only the function that processes atom-pair contributions. +* LONGER DESCRIPTION HERE For more information about the diffpy.srreal library, please consult our `online documentation `_. @@ -119,9 +91,7 @@ You may consult our `online documentation `_ is the discussion forum for general questions and discussions about the use of diffpy.srreal. Please join the diffpy.srreal users community by joining the Google group. The diffpy.srreal 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.srreal in a development mode, with its sources being directly used by Python @@ -149,4 +119,9 @@ Before contributing, please read our `Code of Conduct `_ or email Prof. Simon Billinge at sb2896@columbia.edu. +For more information on diffpy.srreal please visit the project `web-page `_ or email Simon Billinge at sb2896@columbia.edu. + +Acknowledgements +---------------- + +``diffpy.srreal`` is built and maintained with `scikit-package `_. From 741046024f223f9e7e2e63e569ece67d0dc5795a Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 24 Jun 2025 15:25:06 -0400 Subject: [PATCH 06/15] skpkg: user facing files and requirements --- .readthedocs.yaml | 13 ++++ README.rst | 30 ++++++++- doc/source/api/diffpy.srreal.devutils.rst | 20 ++++++ doc/source/conf.py | 21 +++++- doc/source/getting-started.rst | 79 +++++++++++++++++++++++ doc/source/index.rst | 10 ++- doc/source/license.rst | 2 +- requirements/docs.txt | 1 + 8 files changed, 171 insertions(+), 5 deletions(-) create mode 100644 .readthedocs.yaml create mode 100644 doc/source/api/diffpy.srreal.devutils.rst create mode 100644 doc/source/getting-started.rst diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..47f7a01 --- /dev/null +++ b/.readthedocs.yaml @@ -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 diff --git a/README.rst b/README.rst index 116f2d1..d1343cb 100644 --- a/README.rst +++ b/README.rst @@ -37,7 +37,35 @@ Calculators for PDF, bond valence sum, and other quantities based on atom pair interaction. -* LONGER DESCRIPTION HERE +The diffpy.srreal package provides calculators for atomic pair distribution +function (PDF), bond valence sums (BVS), atom overlaps for a hard-sphere +model, bond distances and directions up to specified maximum distance. The +atomic structure models are represented with internal classes as non-periodic, +periodic or structures with space group symmetries. The package provides +implicit adapters from diffpy.structure classes or from Crystal or Molecule +objects from pyobjcryst. Adapters can be easily defined for any other +structure representations in Python allowing their direct use with the +calculators. Calculators support two evaluation models - BASIC, which +performs a full pair-summation every time, and OPTIMIZED, which updates only +pair contributions that have changed since the last evaluation. Calculations +can be split among parallel jobs using Python multiprocessing package or any +other library that provides parallel map function. PDF calculations can +be done in two modes - either as a real-space summation of peak profiles +(PDFCalculator) or as a reciprocal-space Debye summation and Fourier +transform of the total scattering structure function (DebyePDFCalculator). + +The diffpy.srreal package is a Python binding to the C++ library libdiffpy +(https://github.com/diffpy/libdiffpy). Calculators are created as +objects of a given calculator type and so multiple instances of the same +calculator type can exist with different configurations. Calculators are +composed of other objects that perform lower-level tasks, such as calculating +peak profile or looking up atom scattering factors. These objects can be +re-assigned at runtime allowing to easily customize the calculation procedure. +New classes can be defined using object inheritance either in Python or in C++ +and used with the existing calculators; as an example, this allows to +calculate PDF with a user-defined profile function. A new calculator class +can be also defined for any quantity that is obtained by iteration over atom +pairs, by defining only the function that processes atom-pair contributions. For more information about the diffpy.srreal library, please consult our `online documentation `_. diff --git a/doc/source/api/diffpy.srreal.devutils.rst b/doc/source/api/diffpy.srreal.devutils.rst new file mode 100644 index 0000000..77bc079 --- /dev/null +++ b/doc/source/api/diffpy.srreal.devutils.rst @@ -0,0 +1,20 @@ +:tocdepth: -1 + +diffpy.srreal.devutils package +============================== + +.. automodule:: diffpy.srreal.devutils + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +diffpy.srreal.devutils.tunePeakPrecision module +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: diffpy.srreal.devutils.tunePeakPrecision + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/conf.py b/doc/source/conf.py index f885a7b..a05707e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -18,6 +18,12 @@ from importlib.metadata import version from pathlib import Path +# Attempt to import the version dynamically from GitHub tag. +try: + fullversion = version("diffpy.srreal") +except Exception: + fullversion = "No version found. The correct version will appear in the released version." # noqa: E501 + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use Path().resolve() to make it absolute, like shown here. @@ -43,6 +49,7 @@ "sphinx.ext.viewcode", "sphinx.ext.intersphinx", "sphinx_rtd_theme", + "sphinx_copybutton", "m2r", ] @@ -68,7 +75,6 @@ # |version| and |release|, also used in various other places throughout the # built documents. -fullversion = version(project) # The short X.Y version. version = "".join(fullversion.split(".post")[:1]) # The full version, including alpha/beta/rc tags. @@ -88,6 +94,11 @@ # substitute YEAR in the copyright string copyright = copyright.replace("%Y", year) +# For sphinx_copybutton extension. +# Do not copy "$" for shell commands in code-blocks. +copybutton_prompt_text = r"^\$ " +copybutton_prompt_is_regexp = True + # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ["build"] @@ -123,6 +134,14 @@ # html_theme = "sphinx_rtd_theme" +html_context = { + "display_github": True, + "github_user": "diffpy", + "github_repo": "diffpy.srreal", + "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. diff --git a/doc/source/getting-started.rst b/doc/source/getting-started.rst new file mode 100644 index 0000000..ac7d510 --- /dev/null +++ b/doc/source/getting-started.rst @@ -0,0 +1,79 @@ +:tocdepth: -1 + +.. index:: getting-started + +.. _getting-started: + +================ +Getting started +================ + +Here are some example templates provided to help you get started with writing your documentation. You can use these templates to create your own documentation. + +Reuse ``.rst`` files across multiple pages +------------------------------------------ + +Here is how you can reuse a reusable block of ``.rst`` files across multiple pages: + +.. include:: snippets/example-table.rst + +.. warning:: + + Ensure that the ``.rst`` file you are including is not too long. If it is too long, it may be better to split it into multiple files and include them separately. + +Refer to a specific section in the documentation +------------------------------------------------ + +You can use the ``ref`` tag to refer to a specific section in the documentation. For example, you can refer to the section below using the ``:ref:`` tag as shown :ref:`here `. + +.. note:: + + Please check the raw ``.rst`` file of this page to see the exact use of the ``:ref:`` tag. + +Embed your code snippets in the documentation +--------------------------------------------- + +Here is how you can write a block of code in the documentation. You can use the ``code-block`` directive to write a block of code in the documentation. For example, you can write a block of code as shown below: + +.. code-block:: bash + + # Create a new environment, without build dependencies (pure Python package) + conda create -n -env python=3.13 \ + --file requirements/test.txt \ + --file requirements/conda.txt + + # Create a new environment, with build dependencies (non-pure Python package) + conda create -n -env python=3.13 \ + --file requirements/test.txt \ + --file requirements/conda.txt \ + --file requirements/build.txt + + # Activate the environment + conda activate _env + + # Install your package locally + # `--no-deps` to NOT install packages again from `requirements.pip.txt` + pip install -e . --no-deps + + # Run pytest locally + pytest + + # ... run example tutorials + +.. _attach-image: + +Attach an image to the documentation +------------------------------------ + +Here is how you attach an image to the documentation. The ``/doc/source/img/scikit-package-logo-text.png`` example image is provided in the template. + +.. image:: ./img/scikit-package-logo-text.png + :alt: codecov-in-pr-comment + :width: 400px + :align: center + + +Other useful directives +----------------------- + +Here is how you can do menu selection :menuselection:`Admin --> Settings` and display labels for buttons like :guilabel:`Privacy level`. diff --git a/doc/source/index.rst b/doc/source/index.rst index 2c063df..1b845f1 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -4,9 +4,9 @@ .. |title| replace:: diffpy.srreal documentation -diffpy.srreal - Calculators for PDF, bond valence sum, and other quantities based on atom pair interaction. +``diffpy.srreal`` - Calculators for PDF, bond valence sum, and other quantities based on atom pair interaction. -| Software version |release|. +| Software version |release| | Last updated |today|. The diffpy.srreal package provides calculators for atomic pair distribution @@ -66,6 +66,12 @@ Installation See the `README `_ file included with the distribution. +================ +Acknowledgements +================ + +``diffpy.srreal`` is built and maintained with `scikit-package `_. + ================= Table of contents ================= diff --git a/doc/source/license.rst b/doc/source/license.rst index dfdea74..03c1eae 100644 --- a/doc/source/license.rst +++ b/doc/source/license.rst @@ -22,7 +22,7 @@ Copyright (c) 2008-2012, The Trustees of Columbia University in the City of New Copyright (c) 2014-2019, Brookhaven Science Associates, Brookhaven National Laboratory -Copyright (c) 2024, The Trustees of Columbia University in the City of New York. +Copyright (c) 2025, The Trustees of Columbia University in the City of New York. All rights reserved. The "DiffPy-CMI" is distributed subject to the following license conditions: diff --git a/requirements/docs.txt b/requirements/docs.txt index ab17b1c..5f34c6e 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,4 +1,5 @@ sphinx sphinx_rtd_theme +sphinx-copybutton doctr m2r From e2e5e0d888ac3ec786ccfb95c5d90fc2c8b8a6d4 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 24 Jun 2025 15:25:54 -0400 Subject: [PATCH 07/15] chore: news --- news/skpkg-migration.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/skpkg-migration.rst diff --git a/news/skpkg-migration.rst b/news/skpkg-migration.rst new file mode 100644 index 0000000..b0ec659 --- /dev/null +++ b/news/skpkg-migration.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Support ``scikit-package`` Level 5 standard (https://scikit-package.github.io/scikit-package/). + +**Security:** + +* From 830af7d0aaba334e47be516c5175410a0e25d2d5 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 24 Jun 2025 15:27:53 -0400 Subject: [PATCH 08/15] chore: add diffpy user group to readme --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index d1343cb..280fa60 100644 --- a/README.rst +++ b/README.rst @@ -119,6 +119,8 @@ You may consult our `online documentation `_ is the discussion forum for general questions and discussions about the use of diffpy.srreal. Please join the diffpy.srreal users community by joining the Google group. The diffpy.srreal 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 `_. Feel free to fork the project and contribute. To install diffpy.srreal From f2e0ddcbb79eb38b67cde4c5be44257b2582022c Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 24 Jun 2025 15:28:57 -0400 Subject: [PATCH 09/15] chore: more diffpy user group in readme --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 280fa60..502f323 100644 --- a/README.rst +++ b/README.rst @@ -121,7 +121,7 @@ Support and Contribute `Diffpy user group `_ is the discussion forum for general questions and discussions about the use of diffpy.srreal. Please join the diffpy.srreal users community by joining the Google group. The diffpy.srreal 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 `_. +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 `_. Feel free to fork the project and contribute. To install diffpy.srreal in a development mode, with its sources being directly used by Python From ad73cb4302f4c671dd121437c0af8921dcffcf28 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 24 Jun 2025 15:38:23 -0400 Subject: [PATCH 10/15] chore: fix typo --- doc/source/api/diffpy.srreal.devutils.rst | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 doc/source/api/diffpy.srreal.devutils.rst diff --git a/doc/source/api/diffpy.srreal.devutils.rst b/doc/source/api/diffpy.srreal.devutils.rst deleted file mode 100644 index 77bc079..0000000 --- a/doc/source/api/diffpy.srreal.devutils.rst +++ /dev/null @@ -1,20 +0,0 @@ -:tocdepth: -1 - -diffpy.srreal.devutils package -============================== - -.. automodule:: diffpy.srreal.devutils - :members: - :undoc-members: - :show-inheritance: - -Submodules ----------- - -diffpy.srreal.devutils.tunePeakPrecision module -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. automodule:: diffpy.srreal.devutils.tunePeakPrecision - :members: - :undoc-members: - :show-inheritance: From ea1c8886a695ad3401e0e439b5793ddf96e5a4f8 Mon Sep 17 00:00:00 2001 From: Caden Myers <158210249+cadenmyers13@users.noreply.github.com> Date: Tue, 24 Jun 2025 16:32:33 -0400 Subject: [PATCH 11/15] chore: revert tests-on-pr.yml back to original --- .github/workflows/tests-on-pr.yml | 48 +++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 3deb95d..b4d3a35 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -1,15 +1,47 @@ name: Tests on PR on: + push: + branches: + - main + - cookie pull_request: workflow_dispatch: jobs: - tests-on-pr: - uses: scikit-package/release-scripts/.github/workflows/_tests-on-pr.yml@v0 - with: - project: diffpy.srreal - c_extension: true - headless: false - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + validate: + 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] + + steps: + - name: Check out diffpy.srreal + 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.srreal and requirements + run: | + conda install --file requirements/conda.txt + conda install --file requirements/test.txt + python -m pip install . --no-deps + - name: Validate diffpy.pdfgui + run: pytest tests From ac8a64d93db06c5c39556c063a46c3a94e1428f5 Mon Sep 17 00:00:00 2001 From: Caden Myers <158210249+cadenmyers13@users.noreply.github.com> Date: Tue, 24 Jun 2025 16:33:42 -0400 Subject: [PATCH 12/15] chore: add blank lines --- .github/workflows/tests-on-pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index b4d3a35..c877fd3 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -38,10 +38,12 @@ jobs: run: >- conda config --set always_yes yes --set changeps1 no + - name: Install diffpy.srreal and requirements run: | conda install --file requirements/conda.txt conda install --file requirements/test.txt python -m pip install . --no-deps + - name: Validate diffpy.pdfgui run: pytest tests From 62b83e558e788a565a687c335f524d8736e4b057 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 20:33:57 +0000 Subject: [PATCH 13/15] [pre-commit.ci] auto fixes from pre-commit hooks --- .github/workflows/tests-on-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index c877fd3..ed07dd1 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -38,12 +38,12 @@ jobs: run: >- conda config --set always_yes yes --set changeps1 no - + - name: Install diffpy.srreal and requirements run: | conda install --file requirements/conda.txt conda install --file requirements/test.txt python -m pip install . --no-deps - + - name: Validate diffpy.pdfgui run: pytest tests From 1488319ae8e95f2c6e4956593d49474b6918b86c Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 25 Jun 2025 11:02:35 -0400 Subject: [PATCH 14/15] ci: configure tests-on-pr.yml to run without environment.yml --- .github/workflows/tests-on-pr.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index ed07dd1..e554678 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -28,22 +28,25 @@ jobs: - 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 - + run: | + conda config --add channels conda-forge - name: Install diffpy.srreal and requirements run: | - conda install --file requirements/conda.txt - conda install --file requirements/test.txt + conda create -n test python=${{ matrix.python-version }} -y + source $(conda info --base)/etc/profile.d/conda.sh + conda activate test + conda install pip -y + conda config --set always_yes yes --set changeps1 no + conda install --file requirements/conda.txt -y + conda install --file requirements/test.txt -y python -m pip install . --no-deps - name: Validate diffpy.pdfgui - run: pytest tests + run: | + source $(conda info --base)/etc/profile.d/conda.sh + conda activate test + pytest tests From e4a27007819d3799e2df00a90c569f55abaf795e Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 25 Jun 2025 12:38:59 -0400 Subject: [PATCH 15/15] skpkg: remove getting-started.rst --- doc/source/getting-started.rst | 79 ---------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 doc/source/getting-started.rst diff --git a/doc/source/getting-started.rst b/doc/source/getting-started.rst deleted file mode 100644 index ac7d510..0000000 --- a/doc/source/getting-started.rst +++ /dev/null @@ -1,79 +0,0 @@ -:tocdepth: -1 - -.. index:: getting-started - -.. _getting-started: - -================ -Getting started -================ - -Here are some example templates provided to help you get started with writing your documentation. You can use these templates to create your own documentation. - -Reuse ``.rst`` files across multiple pages ------------------------------------------- - -Here is how you can reuse a reusable block of ``.rst`` files across multiple pages: - -.. include:: snippets/example-table.rst - -.. warning:: - - Ensure that the ``.rst`` file you are including is not too long. If it is too long, it may be better to split it into multiple files and include them separately. - -Refer to a specific section in the documentation ------------------------------------------------- - -You can use the ``ref`` tag to refer to a specific section in the documentation. For example, you can refer to the section below using the ``:ref:`` tag as shown :ref:`here `. - -.. note:: - - Please check the raw ``.rst`` file of this page to see the exact use of the ``:ref:`` tag. - -Embed your code snippets in the documentation ---------------------------------------------- - -Here is how you can write a block of code in the documentation. You can use the ``code-block`` directive to write a block of code in the documentation. For example, you can write a block of code as shown below: - -.. code-block:: bash - - # Create a new environment, without build dependencies (pure Python package) - conda create -n -env python=3.13 \ - --file requirements/test.txt \ - --file requirements/conda.txt - - # Create a new environment, with build dependencies (non-pure Python package) - conda create -n -env python=3.13 \ - --file requirements/test.txt \ - --file requirements/conda.txt \ - --file requirements/build.txt - - # Activate the environment - conda activate _env - - # Install your package locally - # `--no-deps` to NOT install packages again from `requirements.pip.txt` - pip install -e . --no-deps - - # Run pytest locally - pytest - - # ... run example tutorials - -.. _attach-image: - -Attach an image to the documentation ------------------------------------- - -Here is how you attach an image to the documentation. The ``/doc/source/img/scikit-package-logo-text.png`` example image is provided in the template. - -.. image:: ./img/scikit-package-logo-text.png - :alt: codecov-in-pr-comment - :width: 400px - :align: center - - -Other useful directives ------------------------ - -Here is how you can do menu selection :menuselection:`Admin --> Settings` and display labels for buttons like :guilabel:`Privacy level`.