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

Consistent import from top-level and first-level namespace of qcodes #1962

Merged
merged 28 commits into from Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d241c1a
Import legacy api to qcodes main namespace only when specified in config
lakhotiaharshit Mar 23, 2020
fd4333b
Copy data related to import to qcodes.data
lakhotiaharshit Mar 23, 2020
98a4602
Fix tests to not import legacy api from main namespace of qcodes
lakhotiaharshit Mar 23, 2020
d217e76
Copy dataset related to import to qcodes.dataset
lakhotiaharshit Mar 23, 2020
06c3e49
Copy instrument related to import to qcodes.instrument
lakhotiaharshit Mar 23, 2020
ec0857b
Copy intrument_drivers related to import to qcodes.instrument_drivers
lakhotiaharshit Mar 23, 2020
9d4b3ef
Copy utils related to import to qcodes.utils
lakhotiaharshit Mar 23, 2020
45e97ef
Fix imports in all the notebooks
lakhotiaharshit Mar 24, 2020
036e5b3
Add black lines
lakhotiaharshit Mar 24, 2020
d71269d
Remove unnecessary import
lakhotiaharshit Mar 24, 2020
7413a45
Merge branch 'master' into qcodes_init
lakhotiaharshit Mar 24, 2020
cb6ea6f
Fix imports utils.slack
lakhotiaharshit Mar 24, 2020
cfe9979
Merge branch 'qcodes_init' of https://github.com/lakhotiaharshit/Qcod…
lakhotiaharshit Mar 24, 2020
05193ce
Relative imports to break circular imports and appease travis
lakhotiaharshit Mar 25, 2020
8f6a4d8
Move .data imports to legacy and fix tests
lakhotiaharshit Mar 25, 2020
e862756
Fix relative imports
lakhotiaharshit Mar 25, 2020
161068e
Merge branch 'master' into qcodes_init
lakhotiaharshit Mar 25, 2020
c2eab1f
Fix legacy imports in the location formatter notebook
lakhotiaharshit Mar 25, 2020
c95d651
Copy import of data to one level down
lakhotiaharshit Mar 25, 2020
2fed096
Fix legacy imports in notebook Tutorial.ipynb
lakhotiaharshit Mar 25, 2020
1e98093
Fix circular imports
lakhotiaharshit Mar 25, 2020
1a2da8c
Fix import of Measure in Keithley
lakhotiaharshit Mar 25, 2020
c2dcd9e
Fix circular import issue from data_set
lakhotiaharshit Mar 25, 2020
ae2f47f
Merge branch 'master' into qcodes_init
jenshnielsen Mar 25, 2020
c5742bc
Add changelog
lakhotiaharshit Mar 26, 2020
59b039b
Make all module level imports relative
lakhotiaharshit Mar 26, 2020
f4248a3
Fix codacy be happy
lakhotiaharshit Mar 26, 2020
264aaca
Update 0.13.0.rst
lakhotiaharshit Mar 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/changes/0.13.0.rst
Expand Up @@ -13,6 +13,7 @@ be accessed via ``station_snapshot['config']``. (#1913)
The ``QCoDeS`` configuration module has moved from ``qcodes.config`` to ``qcodes.configuration``
to disambiguate it from the current active config which is defined in ``qcodes.config`` as always (#1682)

The legacy api such as Loop, active_loop, active_data_set, Measure, DataSet, new_data, load_data, Task, Wait, BreakIf, FormatLocation, DataArray, Formatter, GNUPlotFormat, HDF5Format, DiskIO, are no more imported in ``QCoDeS`` namespace by default. The core config now contains a new flag `import_legacy_api` that can be set to True if the legacy api needs to be imported in the ``QCoDeS`` namespace. (#1962)

New Instrument drivers:
_______________________
Expand All @@ -28,7 +29,7 @@ _________________
Improved:
_________

* .
The public api can also be imported from their respective modules for ex ``qcodes.dataset``, ``qcodes.instrument`` etc. (#1962)


Documentation:
Expand Down
135 changes: 101 additions & 34 deletions docs/examples/legacy/Combined Parameters.ipynb
Expand Up @@ -13,13 +13,31 @@
"metadata": {
"scrolled": false
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"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",
"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-28996-qcodes.log\n",
"False\n"
]
}
],
"source": [
"import qcodes as qc\n",
"import numpy as np \n",
"\n",
"from qcodes.instrument.parameter import ManualParameter\n",
"from qcodes.utils.validators import Numbers"
"from qcodes.utils.validators import Numbers\n",
"from qcodes.loops import Loop"
]
},
{
Expand Down Expand Up @@ -70,7 +88,7 @@
"outputs": [],
"source": [
"# 2d loop with a inner loop over a combined parameter\n",
"loop = qc.Loop(p1.sweep(0,10,1)).loop(combined.sweep(sweep_vals), delay=0.001).each(p4)"
"loop = Loop(p1.sweep(0,10,1)).loop(combined.sweep(sweep_vals), delay=0.001).each(p4)"
]
},
{
Expand All @@ -91,17 +109,17 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Started at 2018-10-23 12:59:28\n",
"Started at 2020-03-24 18:35:07\n",
"DataSet:\n",
" location = 'data/2018-10-23/#021_testsweep_12-59-28'\n",
" location = 'data/2020-03-24/#004_testsweep_18-35-07'\n",
" <Type> | <array_id> | <array.name> | <array.shape>\n",
" Setpoint | p1_set | p1 | (11,)\n",
" Setpoint | combined_set | combined | (11, 2)\n",
" Measured | p4 | p4 | (11, 2)\n",
" Measured | p1 | p1 | (11, 2)\n",
" Measured | p2 | p2 | (11, 2)\n",
" Measured | p3 | p3 | (11, 2)\n",
"Finished at 2018-10-23 12:59:28\n"
"Finished at 2020-03-24 18:35:07\n"
]
}
],
Expand Down Expand Up @@ -204,7 +222,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -218,17 +236,17 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"# 2d loop with a inner loop over a combined parameter\n",
"loop = qc.Loop(p1.sweep(0,10,1)).loop(combined.sweep(x_vals, y_vals, z_vals), delay=0.001).each(p4)"
"loop = Loop(p1.sweep(0,10,1)).loop(combined.sweep(x_vals, y_vals, z_vals), delay=0.001).each(p4)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -237,24 +255,24 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Started at 2018-10-23 12:59:42\n",
"Started at 2020-03-24 18:35:07\n",
"DataSet:\n",
" location = 'data/2018-10-23/#022_testsweep_12-59-42'\n",
" location = 'data/2020-03-24/#005_testsweep_18-35-07'\n",
" <Type> | <array_id> | <array.name> | <array.shape>\n",
" Setpoint | p1_set | p1 | (11,)\n",
" Setpoint | combined_set | combined | (11, 2)\n",
" Measured | p4 | p4 | (11, 2)\n",
" Measured | p1 | p1 | (11, 2)\n",
" Measured | p2 | p2 | (11, 2)\n",
" Measured | p3 | p3 | (11, 2)\n",
"Finished at 2018-10-23 12:59:43\n"
"Finished at 2020-03-24 18:35:07\n"
]
}
],
Expand All @@ -273,7 +291,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -301,7 +319,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 15,
"metadata": {},
"outputs": [
{
Expand All @@ -311,46 +329,46 @@
" ('unit', 'a.u'),\n",
" ('label', 'Sum'),\n",
" ('full_name', 'combined'),\n",
" ('aggregator', '<function linear at 0x000001B1F9196158>'),\n",
" ('aggregator', '<function linear at 0x0000024683100828>'),\n",
" ('p1',\n",
" {'value': 2.0,\n",
" 'ts': '2018-10-23 12:59:43',\n",
" 'raw_value': 2.0,\n",
" 'ts': '2020-03-24 18:35:07',\n",
" '__class__': 'qcodes.instrument.parameter.ManualParameter',\n",
" 'full_name': 'p1',\n",
" 'post_delay': 0,\n",
" 'label': 'p1',\n",
" 'vals': '<Numbers -10<=v<=10>',\n",
" 'inter_delay': 0,\n",
" 'name': 'p1',\n",
" 'post_delay': 0,\n",
" 'unit': ''}),\n",
" 'vals': '<Numbers -10<=v<=10>',\n",
" 'unit': '',\n",
" 'name': 'p1'}),\n",
" ('p2',\n",
" {'value': 2.0,\n",
" 'ts': '2018-10-23 12:59:43',\n",
" 'raw_value': 2.0,\n",
" 'ts': '2020-03-24 18:35:07',\n",
" '__class__': 'qcodes.instrument.parameter.ManualParameter',\n",
" 'full_name': 'p2',\n",
" 'post_delay': 0,\n",
" 'label': 'p2',\n",
" 'vals': '<Numbers -10<=v<=10>',\n",
" 'inter_delay': 0,\n",
" 'name': 'p2',\n",
" 'post_delay': 0,\n",
" 'unit': ''}),\n",
" 'vals': '<Numbers -10<=v<=10>',\n",
" 'unit': '',\n",
" 'name': 'p2'}),\n",
" ('p3',\n",
" {'value': 2.0,\n",
" 'ts': '2018-10-23 12:59:43',\n",
" 'raw_value': 2.0,\n",
" 'ts': '2020-03-24 18:35:07',\n",
" '__class__': 'qcodes.instrument.parameter.ManualParameter',\n",
" 'full_name': 'p3',\n",
" 'post_delay': 0,\n",
" 'label': 'p3',\n",
" 'vals': '<Numbers -10<=v<=10>',\n",
" 'inter_delay': 0,\n",
" 'name': 'p3',\n",
" 'post_delay': 0,\n",
" 'unit': ''})])"
" 'vals': '<Numbers -10<=v<=10>',\n",
" 'unit': '',\n",
" 'name': 'p3'})])"
]
},
"execution_count": 16,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -359,6 +377,13 @@
"# snapshot of the combined parameter\n",
"combined.snapshot()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -378,7 +403,49 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.7.5"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
Expand Down
149 changes: 85 additions & 64 deletions docs/examples/legacy/Comprehensive Plotting How-To.ipynb

Large diffs are not rendered by default.