Skip to content

Commit

Permalink
DOC: create docs
Browse files Browse the repository at this point in the history
  • Loading branch information
st3107 committed Oct 7, 2020
1 parent 74fa4af commit aca1f0a
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/examples/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Examples
========

Below is a gallery of examples.
Binary file added docs/source/auto_gallery/auto_gallery_jupyter.zip
Binary file not shown.
Binary file added docs/source/auto_gallery/auto_gallery_python.zip
Binary file not shown.
40 changes: 40 additions & 0 deletions docs/source/auto_gallery/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
:orphan:



.. _sphx_glr_auto_gallery:

Examples
========

Below is a gallery of examples.


.. raw:: html

<div class="sphx-glr-clear"></div>



.. only :: html
.. container:: sphx-glr-footer
:class: sphx-glr-footer-gallery
.. container:: sphx-glr-download sphx-glr-download-python
:download:`Download all examples in Python source code: auto_gallery_python.zip </auto_gallery/auto_gallery_python.zip>`
.. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download all examples in Jupyter notebooks: auto_gallery_jupyter.zip </auto_gallery/auto_gallery_jupyter.zip>`
.. only:: html

.. rst-class:: sphx-glr-signature

`Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
8 changes: 8 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'IPython.sphinxext.ipython_directive',
'IPython.sphinxext.ipython_console_highlighting',
'matplotlib.sphinxext.plot_directive',
'numpydoc',
'sphinx_copybutton',
'sphinx_gallery.gen_gallery'
]

# Configuration options for plot_directive. See:
Expand Down Expand Up @@ -200,3 +202,9 @@
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
'matplotlib': ('https://matplotlib.org', None),
}

# Gallery configuration
sphinx_gallery_conf = {
'examples_dirs': '../examples', # path to your example scripts
'gallery_dirs': 'auto_gallery', # path to where to save gallery generated output
}
9 changes: 9 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PDFstream Documentation
=======================

.. toctree::
:maxdepth: 2

installation
auto_gallery/index
min_versions
81 changes: 81 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
============
Installation
============

Prerequisites
-------------

Install `Anaconda <https://docs.conda.io/projects/conda/en/latest/user-guide/install/>`_.

After conda is installed, at the commnad line::

conda config --append channels nsls2forge
conda config --append channels conda-forge

(Optional) Get the .whl file of `PDFgetX <https://www.diffpy.org/products/pdfgetx.html>`_. This package is used
to transform the XRD data to PDF data.

General Installation
--------------------

Users can install the `pdfstream` using conda. It is suggested to create a new environment for it.

At the command line::

conda create -n pdfstream_env -c st3107 pdfstream

The ``pdfstream_env`` in the command is the name of the environment. It can be changed to any name.

Activate the environment::

conda activate pdfstream_env

(Optional) Install the `diffpy.pdfgetx` using .whl file::

python -m pip install <path to .whl file>

Change the ``<path to .whl file>`` to the path of the .whl file on your computer.

Before using the `pdfstream`, remember to activate the environment::

conda activate pdfstream_env

Development Installation
------------------------

**Fork** and clone the github repo and change the current directory::

git clone https://github.com/<your account>/pdfstream

Remember to change ``<your account>`` to the name of your github account.

Change directory::

cd pdfstream

Create an environment with all the requirements::

conda create -n pdfstream_env --file requirements/build.txt --file requirements/run.txt --file requirements/test.txt

(Optional) For the maintainer, install the packages for building documents and releasing the software::

conda install -n pdfstream_env --file requirements/docs.txt --file requirements/release.txt

Activate the environment::

conda activate pdfstream_env

Install the `diffpy.pdfgetx` using .whl file::

python -m pip install <path to .whl file>

Install the `twine` for pypi release::

python -m pip install twine

Change the ``<path to .whl file>`` to the path of the .whl file on your computer.

Install the `pdfstream` in development mode::

python -m pip install -e .

28 changes: 28 additions & 0 deletions docs/source/min_versions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
===================================
Minimum Version of Python and NumPy
===================================


- This project supports at least the minor versions of Python
initially released 12 months prior to a planned project release
date.
- The project will always support at least the 2 latest minor
versions of Python.
- The project will support minor versions of ``numpy`` initially
released in the 24 months prior to a planned project release date or
the oldest version that supports the minimum Python version
(whichever is higher).
- The project will always support at least the 3 latest minor
versions of NumPy.

The minimum supported version of Python will be set to
``python_requires`` in ``setup``. All supported minor versions of
Python will be in the test matrix and have binary artifacts built
for releases.

The project should adjust upward the minimum Python and NumPy
version support on every minor and major release, but never on a
patch release.

This is consistent with NumPy `NEP 29
<https://numpy.org/neps/nep-0029-deprecation_policy.html>`__.
6 changes: 6 additions & 0 deletions rever.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ def build_docs():
make -C docs html


@activity
def install():
python -m pip install -e .


$PROJECT = 'pdffitx'
$ACTIVITIES = [
'version_bump',
'install',
'changelog',
'build_docs',
'tag',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages
import sys

from release import NAME, VERSION, DESCRIPTION, AUTHOR_EMAIL, URL
from release import NAME, VERSION, DESCRIPTION, AUTHOR, AUTHOR_EMAIL, LICENSE, URL

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

0 comments on commit aca1f0a

Please sign in to comment.