Skip to content
Snippets Groups Projects
Commit ae724d3c authored by Laurent Mercadier's avatar Laurent Mercadier
Browse files

Only check keys if menmonic has more than one version

parent a8f47d21
No related branches found
No related tags found
1 merge request!159Only check keys if menmonic has more than one version
...@@ -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'])):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment