Figure Modules Organization

Web site figures are generated by code modules stored in the nowcast/figures/ directory tree.

In Python terms, that directory is a namespace from which figure modules can be imported:

  • nowcast.figures

Within that namespace the figure-producing functions are organized into a module for each figure. So, for example, the nowcast.figures.day_avg_tracer module contains the code to produce a figure showing colour contours of the day averaged surface field of a tracer for the full model domain.

The code in the figure modules is just the code that is specific to creating that one figure. Generic functions that are useful in the creation of more than one figure are collected in the nowcast.figures.shared module.

The Creating a Figure Module docs contain a detailed element-by-element discussion of how to create and structure a web site figure module. They use the nowcast.figures.day_avg_tracer module as an example.

The DevelopDayAvgTracer notebook in notebooks/figures/ is an example of developing figure module functions in a Jupyter notebook. You can take that approach if you wish, or you can develop directly in a module.

Of course, the ultimate goal is to produce a module. Once you’ve got a code module, you should create a notebook that tests it in the nowcast system context. The TestDayAvgTracer notebook in notebooks/figures/ is an example of a test notebook for the nowcast.figures.day_avg_tracer module.