Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/contributor/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Otherwise **`cz bump`** can keep treating breaking changes on **0.x** as minor b

## 3. Update the contributor guide

Delete this file and update {doc}`./index` to remove the `going-stable-1-0`toctree entry.
Delete this file and update {doc}`./index` to remove the `going-stable-1-0` toctree entry.

## 4. Cutting 1.0.0

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ as defined in [Towards the certification of AI-based systems](https://doi.org/10

## Where does it fit in my workflow?

RAITAP is configured via YAML [Hydra](https://hydra.cc/) configs or CLI flags, and then ran via a CLI command.
RAITAP is configured via YAML [Hydra](https://hydra.cc/) configs or CLI flags, and then run via a CLI command.

This means it can be used either as:

Expand Down
2 changes: 1 addition & 1 deletion docs/using-raitap/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pip install raitap
```

:::{note}
RAITAP was currently tested with Python 3.13.x. Ensure your project matches this requirement, or expect possible issues.
RAITAP is currently tested with Python 3.13.x. Ensure your project matches this requirement, or expect possible issues.
:::

## 2. Install optional dependencies
Expand Down
6 changes: 3 additions & 3 deletions src/raitap/transparency/visualisers/tests/test_visualisers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ def test_visualise_tensor(self, sample_images: torch.Tensor) -> None:

fig = visualiser.visualise(attributions)
assert fig is not None
assert len(fig.axes) >= 4 # at least one axes per sample
assert len(fig.axes) == 8 # 2 axes per sample (original + attribution) for 4 samples
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comment claims the 8 axes are from “original + attribution”, but this test calls visualise(attributions) without inputs, so the original-image panel cannot be rendered. Either pass inputs=sample_images (and update the expected axes count accordingly), or update the comment/expectation to reflect what actually creates the extra axes here (typically Captum’s per-sample colorbar axes when show_colorbar=True).

Suggested change
assert len(fig.axes) == 8 # 2 axes per sample (original + attribution) for 4 samples
assert len(fig.axes) == 8 # 2 axes per sample for 4 samples: attribution plot + colorbar

Copilot uses AI. Check for mistakes.

@pytest.mark.usefixtures("needs_captum")
def test_max_samples_limit(self) -> None:
visualiser = CaptumImageVisualiser(method="heat_map")
large_batch = torch.randn(64, 3, 32, 32)

fig = visualiser.visualise(large_batch, max_samples=4)
assert len(fig.axes) >= 4
assert len(fig.axes) == 8

@pytest.mark.usefixtures("needs_captum")
def test_overlay_with_inputs(self, sample_images: torch.Tensor) -> None:
Expand Down Expand Up @@ -81,7 +81,7 @@ def test_can_disable_original_image_panel(self, sample_images: torch.Tensor) ->

fig = visualiser.visualise(attributions, inputs=sample_images, max_samples=2)

assert len(fig.axes) >= 2
assert len(fig.axes) == 2
assert fig.axes[0].get_title() == ""
Comment on lines 82 to 85
Copy link

Copilot AI Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CaptumImageVisualiser defaults to show_colorbar=True, and in the non-paired layout Captum typically adds an extra colorbar axis per sample. With max_samples=2 this usually yields 4 axes (2 plots + 2 colorbars), so len(fig.axes) == 2 is likely incorrect/flaky. To assert exactly 2 axes, set show_colorbar=False for this test, or update the expected axes count to include the colorbar axes.

Copilot uses AI. Check for mistakes.

@pytest.mark.usefixtures("needs_captum")
Expand Down
Loading