psdi-data-conversion 0.0.37__py3-none-any.whl → 0.0.38__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.
@@ -8,17 +8,17 @@ application, and GUI.
8
8
 
9
9
  from psdi_data_conversion import constants as const
10
10
  from psdi_data_conversion.converters.atomsk import CONVERTER_ATO
11
- from psdi_data_conversion.converters.base import (FileConverterAbortException, FileConverterHelpException,
12
- FileConverterInputException, FileConverterSizeException)
11
+ from psdi_data_conversion.converters.base import (FileConverterAbortException, FileConverterInputException,
12
+ FileConverterSizeException)
13
13
  from psdi_data_conversion.converters.c2x import CONVERTER_C2X
14
14
  from psdi_data_conversion.converters.openbabel import CONVERTER_OB, COORD_GEN_KEY, COORD_GEN_QUAL_KEY
15
+ from psdi_data_conversion.database import FileConverterDatabaseException
15
16
  from psdi_data_conversion.testing.conversion_callbacks import (CheckArchiveContents, CheckException, CheckLogContents,
16
17
  CheckLogContentsSuccess, CheckFileStatus,
17
18
  CheckStderrContents, CheckStdoutContents,
18
19
  MatchOutputFile, MultiCallback as MCB)
19
20
  from psdi_data_conversion.testing.utils import ConversionTestSpec as Spec
20
21
 
21
-
22
22
  l_all_test_specs: list[Spec] = []
23
23
  """All test specs defined in this file"""
24
24
 
@@ -36,11 +36,16 @@ l_all_test_specs.append(Spec(name="Standard Multiple Tests",
36
36
  "hemoglobin.pdb", "hemoglobin.pdb", "nacl.cif",
37
37
  "hemoglobin.pdb", "hemoglobin.pdb", "nacl.cif",
38
38
  "ethanol.xyz"],
39
- to_format=["pdb",
39
+ to_format=["pdb-0",
40
40
  "cif", "mol2", "xyz",
41
41
  "cif", "xyz", "xyz",
42
42
  "cif", "xyz", "xyz",
43
43
  "cml"],
44
+ from_format=[None,
45
+ None, None, None,
46
+ None, None, None,
47
+ "pdb-0", "pdb-0", None,
48
+ None],
44
49
  converter_name=[CONVERTER_OB,
45
50
  CONVERTER_OB, CONVERTER_OB, CONVERTER_OB,
46
51
  CONVERTER_ATO, CONVERTER_ATO, CONVERTER_ATO,
@@ -65,7 +70,7 @@ l_all_test_specs.append(Spec(name="Archive",
65
70
  filename=["caffeine-smi.zip",
66
71
  "caffeine-smi.tar",
67
72
  "caffeine-smi.tar.gz"],
68
- conversion_kwargs={"from_format": "smi"},
73
+ from_format="smi",
69
74
  to_format="inchi",
70
75
  callback=archive_callback,
71
76
  ))
@@ -74,8 +79,8 @@ l_all_test_specs.append(Spec(name="Archive",
74
79
  l_all_test_specs.append(Spec(name="Archive (wrong format) - Library and CLA",
75
80
  filename="caffeine-smi.zip",
76
81
  to_format="inchi",
77
- conversion_kwargs=[{"from_format": "pdb"},
78
- {"from_format": "pdb", "strict": True}],
82
+ from_format=["pdb-0", "pdb-0"],
83
+ conversion_kwargs=[{}, {"strict": True}],
79
84
  expect_success=[True, False],
80
85
  callback=[CheckStderrContents(const.ERR_WRONG_EXTENSIONS),
81
86
  CheckException(ex_type=FileConverterInputException,
@@ -88,8 +93,8 @@ l_all_test_specs.append(Spec(name="Archive (wrong format) - Library and CLA",
88
93
  l_all_test_specs.append(Spec(name="Archive (wrong format) - GUI",
89
94
  filename="caffeine-smi.zip",
90
95
  to_format="inchi",
91
- conversion_kwargs=[{"from_format": "pdb"},
92
- {"from_format": "pdb", "strict": True}],
96
+ from_format=["pdb-0", "pdb-0"],
97
+ conversion_kwargs=[{}, {"strict": True}],
93
98
  expect_success=[False, False],
94
99
  callback=CheckException(ex_type=FileConverterInputException,
95
100
  ex_message=const.ERR_WRONG_EXTENSIONS),
@@ -150,7 +155,7 @@ Not compatible with GUI tests, since the GUI doesn't support quiet mode
150
155
 
151
156
  l_all_test_specs.append(Spec(name="Open Babel Warning",
152
157
  filename="1NE6.mmcif",
153
- to_format="pdb",
158
+ to_format="pdb-0",
154
159
  callback=CheckLogContentsSuccess(["Open Babel Warning",
155
160
  "Failed to kekulize aromatic bonds",])
156
161
  ))
@@ -205,6 +210,7 @@ Not compatible with the GUI, since the GUI can't forcibly delete files uploaded
205
210
  l_all_test_specs.append(Spec(name="Failed conversion - bad input file",
206
211
  filename=["quartz_err.xyz", "cyclopropane_err.mol"],
207
212
  to_format=["inchi", "xyz"],
213
+ from_format=[None, "mol-0"],
208
214
  expect_success=False,
209
215
  converter_name=[CONVERTER_OB, CONVERTER_C2X],
210
216
  callback=[MCB(CheckFileStatus(expect_output_exists=False,
@@ -246,12 +252,13 @@ l_all_test_specs.append(Spec(name="Errors in logs - GUI",
246
252
 
247
253
  l_all_test_specs.append(Spec(name="Failed conversion - invalid conversion",
248
254
  filename=["Fapatite.ins", "nacl.mol"],
255
+ from_format=["ins", "mol-0"],
249
256
  to_format=["cml", "xyz"],
250
257
  expect_success=False,
251
- converter_name=[CONVERTER_OB, CONVERTER_ATO],
258
+ converter_name=[CONVERTER_C2X, CONVERTER_ATO],
252
259
  callback=MCB(CheckFileStatus(expect_output_exists=False,
253
260
  expect_log_exists=None),
254
- CheckException(ex_type=FileConverterHelpException,
261
+ CheckException(ex_type=FileConverterDatabaseException,
255
262
  ex_message="is not supported")),
256
263
  compatible_with_gui=False,
257
264
  ))
@@ -263,7 +270,8 @@ Not compatible with the GUI, since the GUI only offers valid conversions.
263
270
  l_all_test_specs.append(Spec(name="Blocked conversion - wrong input type",
264
271
  filename="1NE6.mmcif",
265
272
  to_format="cif",
266
- conversion_kwargs={"from_format": "pdb", "strict": True},
273
+ from_format="pdb-0",
274
+ conversion_kwargs={"strict": True},
267
275
  expect_success=False,
268
276
  callback=MCB(CheckFileStatus(expect_output_exists=False,
269
277
  expect_log_exists=None),
@@ -278,7 +286,8 @@ l_all_test_specs.append(Spec(name="Blocked conversion - wrong input type",
278
286
  l_all_test_specs.append(Spec(name="Failed conversion - wrong input type",
279
287
  filename="1NE6.mmcif",
280
288
  to_format="cif",
281
- conversion_kwargs={"from_format": "pdb", "strict": False},
289
+ from_format="pdb-0",
290
+ conversion_kwargs={"strict": False},
282
291
  expect_success=False,
283
292
  callback=MCB(CheckFileStatus(expect_output_exists=False,
284
293
  expect_log_exists=None),
@@ -291,6 +300,8 @@ l_all_test_specs.append(Spec(name="Large files - Library and CLA",
291
300
  filename=["ch3cl-esp.cub", "benzyne.molden", "periodic_dmol3.outmol",
292
301
  "fullRhinovirus.pdb"],
293
302
  to_format=["cdjson", "dmol", "mol", "cif"],
303
+ from_format=[None, None, None, "pdb-0"],
304
+ conversion_kwargs=[{}, {}, {}, {"strict": False}],
294
305
  converter_name=[CONVERTER_OB, CONVERTER_OB, CONVERTER_OB, CONVERTER_C2X],
295
306
  callback=CheckFileStatus(),
296
307
  compatible_with_gui=False,
@@ -301,6 +312,7 @@ l_all_test_specs.append(Spec(name="Large files - GUI",
301
312
  filename=["ch3cl-esp.cub", "benzyne.molden",
302
313
  "periodic_dmol3.outmol", "fullRhinovirus.pdb"],
303
314
  to_format=["cdjson", "dmol", "mol", "cif"],
315
+ from_format=[None, None, None, "pdb-0"],
304
316
  converter_name=[CONVERTER_OB, CONVERTER_OB, CONVERTER_OB, CONVERTER_C2X],
305
317
  expect_success=[False, False, False, True],
306
318
  callback=[CheckException(ex_type=FileConverterInputException),
@@ -319,7 +331,7 @@ max_size_callback = MCB(CheckFileStatus(expect_output_exists=False),
319
331
  ex_status_code=const.STATUS_CODE_SIZE))
320
332
  l_all_test_specs.append(Spec(name="Max size exceeded",
321
333
  filename=["1NE6.mmcif", "caffeine-smi.tar.gz"],
322
- to_format="pdb",
334
+ to_format="pdb-0",
323
335
  conversion_kwargs=[{"max_file_size": 0.0001}, {"max_file_size": 0.0005}],
324
336
  expect_success=False,
325
337
  callback=max_size_callback,