parameters: (self)
docstring: Validate command line arguments.
docstring_summary: Validate command line arguments.
docstring_tokens: Validate command line arguments .
function: def _validate_input(self):
          """Validate command line arguments."""
  
          if self._args.events is None:
              if self._args.all_events:
                  self._args.events = float("inf")
                  print_msg("Using all tracks for alignment")
              elif (self._args.tracks is None) and (self._args.rate is None):
                  msg = ("either -n/--events-for-alignment, --all-events, or both of "
                         "--tracks-for-alignment and --track-rate are required")
                  self._parser.error(msg)
              elif (((self._args.tracks is not None) and (self._args.rate is None)) or
                  ((self._args.rate is not None)and (self._args.tracks is None))):
                  msg = ("--tracks-for-alignment and --track-rate must be used "
                         "together")
                  self._parser.error(msg)
              else:
                  self._args.events = int(math.ceil(self._args.tracks /
                                                    self._args.rate))
                  print_msg("Requested {0:d} tracks with {1:.2f} tracks/event "
                            "-> {2:d} events for alignment."
                            .format(self._args.tracks, self._args.rate,
                                    self._args.events))
          else:
              if (self._args.tracks is not None) or (self._args.rate is not None) or self._args.all_events:
                  msg = ("-n/--events-for-alignment must not be used with "
                         "--tracks-for-alignment, --track-rate, or --all-events")
                  self._parser.error(msg)
              print_msg("Requested {0:d} events for alignment."
                        .format(self._args.events))
  
          for dataset in self._args.datasets:
              if not re.match(self._dataset_regex, dataset):
                  print_msg("Dataset pattern '"+dataset+"' is not in CMS format.")
                  sys.exit(1)
  
          nonzero_events_per_iov = (self._args.minimum_events_in_iov > 0)
          if nonzero_events_per_iov and self._args.fraction <= 0:
              print_msg("Setting minimum number of events per IOV for alignment "
                        "to 0 because a non-positive fraction of alignment events"
                        " is chosen: {}".format(self._args.fraction))
              nonzero_events_per_iov = False
              self._args.minimum_events_in_iov = 0
          if nonzero_events_per_iov and self._args.events <= 0:
              print_msg("Setting minimum number of events per IOV for alignment "
                        "to 0 because a non-positive number of alignment events"
                        " is chosen: {}".format(self._args.events))
              nonzero_events_per_iov = False
              self._args.minimum_events_in_iov = 0
function_tokens: def _validate_input ( self ) : if self . _args . events is None : if self . _args . all_events : self . _args . events = float ( "inf" ) print_msg ( "Using all tracks for alignment" ) elif ( self . _args . tracks is None ) and ( self . _args . rate is None ) : msg = ( "either -n/--events-for-alignment, --all-events, or both of " "--tracks-for-alignment and --track-rate are required" ) self . _parser . error ( msg ) elif ( ( ( self . _args . tracks is not None ) and ( self . _args . rate is None ) ) or ( ( self . _args . rate is not None ) and ( self . _args . tracks is None ) ) ) : msg = ( "--tracks-for-alignment and --track-rate must be used " "together" ) self . _parser . error ( msg ) else : self . _args . events = int ( math . ceil ( self . _args . tracks / self . _args . rate ) ) print_msg ( "Requested {0:d} tracks with {1:.2f} tracks/event " "-> {2:d} events for alignment." . format ( self . _args . tracks , self . _args . rate , self . _args . events ) ) else : if ( self . _args . tracks is not None ) or ( self . _args . rate is not None ) or self . _args . all_events : msg = ( "-n/--events-for-alignment must not be used with " "--tracks-for-alignment, --track-rate, or --all-events" ) self . _parser . error ( msg ) print_msg ( "Requested {0:d} events for alignment." . format ( self . _args . events ) ) for dataset in self . _args . datasets : if not re . match ( self . _dataset_regex , dataset ) : print_msg ( "Dataset pattern '" + dataset + "' is not in CMS format." ) sys . exit ( 1 ) nonzero_events_per_iov = ( self . _args . minimum_events_in_iov > 0 ) if nonzero_events_per_iov and self . _args . fraction <= 0 : print_msg ( "Setting minimum number of events per IOV for alignment " "to 0 because a non-positive fraction of alignment events" " is chosen: {}" . format ( self . _args . fraction ) ) nonzero_events_per_iov = False self . _args . minimum_events_in_iov = 0 if nonzero_events_per_iov and self . _args . events <= 0 : print_msg ( "Setting minimum number of events per IOV for alignment " "to 0 because a non-positive number of alignment events" " is chosen: {}" . format ( self . _args . events ) ) nonzero_events_per_iov = False self . _args . minimum_events_in_iov = 0