psdi-data-conversion 0.2.1__tar.gz → 0.2.3__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 (154) hide show
  1. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/CHANGELOG.md +27 -0
  2. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/PKG-INFO +52 -11
  3. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/README.md +51 -10
  4. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/app.py +1 -1
  5. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/converters/base.py +4 -1
  6. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/converters/openbabel.py +82 -11
  7. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/database.py +9 -8
  8. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/dist.py +2 -2
  9. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/file_io.py +18 -0
  10. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/main.py +29 -38
  11. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/testing/constants.py +1 -1
  12. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/testing/utils.py +25 -13
  13. psdi_data_conversion-0.2.3/psdi_data_conversion/utils.py +40 -0
  14. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/tests/python/cli_test.py +13 -4
  15. psdi_data_conversion-0.2.1/psdi_data_conversion/utils.py +0 -21
  16. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/.gitignore +0 -0
  17. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/CONTRIBUTING.md +0 -0
  18. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/LICENSE +0 -0
  19. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/doc/conversion_chaining.md +0 -0
  20. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/doc/img/all_conversions.png +0 -0
  21. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/doc/img/simple_graph.svg +0 -0
  22. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/doc/img/simple_graph_with_custom.svg +0 -0
  23. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/__init__.py +0 -0
  24. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/bin/LICENSE_ATOMSK +0 -0
  25. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/bin/LICENSE_C2X +0 -0
  26. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/bin/linux/atomsk +0 -0
  27. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/bin/linux/c2x +0 -0
  28. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/bin/mac/atomsk +0 -0
  29. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/bin/mac/c2x +0 -0
  30. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/constants.py +0 -0
  31. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/converter.py +0 -0
  32. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/converters/__init__.py +0 -0
  33. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/converters/atomsk.py +0 -0
  34. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/converters/c2x.py +0 -0
  35. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/gui/__init__.py +0 -0
  36. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/gui/accessibility.py +0 -0
  37. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/gui/env.py +0 -0
  38. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/gui/get.py +0 -0
  39. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/gui/post.py +0 -0
  40. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/gui/setup.py +0 -0
  41. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/log_utility.py +0 -0
  42. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/scripts/atomsk.sh +0 -0
  43. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/scripts/c2x.sh +0 -0
  44. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/security.py +0 -0
  45. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/convert.htm +0 -0
  46. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/convertato.htm +0 -0
  47. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/convertc2x.htm +0 -0
  48. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/download.htm +0 -0
  49. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/feedback.htm +0 -0
  50. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/header-links.html +0 -0
  51. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/index-versions/header-links.html +0 -0
  52. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/index-versions/psdi-common-footer.html +0 -0
  53. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/index-versions/psdi-common-header.html +0 -0
  54. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/psdi-common-footer.html +0 -0
  55. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/content/psdi-common-header.html +0 -0
  56. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/data/data.json +0 -0
  57. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/colormode-toggle-dm.svg +0 -0
  58. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/colormode-toggle-lm.svg +0 -0
  59. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/psdi-icon-dark.svg +0 -0
  60. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/psdi-icon-light.svg +0 -0
  61. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/psdi-logo-darktext-simple.png +0 -0
  62. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/psdi-logo-darktext.png +0 -0
  63. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/psdi-logo-lighttext-simple.png +0 -0
  64. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/psdi-logo-lighttext.png +0 -0
  65. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-bluesky-black.svg +0 -0
  66. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-bluesky-white.svg +0 -0
  67. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-instagram-black.svg +0 -0
  68. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-instagram-white.svg +0 -0
  69. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-linkedin-black.png +0 -0
  70. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-linkedin-white.png +0 -0
  71. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-mastodon-black.svg +0 -0
  72. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-mastodon-white.svg +0 -0
  73. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-x-black.svg +0 -0
  74. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-x-white.svg +0 -0
  75. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-youtube-black.png +0 -0
  76. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/social-logo-youtube-white.png +0 -0
  77. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/ukri-epsr-logo-darktext.png +0 -0
  78. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/ukri-epsr-logo-lighttext.png +0 -0
  79. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/ukri-logo-darktext.png +0 -0
  80. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/img/ukri-logo-lighttext.png +0 -0
  81. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/accessibility.js +0 -0
  82. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/common.js +0 -0
  83. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/convert.js +0 -0
  84. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/convert_common.js +0 -0
  85. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/convertato.js +0 -0
  86. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/convertc2x.js +0 -0
  87. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/data.js +0 -0
  88. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/format.js +0 -0
  89. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/load_accessibility.js +0 -0
  90. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/psdi-common.js +0 -0
  91. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/javascript/report.js +0 -0
  92. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/styles/format.css +0 -0
  93. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/static/styles/psdi-common.css +0 -0
  94. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/templates/accessibility.htm +0 -0
  95. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/templates/documentation.htm +0 -0
  96. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/templates/index.htm +0 -0
  97. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/templates/report.htm +0 -0
  98. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/testing/__init__.py +0 -0
  99. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/testing/conversion_callbacks.py +0 -0
  100. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/testing/conversion_test_specs.py +0 -0
  101. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/psdi_data_conversion/testing/gui.py +0 -0
  102. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/pyproject.toml +0 -0
  103. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/scripts/make_doc_graph_plots.py +0 -0
  104. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/scripts/setup_bin.py +0 -0
  105. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/1ARJ.mmcif +0 -0
  106. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/1NE6.mmcif +0 -0
  107. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/5a9z-assembly1.cif +0 -0
  108. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/Fapatite.ins +0 -0
  109. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/aceticacid.mol +0 -0
  110. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/benzyne.molden +0 -0
  111. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/caffeine-smi.tar +0 -0
  112. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/caffeine-smi.tar.gz +0 -0
  113. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/caffeine-smi.zip +0 -0
  114. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/caffeine.inchi +0 -0
  115. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/ch3cl-esp.cub +0 -0
  116. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/cyclopropane_err.mol +0 -0
  117. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/ethanol.xyz +0 -0
  118. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/fullRhinovirus.pdb +0 -0
  119. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/hemoglobin.pdb +0 -0
  120. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/nacl.cif +0 -0
  121. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/nacl.mol +0 -0
  122. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/aceticacid.log.txt +0 -0
  123. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/aceticacid.mol2 +0 -0
  124. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/caffeine-2D-fastest.xyz +0 -0
  125. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/caffeine-3D-best.xyz +0 -0
  126. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/caffeine.smi +0 -0
  127. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/caffeine.xyz +0 -0
  128. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/caffeine_a_in.smi +0 -0
  129. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/caffeine_a_in_kx_f4_l5_out.smi +0 -0
  130. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/caffeine_a_in_kx_f4_out.smi +0 -0
  131. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/caffeine_a_in_kx_out.smi +0 -0
  132. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/caffeine_a_in_x_out.smi +0 -0
  133. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/hemoglobin_Atomsk.xyz +0 -0
  134. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/hemoglobin_c2x.xyz +0 -0
  135. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/nacl.log +0 -0
  136. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/nacl.mol +0 -0
  137. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/quartz_OB.cif +0 -0
  138. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/quartz_OB.log.txt +0 -0
  139. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/quartz_atomsk.cif +0 -0
  140. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/quartz_atomsk.log.txt +0 -0
  141. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/standard_test.inchi +0 -0
  142. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/xyz_files-mol.zip +0 -0
  143. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/output/xyz_files.log.txt +0 -0
  144. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/periodic_dmol3.outmol +0 -0
  145. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/quartz.xyz +0 -0
  146. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/quartz_err.xyz +0 -0
  147. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/test_data/standard_test.cdxml +0 -0
  148. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/tests/gui/gui_test.py +0 -0
  149. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/tests/python/converter_test.py +0 -0
  150. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/tests/python/database_test.py +0 -0
  151. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/tests/python/dist_test.py +0 -0
  152. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/tests/python/file_io_test.py +0 -0
  153. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/tests/python/logging_test.py +0 -0
  154. {psdi_data_conversion-0.2.1 → psdi_data_conversion-0.2.3}/tests/python/security_test.py +0 -0
@@ -1,5 +1,32 @@
1
1
  # Changelog for PSDI Data Conversion
2
2
 
3
+ ## v0.2.3
4
+
5
+ ### New and Changed Functionality
6
+
7
+ - When listing formats supported by a given converter in the command-line application, the description of each format will also be shown in the table
8
+ - A warning will now be printed to stderr and logged if an unrecognised format flag or option is provided for conversion with Open Babel
9
+
10
+ ### Bugfixes
11
+
12
+ - Fixed coordinate generation quality not being properly logged
13
+
14
+ ### Documentation Changes
15
+
16
+ - Fixed help for the "--from-flags", "--from-options" etc. command-line options to properly describe how values should be provided for them
17
+ - Add note to README about how to submit feedback and missing formats/conversion
18
+ - Updated README discussion of format IDs and disambiguated names, and provided more information about how to get IDs when formats are listed or when an ambiguous conversion is requested
19
+
20
+ ## v0.2.2
21
+
22
+ ### Bugfixes
23
+
24
+ - Fixed bug where c2x and Atomsk converters would fail if the current working directory wasn't the base directory of the project
25
+
26
+ ### Testing Changes
27
+
28
+ - Disabled automated MacOS testing, which started failing due to an update on GitHub's end, while we decide how to fix it
29
+
3
30
  ## v0.2.1
4
31
 
5
32
  ### Bugfixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: psdi_data_conversion
3
- Version: 0.2.1
3
+ Version: 0.2.3
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/
@@ -293,6 +293,7 @@ This is the repository for the PSDI PF2 Chemistry File Format Conversion project
293
293
  - [Input file is malformatted or corrupt](#input-file-is-malformatted-or-corrupt)
294
294
  - [Input file's format is misidentified](#input-files-format-is-misidentified)
295
295
  - [Other known issues](#other-known-issues)
296
+ - [Feedback](#feedback)
296
297
  - [Licensing](#licensing)
297
298
  - [Contributors](#contributors)
298
299
  - [Funding](#funding)
@@ -484,12 +485,17 @@ options] [-s/--strict] [--nc/--no-check] [-q/--quiet] [-g/--log-file <log file n
484
485
 
485
486
  Call `psdi-data-convert -h` for details on each of these options.
486
487
 
487
- Note that some requested conversions may involve ambiguous formats which share the same extension. In this case, the application will print a warning and list possible matching formats, with a disambiguating name that can be used to specify which one. For instance, the `c2x` converter can convert into two variants of the `pdb` format, and if you ask it to convert to `pdb` without specifying which one, you'll see:
488
+ Note that some requested conversions may involve ambiguous formats which share the same extension. In this case, the application will print a warning and list possible matching formats, with IDs and disambiguating names that can be used to specify which one. For instance, the `c2x` converter can convert into two variants of the `pdb` format, and if you ask it to convert to `pdb` without specifying which one, you'll see:
488
489
 
489
490
  ```
490
- ERROR: Extension 'pdb' is ambiguous and must be defined by ID. Possible formats and their IDs are:
491
+ WARNING: Format 'pdb' is ambiguous and could refer to multiple formats. It may be necessary to explicitly specify which
492
+ you want to use when calling this script, e.g. with '-f pdb-0' - see the disambiguated names in the list below:
493
+
491
494
  9: pdb-0 (Protein Data Bank)
495
+ ...
496
+
492
497
  259: pdb-1 (Protein Data Bank with atoms numbered)
498
+ ...
493
499
  ```
494
500
 
495
501
  This provides the IDs ("9" and "259") and disambiguating names ("pdb-0" and "pdb-1") for the matching formats. Either can be used in the call to the converter, e.g.:
@@ -745,38 +751,69 @@ To remedy this, try explicitly specifying the format, rather than letting the ap
745
751
  `<format>` here can be the standard extension of the format (in the case of unambiguous extensions), its ID, or its disambiguated name. To give an example which explains what each of these are, let's say you have an MDL MOL file you wish to convert to XYZ, so you get information about it and possible converters with `psdi-data-convert -l -f mol -t xyz`:
746
752
 
747
753
  ```base
748
- $ psdi-data-convert -l -f mol
754
+ $ psdi-data-convert -l -f mol -t xyz
749
755
  WARNING: Format 'mol' is ambiguous and could refer to multiple formats. It may be necessary to explicitly specify which
750
756
  you want to use when calling this script, e.g. with '-f mol-0' - see the disambiguated names in the list below:
751
757
 
752
758
  18: mol-0 (MDL MOL)
759
+ - Atomic composition is supported
760
+ - Atomic connections are supported
761
+ - 2D atomic coordinates are supported
762
+ - 3D atomic coordinates are supported
763
+
753
764
  216: mol-1 (MOLDY)
765
+ - Atomic composition is unknown whether or not to be supported
766
+ - Atomic connections are unknown whether or not to be supported
767
+ - 2D atomic coordinates are unknown whether or not to be supported
768
+ - 3D atomic coordinates are unknown whether or not to be supported
769
+
770
+ WARNING: Format 'xyz' is ambiguous and could refer to multiple formats. It may be necessary to explicitly specify which
771
+ you want to use when calling this script, e.g. with '-f xyz-0' - see the disambiguated names in the list below:
754
772
 
755
- 20: xyz (XYZ cartesian coordinates)
773
+ 20: xyz-0 (XYZ cartesian coordinates)
774
+ - Atomic composition is supported
775
+ - Atomic connections are not supported
776
+ - 2D atomic coordinates are supported
777
+ - 3D atomic coordinates are supported
756
778
 
757
- The following registered converters can convert from mol-0 to xyz:
779
+ 284: xyz-1 (Extended XYZ (adds lattice vectors))
780
+ - Atomic composition is unknown whether or not to be supported
781
+ - Atomic connections are unknown whether or not to be supported
782
+ - 2D atomic coordinates are unknown whether or not to be supported
783
+ - 3D atomic coordinates are unknown whether or not to be supported
784
+
785
+ The following registered converters can convert from mol-0 to xyz-0:
758
786
 
759
787
  Open Babel
760
788
  c2x
761
789
 
762
790
  For details on input/output flags and options allowed by a converter for this conversion, call:
763
- psdi-data-convert -l <converter name> -f mol-0 -t xyz
791
+ psdi-data-convert -l <converter name> -f mol-0 -t xyz-0
792
+
793
+ The following registered converters can convert from mol-0 to xyz-1:
764
794
 
765
- The following registered converters can convert from mol-1 to xyz:
795
+ c2x
796
+
797
+ For details on input/output flags and options allowed by a converter for this conversion, call:
798
+ psdi-data-convert -l <converter name> -f mol-0 -t xyz-1
799
+
800
+ The following registered converters can convert from mol-1 to xyz-0:
766
801
 
767
802
  Atomsk
768
803
 
769
804
  For details on input/output flags and options allowed by a converter for this conversion, call:
770
- psdi-data-convert -l <converter name> -f mol-1 -t xyz
805
+ psdi-data-convert -l <converter name> -f mol-1 -t xyz-0
806
+
807
+ No converters are available which can perform a conversion from mol-1 to xyz-1
771
808
  ```
772
809
 
773
- This output indicates that the application is aware of two formats which share the `mol` extension: MDL MOL and MOLDY. It lists the ID, disambiguated name, and description of each: ID `18` and disambiguated name `mol-0` for MDL MOL, and ID `216` and disambiguated name `mol-1` for MOLDY. The XYZ format, on the other hand, is unambiguous, and only lists the standard extension for it as its disambiguated name (although `xyz-0` will be accepted without error as well).
810
+ This output indicates that the application is aware of two formats which share the `mol` extension: MDL MOL and MOLDY. It lists the ID, disambiguated name, and description of each: ID `18` and disambiguated name `mol-0` for MDL MOL, and ID `216` and disambiguated name `mol-1` for MOLDY. The XYZ format similarly has two variants which can be converted to.
774
811
 
775
812
  The program then lists converters which can handle the requested conversion, revealing a potential pitfall: The Open Babel and c2x converters can convert from MDL MOL to XYZ, which the Atomsk converter can convert from MOLDY to XYZ. If you don't specify which format you're converting from, the script might assume you meant to use the other one, if that's the only one compatible with the converter you've requested (or with the default converter, Open Babel, if you didn't explicitly request one). So to be careful here, it's best to specify this input format unambiguously.
776
813
 
777
814
  Since in this example you have an MDL MOL file, you would use `-f 18` or `-f mol-0` to explicitly specify it in the command-line, or similarly provide one of these to the `from_format` argument of `run_converter` within Python. The application will then properly handle it, including alerting you if you request a conversion that isn't supported by your requested converter (e.g. if you request a conversion of this MDL MOL file to XYZ with Atomsk).
778
815
 
779
- Important note: The disambiguated name is generated dynamically and isn't stored in the database, and in rare cases may change for some formats in future versions of this application which expand support to more formats and conversions. For uses which require forward-compatibility with future versions of this application, the ID should be used instead.
816
+ Important note: The disambiguated name is generated dynamically and isn't stored in the database, and in rare cases may change for some formats in future versions of this application which expand support to more formats and conversions. For uses which require forward-compatibility with future versions of this application, the ID should be used instead. You can obtain the ID for any format via the command: `psdi-data-convert -l -f <format-name>`.
780
817
 
781
818
  #### Other known issues
782
819
 
@@ -784,6 +821,10 @@ Through testing, we've identified some other conversion issues, which we list he
784
821
 
785
822
  - Open Babel will indefinitely hang when attempting to convert large files (more than ~1 MB) of certain types (such as `mmcif`). This is an issue with the converter itself and not our application, which we hope will be fixed in a future version. If this occurs, the job will have to be forcibly terminated. CTRL+C will fail to terminate it, but it can be stopped with CTRL+Z, then terminated with `kill %N`, where N is the number listed beside the job when it is stopped (usually 1). The conversion should then be attempted with another supported converter.
786
823
 
824
+ ## Feedback
825
+
826
+ To report a missing format or conversion, please use [the form on the public web service](https://data-conversion.psdi.ac.uk/report.htm). Other feedback can be submitted on [the feedback page](https://data-conversion.psdi.ac.uk/static/content/feedback.htm).
827
+
787
828
  ## Licensing
788
829
 
789
830
  This project is provided under the Apache License version 2.0, the terms of which can be found in the file `LICENSE`.
@@ -43,6 +43,7 @@ This is the repository for the PSDI PF2 Chemistry File Format Conversion project
43
43
  - [Input file is malformatted or corrupt](#input-file-is-malformatted-or-corrupt)
44
44
  - [Input file's format is misidentified](#input-files-format-is-misidentified)
45
45
  - [Other known issues](#other-known-issues)
46
+ - [Feedback](#feedback)
46
47
  - [Licensing](#licensing)
47
48
  - [Contributors](#contributors)
48
49
  - [Funding](#funding)
@@ -234,12 +235,17 @@ options] [-s/--strict] [--nc/--no-check] [-q/--quiet] [-g/--log-file <log file n
234
235
 
235
236
  Call `psdi-data-convert -h` for details on each of these options.
236
237
 
237
- Note that some requested conversions may involve ambiguous formats which share the same extension. In this case, the application will print a warning and list possible matching formats, with a disambiguating name that can be used to specify which one. For instance, the `c2x` converter can convert into two variants of the `pdb` format, and if you ask it to convert to `pdb` without specifying which one, you'll see:
238
+ Note that some requested conversions may involve ambiguous formats which share the same extension. In this case, the application will print a warning and list possible matching formats, with IDs and disambiguating names that can be used to specify which one. For instance, the `c2x` converter can convert into two variants of the `pdb` format, and if you ask it to convert to `pdb` without specifying which one, you'll see:
238
239
 
239
240
  ```
240
- ERROR: Extension 'pdb' is ambiguous and must be defined by ID. Possible formats and their IDs are:
241
+ WARNING: Format 'pdb' is ambiguous and could refer to multiple formats. It may be necessary to explicitly specify which
242
+ you want to use when calling this script, e.g. with '-f pdb-0' - see the disambiguated names in the list below:
243
+
241
244
  9: pdb-0 (Protein Data Bank)
245
+ ...
246
+
242
247
  259: pdb-1 (Protein Data Bank with atoms numbered)
248
+ ...
243
249
  ```
244
250
 
245
251
  This provides the IDs ("9" and "259") and disambiguating names ("pdb-0" and "pdb-1") for the matching formats. Either can be used in the call to the converter, e.g.:
@@ -495,38 +501,69 @@ To remedy this, try explicitly specifying the format, rather than letting the ap
495
501
  `<format>` here can be the standard extension of the format (in the case of unambiguous extensions), its ID, or its disambiguated name. To give an example which explains what each of these are, let's say you have an MDL MOL file you wish to convert to XYZ, so you get information about it and possible converters with `psdi-data-convert -l -f mol -t xyz`:
496
502
 
497
503
  ```base
498
- $ psdi-data-convert -l -f mol
504
+ $ psdi-data-convert -l -f mol -t xyz
499
505
  WARNING: Format 'mol' is ambiguous and could refer to multiple formats. It may be necessary to explicitly specify which
500
506
  you want to use when calling this script, e.g. with '-f mol-0' - see the disambiguated names in the list below:
501
507
 
502
508
  18: mol-0 (MDL MOL)
509
+ - Atomic composition is supported
510
+ - Atomic connections are supported
511
+ - 2D atomic coordinates are supported
512
+ - 3D atomic coordinates are supported
513
+
503
514
  216: mol-1 (MOLDY)
515
+ - Atomic composition is unknown whether or not to be supported
516
+ - Atomic connections are unknown whether or not to be supported
517
+ - 2D atomic coordinates are unknown whether or not to be supported
518
+ - 3D atomic coordinates are unknown whether or not to be supported
519
+
520
+ WARNING: Format 'xyz' is ambiguous and could refer to multiple formats. It may be necessary to explicitly specify which
521
+ you want to use when calling this script, e.g. with '-f xyz-0' - see the disambiguated names in the list below:
504
522
 
505
- 20: xyz (XYZ cartesian coordinates)
523
+ 20: xyz-0 (XYZ cartesian coordinates)
524
+ - Atomic composition is supported
525
+ - Atomic connections are not supported
526
+ - 2D atomic coordinates are supported
527
+ - 3D atomic coordinates are supported
506
528
 
507
- The following registered converters can convert from mol-0 to xyz:
529
+ 284: xyz-1 (Extended XYZ (adds lattice vectors))
530
+ - Atomic composition is unknown whether or not to be supported
531
+ - Atomic connections are unknown whether or not to be supported
532
+ - 2D atomic coordinates are unknown whether or not to be supported
533
+ - 3D atomic coordinates are unknown whether or not to be supported
534
+
535
+ The following registered converters can convert from mol-0 to xyz-0:
508
536
 
509
537
  Open Babel
510
538
  c2x
511
539
 
512
540
  For details on input/output flags and options allowed by a converter for this conversion, call:
513
- psdi-data-convert -l <converter name> -f mol-0 -t xyz
541
+ psdi-data-convert -l <converter name> -f mol-0 -t xyz-0
542
+
543
+ The following registered converters can convert from mol-0 to xyz-1:
514
544
 
515
- The following registered converters can convert from mol-1 to xyz:
545
+ c2x
546
+
547
+ For details on input/output flags and options allowed by a converter for this conversion, call:
548
+ psdi-data-convert -l <converter name> -f mol-0 -t xyz-1
549
+
550
+ The following registered converters can convert from mol-1 to xyz-0:
516
551
 
517
552
  Atomsk
518
553
 
519
554
  For details on input/output flags and options allowed by a converter for this conversion, call:
520
- psdi-data-convert -l <converter name> -f mol-1 -t xyz
555
+ psdi-data-convert -l <converter name> -f mol-1 -t xyz-0
556
+
557
+ No converters are available which can perform a conversion from mol-1 to xyz-1
521
558
  ```
522
559
 
523
- This output indicates that the application is aware of two formats which share the `mol` extension: MDL MOL and MOLDY. It lists the ID, disambiguated name, and description of each: ID `18` and disambiguated name `mol-0` for MDL MOL, and ID `216` and disambiguated name `mol-1` for MOLDY. The XYZ format, on the other hand, is unambiguous, and only lists the standard extension for it as its disambiguated name (although `xyz-0` will be accepted without error as well).
560
+ This output indicates that the application is aware of two formats which share the `mol` extension: MDL MOL and MOLDY. It lists the ID, disambiguated name, and description of each: ID `18` and disambiguated name `mol-0` for MDL MOL, and ID `216` and disambiguated name `mol-1` for MOLDY. The XYZ format similarly has two variants which can be converted to.
524
561
 
525
562
  The program then lists converters which can handle the requested conversion, revealing a potential pitfall: The Open Babel and c2x converters can convert from MDL MOL to XYZ, which the Atomsk converter can convert from MOLDY to XYZ. If you don't specify which format you're converting from, the script might assume you meant to use the other one, if that's the only one compatible with the converter you've requested (or with the default converter, Open Babel, if you didn't explicitly request one). So to be careful here, it's best to specify this input format unambiguously.
526
563
 
527
564
  Since in this example you have an MDL MOL file, you would use `-f 18` or `-f mol-0` to explicitly specify it in the command-line, or similarly provide one of these to the `from_format` argument of `run_converter` within Python. The application will then properly handle it, including alerting you if you request a conversion that isn't supported by your requested converter (e.g. if you request a conversion of this MDL MOL file to XYZ with Atomsk).
528
565
 
529
- Important note: The disambiguated name is generated dynamically and isn't stored in the database, and in rare cases may change for some formats in future versions of this application which expand support to more formats and conversions. For uses which require forward-compatibility with future versions of this application, the ID should be used instead.
566
+ Important note: The disambiguated name is generated dynamically and isn't stored in the database, and in rare cases may change for some formats in future versions of this application which expand support to more formats and conversions. For uses which require forward-compatibility with future versions of this application, the ID should be used instead. You can obtain the ID for any format via the command: `psdi-data-convert -l -f <format-name>`.
530
567
 
531
568
  #### Other known issues
532
569
 
@@ -534,6 +571,10 @@ Through testing, we've identified some other conversion issues, which we list he
534
571
 
535
572
  - Open Babel will indefinitely hang when attempting to convert large files (more than ~1 MB) of certain types (such as `mmcif`). This is an issue with the converter itself and not our application, which we hope will be fixed in a future version. If this occurs, the job will have to be forcibly terminated. CTRL+C will fail to terminate it, but it can be stopped with CTRL+Z, then terminated with `kill %N`, where N is the number listed beside the job when it is stopped (usually 1). The conversion should then be attempted with another supported converter.
536
573
 
574
+ ## Feedback
575
+
576
+ To report a missing format or conversion, please use [the form on the public web service](https://data-conversion.psdi.ac.uk/report.htm). Other feedback can be submitted on [the feedback page](https://data-conversion.psdi.ac.uk/static/content/feedback.htm).
577
+
537
578
  ## Licensing
538
579
 
539
580
  This project is provided under the Apache License version 2.0, the terms of which can be found in the file `LICENSE`.
@@ -10,7 +10,7 @@ from argparse import ArgumentParser
10
10
  from psdi_data_conversion import constants as const
11
11
  from psdi_data_conversion.gui.env import update_env
12
12
  from psdi_data_conversion.gui.setup import get_app, limit_upload_size, start_app
13
- from psdi_data_conversion.main import print_wrap
13
+ from psdi_data_conversion.utils import print_wrap
14
14
 
15
15
  app = get_app()
16
16
 
@@ -20,6 +20,7 @@ from typing import Any
20
20
  from psdi_data_conversion import constants as const
21
21
  from psdi_data_conversion import log_utility
22
22
  from psdi_data_conversion.dist import bin_exists, get_bin_path, get_dist
23
+ from psdi_data_conversion.file_io import get_package_path
23
24
  from psdi_data_conversion.security import SAFE_STRING_RE, string_is_safe
24
25
 
25
26
  try:
@@ -744,7 +745,9 @@ class ScriptFileConverter(FileConverter):
744
745
  if self.required_bin is not None:
745
746
  env["BIN_PATH"] = get_bin_path(self.required_bin)
746
747
 
747
- process = subprocess.run(['sh', f'psdi_data_conversion/scripts/{self.script}', *self._get_script_args()],
748
+ script_abs_path = os.path.join(get_package_path(), "scripts", self.script)
749
+
750
+ process = subprocess.run(['sh', script_abs_path, *self._get_script_args()],
748
751
  env=env, capture_output=True, text=True)
749
752
 
750
753
  self.out = process.stdout
@@ -12,6 +12,7 @@ from openbabel import openbabel
12
12
 
13
13
  from psdi_data_conversion.converters.base import FileConverter, FileConverterInputException
14
14
  from psdi_data_conversion.security import SAFE_STRING_RE, string_is_safe
15
+ from psdi_data_conversion.utils import print_wrap
15
16
 
16
17
  CONVERTER_OB = 'Open Babel'
17
18
 
@@ -83,30 +84,34 @@ class OBFileConverter(FileConverter):
83
84
  `run_converter()` through providing a dict to the `data` kwarg. The supported keys and values are:
84
85
 
85
86
  "from_flags": str
86
- String of concatenated one-letter flags for how to read the input file. To list the flags supported for a given
87
- input format, call ``psdi-data-convert -l -f <format> -w Open Babel`` at the command-line and look for the
88
- "Allowed input flags" section, if one exists, or alternatively call the library function
87
+ String of concatenated one-letter flags for how to write the output file, e.g. ``"from_flags": "xyz"`` will set
88
+ flags x, y and z. To list the flags supported for a given output format, call
89
+ ``psdi-data-convert -l -f <format> -w Open Babel`` at the command-line and look for the "Allowed input flags"
90
+ section, if one exists, or alternatively call the library function
89
91
  ``psdi_data_conversion.database.get_in_format_args("Open Babel", <format>)`` from within Python code.
90
92
 
91
93
  "to_flags": str
92
- String of concatenated one-letter flags for how to write the output file. To list the flags supported for a
93
- given output format, call ``psdi-data-convert -l -f <format> -w Open Babel`` at the command-line and look for
94
- the "Allowed output flags" section, if one exists, or alternatively call the library function
94
+ String of concatenated one-letter flags for how to write the output file, e.g. ``"to_flags": "xyz"`` will set
95
+ flags x, y and z. To list the flags supported for a given output format, call
96
+ ``psdi-data-convert -l -t <format> -w Open Babel`` at the command-line and look for the "Allowed output flags"
97
+ section, if one exists, or alternatively call the library function
95
98
  ``psdi_data_conversion.database.get_out_format_args("Open Babel", <format>)`` from within Python code.
96
99
 
97
100
  "from_options": str
98
101
  String of space-separated options for how to read the input file. Each option "word" in this string should start
99
- with the letter indicating which option is being used, followed by the value for that option. To list the
102
+ with the letter indicating which option is being used, followed by the value for that option. E.g.
103
+ ``"from_options": "a1 b2"`` will set the value 1 for option a and the value 2 for option b. To list the
100
104
  options supported for a given input format, call ``psdi-data-convert -l -f <format> -w Open Babel`` at the
101
105
  command-line and look for the "Allowed input options" section, if one exists, or alternatively call the library
102
106
  function ``psdi_data_conversion.database.get_in_format_args("Open Babel", <format>)`` from within Python code.
103
107
 
104
108
  "to_options": str
105
109
  String of space-separated options for how to write the output file. Each option "word" in this string should
106
- start with the letter indicating which option is being used, followed by the value for that option. To list the
110
+ start with the letter indicating which option is being used, followed by the value for that option. E.g.
111
+ ``"to_options": "a1 b2"`` will set the value 1 for option a and the value 2 for option b. To list the
107
112
  options supported for a given output format, call ``psdi-data-convert -l -t <format> -w Open Babel`` at the
108
113
  command-line and look for the "Allowed output options" section, if one exists, or alternatively call the library
109
- function ``psdi_data_conversion.database.get_out_format_args("Open Babel", <format>)`` from within Python code.
114
+ function ``psdi_data_conversion.database.get_in_format_args("Open Babel", <format>)`` from within Python code.
110
115
 
111
116
  "coordinates": str
112
117
  One of "Gen2D", "Gen3D", or "neither", specifying how positional coordinates should be generated in the output
@@ -159,13 +164,28 @@ class OBFileConverter(FileConverter):
159
164
  from_args = self.data.get("from_args", "")
160
165
  to_args = self.data.get("to_args", "")
161
166
 
167
+ from psdi_data_conversion.database import (FileConverterDatabaseException, get_in_format_args,
168
+ get_out_format_args)
169
+
162
170
  # Add option flags and arguments as appropriate
163
171
  for char in from_flags:
164
172
  check_string_security(char)
173
+ # Check that the flag is valid
174
+ try:
175
+ get_in_format_args(self.name, self.from_format_info, char)
176
+ except FileConverterDatabaseException:
177
+ print_wrap(f"WARNING: Input format flag '{char}' not recognised for conversion with {self.name}. "
178
+ "If this is valid, the database should be updated to indicate this.", err=True)
165
179
  ob_conversion.AddOption(char, ob_conversion.INOPTIONS)
166
180
 
167
181
  for char in to_flags:
168
182
  check_string_security(char)
183
+ # Check that the flag is valid
184
+ try:
185
+ get_out_format_args(self.name, self.from_format_info, char)
186
+ except FileConverterDatabaseException:
187
+ print_wrap(f"WARNING: Output format flag '{char}' not recognised for conversion with {self.name}. "
188
+ "If this is valid, the database should be updated to indicate this", err=True)
169
189
  ob_conversion.AddOption(char, ob_conversion.OUTOPTIONS)
170
190
 
171
191
  self.data["read_flags_args"] = []
@@ -176,37 +196,82 @@ class OBFileConverter(FileConverter):
176
196
  if "from_options" in self.data:
177
197
  # From options were provided by the command-line script or library
178
198
  l_from_options = self.data["from_options"].split()
199
+
179
200
  for opt in l_from_options:
180
201
  option, value = get_option_and_value(opt)
202
+
203
+ # Check that the option is valid
204
+ try:
205
+ get_in_format_args(self.name, self.from_format_info, option)
206
+ except FileConverterDatabaseException:
207
+ print_wrap(f"WARNING: Input format option '{option}' not recognised for conversion with "
208
+ f"{self.name}. If this is valid, the database should be updated to indicate "
209
+ "this", err=True)
210
+
181
211
  ob_conversion.AddOption(option, ob_conversion.INOPTIONS, value)
212
+
182
213
  self.logger.debug(f"Set Open Babel read flags arguments to: {self.data['from_options']}")
183
214
  # Store the options in the "read_flags_args" entry for the later logging
184
215
  self.data["read_flags_args"] = l_from_options
216
+
185
217
  else:
186
218
  # From options were provided by the command-line script or library
187
219
  for char in from_arg_flags:
220
+
188
221
  index = from_args.find('£')
189
222
  arg, from_args = from_args[0:index], from_args[index + 1:len(from_args)]
190
223
  check_string_security(char), check_string_security(arg)
224
+
225
+ # Check that the option is valid
226
+ try:
227
+ get_in_format_args(self.name, self.from_format_info, arg)
228
+ except FileConverterDatabaseException:
229
+ print_wrap(f"WARNING: Input format option '{arg}' not recognised for conversion with "
230
+ f"{self.name}. If this is valid, the database should be updated to indicate "
231
+ "this.", err=True)
232
+
191
233
  ob_conversion.AddOption(char, ob_conversion.INOPTIONS, arg)
192
234
  self.data["read_flags_args"].append(char + " " + arg)
235
+
193
236
  self.logger.debug(f"Set Open Babel read flags arguments to: {self.data['read_flags_args']}")
194
237
 
195
238
  if "to_options" in self.data:
196
239
  # From options were provided by the command-line script or library
197
240
  l_to_options = self.data["to_options"].split()
241
+
198
242
  for opt in l_to_options:
199
243
  option, value = get_option_and_value(opt)
244
+
245
+ # Check that the option is valid
246
+ try:
247
+ get_in_format_args(self.name, self.to_format_info, option)
248
+ except FileConverterDatabaseException:
249
+ print_wrap(f"WARNING: Output format option '{option}' not recognised for conversion with "
250
+ f"{self.name}. If this is valid, the database should be updated to indicate "
251
+ "this.", err=True)
252
+
200
253
  ob_conversion.AddOption(option, ob_conversion.OUTOPTIONS, value)
254
+
201
255
  self.logger.debug(f"Set Open Babel write flags arguments to: {self.data['to_options']}")
202
256
  # Store the options in the "write_flags_args" entry for the later logging
203
257
  self.data["write_flags_args"] = l_to_options
258
+
204
259
  else:
205
- # From options were provided by the command-line script or library
260
+ # To options were provided by the command-line script or library
206
261
  for char in to_arg_flags:
262
+
207
263
  index = to_args.find('£')
208
264
  arg, to_args = to_args[0:index], to_args[index + 1:len(to_args)]
209
265
  check_string_security(char), check_string_security(arg)
266
+
267
+ # Check that the option is valid
268
+ try:
269
+ get_out_format_args(self.name, self.to_format_info, arg)
270
+ except FileConverterDatabaseException:
271
+ print_wrap(f"WARNING: Output format option '{arg}' not recognised for conversion with "
272
+ f"{self.name}. If this is valid, the database should be updated to indicate "
273
+ "this.", err=True)
274
+
210
275
  ob_conversion.AddOption(char, ob_conversion.OUTOPTIONS, arg)
211
276
  self.data["write_flags_args"].append(char + " " + arg)
212
277
  self.logger.debug(f"Set Open Babel write flags arguments to: {self.data['read_flags_args']}")
@@ -239,6 +304,12 @@ class OBFileConverter(FileConverter):
239
304
  if "Open Babel Error" in self.err:
240
305
  self._abort_from_err()
241
306
 
307
+ # Check for any non-critical errors and print them out
308
+ l_err_blocks = self.err.split("\n\n")
309
+ for err_block in l_err_blocks:
310
+ if err_block.startswith("ERROR:") or err_block.startswith("WARNING:"):
311
+ print_wrap(err_block, err=True)
312
+
242
313
  def _create_message(self) -> str:
243
314
  """Overload method to create a log of options passed to the converter
244
315
  """
@@ -248,7 +319,7 @@ class OBFileConverter(FileConverter):
248
319
  label_length = 19
249
320
 
250
321
  for (label, key, multi) in (("Coord. gen.:", COORD_GEN_KEY, False),
251
- ("Coord. option:", "coord_option", False),
322
+ ("Coord. option:", COORD_GEN_QUAL_KEY, False),
252
323
  ("Read options:", "from_flags", False),
253
324
  ("Write options:", "to_flags", False),
254
325
  ("Read opts + args:", "read_flags_args", True),
@@ -24,6 +24,7 @@ from psdi_data_conversion import constants as const
24
24
  from psdi_data_conversion.converter import (L_REGISTERED_CONVERTERS, L_SUPPORTED_CONVERTERS,
25
25
  get_registered_converter_class)
26
26
  from psdi_data_conversion.converters.base import FileConverter, FileConverterException
27
+ from psdi_data_conversion.file_io import get_package_path
27
28
  from psdi_data_conversion.utils import regularize_name
28
29
 
29
30
  # Keys for top-level and general items in the database
@@ -1206,10 +1207,7 @@ def get_database_path() -> str:
1206
1207
  str
1207
1208
  """
1208
1209
 
1209
- # For an interactive shell, __file__ won't be defined for this module, so use the constants module instead
1210
- reference_file = os.path.realpath(const.__file__)
1211
-
1212
- qualified_database_filename = os.path.join(os.path.dirname(reference_file), const.DATABASE_FILENAME)
1210
+ qualified_database_filename = os.path.join(get_package_path(), const.DATABASE_FILENAME)
1213
1211
 
1214
1212
  return qualified_database_filename
1215
1213
 
@@ -1432,11 +1430,14 @@ def disambiguate_formats(converter_name: str,
1432
1430
  raise FileConverterDatabaseException(f"Conversion from {in_format} to {out_format} with converter "
1433
1431
  f"{converter_name} is not supported", help=True)
1434
1432
  else:
1435
- msg = (f"Conversion from {in_format} to {out_format} with converter {converter_name} is ambiguous.\n"
1436
- "Possible matching conversions are:\n")
1433
+ msg = (f"Conversion from {in_format} to {out_format} with converter {converter_name} is ambiguous. Please "
1434
+ "Use the ID or disambiguated name (listed below) of the desired conversion. Possible matching "
1435
+ "conversions are:\n")
1437
1436
  for _, possible_in_format, possible_out_format in l_possible_conversions:
1438
- msg += (f"{possible_in_format.disambiguated_name} ({possible_in_format.note}) to "
1439
- f"{possible_out_format.disambiguated_name} ({possible_out_format.note})\n")
1437
+ msg += (f" {possible_in_format.id}: {possible_in_format.disambiguated_name} "
1438
+ f"({possible_in_format.note}) to "
1439
+ f"{possible_out_format.id}: {possible_out_format.disambiguated_name} "
1440
+ f"({possible_out_format.note})\n")
1440
1441
  # Trim the final newline from the message
1441
1442
  msg = msg[:-1]
1442
1443
  raise FileConverterDatabaseException(msg, help=True)
@@ -9,7 +9,7 @@ import os
9
9
  import shutil
10
10
  import sys
11
11
 
12
- import psdi_data_conversion
12
+ from psdi_data_conversion.file_io import get_package_path
13
13
 
14
14
  # Labels for each platform (which we use for the folder in this project), and the head of the name each platform will
15
15
  # have in `sys.platform`
@@ -29,7 +29,7 @@ D_DIST_NAME_HEADS = {LINUX_LABEL: LINUX_NAME_HEAD,
29
29
 
30
30
 
31
31
  # Determine the fully-qualified binary directory when this module is first imported
32
- BIN_DIR: str = os.path.join(psdi_data_conversion.__path__[0], "bin")
32
+ BIN_DIR: str = os.path.join(get_package_path(), "bin")
33
33
 
34
34
 
35
35
  def get_dist():
@@ -7,12 +7,30 @@ Functions and classes related to general filesystem input/output
7
7
 
8
8
  import glob
9
9
  import os
10
+ from functools import lru_cache
10
11
  from shutil import copyfile, make_archive, unpack_archive
11
12
  from tempfile import TemporaryDirectory
12
13
 
13
14
  from psdi_data_conversion import constants as const
14
15
 
15
16
 
17
+ @lru_cache(maxsize=1)
18
+ def get_package_path() -> str:
19
+ """Gets the absolute path to where the `psdi_data_conversion` package is on disk
20
+
21
+ Returns
22
+ -------
23
+ str
24
+ """
25
+
26
+ # For an interactive shell, __file__ won't be defined for this module, so use the constants module instead
27
+ reference_file = os.path.realpath(const.__file__)
28
+
29
+ package_path = os.path.dirname(reference_file)
30
+
31
+ return package_path
32
+
33
+
16
34
  def is_archive(filename: str) -> bool:
17
35
  """Uses a file's extension to check if it's an archive or not
18
36
  """