Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PlanarLarvae.jl
Manage
Activity
Members
Labels
Plan
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
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
Nyx
PlanarLarvae.jl
Commits
0a3d229a
Commit
0a3d229a
authored
2 years ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
additional argument to appendlabel!
parent
57774376
No related branches found
No related tags found
No related merge requests found
Pipeline
#100084
passed
2 years ago
Stage: test
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Project.toml
+1
-1
1 addition, 1 deletion
Project.toml
src/Datasets.jl
+10
-3
10 additions, 3 deletions
src/Datasets.jl
with
11 additions
and
4 deletions
Project.toml
+
1
−
1
View file @
0a3d229a
name
=
"PlanarLarvae"
name
=
"PlanarLarvae"
uuid
=
"c2615984-ef14-4d40-b148-916c85b43307"
uuid
=
"c2615984-ef14-4d40-b148-916c85b43307"
authors
=
[
"François Laurent"
,
"Institut Pasteur"
]
authors
=
[
"François Laurent"
,
"Institut Pasteur"
]
version
=
"0.9.
1
"
version
=
"0.9.
2
"
[deps]
[deps]
DelimitedFiles
=
"8bb1440f-4735-579b-a4ab-409b98df4dab"
DelimitedFiles
=
"8bb1440f-4735-579b-a4ab-409b98df4dab"
...
...
This diff is collapsed.
Click to expand it.
src/Datasets.jl
+
10
−
3
View file @
0a3d229a
...
@@ -1138,16 +1138,21 @@ coerce(ref::AbstractVector, a) = coerce(eltype(ref), a)
...
@@ -1138,16 +1138,21 @@ coerce(ref::AbstractVector, a) = coerce(eltype(ref), a)
coerce
(
ref
,
a
)
=
coerce
(
typeof
(
ref
),
a
)
coerce
(
ref
,
a
)
=
coerce
(
typeof
(
ref
),
a
)
"""
"""
appendlabel!(run, label; recordname=:labels, attrname=(:secondarylabels, :names), ignore=String[])
appendlabel!(run, label; recordname=:labels, attrname=(:secondarylabels, :names), ignore=String[]
, ifempty=true
)
Append a label to existing labels, at every track steps.
Append a label to existing labels, at every track steps.
Per default, the label to append is considered secondary, meaning it is represented appart in
Per default, the label to append is considered secondary, meaning it is represented appart in
the metadata. Secondary labels are recorded as such in metadata, so that they can be
the metadata. Secondary labels are recorded as such in metadata, so that they can be
distinguished from primary labels.
distinguished from primary labels.
Argument `ignore` lists uncompatible labels that prevent the label to be appended.
Argument `ignore` lists uncompatible labels that prevent the label to be appended.
Argument `ifempty`, if set to false, additionally allows preventing the specified label to be
appended in cases the label is explicitly undefined with an empty list of labels.
"""
"""
function
appendlabel!
(
run
::
Run
,
label
::
Union
{
Symbol
,
String
};
function
appendlabel!
(
run
::
Run
,
label
::
Union
{
Symbol
,
String
};
recordname
=:
labels
,
attrname
=
(
:
secondarylabels
,
:
names
),
ignore
=
String
[])
recordname
=:
labels
,
attrname
=
(
:
secondarylabels
,
:
names
),
ignore
=
String
[],
ifempty
=
true
)
decodelabels!
(
run
)
decodelabels!
(
run
)
topattr
=
attrname
isa
Symbol
?
attrname
:
attrname
[
1
]
topattr
=
attrname
isa
Symbol
?
attrname
:
attrname
[
1
]
labels
=
if
topattr
==
recordname
labels
=
if
topattr
==
recordname
...
@@ -1178,7 +1183,9 @@ function appendlabel!(run::Run, label::Union{Symbol, String};
...
@@ -1178,7 +1183,9 @@ function appendlabel!(run::Run, label::Union{Symbol, String};
for
(
i
,
existinglabel
)
in
enumerate
(
labels
)
for
(
i
,
existinglabel
)
in
enumerate
(
labels
)
if
isa
(
existinglabel
,
Vector
)
if
isa
(
existinglabel
,
Vector
)
if
isempty
(
existinglabel
)
if
isempty
(
existinglabel
)
labels
[
i
]
=
label
# not a vector
if
ifempty
labels
[
i
]
=
label
# not a vector
end
elseif
isempty
(
existinglabel
∩
ignore
)
elseif
isempty
(
existinglabel
∩
ignore
)
push!
(
existinglabel
,
label
)
push!
(
existinglabel
,
label
)
end
end
...
...
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