Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasdavis committed Nov 11, 2022
1 parent 3e5ede6 commit 5e25391
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 49 deletions.
47 changes: 13 additions & 34 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
dask_histogram
--------------

dask.array/NumPy-like API
^^^^^^^^^^^^^^^^^^^^^^^^^

.. currentmodule:: dask_histogram

.. autosummary::
:toctree: generated/

histogram
histogram2d
histogramdd


Collection API
^^^^^^^^^^^^^^

Expand All @@ -14,17 +27,6 @@ Collection API
factory
partitioned_factory

dask.array/NumPy-like API
^^^^^^^^^^^^^^^^^^^^^^^^^

.. currentmodule:: dask_histogram.routines

.. autosummary::
:toctree: generated/

histogram
histogram2d
histogramdd

boost-histogram-like API
^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -35,26 +37,3 @@ boost-histogram-like API
:toctree: generated/

Histogram

..
Reference
^^^^^^^^^
.. currentmodule:: dask_histogram
.. autofunction:: factory
.. autoclass:: AggHistogram
:members:
:autosummary:
.. autoclass:: PartitionedHistogram
:members:
:autosummary:

.. currentmodule:: dask_histogram.routines
.. autofunction:: histogram
.. autofunction:: histogram2d
.. autofunction:: histogramdd

.. currentmodule:: dask_histogram.boost
.. autoclass:: Histogram
:members:
:autosummary:
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.todo",
"autodocsumm",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dask[dataframe]
sphinx
autodocsumm
dask-sphinx-theme
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,20 @@ classifiers = [
"Topic :: Scientific/Engineering :: Physics",
]
dependencies = [
"boost-histogram>=1.2.0",
"boost-histogram>=1.3.2",
"dask>=2021.03.0",
]
dynamic = ["version"]

[project.optional-dependencies]
complete = [
"autodocsumm",
"dask-sphinx-theme >=3.0.2",
"dask[dataframe]",
"hist",
"pytest",
"sphinx >=4.0.0",
]
docs = [
"autodocsumm",
"dask-sphinx-theme >=3.0.2",
"dask[dataframe]",
"sphinx >=4.0.0",
Expand Down
8 changes: 4 additions & 4 deletions src/dask_histogram/boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class Histogram(bh.Histogram, family=dask_histogram):
See Also
--------
histogram
histogram2d
histogramdd
dask_histogram.histogram
dask_histogram.histogram2d
dask_histogram.histogramdd
Examples
--------
Expand Down Expand Up @@ -304,7 +304,7 @@ def __repr__(self) -> str:
)
ret += f",{newline}".join(repr(ax) for ax in self.axes)
ret += "{comma}{newline}storage={storage}".format(
storage=self._storage_type(),
storage=self.storage_type(),
newline=newline
if len(self.axes) > 1
else " "
Expand Down
6 changes: 3 additions & 3 deletions src/dask_histogram/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def clone(histref: bh.Histogram | None = None) -> bh.Histogram:
"""
if histref is None:
return bh.Histogram()
return bh.Histogram(*histref.axes, storage=histref._storage_type())
return bh.Histogram(*histref.axes, storage=histref.storage_type())


def _blocked_sa(
Expand Down Expand Up @@ -308,7 +308,7 @@ def histref(self) -> bh.Histogram:
@property
def _storage_type(self) -> type[bh.storage.Storage]:
"""Storage type of the histogram."""
return self.histref._storage_type
return self.histref.storage_type

@property
def ndim(self) -> int:
Expand Down Expand Up @@ -723,7 +723,7 @@ def to_dask_array(agghist: AggHistogram, flow: bool = False, dd: bool = False) -
shape = agghist.histref.shape
if flow:
shape = tuple(i + 2 for i in shape)
int_storage = agghist.histref._storage_type in (
int_storage = agghist.histref.storage_type in (
bh.storage.Int64,
bh.storage.AtomicInt64,
)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_obj_1D(use_weights):
h.fill(x, weight=weights)
h.compute()

control = bh.Histogram(*h.axes, storage=h._storage_type())
control = bh.Histogram(*h.axes, storage=h.storage_type())
if use_weights:
control.fill(x.compute(), weight=weights.compute())
else:
Expand Down Expand Up @@ -52,7 +52,7 @@ def test_obj_2D(use_weights):
h.fill(x, y, weight=weights)
h.compute()

control = bh.Histogram(*h.axes, storage=h._storage_type())
control = bh.Histogram(*h.axes, storage=h.storage_type())
if use_weights:
control.fill(x.compute(), y.compute(), weight=weights.compute())
else:
Expand Down Expand Up @@ -82,7 +82,7 @@ def test_obj_3D_rectangular(use_weights):
h.fill(x, weight=weights)
h.compute()

control = bh.Histogram(*h.axes, storage=h._storage_type())
control = bh.Histogram(*h.axes, storage=h.storage_type())
if use_weights:
control.fill(*(x.compute().T), weight=weights.compute())
else:
Expand Down

0 comments on commit 5e25391

Please sign in to comment.