@call_parse
def main(m:Param('turn parallel processing ON', action='store_true'),
'turn verbose OFF', action='store_false'),
v:Param('turn test mode ON', action='store_true'),
t:Param('force conversion', action='store_true'),
f:Param(str=None, # Test Campaign in YYYYMM format
tc:int=None, # run number where to start, default [None], = stop if no end is provided
s:int=None, # run number where to stop, default [None]
e:str=None, # batch number, default [None]
b:
):
# from argparse import ArgumentParser
# parser = ArgumentParser()
# parser.add_argument('-m', action='store_true', help='turn parallel processing ON')
# parser.add_argument('-tc', nargs='?', default=None)
# parser.add_argument('s', nargs='?', default=None, help='run number where to start, default [None], = stop if no end is provided', type=int)
# parser.add_argument('e', nargs='?', default=None, help='run number where to stop, default [None]', type=int)
# parser.add_argument('-b', nargs='?', default=None, help='batch number, default [None]')
# parser.add_argument('-v', action='store_false', help='turn verbose OFF')
# parser.add_argument('-t', action='store_true', help='turn test mode ON')
# parser.add_argument('-f', action='store_true', help='force conversion')
# args = parser.parse_args()
= AutoConvert(s, e, b, tc, v, f) if s is not None else BatchConvert(b, tc, v, f)
z = z.Converter
a = z.Converters if hasattr(z, 'Converters') else None
cs
if not t:
= z.converters
cs if len(cs):
f'Start converting runs {cs[0].Run} - {cs[-1].Run}', color=GREEN)
print_banner(
z.run()'Finished Conversion!', color=GREEN)
print_banner(else:
'There is nothing to convert :-)\n', blank_lines=1) info(
Convert
Script to automatically convert several files (created on October 19th 2022 by M. Reichmann (remichae@phys.ethz.ch))
AutoConvert
AutoConvert (first_run=None, last_run=None, batch=None, beamtest=None, verbose=False, force=False)
Initialize self. See help(type(self)) for accurate signature.
BatchConvert
BatchConvert (batch=None, beamtest=None, verbose=False, force=False)
Initialize self. See help(type(self)) for accurate signature.