diff --git a/.codecov.yml b/.codecov.yml index 5a94096e..4af5eb24 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,14 +1,14 @@ coverage: status: - project: # more options at https://docs.codecov.com/docs/commit-status + project: # more options at https://docs.codecov.com/docs/commit-status default: target: auto # use the coverage from the base commit, fail if coverage is lower - threshold: 0% # allow the coverage to drop by + threshold: 0% # allow the coverage to drop by comment: layout: " diff, flags, files" behavior: default require_changes: false - require_base: false # [true :: must have a base report to post] - require_head: false # [true :: must have a head report to post] + require_base: false # [true :: must have a base report to post] + require_head: false # [true :: must have a head report to post] hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage] diff --git a/.flake8 b/.flake8 index 5a56eddd..7b2865c1 100644 --- a/.flake8 +++ b/.flake8 @@ -1,3 +1,5 @@ +# As of now, flake8 does not natively support configuration via pyproject.toml +# https://github.com/microsoft/vscode-flake8/issues/135 [flake8] exclude = .git, diff --git a/.github/ISSUE_TEMPLATE/release_checklist.md b/.github/ISSUE_TEMPLATE/release_checklist.md index 0f560278..6107962c 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.md +++ b/.github/ISSUE_TEMPLATE/release_checklist.md @@ -6,30 +6,41 @@ labels: "release" assignees: "" --- -### PyPI/GitHub release checklist: +### PyPI/GitHub rc-release preparation checklist: - [ ] 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. -- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated. + 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 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: -### conda-forge release checklist: +### 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:///`. +- [ ] Successfully run all tests, tutorial examples or do functional testing. +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. -- [ ] All relevant issues in the feedstock are addressed in the release PR. +- [ ] 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 -- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. -- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. +- [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. +- [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. 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 00000000..1099d862 --- /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 cd49342e..27fe04c1 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -4,15 +4,15 @@ on: workflow_dispatch: push: tags: - - '*' # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml + - "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml 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.morph - github_admin_username: sbillinge - + c_extension: false + 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 d672d34d..b999887f 100644 --- a/.github/workflows/check-news-item.yml +++ b/.github/workflows/check-news-item.yml @@ -3,10 +3,10 @@ name: Check for News on: pull_request_target: branches: - - main + - main 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.morph 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 4a5af435..cc9611df 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.morph c_extension: false diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml new file mode 100644 index 00000000..f58afea8 --- /dev/null +++ b/.github/workflows/publish-docs-on-release.yml @@ -0,0 +1,12 @@ +name: Deploy Documentation on Release + +on: + workflow_dispatch: + +jobs: + docs: + uses: scikit-package/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 + with: + project: diffpy.morph + c_extension: false + headless: false diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 8d0a909f..9d7879ea 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -1,15 +1,12 @@ name: Tests on PR on: - push: - branches: - - main pull_request: workflow_dispatch: jobs: tests-on-pr: - uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0 + uses: scikit-package/release-scripts/.github/workflows/_tests-on-pr.yml@v0 with: project: diffpy.morph c_extension: false diff --git a/.gitignore b/.gitignore index a25212ea..099e2948 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__/ .Python env/ build/ +_build/ develop-eggs/ dist/ downloads/ @@ -90,10 +91,3 @@ target/ # Ipython Notebook .ipynb_checkpoints - -# version information -setup.cfg -/src/diffpy/*/version.cfg - -# Rever -rever/ diff --git a/.isort.cfg b/.isort.cfg index 6d831957..86f162b8 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,4 +1,5 @@ [settings] +# Keep import statement below line_length character limit line_length = 79 multi_line_output = 3 include_trailing_comma = True diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9cf0556f..0e4a84d1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,14 @@ default_language_version: - python: python3 + python: python3 ci: - autofix_commit_msg: | - [pre-commit.ci] auto fixes from pre-commit hooks - autofix_prs: true - autoupdate_branch: 'pre-commit-autoupdate' - autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' - autoupdate_schedule: monthly - skip: [no-commit-to-branch] - submodules: false + autofix_commit_msg: | + [pre-commit.ci] auto fixes from pre-commit hooks + autofix_prs: true + autoupdate_branch: "pre-commit-autoupdate" + autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate" + autoupdate_schedule: monthly + skip: [no-commit-to-branch] + submodules: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 @@ -47,6 +47,20 @@ repos: - repo: https://github.com/codespell-project/codespell rev: v2.3.0 hooks: - - id: codespell - additional_dependencies: - - tomli + - id: codespell + additional_dependencies: + - tomli + # prettier - multi formatter for .json, .yml, and .md files + - repo: https://github.com/pre-commit/mirrors-prettier + rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8 + hooks: + - id: prettier + additional_dependencies: + - "prettier@^3.2.4" + # docformatter - PEP 257 compliant docstring formatter + - repo: https://github.com/s-weigand/docformatter + rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c + hooks: + - id: docformatter + additional_dependencies: [tomli] + args: [--in-place, --config, ./pyproject.toml] diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..47f7a017 --- /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/AUTHORS.rst b/AUTHORS.rst index d9f94cb0..f7aca6d3 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -1,5 +1,5 @@ Authors -======== +======= Billinge Group and community contributors. diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ab9d9273..81011da6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,5 @@ ============= -Release Notes +Release notes ============= .. current developments diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst index ff9c3561..e8199ca5 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/LICENSE.rst b/LICENSE.rst index 95a04ac9..748d7e06 100644 --- a/LICENSE.rst +++ b/LICENSE.rst @@ -1,7 +1,6 @@ BSD 3-Clause License -Copyright (c) 2024, The Trustees of Columbia University -in the City of New York. +Copyright (c) 2024-2025, The Trustees of Columbia University in the City of New York. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.rst b/README.rst index 4c54d9b6..ec134b6c 100644 --- a/README.rst +++ b/README.rst @@ -1,11 +1,14 @@ -|Icon| `diffpy.morph `_ -============================================================== +|Icon| |title|_ +=============== + +.. |title| replace:: diffpy.morph +.. _title: https://diffpy.github.io/diffpy.morph .. |Icon| image:: https://avatars.githubusercontent.com/diffpy :target: https://diffpy.github.io/diffpy.morph :height: 100px -|PyPi| |Forge| |PythonVersion| |PR| +|PyPI| |Forge| |PythonVersion| |PR| |CI| |Codecov| |Black| |Tracking| @@ -23,7 +26,7 @@ .. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff -.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.morph +.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.morph :target: https://pypi.org/project/diffpy.morph/ .. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.morph @@ -32,7 +35,7 @@ .. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue :target: https://github.com/diffpy/diffpy.morph/issues -Tools for manipulating and comparing PDF profiles +Python package for manipulating and comparing PDF profiles ``diffpy.morph`` is a Python software package designed to increase the insight researchers can obtain from measured atomic pair distribution functions @@ -107,11 +110,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:: +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. +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 `_. @@ -174,7 +177,7 @@ in a development mode, with its sources being directly used by Python rather than copied to a package directory, use the following in the root directory :: - pip install -e . + pip install -e . To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit hooks. @@ -195,4 +198,9 @@ Before contributing, please read our `Code of Conduct `_ or email Prof. Simon Billinge at sb2896@columbia.edu. +For more information on diffpy.morph please visit the project `web-page `_ or email Simon J.L. Billinge group at sb2896@columbia.edu. + +Acknowledgements +---------------- + +``diffpy.morph`` is built and maintained with `scikit-package `_. diff --git a/doc/manual/images/morph_ex1.png b/doc/manual/images/morph_ex1.png index 76b59b3d..109b40fb 100644 Binary files a/doc/manual/images/morph_ex1.png and b/doc/manual/images/morph_ex1.png differ diff --git a/doc/manual/images/nacl_example.agr b/doc/manual/images/nacl_example.agr index 95f6b17b..4a7e1af9 100644 Binary files a/doc/manual/images/nacl_example.agr and b/doc/manual/images/nacl_example.agr differ diff --git a/doc/manual/images/nacl_example.png b/doc/manual/images/nacl_example.png new file mode 100644 index 00000000..4c8742e8 Binary files /dev/null and b/doc/manual/images/nacl_example.png differ diff --git a/doc/manual/images/nacl_example.xcf b/doc/manual/images/nacl_example.xcf deleted file mode 100644 index 228931a0..00000000 Binary files a/doc/manual/images/nacl_example.xcf and /dev/null differ diff --git a/doc/manual/pdfmorph.pdf b/doc/manual/pdfmorph.pdf index 779e49f4..da02eb9c 100644 Binary files a/doc/manual/pdfmorph.pdf and b/doc/manual/pdfmorph.pdf differ diff --git a/doc/source/conf.py b/doc/source/conf.py index aad111d5..badd3318 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# diffpy.morph documentation build configuration file, created by +# diffpy.morph 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 @@ -18,17 +18,21 @@ from importlib.metadata import version from pathlib import Path -autodoc_mock_imports = [ - "diffpy.utils", -] +# Attempt to import the version dynamically from GitHub tag. +try: + fullversion = version("diffpy.morph") +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. +# 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 members and community contributors" +sys.path.insert(0, str(Path("../../src").resolve())) + +# abbreviations +ab_authors = "Sangjoon Lee, Simon Billinge, Billinge Group members" # -- General configuration ------------------------------------------------ @@ -45,6 +49,7 @@ "sphinx.ext.viewcode", "sphinx.ext.intersphinx", "sphinx_rtd_theme", + "sphinx_copybutton", "m2r", ] @@ -70,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. @@ -90,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"] @@ -125,6 +134,14 @@ # html_theme = "sphinx_rtd_theme" +html_context = { + "display_github": True, + "github_user": "diffpy", + "github_repo": "diffpy.morph", + "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/index.rst b/doc/source/index.rst index 9044436d..ee85d452 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1,10 +1,10 @@ -############################################# +####### diffpy.morph documentation -############################################# +####### -diffpy.morph - Tools for manipulating and comparing diffraction data. +``diffpy.morph`` - Tools for manipulating and comparing PDF profiles -| Software version |release|. +| Software version |release| | Last updated |today|. Introduction @@ -41,15 +41,14 @@ that are not PDFs, it has not been extensively tested beyond the PDF. To get started, please visit the :ref:`quick_start`. -======== +======= Authors -======== +======= ``diffpy.morph`` is developed by members of the Billinge Group at Columbia University and Brookhaven National Laboratory including Christopher L. Farrow, Christopher J. Wright, Pavol Juhás, Chia-Hao (Timothy) Liu, Andrew Yang, and Simon J. L. Billinge. - For a detailed list of contributors see https://github.com/diffpy/diffpy.morph/graphs/contributors. @@ -60,6 +59,12 @@ Installation See the `README `_ file included with the distribution. +================ +Acknowledgements +================ + +``diffpy.morph`` is built and maintained with `scikit-package `_. + ================= Table of contents ================= @@ -71,9 +76,9 @@ Table of contents release Package API -======== +======= Indices -======== +======= * :ref:`genindex` * :ref:`search` diff --git a/doc/source/license.rst b/doc/source/license.rst index 9ae52a98..a03a8fb8 100644 --- a/doc/source/license.rst +++ b/doc/source/license.rst @@ -9,8 +9,7 @@ OPEN SOURCE LICENSE AGREEMENT ============================= BSD 3-Clause License -Copyright (c) 2024, The Trustees of Columbia University in -the City of New York. +Copyright (c) 2024-2025, The Trustees of Columbia University in the City of New York. All Rights Reserved. Redistribution and use in source and binary forms, with or without diff --git a/news/diffpy_morph.rst b/news/diffpy_morph.rst index 52beb663..32740fb1 100644 --- a/news/diffpy_morph.rst +++ b/news/diffpy_morph.rst @@ -1,23 +1,23 @@ -**Added:** - -* - -**Changed:** - -* Renamed PDFmorph to diffpy.morph - -**Deprecated:** - -* - -**Removed:** - -* - -**Fixed:** - -* - -**Security:** - -* +**Added:** + +* + +**Changed:** + +* Renamed PDFmorph to diffpy.morph + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/news/doc.rst b/news/doc.rst new file mode 100644 index 00000000..b0ec659f --- /dev/null +++ b/news/doc.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Support ``scikit-package`` Level 5 standard (https://scikit-package.github.io/scikit-package/). + +**Security:** + +* diff --git a/requirements/build.txt b/requirements/build.txt deleted file mode 100644 index f72d870d..00000000 --- a/requirements/build.txt +++ /dev/null @@ -1,2 +0,0 @@ -python -setuptools diff --git a/requirements/docs.txt b/requirements/docs.txt index ab17b1c8..5f34c6ed 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,4 +1,5 @@ sphinx sphinx_rtd_theme +sphinx-copybutton doctr m2r diff --git a/requirements/test.txt b/requirements/test.txt index f33bd0e3..a7277865 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -2,5 +2,5 @@ flake8 pytest codecov coverage -pytest-env pytest-cov +pytest-env diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 38fef756..d8e13db0 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -1,25 +1,14 @@ #!/usr/bin/env python ############################################################################## # -# (c) 2024 The Trustees of Columbia University in the City of New York. +# (c) 2025 The Trustees of Columbia University in the City of New York. # All rights reserved. # # File coded by: Billinge Group members and community contributors. # # See GitHub contributions for a more detailed list of contributors. -# https://github.com/diffpy/diffpy.pdfmorph/graphs/contributors +# https://github.com/diffpy/diffpy.morph/graphs/contributors # # See LICENSE.rst for license information. # ############################################################################## - -"""morph - tools for manipulating and comparing PDF data. - -""" - - -from pkgutil import extend_path - -__path__ = extend_path(__path__, __name__) - -# End of file diff --git a/src/diffpy/morph/__init__.py b/src/diffpy/morph/__init__.py index b1006e3c..48455828 100644 --- a/src/diffpy/morph/__init__.py +++ b/src/diffpy/morph/__init__.py @@ -1,10 +1,10 @@ #!/usr/bin/env python ############################################################################## # -# (c) 2024 The Trustees of Columbia University in the City of New York. +# (c) 2025 The Trustees of Columbia University in the City of New York. # All rights reserved. # -# File coded by: Billinge Group members and community contributors. +# 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 @@ -12,17 +12,15 @@ # See LICENSE.rst for license information. # ############################################################################## - -"""Tools for manipulating and comparing PDF profiles""" +"""Python package for manipulating and comparing PDF profiles.""" # key used when saving multiple morphs __save_morph_as__ = "save_morph_as" # package version -from diffpy.morph.version import __version__ +from diffpy.morph.version import __version__ # noqa # silence the pyflakes syntax checker assert __version__ or True - # End of file diff --git a/src/diffpy/morph/log.py b/src/diffpy/morph/log.py index 7e49af6b..c1919566 100644 --- a/src/diffpy/morph/log.py +++ b/src/diffpy/morph/log.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """Configuration of loggers used in this package. Logger instances: diff --git a/src/diffpy/morph/morph_api.py b/src/diffpy/morph/morph_api.py index 22496546..f4b06a72 100644 --- a/src/diffpy/morph/morph_api.py +++ b/src/diffpy/morph/morph_api.py @@ -54,7 +54,7 @@ def morph_default_config(**kwargs): - """function to generate default morph configuration + """Function to generate default morph configuration. Parameters ---------- @@ -96,7 +96,7 @@ def morph( verbose=False, **kwargs, ): - """function to perform PDF morphing. + """Function to perform PDF morphing. Parameters ---------- diff --git a/src/diffpy/morph/morph_helpers/__init__.py b/src/diffpy/morph/morph_helpers/__init__.py index 46b8fe5b..fe7eeae5 100644 --- a/src/diffpy/morph/morph_helpers/__init__.py +++ b/src/diffpy/morph/morph_helpers/__init__.py @@ -10,9 +10,8 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""List of helpers for certain morphing operations -(currently only used for smear).""" +"""List of helpers for certain morphing operations (currently only used for +smear).""" from diffpy.morph.morph_helpers.transformpdftordf import TransformXtalPDFtoRDF from diffpy.morph.morph_helpers.transformrdftopdf import TransformXtalRDFtoPDF diff --git a/src/diffpy/morph/morph_helpers/transformpdftordf.py b/src/diffpy/morph/morph_helpers/transformpdftordf.py index 556edcbf..31331ed7 100644 --- a/src/diffpy/morph/morph_helpers/transformpdftordf.py +++ b/src/diffpy/morph/morph_helpers/transformpdftordf.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class TransformXtalPDFtoRDF -- Transform crystal PDFs to RDFs. -""" +"""Class TransformXtalPDFtoRDF -- Transform crystal PDFs to RDFs.""" from diffpy.morph.morphs.morph import LABEL_GR, LABEL_RA, LABEL_RR, Morph @@ -34,7 +31,6 @@ class TransformXtalPDFtoRDF(Morph): With s = baselineslope, R(r) = r * (G(r) - r * s) - """ # Define input output types diff --git a/src/diffpy/morph/morph_helpers/transformrdftopdf.py b/src/diffpy/morph/morph_helpers/transformrdftopdf.py index 4dce9731..495c7dda 100644 --- a/src/diffpy/morph/morph_helpers/transformrdftopdf.py +++ b/src/diffpy/morph/morph_helpers/transformrdftopdf.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class TransformXtalRDFtoPDF -- Transform crystal RDFs to PDFs. -""" +"""Class TransformXtalRDFtoPDF -- Transform crystal RDFs to PDFs.""" import numpy @@ -36,7 +33,6 @@ class TransformXtalRDFtoPDF(Morph): With s = baselineslope, G(r) = R(r) / r + r * s - """ # Define input output types diff --git a/src/diffpy/morph/morph_io.py b/src/diffpy/morph/morph_io.py index 722771c9..a306542b 100644 --- a/src/diffpy/morph/morph_io.py +++ b/src/diffpy/morph/morph_io.py @@ -34,8 +34,8 @@ def single_morph_output( verbose=False, stdout_flag=False, ): - """Helper function for printing details about a single morph. - Handles both printing to terminal and printing to a file. + """Helper function for printing details about a single morph. Handles both + printing to terminal and printing to a file. Parameters ---------- @@ -136,9 +136,9 @@ def create_morphs_directory(save_directory): def get_multisave_names(target_list: list, save_names_file=None, mm=False): """Create or import a dictionary that specifies names to save morphs as. - First attempt to import names from a specified file. - If names for certain morphs not found, use default naming scheme: - 'Morph_with_Target_.cgr'. + First attempt to import names from a specified file. If names for certain + morphs not found, use default naming scheme: 'Morph_with_Target_.cgr'. Used when saving multiple morphs. diff --git a/src/diffpy/morph/morphapp.py b/src/diffpy/morph/morphapp.py index 2feba7c0..ad7ca73c 100755 --- a/src/diffpy/morph/morphapp.py +++ b/src/diffpy/morph/morphapp.py @@ -42,8 +42,8 @@ def __init__(self, *args, **kwargs): def custom_error(self, msg): """custom_error(msg : string) - Print a message incorporating 'msg' to stderr and exit. - Does not print usage. + Print a message incorporating 'msg' to stderr and exit. Does + not print usage. """ self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg)) diff --git a/src/diffpy/morph/morphs/__init__.py b/src/diffpy/morph/morphs/__init__.py index 0322e98f..a1cbdc88 100644 --- a/src/diffpy/morph/morphs/__init__.py +++ b/src/diffpy/morph/morphs/__init__.py @@ -12,9 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - -"""Definition of morphs. -""" +"""Definition of morphs.""" from diffpy.morph.morphs.morph import Morph # noqa: F401 diff --git a/src/diffpy/morph/morphs/morph.py b/src/diffpy/morph/morphs/morph.py index 0b7cb543..5f6c2ccc 100644 --- a/src/diffpy/morph/morphs/morph.py +++ b/src/diffpy/morph/morphs/morph.py @@ -12,8 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - - """Morph -- base class for defining a morph. """ @@ -198,7 +196,7 @@ def checkConfig(self): return def plotInputs(self, xylabels=True): - """Plot input arrays using matplotlib.pyplot + """Plot input arrays using matplotlib.pyplot. Parameters ---------- @@ -220,7 +218,7 @@ def plotInputs(self, xylabels=True): return rv def plotOutputs(self, xylabels=True, **plotargs): - """Plot output arrays using matplotlib.pyplot + """Plot output arrays using matplotlib.pyplot. Parameters ---------- diff --git a/src/diffpy/morph/morphs/morphchain.py b/src/diffpy/morph/morphs/morphchain.py index 1dc05b41..e7a8f824 100644 --- a/src/diffpy/morph/morphs/morphchain.py +++ b/src/diffpy/morph/morphs/morphchain.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """MorphChain -- Chain of morphs executed in order. """ diff --git a/src/diffpy/morph/morphs/morphfuncy.py b/src/diffpy/morph/morphs/morphfuncy.py index e0b5fe7f..9e72b719 100644 --- a/src/diffpy/morph/morphs/morphfuncy.py +++ b/src/diffpy/morph/morphs/morphfuncy.py @@ -3,7 +3,7 @@ class MorphFuncy(Morph): """Apply the user-supplied Python function to the y-coordinates of the - morph data""" + morph data.""" # Define input output types summary = "Apply a Python function to the y-axis data" diff --git a/src/diffpy/morph/morphs/morphishape.py b/src/diffpy/morph/morphs/morphishape.py index 5cf3da91..6492b9d2 100644 --- a/src/diffpy/morph/morphs/morphishape.py +++ b/src/diffpy/morph/morphs/morphishape.py @@ -12,11 +12,8 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphISphere -- apply inverse spherical shape function -class MorphISpheroid -- apply inverse spheroidal shape function -""" +"""Class MorphISphere -- apply inverse spherical shape function class +MorphISpheroid -- apply inverse spheroidal shape function.""" import numpy @@ -26,7 +23,7 @@ class MorphISpheroid -- apply inverse spheroidal shape function class MorphISphere(Morph): - """Apply inverse spherical characteristic function to the morph + """Apply inverse spherical characteristic function to the morph. Configuration Variables ----------------------- @@ -56,7 +53,7 @@ def morph(self, x_morph, y_morph, x_target, y_target): class MorphISpheroid(Morph): - """Apply inverse spherical characteristic function to the morph + """Apply inverse spherical characteristic function to the morph. Configuration Variables ----------------------- diff --git a/src/diffpy/morph/morphs/morphresolution.py b/src/diffpy/morph/morphs/morphresolution.py index a7246ad3..922e39d3 100644 --- a/src/diffpy/morph/morphs/morphresolution.py +++ b/src/diffpy/morph/morphs/morphresolution.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphResolutionDamping -- apply resolution broadening to the morph -""" +"""Class MorphResolutionDamping -- apply resolution broadening to the morph.""" import numpy diff --git a/src/diffpy/morph/morphs/morphrgrid.py b/src/diffpy/morph/morphs/morphrgrid.py index dc9b68d3..fadce9f7 100644 --- a/src/diffpy/morph/morphs/morphrgrid.py +++ b/src/diffpy/morph/morphs/morphrgrid.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphRGrid -- put morph and target on desired grid. -""" +"""Class MorphRGrid -- put morph and target on desired grid.""" import numpy diff --git a/src/diffpy/morph/morphs/morphscale.py b/src/diffpy/morph/morphs/morphscale.py index 2f5c6b4d..c2bd86c7 100644 --- a/src/diffpy/morph/morphs/morphscale.py +++ b/src/diffpy/morph/morphs/morphscale.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphScale -- scale the morph data -""" +"""Class MorphScale -- scale the morph data.""" from diffpy.morph.morphs.morph import LABEL_GR, LABEL_RA, Morph diff --git a/src/diffpy/morph/morphs/morphshape.py b/src/diffpy/morph/morphs/morphshape.py index 9aae3d78..0405f3d1 100644 --- a/src/diffpy/morph/morphs/morphshape.py +++ b/src/diffpy/morph/morphs/morphshape.py @@ -12,11 +12,8 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphSphere -- apply a spherical shape function to the morph -class MorphSpheroid -- apply a spheroidal shape function to the morph -""" +"""Class MorphSphere -- apply a spherical shape function to the morph class +MorphSpheroid -- apply a spheroidal shape function to the morph.""" import numpy @@ -28,7 +25,7 @@ class MorphSpheroid -- apply a spheroidal shape function to the morph class MorphSphere(Morph): - """Apply a spherical characteristic function to the morph + """Apply a spherical characteristic function to the morph. Configuration Variables ----------------------- @@ -56,7 +53,7 @@ def morph(self, x_morph, y_morph, x_target, y_target): class MorphSpheroid(Morph): - """Apply a spherical characteristic function to the morph + """Apply a spherical characteristic function to the morph. Configuration Variables ----------------------- @@ -143,7 +140,6 @@ def _spheroidalCF2(r, psize, axrat): axrat -- The ratio of axis lengths From Lei et al., Phys. Rev. B, 80, 024118 (2009) - """ pelpt = axrat diff --git a/src/diffpy/morph/morphs/morphshift.py b/src/diffpy/morph/morphs/morphshift.py index b3ac8818..b4f6c9f8 100644 --- a/src/diffpy/morph/morphs/morphshift.py +++ b/src/diffpy/morph/morphs/morphshift.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphShift -- shift the morph -""" +"""Class MorphShift -- shift the morph.""" import numpy diff --git a/src/diffpy/morph/morphs/morphsmear.py b/src/diffpy/morph/morphs/morphsmear.py index 2495ee38..b8735919 100644 --- a/src/diffpy/morph/morphs/morphsmear.py +++ b/src/diffpy/morph/morphs/morphsmear.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphSmear -- smear the morph. -""" +"""Class MorphSmear -- smear the morph.""" import numpy diff --git a/src/diffpy/morph/morphs/morphsqueeze.py b/src/diffpy/morph/morphs/morphsqueeze.py index fc6493d6..6e41fc3d 100644 --- a/src/diffpy/morph/morphs/morphsqueeze.py +++ b/src/diffpy/morph/morphs/morphsqueeze.py @@ -6,8 +6,10 @@ class MorphSqueeze(Morph): - """Apply a polynomial to squeeze the morph function. The morphed - data is returned on the same grid as the unmorphed data.""" + """Apply a polynomial to squeeze the morph function. + + The morphed data is returned on the same grid as the unmorphed data. + """ # Define input output types summary = "Squeeze morph by polynomial shift" diff --git a/src/diffpy/morph/morphs/morphstretch.py b/src/diffpy/morph/morphs/morphstretch.py index 6b99caea..78c25c8b 100644 --- a/src/diffpy/morph/morphs/morphstretch.py +++ b/src/diffpy/morph/morphs/morphstretch.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""class MorphStretch -- stretch the morph. -""" +"""Class MorphStretch -- stretch the morph.""" import numpy diff --git a/src/diffpy/morph/plot.py b/src/diffpy/morph/plot.py index 1ff29466..21e94e8d 100644 --- a/src/diffpy/morph/plot.py +++ b/src/diffpy/morph/plot.py @@ -227,8 +227,7 @@ def compare_funcs( def plot_param(target_labels, param_list, param_name=None, field=None): - """ - Plot Rw values for multiple morphs. + """Plot Rw values for multiple morphs. Parameters ---------- diff --git a/src/diffpy/morph/refine.py b/src/diffpy/morph/refine.py index 11b4a2c0..9514f8d8 100644 --- a/src/diffpy/morph/refine.py +++ b/src/diffpy/morph/refine.py @@ -12,7 +12,6 @@ # See LICENSE.txt for license information. # ############################################################################## - """refine -- Refine a morph or morph chain """ @@ -82,9 +81,9 @@ def _residual(self, pvals): def _pearson(self, pvals): """Pearson correlation function. - This gives e**-p (vector), where p is the pearson correlation function. - We seek to minimize this, which occurs when the correlation is the - largest. + This gives e**-p (vector), where p is the pearson correlation + function. We seek to minimize this, which occurs when the + correlation is the largest. """ self._update_chain(pvals) _x_morph, _y_morph, _x_target, _y_target = self.chain( diff --git a/src/diffpy/morph/tools.py b/src/diffpy/morph/tools.py index f9b024dd..706b33db 100644 --- a/src/diffpy/morph/tools.py +++ b/src/diffpy/morph/tools.py @@ -12,10 +12,7 @@ # See LICENSE.txt for license information. # ############################################################################## - - -"""Tools used in morphs and morph chains. -""" +"""Tools used in morphs and morph chains.""" import numpy @@ -180,8 +177,8 @@ def case_insensitive_dictionary_search(key: str, dictionary: dict): def field_sort( filepaths: list, field, reverse=False, serfile=None, get_field_values=False ): - """Sort a list of files by a field stored in header information. - All files must contain this header information. + """Sort a list of files by a field stored in header information. All files + must contain this header information. Parameters ---------- @@ -243,9 +240,9 @@ def field_sort( def get_values_from_dictionary_collection( dictionary_collection: iter, target_key ): - """In an (iterable) collection of dictionaries, search for a target key - in each dictionary. Return a list of all found values corresponding - to that key. + """In an (iterable) collection of dictionaries, search for a target key in + each dictionary. Return a list of all found values corresponding to that + key. Parameters ---------- diff --git a/src/diffpy/morph/version.py b/src/diffpy/morph/version.py index 1077d2ca..f40af37f 100644 --- a/src/diffpy/morph/version.py +++ b/src/diffpy/morph/version.py @@ -1,18 +1,17 @@ #!/usr/bin/env python ############################################################################## # -# (c) 2024 The Trustees of Columbia University in the City of New York. +# (c) 2025 The Trustees of Columbia University in the City of New York. # All rights reserved. # -# File coded by: Billinge Group members and community contributors. +# 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.pdfmorph/graphs/contributors +# https://github.com/diffpy/diffpy.morph/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. diff --git a/tests/debug.py b/tests/debug.py index 0d3926c0..6497a261 100644 --- a/tests/debug.py +++ b/tests/debug.py @@ -12,9 +12,7 @@ # See LICENSE.rst for license information. # ############################################################################## - -""" -Convenience module for debugging the unit tests using +"""Convenience module for debugging the unit tests using. python -m diffpy.morph.tests.debug diff --git a/tests/run.py b/tests/run.py index dc27a05b..c34754e3 100644 --- a/tests/run.py +++ b/tests/run.py @@ -12,9 +12,8 @@ # See LICENSE.rst for license information. # ############################################################################## -"""Convenience module for executing all unit tests with -python -m diffpy.morph.tests.run -""" +"""Convenience module for executing all unit tests with python -m +diffpy.morph.tests.run.""" import sys diff --git a/tests/test_morphchain.py b/tests/test_morphchain.py index 92ed0189..4c567379 100644 --- a/tests/test_morphchain.py +++ b/tests/test_morphchain.py @@ -27,7 +27,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphChain.morph()""" + """Check MorphChain.morph()""" # Define the morphs config = { "rmin": 1, diff --git a/tests/test_morphpdftordf.py b/tests/test_morphpdftordf.py index 1c39b534..6cdacb4a 100644 --- a/tests/test_morphpdftordf.py +++ b/tests/test_morphpdftordf.py @@ -30,7 +30,7 @@ def setup(self): return def test_transform(self, setup): - """check TransformXtalPDFtoRDF.morph()""" + """Check TransformXtalPDFtoRDF.morph()""" config = {"baselineslope": -1.0} transform = TransformXtalPDFtoRDF(config) diff --git a/tests/test_morphrdftopdf.py b/tests/test_morphrdftopdf.py index ee139cc1..05fd09cb 100644 --- a/tests/test_morphrdftopdf.py +++ b/tests/test_morphrdftopdf.py @@ -24,7 +24,7 @@ def setup(self): return def test_transform(self, setup): - """check TransformXtalRDFtoPDF.morph()""" + """Check TransformXtalRDFtoPDF.morph()""" config = {"baselineslope": -1.0} transform = TransformXtalRDFtoPDF(config) diff --git a/tests/test_morphresolution.py b/tests/test_morphresolution.py index 13a56d8d..40566113 100644 --- a/tests/test_morphresolution.py +++ b/tests/test_morphresolution.py @@ -24,7 +24,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphScale.morph()""" + """Check MorphScale.morph()""" config = {"qdamp": 0.01} morph = MorphResolutionDamping(config) diff --git a/tests/test_morphrgrid.py b/tests/test_morphrgrid.py index d823dbad..4187698c 100644 --- a/tests/test_morphrgrid.py +++ b/tests/test_morphrgrid.py @@ -34,7 +34,7 @@ def _runTests(self, xyallout, morph): return def testRangeInBounds(self, setup): - """Selected range is within input bounds""" + """Selected range is within input bounds.""" config = { "rmin": 1.0, @@ -52,7 +52,7 @@ def testRangeInBounds(self, setup): return def testRmaxOut(self, setup): - """Selected rmax is outside of input bounds""" + """Selected rmax is outside of input bounds.""" config = { "rmin": 1.0, @@ -70,7 +70,7 @@ def testRmaxOut(self, setup): return def testRminOut(self, setup): - """Selected rmin is outside of input bounds""" + """Selected rmin is outside of input bounds.""" config = { "rmin": 0.0, @@ -88,7 +88,7 @@ def testRminOut(self, setup): return def testRstepOut(self, setup): - """Selected rstep is outside of input bounds""" + """Selected rstep is outside of input bounds.""" config = { "rmin": 1.0, diff --git a/tests/test_morphscale.py b/tests/test_morphscale.py index ccabb483..fa39042c 100644 --- a/tests/test_morphscale.py +++ b/tests/test_morphscale.py @@ -24,7 +24,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphScale.morph()""" + """Check MorphScale.morph()""" config = {"scale": 2.0} morph = MorphScale(config) diff --git a/tests/test_morphshape.py b/tests/test_morphshape.py index 1905ebe8..18cd49ad 100644 --- a/tests/test_morphshape.py +++ b/tests/test_morphshape.py @@ -27,7 +27,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphSphere.morph()""" + """Check MorphSphere.morph()""" config = {"radius": 17.5} morph = MorphSphere(config) @@ -78,7 +78,7 @@ def reset(self): return def test_morph(self): - """check MorphSpheroid.morph() and MorphISpheroid.morph()""" + """Check MorphSpheroid.morph() and MorphISpheroid.morph()""" for idx in range(len(self.testfiles)): self.testfile = self.testfiles[idx] diff --git a/tests/test_morphshift.py b/tests/test_morphshift.py index 4f2e552b..895022d7 100644 --- a/tests/test_morphshift.py +++ b/tests/test_morphshift.py @@ -30,7 +30,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphScale.morph()""" + """Check MorphScale.morph()""" config = {"hshift": self.hshift, "vshift": self.vshift} morph = MorphShift(config) diff --git a/tests/test_morphsmear.py b/tests/test_morphsmear.py index aa431c0e..a0162840 100644 --- a/tests/test_morphsmear.py +++ b/tests/test_morphsmear.py @@ -28,7 +28,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphSmear.morph()""" + """Check MorphSmear.morph()""" morph = MorphSmear() morph.smear = 0.15 diff --git a/tests/test_morphstretch.py b/tests/test_morphstretch.py index 37b23a0c..8137b166 100644 --- a/tests/test_morphstretch.py +++ b/tests/test_morphstretch.py @@ -25,7 +25,7 @@ def setup(self): return def test_morph(self, setup): - """check MorphStretch.morph()""" + """Check MorphStretch.morph()""" morph = MorphStretch() # Stretch by 50% diff --git a/tests/test_refine.py b/tests/test_refine.py index d9cbd6d4..33d8d4ac 100644 --- a/tests/test_refine.py +++ b/tests/test_refine.py @@ -30,7 +30,7 @@ def setup(self): return def test_refine_morph(self, setup): - """refine a morph""" + """Refine a morph.""" # Define the morphs config = { "scale": 1.0, @@ -50,7 +50,7 @@ def test_refine_morph(self, setup): return def test_refine_chain(self, setup): - """refine a chain""" + """Refine a chain.""" # Give this some texture self.y_morph[30:] = 5 self.y_target[33:] = 15 diff --git a/tests/test_tools.py b/tests/test_tools.py index 946b4a3d..4fcbd7f0 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -1,7 +1,6 @@ #!/usr/bin/env python -"""Unit tests for tools.py -""" +"""Unit tests for tools.py.""" import os @@ -29,14 +28,14 @@ def setup(self): return def test_estimateBaselineSlope(self, setup): - """check estimateBaselineSlope() using calculated data""" + """Check estimateBaselineSlope() using calculated data.""" slope = tools.estimateBaselineSlope(self.x_morph, self.y_morph) slopecalc = -4 * numpy.pi * self.rho0 assert numpy.allclose(slopecalc, slope, 1e-2) return def test_estimateScale(self, setup): - """check estimateScale() using calculated data""" + """Check estimateScale() using calculated data.""" import random x = random.random() diff --git a/tests/test_version.py b/tests/test_version.py index 230d27c2..68915adc 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -1,7 +1,6 @@ -"""Unit tests for __version__.py -""" +"""Unit tests for __version__.py.""" -import diffpy.morph +import diffpy.morph # noqa def test_package_version():