Delimited File I/Oο
Delimited Points Reader Baseο
- class PVGeo.readers.delimited.DelimitedPointsReaderBase(**kwargs)[source]ο
Bases:
DelimitedTextReader
A base class for delimited text readers that produce
vtkPolyData
points.- RequestData(request, inInfo, outInfo)[source]ο
Used by pipeline to get data for current timestep and populate the output data object.
- description = 'PVGeo: Delimited Points'ο
Delimited Text Readerο
- class PVGeo.readers.delimited.DelimitedTextReader(nOutputPorts=1, outputType='vtkTable', **kwargs)[source]ο
Bases:
ReaderBase
This reader will take in any delimited text file and make a
vtkTable
from it. This is not much different than the default .txt or .csv reader in ParaView, however it gives us room to use our own extensions and a little more flexibility in the structure of the files we import.- RequestData(request, inInfo, outInfo)[source]ο
Used by pipeline to get data for current timestep and populate the output data object.
- _extract_headers(contents)[source]ο
Should NOT be overridden. This is a convienance methods to iteratively get all file contents. Your should override
_extract_header
.
- _file_contents_to_data_frame(contents)[source]ο
Should NOT need to be overridden. After
_extract_headers
handles removing the file header from the file contents, this method will parse the remainder of the contents into a pandas DataFrame with column names generated from the titles resulting from in_extract_headers
.
- _get_file_contents(idx=None)[source]ο
This grabs the lines of the input data file as a string array. This allows us to load the file contents, parse the header then use numpy or pandas to parse the data.
- _get_raw_data(idx=0)[source]ο
This will return the proper data for the given timestep as a dataframe
- description = 'PVGeo: Delimited Text Files'ο
- extensions = 'dat csv txt text ascii xyz tsv ntab'ο
- has_titles()[source]ο
Get the boolean for if the delimited file has header titles for the data arrays.
- set_delimiter(deli)[source]ο
The input fileβs delimiter. To use a tab delimiter please use
set_split_on_white_space()
- Parameters:
deli (str) β a string delimiter/separator
XYZ Text Readerο
- class PVGeo.readers.delimited.XYZTextReader(**kwargs)[source]ο
Bases:
DelimitedTextReader
A makeshift reader for XYZ files where titles have comma delimiter and data has space delimiter.
- description = 'PVGeo: XYZ Delimited Text Files where header has comma delimiter.'ο