gwin.io.txt module

This modules defines functions for reading and samples that the inference samplers generate and are stored in an ASCII TXT file.

class gwin.io.txt.InferenceTXTFile(path, mode=None, delimiter=None)[source]

Bases: object

A class that has extra functions for handling reading the samples from posterior-only TXT files.

Parameters:
  • path (str) – The path to the TXT file.
  • mode ({None, str}) – The mode to open the file. Only accepts “r” or “rb” for reading.
  • delimiter (str) – Delimiter to use for TXT file. Default is space-delimited.
comments = ''
delimiter = ' '
name = 'txt'
classmethod write(output_file, samples, labels, delimiter=None)[source]

Writes a text file with samples.

Parameters:
  • output_file (str) – The path of the file to write.
  • samples (FieldArray) – Samples to write to file.
  • labels (list) – A list of strings to include as header in TXT file.
  • delimiter (str) – Delimiter to use in TXT file.