Skip to content

neptoon.visulisation

figures_handler

Classes:

Functions:

FigureMetadata dataclass

FigureMetadata(topic, description, required_columns, method)

Key information on each figure created.

topic : FigureTopic The topic the figure is related to description : str A brief description about the figure required_columns: List[str] The columns required for this particular figure. method : callable The method (found in FigureHandler) which will be called to produce this figure.

TempFigure dataclass

TempFigure(name, path, topic)

Tracks a temporary figure file

name : str Name of the figure

TempFigureHandler

TempFigureHandler(site_id)

Handles the creation and storage of figures made with the FigureHandler by creating a temp directory, recording paths for each figure, and removing temp files upon program exit.

store_figure

store_figure(name, topic)

Stores metadata of temporary figure storage

Parameters:

Name Type Description Default
name str

name of the figure being stored

required
topic FigureTopic

Topic the figure is part of (e.g., NMDB, or Soil)

required

Returns:

Type Description
Path

Path of the temp figure

cleanup

cleanup()

Remove temporary directory and files

get_figures

get_figures(topic=None)

Collect the figures that are saved

Parameters:

Name Type Description Default
topic FigureTopic

Topic the figure is part of (e.g., NMDB, or Soil)

None

Returns:

Type Description
List[TempFigure]

A list of TempFigure objects with location of save files.

FigureHandler

FigureHandler(data_frame, sensor_info, create_all=False, ignore_sections=None, selected_figures=None, show_figures=False, backend='Agg')

Class to manage creating figures when data has been processed using the CRNSDataHub.

create_figures

create_figures()

Creates the figures