Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
io
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
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
bioroboticslab
robofish
io
Commits
c95c84ed
Commit
c95c84ed
authored
2 years ago
by
mhocke
Browse files
Options
Downloads
Patches
Plain Diff
Fix gridpoints
Grid points were only visible in exported video files, but not during live view.
parent
b759f806
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!36
Fix gridpoints in robofish-io-render
Pipeline
#51658
failed
2 years ago
Stage: package
Stage: test
Stage: deploy
Stage: trigger
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/robofish/io/file.py
+6
-18
6 additions, 18 deletions
src/robofish/io/file.py
with
6 additions
and
18 deletions
src/robofish/io/file.py
+
6
−
18
View file @
c95c84ed
...
...
@@ -15,7 +15,6 @@
# email andi.gerken@gmail.com
# -----------------------------------------------------------
from
pytest
import
skip
import
robofish.io
from
robofish.io.entity
import
Entity
import
h5py
...
...
@@ -259,7 +258,6 @@ class File(h5py.File):
return
self
def
__exit__
(
self
,
type
,
value
,
traceback
):
# Check if the context was left under normal circumstances
if
(
hasattr
(
self
,
"
closed
"
)
and
not
self
.
closed
)
and
(
type
,
...
...
@@ -933,15 +931,6 @@ class File(h5py.File):
# Plotting outside of the figure to have the label
ax
.
plot
([
550
,
600
],
[
550
,
600
],
lw
=
5
,
c
=
this_c
,
label
=
fish_id
)
# ax.scatter(
# [poses[:, skip_timesteps, 0]],
# [poses[:, skip_timesteps, 1]],
# marker="h",
# c="black",
# s=ms,
# label="Start",
# zorder=5,
# )
ax
.
scatter
(
[
poses
[:,
-
1
,
0
]],
[
poses
[:,
-
1
,
1
]],
...
...
@@ -1025,10 +1014,6 @@ class File(h5py.File):
plt
.
plot
([],
[],
lw
=
options
[
"
linewidth
"
],
zorder
=
0
)[
0
]
for
_
in
range
(
n_entities
)
]
points
=
[
plt
.
scatter
([],
[],
marker
=
"
x
"
,
color
=
"
k
"
),
plt
.
plot
([],
[],
linestyle
=
"
dotted
"
,
alpha
=
0.5
,
color
=
"
k
"
,
zorder
=
0
)[
0
],
]
categories
=
[
entity
.
attrs
.
get
(
"
category
"
,
None
)
for
entity
in
self
.
entities
]
entity_polygons
=
[
patches
.
Polygon
(
shape_vertices
(
options
[
"
entity_scale
"
]),
facecolor
=
color
)
...
...
@@ -1053,9 +1038,12 @@ class File(h5py.File):
)
xv
,
yv
=
np
.
meshgrid
(
x
,
y
)
grid_points
=
plt
.
scatter
(
xv
,
yv
,
c
=
"
gray
"
,
s
=
1.5
)
points
=
[
plt
.
scatter
([],
[],
marker
=
"
x
"
,
color
=
"
k
"
),
plt
.
plot
([],
[],
linestyle
=
"
dotted
"
,
alpha
=
0.5
,
color
=
"
k
"
,
zorder
=
0
)[
0
],
plt
.
scatter
(
xv
,
yv
,
c
=
"
gray
"
,
s
=
1.5
),
]
# border = plt.plot(border_vertices[0], border_vertices[1], "k")
border
=
patches
.
Polygon
(
border_vertices
.
T
,
facecolor
=
"
w
"
,
zorder
=-
1
)
def
title
(
file_frame
:
int
)
->
str
:
...
...
@@ -1146,7 +1134,7 @@ class File(h5py.File):
[
options
[
"
view_size
"
],
min_view
+
options
[
"
margin
"
]]
)
if
not
np
.
isnan
(
min_view
).
any
()
and
not
new_view_size
is
np
.
nan
:
if
not
np
.
isnan
(
min_view
).
any
()
and
new_view_size
is
not
np
.
nan
:
self
.
middle_of_swarm
=
options
[
"
slow_view
"
]
*
self
.
middle_of_swarm
+
(
1
-
options
[
"
slow_view
"
])
*
np
.
mean
(
...
...
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