Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IPI_annot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
Maxence Ferrari
IPI_annot
Commits
2b75f8cd
Commit
2b75f8cd
authored
4 years ago
by
ferrari
Browse files
Options
Downloads
Patches
Plain Diff
Fix and improve number of file widget
parent
0a8fbc14
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
IPI_bombyx.py
+10
-7
10 additions, 7 deletions
IPI_bombyx.py
ipi_extract.py
+2
-0
2 additions, 0 deletions
ipi_extract.py
with
12 additions
and
7 deletions
IPI_bombyx.py
+
10
−
7
View file @
2b75f8cd
...
...
@@ -20,8 +20,8 @@ class BetterIter(object):
def
__iter__
(
self
):
return
self
def
_test_done
(
self
,
list_pass
):
self
.
curr_len
=
len
(
list_pass
)
def
_test_done
(
self
):
self
.
curr_len
=
len
(
self
.
list_pass
)
self
.
overlap
=
self
.
curr_len
>=
self
.
max_num
def
__next__
(
self
):
...
...
@@ -33,9 +33,9 @@ class BetterIter(object):
val
=
next
(
self
.
wrapped
)
self
.
done_file
.
seek
(
0
)
list_pass
=
[
int
(
v
)
for
v
in
self
.
done_file
.
read
().
split
(
'
\n
'
)
if
len
(
v
)]
self
.
_test_done
(
list_pass
)
if
(
val
not
in
list_pass
)
or
self
.
overlap
:
self
.
list_pass
=
[
int
(
v
)
for
v
in
self
.
done_file
.
read
().
split
(
'
\n
'
)
if
len
(
v
)]
self
.
_test_done
()
if
(
val
not
in
self
.
list_pass
)
or
self
.
overlap
:
break
self
.
current
=
val
return
val
...
...
@@ -59,7 +59,8 @@ def _next_file(event, refs, order, df, save, args, outpath, done_file, text):
try
:
ipi
.
reset
(
refs
[
'
callback
'
],
os
.
path
.
join
(
args
.
wd
,
df
.
iloc
[
ind
].
filepredmax
.
strip
(
'
/
'
)),
args
.
channel
)
refs
[
'
fig
'
].
canvas
.
set_window_title
(
'
IPI of
'
+
df
.
iloc
[
ind
].
filepredmax
.
rsplit
(
'
/
'
,
1
)[
-
1
])
text
.
set_text
(
'
{order.curr_len} files done
'
)
usr_files
=
[
v
for
f
in
save
for
v
in
f
.
passage
.
unique
()
if
v
in
order
.
list_pass
]
text
.
set_text
(
f
'
{
order
.
curr_len
}
files done
\n
{
len
(
usr_files
)
}
by you
'
)
except
(
RuntimeError
,
FileNotFoundError
)
as
e
:
print
(
e
,
'
Opening next file
'
)
_next_file
(
event
,
refs
,
order
,
df
,
save
,
args
,
outpath
,
done_file
,
text
)
...
...
@@ -98,8 +99,10 @@ def main(args):
ind
=
samples_order
.
__next__
()
ref_dict
=
ipi
.
init
(
os
.
path
.
join
(
args
.
wd
,
df
.
iloc
[
ind
].
filepredmax
.
strip
(
'
/
'
)),
args
.
channel
)
text_ax
=
plt
.
subplot
(
ref_dict
[
'
gridspec
'
][
-
1
,
-
4
:
-
2
])
text
=
text_ax
.
text
(
0.5
,
0.5
,
f
'
{
len
(
file_list
)
}
files done
'
,
horizontalalignment
=
'
center
'
,
usr_files
=
[
v
for
f
in
save
for
v
in
f
.
passage
.
unique
()
if
v
in
file_list
]
text
=
text_ax
.
text
(
0.5
,
0.5
,
f
'
{
len
(
file_list
)
}
files done
\n
{
len
(
usr_files
)
}
by you
'
,
horizontalalignment
=
'
center
'
,
verticalalignment
=
'
center
'
,
transform
=
text_ax
.
transAxes
)
text_ax
.
axis
(
'
off
'
)
next_file
=
partial
(
_next_file
,
refs
=
ref_dict
,
order
=
samples_order
,
df
=
df
,
save
=
save
,
args
=
args
,
outpath
=
outpath
,
done_file
=
done_file
,
text
=
text
)
next_ax
=
plt
.
subplot
(
ref_dict
[
'
gridspec
'
][
-
1
,
-
2
:])
...
...
This diff is collapsed.
Click to expand it.
ipi_extract.py
+
2
−
0
View file @
2b75f8cd
...
...
@@ -453,6 +453,8 @@ class Callback(object):
self
.
curr_vert
=
3
*
[
0
]
# Current vertical line of sig/spec for each plot
for
i
in
range
(
3
):
self
.
view_data
[
i
][
0
][
0
].
set_ydata
(
np
.
zeros
(
int
(
20e-3
*
sr
)))
self
.
view_data
[
i
][
2
][
0
].
set_ydata
(
np
.
zeros
(
int
(
20e-3
*
sr
)))
self
.
view_data
[
i
][
3
][
0
].
set_ydata
(
np
.
zeros
(
int
(
20e-3
*
sr
)))
self
.
view_data
[
i
][
1
][
0
].
set_clim
(
2000
,
2100
)
for
i
in
range
(
3
):
self
.
_set_label
(
i
,
EMLN
)
...
...
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