yieldplotlib.core.file_nodes#

Base module for all common file-type nodes.

Classes#

FileNode

A generic node for handling files.

CSVFile

Represents a CSV file and its associated data.

JSONFile

Node for handling JSON files and their associated data.

PickleFile

Node for handling generic pickle files and their associated data.

FitsFile

Node for handling generic fits files and their associated data.

Module Contents#

class yieldplotlib.core.file_nodes.FileNode(file_path)[source]#

Bases: yieldplotlib.core.node.Node

A generic node for handling files.

Parameters:

file_path (pathlib.Path)

get_file_key_map()[source]#

Get a list of keys expected to be in this file based on the key map.

get(key, **kwargs)[source]#

Translate the key and delegate to the subclass-specific _get method.

Parameters:

key (str)

abstractmethod _get(translated_key, **kwargs)[source]#

Subclass-specific method to retrieve the data associated with the key.

Args:

translated_key: The key to look up in the data. **kwargs: Additional arguments that may be used by specific implementations.

Parameters:

translated_key (str)

transform_data(key, data, type_override=None, value_override=None, **kwargs)[source]#

Apply key-specific data transformations defined in the subclass.

Parameters:

key (str)

class yieldplotlib.core.file_nodes.CSVFile(file_path)[source]#

Bases: FileNode

Represents a CSV file and its associated data.

Parameters:

file_path (pathlib.Path)

load()[source]#

Load the CSV file into memory.

_get(key, **kwargs)[source]#

Return the data associated with the key.

Parameters:

key (str)

class yieldplotlib.core.file_nodes.JSONFile(file_path)[source]#

Bases: FileNode

Node for handling JSON files and their associated data.

Parameters:

file_path (pathlib.Path)

load()[source]#

Load the JSON file into memory.

_get(key, **kwargs)[source]#

Return the data associated with the key.

Parameters:

key (str)

class yieldplotlib.core.file_nodes.PickleFile(file_path)[source]#

Bases: FileNode

Node for handling generic pickle files and their associated data.

Parameters:

file_path (pathlib.Path)

load()[source]#

Load the pickle file into memory.

_get(key, **kwargs)[source]#

Return the data associated with the key.

Parameters:

key (str)

class yieldplotlib.core.file_nodes.FitsFile(file_path)[source]#

Bases: FileNode

Node for handling generic fits files and their associated data.

Parameters:

file_path (pathlib.Path)

file_name#
load()[source]#

Load the fits file.

_get(key, **kwargs)[source]#

Return the data associated with the key.

Parameters:

key (str)