Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more support on memory_backend and storage
Parts of ensuring these can be used independently for testing.
  • Loading branch information
dwhswenson committed Feb 26, 2021
commit 151b3a688d2a0f8d56d5b766890e5e911827d136
1 change: 1 addition & 0 deletions openpathsampling/experimental/simstore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
)
from .class_info import ClassInfoContainer, ClassInfo
from .sql_backend import SQLStorageBackend
from .memory_backend import MemoryStorageBackend
from . import dict_serialization_helpers
from .storable_functions import (
Processor, StorableFunctionConfig, StorableFunctionResults,
Expand Down
7 changes: 7 additions & 0 deletions openpathsampling/experimental/simstore/memory_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,16 @@ def __init__(self, mode='w'):
self.uuid_table = {} # maps UUID to table name
self._table_to_class = {}

@property
def identifier(self):
return hex(id(self))

def close(self):
pass # no such thing as closing here, but may be needed for API

def register_type(self, type_str, backend_type):
pass # no need to do anything here?

def register_schema(self, schema, table_to_class, metadata=None):
for table_name, schema_entries in schema.items():
logger.debug("Registering table: %s" % table_name)
Expand Down
4 changes: 4 additions & 0 deletions openpathsampling/experimental/simstore/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ def _load_missing_info_tables(self, table_to_class):
raise RuntimeError("Unable to register existing database "
+ "tables: " + str(missing_info_tables))

def register_from_tables(self, table_names, classes):
# override in subclass to handle special lookups
pass

def stash(self, objects):
objects = tools.listify(objects)
self._stashed.extend(objects)
Expand Down