Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenQlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
las-nq
OpenQlab
Commits
36e86afe
Commit
36e86afe
authored
5 years ago
by
Christian Darsow-Fromm
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop'
parents
43bcdb48
619c31a5
No related branches found
No related tags found
No related merge requests found
Pipeline
#4099
canceled
5 years ago
Stage: test
Stage: build
Stage: test-build
Stage: deploy
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/openqlab/analysis/__init__.py
+1
-1
1 addition, 1 deletion
src/openqlab/analysis/__init__.py
src/openqlab/plots/time_domain.py
+4
-4
4 additions, 4 deletions
src/openqlab/plots/time_domain.py
src/tests/test_plots.py
+11
-0
11 additions, 0 deletions
src/tests/test_plots.py
with
16 additions
and
5 deletions
src/openqlab/analysis/__init__.py
+
1
−
1
View file @
36e86afe
from
.servo_design
import
ServoDesign
from
.servo_design
import
ServoDesign
from
.gaussian_beam
import
fit_beam_data
,
GaussianBeam
from
.gaussian_beam
import
fit_beam_data
,
GaussianBeam
from
..conversion
import
db
from
..conversion
import
db
from
.
import
phase
from
.
import
phase
,
cavity
This diff is collapsed.
Click to expand it.
src/openqlab/plots/time_domain.py
+
4
−
4
View file @
36e86afe
...
@@ -80,8 +80,8 @@ def scope(traces, title='Oscilloscope View'):
...
@@ -80,8 +80,8 @@ def scope(traces, title='Oscilloscope View'):
from
mpl_toolkits.axes_grid1
import
host_subplot
from
mpl_toolkits.axes_grid1
import
host_subplot
import
mpl_toolkits.axisartist
as
AA
import
mpl_toolkits.axisartist
as
AA
traces
=
DataContainer
(
# then you can also conviniently put in a single column, which would otherwise be a series
traces
)
# then you can also conviniently put in a single column, which would otherwise be a seri
es
traces
=
DataContainer
(
trac
es
)
offset
=
50
offset
=
50
Ntraces
=
len
(
traces
.
columns
)
Ntraces
=
len
(
traces
.
columns
)
if
Ntraces
>
4
:
if
Ntraces
>
4
:
...
@@ -91,7 +91,7 @@ def scope(traces, title='Oscilloscope View'):
...
@@ -91,7 +91,7 @@ def scope(traces, title='Oscilloscope View'):
host
=
host_subplot
(
111
,
axes_class
=
AA
.
Axes
)
host
=
host_subplot
(
111
,
axes_class
=
AA
.
Axes
)
plt
.
subplots_adjust
(
right
=
1.0
-
0.11
*
(
Ntraces
-
1
))
plt
.
subplots_adjust
(
right
=
1.0
-
0.11
*
(
Ntraces
-
1
))
line
,
=
host
.
plot
(
traces
.
index
,
traces
.
iloc
[:,
0
],
label
=
traces
.
columns
[
0
])
line
,
=
host
.
plot
(
np
.
array
(
traces
.
index
)
,
np
.
array
(
traces
.
iloc
[:,
0
]
)
,
label
=
traces
.
columns
[
0
])
host
.
set_ylabel
(
traces
.
columns
[
0
])
host
.
set_ylabel
(
traces
.
columns
[
0
])
host
.
set_xlabel
(
traces
.
index
.
name
)
host
.
set_xlabel
(
traces
.
index
.
name
)
host
.
axis
[
'
left
'
].
label
.
set_color
(
line
.
get_color
())
host
.
axis
[
'
left
'
].
label
.
set_color
(
line
.
get_color
())
...
@@ -111,7 +111,7 @@ def scope(traces, title='Oscilloscope View'):
...
@@ -111,7 +111,7 @@ def scope(traces, title='Oscilloscope View'):
pax
.
major_ticks
.
set_ticksize
(
4.0
)
pax
.
major_ticks
.
set_ticksize
(
4.0
)
ax
.
axis
[
'
right
'
]
=
pax
ax
.
axis
[
'
right
'
]
=
pax
line
,
=
ax
.
plot
(
traces
.
index
,
traces
.
iloc
[:,
ii
],
label
=
traces
.
columns
[
ii
])
line
,
=
ax
.
plot
(
np
.
array
(
traces
.
index
)
,
np
.
array
(
traces
.
iloc
[:,
ii
]
)
,
label
=
traces
.
columns
[
ii
])
ax
.
axis
[
'
right
'
].
toggle
(
all
=
True
)
ax
.
axis
[
'
right
'
].
toggle
(
all
=
True
)
ax
.
set_ylabel
(
traces
.
columns
[
ii
])
ax
.
set_ylabel
(
traces
.
columns
[
ii
])
ax
.
axis
[
'
right
'
].
label
.
set_color
(
line
.
get_color
())
ax
.
axis
[
'
right
'
].
label
.
set_color
(
line
.
get_color
())
...
...
This diff is collapsed.
Click to expand it.
src/tests/test_plots.py
+
11
−
0
View file @
36e86afe
...
@@ -51,3 +51,14 @@ class TestAmplitudePhase(unittest.TestCase):
...
@@ -51,3 +51,14 @@ class TestAmplitudePhase(unittest.TestCase):
def
test_clamp_phase_warns
(
self
):
def
test_clamp_phase_warns
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
with
self
.
assertWarns
(
DeprecationWarning
):
plots
.
frequency_domain
.
_clamp_phase
(
4
)
plots
.
frequency_domain
.
_clamp_phase
(
4
)
class
TestTimeDomain
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
data
=
io
.
read
(
r
'
./ContainerTestData/SuccedingImport/Oscilloscope/Keysight/20180606_001.csv
'
)
def
test_default_plot
(
self
):
fig
=
plots
.
scope
(
self
.
data
)
fig
=
plots
.
scope
(
self
.
data
.
iloc
[:,
0
])
self
.
assertIsInstance
(
fig
,
matplotlib
.
figure
.
Figure
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment