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

Package structure #22

Merged
merged 4 commits into from
Feb 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ Figured out a new way to use qcodes? Found a package that makes your life better

### Setup

- Install git: the [command-line toolset](https://git-scm.com/) is the most powerful but the [desktop GUI from github](https://desktop.github.com/) is also quite powerful
- Clone and register the package for development as described in [README.md#installation]

- Clone this repo:
- Run the tests. In the root directory of the repository:
```
git clone https://github.com/qdev-dk/Qcodes.git
python setup.py nosetests
```

- Install the dependencies, including for testing (see [README.md#Requirements])

- Run the tests. In the root directory of the repository:
or:
```
nosetests --with-coverage --cover-package=qcodes
```
Expand Down
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,32 @@ Qcodes is compatible with Python 3.3+. It is primarily intended for use from Jup

We recommend [Anaconda](https://www.continuum.io/downloads) as an easy way to get most of the dependencies out-of-the-box.

### Requirements
As the project is still private, install it directly from this repository:

(Note: with the exception of Python itself, these are just the versions currently installed by the core developers. We haven't tested compatibility with lower versions of most packages, but if you know that an older version works fine, please let us know. If a lower OR higher version of any package breaks Qcodes please open an issue.)
- Install git: the [command-line toolset](https://git-scm.com/) is the most powerful but the [desktop GUI from github](https://desktop.github.com/) is also quite good

- Python 3.3+
- numpy 1.10+
- pyvisa 1.8+
- IPython 4.0+
- ipywidgets 4.1+
- matplotlib 1.5+ (only for matplotlib plotting)
- pyqtgraph 0.9.10+ (only for pyqtgraph plotting)
- Clone this repository somewhere on your hard drive. If you're using command line git, open a terminal window in the directory where you'd like to put qcodes and type:
```
git clone https://github.com/qdev-dk/Qcodes.git
```

- Register it with Python, and install dependencies if any are missing: run this from the root directory of the repository you just cloned:
```
python setup.py develop
```

Now Qcodes should be available to import into all Python sessions you run. To test, run `python` from some other directory (not where you just ran `setup.py`) and type `import qcodes`. If it works without an error you're ready to go.

### Plotting Requirements

Because these can sometimes be tricky to install (and not everyone will want all of them), the plotting packages are not set as required dependencies, so setup.py will not automatically install them. You can install them with `pip`:

- For `qcodes.MatPlot`: matplotlib version 1.5 or higher
- For `qcodes.QtPlot`: pyqtgraph version 0.9.10 or higher

for testing:
### Updating Qcodes

- nose 1.3+
- coverage 4.0+
If you registered Qcodes with Python via `setup.py develop`, all you need to do to get the latest code is open a terminal window pointing to anywhere inside the repository and run `git pull`

## Usage

Expand Down
197 changes: 106 additions & 91 deletions docs/examples/Qcodes example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
" min-height: 50px;\n",
" max-height: 400px;\n",
" min-width: 400px;\n",
" max-width: 600px;\n",
" max-width: 700px;\n",
"}</style>"
],
"text/plain": [
Expand All @@ -251,13 +251,6 @@
"import time\n",
"import numpy as np\n",
"\n",
"# load the qcodes path, until we have this installed as a package\n",
"import sys\n",
"import os\n",
"qcpath = os.path.join('..','..')\n",
"if qcpath not in sys.path:\n",
" sys.path.append(qcpath)\n",
"\n",
"import qcodes as qc\n",
"\n",
"qc.set_mp_method('spawn') # force Windows behavior on mac\n",
Expand Down Expand Up @@ -342,7 +335,7 @@
"DataSet: DataMode.PULL_FROM_SERVER, location='testsweep'\n",
" amplitude: amplitude\n",
" chan0: chan0\n",
"started at 2016-01-28 14:53:15\n"
"started at 2016-02-03 21:16:47\n"
]
}
],
Expand Down Expand Up @@ -370,80 +363,102 @@
"data": {
"text/plain": [
"{'amplitude': DataArray[400]: amplitude\n",
" array([ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan]), 'chan0': DataArray[400]: chan0\n",
" array([ nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan])}"
" array([ 0.117, 0.117, 0.115, 0.111, 0.106, 0.099, 0.092, 0.085,\n",
" 0.077, 0.071, 0.064, 0.058, 0.053, 0.048, 0.044, 0.04 ,\n",
" 0.037, 0.034, 0.031, 0.029, 0.027, 0.025, 0.023, 0.022,\n",
" 0.02 , 0.019, 0.018, 0.017, 0.016, 0.015, 0.014, 0.013,\n",
" 0.013, 0.012, 0.011, 0.011, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan]),\n",
" 'chan0': DataArray[400]: chan0\n",
" array([-20. , -19.9, -19.8, -19.7, -19.6, -19.5, -19.4, -19.3, -19.2,\n",
" -19.1, -19. , -18.9, -18.8, -18.7, -18.6, -18.5, -18.4, -18.3,\n",
" -18.2, -18.1, -18. , -17.9, -17.8, -17.7, -17.6, -17.5, -17.4,\n",
" -17.3, -17.2, -17.1, -17. , -16.9, -16.8, -16.7, -16.6, -16.5,\n",
" -16.4, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan, nan, nan, nan, nan, nan,\n",
" nan, nan, nan, nan])}"
]
},
"execution_count": 5,
Expand Down Expand Up @@ -485,10 +500,10 @@
"text": [
"DataSet: DataMode.PULL_FROM_SERVER, location='test2d'\n",
" amplitude_3: amplitude\n",
" chan1: chan1\n",
" chan0: chan0\n",
" chan1: chan1\n",
" amplitude_0: amplitude\n",
"started at 2016-01-28 14:53:48\n"
"started at 2016-02-03 21:17:12\n"
]
}
],
Expand Down Expand Up @@ -523,13 +538,13 @@
"text": [
"DataSet: DataMode.PULL_FROM_SERVER, location='test_multi_d'\n",
" amplitude_5_0: amplitude\n",
" chan1: chan1\n",
" chan2: chan2\n",
" avg_amplitude: avg_amplitude\n",
" amplitude_2: amplitude\n",
" amplitude_3_0: amplitude\n",
" amplitude_2: amplitude\n",
" chan0: chan0\n",
" chan1: chan1\n",
"started at 2016-01-28 14:54:39\n"
"started at 2016-02-03 21:17:52\n"
]
}
],
Expand Down Expand Up @@ -558,7 +573,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"metadata": {
"collapsed": false,
"scrolled": false
Expand All @@ -569,11 +584,11 @@
"output_type": "stream",
"text": [
"DataSet: DataMode.PULL_FROM_SERVER, location='test_complex_param'\n",
" avg_amplitude: avg_amplitude\n",
" amplitude: amplitude\n",
" chan2: chan2\n",
" chan1: chan1\n",
" avg_amplitude: avg_amplitude\n",
"started at 2016-01-28 14:56:48\n"
"started at 2016-02-03 21:19:59\n"
]
}
],
Expand Down
Loading