psdi-data-conversion 0.2.3__py3-none-any.whl → 0.2.4__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.
@@ -244,7 +244,7 @@ class OBFileConverter(FileConverter):
244
244
 
245
245
  # Check that the option is valid
246
246
  try:
247
- get_in_format_args(self.name, self.to_format_info, option)
247
+ get_out_format_args(self.name, self.to_format_info, option)
248
248
  except FileConverterDatabaseException:
249
249
  print_wrap(f"WARNING: Output format option '{option}' not recognised for conversion with "
250
250
  f"{self.name}. If this is valid, the database should be updated to indicate "
@@ -383,47 +383,69 @@ class ConverterInfo:
383
383
  self._d_out_format_options = self._create_d_format_args(OptionInfo, "out")
384
384
  return self._d_out_format_options
385
385
 
386
- def get_in_format_args(self, name: str) -> tuple[list[FlagInfo], list[OptionInfo]]:
386
+ def get_in_format_args(self, in_format: str | int | FormatInfo) -> tuple[list[FlagInfo], list[OptionInfo]]:
387
387
  """Get the input flags and options supported for a given format (provided as its extension)
388
388
 
389
389
  Parameters
390
390
  ----------
391
- name : str
392
- The file format name (extension)
391
+ in_format : str
392
+ The file format name (extension), ID, or FormatInfo
393
393
 
394
394
  Returns
395
395
  -------
396
396
  tuple[set[FlagInfo], set[OptionInfo]]
397
397
  A set of info for the allowed flags, and a set of info for the allowed options
398
398
  """
399
- l_flag_ids = list(self.d_in_format_flags.get(name, set()))
399
+
400
+ l_in_format_infos = get_format_info(in_format, which="all")
401
+ s_flag_ids = set()
402
+ s_option_ids = set()
403
+
404
+ for in_format_info in l_in_format_infos:
405
+ in_format_id = in_format_info.id
406
+
407
+ s_flag_ids.update(self.d_in_format_flags.get(in_format_id, set()))
408
+ s_option_ids.update(self.d_in_format_options.get(in_format_id, set()))
409
+
410
+ l_flag_ids = list(s_flag_ids)
400
411
  l_flag_ids.sort()
401
412
  l_flag_info = [self.l_in_flag_info[x] for x in l_flag_ids]
402
413
 
403
- l_option_ids = list(self.d_in_format_options.get(name, set()))
414
+ l_option_ids = list(s_option_ids)
404
415
  l_option_ids.sort()
405
416
  l_option_info = [self.l_in_option_info[x] for x in l_option_ids]
406
417
 
407
418
  return l_flag_info, l_option_info
408
419
 
409
- def get_out_format_args(self, name: str) -> tuple[list[FlagInfo], list[OptionInfo]]:
420
+ def get_out_format_args(self, out_format: str | int | FormatInfo) -> tuple[list[FlagInfo], list[OptionInfo]]:
410
421
  """Get the output flags and options supported for a given format (provided as its extension)
411
422
 
412
423
  Parameters
413
424
  ----------
414
- name : str
415
- The file format name (extension)
425
+ out_format : str
426
+ The file format name (extension), ID, or FormatInfo
416
427
 
417
428
  Returns
418
429
  -------
419
430
  tuple[set[FlagInfo], set[OptionInfo]]
420
431
  A set of info for the allowed flags, and a set of info for the allowed options
421
432
  """
422
- l_flag_ids = list(self.d_out_format_flags.get(name, set()))
433
+
434
+ l_out_format_infos = get_format_info(out_format, which="all")
435
+ s_flag_ids = set()
436
+ s_option_ids = set()
437
+
438
+ for out_format_info in l_out_format_infos:
439
+ out_format_id = out_format_info.id
440
+
441
+ s_flag_ids.update(self.d_out_format_flags.get(out_format_id, set()))
442
+ s_option_ids.update(self.d_out_format_options.get(out_format_id, set()))
443
+
444
+ l_flag_ids = list(s_flag_ids)
423
445
  l_flag_ids.sort()
424
446
  l_flag_info = [self.l_out_flag_info[x] for x in l_flag_ids]
425
447
 
426
- l_option_ids = list(self.d_out_format_options.get(name, set()))
448
+ l_option_ids = list(s_option_ids)
427
449
  l_option_ids.sort()
428
450
  l_option_info = [self.l_out_option_info[x] for x in l_option_ids]
429
451
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: psdi_data_conversion
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Chemistry file format conversion service, provided by PSDI
5
5
  Project-URL: Homepage, https://data-conversion.psdi.ac.uk/
6
6
  Project-URL: Documentation, https://psdi-uk.github.io/psdi-data-conversion/
@@ -2,7 +2,7 @@ psdi_data_conversion/__init__.py,sha256=urMsTqsTHTch1q4rMT9dgGnrvdPFMP9B8r-6Kr8H
2
2
  psdi_data_conversion/app.py,sha256=u26a6taxmS3Yn9o78hL1avpO-50BnbcMnJAuVn5XlEc,3607
3
3
  psdi_data_conversion/constants.py,sha256=eXE43_9YFahoehiUV7FtqN9MKb-UpSfY2win9ic9W8I,7348
4
4
  psdi_data_conversion/converter.py,sha256=OlwGKxI8nj76wrlVzP5S7fpXb6L-Ql8-mYLYGhW81Fk,27816
5
- psdi_data_conversion/database.py,sha256=uE2s9RelTmcsr8u42nKdTJfmobysO2PY-B_7rl7TecQ,65766
5
+ psdi_data_conversion/database.py,sha256=dJudFtSAXy814Ymw8ht9Lzfs4v-A6hv5k2busaXJlKU,66524
6
6
  psdi_data_conversion/dist.py,sha256=Db7mbLLANfugaptrcWCoVddwHT2rdP4X4HuP6uxr9AI,2309
7
7
  psdi_data_conversion/file_io.py,sha256=SE7cXVedm5ZLdxDQ7W7L2R9LXTqJz2Tak9-YTvc7_js,9250
8
8
  psdi_data_conversion/log_utility.py,sha256=CHAq-JvBnTKaE0SHK5hM5j2dTbfSli4iUc3hsf6dBhc,8789
@@ -19,7 +19,7 @@ psdi_data_conversion/converters/__init__.py,sha256=15Ldt06eyZ0bgNPB4qg419U0Zcjt6
19
19
  psdi_data_conversion/converters/atomsk.py,sha256=_V33me1e4HW0-YXvdE-z6PdwtSK2gYV6QZf5d8aPqH4,1523
20
20
  psdi_data_conversion/converters/base.py,sha256=yGlwQmYcLSKP9DH2reTBGvJ-HhfxjO_dYo6qVX501Zw,36515
21
21
  psdi_data_conversion/converters/c2x.py,sha256=jDA84H8Jpz--ajTWNWX6K6oMfOMMbMxkA31-VnGi0gU,2019
22
- psdi_data_conversion/converters/openbabel.py,sha256=L1R9gc1oU2w_OUqU5Fduz_xT_l8ZPRVG915jOYnKCdE,16956
22
+ psdi_data_conversion/converters/openbabel.py,sha256=2S3WZcYpS-FhKv2lqYndTWn-FNh8LeX3-Kc1nGw0y7s,16957
23
23
  psdi_data_conversion/gui/__init__.py,sha256=Q52GAaJWfNWGDOAEM_fIfAoivLIgM3krhVTiHFTRixM,125
24
24
  psdi_data_conversion/gui/accessibility.py,sha256=XQyAAJZQdIyRftfidhhVgsZXVtA9b9qZhwwFm899kbE,1302
25
25
  psdi_data_conversion/gui/env.py,sha256=nVuKzuE6z9ItH09ZRkooGRUTVZSHtPzSR9XrZVDHC-0,9235
@@ -87,8 +87,8 @@ psdi_data_conversion/testing/conversion_callbacks.py,sha256=ATR-_BsYCUN8KyOyUjfd
87
87
  psdi_data_conversion/testing/conversion_test_specs.py,sha256=PFzTZYonQ0PsZBKjcn0Hp-UPbwphT3zRH5v-VdNImmQ,27585
88
88
  psdi_data_conversion/testing/gui.py,sha256=ul7ixYANIzmOG2ZNOZmQO6wsHmGHdiBGAlw-KuoN0j8,19085
89
89
  psdi_data_conversion/testing/utils.py,sha256=uhJQUceaNmpQd3SioFLZVMExMVzO3Ds8V9DD2hqP-mQ,26700
90
- psdi_data_conversion-0.2.3.dist-info/METADATA,sha256=zCwJY99aohLJ_Cekj0rPP0mz2ieo8WI9qBu7ZuSM-Z8,50396
91
- psdi_data_conversion-0.2.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
- psdi_data_conversion-0.2.3.dist-info/entry_points.txt,sha256=xL7XTzaPRr2E67WhOD1M1Q-76hB8ausQlnNiHzuZQPA,123
93
- psdi_data_conversion-0.2.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
94
- psdi_data_conversion-0.2.3.dist-info/RECORD,,
90
+ psdi_data_conversion-0.2.4.dist-info/METADATA,sha256=hlT0b9qN26H0fVAnNI7euuBjKKVl_VUR1SLAdAzJtBg,50396
91
+ psdi_data_conversion-0.2.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
+ psdi_data_conversion-0.2.4.dist-info/entry_points.txt,sha256=xL7XTzaPRr2E67WhOD1M1Q-76hB8ausQlnNiHzuZQPA,123
93
+ psdi_data_conversion-0.2.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
94
+ psdi_data_conversion-0.2.4.dist-info/RECORD,,