Skip to content

Commit

Permalink
Add tutorials/extension to docs nav bar, create pip.txt (#128)
Browse files Browse the repository at this point in the history
* cap in description

* Add news for doc nav

* Install pip with pip.txt, conda with conda.txt

* Overall doc paths and nav

* Fix api doc table of content order

* Add news on adding tutorials
  • Loading branch information
bobleesj authored Oct 3, 2024
1 parent 2df560c commit c2ab7b0
Show file tree
Hide file tree
Showing 16 changed files with 94 additions and 54 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
:target: https://github.com/diffpy/diffpy.srmise/issues

implementation of the ParSCAPE algorithm for peak extraction from atomic pair distribution functions (PDFs)
Implementation of the ParSCAPE algorithm for peak extraction from atomic pair distribution functions (PDFs)

SrMise is an implementation of the `ParSCAPE algorithm
<https://dx.doi.org/10.1107/S2053273315005276>`_ for peak extraction from
Expand Down
4 changes: 2 additions & 2 deletions doc/source/extending.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _extending-srmise:
.. index:: extending-srmise

===================
Extending SrMise
Expand Down Expand Up @@ -47,7 +47,7 @@ To add a baseline, create a new module which defines a class inheriting from
which need to be implemented are summarized in the source code.


.. literalinclude:: ../../../diffpy/srmise/baselines/base.py
.. literalinclude:: ../../src/diffpy/srmise/baselines/base.py
:pyobject: BaselineFunction
:end-before: __init__

Expand Down
9 changes: 6 additions & 3 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,21 @@ https://github.com/diffpy/diffpy.srmise/graphs/contributors.
Installation
============

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

=================
Table of contents
=================
.. toctree::
:maxdepth: 1
:titlesonly:

license
release
tutorial/index
extending
Package API <api/diffpy.srmise>
release
license

=======
Indices
Expand Down
28 changes: 22 additions & 6 deletions doc/source/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,25 @@ OPEN SOURCE LICENSE AGREEMENT
=============================
BSD 3-Clause License

Copyright (c) 2024, The Trustees of Columbia University in
the City of New York.
All Rights Reserved.
Copyright 2014-2015, Board of Trustees of Michigan State University

Copyright 2016-2024, The Trustees of Columbia University in the City of New York.

All rights reserved.

If you use this program to do productive scientific research that
leads to publication, we ask that you acknowledge use of the
program by citing the following paper in your publication:

L. Granlund, S.J.L. Billinge, P.M. Duxbury, Algorithm for
systematic peak extraction from atomic pair distribution
functions, Acta Crystallographica A 71(4), 392-409 (2015).
doi:10.1107/S2053273315005276

For more information please visit the diffpy web-page at
http://www.diffpy.org
or email Luke Granlund at luke.r.granlund@gmail.com, or Prof. Simon
Billinge at sb2896@columbia.edu.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand All @@ -23,9 +39,9 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Expand Down
28 changes: 13 additions & 15 deletions doc/source/tutorial/abbreviations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,18 @@
.. |tar.gz| replace:: :source-release:`tar.gz`

.. Image substitutions
.. |images/extract_single_peak1.png| image:: ../../../examples/images/extract_single_peak1.png
.. |images/extract_single_peak2.png| image:: ../../../examples/images/extract_single_peak2.png
.. |images/extract_single_peak3.png| image:: ../../../examples/images/extract_single_peak3.png
.. |images/parameter_summary1.png| image:: ../../../examples/images/parameter_summary1.png
.. |images/parameter_summary2.png| image:: ../../../examples/images/parameter_summary2.png
.. |images/parameter_summary3.png| image:: ../../../examples/images/parameter_summary3.png
.. |images/parameter_summary4.png| image:: ../../../examples/images/parameter_summary4.png
.. |images/fit_initial1.png| image:: ../../../examples/images/fit_initial1.png
.. |images/fit_initial2.png| image:: ../../../examples/images/fit_initial2.png
.. |images/query_results1.png| image:: ../../../examples/images/query_results1.png
.. |images/query_results2.png| image:: ../../../examples/images/query_results2.png
.. |images/query_results3.png| image:: ../../../examples/images/query_results3.png

.. Links to non-tutorial parts of documentation.
.. |Extending SrMise| replace:: :ref:`extending-srmise`
.. |images/extract_single_peak1.png| ge:: ../../examples/images/extract_single_peak1.png
.. |images/extract_single_peak2.png| image:: ../../examples/images/extract_single_peak2.png
.. |images/extract_single_peak3.png| image:: ../../examples/images/extract_single_peak3.png
.. |images/parameter_summary1.png| image:: ../../examples/images/parameter_summary1.png
.. |images/parameter_summary2.png| image:: ../../examples/images/parameter_summary2.png
.. |images/parameter_summary3.png| image:: ../../examples/images/parameter_summary3.png
.. |images/parameter_summary4.png| image:: ../../examples/images/parameter_summary4.png
.. |images/fit_initial1.png| image:: ../../examples/images/fit_initial1.png
.. |images/fit_initial2.png| image:: ../../examples/images/fit_initial2.png
.. |images/query_results1.png| image:: ../../examples/images/query_results1.png
.. |images/query_results2.png| image:: ../../examples/images/query_results2.png
.. |images/query_results3.png| image:: ../../examples/images/query_results3.png

.. External links
.. _ParSCAPE algorithm: https://dx.doi.org/10.1107/S2053273315005276
Expand All @@ -42,3 +39,4 @@
.. |pi/Qmax| replace:: π/Q\ :sub:`max`

.. Links to PDF information defined in sample_links.txt
.. |Extending SrMise| replace:: :ref:`extending-srmise`
4 changes: 2 additions & 2 deletions doc/source/tutorial/extract_single_peak.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. include:: sample_links.txt


.. include:: ../../../examples/README
.. include:: ../../examples/README.rst
:start-after: ~Example 1~
:end-before: ~Example 2~

Expand All @@ -13,4 +13,4 @@
Script (extract_single_peak.py)
-------------------------------

.. literalinclude:: ../../../examples/extract_single_peak.py
.. literalinclude:: ../../examples/extract_single_peak.py
4 changes: 2 additions & 2 deletions doc/source/tutorial/fit_initial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. include:: sample_links.txt


.. include:: ../../../examples/README
.. include:: ../../examples/README.rst
:start-after: ~Example 3~
:end-before: ~Example 4~

Expand All @@ -13,4 +13,4 @@
Script (fit_initial.py)
---------------------------

.. literalinclude:: ../../../examples/fit_initial.py
.. literalinclude:: ../../examples/fit_initial.py
20 changes: 8 additions & 12 deletions doc/source/tutorial/index.rst
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
.. include:: abbreviations.txt


.. _tutorial:

===================
Tutorial
===================

.. include:: ../../../examples/README
.. include:: ../../examples/README.rst
:end-before: ~List of Examples~


.. Replace bare list from README
Examples
========

.. toctree::
:maxdepth: 1

extract_single_peak.rst
parameter_summary.rst
fit_initial.rst
query_results.rst
multimodel_known_uncertainties.rst
multimodel_unknown_uncertainties.rst
extract_single_peak
parameter_summary
fit_initial
query_results
multimodel_known_uncertainties
multimodel_unknown_uncertainties


.. Now add information about the samples
.. include:: ../../../examples/README
.. include:: ../../examples/README
:start-after: ~PDF Info~
6 changes: 3 additions & 3 deletions doc/source/tutorial/multimodel_known_uncertainties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. include:: sample_links.txt


.. include:: ../../../examples/README
.. include:: ../../examples/README.rst
:start-after: ~Example 5~
:end-before: ~Example 6~

Expand All @@ -14,12 +14,12 @@
Extraction Script (multimodel_known_dG1.py)
---------------------------------------------

.. literalinclude:: ../../../examples/multimodel_known_dG1.py
.. literalinclude:: ../../examples/multimodel_known_dG1.py


.. _multimodel_known_dG2.py:

Analysis Script (multimodel_known_dG2.py)
-----------------------------------------

.. literalinclude:: ../../../examples/multimodel_known_dG2.py
.. literalinclude:: ../../examples/multimodel_known_dG2.py
6 changes: 3 additions & 3 deletions doc/source/tutorial/multimodel_unknown_uncertainties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. include:: sample_links.txt


.. include:: ../../../examples/README
.. include:: ../../examples/README.rst
:start-after: ~Example 6~
:end-before: ~PDF Info~

Expand All @@ -14,12 +14,12 @@
Extraction Script (multimodel_unknown_dG1.py)
---------------------------------------------

.. literalinclude:: ../../../examples/multimodel_unknown_dG1.py
.. literalinclude:: ../../examples/multimodel_unknown_dG1.py


.. _multimodel_unknown_dG2.py:

Analysis Script (multimodel_unknown_dG2.py)
-------------------------------------------

.. literalinclude:: ../../../examples/multimodel_unknown_dG2.py
.. literalinclude:: ../../examples/multimodel_unknown_dG2.py
4 changes: 2 additions & 2 deletions doc/source/tutorial/parameter_summary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. include:: sample_links.txt


.. include:: ../../../examples/README
.. include:: ../../examples/README.rst
:start-after: ~Example 2~
:end-before: ~Example 3~

Expand All @@ -13,4 +13,4 @@
Script (parameter_summary.py)
-----------------------------

.. literalinclude:: ../../../examples/parameter_summary.py
.. literalinclude:: ../../examples/parameter_summary.py
4 changes: 2 additions & 2 deletions doc/source/tutorial/query_results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. include:: sample_links.txt


.. include:: ../../../examples/README
.. include:: ../../examples/README.rst
:start-after: ~Example 4~
:end-before: ~Example 5~

Expand All @@ -13,4 +13,4 @@
Script (query_results.py)
-------------------------

.. literalinclude:: ../../../examples/query_results.py
.. literalinclude:: ../../examples/query_results.py
24 changes: 24 additions & 0 deletions news/add-nav.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* add pip dependencies under pip.txt, conda dependencies under conda.txt
* add tutorial and extending examples to docs

**Security:**

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

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

[tool.black]
line-length = 115
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy
scipy
matplotlib

0 comments on commit c2ab7b0

Please sign in to comment.