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.

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

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.

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

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.

__len__()
setSize(size)

Set the size of the MMKV argument list.

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.