Skip to content

Commit

Permalink
jinja2 CVE fix (#6992)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheorey authored Oct 1, 2024
1 parent e88c7b1 commit dd0d359
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 45 deletions.
48 changes: 8 additions & 40 deletions cpp/pybind/t/geometry/boundingvolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,51 +22,19 @@ void pybind_boundingvolume_declarations(py::module& m) {
std::shared_ptr<AxisAlignedBoundingBox>, Geometry,
DrawableGeometry>
aabb(m, "AxisAlignedBoundingBox",
R"(A bounding box that is aligned along the coordinate axes
and defined by the min_bound and max_bound."
- (min_bound, max_bound): Lower and upper bounds of the bounding box for all
axes.
- Usage
- AxisAlignedBoundingBox::GetMinBound()
- AxisAlignedBoundingBox::SetMinBound(const core::Tensor &min_bound)
- AxisAlignedBoundingBox::GetMaxBound()
- AxisAlignedBoundingBox::SetMaxBound(const core::Tensor &max_bound)
- Value tensor must have shape {3,}.
- Value tensor must have the same data type and device.
- Value tensor can only be float32 (default) or float64.
- The device of the tensor determines the device of the box.
R"(A bounding box that is aligned along the coordinate axes and
has the properties:
- color: Color of the bounding box.
- Usage
- AxisAlignedBoundingBox::GetColor()
- AxisAlignedBoundingBox::SetColor(const core::Tensor &color)
- Value tensor must have shape {3,}.
- Value tensor can only be float32 (default) or float64.
- Value tensor can only be range [0.0, 1.0].)");
- (``min_bound``, ``max_bound``): Lower and upper bounds of the bounding box for all axes. These are tensors with shape (3,) and a common data type and device. The data type can only be ``open3d.core.float32`` (default) or ``open3d.core.float64``. The device of the tensor determines the device of the box.
- ``color``: Color of the bounding box is a tensor with shape (3,) and a data type ``open3d.core.float32`` (default) or ``open3d.core.float64``. Values can only be in the range [0.0, 1.0].)");
py::class_<OrientedBoundingBox, PyGeometry<OrientedBoundingBox>,
std::shared_ptr<OrientedBoundingBox>, Geometry, DrawableGeometry>
obb(m, "OrientedBoundingBox",
R"(A bounding box oriented along an arbitrary frame of reference.
- (center, rotation, extent): The oriented bounding box is defined by its
center position, rotation maxtrix and extent.
- Usage
- OrientedBoundingBox::GetCenter()
- OrientedBoundingBox::SetCenter(const core::Tensor &center)
- OrientedBoundingBox::GetRotation()
- OrientedBoundingBox::SetRotation(const core::Tensor &rotation)
- Value tensor of center and extent must have shape {3,}.
- Value tensor of rotation must have shape {3, 3}.
- Value tensor must have the same data type and device.
- Value tensor can only be float32 (default) or float64.
- The device of the tensor determines the device of the box.
R"(A bounding box oriented along an arbitrary frame of reference
with the properties:
- color: Color of the bounding box.
- Usage
- OrientedBoundingBox::GetColor()
- OrientedBoundingBox::SetColor(const core::Tensor &color)
- Value tensor must have shape {3,}.
- Value tensor can only be float32 (default) or float64.
- Value tensor can only be range [0.0, 1.0].)");
- (``center``, ``rotation``, ``extent``): The oriented bounding box is defined by its center position (shape (3,)), rotation maxtrix (shape (3,3)) and extent (shape (3,)). Each of these tensors must have the same data type and device. The data type can only be ``open3d.core.float32`` (default) or ``open3d.core.float64``. The device of the tensor determines the device of the box.
- ``color``: Color of the bounding box is a tensor with shape (3,) and a data type ``open3d.core.float32`` (default) or ``open3d.core.float64``. Values can only be in the range [0.0, 1.0].)");
}
void pybind_boundingvolume_definitions(py::module& m) {
auto aabb = static_cast<py::class_<AxisAlignedBoundingBox,
Expand Down
6 changes: 3 additions & 3 deletions docs/make_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def generate_rst(self):
try:
module = self._try_import_module(module_name)
self._generate_module_class_function_docs(module_name, module)
except:
print("[Warning] Module {} cannot be imported.".format(
module_name))
except Exception as _e:
print(f"[Warning] Module {module_name} cannot be imported: "
f"{_e}.")

@staticmethod
def _get_documented_module_names():
Expand Down
5 changes: 3 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
docutils==0.20.1
furo==2023.9.10
jinja2==3.1.3
jinja2==3.1.4
m2r2==0.3.3.post2
matplotlib==3.7.3
nbsphinx==0.9.3
sphinx==7.1.2
nbconvert==6.5.4
lxml[html_clean]==5.2.1
lxml==5.2.1
lxml_html_clean==0.2.2

0 comments on commit dd0d359

Please sign in to comment.