Skip to content

Commit

Permalink
chore(docs): cleanup (and lint) (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeertmans authored Jan 7, 2025
1 parent f202738 commit 7a0117e
Show file tree
Hide file tree
Showing 7 changed files with 417 additions and 414 deletions.
12 changes: 6 additions & 6 deletions differt/tests/geometry/test_triangle_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_num_triangles(self, two_buildings_mesh: TriangleMesh) -> None:
def test_num_quads(self, two_buildings_mesh: TriangleMesh) -> None:
with pytest.raises(
ValueError,
match="Cannot access the number of quadrilaterals if 'assume_quads' is set to 'False'.",
match=r"Cannot access the number of quadrilaterals if 'assume_quads' is set to 'False'.",
):
_ = two_buildings_mesh.num_quads

Expand Down Expand Up @@ -212,38 +212,38 @@ def test_plane(self, key: PRNGKeyArray) -> None:

with pytest.raises(
ValueError,
match="You must specify either of both of 'vertex_b' and 'vertex_c', or none.",
match=r"You must specify either of both of 'vertex_b' and 'vertex_c', or none.",
):
_ = TriangleMesh.plane(vertex_a, vertex_b) # type: ignore[reportCallIssue]

with pytest.raises(
ValueError,
match=re.escape(
"You must specify either of both of 'vertex_b' and 'vertex_c', or none."
r"You must specify either of both of 'vertex_b' and 'vertex_c', or none."
),
):
_ = TriangleMesh.plane(vertex_a, vertex_c=vertex_c) # type: ignore[reportCallIssue]

with pytest.raises(
ValueError,
match=re.escape(
"You must specify one of ('vertex_b', 'vertex_c') or 'normal', not both."
r"You must specify one of ('vertex_b', 'vertex_c') or 'normal', not both."
),
):
_ = TriangleMesh.plane(vertex_a, vertex_b, vertex_c, normal=normal)

with pytest.raises(
ValueError,
match=re.escape(
"You must specify one of ('vertex_b', 'vertex_c') or 'normal', not both."
r"You must specify one of ('vertex_b', 'vertex_c') or 'normal', not both."
),
):
_ = TriangleMesh.plane(vertex_a, vertex_b, vertex_c, normal=normal)

with pytest.raises(
ValueError,
match=re.escape(
"You must specify one of ('vertex_b', 'vertex_c') or 'normal', not both."
r"You must specify one of ('vertex_b', 'vertex_c') or 'normal', not both."
),
):
_ = TriangleMesh.plane(center) # type: ignore[reportCallIssue]
Expand Down
4 changes: 2 additions & 2 deletions differt/tests/geometry/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ def test_rotation_matrices(
jnp.float32,
pytest.raises(
ValueError,
match="Unsupported dtype <class 'int'>, must be a floating dtype.",
match=r"Unsupported dtype <class 'int'>, must be a floating dtype.",
),
),
(
jnp.int32,
jnp.float32,
pytest.raises(
ValueError,
match="Unsupported dtype <class 'jax.numpy.int32'>, must be a floating dtype.",
match=r"Unsupported dtype <class 'jax.numpy.int32'>, must be a floating dtype.",
),
),
],
Expand Down
2 changes: 1 addition & 1 deletion differt/tests/plotting/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_use_unsupported() -> None:
with (
pytest.raises(
ValueError,
match="The backend 'bokeh' is not supported. We currently support:",
match=r"The backend 'bokeh' is not supported. We currently support:",
),
use(backend="bokeh"),
):
Expand Down
2 changes: 1 addition & 1 deletion differt/tests/rt/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def test_rays_intersect_any_triangle(
1, # Impossible to find all visible faces with few rays
pytest.raises(
AssertionError,
match="Number of visible triangles did not match expectation.",
match=r"Number of visible triangles did not match expectation.",
),
),
],
Expand Down
2 changes: 1 addition & 1 deletion differt/tests/scene/test_sionna.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_download_sionna_scenes_existing_empty_folder(empty_folder: Path) -> Non


def test_download_sionna_scenes_existing_non_empty_folder(sionna_folder: Path) -> None:
with pytest.raises(OSError, match="[Dd]irectory (is )?not empty"):
with pytest.raises(OSError, match=r"[Dd]irectory (is )?not empty"):
download_sionna_scenes(folder=sionna_folder, cached=False)


Expand Down
803 changes: 403 additions & 400 deletions docs/source/notebooks/multipath.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/source/notebooks/sampling_paths.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4585,7 +4585,7 @@
" )[1]\n",
"\n",
" @classmethod\n",
" def load(cls, url: str, **kwargs: Any) -> \"Self\":\n",
" def load(cls, url: str, **kwargs: Any) -> \"Model\":\n",
" \"\"\"Load a model from a remote URL.\n",
"\n",
" This is a convenient method to load a model from pre-trained\n",
Expand Down Expand Up @@ -4617,9 +4617,9 @@
" bar.update(block_count * block_size - bar.n)\n",
"\n",
" model = eqx.filter_eval_shape(cls, **kwargs)\n",
" filename, _ = urllib.request.urlretrieve(url, reporthook=reporthook)\n",
" filename, _ = urllib.request.urlretrieve(url, reporthook=reporthook) # noqa: S310\n",
"\n",
" with open(filename, \"rb\") as f:\n",
" with open(filename, \"rb\") as f: # noqa: PTH123\n",
" return eqx.tree_deserialise_leaves(f, model)"
]
},
Expand Down

0 comments on commit 7a0117e

Please sign in to comment.