schrodinger.infra.mmkv module

Wrapper classes and functions for dealing with the MMKV library, which is used to read & write Epik, LigPrep, and ConfGen input files.

See MMKVSettings documentation for more details.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.infra.mmkv.MMKVArgList(handle, key, converter, getter, setter, get_len, set_len)

Bases: object

A class to provide list-like access to MMKV/MMIM array properties.

Like an actual Python list, indices start at 0, not 1. Unlike a Python list, at this time negative indices and slices are not supported.

Note that while this class requires an MMKV/MMIM handle, it neither initiates nor terminates the mmkv library.

append(value)

Append a new value to the current MMKV arglist.

Parameters:value (str, int, bool, or float depending on the MMKV arglist type) – The new value to append.
setSize(size)

Set the size of the MMKV argument list.

class schrodinger.infra.mmkv.MMKVSettings(handle=None)

Bases: UserDict.DictMixin

A class for setting and getting MMKV keyword values.

mydict = MMKVSettings()

Then set any keywords:

mydict[<keywordname>] = <value>

get_command()

Return the command string corresponding to the stored keywords.

get_command_arguments()

Return the arguments corresponding to the stored keywords.

get_default(key)

Return the default value for the given keyword.

keys()
parseInputFile(filename, jobtype)

Populate this MMKV instance based on the data from an input file.

write(filename)

Write the stored keywords to the specified file.

schrodinger.infra.mmkv.get_handlers_for_key(key, arg_handlers)

Find the data for the specified key in the given argument handlers dictionary. Returns a tuple of the converter, getter, and setter functions.

Will raise a KeyError if the wrong key value (or type) is specified, because the exception is passed onto the getter/setter methods.

NOTE: Also used in mmim.py