Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
File renamed without changes.
15 changes: 12 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
recursive-include DistancePrinter *
prune doc
exclude MANIFEST.in
graft src
graft tests
graft requirements

include AUTHORS.rst LICENSE*.rst README.rst

# Exclude all bytecode files and __pycache__ directories
global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files.
global-exclude .DS_Store # Exclude Mac filesystem artifacts.
global-exclude __pycache__ # Exclude Python cache directories.
global-exclude .git* # Exclude git files and directories.
global-exclude .idea # Exclude PyCharm project settings.
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,28 @@ Independent Installation
------------------------
You can also install ``diffpy.distanceprinter`` independently for yourself.

Assuming you have a wheel file in the current working directory, in an active conda environment please type
Assuming you have a wheel file in the current working directory, in an active conda environment please type ::

pip install ./diffpy.distanceprinter-VERSION.whl

where you replace VERSION with the actual version you have so the command matches the filename of the
wheel file you have.

The commands to create and activate the conda environment with name "distanceprinter-env" is
The commands to create and activate the conda environment with name "distanceprinter-env" is ::

conda create -n distanceprinter-env python=3.13
conda activate distanceprinter-env

If you don't have conda installed, we recomment you install `miniconda
<https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html>`_
To install this software from a Python wheel distribution format execute
To install this software from a Python wheel distribution format execute ::

pip install ./diffpy.distanceprinter-VERSION.whl

If you are a developer, you can also install this package from sources. First, obtain the source archive
from `GitHub <https://github.com/diffpy/diffpy.distanceprinter/>`_.
Install the packages in ``./requirements/conda.txt`` and ``./requirements/tests.txt``
using the `--file`` command:
using the ``--file`` command ::

conda activate distanceprinter-env
conda install --file ./requirements/conda.txt
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": "Xiaohao Yang and Billinge Group members",
"license_holders": "The Trustees of Columbia University in the City of New York",
"project_name": "diffpy.distanceprinter",
"github_username_or_orgname": "diffpy",
"github_repo_name": "diffpy.distanceprinter",
"conda_pypi_package_dist_name": "diffpy.distanceprinter",
"package_dir_name": "diffpy.distanceprinter",
"project_short_description": "Distance Printer, calculate the inter atomic distances. Part of xPDFsuite.",
"project_keywords": "diffpy, pdf, data-interpretation",
"minimum_supported_python_version": "3.11",
"maximum_supported_python_version": "3.13",
"project_needs_c_code_compiled": "No",
"project_has_gui_tests": "No"
}
57 changes: 57 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#######
|title|
#######

.. |title| replace:: diffpy.distanceprinter documentation

``diffpy.distanceprinter`` - Distance Printer, calculate the inter atomic distances. Part of xPDFsuite.

| Software version |release|
| Last updated |today|.

===============
Getting started
===============

Welcome to the ``diffpy.distanceprinter`` documentation!

This package is not designed to be installed independently. To get started, please visit
https://www.diffpy.org/products/xPDFsuite.html for more information about the xpdfsuite package and
download the package together with ``diffpy.xpdfsuite``.

=======
Authors
=======

``diffpy.distanceprinter`` is developed by Xiaohao Yang and Billinge Group members. The maintainer for this project is Simon Billinge. For a detailed list of contributors see
https://github.com/diffpy/diffpy.distanceprinter/graphs/contributors.

============
Installation
============

See the `README <https://github.com/diffpy/diffpy.distanceprinter#installation>`_
file included with the distribution.

================
Acknowledgements
================

``diffpy.distanceprinter`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.

=================
Table of contents
=================
.. toctree::
:maxdepth: 2

Package API <api/diffpy.distanceprinter>
release
license

=======
Indices
=======

* :ref:`genindex`
* :ref:`search`
23 changes: 23 additions & 0 deletions news/fix-issues.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No news added: Fix documentation errors

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ exclude = [] # exclude packages matching these glob patterns (empty by default)
namespaces = false # to disable scanning PEP 420 namespaces (true by default)

[project.scripts]
diffpy-distanceprinter = "diffpy.distanceprinter:main"
diffpy-distanceprinter = "diffpy.distanceprinter.distanceprinter_app:main"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Points to the file src/diffpy/distanceprinter/distanceprinter_app.py


[tool.setuptools.dynamic]
dependencies = {file = ["requirements/pip.txt"]}
Expand Down
3 changes: 3 additions & 0 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy
diffpy.pdffit2
diffpy.structure
33 changes: 33 additions & 0 deletions src/diffpy/distanceprinter/distanceprinter_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import argparse
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI utility provided by skpkg. Got this from package update


from diffpy.distanceprinter.version import __version__ # noqa


def main():
parser = argparse.ArgumentParser(
prog="diffpy.distanceprinter",
description=(
"Distance Printer, calculate the inter atomic distances. Part of xPDFsuite.\n\n"
"For more information, visit: "
"https://github.com/diffpy/diffpy.distanceprinter/"
),
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.distanceprinter {__version__}")
else:
# Default behavior when no arguments are given
parser.print_help()


if __name__ == "__main__":
main()
19 changes: 19 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import json
from pathlib import Path

import pytest


@pytest.fixture
def user_filesystem(tmp_path):
base_dir = Path(tmp_path)
home_dir = base_dir / "home_dir"
home_dir.mkdir(parents=True, exist_ok=True)
cwd_dir = base_dir / "cwd_dir"
cwd_dir.mkdir(parents=True, exist_ok=True)

home_config_data = {"username": "home_username", "email": "home@email.com"}
with open(home_dir / "diffpyconfig.json", "w") as f:
json.dump(home_config_data, f)

yield tmp_path
Loading