BaseReader

class mdcraft.io.base.BaseReader(filename: str | Path, /, *, n_workers: int | None)[source]

Bases: object

Base class for topology and trajectory readers.

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.

n_workersint, keyword-only

Number of threads to use when reading the file. If None, the number of available logical threads is used.

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.