Skip to content

Commit

Permalink
Merge pull request #388 from dirac-institute/eigen/fix_docs
Browse files Browse the repository at this point in the history
Make the docs buildable
  • Loading branch information
DinoBektesevic authored Nov 3, 2023
2 parents fc69675 + c908fff commit d997764
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 209 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Build and deploy docs
on:
pull_request:
branches:
- main
- 'doc/**'
- 'docs/**'
tags:
Expand Down
5 changes: 0 additions & 5 deletions docs/source/api_reference/image_info.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/source/api_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Object Search

run_search_referenceapi
search_referenceapi
image_info


Filtering Results
Expand Down
1 change: 0 additions & 1 deletion docs/source/api_reference/search_referenceapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ Module: search

.. automodule:: kbmod.search
:members:
:undoc-members:
:show-inheritance:
39 changes: 16 additions & 23 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ KBMOD (Kernel Based Moving Object Detection) is a GPU-accelerated framework for
:img-top: _static/getting_started.svg

Getting Started
^^^^^^^^^^^^^^^

Just found out about KBMOD? Crash course to what KBMOD can do,
guided through Jupyter Notebooks. Recommended to anyone looking
to see KBMOD in action.
^^^^^^^^^^^^^^^

Just found out about KBMOD? Crash course to what KBMOD can do, guided through Jupyter Notebooks. Recommended to anyone looking to see KBMOD in action.

+++

Expand All @@ -39,8 +37,7 @@ KBMOD (Kernel Based Moving Object Detection) is a GPU-accelerated framework for
User Manual
^^^^^^^^^^^

An in-depth guide through the basic concepts used by KBMOD. Recommended
to anyone looking to use KBMOD in their work.
An in-depth guide through the basic concepts used by KBMOD. Recommended to anyone looking to use KBMOD in their work.

+++

Expand All @@ -57,10 +54,7 @@ KBMOD (Kernel Based Moving Object Detection) is a GPU-accelerated framework for
API Reference
^^^^^^^^^^^^^

The API reference guide contains a detailed description of the functions,
modules, and objects included in KBMOD, which parameters to use and what
to expect as a returned value. For those interested in contributing, or
using KBMOD in their own work.
The API reference guide contains a detailed description of the functions, modules, and objects included in KBMOD, which parameters to use and what to expect as a returned value. For those interested in contributing, or using KBMOD in their own work.

+++

Expand All @@ -74,11 +68,10 @@ KBMOD (Kernel Based Moving Object Detection) is a GPU-accelerated framework for
.. grid-item-card::
:img-top: _static/contributor.svg

Contributors
Contributors
^^^^^^^^^^^^

Want to cite KBMOD? See changelog or release history? Nuts and bolts
of KBMOD mainly intended for developers and contributors to KBMOD.
Want to cite KBMOD? See changelog or release history? Nuts and bolts of KBMOD mainly intended for developers and contributors to KBMOD.

+++

Expand All @@ -89,7 +82,7 @@ KBMOD (Kernel Based Moving Object Detection) is a GPU-accelerated framework for

To the developers pages


Indices and tables
------------------

Expand All @@ -103,23 +96,23 @@ Indices and tables

.. toctree::
:maxdepth: 1

user_manual/index

.. toctree::
:maxdepth: 1

examples/index


.. toctree::
:maxdepth: 1

api_reference/index


.. toctree::
:maxdepth: 1

project_details/index

131 changes: 13 additions & 118 deletions notebooks/kbmod_analysis_demo.ipynb

Large diffs are not rendered by default.

90 changes: 45 additions & 45 deletions src/kbmod/search/pydocs/common_docs.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,62 +72,62 @@ static const auto DOC_PixelPos = R"doc(
Attributes
----------
x : `float`
An x position on an image (in fractional pixels).
y : `float`
An x position on an image (in fractional pixels).
x : `float`
An x position on an image (in fractional pixels).
y : `float`
An x position on an image (in fractional pixels).
)doc";

static const auto DOC_ImageMoments = R"doc(
The central moments of an image (capture how Gaussian-like an image is)
Attributes
----------
m00 : `float`
The m00 central moment.
m01 : `float`
The m01 central moment.
m10 : `float`
The m10 central moment.
m11 : `float`
The m11 central moment.
m02 : `float`
The m02 central moment.
m20 : `float`
The m20 central moment.
)doc";
m00 : `float`
The m00 central moment.
m01 : `float`
The m01 central moment.
m10 : `float`
The m10 central moment.
m11 : `float`
The m11 central moment.
m02 : `float`
The m02 central moment.
m20 : `float`
The m20 central moment.
)doc";

static const auto DOC_StampParameters = R"doc(
Parameters for stamp generation and filtering.
Attributes
----------
radius : `int`
The stamp radius (in pixels)
stamp_type : `StampType`
The co-add method to use for co-added stamps. Must be one of
STAMP_SUM, STAMP_MEAN, or STAMP_MEDIAN.
do_filtering : `bool`
Indicates whether to do stamp-based filtering.
center_thresh : `float`
The minimum percentage of total flux at the central pixels
for a valid coadded stamp.
peak_offset_x : `float`
The minimum x offset (in pixels) of the brightest location in the
coadded stamp to filter.
peak_offset_y : `float`
The minimum y offset (in pixels) of the brightest location in the
coadded stamp to filter.
m01_limit : `float`
The minimum m01 central moment to filter a coadded stamp.
m10_limit : `float`
The minimum m10 central moment to filter a coadded stamp.
m11_limit : `float`
The minimum m11 central moment to filter a coadded stamp.
m02_limit : `float`
The minimum m02 central moment to filter a coadded stamp.
m20_limit : `float`
The minimum m20 central moment to filter a coadded stamp.
radius : `int`
The stamp radius (in pixels)
stamp_type : `StampType`
The co-add method to use for co-added stamps. Must be one of
STAMP_SUM, STAMP_MEAN, or STAMP_MEDIAN.
do_filtering : `bool`
Indicates whether to do stamp-based filtering.
center_thresh : `float`
The minimum percentage of total flux at the central pixels
for a valid coadded stamp.
peak_offset_x : `float`
The minimum x offset (in pixels) of the brightest location in the
coadded stamp to filter.
peak_offset_y : `float`
The minimum y offset (in pixels) of the brightest location in the
coadded stamp to filter.
m01_limit : `float`
The minimum m01 central moment to filter a coadded stamp.
m10_limit : `float`
The minimum m10 central moment to filter a coadded stamp.
m11_limit : `float`
The minimum m11 central moment to filter a coadded stamp.
m02_limit : `float`
The minimum m02 central moment to filter a coadded stamp.
m20_limit : `float`
The minimum m20 central moment to filter a coadded stamp.
)doc";

} // namespace pydocs
Expand Down
8 changes: 4 additions & 4 deletions src/kbmod/search/pydocs/geom_docs.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ static const auto DOC_centered_range = R"doc(
The triplet (start, end, length) = [val-r, val+r, 2r+1] trimmed to fit
within [0, width] range.
Example
-------
Examples
--------
Interval of radius 1, centered on 5, i.e. [4, 5, 6]:
>>> centered_range(5, 1, 10)
Expand Down Expand Up @@ -130,8 +130,8 @@ static const auto DOC_anchored_block = R"doc(
Selected rectangle, such that the corner + width/height returns the
desired array slice.
Example
-------
Examples
--------
>>> img = numpy.arange(100).reshape(10, 10)
>>> rect = anchored_block((5, 5), 1, img.shape)
>>> rect
Expand Down
18 changes: 6 additions & 12 deletions src/kbmod/search/raw_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,20 +605,17 @@ static void raw_image_bindings(py::module& m) {
"get_pixel",
[](rie& cls, int i, int j) {
return cls.get_pixel({i, j});
},
pydocs::DOC_RawImage_get_pixel)
})
.def(
"pixel_has_data",
[](rie& cls, int i, int j) {
return cls.pixel_has_data({i, j});
},
pydocs::DOC_RawImage_pixel_has_data)
})
.def(
"set_pixel",
[](rie& cls, int i, int j, double val) {
cls.set_pixel({i, j}, val);
},
pydocs::DOC_RawImage_set_pixel)
})
// methods
.def("l2_allclose", &rie::l2_allclose, pydocs::DOC_RawImage_l2_allclose)
.def("compute_bounds", &rie::compute_bounds, pydocs::DOC_RawImage_compute_bounds)
Expand Down Expand Up @@ -647,20 +644,17 @@ static void raw_image_bindings(py::module& m) {
"create_stamp",
[](rie& cls, float x, float y, int radius, bool interp, bool keep_no_data) {
return cls.create_stamp({x, y}, radius, interp, keep_no_data);
},
pydocs::DOC_RawImage_create_stamp)
})
.def(
"interpolate",
[](rie& cls, float x, float y) {
return cls.interpolate({x, y});
},
pydocs::DOC_RawImage_interpolate)
})
.def(
"interpolated_add",
[](rie& cls, float x, float y, float val) {
cls.interpolated_add({x, y}, val);
},
pydocs::DOC_RawImage_interpolated_add);
});
}
#endif

Expand Down

0 comments on commit d997764

Please sign in to comment.