File Loader API

File loaders live in the top-level fileloader package. Each loader exposes title and load_data(file_path).

Package Contract

Data loader modules for PhysPlot.

Each loader module should expose a load_data(file_path) function that returns a 2D array-like object suitable for loading into the table.

Input data structure:

Loader modules receive a file path chosen from the import dialog.

Return type:

Loader modules return a rectangular two-dimensional table-like object, usually a NumPy array.

Optional main/runtime behavior:

Package marker for dynamically discovered loader plugins; not executable by itself.

Default Loader

Default data loader for PhysPlot.

This loader reads common spreadsheet and text formats and returns a 2D NumPy array for the main table.

Input data structure:

file_path is a path-like object or string pointing to an Excel, CSV, TSV, TXT, or generic delimited numeric text file.

Return type:

load_data returns a two-dimensional NumPy array. A one-dimensional source is reshaped to (rows, 1).

Optional main/runtime behavior:

Loaded dynamically by the Data Loader selector. This module is not intended to be run directly.

load_data(file_path) numpy.ndarray[source]

Load a spreadsheet or delimited text file for the PhysPlot table.

Parameters:

file_path (str | pathlib.Path): Path to .xlsx, .xls, .csv, .txt, .tsv, or another delimited numeric text file.

Returns:

numpy.ndarray: Two-dimensional table data suitable for printTOTable.

OES HRF Loader

Loader for OES .HRF files.

The .HRF files include metadata followed by comma-separated rows: index, wavelength, intensity. PhysPlot should plot wavelength vs intensity, so this loader drops the leading index column.

Input data structure:

file_path is a path-like object or string pointing to an OES .HRF file. Numeric data are parsed only after the PMT Voltage: metadata line.

Return type:

load_data returns a two-column NumPy array [wavelength, intensity]. DEFAULT_COLUMN_ROLES marks those columns as X-axis and Y-axis.

Optional main/runtime behavior:

Loaded dynamically by the Data Loader selector. This module is not intended to be run directly.

load_data(file_path) numpy.ndarray[source]

Load OES HRF data as wavelength and intensity columns.

Parameters:

file_path (str | pathlib.Path): Path to an .HRF file whose numeric data begin after the PMT Voltage: metadata line.

Returns:

numpy.ndarray: Two-column array [wavelength, intensity]. The leading index column in the HRF file is skipped.

Raises:

ValueError: If no numeric OES data rows are found.