lstosa 0.10.15__tar.gz → 0.10.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. {lstosa-0.10.15 → lstosa-0.10.16}/PKG-INFO +1 -1
  2. {lstosa-0.10.15 → lstosa-0.10.16}/src/lstosa.egg-info/PKG-INFO +1 -1
  3. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/_version.py +2 -2
  4. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/gain_selection.py +9 -2
  5. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/sequencer.py +25 -1
  6. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/workflow/stages.py +13 -6
  7. {lstosa-0.10.15 → lstosa-0.10.16}/.coveragerc +0 -0
  8. {lstosa-0.10.15 → lstosa-0.10.16}/.gitignore +0 -0
  9. {lstosa-0.10.15 → lstosa-0.10.16}/.mailmap +0 -0
  10. {lstosa-0.10.15 → lstosa-0.10.16}/.pre-commit-config.yaml +0 -0
  11. {lstosa-0.10.15 → lstosa-0.10.16}/.readthedocs.yml +0 -0
  12. {lstosa-0.10.15 → lstosa-0.10.16}/LICENSE +0 -0
  13. {lstosa-0.10.15 → lstosa-0.10.16}/MANIFEST.in +0 -0
  14. {lstosa-0.10.15 → lstosa-0.10.16}/README.md +0 -0
  15. {lstosa-0.10.15 → lstosa-0.10.16}/codemeta.json +0 -0
  16. {lstosa-0.10.15 → lstosa-0.10.16}/crontab/crontab.txt +0 -0
  17. {lstosa-0.10.15 → lstosa-0.10.16}/dev/mysql.py +0 -0
  18. {lstosa-0.10.15 → lstosa-0.10.16}/docs/Makefile +0 -0
  19. {lstosa-0.10.15 → lstosa-0.10.16}/docs/_static/logo_lstosa.png +0 -0
  20. {lstosa-0.10.15 → lstosa-0.10.16}/docs/authors.rst +0 -0
  21. {lstosa-0.10.15 → lstosa-0.10.16}/docs/components/index.rst +0 -0
  22. {lstosa-0.10.15 → lstosa-0.10.16}/docs/conf.py +0 -0
  23. {lstosa-0.10.15 → lstosa-0.10.16}/docs/configuration.rst +0 -0
  24. {lstosa-0.10.15 → lstosa-0.10.16}/docs/contribute.rst +0 -0
  25. {lstosa-0.10.15 → lstosa-0.10.16}/docs/documents/index.rst +0 -0
  26. {lstosa-0.10.15 → lstosa-0.10.16}/docs/howto/index.rst +0 -0
  27. {lstosa-0.10.15 → lstosa-0.10.16}/docs/index.rst +0 -0
  28. {lstosa-0.10.15 → lstosa-0.10.16}/docs/introduction/index.rst +0 -0
  29. {lstosa-0.10.15 → lstosa-0.10.16}/docs/introduction/reduction_steps_lstchain.png +0 -0
  30. {lstosa-0.10.15 → lstosa-0.10.16}/docs/jobs.rst +0 -0
  31. {lstosa-0.10.15 → lstosa-0.10.16}/docs/make.bat +0 -0
  32. {lstosa-0.10.15 → lstosa-0.10.16}/docs/nightsummary.rst +0 -0
  33. {lstosa-0.10.15 → lstosa-0.10.16}/docs/provenance.rst +0 -0
  34. {lstosa-0.10.15 → lstosa-0.10.16}/docs/references.rst +0 -0
  35. {lstosa-0.10.15 → lstosa-0.10.16}/docs/reports.rst +0 -0
  36. {lstosa-0.10.15 → lstosa-0.10.16}/docs/scripts/index.rst +0 -0
  37. {lstosa-0.10.15 → lstosa-0.10.16}/docs/troubleshooting/index.rst +0 -0
  38. {lstosa-0.10.15 → lstosa-0.10.16}/docs/utils.rst +0 -0
  39. {lstosa-0.10.15 → lstosa-0.10.16}/docs/veto.rst +0 -0
  40. {lstosa-0.10.15 → lstosa-0.10.16}/docs/workflow/LSTOSA_flow.png +0 -0
  41. {lstosa-0.10.15 → lstosa-0.10.16}/docs/workflow/index.rst +0 -0
  42. {lstosa-0.10.15 → lstosa-0.10.16}/environment.yml +0 -0
  43. {lstosa-0.10.15 → lstosa-0.10.16}/extra/example_sequencer.txt +0 -0
  44. {lstosa-0.10.15 → lstosa-0.10.16}/extra/history_files/sequence_LST1_04183.history +0 -0
  45. {lstosa-0.10.15 → lstosa-0.10.16}/extra/history_files/sequence_LST1_04183_failed.history +0 -0
  46. {lstosa-0.10.15 → lstosa-0.10.16}/extra/history_files/sequence_LST1_04183_oneline.history +0 -0
  47. {lstosa-0.10.15 → lstosa-0.10.16}/extra/history_files/sequence_LST1_04185.0010.history +0 -0
  48. {lstosa-0.10.15 → lstosa-0.10.16}/extra/sacct_output.csv +0 -0
  49. {lstosa-0.10.15 → lstosa-0.10.16}/extra/squeue_output.csv +0 -0
  50. {lstosa-0.10.15 → lstosa-0.10.16}/pyproject.toml +0 -0
  51. {lstosa-0.10.15 → lstosa-0.10.16}/setup.cfg +0 -0
  52. {lstosa-0.10.15 → lstosa-0.10.16}/src/lstosa.egg-info/SOURCES.txt +0 -0
  53. {lstosa-0.10.15 → lstosa-0.10.16}/src/lstosa.egg-info/dependency_links.txt +0 -0
  54. {lstosa-0.10.15 → lstosa-0.10.16}/src/lstosa.egg-info/entry_points.txt +0 -0
  55. {lstosa-0.10.15 → lstosa-0.10.16}/src/lstosa.egg-info/requires.txt +0 -0
  56. {lstosa-0.10.15 → lstosa-0.10.16}/src/lstosa.egg-info/top_level.txt +0 -0
  57. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/__init__.py +0 -0
  58. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/configs/__init__.py +0 -0
  59. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/configs/config.py +0 -0
  60. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/configs/datamodel.py +0 -0
  61. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/configs/options.py +0 -0
  62. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/configs/sequencer.cfg +0 -0
  63. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/conftest.py +0 -0
  64. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/high_level/__init__.py +0 -0
  65. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/high_level/selection_cuts.toml +0 -0
  66. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/high_level/significance.py +0 -0
  67. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/high_level/tests/test_significance.py +0 -0
  68. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/job.py +0 -0
  69. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/nightsummary/__init__.py +0 -0
  70. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/nightsummary/database.py +0 -0
  71. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/nightsummary/extract.py +0 -0
  72. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/nightsummary/nightsummary.py +0 -0
  73. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/nightsummary/set_source_coordinates.py +0 -0
  74. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/nightsummary/tests/test_database.py +0 -0
  75. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/nightsummary/tests/test_extract.py +0 -0
  76. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/nightsummary/tests/test_nightsummary.py +0 -0
  77. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/nightsummary/tests/test_source_coordinates.py +0 -0
  78. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/osadb.py +0 -0
  79. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/paths.py +0 -0
  80. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/provenance/__init__.py +0 -0
  81. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/provenance/capture.py +0 -0
  82. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/provenance/config/definition.yaml +0 -0
  83. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/provenance/config/environment.yaml +0 -0
  84. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/provenance/config/logger.yaml +0 -0
  85. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/provenance/io.py +0 -0
  86. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/provenance/utils.py +0 -0
  87. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/raw.py +0 -0
  88. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/report.py +0 -0
  89. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/__init__.py +0 -0
  90. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/autocloser.py +0 -0
  91. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/calibration_pipeline.py +0 -0
  92. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/closer.py +0 -0
  93. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/copy_datacheck.py +0 -0
  94. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/datasequence.py +0 -0
  95. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/gainsel_webmaker.py +0 -0
  96. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/provprocess.py +0 -0
  97. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/reprocess_longterm.py +0 -0
  98. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/reprocessing.py +0 -0
  99. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/sequencer_webmaker.py +0 -0
  100. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/show_run_summary.py +0 -0
  101. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/simulate_processing.py +0 -0
  102. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/tests/__init__.py +0 -0
  103. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/tests/test_osa_scripts.py +0 -0
  104. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/scripts/update_source_catalog.py +0 -0
  105. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/tests/__init__.py +0 -0
  106. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/tests/test_jobs.py +0 -0
  107. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/tests/test_osa.py +0 -0
  108. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/tests/test_osadb.py +0 -0
  109. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/tests/test_paths.py +0 -0
  110. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/tests/test_raw.py +0 -0
  111. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/tests/test_report.py +0 -0
  112. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/tests/test_veto.py +0 -0
  113. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/utils/__init__.py +0 -0
  114. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/utils/cliopts.py +0 -0
  115. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/utils/iofile.py +0 -0
  116. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/utils/logging.py +0 -0
  117. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/utils/mail.py +0 -0
  118. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/utils/register.py +0 -0
  119. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/utils/tests/test_iofile.py +0 -0
  120. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/utils/tests/test_utils.py +0 -0
  121. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/utils/utils.py +0 -0
  122. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/version.py +0 -0
  123. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/veto.py +0 -0
  124. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/webserver/__init__.py +0 -0
  125. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/webserver/utils.py +0 -0
  126. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/workflow/__init__.py +0 -0
  127. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/workflow/dl3.py +0 -0
  128. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/workflow/tests/test_dl3.py +0 -0
  129. {lstosa-0.10.15 → lstosa-0.10.16}/src/osa/workflow/tests/test_stages.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lstosa
3
- Version: 0.10.15
3
+ Version: 0.10.16
4
4
  Summary: Onsite analysis pipeline for the CTA LST-1
5
5
  Author: María Láinez, José Enrique Ruiz, Lab Saha, Andrés Baquero, José Luis Contreras, Maximilian Linhoff
6
6
  Author-email: Daniel Morcuende <dmorcuen@ucm.es>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lstosa
3
- Version: 0.10.15
3
+ Version: 0.10.16
4
4
  Summary: Onsite analysis pipeline for the CTA LST-1
5
5
  Author: María Láinez, José Enrique Ruiz, Lab Saha, Andrés Baquero, José Luis Contreras, Maximilian Linhoff
6
6
  Author-email: Daniel Morcuende <dmorcuen@ucm.es>
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.10.15'
16
- __version_tuple__ = version_tuple = (0, 10, 15)
15
+ __version__ = version = '0.10.16'
16
+ __version_tuple__ = version_tuple = (0, 10, 16)
@@ -380,13 +380,20 @@ def GainSel_finished(date: datetime) -> bool:
380
380
  """Check if gain selection finished successfully."""
381
381
  flagfile = GainSel_flag_file(date)
382
382
  return flagfile.exists()
383
-
383
+
384
384
 
385
385
  def check_gainsel_jobs_runwise(date: datetime, run_id: int) -> bool:
386
386
  """Search for failed jobs in the log directory."""
387
387
  base_dir = Path(cfg.get("LST1", "BASE"))
388
388
  log_dir = base_dir / f"R0G/log/{date_to_dir(date)}"
389
- history_files = log_dir.glob(f"gain_selection_{run_id:05d}.????.history")
389
+ history_files = list(log_dir.glob(f"gain_selection_{run_id:05d}.????.history"))
390
+ summary_table = run_summary_table(date)
391
+ n_subruns = summary_table[summary_table["run_id"] == run_id]["n_subruns"]
392
+
393
+ if len(history_files) != n_subruns:
394
+ log.debug(f"All history files of run {run_id} were not created yet")
395
+ return False
396
+
390
397
  failed_subruns = []
391
398
  log.info(f"Checking all history files of run {run_id}")
392
399
 
@@ -119,6 +119,11 @@ def single_process(telescope):
119
119
  log.info(f"Sequencer already finished for date {date_to_iso(options.date)}. Exiting")
120
120
  sys.exit(0)
121
121
 
122
+ elif timeout_in_sequencer(options.date) and not options.force_submit:
123
+ log.info(f"Some jobs of sequencer finished in TIMEOUT for date {date_to_iso(options.date)}."
124
+ " Please relaunch the affected sequences manually.")
125
+ sys.exit(0)
126
+
122
127
  # Build the sequences
123
128
  sequence_list = build_sequences(options.date)
124
129
 
@@ -332,7 +337,7 @@ def is_sequencer_running(date: datetime.datetime) -> bool:
332
337
 
333
338
 
334
339
  def is_sequencer_completed(date: datetime.datetime) -> bool:
335
- """Check if the jobs launched by sequencer are running or pending for the given date."""
340
+ """Check if the jobs launched by sequencer are already completed."""
336
341
  summary_table = run_summary_table(date)
337
342
  data_runs = summary_table[summary_table["run_type"] == "DATA"]
338
343
  sacct_output = run_sacct()
@@ -350,5 +355,24 @@ def is_sequencer_completed(date: datetime.datetime) -> bool:
350
355
  return True
351
356
 
352
357
 
358
+ def timeout_in_sequencer(date: datetime.datetime) -> bool:
359
+ """Check if any of the jobs launched by sequencer finished in timeout."""
360
+ summary_table = run_summary_table(date)
361
+ data_runs = summary_table[summary_table["run_type"] == "DATA"]
362
+ sacct_output = run_sacct()
363
+ sacct_info = get_sacct_output(sacct_output)
364
+
365
+ for run in data_runs["run_id"]:
366
+ jobs_run = sacct_info[sacct_info["JobName"]==f"LST1_{run:05d}"]
367
+ if len(jobs_run["JobID"].unique())>1:
368
+ last_job_id = sorted(jobs_run["JobID"].unique())[-1]
369
+ jobs_run = sacct_info[sacct_info["JobID"]==last_job_id]
370
+ timeout_jobs = jobs_run[(jobs_run["State"] == "TIMEOUT")]
371
+ if len(timeout_jobs) != 0:
372
+ return True
373
+
374
+ return False
375
+
376
+
353
377
  if __name__ == "__main__":
354
378
  main()
@@ -75,15 +75,15 @@ class AnalysisStage:
75
75
  reproduced in subsequent trials.
76
76
  """
77
77
 
78
- if self.command == "lstchain_data_r0_to_dl1":
78
+ if self.command == cfg.get("lstchain", "r0_to_dl1"):
79
79
  self._remove_dl1a_output()
80
- elif self.command == "lstchain_dl1ab":
80
+ elif self.command == cfg.get("lstchain", "dl1ab"):
81
81
  self._remove_dl1b_output('dl1_LST-1.Run')
82
- elif self.command == "lstchain_check_dl1":
82
+ elif self.command == cfg.get("lstchain", "check_dl1"):
83
83
  self._remove_dl1b_output('datacheck_dl1_LST-1.Run')
84
- elif self.command == "onsite_create_calibration_file":
84
+ elif self.command == cfg.get("lstchain", "charge_calibration"):
85
85
  self._remove_calibration()
86
- elif self.command == "onsite_create_drs4_pedestal_file":
86
+ elif self.command == cfg.get("lstchain", "drs4_baseline"):
87
87
  self._remove_drs4_baseline()
88
88
 
89
89
  def _remove_drs4_baseline(self):
@@ -121,9 +121,16 @@ class AnalysisStage:
121
121
 
122
122
  def _write_checkpoint(self):
123
123
  """Write the checkpoint in the history file."""
124
+ command_to_prod_id = {
125
+ cfg.get("lstchain", "r0_to_dl1"): options.prod_id,
126
+ cfg.get("lstchain", "dl1ab"): options.dl1_prod_id,
127
+ cfg.get("lstchain", "check_dl1"): options.dl1_prod_id,
128
+ cfg.get("lstchain", "dl1_to_dl2"): options.dl2_prod_id
129
+ }
130
+ prod_id = command_to_prod_id.get(self.command)
124
131
  history(
125
132
  run=self.run,
126
- prod_id=options.prod_id,
133
+ prod_id=prod_id,
127
134
  stage=self.command,
128
135
  return_code=self.rc,
129
136
  history_file=self.history_file,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes