BaseWriter

class mdcraft.io.base.BaseWriter(filename: str | Path)[source]

Bases: object

Base class for topology and trajectory writers.

Subclasses must implement the open() and close() methods to handle the opening and closing of the file.

Parameters:
filenamestr or pathlib.Path, positional-only

Filename or path to the topology or trajectory file.

Methods

close

Closes the topology or trajectory file and deletes the handle.

open

Opens the topology or trajectory file and stores a handle to it.

abstractmethod close() None[source]

Closes the topology or trajectory file and deletes the handle.

abstractmethod open() None[source]

Opens the topology or trajectory file and stores a handle to it.