Skip to content

Commit 84acda7

Browse files
authored
Merge pull request #22 from zmx27/fix-issues
skpkg: add cookiecutter.json, fix rendering issues in readme, add index.rst, add conftest.py, update requirements folder, update manifest.in
2 parents 07d36d9 + 0186c51 commit 84acda7

File tree

10 files changed

+170
-8
lines changed

10 files changed

+170
-8
lines changed
File renamed without changes.

MANIFEST.in

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1-
recursive-include DistancePrinter *
2-
prune doc
3-
exclude MANIFEST.in
1+
graft src
2+
graft tests
3+
graft requirements
4+
5+
include AUTHORS.rst LICENSE*.rst README.rst
6+
7+
# Exclude all bytecode files and __pycache__ directories
8+
global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files.
9+
global-exclude .DS_Store # Exclude Mac filesystem artifacts.
10+
global-exclude __pycache__ # Exclude Python cache directories.
11+
global-exclude .git* # Exclude git files and directories.
12+
global-exclude .idea # Exclude PyCharm project settings.

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,28 @@ Independent Installation
4444
------------------------
4545
You can also install ``diffpy.distanceprinter`` independently for yourself.
4646

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

4949
pip install ./diffpy.distanceprinter-VERSION.whl
5050

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

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

5656
conda create -n distanceprinter-env python=3.13
5757
conda activate distanceprinter-env
5858

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

6363
pip install ./diffpy.distanceprinter-VERSION.whl
6464

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

7070
conda activate distanceprinter-env
7171
conda install --file ./requirements/conda.txt

cookiecutter.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"maintainer_name": "Simon Billinge",
3+
"maintainer_email": "sb2896@columbia.edu",
4+
"maintainer_github_username": "sbillinge",
5+
"contributors": "Xiaohao Yang and Billinge Group members",
6+
"license_holders": "The Trustees of Columbia University in the City of New York",
7+
"project_name": "diffpy.distanceprinter",
8+
"github_username_or_orgname": "diffpy",
9+
"github_repo_name": "diffpy.distanceprinter",
10+
"conda_pypi_package_dist_name": "diffpy.distanceprinter",
11+
"package_dir_name": "diffpy.distanceprinter",
12+
"project_short_description": "Distance Printer, calculate the inter atomic distances. Part of xPDFsuite.",
13+
"project_keywords": "diffpy, pdf, data-interpretation",
14+
"minimum_supported_python_version": "3.11",
15+
"maximum_supported_python_version": "3.13",
16+
"project_needs_c_code_compiled": "No",
17+
"project_has_gui_tests": "No"
18+
}

docs/source/index.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#######
2+
|title|
3+
#######
4+
5+
.. |title| replace:: diffpy.distanceprinter documentation
6+
7+
``diffpy.distanceprinter`` - Distance Printer, calculate the inter atomic distances. Part of xPDFsuite.
8+
9+
| Software version |release|
10+
| Last updated |today|.
11+
12+
===============
13+
Getting started
14+
===============
15+
16+
Welcome to the ``diffpy.distanceprinter`` documentation!
17+
18+
This package is not designed to be installed independently. To get started, please visit
19+
https://www.diffpy.org/products/xPDFsuite.html for more information about the xpdfsuite package and
20+
download the package together with ``diffpy.xpdfsuite``.
21+
22+
=======
23+
Authors
24+
=======
25+
26+
``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
27+
https://github.com/diffpy/diffpy.distanceprinter/graphs/contributors.
28+
29+
============
30+
Installation
31+
============
32+
33+
See the `README <https://github.com/diffpy/diffpy.distanceprinter#installation>`_
34+
file included with the distribution.
35+
36+
================
37+
Acknowledgements
38+
================
39+
40+
``diffpy.distanceprinter`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.
41+
42+
=================
43+
Table of contents
44+
=================
45+
.. toctree::
46+
:maxdepth: 2
47+
48+
Package API <api/diffpy.distanceprinter>
49+
release
50+
license
51+
52+
=======
53+
Indices
54+
=======
55+
56+
* :ref:`genindex`
57+
* :ref:`search`

news/fix-issues.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* No news added: Fix documentation errors
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* <news item>
20+
21+
**Security:**
22+
23+
* <news item>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ exclude = [] # exclude packages matching these glob patterns (empty by default)
4949
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
5050

5151
[project.scripts]
52-
diffpy-distanceprinter = "diffpy.distanceprinter:main"
52+
diffpy-distanceprinter = "diffpy.distanceprinter.distanceprinter_app:main"
5353

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

requirements/pip.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
numpy
2+
diffpy.pdffit2
3+
diffpy.structure
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import argparse
2+
3+
from diffpy.distanceprinter.version import __version__ # noqa
4+
5+
6+
def main():
7+
parser = argparse.ArgumentParser(
8+
prog="diffpy.distanceprinter",
9+
description=(
10+
"Distance Printer, calculate the inter atomic distances. Part of xPDFsuite.\n\n"
11+
"For more information, visit: "
12+
"https://github.com/diffpy/diffpy.distanceprinter/"
13+
),
14+
formatter_class=argparse.RawDescriptionHelpFormatter,
15+
)
16+
17+
parser.add_argument(
18+
"--version",
19+
action="store_true",
20+
help="Show the program's version number and exit",
21+
)
22+
23+
args = parser.parse_args()
24+
25+
if args.version:
26+
print(f"diffpy.distanceprinter {__version__}")
27+
else:
28+
# Default behavior when no arguments are given
29+
parser.print_help()
30+
31+
32+
if __name__ == "__main__":
33+
main()

tests/conftest.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import json
2+
from pathlib import Path
3+
4+
import pytest
5+
6+
7+
@pytest.fixture
8+
def user_filesystem(tmp_path):
9+
base_dir = Path(tmp_path)
10+
home_dir = base_dir / "home_dir"
11+
home_dir.mkdir(parents=True, exist_ok=True)
12+
cwd_dir = base_dir / "cwd_dir"
13+
cwd_dir.mkdir(parents=True, exist_ok=True)
14+
15+
home_config_data = {"username": "home_username", "email": "home@email.com"}
16+
with open(home_dir / "diffpyconfig.json", "w") as f:
17+
json.dump(home_config_data, f)
18+
19+
yield tmp_path

0 commit comments

Comments
 (0)