schrodinger.infra.mmim module

Wrapper classes and functions for dealing with the MMIM library, which is used to read & write Impact and QSite input files.

See MMIMDict documentation for more details.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.infra.mmim.convert_string(key, value)

Given a key (as integer or string) and a value (string), try to convert the value to the proper type for this keyword. Return converted value. Will raise a KeyError if the wrong key value is specified.

NOTE: Used by glide.py

class schrodinger.infra.mmim.MMIMArgList(handle, key, converter=None, getter=None, setter=None, get_len=None, set_len=None)

Bases: schrodinger.infra.mmkv.MMKVArgList

__init__(handle, key, converter=None, getter=None, setter=None, get_len=None, set_len=None)

Create an instance from the MMKV/MMIM handle and key (int or string).

Takes functions to get and set indexed values, and a function to determine the length. If these are not provided, they are looked up based on the key provided.

get_len and set_len methods should be defined for array types only.

class schrodinger.infra.mmim.MMIMDict(handle)

Bases: collections.abc.MutableMapping

A class for setting and getting MMIM keyword values. Given an MMIM handle, create an instance as follows:

mydict = MMIMDict(mmim_handle)

Then set any keywords:

mydict[<keywordname>] = <value>

__init__(handle)

Create an instance from the given MMIM handle.

keys() a set-like object providing a view on D's keys
__len__()