Skip to content

Commit aca1f0a

Browse files
committed
DOC: create docs
1 parent 74fa4af commit aca1f0a

10 files changed

+177
-1
lines changed

docs/examples/README.rst

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Examples
2+
========
3+
4+
Below is a gallery of examples.
22 Bytes
Binary file not shown.
22 Bytes
Binary file not shown.

docs/source/auto_gallery/index.rst

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
:orphan:
2+
3+
4+
5+
.. _sphx_glr_auto_gallery:
6+
7+
Examples
8+
========
9+
10+
Below is a gallery of examples.
11+
12+
13+
.. raw:: html
14+
15+
<div class="sphx-glr-clear"></div>
16+
17+
18+
19+
.. only :: html
20+
21+
.. container:: sphx-glr-footer
22+
:class: sphx-glr-footer-gallery
23+
24+
25+
.. container:: sphx-glr-download sphx-glr-download-python
26+
27+
:download:`Download all examples in Python source code: auto_gallery_python.zip </auto_gallery/auto_gallery_python.zip>`
28+
29+
30+
31+
.. container:: sphx-glr-download sphx-glr-download-jupyter
32+
33+
:download:`Download all examples in Jupyter notebooks: auto_gallery_jupyter.zip </auto_gallery/auto_gallery_jupyter.zip>`
34+
35+
36+
.. only:: html
37+
38+
.. rst-class:: sphx-glr-signature
39+
40+
`Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_

docs/source/conf.py

+8
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@
3838
'sphinx.ext.intersphinx',
3939
'sphinx.ext.mathjax',
4040
'sphinx.ext.viewcode',
41+
'sphinx.ext.napoleon',
4142
'IPython.sphinxext.ipython_directive',
4243
'IPython.sphinxext.ipython_console_highlighting',
4344
'matplotlib.sphinxext.plot_directive',
4445
'numpydoc',
4546
'sphinx_copybutton',
47+
'sphinx_gallery.gen_gallery'
4648
]
4749

4850
# Configuration options for plot_directive. See:
@@ -200,3 +202,9 @@
200202
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
201203
'matplotlib': ('https://matplotlib.org', None),
202204
}
205+
206+
# Gallery configuration
207+
sphinx_gallery_conf = {
208+
'examples_dirs': '../examples', # path to your example scripts
209+
'gallery_dirs': 'auto_gallery', # path to where to save gallery generated output
210+
}

docs/source/index.rst

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
PDFstream Documentation
2+
=======================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
installation
8+
auto_gallery/index
9+
min_versions

docs/source/installation.rst

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
============
2+
Installation
3+
============
4+
5+
Prerequisites
6+
-------------
7+
8+
Install `Anaconda <https://docs.conda.io/projects/conda/en/latest/user-guide/install/>`_.
9+
10+
After conda is installed, at the commnad line::
11+
12+
conda config --append channels nsls2forge
13+
conda config --append channels conda-forge
14+
15+
(Optional) Get the .whl file of `PDFgetX <https://www.diffpy.org/products/pdfgetx.html>`_. This package is used
16+
to transform the XRD data to PDF data.
17+
18+
General Installation
19+
--------------------
20+
21+
Users can install the `pdfstream` using conda. It is suggested to create a new environment for it.
22+
23+
At the command line::
24+
25+
conda create -n pdfstream_env -c st3107 pdfstream
26+
27+
The ``pdfstream_env`` in the command is the name of the environment. It can be changed to any name.
28+
29+
Activate the environment::
30+
31+
conda activate pdfstream_env
32+
33+
(Optional) Install the `diffpy.pdfgetx` using .whl file::
34+
35+
python -m pip install <path to .whl file>
36+
37+
Change the ``<path to .whl file>`` to the path of the .whl file on your computer.
38+
39+
Before using the `pdfstream`, remember to activate the environment::
40+
41+
conda activate pdfstream_env
42+
43+
Development Installation
44+
------------------------
45+
46+
**Fork** and clone the github repo and change the current directory::
47+
48+
git clone https://github.com/<your account>/pdfstream
49+
50+
Remember to change ``<your account>`` to the name of your github account.
51+
52+
Change directory::
53+
54+
cd pdfstream
55+
56+
Create an environment with all the requirements::
57+
58+
conda create -n pdfstream_env --file requirements/build.txt --file requirements/run.txt --file requirements/test.txt
59+
60+
(Optional) For the maintainer, install the packages for building documents and releasing the software::
61+
62+
conda install -n pdfstream_env --file requirements/docs.txt --file requirements/release.txt
63+
64+
Activate the environment::
65+
66+
conda activate pdfstream_env
67+
68+
Install the `diffpy.pdfgetx` using .whl file::
69+
70+
python -m pip install <path to .whl file>
71+
72+
Install the `twine` for pypi release::
73+
74+
python -m pip install twine
75+
76+
Change the ``<path to .whl file>`` to the path of the .whl file on your computer.
77+
78+
Install the `pdfstream` in development mode::
79+
80+
python -m pip install -e .
81+

docs/source/min_versions.rst

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
===================================
2+
Minimum Version of Python and NumPy
3+
===================================
4+
5+
6+
- This project supports at least the minor versions of Python
7+
initially released 12 months prior to a planned project release
8+
date.
9+
- The project will always support at least the 2 latest minor
10+
versions of Python.
11+
- The project will support minor versions of ``numpy`` initially
12+
released in the 24 months prior to a planned project release date or
13+
the oldest version that supports the minimum Python version
14+
(whichever is higher).
15+
- The project will always support at least the 3 latest minor
16+
versions of NumPy.
17+
18+
The minimum supported version of Python will be set to
19+
``python_requires`` in ``setup``. All supported minor versions of
20+
Python will be in the test matrix and have binary artifacts built
21+
for releases.
22+
23+
The project should adjust upward the minimum Python and NumPy
24+
version support on every minor and major release, but never on a
25+
patch release.
26+
27+
This is consistent with NumPy `NEP 29
28+
<https://numpy.org/neps/nep-0029-deprecation_policy.html>`__.

rever.xsh

+6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ def build_docs():
1313
make -C docs html
1414

1515

16+
@activity
17+
def install():
18+
python -m pip install -e .
19+
20+
1621
$PROJECT = 'pdffitx'
1722
$ACTIVITIES = [
1823
'version_bump',
24+
'install',
1925
'changelog',
2026
'build_docs',
2127
'tag',

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from setuptools import setup, find_packages
33
import sys
44

5-
from release import NAME, VERSION, DESCRIPTION, AUTHOR_EMAIL, URL
5+
from release import NAME, VERSION, DESCRIPTION, AUTHOR, AUTHOR_EMAIL, LICENSE, URL
66

77
# NOTE: This file must remain Python 2 compatible for the foreseeable future,
88
# to ensure that we error out properly for people with outdated setuptools

0 commit comments

Comments
 (0)