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
14dc4f58
Commit
14dc4f58
authored
4 months ago
by
mhocke
Browse files
Options
Downloads
Patches
Plain Diff
Add cutom color support to rendering
parent
3c053452
No related branches found
No related tags found
1 merge request
!50
Merge dev_mathis with multiple changes
Pipeline
#66463
failed
4 months ago
Stage: package
Stage: test
Stage: deploy
Stage: trigger
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/robofish/io/app.py
+10
-0
10 additions, 0 deletions
src/robofish/io/app.py
src/robofish/io/file.py
+12
-1
12 additions, 1 deletion
src/robofish/io/file.py
with
22 additions
and
1 deletion
src/robofish/io/app.py
+
10
−
0
View file @
14dc4f58
...
@@ -241,6 +241,16 @@ def render(args: argparse.Namespace = None) -> None:
...
@@ -241,6 +241,16 @@ def render(args: argparse.Namespace = None) -> None:
help
=
"
Last frame to render. Render until the end if set to 0.
"
,
help
=
"
Last frame to render. Render until the end if set to 0.
"
,
)
)
parser
.
add_argument
(
"
--custom-colors
"
,
type
=
str
,
nargs
=
"
+
"
,
default
=
[],
help
=
"
Custom colors to use for guppies. Use spaces as delimiter.
"
"
To set all guppies to the same color, pass only one color.
"
"
Hexadecimal values, color names and matplotlib abbreviations are supported (
\"
#000000
\"
, black, k)
"
)
default_options
=
{
default_options
=
{
"
linewidth
"
:
2
,
"
linewidth
"
:
2
,
"
speedup
"
:
1
,
"
speedup
"
:
1
,
...
...
This diff is collapsed.
Click to expand it.
src/robofish/io/file.py
+
12
−
1
View file @
14dc4f58
...
@@ -1004,6 +1004,7 @@ class File(h5py.File):
...
@@ -1004,6 +1004,7 @@ class File(h5py.File):
render_zones
:
bool
=
False
,
render_zones
:
bool
=
False
,
render_swarm_center
:
bool
=
False
,
render_swarm_center
:
bool
=
False
,
highlight_switches
:
bool
=
False
,
highlight_switches
:
bool
=
False
,
custom_colors
:
bool
=
None
,
dpi
:
int
=
200
,
dpi
:
int
=
200
,
figsize
:
int
=
10
,
figsize
:
int
=
10
,
)
->
None
:
)
->
None
:
...
@@ -1058,7 +1059,17 @@ class File(h5py.File):
...
@@ -1058,7 +1059,17 @@ class File(h5py.File):
categories
=
[
entity
.
attrs
.
get
(
"
category
"
,
None
)
for
entity
in
self
.
entities
]
categories
=
[
entity
.
attrs
.
get
(
"
category
"
,
None
)
for
entity
in
self
.
entities
]
n_fish
=
len
([
c
for
c
in
categories
if
c
==
"
organism
"
])
n_fish
=
len
([
c
for
c
in
categories
if
c
==
"
organism
"
])
lines
=
[
plt
.
plot
([],
[],
lw
=
linewidth
,
zorder
=
0
)[
0
]
for
_
in
range
(
n_entities
)]
lines
=
[
plt
.
plot
(
[],
[],
lw
=
linewidth
,
color
=
custom_colors
[
i
%
len
(
custom_colors
)
-
1
]
if
custom_colors
else
None
,
zorder
=
0
,
)[
0
]
for
i
in
range
(
n_entities
)
]
entity_colors
=
[
lines
[
entity
].
get_color
()
for
entity
in
range
(
n_entities
)]
entity_colors
=
[
lines
[
entity
].
get_color
()
for
entity
in
range
(
n_entities
)]
fish_colors
=
[
fish_colors
=
[
color
color
...
...
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