예제 #1
0
 def test_memory_store_save(self):
     store = MemoryStore.from_model(model, prior)
     with tempfile.TemporaryDirectory() as td:
         td_path = Path(td)
         store.save(td)
         items = [
             p.relative_to(td).as_posix() for p in td_path.rglob("*") if p.is_dir()
         ]
         assert len(items) > 0
예제 #2
0
 def test_memory_store_sample(self):
     store = MemoryStore.from_model(model, prior)
     indices = store.sample(100, prior)
     assert len(indices) == len(store)