Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
b749cdc8
Commit
b749cdc8
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-544
: Modernise dict construction using a generator
parent
e18710e1
No related branches found
No related tags found
1 merge request
!199
L2SS-544: Improve LibConfiguration parsing, and return a dict instead of list...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tangostationcontrol/tangostationcontrol/toolkit/archiver.py
+3
-3
3 additions, 3 deletions
tangostationcontrol/tangostationcontrol/toolkit/archiver.py
with
3 additions
and
3 deletions
tangostationcontrol/tangostationcontrol/toolkit/archiver.py
+
3
−
3
View file @
b749cdc8
...
@@ -373,7 +373,7 @@ class Archiver():
...
@@ -373,7 +373,7 @@ class Archiver():
es
=
DeviceProxy
(
es_name
)
es
=
DeviceProxy
(
es_name
)
attrs
.
extend
(
list
(
es
.
AttributeList
or
[]))
attrs
.
extend
(
list
(
es
.
AttributeList
or
[]))
errs
.
extend
(
list
(
es
.
AttributeErrorList
or
[]))
errs
.
extend
(
list
(
es
.
AttributeErrorList
or
[]))
return
dict
((
a
,
e
)
for
a
,
e
in
zip
(
attrs
,
errs
)
if
e
)
or
{
}
return
{
a
:
e
for
a
,
e
in
zip
(
attrs
,
errs
)
if
e
}
def
get_attribute_errors
(
self
,
attribute_name
:
str
):
def
get_attribute_errors
(
self
,
attribute_name
:
str
):
"""
"""
...
@@ -419,7 +419,7 @@ class Archiver():
...
@@ -419,7 +419,7 @@ class Archiver():
attribute_name
=
attribute_name_from_url
(
attribute_name
)
attribute_name
=
attribute_name_from_url
(
attribute_name
)
if
self
.
is_attribute_archived
(
attribute_name
):
if
self
.
is_attribute_archived
(
attribute_name
):
es
=
DeviceProxy
(
self
.
get_attribute_subscriber
(
attribute_name
))
es
=
DeviceProxy
(
self
.
get_attribute_subscriber
(
attribute_name
))
freq_dict
=
dict
((
a
,
r
)
for
a
,
r
in
zip
(
es
.
AttributeList
,
es
.
AttributeRecordFreqList
)
)
freq_dict
=
{
a
:
r
for
a
,
r
in
zip
(
es
.
AttributeList
,
es
.
AttributeRecordFreqList
)
}
for
f
in
freq_dict
:
for
f
in
freq_dict
:
if
attribute_name
.
lower
()
in
f
:
if
attribute_name
.
lower
()
in
f
:
return
freq_dict
.
get
(
f
,
0.
)
return
freq_dict
.
get
(
f
,
0.
)
...
@@ -433,7 +433,7 @@ class Archiver():
...
@@ -433,7 +433,7 @@ class Archiver():
attribute_name
=
attribute_name_from_url
(
attribute_name
)
attribute_name
=
attribute_name_from_url
(
attribute_name
)
if
self
.
is_attribute_archived
(
attribute_name
):
if
self
.
is_attribute_archived
(
attribute_name
):
es
=
DeviceProxy
(
self
.
get_attribute_subscriber
(
attribute_name
))
es
=
DeviceProxy
(
self
.
get_attribute_subscriber
(
attribute_name
))
fail_dict
=
dict
((
a
,
r
)
for
a
,
r
in
zip
(
es
.
AttributeList
,
es
.
AttributeFailureFreqList
)
)
fail_dict
=
{
a
:
r
for
a
,
r
in
zip
(
es
.
AttributeList
,
es
.
AttributeFailureFreqList
)
}
for
f
in
fail_dict
:
for
f
in
fail_dict
:
if
attribute_name
.
lower
()
in
f
:
if
attribute_name
.
lower
()
in
f
:
return
fail_dict
.
get
(
f
,
0.
)
return
fail_dict
.
get
(
f
,
0.
)
...
...
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