InvariantTableWriter#

class InvariantTableWriter(filename, name_is_key, invariant_fieldnames: list, notation='native', comment=None)#

Bases: ABC

Abstract base class for file writers.

  • Handles file opening, closing, and resource management.

  • Supports writing format headers and optional comments.

__init__(filename, name_is_key, invariant_fieldnames: list, notation='native', comment=None)#

Initializes the invariant writer.

Parameters:
  • filename – Path to the output file.

  • notation – The diagram notation (‘dowker’, ‘gauss’, etc.).

  • comment – (Optional) A comment to add at the start of the file.

Methods

__init__(filename, name_is_key, ...[, ...])

Initializes the invariant writer.

close()

Closes the file.

write_comment(comment)

write_invariant(key, invariant_dictionary)

close()#

Closes the file.