Skip to content

Commit

Permalink
Merge pull request #157 from kiudee/fix_initialize_data
Browse files Browse the repository at this point in the history
Fix initialize_data returning the same object several times.
  • Loading branch information
kiudee committed Aug 14, 2021
2 parents 87487bb + c9ae4da commit 6a9c623
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tests/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ def test_initialize_data(tmp_path):
assert len(y) == 0
assert len(noise) == 0
assert iteration == 0
# Check if the created data structured are not exactly the same list:
X.append(0)
assert len(X) == 1
assert len(y) == 0
assert len(noise) == 0

# Create a temporary file for testing:
testfile = tmp_path / "data.npz"
Expand Down
4 changes: 3 additions & 1 deletion tune/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ def initialize_data(
parameters in the data.
"""
logger = logging.getLogger()
X = y = noise = []
X = []
y = []
noise = []
iteration = 0
if data_path is not None and resume:
space = normalize_dimensions(parameter_ranges)
Expand Down

0 comments on commit 6a9c623

Please sign in to comment.