# Delimited File I/O¶

class PVGeo.readers.delimited.DelimitedPointsReaderBase(**kwargs)[source]

A base class for delimited text readers that produce vtkPolyData points.

GetCopyZ()[source]
RequestData(request, inInfo, outInfo)[source]

Used by pipeline to get data for current timestep and populate the output data object.

SetCopyZ(flag)[source]
description = 'PVGeo: Delimited Points'

class PVGeo.readers.delimited.DelimitedTextReader(nOutputPorts=1, outputType='vtkTable', **kwargs)[source]

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.

GetSkipRows()[source]
GetSplitOnWhiteSpace()[source]
GetTitles()[source]
HasTitles()[source]
RequestData(request, inInfo, outInfo)[source]

Used by pipeline to get data for current timestep and populate the output data object.

SetComments(identifier)[source]

The character identifier for comments within the file.

SetDelimiter(deli)[source]

The input file’s delimiter. To use a tab delimiter please use SetSplitOnWhiteSpace()

Parameters: deli (str) – a string delimiter/seperator
SetHasTitles(flag)[source]

A boolean for if the delimited file has header titles for the data arrays.

SetSkipRows(skip)[source]

The integer number of rows to skip at the top of the file.

SetSplitOnWhiteSpace(flag)[source]

Set a boolean flag to override the SetDelimiter() and use any white space as a delimiter.

_ExtractHeader(content)[source]

Override this. Removes header from single file’s content.

_ExtractHeaders(contents)[source]

Should NOT be overriden. This is a convienance methods to iteratively get all file contents. Your should override _ExtractHeader.

_FileContentsToDataFrame(contents)[source]

Should NOT need to be overriden. After _ExtractHeaders 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 _ExtractHeaders.

_GetDeli()[source]

For itenral use

_GetFileContents(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.

_GetRawData(idx=0)[source]

This will return the proper data for the given timestep as a dataframe

_ReadUpFront()[source]

Should not need to be overridden.

description = 'PVGeo: Delimited Text Files'
extensions = 'dat csv txt text ascii xyz tsv ntab'

class PVGeo.readers.delimited.XYZTextReader(**kwargs)[source]
_ExtractHeader(content)[source]
description = 'PVGeo: XYZ Delimited Text Files where header has comma delimiter.'