Skip to content

Commit

Permalink
feat(OptPlotter): add skeleton from_autogenerated_figure class method
Browse files Browse the repository at this point in the history
  • Loading branch information
znicholls committed Apr 21, 2023
1 parent 4c232fb commit 4806acb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/openscm_calibration/scipy_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,19 @@ def callback_differential_evolution(
"""
self.update_plots()

@classmethod
def from_autogenerated_figure(cls) -> OptPlotter:
"""
Create plotter with automatic figure generation
Details are to be confirmed here: see issue #5
Returns
-------
:obj:`OptPlotter` initialised with generated figure
"""
raise NotImplementedError

def update_plots(self) -> None:
"""
Update all the plots
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/test_scipy_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ def test_timeseries_axes_convert_run_target_incompatible(dummy_init_kwargs):
OptPlotter(**dummy_init_kwargs)


def test_from_autogenerated_figure():
with pytest.raises(NotImplementedError):
OptPlotter.from_autogenerated_figure()


@patch("openscm_calibration.scipy_plotting.OptPlotter.__init__", return_value=None)
@patch("openscm_calibration.scipy_plotting.OptPlotter.update_plots")
def test_callback_minimize(mock_update_plots, mock_init):
Expand Down

0 comments on commit 4806acb

Please sign in to comment.