xbudget.display.show_recipe

xbudget.display.show_recipe(recipe, budget=None)[source]

Display a recipe as a collapsible tree.

Parameters:
  • recipe (dict) – A recipe in xbudget format (e.g. from load_preset_budget()).

  • budget (str, optional) – Show only this budget ("mass", "heat", "salt"). Default: all budgets in the recipe.

Returns:

An object that renders as a collapsible HTML tree in a Jupyter/VSCode notebook and as an indented ASCII tree when repr()-ed or printed.

Return type:

_RecipeView

Examples

>>> import xbudget
>>> recipe = xbudget.load_preset_budget("MOM6")
>>> xbudget.show_recipe(recipe, "heat")