FormingWorlds / PROTEUS

Coupled atmosphere-interior framework to simulate the temporal evolution of rocky planets.
https://fwl-proteus.readthedocs.io
Apache License 2.0
12 stars 1 forks source link

Add plots to CLI #151

Closed stefsmeets closed 2 months ago

stefsmeets commented 2 months ago

This PR refactors the plots and exposes them through the CLI. The plots can also be invoked directly.

Example:

$ proteus plot interior global --config init_coupler.toml
Plotting: global
Plotting: interior

which is the equivalent of:

python src/plot/cpl_interior.py init_coupler.toml

List all plots:

$ proteus plot --list
atmosphere atmosphere_cbar elements escape fluxes_atmosphere
fluxes_global global heatingrates interior interior_cbar
interior_cmesh observables offchem_grid_cross offchem_species
offchem_time offchem_year sflux sflux_cross stacked

Closes #143

Todo

Tested:

Not tested (data not available, needs vulcan run):

Not available through CLI yet:

stefsmeets commented 2 months ago

For testing the plots, in the absence of a full dataset, I would like to follow-up with a sample output dataset to work with, e.g. from proteus start --config inputs/default.toml. The data can be hosted in a separate repo, and we can use the matplotlib.testing module to help regression test the outputs.

stefsmeets commented 2 months ago

Hi @lsoucasse @nichollsh , this PR is ready. could you have a look at this PR and let me know what you think?

I changed all the plotting codes so that they have a consistent entry point (plot_xxx_entry), so that they take a Proteus object. There are no functional changes. All functions can still be invoked directly.

Other than that, most of the changes are of this kind: