Skip to content

Commit

Permalink
Readthedocs (#5)
Browse files Browse the repository at this point in the history
* comment out pyre and journal in meta.yaml

* commented back

* fixed more typos

* commented out --no-deps

* formatting

* sectioning

---------

Co-authored-by: Patrou, Maria <patroum@ornl.gov>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kyle Ma <maq1@ornl.gov>
  • Loading branch information
4 people authored Sep 23, 2024
1 parent 53b5dd7 commit 7a74f35
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: pre-commit
run: pre-commit run --all-files
- name: Install histogram
run: python -m pip install -e . --no-deps
run: python -m pip install -e .
- name: Run tests
run: xvfb-run --server-args="-screen 0 1920x1080x24" -a python -m pytest --cov --cov-report=xml --cov-report=term --cov-config=.coveragerc
- name: Upload coverage reports to Codecov
Expand Down
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "mambaforge-4.10"

python:
install:
- method: pip
path: .

sphinx:
builder: html
configuration: docs/sphinx/conf.py
fail_on_warning: true

conda:
environment: environment.yml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ histogram data object

.. code-block:: shell

$ pip install -e . --no-deps
$ pip install -e .

* Tests

Expand Down
9 changes: 5 additions & 4 deletions docs/sphinx/_static/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ body {
margin: 0;
/*min-width: 740px;*/

background-image:url('bg.png');
/* background-image:url('bg.png'); */
background-repeat:no-repeat;
background-position:bottom right;
background-color:#777777;
Expand Down Expand Up @@ -170,7 +170,7 @@ div.document {
/* opacity: 0.8;
filter:alpha(opacity=80); */
text-align: left;
background-image: url(contents.png);
/* background-image: url(contents.png); */
background-repeat: repeat-x;
}

Expand All @@ -195,7 +195,8 @@ div.related h3 {
}

div.related ul {
background-image: url(navigation.png);
/* background-image: url(navigation.png); */
background-color: black;
height: 2em;
list-style: none;
border-top: 1px solid #ddd;
Expand Down Expand Up @@ -545,7 +546,7 @@ ul.search {

ul.search li {
padding: 5px 0 5px 20px;
background-image: url(file.png);
/* background-image: url(file.png); */
background-repeat: no-repeat;
background-position: 0 7px;
}
Expand Down
6 changes: 3 additions & 3 deletions docs/sphinx/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
<table><tr>
<td>
<div style="text-align: left; padding: 7px 7px 10px 10px">
<a href="https://vnf.caltech.edu"><img class="logo" src="{{
pathto("_static/logo.png", 1) }}" border="0" alt="py4sci"
<a href="https://histogram-dev.readthedocs.io/en/latest/"><img class="logo" src="{{
pathto("_static\logo.png", 1) }}" border="0" alt="py4sci"
height="60"/></a>
</div>
</td>
<td style="padding: 0pt 0pt 1em 3em;">
<h1 class="title">
histogram
Histogram
</h1>
</td>
</tr>
Expand Down
8 changes: 6 additions & 2 deletions docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.pngmath",
"sphinx.ext.imgmath",
"sphinx.ext.ifconfig",
]

Expand Down Expand Up @@ -62,7 +62,7 @@

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None
language = "en"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -130,6 +130,10 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

html_css_files = [
"default.css",
]

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'
Expand Down
17 changes: 11 additions & 6 deletions docs/sphinx/install-details.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
:orphan:

.. _install-details:

Installation Details
Expand All @@ -19,13 +21,16 @@ Optionally, you may want to install:

Install
-------
The histogram package can be installed by using easy_install::
The histogram package can be installed by using pip install in editable mode currently::

$ git clone git@github.com:neutrons/histogram-dev.git.

Navigate to the root directory of histogram-dev:::

$ easy_install histogram
$ conda env create

Or you can download histogram package from
http://dev.danse.us/packages/histogram-0.2dev.tar.gz
(This will create an environment using the environment.yml file.)

Expand and enter it, and run::
To install the package, in the correct environment(histogram-dev)::

$ python setup.py install
$ pip install -e .
11 changes: 9 additions & 2 deletions docs/sphinx/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
Installation
============

The histogram package can be installed by using easy_install::
The histogram package can be installed by using pip install::

$ easy_install histogram
Download the source code from https://github.com/neutrons/histogram-dev.

To install:

$ pip install -e .

To test, in the root directory type:

pytest

:ref:`More details <install-details>`
2 changes: 1 addition & 1 deletion docs/sphinx/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Features
* :ref:`Easy access to data as numpy arrays <I_E2>`
* :ref:`Dump/load histograms in hdf format <save_load>`
* :ref:`Quick plot using matplotlib <plot>`
* Minimal GUI application that
* :ref:`Minimal GUI application that is easy to use <gui>`


Getting Started
Expand Down
15 changes: 11 additions & 4 deletions docs/sphinx/python-interface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ some meta data, and two main datasets: "data" and "errors".

* name: h.name()
* bin centers of an axis: h.<axisname>
- For example, a histogram has an axis named "x", then the bin
centers of "x" axis can be accessed as h.x.

- For example, a histogram has an axis named "x", then the bin centers of "x" axis can be accessed as h.x.

* data (the "intensities" array): h.I
* error squares (the squares of error bars array): h.E2

Expand Down Expand Up @@ -440,10 +441,16 @@ Save/load a histogram
^^^^^^^^^^^^^^^^^^^^^
You can save/load a histogram in hdf5 format.

* To save a histogram::
* To save a histogram

::

>>> from histogram.hdf import dump
>>> dump(h, 'myhist.h5')

* To load a histogram::
* To load a histogram

::

>>> from histogram.hdf import load
>>> h = load('myhist.h5')
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ dynamic = ["version"]
requires-python = ">=3.8"
dependencies = [
"numpy >= 1.20.3,< 2.0",
"pyre == 0.8.3",
"journal==0.8.4"
]
license = { text = "MIT" }
keywords = ["neutrons", "histogram", "python"]
Expand Down

0 comments on commit 7a74f35

Please sign in to comment.