Skip to content

Commit

Permalink
make store method public
Browse files Browse the repository at this point in the history
  • Loading branch information
knikolaou committed May 16, 2024
1 parent ec7c3dd commit 5fbc626
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions CI/unit_tests/recorders/test_base_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def test_store(self):

# Test storing
recorder._measure(**self.neural_state)
recorder._store()
recorder.store()
data = recorder.load()

assert set(data.keys()) == {"dummy_1", "dummy_2"}
Expand All @@ -199,7 +199,7 @@ def test_store(self):

# Test storing again
recorder._measure(**self.neural_state)
recorder._store()
recorder.store()
data = recorder.load()

assert set(data.keys()) == {"dummy_1", "dummy_2"}
Expand All @@ -211,7 +211,7 @@ def test_store(self):
# test overwriting
recorder.overwrite = True
recorder._measure(**self.neural_state)
recorder._store()
recorder.store()
data = recorder.load()

assert set(data.keys()) == {"dummy_1", "dummy_2"}
Expand Down Expand Up @@ -243,11 +243,11 @@ def test_counter(self):
assert recorder._counter == 1
recorder._measure(**self.neural_state)
assert recorder._counter == 2
recorder._store() # It should not story due to the chunk size
recorder.store() # It should not story due to the chunk size
assert recorder._counter == 2
recorder._measure(**self.neural_state)
assert recorder._counter == 3
recorder._store() # It should store now
recorder.store() # It should store now
assert recorder._counter == 0

# Delete temporary directory
Expand Down
4 changes: 2 additions & 2 deletions papyrus/recorders/base_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _measure(self, **neural_state):
# Increment the counter
self._counter += 1

def _store(self):
def store(self):
"""
Store the results of the measurements in the database.
Expand Down Expand Up @@ -221,4 +221,4 @@ def record(self, neural_state: dict):
The result of the recorder.
"""
self._measure(**neural_state)
self._store()
self.store()

0 comments on commit 5fbc626

Please sign in to comment.