roc-film 1.13.3__tar.gz → 1.13.5__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. {roc_film-1.13.3 → roc_film-1.13.5}/PKG-INFO +1 -1
  2. {roc_film-1.13.3 → roc_film-1.13.5}/pyproject.toml +1 -1
  3. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/descriptor.json +4 -4
  4. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/dds_to_l0.py +27 -24
  5. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/merge_tmraw.py +2 -2
  6. roc_film-1.13.3/setup.py +0 -49
  7. {roc_film-1.13.3 → roc_film-1.13.5}/LICENSE +0 -0
  8. {roc_film-1.13.3 → roc_film-1.13.5}/README.md +0 -0
  9. {roc_film-1.13.3 → roc_film-1.13.5}/roc/__init__.py +0 -0
  10. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/__init__.py +0 -0
  11. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/commands.py +0 -0
  12. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/config/__init__.py +0 -0
  13. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/constants.py +0 -0
  14. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/exceptions.py +0 -0
  15. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/__init__.py +0 -0
  16. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/cat_solo_hk.py +0 -0
  17. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/cdf_postpro.py +0 -0
  18. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/check_dds.py +0 -0
  19. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/file_handler.py +0 -0
  20. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/l0_to_anc_bia_sweep_table.py +0 -0
  21. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/l0_to_hk.py +0 -0
  22. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/l0_to_l1_bia_current.py +0 -0
  23. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/l0_to_l1_bia_sweep.py +0 -0
  24. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/l0_to_l1_sbm.py +0 -0
  25. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/l0_to_l1_surv.py +0 -0
  26. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/make_daily_tm.py +0 -0
  27. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/merge_tcreport.py +0 -0
  28. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/parse_dds_xml.py +0 -0
  29. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tasks/set_l0_utc.py +0 -0
  30. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/__init__.py +0 -0
  31. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/hdf5_compare.py +0 -0
  32. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/test_dds_to_l0.py +0 -0
  33. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/test_dds_to_tc.py +0 -0
  34. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/test_dds_to_tm.py +0 -0
  35. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/test_film.py +0 -0
  36. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/test_l0_to_hk.py +0 -0
  37. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/test_l0_to_l1_bia.py +0 -0
  38. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/test_l0_to_l1_sbm.py +0 -0
  39. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/test_l0_to_l1_surv.py +0 -0
  40. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/test_metadata.py +0 -0
  41. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tests/tests.py +0 -0
  42. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tools/__init__.py +0 -0
  43. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tools/dataset_tasks.py +0 -0
  44. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tools/file_helpers.py +0 -0
  45. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tools/l0.py +0 -0
  46. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tools/metadata.py +0 -0
  47. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tools/skeleton.py +0 -0
  48. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tools/tools.py +0 -0
  49. {roc_film-1.13.3 → roc_film-1.13.5}/roc/film/tools/xlsx2skt.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: roc-film
3
- Version: 1.13.3
3
+ Version: 1.13.5
4
4
  Summary: RPW FILe Maker (FILM): Plugin to make RPW L0, L1 and HK data files
5
5
  Home-page: https://gitlab.obspm.fr/ROC/Pipelines/Plugins/FILM
6
6
  License: CECILL-C
@@ -10,7 +10,7 @@ exclude = "/(\n \\.git\n | \\.hg\n | \\.mypy_cache\n | \\.tox\n | \\.venv
10
10
 
11
11
  [tool.poetry]
12
12
  name = "roc-film"
13
- version = "1.13.3"
13
+ version = "1.13.5"
14
14
  readme = "README.md"
15
15
  license = "CeCILL-C"
16
16
  repository = "https://gitlab.obspm.fr/ROC/Pipelines/Plugins/FILM"
@@ -6,10 +6,10 @@
6
6
  "description": "RPW FILe Maker (FILM): Plugin to make RPW L0, L1 and HK data files"
7
7
  },
8
8
  "release": {
9
- "version": "1.13.3",
10
- "date": "2023-02-01",
9
+ "version": "1.13.5",
10
+ "date": "2023-09-07",
11
11
  "author": "Xavier Bonnin <xavier.bonnin@obspm.fr>, ROC Team <roc.support@sympa.obspm.fr>",
12
- "modification": "Fix errors in l0_to_l1_sbm processing",
12
+ "modification": "Hotfix https://gitlab.obspm.fr/ROC/Pipelines/Plugins/FILM/-/issues/40",
13
13
  "url": "https://gitlab.obspm.fr/ROC/Pipelines/Plugins/FILM"
14
14
  },
15
15
  "tasks": [
@@ -790,4 +790,4 @@
790
790
  }
791
791
  }
792
792
  ]
793
- }
793
+ }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
- import collections
3
+
4
4
  import os
5
5
  from datetime import datetime
6
6
  import uuid
@@ -188,7 +188,7 @@ class DdsToL0(Task):
188
188
  try:
189
189
  # Initialize task inputs
190
190
  self.setup_inputs()
191
- except:
191
+ except Exception:
192
192
  logger.exception(f'Initializing inputs has failed for task {self.job_id}!')
193
193
  self.pipeline.exit()
194
194
  return
@@ -239,7 +239,6 @@ class DdsToL0(Task):
239
239
 
240
240
  # Initialize some loop variables
241
241
  parent_list = []
242
- packet_count = 0
243
242
 
244
243
  # Start loop over dds XML file
245
244
  for i, dds_file in enumerate(self.dds_file_list):
@@ -247,7 +246,6 @@ class DdsToL0(Task):
247
246
  # (Re)initialize loop variables
248
247
  dds_data = None
249
248
  packet_parser = None
250
- valid_packet_parser = None
251
249
 
252
250
  # Parse input RPW TM/TC DDS format file
253
251
  logger.info(f'Parsing {dds_file}...')
@@ -270,7 +268,7 @@ class DdsToL0(Task):
270
268
  try:
271
269
  logger.info(f'Extracting {dds_packet_num_list[i]} packets from {dds_file}... [{self.job_id}]')
272
270
  packet_parser = self._parse_packet(dds_data)
273
- except:
271
+ except Exception:
274
272
  logger.exception(f'Parsing current packet list has failed! [{self.job_id}]')
275
273
  continue
276
274
 
@@ -290,7 +288,7 @@ class DdsToL0(Task):
290
288
  logger.error(f'{n_invalid} invalid TM/TC packets found in {dds_file}! [{self.job_id}]')
291
289
  try:
292
290
  self.invalid_to_db(invalid_packets)
293
- except:
291
+ except Exception:
294
292
  logger.exception(f'Invalid packets cannot be inserted in the database! [{self.job_id}]')
295
293
  raise L0ProdFailure
296
294
 
@@ -310,7 +308,7 @@ class DdsToL0(Task):
310
308
  logger.exception('L0ProdFailure')
311
309
  self.failed_files.append(l0_file)
312
310
  break
313
- except:
311
+ except Exception:
314
312
  logger.exception(f'Error when parsing {dds_file}! [{self.job_id}]')
315
313
  self.failed_dds_files.append(dds_file)
316
314
  else:
@@ -344,16 +342,13 @@ class DdsToL0(Task):
344
342
 
345
343
  output_list = []
346
344
 
347
- dds_data = xml_to_dict(dds_file)['ns2:ResponsePart']\
348
- ['Response']
345
+ dds_data = xml_to_dict(dds_file)['ns2:ResponsePart']['Response']
349
346
 
350
347
  if 'PktRawResponse' in dds_data:
351
- dds_data = dds_data['PktRawResponse'] \
352
- ['PktRawResponseElement']
348
+ dds_data = dds_data['PktRawResponse']['PktRawResponseElement']
353
349
  dds_type = 'TM'
354
350
  elif 'PktTcReportResponse' in dds_data:
355
- dds_data = dds_data['PktTcReportResponse'] \
356
- ['PktTcReportList']['PktTcReportListElement']
351
+ dds_data = dds_data['PktTcReportResponse']['PktTcReportList']['PktTcReportListElement']
357
352
  dds_type = 'TC'
358
353
  else:
359
354
  logger.warning(f'Invalid input dds file {dds_file}')
@@ -362,7 +357,7 @@ class DdsToL0(Task):
362
357
  # Make sure that returned dds_data is a list
363
358
  # (If only one XML element is found in the file
364
359
  # the xml_to_dict method returns a collections.OrderedDict() instance).
365
- if isinstance(dds_data, collections.OrderedDict):
360
+ if not isinstance(dds_data, list):
366
361
  dds_data = [dds_data]
367
362
 
368
363
  output_list = [self._build_packet_dict(current_packet, dds_type)
@@ -390,28 +385,36 @@ class DdsToL0(Task):
390
385
 
391
386
  file_type = dds_file_type.upper()
392
387
 
388
+ if not isinstance(packet, dict):
389
+ logger.error(f'Problem with packet: {packet}')
390
+ return {}
391
+
393
392
  if file_type == 'TC':
394
393
 
395
394
  # Get packet SRDB id
396
395
  srdb_id = packet.get('CommandName', None)
396
+ if srdb_id is None:
397
+ logger.error('CommandName not defined!')
398
+ return {}
397
399
 
398
400
  # Get corresponding PALISADE ID
399
- if srdb_id:
401
+ try:
400
402
  palisade_id = self.palisade_metadata[srdb_id]['palisade_id']
401
- else:
402
- palisade_id = None
403
+ except Exception:
404
+ logger.error(f'palisade_id not found for {srdb_id}')
405
+ return {}
403
406
 
404
407
  # Get corresponding packet category
405
- if srdb_id:
406
- packet_category = self.palisade_metadata[
407
- srdb_id]['packet_category']
408
- else:
409
- packet_category = None
408
+ try:
409
+ packet_category = self.palisade_metadata[srdb_id]['packet_category']
410
+ except Exception:
411
+ logger.error(f'packet_category not found for {srdb_id}')
412
+ return {}
410
413
 
411
414
  try:
412
415
  utc_time = datetime.strptime(packet.get(
413
416
  'ExecutionTime'), TIME_ISO_STRFORMAT)
414
- except:
417
+ except Exception:
415
418
  utc_time = INVALID_UTC_DATETIME
416
419
 
417
420
  # Get ack execution completion status
@@ -434,7 +437,7 @@ class DdsToL0(Task):
434
437
  if field['FieldName'] == 'uniqueID':
435
438
  unique_id = packet['CustomField'][i]['Value']
436
439
  break
437
- except:
440
+ except Exception:
438
441
  unique_id = 'UNKNOWN'
439
442
 
440
443
  # Only keep "PASSED" and "FAILED" exe status in L0
@@ -292,7 +292,7 @@ class MergeTmRaw(Task):
292
292
  # Make sure that returned output_tmraw_list is a list
293
293
  # (If only one Packet element is found in the XML
294
294
  # the xml_to_dict method returns a collections.OrderedDict() instance).
295
- if isinstance(output_packet_list, collections.OrderedDict):
295
+ if not isinstance(output_packet_list, list):
296
296
  output_packet_list = [output_packet_list]
297
297
 
298
298
  # Add packet date and time to output list
@@ -302,7 +302,7 @@ class MergeTmRaw(Task):
302
302
 
303
303
  output_packet_list = list(set([
304
304
  self._get_packet_time(current_packet['Packet'],
305
- scos_header=scos_header)
305
+ scos_header=scos_header)
306
306
  for current_packet in output_packet_list
307
307
  ]))
308
308
 
roc_film-1.13.3/setup.py DELETED
@@ -1,49 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- from setuptools import setup
3
-
4
- packages = \
5
- ['roc',
6
- 'roc.film',
7
- 'roc.film.config',
8
- 'roc.film.tasks',
9
- 'roc.film.tests',
10
- 'roc.film.tools']
11
-
12
- package_data = \
13
- {'': ['*']}
14
-
15
- install_requires = \
16
- ['edds_process>=0.8.2',
17
- 'h5py>=3.7,<4.0',
18
- 'jinja2>=3.0,<4.0',
19
- 'maser-tools>=0.1.3',
20
- 'numpy!=1.19.5',
21
- 'pandas>=1.3,<2.0',
22
- 'poppy-core',
23
- 'poppy-pop',
24
- 'roc-dingo>=1.0,<2.0',
25
- 'roc-idb>=1.0,<2.0',
26
- 'roc-rap>=1.0,<2.0',
27
- 'roc-rpl>=1.0,<2.0',
28
- 'spacepy>=0.4,<0.5',
29
- 'sqlalchemy>=1.4,<2.0',
30
- 'xmltodict>=0.13,<0.14']
31
-
32
- setup_kwargs = {
33
- 'name': 'roc-film',
34
- 'version': '1.13.3',
35
- 'description': 'RPW FILe Maker (FILM): Plugin to make RPW L0, L1 and HK data files',
36
- 'long_description': '# FILM PLUGIN README\n\n[![pipeline status](https://gitlab.obspm.fr/ROC/Pipelines/Plugins/FILM/badges/develop/pipeline.svg)](https://gitlab.obspm.fr/ROC/Pipelines/Plugins/FILM/pipelines)\n\nThis directory contains the source files of the Rpw FILe Maker (FILM), a plugin of the ROC pipelines dedicated to the RPW L0, L1 and HK files production.\n\nFILM has been developed with the [POPPY framework](https://poppy-framework.readthedocs.io/en/latest/).\n\n## Quickstart\n\n### Installation with pip\n\nTo install the plugin using pip:\n\n```\npip install roc-film\n```\n\n### Installation from the repository\n\nFirst, retrieve the `FILM` repository from the ROC gitlab server:\n\n```\ngit clone https://gitlab.obspm.fr/ROC/Pipelines/Plugins/FILM.git\n```\n\nYou will need a personal access token to reach the package registry in the ROC Gitlab server.\n\nThen, install the package (here using (poetry)[https://python-poetry.org/]):\n\n```\npoetry install"\n```\n\nNOTES:\n\n - It is also possible to clone the repository using SSH\n - To install poetry: `pip install poetry`\n\n## Usage\n\nThe roc-film plugin is designed to be run in a POPPy-built pipeline.\nNevertheless, it is still possible to import some classes and methods in Python files.\n\n### How to release a new version of the plugin?\n\n1. Checkout to the git *develop* branch (and make pull to be sure to work from the latest commit in the gitlab server)\n\n2. First update metadata (version, dependencies, etc.) in the plugin *pyproject.toml* file.\n\n3. Then make sure the *descriptor.json* and *poetry.lock* files are also up-to-date.\n\nTo update the *descriptor.json* file, run the command:\n\n python bump_descriptor.py -m <modification_message>\n\nTo update the *poetry.lock* file, enter:\n\n poetry lock\n\nN.B. *poetry* Python package must be installed (see https://python-poetry.org/).\n\n4. Commit the changes in the *develop* branch. Make sure to commit with a comprehensive enough message.\n5. Checkout to the *master* branch and merge the *develop* branch into *master*\n6. Create a new git tag `X.Y.Z` for the new version of the plugin (must be the same version than in the *pyproject.toml* file)\n7. Push both the *master* branch and the tag to the gitlab server\n8. Do a rebase of *develop* onto the *master* branch\n9. Push the up-to-date *develop* branch to the gitlab server\n\nN.B. This procedure only concerns the version release. It is assumed that any other changes in the code have been already validated previously.\n\n## CONTACT\n\n* Xavier BONNIN xavier.bonnin@obspm.fr (author, maintainer)\n* Florence HENRY florence.henry@obspm.fr (maintainer)\n\n\nLicense\n-------\n\nThis project is licensed under CeCILL-C.\n\nAcknowledgments\n---------------\n\n* Solar Orbiter / RPW Operation Centre (ROC) team\n',
37
- 'author': 'Xavier Bonnin',
38
- 'author_email': 'xavier.bonnin@obspm.fr',
39
- 'maintainer': 'None',
40
- 'maintainer_email': 'None',
41
- 'url': 'https://gitlab.obspm.fr/ROC/Pipelines/Plugins/FILM',
42
- 'packages': packages,
43
- 'package_data': package_data,
44
- 'install_requires': install_requires,
45
- 'python_requires': '>=3.8,<4',
46
- }
47
-
48
-
49
- setup(**setup_kwargs)
File without changes
File without changes
File without changes