Skip to content

feat: update plot API to use flat functions from PyAutoFit PR #1174 #18

@Jammy2211

Description

@Jammy2211

Overview

PyAutoFit PR PyAutoLabs/PyAutoFit#1174 replaced the class-based plotting API (NestPlotter, MCMCPlotter, MLEPlotter, SamplesPlotter) with simple module-level functions (e.g. aplt.corner_anesthetic(samples=s)). The autofit_workspace still uses the old class-based API in several scripts and has stale docstrings referencing the removed classes. This task updates all workspace scripts to use the new flat function API.

Plan

  • Migrate 6 scripts that still instantiate old plotter classes to the new flat function API
  • Update docstrings/comments in all 6 scripts/plot/*.py files that reference old class names
  • Regenerate notebooks from updated scripts
  • Verify no references to old plotter classes remain
Detailed implementation plan

Affected Repositories

  • autofit_workspace (primary)

Work Classification

Workspace

Branch Survey

Repository Current Branch Dirty?
autofit_workspace main smoke_tests.txt modified

Suggested branch: feature/plot-api-update

Implementation Steps

  1. scripts/cookbooks/samples.py — Replace plotter = aplt.MCMCPlotter(samples=result.samples); plotter.corner_cornerpy() with aplt.corner_cornerpy(samples=result.samples). Update docstring.

  2. scripts/cookbooks/search.py — Replace plotter = aplt.MCMCPlotter(samples=samples); plotter.corner_cornerpy(...) with aplt.corner_cornerpy(samples=samples, ...). Update docstring.

  3. scripts/overview/overview_1_the_basics.py — Replace plotter = aplt.NestPlotter(samples=result.samples); plotter.corner_anesthetic() with aplt.corner_anesthetic(samples=result.samples).

  4. scripts/howtofit/chapter_1_introduction/tutorial_5_results_and_samples.py — Replace plotter = aplt.MCMCPlotter(samples=result.samples); plotter.corner_cornerpy() with aplt.corner_cornerpy(samples=result.samples). Update docstring.

  5. scripts/howtofit/chapter_3_graphical_models/tutorial_1_individual_models.py — Replace plotter = aplt.NestPlotter(samples=samples); plotter.corner_cornerpy() with aplt.corner_cornerpy(samples=samples).

  6. scripts/howtofit/chapter_3_graphical_models/tutorial_3_graphical_benefits.py — Replace plotter = aplt.NestPlotter(samples=result_list[0].samples); plotter.corner_cornerpy() with aplt.corner_cornerpy(samples=result_list[0].samples).

  7. scripts/plot/*.py (6 files) — Update docstrings only (DynestyPlotter, NautilusPlotter, UltraNestPlotter, EmceePlotter, ZeusPlotter, PySwarmsPlotter).

  8. Regenerate notebooks from scripts.

Key Files

  • scripts/cookbooks/samples.py
  • scripts/cookbooks/search.py
  • scripts/overview/overview_1_the_basics.py
  • scripts/howtofit/chapter_1_introduction/tutorial_5_results_and_samples.py
  • scripts/howtofit/chapter_3_graphical_models/tutorial_1_individual_models.py
  • scripts/howtofit/chapter_3_graphical_models/tutorial_3_graphical_benefits.py
  • scripts/plot/DynestyPlotter.py
  • scripts/plot/NautilusPlotter.py
  • scripts/plot/UltraNestPlotter.py
  • scripts/plot/EmceePlotter.py
  • scripts/plot/ZeusPlotter.py
  • scripts/plot/PySwarmsPlotter.py

Original Prompt

Click to expand starting prompt

The following issue implements a plot interface udpate PyAutoLabs/PyAutoFit#1174

This never got implemented in @autofit_workspace, so we just need to apply the API updates there.

Do a quick check locally that indeed the old API is still present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions