Skip to content

Commit baa2f79

Browse files
i-am-mounceammouncemplilly4395
authored
Various fixes (#252)
* fix(general): drange needed to return an np.ndarray for nondivisible deltas * fix(general): first_string needed a typeerror for thigns that don't fall in either of the first down conditions * fix(general): is_numeric_type behaved incorrectly for boolean * refactor(measurement): removed task specific experiment objects * test(general): rewrote tests to comply with pytest style and more specific failures * fix(plotting): fixed live plot to correctly display scan indicies * fix(drivers): fixed TestVoltage to go between -10 and 10 * feature(measurement): delta product for unlimited scans * chore(): added relevent __init__ changes * chore(measurement): removed charge recorder, should be obsolete * feature(measurement): initial measurement v1 and tests * chore(general): removed quadature sum, not used * chore(general): moved experiment specific general functions to measurement * chore(general): itemattribute is now a separate package * removed coding statement at the top of the file * tests(): removed legacy tests * chore(drivers): fixed itemattribute syntax * fix(measurement): fixed imports for get_pyscan_version * test(): updated more tests to follow pytest syntax * chore(measurement): removed 'time' from runinfo to re implement later * chore(syntax): small documentation and syntax changes * fix(general): is_numeric_type behaved incorrectly for boolean * fix(general): first_string needed a typeerror for thigns that don't fall in either of the first down conditions * main to v1 update yml (#240) * Update test_station.yml * Update complete.yml * chore(reorg): removed application specific experiments * chore(reorg): removed chart recorder, should be replaced by continuous scan * chore(reog): ItemAttribute is now a separate package * chore(reorg): removed quadrature sum, not used in pyscan * Added itemattribue to requirements * chore(reorg): removed sparse experiment example, refactor later * docs(): fixed documentation to compile * test(): renamed test folders, removed scope, added new experiment tests * chore(): reorganized runinfo, changed a few property names, removed drop() * "chore(): changed logging to default False" * chore(): Removed legacy sweep * fix(measurement): merged average and regular sweep, split metadata save, absexpt reorg * chore(): removed unnecessary comments and debug * chore(): refactored continuous scan * chore(): streamlined continuous scan, added tests for continuous experiment methods * fix(): if json encoder doesn't find the right type, adds could not serialize string * docs(): fixed flake8 errors * fix(measurement): average_scan values are now np.ndarray * fix(plotting): plot2D runinfo syntax fixed * chore: reran notebooks, made speed changes * feat(general): inifite iterator didn't work with product, integrated into delta_product * feat(general): reconfigured stack or append * fix(measurement): fixed continuous scan * fix: small bug in drange, need to return single valued array * fix: fixed bug in first string, added better test * fix: fixed is_numeric_type for boolean and added better tests * refactor(measurement): removed task specific experiment objects * refactor(measurement): removed unnecessary imports and ChartRecorder mode * chore: removed unused files * chore: remoded coding utf-8, it's redundant * chore: removed unused file and merge error * docs: fixed flake8 errors * ci: fixed flake8 errors and addeded ignores * ci: fixed flake8 for tests * ci: updated python to test on latest 3.12 * fix: fixed continuous scan error for n_max > 2 * ci: removed continuous scan plot, need to fix * style: no need for AbstractExperiment, there is only one * test: fixed notebook compatibility --------- Co-authored-by: [email protected] <[email protected]> Co-authored-by: mplilly4395 <[email protected]>
1 parent 4947570 commit baa2f79

File tree

134 files changed

+2347
-5477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+2347
-5477
lines changed

.flake8

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,36 @@
44
# Loaded by flake8 by default
55

66
[flake8]
7-
# DO NOT check for the following errors:
87

8+
exclude=
9+
.github
10+
.venv
11+
backup
12+
docs
13+
demo_notebooks
14+
driver_test_notbooks
15+
user_experiments
16+
17+
# DO NOT check for the following errors:
918
# E266: too many leading '#' for block comment
1019
# E722: do not use bare except, specify exception instead
1120
# W503: Line breaks should occur after the binary operator
1221
# to keep all variable names aligned. (we're doing the opposite)
1322
# C901 too complex, change this later
14-
ignore=E266,E722,W503,C901
15-
16-
; exclude=
23+
ignore=E266,E722,W503,C901,F129
1724

1825
# F401: module imported but unused
1926
# F403 unable to detect undefined names
2027
per-file-ignores =
28+
*/__init__.py:F401,F403
29+
2130
pyscan/__init__.py:F401,F403
2231
pyscan/measurement/__init__.py:F401,F403
2332
pyscan/general/__init__.py:F401,F403
2433
pyscan/drivers/__init__.py:F401,F403
2534
pyscan/plotting/__init__.py:F401,F403
26-
*/__init__.py:F401,F403
35+
36+
./test/test_measurement/test_abstract_experiment.py:F841
37+
./test/test_measurement/test_experiment/*.py:E129,E128
2738

28-
# 120 characters is a more agreeable max line length for modern displays
29-
max-line-length=120
39+
max-line-length=127

.github/workflows/complete.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v3
22-
- name: Set up Python 3.10
22+
- name: Set up Python 3.12
2323
uses: actions/setup-python@v3
2424
with:
25-
python-version: "3.10"
25+
python-version: "3.12"
2626

2727
- name: Install package
2828
run: |
@@ -51,10 +51,10 @@ jobs:
5151

5252
steps:
5353
- uses: actions/checkout@v3
54-
- name: Set up Python 3.10
54+
- name: Set up Python 3.12
5555
uses: actions/setup-python@v3
5656
with:
57-
python-version: "3.10"
57+
python-version: "3.12"
5858

5959
- name: Install package
6060
run: |

demo_notebooks/01-example_property_scans.ipynb

Lines changed: 16 additions & 35 deletions
Large diffs are not rendered by default.

demo_notebooks/02-example_plotting_multiD_data.ipynb

Lines changed: 9 additions & 28 deletions
Large diffs are not rendered by default.

demo_notebooks/03-example_repeat_scans.ipynb

Lines changed: 6 additions & 25 deletions
Large diffs are not rendered by default.

demo_notebooks/04-example_average_scans.ipynb

Lines changed: 7 additions & 33 deletions
Large diffs are not rendered by default.

demo_notebooks/05-example_function_scans.ipynb

Lines changed: 5 additions & 24 deletions
Large diffs are not rendered by default.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# 06 Example - Continuous Scan"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"import pyscan as ps\n",
17+
"import numpy as np\n",
18+
"import matplotlib.pyplot as plt\n",
19+
"from time import sleep\n",
20+
"import random"
21+
]
22+
},
23+
{
24+
"cell_type": "markdown",
25+
"metadata": {},
26+
"source": [
27+
"## Setup devices"
28+
]
29+
},
30+
{
31+
"cell_type": "code",
32+
"execution_count": 2,
33+
"metadata": {},
34+
"outputs": [],
35+
"source": [
36+
"devices = ps.ItemAttribute()\n",
37+
"\n",
38+
"devices.v1 = ps.TestVoltage()\n"
39+
]
40+
},
41+
{
42+
"cell_type": "markdown",
43+
"metadata": {},
44+
"source": [
45+
"## Define a measure function"
46+
]
47+
},
48+
{
49+
"cell_type": "code",
50+
"execution_count": 3,
51+
"metadata": {},
52+
"outputs": [],
53+
"source": [
54+
"def measure_up_to_3D(expt):\n",
55+
" d = ps.ItemAttribute()\n",
56+
"\n",
57+
" d.x1 = expt.runinfo.scan0.i\n",
58+
" d.x2 = [expt.runinfo.scan0.i for _ in range(2)]\n",
59+
" d.x3 = [[expt.runinfo.scan0.i, expt.runinfo.scan0.i] for _ in range(2)]\n",
60+
"\n",
61+
" return d"
62+
]
63+
},
64+
{
65+
"cell_type": "markdown",
66+
"metadata": {},
67+
"source": [
68+
"## Experiments"
69+
]
70+
},
71+
{
72+
"cell_type": "markdown",
73+
"metadata": {},
74+
"source": [
75+
"### 1. 1D Scan with scan0 as ContinuousScan, using point data"
76+
]
77+
},
78+
{
79+
"cell_type": "code",
80+
"execution_count": 4,
81+
"metadata": {},
82+
"outputs": [
83+
{
84+
"name": "stdout",
85+
"output_type": "stream",
86+
"text": [
87+
"Stopping Experiment\n"
88+
]
89+
}
90+
],
91+
"source": [
92+
"runinfo = ps.RunInfo()\n",
93+
"runinfo.measure_function = measure_up_to_3D\n",
94+
"runinfo.scan0 = ps.ContinuousScan(n_max=100, dt=0.01)\n",
95+
"\n",
96+
"expt = ps.Experiment(runinfo, devices)\n",
97+
"expt.run()"
98+
]
99+
}
100+
],
101+
"metadata": {
102+
"kernelspec": {
103+
"display_name": ".venv",
104+
"language": "python",
105+
"name": "python3"
106+
},
107+
"language_info": {
108+
"codemirror_mode": {
109+
"name": "ipython",
110+
"version": 3
111+
},
112+
"file_extension": ".py",
113+
"mimetype": "text/x-python",
114+
"name": "python",
115+
"nbconvert_exporter": "python",
116+
"pygments_lexer": "ipython3",
117+
"version": "3.12.4"
118+
}
119+
},
120+
"nbformat": 4,
121+
"nbformat_minor": 2
122+
}

demo_notebooks/06-example_sparse_experiment.ipynb

Lines changed: 0 additions & 239 deletions
This file was deleted.

demo_notebooks/07-example_timed_propertyscan.ipynb

Lines changed: 0 additions & 358 deletions
This file was deleted.

0 commit comments

Comments
 (0)