Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b23c4bb
skpkg: skpkg update without manual edits
stevenhua0320 Nov 19, 2025
5ea24ed
fix: fix author and required variable back.
stevenhua0320 Nov 19, 2025
1ab04ae
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 19, 2025
36c2e74
Merge pull request #149 from stevenhua0320/scikit-update
sbillinge Nov 20, 2025
d6fc863
skpkg: add CHAGELOG.rst, README.rst, license, update pyproject.toml
stevenhua0320 Nov 20, 2025
a0d4c2c
chore: Add instructions back to README.rst and revert history of CHAN…
stevenhua0320 Nov 20, 2025
f795440
chore: add activate for env to make consistent.
stevenhua0320 Nov 20, 2025
3d87783
Merge pull request #150 from stevenhua0320/scikit-update-2
sbillinge Nov 20, 2025
eae357e
skpkg: change version build file.
stevenhua0320 Nov 20, 2025
8b93472
skpkg: package update command with no manual edits.
stevenhua0320 Nov 21, 2025
f7bc156
fix: revert setup.py and conftest.py to original
stevenhua0320 Nov 21, 2025
a8689bf
chore: add docstring back to setup.py
stevenhua0320 Nov 21, 2025
7293c68
fix: change import directory
stevenhua0320 Nov 21, 2025
3acf21e
fix: revert the get release date function.
stevenhua0320 Nov 21, 2025
3ec420e
revert the import of redirect_stdout
stevenhua0320 Nov 21, 2025
07635d0
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 21, 2025
ce19194
chore: suppress flake8 since it is used in C++
stevenhua0320 Nov 21, 2025
2900590
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Nov 21, 2025
d352c09
fix: revert original code to import
stevenhua0320 Nov 22, 2025
a6c0e0f
Merge pull request #151 from stevenhua0320/scikit-update-3
sbillinge Nov 22, 2025
122fecf
chore: delete duplicated file
stevenhua0320 Nov 22, 2025
689af53
Merge pull request #152 from stevenhua0320/delete-replicate
sbillinge Nov 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# As of now, flake8 does not natively support configuration via pyproject.toml
# https://github.com/microsoft/vscode-flake8/issues/135
[flake8]
exclude =
.git,
__pycache__,
build,
dist,
doc/source/conf.py
docs/source/conf.py
max-line-length = 115
# Ignore some style 'errors' produced while formatting by 'black'
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Please let the maintainer know that all checks are done and the package is ready
<!-- After the maintainer releases the PyPI package, please check the following when creating a PR for conda-forge release.-->

- [ ] 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.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-wheel-release-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml

jobs:
release:
build-release:
uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
with:
project: diffpy.pdffit2
Expand Down
1 change: 1 addition & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[settings]
# Keep import statement below line_length character limit
line_length = 115
multi_line_output = 3
include_trailing_comma = True
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ python:
- requirements: requirements/docs.txt

sphinx:
configuration: doc/source/conf.py
configuration: docs/source/conf.py
File renamed without changes.
52 changes: 23 additions & 29 deletions LICENSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,26 @@ For more information please visit the project web-page:
or email Prof. Simon Billinge at sb2896@columbia.edu

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS". COPYRIGHT HOLDER
EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS, ADEQUACY OR SUITABILITY
FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF FREEDOM FROM
INFRINGEMENT OF ANY DOMESTIC OR FOREIGN PATENT, COPYRIGHTS, TRADE
SECRETS OR OTHER PROPRIETARY RIGHTS OF ANY PARTY. IN NO EVENT SHALL
COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE OR RELATING TO THIS AGREEMENT, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13 changes: 8 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
:target: https://anaconda.org/conda-forge/diffpy.pdffit2

.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
:target: https://github.com/diffpy/diffpy.pdffit2/pulls

.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.pdffit2
:target: https://pypi.org/project/diffpy.pdffit2/
Expand Down Expand Up @@ -116,16 +117,18 @@ Install pdffit2 using ``pip`` to download and install the latest version from `P

pip install diffpy.pdffit2

To confirm that the installation was successful, type ::

python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)"

If you prefer to install from sources, after installing the dependencies, obtain the source archive from
`GitHub <https://github.com/diffpy/diffpy.pdffit2/>`_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory
and run the following ::

pip install .


You can type the following command to verify the installation is successful. ::

python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)"


Getting Started
---------------

Expand Down Expand Up @@ -170,7 +173,7 @@ trying to commit again.

Improvements and fixes are always appreciated.

Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.pdffit2/blob/main/CODE_OF_CONDUCT.rst>`_.
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.pdffit2/blob/main/CODE-OF-CONDUCT.rst>`_.

Contact
-------
Expand Down
18 changes: 18 additions & 0 deletions cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"maintainer_name": "Simon Billinge",
"maintainer_email": "sb2896@columbia.edu",
"maintainer_github_username": "sbillinge",
"contributors": "Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members",
"license_holders": "The Trustees of Columbia University in the City of New York",
"project_name": "diffpy.pdffit2",
"github_username_or_orgname": "diffpy",
"github_repo_name": "diffpy.pdffit2",
"conda_pypi_package_dist_name": "diffpy.pdffit2",
"package_dir_name": "diffpy.pdffit2",
"project_short_description": "PDFfit2 - real space structure refinement program.",
"project_keywords": "PDF, structure refinement",
"minimum_supported_python_version": "3.11",
"maximum_supported_python_version": "3.13",
"project_needs_c_code_compiled": "Yes",
"project_has_gui_tests": "No"
}
13 changes: 7 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# diffpy.pdffit2 documentation build configuration file, created by
# diffpy.pdffit2 documentation build configuration file, created by # noqa: E501
# sphinx-quickstart on Thu Jan 30 15:49:41 2014.
#
# This file is execfile()d with the current directory set to its
Expand All @@ -22,17 +22,19 @@
try:
fullversion = version("diffpy.pdffit2")
except Exception:
fullversion = "No version found. The correct version will appear in the released version."
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.
# documentation root, use Path().resolve() to make it absolute, like shown here. # noqa: E501
# sys.path.insert(0, str(Path(".").resolve()))
sys.path.insert(0, str(Path("../..").resolve()))
sys.path.insert(0, str(Path("../../src").resolve()))

# abbreviations
ab_authors = "Billinge group and community members."
ab_authors = (
"Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members"
)

# -- General configuration ------------------------------------------------

Expand All @@ -56,7 +58,6 @@
autodoc_mock_imports = [
"diffpy.pdffit2.pdffit2",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down Expand Up @@ -144,7 +145,7 @@
"github_user": "diffpy",
"github_repo": "diffpy.pdffit2",
"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
Expand Down
52 changes: 23 additions & 29 deletions docs/source/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,26 @@ For more information please visit the project web-page:
or email Prof. Simon Billinge at sb2896@columbia.edu

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS". COPYRIGHT HOLDER
EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS, ADEQUACY OR SUITABILITY
FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF FREEDOM FROM
INFRINGEMENT OF ANY DOMESTIC OR FOREIGN PATENT, COPYRIGHTS, TRADE
SECRETS OR OTHER PROPRIETARY RIGHTS OF ANY PARTY. IN NO EVENT SHALL
COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE OR RELATING TO THIS AGREEMENT, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,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-pdffit2 = "diffpy.pdffit2_app:main"

[tool.setuptools.dynamic]
dependencies = {file = ["requirements/pip.txt"]}

Expand Down
10 changes: 0 additions & 10 deletions src/diffpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,3 @@
# See LICENSE.rst for license information.
#
##############################################################################
"""diffpy - tools for structure analysis by diffraction.

Blank namespace package for module diffpy."""


from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)

# End of file
33 changes: 33 additions & 0 deletions src/diffpy/pdffit2/pdffit2_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import argparse

from diffpy.pdffit2.version import __version__ # noqa


def main():
parser = argparse.ArgumentParser(
prog="diffpy.pdffit2",
description=(
"PDFfit2 - real space structure refinement program.\n\n"
"For more information, visit: "
"https://github.com/diffpy/diffpy.pdffit2/"
),
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.pdffit2 {__version__}")
else:
# Default behavior when no arguments are given
parser.print_help()


if __name__ == "__main__":
main()
17 changes: 11 additions & 6 deletions src/diffpy/pdffit2/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@
# File coded by: Billinge Group members and community contributors.
#
# See GitHub contributions for a more detailed list of contributors.
# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors
# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors # noqa: E501
#
# See LICENSE.rst for license information.
#
##############################################################################
"""Definition of __version__."""

# We do not use the other three variables, but can be added back if needed.
# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"]

import datetime
import json
import urllib.request
from importlib.metadata import version

# obtain version information
from importlib.metadata import PackageNotFoundError, version
from pathlib import Path


Expand Down Expand Up @@ -57,9 +62,9 @@ def get_pypi_release_date(package_name, timeout=5):
return str(release_date)


__version__ = version("diffpy.pdffit2")
__date__ = get_pypi_release_date("diffpy.pdffit2")

# End of file

# Release date: 2025-02-07
try:
__version__ = version("diffpy.pdffit2")
except PackageNotFoundError:
__version__ = "unknown"
3 changes: 2 additions & 1 deletion tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import pytest

from diffpy.pdffit2 import PdfFit, pdffit2
from diffpy.pdffit2 import pdffit2
from diffpy.pdffit2.pdffit import PdfFit


class read_structExceptions(unittest.TestCase):
Expand Down
3 changes: 2 additions & 1 deletion tests/test_pdffit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import pytest

from diffpy.pdffit2 import PdfFit, pdffit2
from diffpy.pdffit2 import pdffit2
from diffpy.pdffit2.pdffit import PdfFit
from diffpy.structure import loadStructure

# ----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/test_phase_fractions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest

from diffpy.pdffit2 import PdfFit
from diffpy.pdffit2.pdffit import PdfFit


##############################################################################
Expand Down
3 changes: 2 additions & 1 deletion tests/test_shape_factors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import numpy
import pytest

from diffpy.pdffit2 import PdfFit, pdffit2
from diffpy.pdffit2 import pdffit2
from diffpy.pdffit2.pdffit import PdfFit


def spherefactor(r, d):
Expand Down
Loading
Loading