Skip to content

Commit 68fb53b

Browse files
authored
refactor: add dataclass support pairplot configurations (#1631)
* refactor(plot): define plotting configuration dataclasses * refactor(plot): refactor plotting functions and add dataclasses to plotting function arguments * refactor(plot): move plotting helper functions to separate file * refactor(plot): Remove MPlKwargs dataclass and update FigKwargs usage * refactor(plot): add KwargsType for function annotation * refactor(plot): add docstrings to base classes and remove setting color to mpl kwargs by default * docs(plot): add docstrings to plotting functions * docs(plot): update plotting tutorial * add license header * docs(plot): update pairplot and mariginal pairplot docstrings * chore: update variable name * chore: update Kwargs variable name to Options * plot(FigOptions): remove nested dataclasses and add docstring * plot: update dictinary usage of fig_kwargs options to use dataclass fields * docs(plot): update plotting functionality tutorial * docs: include migration note for plotting functionality * chore: include plotting dataclasses in init file * plot: add plotting style validation * chore: fix error message * chore: update color selection logic to avoid index error * test: add plotting dataclass tests * chore: check for mismatching pairplot arguments * chore: rename test functions
1 parent 4d1dc5f commit 68fb53b

File tree

7 files changed

+1134
-545
lines changed

7 files changed

+1134
-545
lines changed

docs/advanced_tutorials/17_plotting_functionality.ipynb

Lines changed: 96 additions & 81 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ dev = [
7979
# Test
8080
"pytest",
8181
"pytest-cov",
82-
"pytest-testmon",
83-
"pytest-xdist",
8482
"pytest-harvest",
83+
"pytest-mock",
8584
"pytest-split",
85+
"pytest-testmon",
86+
"pytest-xdist",
8687
"torchtestcase",
8788
]
8889

sbi/analysis/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@
1919
pp_plot_lc2st,
2020
sbc_rank_plot,
2121
)
22+
from sbi.analysis.plotting_classes import (
23+
ContourOffDiagOptions,
24+
FigOptions,
25+
HistDiagOptions,
26+
HistOffDiagOptions,
27+
KdeDiagOptions,
28+
KdeOffDiagOptions,
29+
PlotOffDiagOptions,
30+
ScatterDiagOptions,
31+
ScatterOffDiagOptions,
32+
)
2233
from sbi.analysis.sensitivity_analysis import ActiveSubspace
2334
from sbi.analysis.tensorboard_output import list_all_logs, plot_summary
2435

0 commit comments

Comments
 (0)