MDMC.readers package

Subpackages

Submodules

MDMC.readers.reader module

Module for reader abstract class

class MDMC.readers.reader.Reader(file_name: str)[source]

Bases: ABC

Abstract class that defines methods common to all readers

Parameters:

file_name (str) – name of file to read

abstract parse(**settings: dict) None[source]

Parses the file data so that it is in a format expected by the class calling the data reader

For readers which are not specific to one data type, the calling class must be determined so that the file data can be parsed into the appropriate data type.

Parameters:

**settings (dict) – dictionary of settings for reader

MDMC.readers.reader_factory module

Factory class for generating readers

class MDMC.readers.reader_factory.ReaderFactory[source]

Bases: ABC

Provides a abstract base class for methods and properties common to all reader factories

abstract static base_class()[source]

This should be implemented to return the base class of objects returned by the ReaderFactory

classmethod create_reader(module_name: str, file_name: str) Reader[source]

Creates a reader object from a module name

The reader object must be the first class in the module. The base class which the reader must inherit is defined by cls.base_class

Parameters:
  • module_name (str) – The name of the module where the reader is the first class

  • file_name (str) – The name of the file that the Reader will read

Returns:

A Reader object

Return type:

Reader

Module contents

Readers for both atomic configurations and experimental observables

Contents

configurations observables reader_factory reader