Skip to content

Commit

Permalink
Merge resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
voetberg committed Jun 24, 2024
1 parent cd1a7fb commit 2c39530
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/plots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from plots.predictive_posterior_check import PPC
from plots.predictive_prior_check import PriorPC
from plots.parity import Parity
from plots.predictive_prior_check import PriorPC

Plots = {
CDFRanks.__name__: CDFRanks,
Expand All @@ -14,6 +15,6 @@
TARP.__name__: TARP,
"LC2ST": LocalTwoSampleTest,
PPC.__name__: PPC,
PriorPC.__name__: PriorPC,
"Parity": Parity
"Parity": Parity,
PriorPC.__name__: PriorPC
}
5 changes: 3 additions & 2 deletions src/utils/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
"coverage_sigma": 3
},
"LC2ST": {},
"Parity":{},
"PPC": {},
"PriorPC":{},
"Parity":{}
"PriorPC":{}

},
"metrics_common": {
"use_progress_bar": False,
Expand Down
19 changes: 15 additions & 4 deletions tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
CoverageFraction,
TARP,
LocalTwoSampleTest,
PPC,
PPC,
PriorPC,
Parity
)
Expand Down Expand Up @@ -80,10 +80,7 @@ def test_ppc(plot_config, mock_model, mock_data, mock_2d_data, result_output):
plot = PPC(mock_model, mock_data, save=True, show=False)
plot(**get_item("plots", "PPC", raise_exception=False))
assert os.path.exists(f"{plot.out_dir}/{plot.plot_name}")
<<<<<<< HEAD

=======
>>>>>>> 9d57556 (Update existing plots and metrics to work with 2d #72)
plot = PPC(
mock_model,
mock_2d_data, save=True, show=False,
Expand All @@ -98,6 +95,20 @@ def test_prior_pc(plot_config, mock_model, mock_data):
plot(**get_item("plots", "PriorPC", raise_exception=False))
assert os.path.exists(f"{plot.out_dir}/{plot.plot_name}")


def test_prior_pc(plot_config, mock_model, mock_2d_data, mock_data, result_output):
Config(plot_config)
plot = PriorPC(mock_model, mock_data, save=True, show=False)
plot(**get_item("plots", "PriorPC", raise_exception=False))
assert os.path.exists(f"{plot.out_dir}/{plot.plot_name}")
plot = PPC(
mock_model,
mock_2d_data, save=True, show=False,
out_dir=f"{result_output.strip('/')}/mock_2d/")
assert type(plot.data.simulator).__name__ == "Mock2DSimulator"
plot(**get_item("plots", "PPC", raise_exception=False))
assert os.path.exists(f"{plot.out_dir}/{plot.plot_name}")

def test_parity(plot_config, mock_model, mock_data):
Config(plot_config)
plot = Parity(mock_model, mock_data, save=True, show=False)
Expand Down

0 comments on commit 2c39530

Please sign in to comment.