graphnet_writer

Module containing `GraphNeTFileSaveMethod`(s).

These modules are used to save the interim data format from DataConverter to a deep-learning friendly file format.

class graphnet.data.writers.graphnet_writer.GraphNeTWriter(name, class_name, level, log_folder, **kwargs)[source]

Bases: Logger, ABC

Generic base class for saving interim data format in DataConverter.

Classes inheriting from GraphNeTFileSaveMethod must implement the save_file method, which recieves the interim data format from from a single file.

In addition, classes inheriting from GraphNeTFileSaveMethod must set the file_extension property.

Construct Logger.

Parameters:
  • name (str | None)

  • class_name (str | None)

  • level (int)

  • log_folder (str | None)

  • kwargs (Any)

abstract merge_files(files, output_dir)[source]

Merge smaller files.

Parameters:
  • files (List[str]) – Files to be merged.

  • output_dir (str) – The directory to store the merged files in.

Return type:

None

property file_extension: str

Return file extension used to store the data.

property expects_merged_dataframes: bool

Return if writer expects input to be merged dataframes or not.