Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
ToolBox
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
Model registry
Operate
Environments
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
SCS
ToolBox
Commits
ae724d3c
Commit
ae724d3c
authored
3 years ago
by
Laurent Mercadier
Browse files
Options
Downloads
Patches
Plain Diff
Only check keys if menmonic has more than one version
parent
a8f47d21
No related branches found
No related tags found
1 merge request
!159
Only check keys if menmonic has more than one version
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/toolbox_scs/mnemonics_machinery.py
+3
-0
3 additions, 0 deletions
src/toolbox_scs/mnemonics_machinery.py
with
3 additions
and
0 deletions
src/toolbox_scs/mnemonics_machinery.py
+
3
−
0
View file @
ae724d3c
...
@@ -10,6 +10,7 @@ import logging
...
@@ -10,6 +10,7 @@ import logging
from
.constants
import
mnemonics
as
_mnemonics
from
.constants
import
mnemonics
as
_mnemonics
from
extra_data
import
open_run
from
extra_data
import
open_run
from
numpy
import
s_
__all__
=
[
__all__
=
[
'
mnemonics_for_run
'
'
mnemonics_for_run
'
]
]
...
@@ -72,6 +73,8 @@ def mnemo_version_index(run, mnemonic):
...
@@ -72,6 +73,8 @@ def mnemo_version_index(run, mnemonic):
The index of the tuple. If no valid version is found, returns -1.
The index of the tuple. If no valid version is found, returns -1.
"""
"""
if
len
(
_mnemonics
[
mnemonic
])
==
1
:
return
0
for
i
,
v
in
enumerate
(
_mnemonics
[
mnemonic
]):
for
i
,
v
in
enumerate
(
_mnemonics
[
mnemonic
]):
if
(
v
[
'
source
'
]
in
run
.
all_sources
and
if
(
v
[
'
source
'
]
in
run
.
all_sources
and
v
[
'
key
'
]
in
run
.
keys_for_source
(
v
[
'
source
'
])):
v
[
'
key
'
]
in
run
.
keys_for_source
(
v
[
'
source
'
])):
...
...
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