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.

__getitem__(index)
__setitem__(index, value)
__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.
__iter__()
__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.infra.mmkv', '__doc__': '\n A class to provide list-like access to MMKV/MMIM array properties.\n\n Like an actual Python list, indices start at 0, not 1. Unlike a Python\n list, at this time negative indices and slices are not supported.\n\n Note that while this class requires an MMKV/MMIM handle, it neither\n initiates nor terminates the mmkv library.\n\n ', '__init__': <function MMKVArgList.__init__>, '__getitem__': <function MMKVArgList.__getitem__>, '__setitem__': <function MMKVArgList.__setitem__>, '__len__': <function MMKVArgList.__len__>, 'setSize': <function MMKVArgList.setSize>, 'append': <function MMKVArgList.append>, '__iter__': <function MMKVArgList.__iter__>, '__dict__': <attribute '__dict__' of 'MMKVArgList' objects>, '__weakref__': <attribute '__weakref__' of 'MMKVArgList' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.infra.mmkv'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)