Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aliby-mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Swain Lab
aliby
aliby-mirror
Commits
b9f7a90b
Commit
b9f7a90b
authored
3 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
add tests
Former-commit-id: 1115de5f4cfc796e8014e22be8b0758449e63545
parent
6510ead6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/functions/tracks.py
+2
-5
2 additions, 5 deletions
core/functions/tracks.py
with
2 additions
and
5 deletions
core/functions/tracks.py
+
2
−
5
View file @
b9f7a90b
...
@@ -168,7 +168,7 @@ def rec_bottom(d, k):
...
@@ -168,7 +168,7 @@ def rec_bottom(d, k):
return
rec_bottom
(
d
,
d
[
k
])
return
rec_bottom
(
d
,
d
[
k
])
def
join_tracks
(
tracks
,
joinable_pairs
,
drop
=
Fals
e
)
->
pd
.
DataFrame
:
def
join_tracks
(
tracks
,
joinable_pairs
,
drop
=
Tru
e
)
->
pd
.
DataFrame
:
"""
"""
Join pairs of tracks from later tps towards the start.
Join pairs of tracks from later tps towards the start.
...
@@ -186,7 +186,7 @@ def join_tracks(tracks, joinable_pairs, drop=False) -> pd.DataFrame:
...
@@ -186,7 +186,7 @@ def join_tracks(tracks, joinable_pairs, drop=False) -> pd.DataFrame:
tmp
=
copy
(
tracks
)
tmp
=
copy
(
tracks
)
for
target
,
source
in
joinable_pairs
:
for
target
,
source
in
joinable_pairs
:
tmp
.
loc
[
target
]
=
join_track_pair
s
(
tmp
.
loc
[
target
],
tmp
.
loc
[
source
])
tmp
.
loc
[
target
]
=
join_track_pair
(
tmp
.
loc
[
target
],
tmp
.
loc
[
source
])
if
drop
:
if
drop
:
tmp
=
tmp
.
drop
(
source
)
tmp
=
tmp
.
drop
(
source
)
...
@@ -194,9 +194,6 @@ def join_tracks(tracks, joinable_pairs, drop=False) -> pd.DataFrame:
...
@@ -194,9 +194,6 @@ def join_tracks(tracks, joinable_pairs, drop=False) -> pd.DataFrame:
return
tmp
return
tmp
from
copy
import
copy
def
join_track_pair
(
target
,
source
):
def
join_track_pair
(
target
,
source
):
tgt_copy
=
copy
(
target
)
tgt_copy
=
copy
(
target
)
end
=
find_1st
(
target
.
values
[::
-
1
],
0
,
cmp_larger
)
end
=
find_1st
(
target
.
values
[::
-
1
],
0
,
cmp_larger
)
...
...
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