Skip to content

Commit 818c7b8

Browse files
committed
Add selected README content to the docs manually
1 parent dfd584d commit 818c7b8

File tree

3 files changed

+181
-25
lines changed

3 files changed

+181
-25
lines changed

docs/index.rst

Lines changed: 72 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,46 @@
1111
Welcome to boost-histogram's documentation!
1212
===========================================
1313

14-
Boost-histogram (`source <https://github.com/scikit-hep/boost-histogram>`__) is a Python package providing Python bindings for Boost.Histogram_ (`source <https://github.com/boostorg/histogram>`__). It can be installed with ``pip`` from PyPI_ or with ``conda`` via conda-forge_.
14+
|Gitter| |Build Status| |Actions Status| |Documentation Status| |DOI|
15+
|Code style: black| |PyPI version| |Conda-Forge| |Scikit-HEP|
16+
17+
Boost-histogram (`source <https://github.com/scikit-hep/boost-histogram>`__) is
18+
a Python package providing Python bindings for Boost.Histogram_ (`source
19+
<https://github.com/boostorg/histogram>`__). You can install this library from
20+
`PyPI <https://pypi.org/project/boost-histogram/>`__ with pip or you can use
21+
Conda via `conda-forge <https://github.com/conda-forge/boost-histogram-feedstock>`__:
22+
23+
.. code:: bash
24+
25+
python -m pip install boost-histogram
26+
27+
.. code:: bash
28+
29+
conda install -c conda-forge boost-histogram
30+
31+
All the normal best-practices for Python apply; you should be in a
32+
virtual environment, etc. See :ref:`usage-installation` for more details. An example of usage:
33+
34+
.. code:: python
35+
36+
import boost_histogram as bh
37+
38+
# Compose axis however you like; this is a 2D histogram
39+
hist = bh.Histogram(bh.axis.Regular(2, 0, 1),
40+
bh.axis.Regular(4, 0.0, 1.0))
41+
42+
# Filling can be done with arrays, one per dimension
43+
hist.fill([.3, .5, .2],
44+
[.1, .4, .9])
45+
46+
# Numpy array view into histogram counts, no overflow bins
47+
counts = hist.view()
48+
49+
See :ref:`usage-quickstart` for more.
1550

16-
.. _Boost.Histogram: https://www.boost.org/doc/libs/release/libs/histogram/doc/html/index.html
17-
.. _PyPI: https://pypi.org/project/boost-histogram
18-
.. _conda-forge: https://github.com/conda-forge/boost-histogram-feedstock
1951

2052
.. toctree::
21-
:maxdepth: 2
53+
:maxdepth: 1
2254
:caption: Contents:
2355

2456
usage/installation
@@ -33,8 +65,9 @@ Boost-histogram (`source <https://github.com/scikit-hep/boost-histogram>`__) is
3365
usage/numpy
3466
usage/comparison
3567

68+
3669
.. toctree::
37-
:maxdepth: 2
70+
:maxdepth: 1
3871
:caption: Examples:
3972

4073
notebooks/SimpleExample
@@ -43,15 +76,48 @@ Boost-histogram (`source <https://github.com/scikit-hep/boost-histogram>`__) is
4376
notebooks/xarray
4477
notebooks/BoostHistogramHandsOn
4578

79+
4680
.. toctree::
4781
:caption: API Reference:
4882

4983
api/modules
5084

85+
Acknowledgements
86+
----------------
87+
88+
This library was primarily developed by Henry Schreiner and Hans
89+
Dembinski.
90+
91+
Support for this work was provided by the National Science Foundation
92+
cooperative agreement OAC-1836650 (IRIS-HEP) and OAC-1450377
93+
(DIANA/HEP). Any opinions, findings, conclusions or recommendations
94+
expressed in this material are those of the authors and do not
95+
necessarily reflect the views of the National Science Foundation.
5196

5297
Indices and tables
5398
==================
5499

55100
* :ref:`genindex`
56101
* :ref:`modindex`
57102
* :ref:`search`
103+
104+
.. _Boost.Histogram: https://www.boost.org/doc/libs/release/libs/histogram/doc/html/index.html
105+
.. |Gitter| image:: https://badges.gitter.im/HSF/PyHEP-histogramming.svg
106+
:target: https://gitter.im/HSF/PyHEP-histogramming?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
107+
.. |Build Status| image:: https://dev.azure.com/scikit-hep/boost-histogram/_apis/build/status/bh-tests?branchName=develop
108+
:target: https://dev.azure.com/scikit-hep/boost-histogram/_build/latest?definitionId=2&branchName=develop
109+
.. |Actions Status| image:: https://github.com/scikit-hep/boost-histogram/workflows/Tests/badge.svg
110+
:target: https://github.com/scikit-hep/boost-histogram/actions
111+
.. |Documentation Status| image:: https://readthedocs.org/projects/boost-histogram/badge/?version=latest
112+
:target: https://boost-histogram.readthedocs.io/en/latest/?badge=latest
113+
.. |DOI| image:: https://zenodo.org/badge/148885351.svg
114+
:target: https://zenodo.org/badge/latestdoi/148885351
115+
.. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
116+
:target: https://github.com/ambv/black
117+
.. |PyPI version| image:: https://badge.fury.io/py/boost-histogram.svg
118+
:target: https://pypi.org/project/boost-histogram/
119+
.. |Conda-Forge| image:: https://img.shields.io/conda/vn/conda-forge/boost-histogram
120+
:target: https://github.com/conda-forge/boost-histogram-feedstock
121+
.. |Scikit-HEP| image:: https://scikit-hep.org/assets/images/Scikit--HEP-Project-blue.svg
122+
:target: https://scikit-hep.org/
123+

docs/usage/installation.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/usage/installation.rst

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
.. _usage-installation:
2+
3+
Installation
4+
============
5+
6+
7+
Boost-histogram (`source <https://github.com/scikit-hep/boost-histogram>`__) is a Python package providing Python bindings for Boost.Histogram_ (`source <https://github.com/boostorg/histogram>`__).
8+
9+
.. _Boost.Histogram: https://www.boost.org/doc/libs/release/libs/histogram/doc/html/index.html
10+
11+
12+
You can install this library from
13+
`PyPI <https://pypi.org/project/boost-histogram/>`__ with pip:
14+
15+
.. code:: bash
16+
17+
python -m pip install boost-histogram
18+
19+
or you can use Conda through
20+
`conda-forge <https://github.com/conda-forge/boost-histogram-feedstock>`__:
21+
22+
.. code:: bash
23+
24+
conda install -c conda-forge boost-histogram
25+
26+
All the normal best-practices for Python apply; you should be in a
27+
virtual environment, etc.
28+
29+
30+
31+
Supported platforms
32+
-------------------
33+
34+
Binaries available:
35+
^^^^^^^^^^^^^^^^^^^
36+
37+
These are the supported platforms for which wheels are produced:
38+
39+
=========================== =========== =======================
40+
System Arch Python versions
41+
=========================== =========== =======================
42+
ManyLinux1 (custom GCC 9.2) 64 & 32-bit 2.7, 3.5, 3.6, 3.7, 3.8
43+
ManyLinux2010 64-bit 2.7, 3.5, 3.6, 3.7, 3.8
44+
macOS 10.9+ 64-bit 2.7, 3.6, 3.7, 3.8
45+
Windows 64 & 32-bit 2.7, 3.6, 3.7, 3.8
46+
=========================== =========== =======================
47+
48+
- Linux: I’m not supporting 3.4 because I have to build the Numpy
49+
wheels to do so.
50+
- manylinux1: Using a custom docker container with GCC 9.2; should work
51+
but can’t be called directly other compiled extensions unless they do
52+
the same thing (think that’s the main caveat). Supporting 32 bits
53+
because it’s there.
54+
- manylinux2010: Requires pip 10+ and a version of Linux newer than
55+
2010. This is very new technology.
56+
- MacOS: Uses the dedicated 64 bit 10.9+ Python.org builds. We are not
57+
supporting 3.5 because those no longer provide binaries (could add a
58+
32+64 fat 10.6+ that really was 10.9+, but not worth it unless there
59+
is a need for it).
60+
- Windows: PyBind11 requires compilation with a newer copy of Visual
61+
Studio than Python 2.7’s Visual Studio 2008; you need to have the
62+
`Visual Studio 2015
63+
distributable <https://www.microsoft.com/en-us/download/details.aspx?id=48145>`__
64+
installed (the dll is included in 2017 and 2019, as well).
65+
66+
If you are on a Linux system that is not part of the “many” in
67+
manylinux, such as Alpine or ClearLinux, building from source is usually
68+
fine, since the compilers on those systems are often quite new. It will
69+
just take a little longer to install when it’s using the sdist instead
70+
of a wheel.
71+
72+
Conda-Forge
73+
^^^^^^^^^^^
74+
75+
The boost-histogram package is available on Conda-Forge, as well. All
76+
supported versions are available with the exception of Windows + Python
77+
2.7, which cannot built due to the age of the compiler. Please use Pip
78+
if you *really* need Python 2.7 on Windows. You will also need the VS
79+
2015 distributable, as described above.
80+
81+
::
82+
83+
conda install -c conda-forge boost-histogram
84+
85+
Source builds
86+
^^^^^^^^^^^^^
87+
88+
For a source build, for example from an “sdist” package, the only
89+
requirements are a C++14 compatible compiler. The compiler requirements
90+
are dictated by Boost.Histogram’s C++ requirements: gcc >= 5.5, clang >=
91+
3.8, msvc >= 14.1. You should have a version of pip less than 2-3 years
92+
old (10+).
93+
94+
If you are using Python 2.7 on Windows, you will need to use a recent
95+
version of Visual studio and force distutils to use it, or just upgrade
96+
to Python 3.6 or newer. Check the PyBind11 documentation for `more
97+
help <https://pybind11.readthedocs.io/en/stable/faq.html#working-with-ancient-visual-studio-2009-builds-on-windows>`__.
98+
On some Linux systems, you may need to use a newer compiler than the one
99+
your distribution ships with.
100+
101+
Numpy is downloaded during the build (enables multithreaded builds).
102+
Boost is not required or needed (this only depends on included
103+
header-only dependencies).This library is under active development; you
104+
can install directly from GitHub if you would like.
105+
106+
.. code:: bash
107+
108+
python -m pip install git+https://github.com/scikit-hep/boost-histogram.git@develop
109+

0 commit comments

Comments
 (0)