paramonte._TabularFileContents

Module Contents

Classes

TabularFileContents(file, fileType, delimiter, methodName, parseContents=True, reportEnabled=True)

This is the TabularFileContents class for generating instances

paramonte._TabularFileContents.Struct[source]
paramonte._TabularFileContents.newline
class paramonte._TabularFileContents.TabularFileContents(file, fileType, delimiter, methodName, parseContents=True, reportEnabled=True)[source]

Bases: _OutputFileContents.OutputFileContents

This is the TabularFileContents class for generating instances of the ParaMonte tabular output contents. This class is NOT meant to be directly accessed by the ParaMonte library users. It is internally used by the ParaMonte library to parse the tabular contents of the output files generated by the ParaMonte sampler routines. For example, the ParaDRAM sampler class makes calls to this class via its readSample() or readChain() or readMarkovChain() or readProgress() methods to return a list of objects of class TabularFileContents.

Parameters

file

The full path to the file containing the sample/chain.

fileType

A string containing the type of the file to be parsed. Current options include but are not limited to: sample, chain, markovChain, progress

delimiter

The delimiter used in the sample/chain file, which must be provided by the user.

methodName

A string representing the name of the ParaMonte sampler used to call the constructor of the TabularFileContents class.

parseContents

If set to True, the contents of the file will be parsed and stored in a component of the object named contents. The default value is True.

reportEnabled

A logical input parameter indicating whether the ParaMonte automatic guidelines to the standard output should be provided or not. The default value is True.

Attributes

file

The full path to the file containing the sample/chain.

delimiter

The delimiter used in the sample/chain file, which must be provided by the user.

ndim

The number of dimensions of the domain of the objective function from which the sample has been drawn.

count

The number of points (states) in the sample/chain file. This is essentially, the number of rows in the file minus one (representing the header line).

plot

A structure containing the graphics tools for the visualization of the contents of the file.

df

If the input file contents is structured in a format that could be read as a dataframe, then the contents of the file will be stored in the form of a pandas-library DataFrame in this property (hence called df).

contents

If the input file contents is structured in the form of columns, then a property named contents is also added to the object. Each component of contents will named via the header of the file and will contain data from the corresponding column of the file.

Returns

tabularFileContents

An object of class TabularFileContents.

_resetPlot(self, resetType='soft', plotNames='all')[source]

Reset the properties of the plot to the original default settings. Use this method when you change many attributes of the plot and you want to clean up and go back to the default settings.

Parameters

resetType (optional)

An optional string with possible value of "hard". If provided, the plot object will be regenerated from scratch. This includes reading the original data frame again and resetting everything. If not provided, then only the plot settings will be reset without reseting the dataFrame.

plotNames (optional)

An optional string value or list of string values representing the names of plots to reset. If no value is provided, then all plots will be reset.

Returns

None

Example

reset("hard")                   # regenerate all plots from scratch
reset("hard","line3")           # regenerate line3 plot from scratch
reset("hard",["line","line3"])  # regenerate line and line3 plots
_reportWrongPlotName(self, plotNames)[source]