Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
russellromney committed May 18, 2019
1 parent a9e6be7 commit bb400db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion brain_plasma/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from brain_plasma import Brain
from .brain_plasma import Brain
6 changes: 5 additions & 1 deletion brain_plasma/brain_plasma.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def start(self,path=None,size=None):
self.path = path
# check if there is an existing plasma_store at that place; if so, connect to it and resize it to the new sie
try:
self.client = plasma.connect(self.path)
self.client = plasma.connect(self.path,num_retires=2)
for name in self.names():
self.forget(name)
if size!=None:
Expand Down Expand Up @@ -168,6 +168,10 @@ def size(self):
return self.bytes

def resize(self,size):
'''change the size of the underlying plasma_store to "size"'''
# check to see if the size of the new brain will be too small
if self.used() >= size:
raise BaseException('BrainError: must resize to bytes larger than currently used bytes')
# TODO - add a way to deal with desriptions
# create temp brain with old size by temp path
self.temp_brain = Brain(size=self.bytes,path='/tmp/plasma-temp',start_process=True)
Expand Down
2 changes: 1 addition & 1 deletion tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from brain_plasma import Brain
from brain_plasma.brain_plasma import Brain
import json
import pandas as pd
import numpy as np
Expand Down

0 comments on commit bb400db

Please sign in to comment.