lstosa 0.11.4__py3-none-any.whl → 0.11.5__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lstosa
3
- Version: 0.11.4
3
+ Version: 0.11.5
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,5 +1,5 @@
1
1
  osa/__init__.py,sha256=crotf1NMTfNdZuCua_5T_jk3kvZrAAwVw4FPrfxv994,193
2
- osa/_version.py,sha256=CM88WwpDGbWDl4mS-7JC0G71hVYzQYpuyk0Gyep3nBg,706
2
+ osa/_version.py,sha256=ZyFxcHP5D9gYt6tCf5RRnkEsC8isbt9wg2nFTag5BOE,706
3
3
  osa/conftest.py,sha256=AdSHdWqjeMTgIeZEF8fdw6eSliySouivMWCPIqUV2os,24667
4
4
  osa/job.py,sha256=CunwW7xA4mWEocS6KkDZ1K6h_LYh_ePZMyGHyCa6CKg,27863
5
5
  osa/osadb.py,sha256=pkCuYbEG-moHG0uQHxwB7giQAv2XTld4HJ5gdn1F1hA,2422
@@ -44,14 +44,14 @@ osa/scripts/gainsel_webmaker.py,sha256=40_DX7RUmImX-31iqRTFPEUvdVXXPSKp0xMEJWuAu
44
44
  osa/scripts/provprocess.py,sha256=Zv8sHTOgGNuEzu1QPUF142VQbHyfOsrxO073-xA6KG8,19107
45
45
  osa/scripts/reprocess_longterm.py,sha256=wMfc3UVwickkGFiviIhOlB9ebMIqQPWoUrgg8hQ78Lg,2138
46
46
  osa/scripts/reprocessing.py,sha256=IL30e2McFA0EGbzvkTXdzmKJGBTbafYlCA-PsafyzyY,4571
47
- osa/scripts/sequencer.py,sha256=TpxQPY4K_CpIpvfqSdpgf8737utCeMZw0ozrslmDlmo,12162
47
+ osa/scripts/sequencer.py,sha256=hqkTXuYKvHHD6-s_wbzBulb2qpMF-pTLif0UOcIXu70,13150
48
48
  osa/scripts/sequencer_catB_tailcuts.py,sha256=zVBuCBiiIoO3HKHbJ0zqaDtuwxkxcziR4T5i-2WyDX8,10476
49
- osa/scripts/sequencer_webmaker.py,sha256=a9okC-l9UMJHELTLLM2Q933-JELFOhXEbbH1Kbp1E8g,4936
49
+ osa/scripts/sequencer_webmaker.py,sha256=NpH5MrX2pgbVdi1ntp2xX5Yka7Gwp5PuoykkH5-UQq4,4936
50
50
  osa/scripts/show_run_summary.py,sha256=ofznLdoFHKQB-TELD6g5zMqD_TE9M9BuJR12zHvNdXE,2518
51
51
  osa/scripts/simulate_processing.py,sha256=D3b0kjyUS6Lm7pkQNJ-tJzQMveTwoPabfBBW80RMqN0,6828
52
52
  osa/scripts/update_source_catalog.py,sha256=Po4KSBOQCAT2Do1DUu5wnKV48Dq_pONfvtD47hh8fYI,8277
53
53
  osa/scripts/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
- osa/scripts/tests/test_osa_scripts.py,sha256=gyijYBzLQ19J1Az1mOdLm9bMxMwCkZryd78SfxCNtwg,15088
54
+ osa/scripts/tests/test_osa_scripts.py,sha256=HaKVW-E2Gs6vvJoozIeCAg8-sxyu9k5zwNLFDPpCVrs,15116
55
55
  osa/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
56
  osa/tests/test_jobs.py,sha256=ozrMBjHujDhEMzEvJE7WynChqjbBTcORHsHmFXozeWk,16112
57
57
  osa/tests/test_osa.py,sha256=QCOsjUgPuNMHoef3Ym2sDXVjun2LaBrfKyroAIH-os8,415
@@ -76,9 +76,9 @@ osa/workflow/dl3.py,sha256=ZMXPrdJA0WOxDiHEW9sdM2vmYix8R3eSMTGc6o42yxg,9860
76
76
  osa/workflow/stages.py,sha256=ILg91VyNXcy--si7CpDa1UFRiugqIH6nKl10Ru2zZVc,7422
77
77
  osa/workflow/tests/test_dl3.py,sha256=81Vt4lNxNjdKi_ehzymqfFWFjncw7GuQcix9S0Yigaw,384
78
78
  osa/workflow/tests/test_stages.py,sha256=aslfOIjf-rvf3r9N7NtimaOKkVB6K1M3bidgHOzRkMs,3985
79
- lstosa-0.11.4.dist-info/LICENSE,sha256=h6iWot11EtMvaDaS_AvCHKLTNByO5wEbMyNj1c90y1c,1519
80
- lstosa-0.11.4.dist-info/METADATA,sha256=-Xpxb7cFIvr3dqwB0rWr1Ocbeqjcpjnc5tgr5jtvOqA,7302
81
- lstosa-0.11.4.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
82
- lstosa-0.11.4.dist-info/entry_points.txt,sha256=CzDKpLjZZQm8jJBxOVpMR8Czpgg_Yh-k6IPETp30VZE,1048
83
- lstosa-0.11.4.dist-info/top_level.txt,sha256=_Tj8zVHdrOoWZuuWTHbDpNofxW0imUmKdlXhnxsXJek,4
84
- lstosa-0.11.4.dist-info/RECORD,,
79
+ lstosa-0.11.5.dist-info/LICENSE,sha256=h6iWot11EtMvaDaS_AvCHKLTNByO5wEbMyNj1c90y1c,1519
80
+ lstosa-0.11.5.dist-info/METADATA,sha256=w662afh4R8FFG9Ln0iYtMWvvE8pCYXYcVj1rDezy_dA,7302
81
+ lstosa-0.11.5.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
82
+ lstosa-0.11.5.dist-info/entry_points.txt,sha256=CzDKpLjZZQm8jJBxOVpMR8Czpgg_Yh-k6IPETp30VZE,1048
83
+ lstosa-0.11.5.dist-info/top_level.txt,sha256=_Tj8zVHdrOoWZuuWTHbDpNofxW0imUmKdlXhnxsXJek,4
84
+ lstosa-0.11.5.dist-info/RECORD,,
osa/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.11.4'
32
- __version_tuple__ = version_tuple = (0, 11, 4)
31
+ __version__ = version = '0.11.5'
32
+ __version_tuple__ = version_tuple = (0, 11, 5)
33
33
 
34
34
  __commit_id__ = commit_id = None
osa/scripts/sequencer.py CHANGED
@@ -11,7 +11,7 @@ import os
11
11
  import sys
12
12
  from decimal import Decimal
13
13
  import datetime
14
-
14
+ import re
15
15
  from osa import osadb
16
16
  from osa.configs import options
17
17
  from osa.configs.config import cfg
@@ -50,6 +50,7 @@ __all__ = [
50
50
  "update_sequence_status",
51
51
  "get_status_for_sequence",
52
52
  "output_matrix",
53
+ "check_catB_status",
53
54
  "report_sequences",
54
55
  "update_job_info",
55
56
  ]
@@ -205,6 +206,34 @@ def update_sequence_status(seq_list):
205
206
  )
206
207
  seq.muonstatus = int(Decimal(get_status_for_sequence(seq, "MUON") * 100) / seq.subruns)
207
208
  seq.dl2status = int(Decimal(get_status_for_sequence(seq, "DL2") * 100))
209
+ seq.catbstatus = check_catB_status(seq)
210
+
211
+
212
+ def check_catB_status(seq):
213
+ catbstatus = "None"
214
+
215
+ if seq.type == "DATA":
216
+ directory = options.directory
217
+
218
+ closed_files = list(directory.glob(f"catB*{seq.run}*.closed"))
219
+ if closed_files:
220
+ catbstatus = "CLOSED"
221
+ else:
222
+ log_files = list(options.log_directory.glob(f"catB_calibration_{seq.run}_*.err"))
223
+ if log_files:
224
+ filename = sorted(log_files)[-1].name
225
+ match = re.search(f"catB_calibration_{seq.run}_(\d+).err", filename)
226
+ if match:
227
+ job_id = match.group(1)
228
+
229
+ sacct_output = run_sacct(job_id)
230
+ sacct_info = get_sacct_output(sacct_output)
231
+
232
+ if not sacct_info.empty:
233
+ catbstatus = sacct_info.iloc[0]["State"]
234
+
235
+ return catbstatus
236
+
208
237
 
209
238
 
210
239
  def get_status_for_sequence(sequence, data_level) -> int:
@@ -278,7 +307,7 @@ def report_sequences(sequence_list):
278
307
  "Exit",
279
308
  ]
280
309
  if options.tel_id in ["LST1", "LST2"]:
281
- header.extend(("DL1%", "MUONS%", "DL1AB%", "DATACHECK%", "DL2%"))
310
+ header.extend(("DL1%", "MUONS%", "CAT-B","DL1AB%", "DATACHECK%", "DL2%"))
282
311
  matrix = [header]
283
312
  for sequence in sequence_list:
284
313
  row_list = [
@@ -297,12 +326,13 @@ def report_sequences(sequence_list):
297
326
  sequence.exit,
298
327
  ]
299
328
  if sequence.type in ["DRS4", "PEDCALIB"]:
300
- row_list.extend((None, None, None, None, None))
329
+ row_list.extend((None, None, None, None, None, None))
301
330
  elif sequence.type == "DATA":
302
331
  row_list.extend(
303
332
  (
304
333
  sequence.dl1status,
305
334
  sequence.muonstatus,
335
+ sequence.catbstatus,
306
336
  sequence.dl1abstatus,
307
337
  sequence.datacheckstatus,
308
338
  sequence.dl2status,
@@ -107,7 +107,7 @@ def lines_to_matrix(lines: Iterable) -> list:
107
107
  matrix = []
108
108
  for line in lines:
109
109
  l_fields = line.split()
110
- if len(l_fields) == 18:
110
+ if len(l_fields) == 19:
111
111
  matrix.append(l_fields)
112
112
  return matrix
113
113
 
@@ -163,10 +163,10 @@ def test_simulated_sequencer(
163
163
  assert rc.stdout == dedent(
164
164
  f"""\
165
165
  =================================== Starting sequencer.py at {now} UTC for LST, Telescope: LST1, Date: 2020-01-17 ===================================
166
- Tel Seq Parent Type Run Subruns Source Action Tries JobID State CPU_time Exit DL1% MUONS% DL1AB% DATACHECK% DL2%
167
- LST1 1 None PEDCALIB 1809 5 None None None None None None None None None None None None
168
- LST1 2 1 DATA 1807 11 Crab None None None None None None 0 0 0 0 100
169
- LST1 3 1 DATA 1808 9 MadeUpSource None None None None None None 0 0 0 0 100
166
+ Tel Seq Parent Type Run Subruns Source Action Tries JobID State CPU_time Exit DL1% MUONS% CAT-B DL1AB% DATACHECK% DL2%
167
+ LST1 1 None PEDCALIB 1809 5 None None None None None None None None None None None None None
168
+ LST1 2 1 DATA 1807 11 Crab None None None None None None 0 0 None 0 0 100
169
+ LST1 3 1 DATA 1808 9 MadeUpSource None None None None None None 0 0 None 0 0 100
170
170
  """ # noqa: E501
171
171
  )
172
172