Table

class hoomd.write.Table(trigger, logger, output=stdout, header_sep='.', delimiter=' ', pretty=True, max_precision=10, max_header_len=None)

Write delimiter separated values to a stream.

Parameters:
  • trigger (hoomd.trigger.trigger_like) – The trigger to determine when to run the Table backend.

  • logger (hoomd.logging.Logger) – The logger to query for output. Table supports only 'scalar' and 'string' logger categories.

  • output (file-like object , optional) – A file-like object to output the data from, defaults to standard out. The object must have write and flush methods and a mode attribute. Examples include sys.stdout, sys.stderr and the return value of open().

  • header_sep (str, optional) – String to use to separate names in the logger’s namespace, defaults to '.'. For example, if logging the total energy of an hoomd.md.pair.LJ pair force object, the default header would be md.pair.LJ.energy.

  • delimiter (str, optional) – String used to separate elements in the space delimited file, defaults to ' '.

  • pretty (bool, optional) – Flags whether to attempt to make output prettier and easier to read (defaults to True).

  • max_precision (int, optional) – If pretty is not set, then this controls the maximum precision to use when writing numerical values, defaults to 10.

  • max_header_len (int, optional) –

    If not None (the default), limit the outputted header names to length max_header_len. When not None, names are grabbed from the most specific to the least. For example, if set to 7 the namespace ‘hoomd.md.pair.LJ.energy’ would be set to ‘energy’.

    Note

    At a minimum, the complete most specific part of the namespace will be used regardless of this setting.

Use Table to write scalar and string hoomd.logging.Logger quantities to standard out or to a file.

Warning

When logger quantities include strings with spaces, the default space delimiter will result in files that are not machine readable.

Example:

logger = hoomd.logging.Logger(categories=["scalar", "string"])
table = hoomd.write.Table(
    trigger=hoomd.trigger.Periodic(10_000),
    logger=logger,
)

Members inherited from AutotunedObject:

property kernel_parameters

Kernel parameters. Read more...

property is_tuning_complete

Check if kernel parameter tuning is complete. Read more...

tune_kernel_parameters()

Start tuning kernel parameters. Read more...


Members inherited from Integrator:

trigger

The trigger to activate this operation. Read more...


Members defined in Table:

logger

The logger to query for output. Table supports only 'scalar' and 'string' logger categories (read-only).

Example:

logger = table.logger
Type:

hoomd.logging.Logger

output

A file-like object to output the data from. The object must have write and flush methods and a mode attribute (read-only).

Example:

output = table.output
Type:

file-like object

header_sep

String to use to separate names in the logger’s namespace (read-only).

Example:

header_sep = table.header_sep
Type:

str

delimiter

String used to separate elements in the space delimited file (read-only).

Example:

delimiter = table.delimiter
Type:

str

pretty

Flags whether to attempt to make output prettier and easier to read (read-only).

Example:

pretty = table.pretty
Type:

bool

max_precision

If pretty is not set, then this controls the maximum precision to use when writing numerical values (read-only).

Example:

max_precision = table.max_precision
Type:

int, optional

max_header_len

Limits the outputted header names to length max_header_len when not None (read-only).

Example:

max_header_len = table.max_header_len
Type:

int

min_column_width

The minimum allowed column width (read-only).

Example:

min_column_width = table.min_column_width
Type:

int

write()

Write out data to self.output.

Writes a row from given hoomd.logging.Logger object data.

Example:

table.write()