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

Modified mnemonics_for_run() to take proposalNB and runNB as inputs

parent 569b56ad
No related branches found
No related tags found
1 merge request!142Newton
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import logging import logging
from .constants import mnemonics as _mnemonics from .constants import mnemonics as _mnemonics
from extra_data import open_run
__all__ = [ __all__ = [
'mnemonics_for_run' 'mnemonics_for_run'
] ]
...@@ -17,15 +17,20 @@ __all__ = [ ...@@ -17,15 +17,20 @@ __all__ = [
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
def mnemonics_for_run(run): def mnemonics_for_run(prop_or_run, runNB=None):
""" """
Returns the availble ToolBox mnemonics for a give extra_data Returns the availble ToolBox mnemonics for a give extra_data
DataCollection DataCollection, or a given proposal + run number.
Parameters Parameters
---------- ----------
run: extra_data DataCollection prop_or_run: extra_data DataCollection or int
The run to check for mnemonics The run (DataCollection) to check for mnemonics.
Alternatively, the proposal number (int), for which the runNB
is also required.
runNB: int
The run number. Only used if the first argument is the proposal
number.
Returns Returns
------- -------
...@@ -35,9 +40,11 @@ def mnemonics_for_run(run): ...@@ -35,9 +40,11 @@ def mnemonics_for_run(run):
Example Example
------- -------
>>> import toolbox_scs as tb >>> import toolbox_scs as tb
>>> run, _ = tb.load(2212, 213) >>> tb.mnemonics_for_run(2212, 213)
>>> tb.mnemonics_for_run(run)
""" """
run = prop_or_run
if runNB is not None:
run = open_run(prop_or_run, runNB)
result = {} result = {}
for m in _mnemonics: for m in _mnemonics:
version = mnemo_version_index(run, m) version = mnemo_version_index(run, m)
......
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