Resolve "Add DAG-based generic plot functions using xarray faceting to automatically represent high-dimensional data"

What does this MR do?

This MR implements a generic facet_grid plot compatible with the DAG capabilities and usable with the both the universe as well as the multiverse plot creators. The function calls the xr.DataArray.plot or xr.Dataset.plot function directly which return automatically layouted visualizations of the data in form of a xarray.FacetGrid object. If a user wants to specify the plot to be generated, he/she can specify the plot kind which wraps all available xarray.plot.<kind> functions (c.f. their docu).

I suspect the function to also be compatible with pandas objects, so they should not only be limited to xarray data structures. :)

Resulting figures from the FFM model config

Just change a single line of configuration 😍

tree_density_facet_grid_2D.pdf tree_density_facet_grid_2D.pdf tree_density_facet_grid_2D.pdf tree_density_facet_grid_2D.pdf tree_density_facet_grid_1D.pdf

Up for discussion

  • Should we include an example run-eval configuration pair in the ForestFire model within a cfgs folder inside of the model directory? This would have a few advantages:
    1. Easily recreate ForestFire default plots.
    2. Having blueprint config available for the FFM that can easily be adapted.
    3. Could include the run and eval in the CI model tests to let multiverse plots be easily tested.
  • Should we add this generic plot in the CopyMeGrid/Graph models as disabled multiverse plots?
  • enough documentation?

Is there something that needs to be double checked?

Can this MR be accepted?

  • Implemented the changes
    • Implemented the generic facet_grid plot --> in utopia/dantro!153
    • Implemented two example plot functions in the FFM that plot tree densities for different seeds and lightning probabilities as an example.
      • Test them in the GitLab ci pipeline
    • Included the facet_grid plot in the base_plots.yml configuration as include from dantros external plot functions
    • Implemented examples in CopyMeGrid and CopyMeGraph
      • Added multiverse run-eval configuration example containing the facet_grid plot
      • Added facet_grid in the base configurations
  • Added Model.run_and_eval_cfg_paths method to dynamically find additional run and eval configuration pairs
  • Added or extended tests
    • facet_grid integration test for several models
    • Models test their additional configurations
    • Model.run_and_eval_cfg_paths test
  • Added or updated documentation: Included the plot function in the base_plots.yml DAG related plotting functions
  • Reasonably up-to-date with current master
  • Pipeline passing without warnings
  • History cleaned up (do not squash!)
  • Approved by @herdeanu
  • Approved by @blsqr (once discussions are resolved)

Related issues

Closes #106 (closed)

Edited by Utopia Developers

Merge request reports

Loading