Skip to content

Commit

Permalink
Merge pull request #2238 from jenshnielsen/cleanup/tests_move_to_legacy
Browse files Browse the repository at this point in the history
Move tests related to qcodes.data loop etc to a legacy folder
  • Loading branch information
jenshnielsen committed Oct 5, 2020
2 parents 99b86b4 + c8e1afc commit 774523b
Show file tree
Hide file tree
Showing 18 changed files with 463 additions and 473 deletions.
120 changes: 49 additions & 71 deletions docs/examples/legacy/Datasaving examples.ipynb
Expand Up @@ -18,14 +18,13 @@
"text": [
"Logging hadn't been started.\n",
"Activating auto-logging. Current session state plus future input saved.\n",
"Filename : C:\\Users\\a-halakh\\.qcodes\\logs\\command_history.log\n",
"Filename : C:\\Users\\Jens-Work\\.qcodes\\logs\\command_history.log\n",
"Mode : append\n",
"Output logging : True\n",
"Raw input log : False\n",
"Timestamping : True\n",
"State : active\n",
"Qcodes Logfile : C:\\Users\\a-halakh\\.qcodes\\logs\\200324-21784-qcodes.log\n",
"False\n"
"Qcodes Logfile : C:\\Users\\Jens-Work\\.qcodes\\logs\\201004-29284-qcodes.log\n"
]
}
],
Expand Down Expand Up @@ -141,13 +140,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Started at 2020-03-24 18:41:24\n",
"Started at 2020-10-04 11:50:36\n",
"DataSet:\n",
" location = 'data/2020-03-24/#011_MockParabola_run_18-41-24'\n",
" location = 'data/2020-10-04/#001_MockParabola_run_11-50-36'\n",
" <Type> | <array_id> | <array.name> | <array.shape>\n",
" Setpoint | MockParabola_x_set | x | (10,)\n",
" Measured | MockParabola_skewed_parabola | skewed_parabola | (10,)\n",
"Finished at 2020-03-24 18:41:24\n"
"Finished at 2020-10-04 11:50:36\n"
]
}
],
Expand All @@ -166,34 +165,22 @@
"name": "stderr",
"output_type": "stream",
"text": [
"qcodes.data.data_set - DEBUG - Attempting to write\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Started at 2020-03-24 18:41:24\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"qcodes.data.data_set - DEBUG - Attempting to write\n",
"qcodes.data.data_set - DEBUG - Finalising the DataSet. Writing.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Started at 2020-10-04 11:50:36\n",
"DataSet:\n",
" location = 'data/2020-03-24/#012_MockParabola_run_18-41-24'\n",
" location = 'data/2020-10-04/#002_MockParabola_run_11-50-36'\n",
" <Type> | <array_id> | <array.name> | <array.shape>\n",
" Setpoint | MockParabola_x_set | x | (10,)\n",
" Setpoint | MockParabola_y_set | y | (10, 15)\n",
" Measured | MockParabola_skewed_parabola | skewed_parabola | (10, 15)\n",
"Finished at 2020-03-24 18:41:25\n"
"Finished at 2020-10-04 11:50:36\n"
]
}
],
Expand Down Expand Up @@ -237,84 +224,75 @@
"name": "stderr",
"output_type": "stream",
"text": [
"test_closed_file (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... root - WARNING - Cannot close file, data_set has no open hdf5 file\n",
"test_closed_file (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... root - WARNING - Cannot close file, data_set has no open hdf5 file\n",
"root - WARNING - Cannot close file, data_set has no open hdf5 file\n",
"ok\n",
"test_dataset_closing (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_dataset_finalize_closes_file (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... qcodes.data.data_set - DEBUG - Finalising the DataSet. Writing.\n",
"test_dataset_closing (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_dataset_finalize_closes_file (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... qcodes.data.data_set - DEBUG - Finalising the DataSet. Writing.\n",
"ok\n",
"test_dataset_flush_after_write (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_dataset_with_missing_attrs (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_double_closing_gives_warning (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_full_write_read_1D (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_full_write_read_2D (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_incremental_write (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_loop_writing (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... qcodes.instrument.base - DEBUG - [Loop_writing_test(MockParabola)] Error getting or interpreting *IDN?: ''\n",
"test_dataset_flush_after_write (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_dataset_with_missing_attrs (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_double_closing_gives_warning (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_full_write_read_1D (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format)\n",
"Test writing and reading a file back in ... ok\n",
"test_full_write_read_2D (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format)\n",
"Test writing and reading a file back in ... ok\n",
"test_incremental_write (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_loop_writing (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... qcodes.instrument.base - DEBUG - [Loop_writing_test(MockParabola)] Error getting or interpreting *IDN?: ''\n",
"qcodes.data.data_set - DEBUG - Attempting to write\n",
"qcodes.data.data_set - DEBUG - Finalising the DataSet. Writing.\n",
"ok\n",
"test_loop_writing_2D (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... qcodes.instrument.base - DEBUG - [Loop_writing_test_2D(MockParabola)] Error getting or interpreting *IDN?: ''\n",
"test_loop_writing_2D (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... qcodes.instrument.base - DEBUG - [Loop_writing_test_2D(MockParabola)] Error getting or interpreting *IDN?: ''\n",
"qcodes.data.data_set - DEBUG - Attempting to write\n",
"qcodes.data.data_set - DEBUG - Finalising the DataSet. Writing.\n"
"qcodes.data.data_set - DEBUG - Finalising the DataSet. Writing.\n",
"ok\n",
"test_metadata_write_read (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format)\n",
"Test is based on the snapshot of the 1D dataset. ... ok\n",
"test_partial_dataset (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_read_writing_dicts_withlists_to_hdf5 (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_reading_into_existing_data_array (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_str_to_bool (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_writing_metadata (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_writing_unsupported_types_to_hdf5 (qcodes.tests.legacy.test_hdf5formatter.TestHDF5_Format)\n",
"Tests writing of ... root - WARNING - Type \"<class 'qcodes.data.data_set.DataSet'>\" for \"nested_dataset\":\"DataSet:\n",
" location = 'c:\\\\users\\\\jens-work\\\\source\\\\repos\\\\qcodes\\\\qcodes\\\\tests\\\\unittest_data/2020-10-04/#036_test_missing_attr_11-50-36'\n",
" <Type> | <array_id> | <array.name> | <array.shape>\" not supported, storing as string\n",
"root - WARNING - List of type \"<class 'qcodes.data.data_set.DataSet'>\" for \"list_of_dataset\":\"[DataSet:\n",
" location = 'c:\\\\users\\\\jens-work\\\\source\\\\repos\\\\qcodes\\\\qcodes\\\\tests\\\\unittest_data/2020-10-04/#036_test_missing_attr_11-50-36'\n",
" <Type> | <array_id> | <array.name> | <array.shape>, DataSet:\n",
" location = 'c:\\\\users\\\\jens-work\\\\source\\\\repos\\\\qcodes\\\\qcodes\\\\tests\\\\unittest_data/2020-10-04/#036_test_missing_attr_11-50-36'\n",
" <Type> | <array_id> | <array.name> | <array.shape>]\" not supported, storing as string\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Started at 2020-03-24 18:41:25\n",
"Started at 2020-10-04 11:50:36\n",
"DataSet:\n",
" location = 'c:\\\\users\\\\a-halakh\\\\documents\\\\microsoft\\\\qcodes\\\\qcodes\\\\unittest_data/2020-03-24/#010_MockLoop_hdf5_test_18-41-25'\n",
" location = 'c:\\\\users\\\\jens-work\\\\source\\\\repos\\\\qcodes\\\\qcodes\\\\tests\\\\unittest_data/2020-10-04/#029_MockLoop_hdf5_test_11-50-36'\n",
" <Type> | <array_id> | <array.name> | <array.shape>\n",
" Setpoint | Loop_writing_test_x_set | x | (10,)\n",
" Measured | Loop_writing_test_skewed_parabola | skewed_parabola | (10,)\n",
"Finished at 2020-03-24 18:41:25\n",
"Started at 2020-03-24 18:41:25\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"ok\n",
"test_metadata_write_read (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_partial_dataset (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_read_writing_dicts_withlists_to_hdf5 (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_reading_into_existing_data_array (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_str_to_bool (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_writing_metadata (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... ok\n",
"test_writing_unsupported_types_to_hdf5 (qcodes.tests.test_hdf5formatter.TestHDF5_Format) ... "
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Finished at 2020-10-04 11:50:36\n",
"Started at 2020-10-04 11:50:36\n",
"DataSet:\n",
" location = 'c:\\\\users\\\\a-halakh\\\\documents\\\\microsoft\\\\qcodes\\\\qcodes\\\\unittest_data/2020-03-24/#011_MockLoop_hdf5_test_18-41-25'\n",
" location = 'c:\\\\users\\\\jens-work\\\\source\\\\repos\\\\qcodes\\\\qcodes\\\\tests\\\\unittest_data/2020-10-04/#030_MockLoop_hdf5_test_11-50-36'\n",
" <Type> | <array_id> | <array.name> | <array.shape>\n",
" Setpoint | Loop_writing_test_2D_x_set | x | (10,)\n",
" Setpoint | Loop_writing_test_2D_y_set | y | (10, 10)\n",
" Measured | Loop_writing_test_2D_skewed_parabola | skewed_parabola | (10, 10)\n",
"Finished at 2020-03-24 18:41:25\n"
"Finished at 2020-10-04 11:50:36\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"root - WARNING - Type \"<class 'qcodes.data.data_set.DataSet'>\" for \"nested_dataset\":\"DataSet:\n",
" location = 'c:\\\\users\\\\a-halakh\\\\documents\\\\microsoft\\\\qcodes\\\\qcodes\\\\unittest_data/2020-03-24/#017_test_missing_attr_18-41-25'\n",
" <Type> | <array_id> | <array.name> | <array.shape>\" not supported, storing as string\n",
"root - WARNING - List of type \"<class 'qcodes.data.data_set.DataSet'>\" for \"list_of_dataset\":\"[DataSet:\n",
" location = 'c:\\\\users\\\\a-halakh\\\\documents\\\\microsoft\\\\qcodes\\\\qcodes\\\\unittest_data/2020-03-24/#017_test_missing_attr_18-41-25'\n",
" <Type> | <array_id> | <array.name> | <array.shape>, DataSet:\n",
" location = 'c:\\\\users\\\\a-halakh\\\\documents\\\\microsoft\\\\qcodes\\\\qcodes\\\\unittest_data/2020-03-24/#017_test_missing_attr_18-41-25'\n",
" <Type> | <array_id> | <array.name> | <array.shape>]\" not supported, storing as string\n",
"ok\n",
"\n",
"----------------------------------------------------------------------\n",
"Ran 18 tests in 0.705s\n",
"Ran 18 tests in 0.302s\n",
"\n",
"OK\n"
]
Expand All @@ -326,7 +304,7 @@
"reload(hdf5_format)\n",
"import unittest\n",
"h5fmt = hdf5_format.HDF5Format()\n",
"import qcodes.tests.test_hdf5formatter as tf\n",
"import qcodes.tests.legacy.test_hdf5formatter as tf\n",
"reload(tf)\n",
"tst = tf.TestHDF5_Format\n",
"suite = unittest.defaultTestLoader.loadTestsFromTestCase(tst)\n",
Expand Down Expand Up @@ -371,7 +349,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.5"
"version": "3.7.9"
},
"toc": {
"base_numbering": 1,
Expand Down
Empty file added qcodes/tests/legacy/__init__.py
Empty file.
File renamed without changes.
Expand Up @@ -3,7 +3,7 @@
from hypothesis import given, settings
import hypothesis.strategies as hst

from .instrument_mocks import DummyInstrument
from ..instrument_mocks import DummyInstrument
from qcodes.instrument.parameter import combine
from qcodes.loops import Loop
from qcodes.actions import Task
Expand Down
Expand Up @@ -14,7 +14,7 @@
DataSet2D, DataSet1D,
DataSetCombined, RecordingMockFormatter)

from .common import strip_qc
from ..common import strip_qc


class TestDataArray(TestCase):
Expand Down
File renamed without changes.
Expand Up @@ -6,7 +6,7 @@
from qcodes.data.hdf5_format import HDF5Format, HDF5FormatMetadata
from qcodes.data.gnuplot_format import GNUPlotFormat
from qcodes.data.data_set import load_data
from qcodes.tests.data_mocks import DataSet2D
from qcodes.tests.legacy.data_mocks import DataSet2D


#%%
Expand Down
File renamed without changes.
File renamed without changes.
Expand Up @@ -13,7 +13,7 @@
from qcodes.utils.validators import Numbers
from qcodes.logger.logger import LogCapture

from .instrument_mocks import MultiGetter, DummyInstrument
from ..instrument_mocks import MultiGetter, DummyInstrument


class NanReturningParameter(MultiParameter):
Expand Down
Expand Up @@ -5,7 +5,7 @@
from qcodes.instrument.parameter import Parameter
from qcodes.measure import Measure

from .instrument_mocks import MultiGetter, MultiSetPointParam
from ..instrument_mocks import MultiGetter, MultiSetPointParam

import numpy as np
from numpy.testing import assert_array_equal
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 774523b

Please sign in to comment.