reprox package
Submodules
reprox.core module
Shared common methods for reprocessing, not useful in itself
- reprox.core.check_user_is_admin(admin_group='xenon1t-admins')[source]
Check that the user is an xenon1t-admin
reprox.find_runs module
- reprox.find_runs.determine_data_to_reprocess(st: strax.context.Context, targets: Union[str, tuple, list] = (), special_modes: Union[List[str], Tuple[str]] = ('LED', 'noise', 'pmtap', 'pmtgain', 'exttrig'), keep_detectors: Union[str, tuple, list] = ('tpc',), exclude_from_invalid_cmt: Optional[str] = 'global_v7', _max_workers: int = 50, ignore_runs=()) pandas.core.frame.DataFrame [source]
- Find data that we can process. This data needs to:
(optional) be within the validity of a specified CMT version. Disable with exclude_from_invalid_cmt=False
Don’t be some calibration mode (led/noise etc. data)
Not be available already (why would you want to reprocess that?)
Have the data which we need in order to compute this target.
- Parameters
st – Context to run with
targets – Data types to produce
special_modes – list of modes to exclude to determine here (usually you can do this trivially, so no need to use this function)
exclude_from_invalid_cmt – A CMT version whereof we will check that the CMT version extends to those ranges where we would like to reprocess.
_max_workers – Max workers for finding the stored data
- Returns
- reprox.find_runs.find_data(targets: Union[str, list, tuple], exclude_from_invalid_cmt_version: Union[bool, str] = 'global_v7', context_kwargs: Union[None, dict] = None, keep_detectors: Union[str, tuple, list] = ['tpc'], ignore_runs=()) None [source]
Determine which data to process, see determine_data_to_reprocess :param targets: List of targets to process :param exclude_from_invalid_cmt_version: A CMT version (optional) to
exclude runs that lie outside it’s validity from
- Parameters
context_kwargs – Any context kwargs
- Returns
reprox.process_job module
- class reprox.process_job.ProcessingJob(run_id, targets, submit_kwargs)[source]
Bases:
object
Class for starting jobs and keeping an eye on their status
- get_run_job_state(read_last=10, ignore_patterns=['tensorflow', 'UserWarning', 'module compiled against']) str [source]
Get the state of the current job
- submit_message = None
reprox.submit_jobs module
- reprox.submit_jobs.submit_jobs(submit_kwargs: Union[None, dict] = None, targets: Union[str, List[str], Tuple[str]] = ('event_info', 'event_pattern_fit'), break_if_n_jobs_left_running: Union[None, int] = None, clear_logs: bool = False, sleep_s_when_queue_full: int = 60, submit_only: Union[None, int] = None, known_partitions: Union[tuple, list] = ['dali', 'xenon1t']) List[reprox.process_job.ProcessingJob] [source]
Submit jobs to the queue for the given options
- Parameters
submit_kwargs – dict of options that are passed on to the job submission
targets – List of datatypes to produce
break_if_n_jobs_left_running – threshold when to stop reporting the status
clear_logs – If true, clear the logs from previous jobs
sleep_s_when_queue_full – sleep this many seconds if the
submit_only – maximum number of jobs to submit
known_partitions – list of partitions this user can submit to
- Returns
a list of all the jobs that were submitted
reprox.validate_run module
Validate that the data can be loaded successfully and move the data to the production folder
- class reprox.validate_run.RunValidation(path: str, context: Optional[strax.context.Context] = None, mode: Union[int, reprox.validate_run.ValidationLevel] = ValidationLevel.SHALLOW)[source]
Bases:
object
Check that a directory (corresponding to a single datatype is
- class reprox.validate_run.ValidationLevel(value)[source]
Bases:
enum.IntEnum
An enumeration.
- DEEP = 1
- SHALLOW = 0
- reprox.validate_run.move_all(source_folder: str = '/home/docs/checkouts/readthedocs.org/user_builds/reprox/checkouts/latest/test_folder/strax_data', destination_folder: str = '/home/docs/checkouts/readthedocs.org/user_builds/reprox/checkouts/latest/test_folder', **move_kwargs)[source]
Move data from all folders in <source_folder> into the destination folder and change the ownership of the folder
- Parameters
source_folder – The main folder where to look for folders to move
destination_folder – The folder where the <path> folder should be moved to
move_kwargs –
Takes the following kwargs: :group: Name of the group that the permissions should be set to :validation_level: the level at which to validate the data:
ValidationLevel.SHALLOW: <0> for basic validation
- ValidationLevel.DEEP: <1> where we actually try loading the
data with (requires a context)
- context
for when the validation_level is set to ValidationLevel.DEEP
- Returns
None
- reprox.validate_run.move_folder(path: str, destination_folder: str = '/home/docs/checkouts/readthedocs.org/user_builds/reprox/checkouts/latest/test_folder', group='xenon1t-admins', validation_level: int = ValidationLevel.SHALLOW, context: Optional[strax.context.Context] = None) Optional[str] [source]
Move data from path into the destination folder and change the ownership of the folder
- Parameters
path – The folder to move
destination_folder – The folder where the <path> folder should be moved to
group – Name of the group that the permissions should be set to
validation_level –
the level at which to validate the data: - ValidationLevel.SHALLOW: <0> for basic validation - ValidationLevel.DEEP: <1> where we actually try loading the
data with (requires a context)
context – for when the validation_level is set to ValidationLevel.DEEP
- Returns
error string if an error occurred
- Raises
FileExistsError – when there is already a folder at the destination path