Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
RadioObservatory
LOFAR
Commits
12bb6322
Commit
12bb6322
authored
6 years ago
by
Thomas Jürges
Browse files
Options
Downloads
Patches
Plain Diff
SW-382
: Replace Python2 integer division (/) with Python3 one (//)
parent
20cb77da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCU/PPSTune/ppstune/ppstune.py
+4
-4
4 additions, 4 deletions
LCU/PPSTune/ppstune/ppstune.py
with
4 additions
and
4 deletions
LCU/PPSTune/ppstune/ppstune.py
+
4
−
4
View file @
12bb6322
...
...
@@ -1477,7 +1477,7 @@ def measure_diff_stability(clock_mhz, repeat = 10,
diffs
.
append
(
normalized_diffs
)
transposed
=
transpose_lists
(
diffs
)
medians
=
[
sorted
(
row
)[
repeat
/
2
]
for
row
in
transposed
]
medians
=
[
sorted
(
row
)[
repeat
//
2
]
for
row
in
transposed
]
deviating
=
[
sum
([
diff
!=
median
for
diff
in
row
])
for
median
,
row
in
zip
(
medians
,
transposed
)]
return
deviating
,
medians
...
...
@@ -1607,7 +1607,7 @@ def measure_all_delays(clock_mhz,
for
index
in
range
(
len
(
failed_attempts
)):
if
medians
[
index
]
!=
previous_medians
[
index
]:
fails
=
failed_attempts
[
index
]
failed_attempts
[
index
]
=
min
(
repeat
,
fails
+
1
+
repeat
/
2
)
failed_attempts
[
index
]
=
min
(
repeat
,
fails
+
1
+
repeat
//
2
)
previous_medians
=
medians
logging
.
info
(
'
Diff errors %3d: [%s]
'
,
delay_step
,
...
...
@@ -1824,7 +1824,7 @@ def ap_optimal_delay_step(ap_failures, cycle_length = 67):
at_minimum
=
[
fails
==
minimum
for
fails
in
ap_failures
]
if
all
(
at_minimum
):
return
-
int
(
floor
(
cycle_length
/
2
)
)
return
-
(
cycle_length
//
2
)
d_forward
=
distance_forward
(
at_minimum
,
False
)
d_reverse
=
distance_forward
(
at_minimum
[::
-
1
],
False
)[::
-
1
]
...
...
@@ -1833,7 +1833,7 @@ def ap_optimal_delay_step(ap_failures, cycle_length = 67):
for
d_for
,
d_rev
in
zip
(
d_forward
,
d_reverse
)]
modified_distance
=
[]
for
dist
in
distance
:
if
dist
<=
cycle_length
/
2
:
if
dist
<=
cycle_length
//
2
:
modified_distance
.
append
(
dist
)
else
:
modified_distance
.
append
(
cycle_length
-
dist
)
...
...
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