Core classes

DataTable

Class that stores data and series

File

Basic class that describes elements of a DataSet

FileType

Module FileType

Module for the basic definition of file types.

class RepTate.core.FileType.ExcelFile(name: str = 'Excel File', extension: str = 'xlsx', description: str = 'Generic Excel file', col_names: list[str] = [], basic_file_parameters: list[str] = [], col_units: list[str] = [], file_parameter_specs: list[FileParameterSpec] = [])

Bases: object

Parse and read contents from Excel file

read_file(filename: str, parent_dataset: DataSetLike | None, axarr: list[AxesLike] | None) File | None

Read Excel File

class RepTate.core.FileType.TXTColumnFile(name: str = 'TXTColumn', extension: str = 'txt', description: str = 'Generic text file with columns', col_names: list[str] = [], basic_file_parameters: list[str] = [], col_units: list[str] = [], file_parameter_specs: list[FileParameterSpec] = [])

Bases: object

Basic class for text-column based data files

Columns should be separated by espaces or tabs

BASIC Structure of FILE:

LINE    CONTENTS
0       Param1=434;Param2=4355;
1       # Header line and/or comments [OPTIONAL, ANY NUMBER OF HEADER LINES IS POSSIBLE]
2       col1 col2 col3 [NAMES OF COLUMNS, OPTIONAL]
3       4343 434.5 535e-434 [DATA, ONLY NUMBERS ALLOWED]

The following examples can be declared with the line:

ftype=TXTColumnFile("LVE files", "tts", "LVE files", ['w','G'','G'''], ['Mw','T'], ['rad/s','Pa','Pa'])

EXAMPLE 1: columns line, no header lines:

C1=8.77210163229153;C2=114.03;Rho0=0.928;C3=0.61;T=-35;CTg=14.65;dx12=0;isof=true;Mw=634.5;chem=PI;PDI=1.03;
w                           G'                          G''                        T                            g
4.29882628773180E-0008      1.44001856995549E+0002      3.70207627600662E+0003     -3.30000000000000E-0003      0.00000000000000E+0000
6.30767835406968E-0008      2.56947504513849E+0002      5.39032089470917E+0003      3.14760000000000E-0004      0.00000000000000E+0000
9.25946098215800E-0008      4.87031807130633E+0002      7.86538338583378E+0003     -1.01000000000000E-0002      0.00000000000000E+0000

EXAMPLE 2: Neither columns line nor header lines:

C1=8.77210163229153;C2=114.03;Rho0=0.928;C3=0.61;T=-35;CTg=14.65;dx12=0;isof=true;Mw=23.4;chem=PI;PDI=1.03;
2.42782390212358E-0003      2.11182193155015E+0001      1.72559181398615E+0003      1.25000000000000E-0003      0.00000000000000E+0000
3.56351666244471E-0003      4.30476548641552E+0001      2.53490824331357E+0003      1.48400000000000E-0002      0.00000000000000E+0000

EXAMPLE 3: 2 Header lines, no column line:

T=160;chem=PE;
# Header 1
# Header 2
4.23333e-05 1.05E+00 2.96E+01
6.7e-05 2.02E+00 3.97E+01

EXAMPLE 4: 2 Header lines + column line:

T=160;chem=PE;
# Header 1
# Header 2
w G' G''
4.23333e-05 1.05E+00 2.96E+01
6.7e-05 2.02E+00 3.97E+01
find_col_names_and_first_data_lines(lines: list[str], file: File) tuple[int, int]

Find column names and first row with data

get_parameters(line: str, file: File) None

Get the file parameters

is_number(s: str) bool

Checks if the input string contains a number

parse_column_header(line: str) tuple[list[int], list[str], list[str]]

Map expected columns to data indexes and units declared in a header.

If no unit is declared in the file header, fall back to the application file type units. Those units are RepTate’s current implicit input units.

read_file(filename: str, parent_dataset: DataSetLike | None, axarr: list[AxesLike] | None) File | None

Gets all the data from the file

Parameter

Abstract class to describe theory parameters

View

Abstract class to describe a view