Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make data saver accept numpy type floats/ints #1225

Merged
merged 9 commits into from
Aug 15, 2018
15 changes: 14 additions & 1 deletion qcodes/tests/dataset/test_datasaver.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_default_callback(experiment):

def test_numpy_types(experiment):
"""
Test that we can save numpy types in the dataset
Test that we can save numpy types in the data set
"""

p = ParamSpec("p", "numeric")
Expand All @@ -91,3 +91,16 @@ def test_numpy_types(experiment):

for dtype in dtypes:
data_saver.add_result(("p", dtype(2)))


def test_string(experiment):
"""
Test that we can save text in the data set
"""
p = ParamSpec("p", "text")

test_set = qc.new_data_set("test-dataset")
data_saver = DataSaver(
dataset=test_set, write_period=0, parameters={"p": p})

data_saver.add_result(("p", "some text"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't want to be annoying but:

  • pep8 required newline at the end of the file
  • should the test also assert that some text is indeed in the database?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am quite surprised this commit even passed the quality inspection: Doesn't CI check for PEP8?

Anyway, I will correct the above.