finalcif 178__tar.gz → 180__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 (200) hide show
  1. {finalcif-178 → finalcif-180}/.run/compile_ui_files.run.xml +3 -2
  2. finalcif-180/.run/finalcif_start.run.xml +28 -0
  3. {finalcif-178 → finalcif-180}/PKG-INFO +8 -8
  4. finalcif-180/finalcif/__init__.py +3 -0
  5. {finalcif-178 → finalcif-180}/finalcif/appwindow.py +10 -4
  6. {finalcif-178 → finalcif-180}/finalcif/cif/checkcif/checkcif.py +52 -7
  7. {finalcif-178 → finalcif-180}/finalcif/cif/hkl.py +31 -28
  8. {finalcif-178 → finalcif-180}/finalcif/equip_property/author_loop_templates.py +33 -13
  9. {finalcif-178 → finalcif-180}/pyproject.toml +7 -7
  10. {finalcif-178 → finalcif-180}/uv.lock +355 -252
  11. finalcif-178/finalcif/__init__.py +0 -3
  12. finalcif-178/run_and_capture.py +0 -30
  13. {finalcif-178 → finalcif-180}/.gitattributes +0 -0
  14. {finalcif-178 → finalcif-180}/.githooks/pre-push +0 -0
  15. {finalcif-178 → finalcif-180}/.gitignore +0 -0
  16. {finalcif-178 → finalcif-180}/.python-version +0 -0
  17. {finalcif-178 → finalcif-180}/.ruff.toml +0 -0
  18. {finalcif-178 → finalcif-180}/.run/Make Documentation MAC.run.xml +0 -0
  19. {finalcif-178 → finalcif-180}/.run/make documentation Windows.run.xml +0 -0
  20. {finalcif-178 → finalcif-180}/AGENTS.md +0 -0
  21. {finalcif-178 → finalcif-180}/CODE_OF_CONDUCT.md +0 -0
  22. {finalcif-178 → finalcif-180}/CONTRIBUTING.md +0 -0
  23. {finalcif-178 → finalcif-180}/Finalcif_installer_win.spec +0 -0
  24. {finalcif-178 → finalcif-180}/Finalcif_linux_onefile.spec +0 -0
  25. {finalcif-178 → finalcif-180}/Finalcif_mac.spec +0 -0
  26. {finalcif-178 → finalcif-180}/LICENSE.md +0 -0
  27. {finalcif-178 → finalcif-180}/README.md +0 -0
  28. {finalcif-178 → finalcif-180}/finalcif/app_path.py +0 -0
  29. {finalcif-178 → finalcif-180}/finalcif/cif/__init__.py +0 -0
  30. {finalcif-178 → finalcif-180}/finalcif/cif/all_cif_dicts.py +0 -0
  31. {finalcif-178 → finalcif-180}/finalcif/cif/atoms.py +0 -0
  32. {finalcif-178 → finalcif-180}/finalcif/cif/checkcif/__init__.py +0 -0
  33. {finalcif-178 → finalcif-180}/finalcif/cif/cif_dict_foo.py +0 -0
  34. {finalcif-178 → finalcif-180}/finalcif/cif/cif_file_io.py +0 -0
  35. {finalcif-178 → finalcif-180}/finalcif/cif/cif_keyword_mapping.py +0 -0
  36. {finalcif-178 → finalcif-180}/finalcif/cif/cif_order.py +0 -0
  37. {finalcif-178 → finalcif-180}/finalcif/cif/cod/__init__.py +0 -0
  38. {finalcif-178 → finalcif-180}/finalcif/cif/cod/deposit.py +0 -0
  39. {finalcif-178 → finalcif-180}/finalcif/cif/cod/deposit_check.py +0 -0
  40. {finalcif-178 → finalcif-180}/finalcif/cif/cod/deposition_list.py +0 -0
  41. {finalcif-178 → finalcif-180}/finalcif/cif/cod/doi.py +0 -0
  42. {finalcif-178 → finalcif-180}/finalcif/cif/cod/upload.py +0 -0
  43. {finalcif-178 → finalcif-180}/finalcif/cif/cod/website_parser.py +0 -0
  44. {finalcif-178 → finalcif-180}/finalcif/cif/core_dict.py +0 -0
  45. {finalcif-178 → finalcif-180}/finalcif/cif/modulation_dict.py +0 -0
  46. {finalcif-178 → finalcif-180}/finalcif/cif/powder_dict.py +0 -0
  47. {finalcif-178 → finalcif-180}/finalcif/cif/reference.py +0 -0
  48. {finalcif-178 → finalcif-180}/finalcif/cif/restraints_dict.py +0 -0
  49. {finalcif-178 → finalcif-180}/finalcif/cif/text.py +0 -0
  50. {finalcif-178 → finalcif-180}/finalcif/cif/twin_dict.py +0 -0
  51. {finalcif-178 → finalcif-180}/finalcif/cif/vrf_entry.py +0 -0
  52. {finalcif-178 → finalcif-180}/finalcif/ciforder/__init__.py +0 -0
  53. {finalcif-178 → finalcif-180}/finalcif/ciforder/order.py +0 -0
  54. {finalcif-178 → finalcif-180}/finalcif/ciforder/order_ui.py +0 -0
  55. {finalcif-178 → finalcif-180}/finalcif/ciforder/order_ui.ui +0 -0
  56. {finalcif-178 → finalcif-180}/finalcif/datafiles/__init__.py +0 -0
  57. {finalcif-178 → finalcif-180}/finalcif/datafiles/bruker_data.py +0 -0
  58. {finalcif-178 → finalcif-180}/finalcif/datafiles/bruker_frame.py +0 -0
  59. {finalcif-178 → finalcif-180}/finalcif/datafiles/ccdc_mail.py +0 -0
  60. {finalcif-178 → finalcif-180}/finalcif/datafiles/data.py +0 -0
  61. {finalcif-178 → finalcif-180}/finalcif/datafiles/p4p_reader.py +0 -0
  62. {finalcif-178 → finalcif-180}/finalcif/datafiles/sadabs.py +0 -0
  63. {finalcif-178 → finalcif-180}/finalcif/datafiles/saint.py +0 -0
  64. {finalcif-178 → finalcif-180}/finalcif/datafiles/shelx_lst.py +0 -0
  65. {finalcif-178 → finalcif-180}/finalcif/datafiles/utils.py +0 -0
  66. {finalcif-178 → finalcif-180}/finalcif/equip_property/__init__.py +0 -0
  67. {finalcif-178 → finalcif-180}/finalcif/equip_property/equipment.py +0 -0
  68. {finalcif-178 → finalcif-180}/finalcif/equip_property/properties.py +0 -0
  69. {finalcif-178 → finalcif-180}/finalcif/equip_property/tools.py +0 -0
  70. {finalcif-178 → finalcif-180}/finalcif/finalcif_start.py +0 -0
  71. {finalcif-178 → finalcif-180}/finalcif/gui/__init__.py +0 -0
  72. {finalcif-178 → finalcif-180}/finalcif/gui/block_combobox.py +0 -0
  73. {finalcif-178 → finalcif-180}/finalcif/gui/checkcif_browser.py +0 -0
  74. {finalcif-178 → finalcif-180}/finalcif/gui/cif_table_model.py +0 -0
  75. {finalcif-178 → finalcif-180}/finalcif/gui/cif_table_view.py +0 -0
  76. {finalcif-178 → finalcif-180}/finalcif/gui/combobox.py +0 -0
  77. {finalcif-178 → finalcif-180}/finalcif/gui/custom_classes.py +0 -0
  78. {finalcif-178 → finalcif-180}/finalcif/gui/dialogs.py +0 -0
  79. {finalcif-178 → finalcif-180}/finalcif/gui/edit_button.py +0 -0
  80. {finalcif-178 → finalcif-180}/finalcif/gui/equipmenttable.py +0 -0
  81. {finalcif-178 → finalcif-180}/finalcif/gui/file_editor.py +0 -0
  82. {finalcif-178 → finalcif-180}/finalcif/gui/finalcif_gui_ui.py +0 -0
  83. {finalcif-178 → finalcif-180}/finalcif/gui/finalcif_gui_ui.ui +0 -0
  84. {finalcif-178 → finalcif-180}/finalcif/gui/import_selector.py +0 -0
  85. {finalcif-178 → finalcif-180}/finalcif/gui/import_selector_ui.py +0 -0
  86. {finalcif-178 → finalcif-180}/finalcif/gui/import_selector_ui.ui +0 -0
  87. {finalcif-178 → finalcif-180}/finalcif/gui/loop_creator.py +0 -0
  88. {finalcif-178 → finalcif-180}/finalcif/gui/loop_creator_ui.py +0 -0
  89. {finalcif-178 → finalcif-180}/finalcif/gui/loop_creator_ui.ui +0 -0
  90. {finalcif-178 → finalcif-180}/finalcif/gui/loops.py +0 -0
  91. {finalcif-178 → finalcif-180}/finalcif/gui/mainstackwidget.py +0 -0
  92. {finalcif-178 → finalcif-180}/finalcif/gui/mixins.py +0 -0
  93. {finalcif-178 → finalcif-180}/finalcif/gui/new_key_dialog.py +0 -0
  94. {finalcif-178 → finalcif-180}/finalcif/gui/new_key_dialog_ui.py +0 -0
  95. {finalcif-178 → finalcif-180}/finalcif/gui/new_key_dialog_ui.ui +0 -0
  96. {finalcif-178 → finalcif-180}/finalcif/gui/plaintextedit.py +0 -0
  97. {finalcif-178 → finalcif-180}/finalcif/gui/playground.py +0 -0
  98. {finalcif-178 → finalcif-180}/finalcif/gui/propertytable.py +0 -0
  99. {finalcif-178 → finalcif-180}/finalcif/gui/shelx_navigation.py +0 -0
  100. {finalcif-178 → finalcif-180}/finalcif/gui/single_line_textedit.py +0 -0
  101. {finalcif-178 → finalcif-180}/finalcif/gui/spell_check_edit.py +0 -0
  102. {finalcif-178 → finalcif-180}/finalcif/gui/squeeze_dialog.py +0 -0
  103. {finalcif-178 → finalcif-180}/finalcif/gui/syntax_highlighter.py +0 -0
  104. {finalcif-178 → finalcif-180}/finalcif/gui/text_templates_ui.py +0 -0
  105. {finalcif-178 → finalcif-180}/finalcif/gui/text_templates_ui.ui +0 -0
  106. {finalcif-178 → finalcif-180}/finalcif/gui/text_value_editor.py +0 -0
  107. {finalcif-178 → finalcif-180}/finalcif/gui/timers.py +0 -0
  108. {finalcif-178 → finalcif-180}/finalcif/gui/validators.py +0 -0
  109. {finalcif-178 → finalcif-180}/finalcif/gui/vrf_classes.py +0 -0
  110. {finalcif-178 → finalcif-180}/finalcif/gui/vzs_viewer.py +0 -0
  111. {finalcif-178 → finalcif-180}/finalcif/icon/__init__.py +0 -0
  112. {finalcif-178 → finalcif-180}/finalcif/icon/finalcif.png +0 -0
  113. {finalcif-178 → finalcif-180}/finalcif/icon/finalcif2.ico +0 -0
  114. {finalcif-178 → finalcif-180}/finalcif/icon/finalcif2.png +0 -0
  115. {finalcif-178 → finalcif-180}/finalcif/icon/multitable.ico +0 -0
  116. {finalcif-178 → finalcif-180}/finalcif/icon/multitable.png +0 -0
  117. {finalcif-178 → finalcif-180}/finalcif/icon/multitable.xcf +0 -0
  118. {finalcif-178 → finalcif-180}/finalcif/report/__init__.py +0 -0
  119. {finalcif-178 → finalcif-180}/finalcif/report/archive_report.py +0 -0
  120. {finalcif-178 → finalcif-180}/finalcif/report/gui/__init__.py +0 -0
  121. {finalcif-178 → finalcif-180}/finalcif/report/gui/mainwindow.py +0 -0
  122. {finalcif-178 → finalcif-180}/finalcif/report/gui/mainwindow.ui +0 -0
  123. {finalcif-178 → finalcif-180}/finalcif/report/references.py +0 -0
  124. {finalcif-178 → finalcif-180}/finalcif/report/report_text.py +0 -0
  125. {finalcif-178 → finalcif-180}/finalcif/report/symm.py +0 -0
  126. {finalcif-178 → finalcif-180}/finalcif/report/templated_report.py +0 -0
  127. {finalcif-178 → finalcif-180}/finalcif/template/__init__.py +0 -0
  128. {finalcif-178 → finalcif-180}/finalcif/template/bootstrap/bootstrap.min.css +0 -0
  129. {finalcif-178 → finalcif-180}/finalcif/template/machines/D8_VENTURE.cif +0 -0
  130. {finalcif-178 → finalcif-180}/finalcif/template/mathml2omml.xsl +0 -0
  131. {finalcif-178 → finalcif-180}/finalcif/template/miew/LICENSES +0 -0
  132. {finalcif-178 → finalcif-180}/finalcif/template/miew/Miew.css +0 -0
  133. {finalcif-178 → finalcif-180}/finalcif/template/miew/Miew.min.js +0 -0
  134. {finalcif-178 → finalcif-180}/finalcif/template/miew/lodash.min.js +0 -0
  135. {finalcif-178 → finalcif-180}/finalcif/template/miew/three.js +0 -0
  136. {finalcif-178 → finalcif-180}/finalcif/template/report.tex +0 -0
  137. {finalcif-178 → finalcif-180}/finalcif/template/report.tmpl +0 -0
  138. {finalcif-178 → finalcif-180}/finalcif/template/report2.tex +0 -0
  139. {finalcif-178 → finalcif-180}/finalcif/template/report_default.docx +0 -0
  140. {finalcif-178 → finalcif-180}/finalcif/template/report_fastmolwidget.tmpl +0 -0
  141. {finalcif-178 → finalcif-180}/finalcif/template/template1.docx +0 -0
  142. {finalcif-178 → finalcif-180}/finalcif/template/template_for_multitable.docx +0 -0
  143. {finalcif-178 → finalcif-180}/finalcif/template/template_text.docx +0 -0
  144. {finalcif-178 → finalcif-180}/finalcif/template/template_without_text.docx +0 -0
  145. {finalcif-178 → finalcif-180}/finalcif/template/templates.py +0 -0
  146. {finalcif-178 → finalcif-180}/finalcif/template/unicode2latex/FakePlasTeX/FakeContext.py +0 -0
  147. {finalcif-178 → finalcif-180}/finalcif/template/unicode2latex/FakePlasTeX/FakeTokenizer.py +0 -0
  148. {finalcif-178 → finalcif-180}/finalcif/template/unicode2latex/FakePlasTeX/README.md +0 -0
  149. {finalcif-178 → finalcif-180}/finalcif/template/unicode2latex/FakePlasTeX/TokenizerPassThru.py +0 -0
  150. {finalcif-178 → finalcif-180}/finalcif/template/unicode2latex/LICENSE +0 -0
  151. {finalcif-178 → finalcif-180}/finalcif/template/unicode2latex/__init__.py +0 -0
  152. {finalcif-178 → finalcif-180}/finalcif/template/unicode2latex/u2l.py +0 -0
  153. {finalcif-178 → finalcif-180}/finalcif/template/unicode2latex/unicode-math-table.tex +0 -0
  154. {finalcif-178 → finalcif-180}/finalcif/template/unicode2latex/unicode-math-xetex.sty +0 -0
  155. {finalcif-178 → finalcif-180}/finalcif/template/xsl/convert.py +0 -0
  156. {finalcif-178 → finalcif-180}/finalcif/template/xsl/xmltohtml.xsl +0 -0
  157. {finalcif-178 → finalcif-180}/finalcif/template/xsl/xmltolatex.xsl +0 -0
  158. {finalcif-178 → finalcif-180}/finalcif/tools/__init__.py +0 -0
  159. {finalcif-178 → finalcif-180}/finalcif/tools/chemparse.py +0 -0
  160. {finalcif-178 → finalcif-180}/finalcif/tools/download.py +0 -0
  161. {finalcif-178 → finalcif-180}/finalcif/tools/dsrmath.py +0 -0
  162. {finalcif-178 → finalcif-180}/finalcif/tools/formal_charge.py +0 -0
  163. {finalcif-178 → finalcif-180}/finalcif/tools/misc.py +0 -0
  164. {finalcif-178 → finalcif-180}/finalcif/tools/mol_file_writer.py +0 -0
  165. {finalcif-178 → finalcif-180}/finalcif/tools/options.py +0 -0
  166. {finalcif-178 → finalcif-180}/finalcif/tools/platon.py +0 -0
  167. {finalcif-178 → finalcif-180}/finalcif/tools/pupdate.py +0 -0
  168. {finalcif-178 → finalcif-180}/finalcif/tools/selfupdate.py +0 -0
  169. {finalcif-178 → finalcif-180}/finalcif/tools/settings.py +0 -0
  170. {finalcif-178 → finalcif-180}/finalcif/tools/shred.py +0 -0
  171. {finalcif-178 → finalcif-180}/finalcif/tools/solvents.py +0 -0
  172. {finalcif-178 → finalcif-180}/finalcif/tools/space_groups.py +0 -0
  173. {finalcif-178 → finalcif-180}/finalcif/tools/spgr_format.py +0 -0
  174. {finalcif-178 → finalcif-180}/finalcif/tools/squeeze.py +0 -0
  175. {finalcif-178 → finalcif-180}/finalcif/tools/statusbar.py +0 -0
  176. {finalcif-178 → finalcif-180}/finalcif/tools/sumformula.py +0 -0
  177. {finalcif-178 → finalcif-180}/finalcif/tools/z_from_packing.py +0 -0
  178. {finalcif-178 → finalcif-180}/finalcif.exe +0 -0
  179. {finalcif-178 → finalcif-180}/githooks/pre-push +0 -0
  180. {finalcif-178 → finalcif-180}/platon/README.txt +0 -0
  181. {finalcif-178 → finalcif-180}/platon/compile_platon.bat +0 -0
  182. {finalcif-178 → finalcif-180}/platon/platon_special.exe +0 -0
  183. {finalcif-178 → finalcif-180}/platon/platon_special.f +0 -0
  184. {finalcif-178 → finalcif-180}/pylock.toml +0 -0
  185. {finalcif-178 → finalcif-180}/run_finalcif +0 -0
  186. {finalcif-178 → finalcif-180}/run_finalcif.bat +0 -0
  187. {finalcif-178 → finalcif-180}/screenshots/finalcif_checkcif.png +0 -0
  188. {finalcif-178 → finalcif-180}/screenshots/finalcif_details.png +0 -0
  189. {finalcif-178 → finalcif-180}/screenshots/finalcif_loops.png +0 -0
  190. {finalcif-178 → finalcif-180}/screenshots/finalcif_loops2.png +0 -0
  191. {finalcif-178 → finalcif-180}/screenshots/finalcif_main.png +0 -0
  192. {finalcif-178 → finalcif-180}/screenshots/finalcif_report.png +0 -0
  193. {finalcif-178 → finalcif-180}/screenshots/finalcif_responses.png +0 -0
  194. {finalcif-178 → finalcif-180}/screenshots/loops_column_buttons.png +0 -0
  195. {finalcif-178 → finalcif-180}/work/compare_z_platon.py +0 -0
  196. {finalcif-178 → finalcif-180}/work/diagnose_1519506.py +0 -0
  197. {finalcif-178 → finalcif-180}/work/diagnose_z.py +0 -0
  198. {finalcif-178 → finalcif-180}/work/investigate_failures.py +0 -0
  199. {finalcif-178 → finalcif-180}/work/validate_cod.py +0 -0
  200. {finalcif-178 → finalcif-180}/work/validate_zprime.py +0 -0
@@ -8,13 +8,14 @@
8
8
  <env name="PYTHONUNBUFFERED" value="1" />
9
9
  </envs>
10
10
  <option name="SDK_HOME" value="" />
11
- <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
11
+ <option name="SDK_NAME" value="~\Downloads\FinalCif\.venv" />
12
+ <option name="WORKING_DIRECTORY" value="$ContentRoot$" />
12
13
  <option name="IS_MODULE_SDK" value="true" />
13
14
  <option name="ADD_CONTENT_ROOTS" value="true" />
14
15
  <option name="ADD_SOURCE_ROOTS" value="true" />
15
- <option name="DEBUG_JUST_MY_CODE" value="true" />
16
16
  <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
17
17
  <option name="RUN_TOOL" value="false" />
18
+ <option name="RUN_AS_SCRIPT" value="false" />
18
19
  <option name="SCRIPT_NAME" value="scripts/compile_ui_files.py" />
19
20
  <option name="PARAMETERS" value="" />
20
21
  <option name="SHOW_COMMAND_LINE" value="false" />
@@ -0,0 +1,28 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="finalcif_start" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
3
+ <module name="finalcif" />
4
+ <option name="ENV_FILES" value="" />
5
+ <option name="INTERPRETER_OPTIONS" value="" />
6
+ <option name="PARENT_ENVS" value="true" />
7
+ <envs>
8
+ <env name="PYTHONUNBUFFERED" value="1" />
9
+ </envs>
10
+ <option name="SDK_HOME" value="" />
11
+ <option name="SDK_NAME" value="~\Downloads\FinalCif\.venv" />
12
+ <option name="WORKING_DIRECTORY" value="$ContentRoot$/finalcif" />
13
+ <option name="IS_MODULE_SDK" value="true" />
14
+ <option name="ADD_CONTENT_ROOTS" value="true" />
15
+ <option name="ADD_SOURCE_ROOTS" value="true" />
16
+ <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
17
+ <option name="RUN_TOOL" value="true" />
18
+ <option name="RUN_AS_SCRIPT" value="false" />
19
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/finalcif/finalcif_start.py" />
20
+ <option name="PARAMETERS" value="" />
21
+ <option name="SHOW_COMMAND_LINE" value="false" />
22
+ <option name="EMULATE_TERMINAL" value="false" />
23
+ <option name="MODULE_MODE" value="false" />
24
+ <option name="REDIRECT_INPUT" value="false" />
25
+ <option name="INPUT_FILE" value="" />
26
+ <method v="2" />
27
+ </configuration>
28
+ </component>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: finalcif
3
- Version: 178
3
+ Version: 180
4
4
  Summary: CIF file editor
5
5
  Project-URL: Homepage, https://dkratzert.de/finalcif.html
6
6
  Project-URL: Bug Tracker, https://github.com/dkratzert/FinalCif/issues
@@ -12,27 +12,27 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Topic :: Scientific/Engineering :: Chemistry
14
14
  Requires-Python: >=3.12
15
- Requires-Dist: certifi==2026.6.17
15
+ Requires-Dist: certifi==2026.10.23
16
16
  Requires-Dist: chardet
17
17
  Requires-Dist: charset-normalizer
18
- Requires-Dist: docxcompose>=2.2.0
19
- Requires-Dist: docxtpl[subdoc]>=0.20.2
18
+ Requires-Dist: docxcompose==2.2.0
19
+ Requires-Dist: docxtpl[subdoc]==0.20.2
20
20
  Requires-Dist: fastmolwidget>=1.2.0
21
21
  Requires-Dist: gemmi>=0.7.5
22
22
  Requires-Dist: html2text
23
23
  Requires-Dist: lxml>=6.1.1
24
- Requires-Dist: numpy==2.4.6
24
+ Requires-Dist: numpy==2.5.5
25
25
  Requires-Dist: packaging==26.3
26
26
  Requires-Dist: pefile
27
27
  Requires-Dist: pybind11>=3
28
28
  Requires-Dist: pyenchant
29
29
  Requires-Dist: pyside6-essentials
30
30
  Requires-Dist: python-docx
31
- Requires-Dist: qtawesome
32
- Requires-Dist: qtpy
31
+ Requires-Dist: qtawesome==1.4.2
32
+ Requires-Dist: qtpy==2.4.3
33
33
  Requires-Dist: requests
34
34
  Requires-Dist: shelxfile>=24
35
- Requires-Dist: urllib3==2.7.0
35
+ Requires-Dist: urllib3==2.8.0
36
36
  Description-Content-Type: text/markdown
37
37
 
38
38
  ![Latest Release](https://img.shields.io/github/v/tag/dkratzert/FinalCif?label=Release)
@@ -0,0 +1,3 @@
1
+
2
+ VERSION = 180
3
+ __version__ = VERSION
@@ -51,7 +51,7 @@ from finalcif import VERSION
51
51
  from finalcif.app_path import application_path
52
52
  from finalcif.cif.cif_file_io import CifContainer, GemmiError, has_cif2_header
53
53
  from finalcif.cif.cod.deposit import CODdeposit
54
- from finalcif.cif.text import utf8_to_str, quote
54
+ from finalcif.cif.text import utf8_to_str, quote, retranslate_delimiter
55
55
  from finalcif.datafiles.bruker_data import BrukerData
56
56
  from finalcif.datafiles.ccdc_mail import CCDCMail
57
57
  from finalcif.equip_property.author_loop_templates import AuthorLoops
@@ -687,7 +687,7 @@ class AppWindow(QMainWindow):
687
687
  self.textedit.ui.cifKeyLineEdit.setText(loop_column_name)
688
688
  for n in range(i.loop.length()):
689
689
  value = i.loop[n, 0]
690
- text_list.append(gemmi.cif.as_string(value))
690
+ text_list.append(retranslate_delimiter(gemmi.cif.as_string(value)))
691
691
  self.textedit.add_textfields(text_list)
692
692
 
693
693
  def export_text_template(self) -> None:
@@ -1187,6 +1187,9 @@ class AppWindow(QMainWindow):
1187
1187
  def _checkcif_failed(self, txt: str) -> None:
1188
1188
  self.ui.CheckCifLogPlainTextEdit.appendHtml(f'<b>{txt}</b>')
1189
1189
 
1190
+ def _log_checkcif_not_finished(self) -> None:
1191
+ self._checkcif_failed('CheckCIF failed to finish. Please try it at https://checkcif.iucr.org/ instead.')
1192
+
1190
1193
  def _log_checkcif(self, txt: str) -> None:
1191
1194
  self.ui.CheckCifLogPlainTextEdit.appendPlainText(txt)
1192
1195
  app.processEvents()
@@ -1251,8 +1254,7 @@ class AppWindow(QMainWindow):
1251
1254
  parser = MyHTMLParser(self.htmlfile.read_text())
1252
1255
  except FileNotFoundError:
1253
1256
  # happens if checkcif fails, e.g. takes too much time.
1254
- self.ui.CheckCifLogPlainTextEdit.appendHtml('<b>CheckCIF failed to finish. '
1255
- 'Please try it at https://checkcif.iucr.org/ instead.</b>')
1257
+ self._log_checkcif_not_finished()
1256
1258
  return
1257
1259
 
1258
1260
  self.checkcif_browser = CheckCifBrowser(parent=self, checkdef=self.checkdef)
@@ -1408,6 +1410,10 @@ class AppWindow(QMainWindow):
1408
1410
  if self.pdf_htmlfile is None:
1409
1411
  return
1410
1412
  self._resolve_structure_factor_upload(self.pdf_htmlfile)
1413
+ if not self.pdf_htmlfile.exists():
1414
+ self._log_checkcif_not_finished()
1415
+ self.pdf_htmlfile = None
1416
+ return
1411
1417
  self.ckf.show_pdf_report()
1412
1418
  self.ui.CheckCifLogPlainTextEdit.appendPlainText('PDF Checkcif report finished.')
1413
1419
  with suppress(OSError):
@@ -13,6 +13,7 @@ import sys
13
13
  import time
14
14
  from collections.abc import Callable
15
15
  from contextlib import suppress
16
+ from html import escape
16
17
  from html.parser import HTMLParser
17
18
  from pathlib import Path
18
19
  from urllib.parse import urljoin
@@ -22,6 +23,7 @@ from qtpy.QtCore import QThread, Signal
22
23
  from requests import Response
23
24
  from requests.exceptions import MissingSchema
24
25
 
26
+ from finalcif import VERSION
25
27
  from finalcif.cif.cif_file_io import CifContainer
26
28
  from finalcif.cif.vrf_entry import VRFEntry
27
29
  from finalcif.gui.dialogs import show_general_warning
@@ -35,6 +37,10 @@ SUBMIT_WITHOUT_HKL_NAME = 'Qsubmitnow'
35
37
  #: Maximum difference in seconds between the modification time of a CIF file and a
36
38
  #: structure factor file in order to regard them as belonging together.
37
39
  MAX_FCF_TIME_DIFFERENCE = 3600.0
40
+ #: Maximum number of characters of a server error page shown to the user.
41
+ MAX_ERROR_TEXT_LENGTH = 600
42
+ #: Identifies FinalCif honestly to the CheckCIF server.
43
+ REQUEST_HEADERS = {'User-Agent': f'FinalCif/{VERSION} ({sys.platform}; +https://dkratzert.de/finalcif.html)'}
38
44
 
39
45
 
40
46
  class HtmlForm:
@@ -162,7 +168,8 @@ def find_matching_fcf_file(cif_file: Path,
162
168
 
163
169
 
164
170
  def _post_form(form: HtmlForm, base_url: str, files: dict | None = None) -> str:
165
- response = requests.post(form.url(base_url), data=form.payload, files=files, timeout=900)
171
+ response = requests.post(form.url(base_url), data=form.payload, files=files, headers=REQUEST_HEADERS,
172
+ timeout=900)
166
173
  response.raise_for_status()
167
174
  return response.text
168
175
 
@@ -267,10 +274,10 @@ class CheckCif(QThread):
267
274
  t1 = time.perf_counter()
268
275
  self.progress.emit('Report request sent. Please wait...')
269
276
  req = self._do_the_server_request(headers, temp_cif)
270
- if req:
277
+ if req is not None:
271
278
  self.progress.emit('request finished')
272
279
  if req.status_code != 200:
273
- self.failed.emit(f'Request failed with code: {req.status_code!s}')
280
+ self.failed.emit(server_error_message(req))
274
281
  else:
275
282
  t2 = time.perf_counter()
276
283
  time.sleep(0.1)
@@ -286,7 +293,8 @@ class CheckCif(QThread):
286
293
  def _do_the_server_request(self, headers: dict, temp_cif: bytes) -> Response | None:
287
294
  req = None
288
295
  try:
289
- req = requests.post(self.checkcif_url, files={'file': temp_cif}, data=headers, timeout=900)
296
+ req = requests.post(self.checkcif_url, files={'file': temp_cif}, data=headers,
297
+ headers=REQUEST_HEADERS, timeout=900)
290
298
  except requests.exceptions.ReadTimeout:
291
299
  message = r"Checkcif server took too long. Try it at 'https://checkcif.iucr.org' directly."
292
300
  self.failed.emit(message)
@@ -297,6 +305,8 @@ class CheckCif(QThread):
297
305
  message = "The checkcif server is not reachable. Is your network connection working?<br>" \
298
306
  "The server URL might also have changed..."
299
307
  self.failed.emit(message)
308
+ except requests.exceptions.RequestException as e:
309
+ self.failed.emit(f'CheckCIF request failed: {escape(str(e))}')
300
310
  return req
301
311
 
302
312
  def _open_pdf_result(self) -> None:
@@ -339,6 +349,40 @@ def fix_iucr_urls(content: str):
339
349
  return re.sub(r'\s+src\s*=\s*"//', ' src="https://', href)
340
350
 
341
351
 
352
+ class _PageTextParser(HTMLParser):
353
+ """Collects the visible text of an HTML page."""
354
+ _invisible_tags = frozenset({'script', 'style', 'title'})
355
+
356
+ def __init__(self, html: str) -> None:
357
+ super().__init__()
358
+ self._parts: list[str] = []
359
+ self._invisible_depth = 0
360
+ self.feed(html)
361
+
362
+ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None:
363
+ if tag in self._invisible_tags:
364
+ self._invisible_depth += 1
365
+
366
+ def handle_endtag(self, tag: str) -> None:
367
+ if tag in self._invisible_tags and self._invisible_depth:
368
+ self._invisible_depth -= 1
369
+
370
+ def handle_data(self, data: str) -> None:
371
+ if not self._invisible_depth and data.strip():
372
+ self._parts.append(' '.join(data.split()))
373
+
374
+ @property
375
+ def text(self) -> str:
376
+ return ' '.join(self._parts)
377
+
378
+
379
+ def server_error_message(response: Response) -> str:
380
+ """HTML message for a failed CheckCIF request including the explanation of the server."""
381
+ message = f'CheckCIF server answered with HTTP {response.status_code} {response.reason or ""}'.rstrip()
382
+ text = _PageTextParser(response.text).text[:MAX_ERROR_TEXT_LENGTH]
383
+ return f'{message}:<br>{escape(text)}' if text else f'{message}.'
384
+
385
+
342
386
  class MyHTMLParser(HTMLParser):
343
387
  def __init__(self, data):
344
388
  self.pdf_link = ''
@@ -350,7 +394,7 @@ class MyHTMLParser(HTMLParser):
350
394
  self.feed(data)
351
395
 
352
396
  def get_pdf(self) -> bytes | None:
353
- return requests.get(self.pdf_link, timeout=10).content
397
+ return requests.get(self.pdf_link, headers=REQUEST_HEADERS, timeout=10).content
354
398
 
355
399
  def handle_starttag(self, tag: str, attrs: str) -> None:
356
400
  # if tag and tag not in ('font', 'div', 'link', 'meta', 'html', 'table', 'td') and attrs:
@@ -372,7 +416,7 @@ class MyHTMLParser(HTMLParser):
372
416
 
373
417
  def save_image(self, image_file: Path) -> None:
374
418
  try:
375
- image = requests.get(self.imageurl, timeout=10).content
419
+ image = requests.get(self.imageurl, headers=REQUEST_HEADERS, timeout=10).content
376
420
  except MissingSchema:
377
421
  print('debug: Got no image from checkcif server.')
378
422
  image = b''
@@ -381,7 +425,8 @@ class MyHTMLParser(HTMLParser):
381
425
 
382
426
  def get_ckf(self) -> str:
383
427
  try:
384
- return requests.get(self.structure_factor_report, timeout=10).content.decode('latin1', 'ignore')
428
+ return requests.get(self.structure_factor_report, headers=REQUEST_HEADERS,
429
+ timeout=10).content.decode('latin1', 'ignore')
385
430
  except MissingSchema:
386
431
  return ''
387
432
 
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
2
 
3
- import re
4
3
  from collections import namedtuple
5
4
  from collections.abc import Sequence
6
5
  from pathlib import Path
@@ -40,45 +39,36 @@ class HKL:
40
39
  """
41
40
  Adds the hkl data from a SHELX hkl file as local loop.
42
41
  """
43
- hkl_width = self._get_hkl_width()
44
42
  loop_header = ['index_h',
45
43
  'index_k',
46
44
  'index_l',
47
45
  'F_squared_meas' if self.hklf_type != 3 else 'F_meas',
48
46
  'F_squared_sigma' if self.hklf_type != 3 else 'F_sigma',
49
47
  'scale_group_code']
50
- loop: Loop = self.block.init_loop('_refln_', self._trim_header_to_hkl_width(loop_header))
51
- zero_reflection_pattern = re.compile(r'^\s+0\s+0\s+0\s+0.*')
52
- for line in self._hkl_file.splitlines(keepends=False):
53
- splitline = line.split()
54
- if not splitline:
48
+ loop: Loop | None = None
49
+ width = 0
50
+ for line_number, line in enumerate(self._hkl_file.splitlines(keepends=False), start=1):
51
+ row = line.split()
52
+ if not row:
55
53
  continue
56
- # Do not use data after the 0 0 0 reflection
57
- if zero_reflection_pattern.match(line):
58
- # Need to truncate, because some programs add the scale group even if
59
- # there is no scale group in other reflections
60
- loop.add_row(splitline[:hkl_width])
54
+ # Without a 0 0 0 terminator, embedded HKL data may end with CIF metadata:
55
+ if not _is_reflection(row) or len(row) < width:
56
+ print(f'HKL data ends at invalid line {line_number}: {line}')
61
57
  break
62
- try:
63
- loop.add_row(splitline[:len(loop_header)])
64
- # RuntimeError ist from gemmi.cif.add_row:
65
- except (IndexError, RuntimeError):
66
- continue
58
+ if loop is None:
59
+ loop = self.block.init_loop('_refln_', loop_header[:len(row)])
60
+ width = loop.width()
61
+ # Truncate, because some programs add a batch number only to the terminating reflection:
62
+ loop.add_row(row[:width])
63
+ if _is_zero_reflection(row):
64
+ # Data after the 0 0 0 reflection is not part of the hkl file.
65
+ break
66
+ if loop is None:
67
+ raise ValueError('No valid HKL reflections found.')
67
68
 
68
69
  def __repr__(self) -> str:
69
70
  return self.hkl_as_cif[:250]
70
71
 
71
- def _trim_header_to_hkl_width(self, loop_header: list[str]) -> list[str]:
72
- hkl_with = self._get_hkl_width()
73
- trimmed_header = loop_header[:hkl_with]
74
- return trimmed_header
75
-
76
- def _get_hkl_width(self) -> int:
77
- first_lines = self._hkl_file[:150].strip().splitlines(keepends=False)
78
- if len(first_lines) > 1:
79
- return len(first_lines[1].split())
80
- return len(first_lines[0].split())
81
-
82
72
  def get_hkl_min_max(self) -> Limit:
83
73
  hkl: gemmi.ReflnBlock = gemmi.hkl_cif_as_refln_block(self.block)
84
74
  miller = hkl.make_miller_array()
@@ -87,6 +77,19 @@ class HKL:
87
77
  return Limit(h_max=h_max, h_min=h_min, k_max=k_max, k_min=k_min, l_max=l_max, l_min=l_min)
88
78
 
89
79
 
80
+ def _is_reflection(row: list[str]) -> bool:
81
+ """Whether a split hkl line starts with three integer indices, the intensity and its sigma."""
82
+ try:
83
+ int(row[0]), int(row[1]), int(row[2]), float(row[3]), float(row[4])
84
+ except (ValueError, IndexError):
85
+ return False
86
+ return True
87
+
88
+
89
+ def _is_zero_reflection(row: list[str]) -> bool:
90
+ return not (int(row[0]) or int(row[1]) or int(row[2]))
91
+
92
+
90
93
  def calculate_rint(hkl_file: str, space_group: str, *, cell: Sequence[float] | None = None,
91
94
  resolution: tuple[float, float] | None = None, hklf: int = 4,
92
95
  twst: int | None = None) -> float | None:
@@ -7,6 +7,7 @@ from __future__ import annotations
7
7
  # and you think this stuff is worth it, you can buy me a beer in return.
8
8
  # ----------------------------------------------------------------------------
9
9
  import re
10
+ from bisect import bisect
10
11
  from dataclasses import dataclass
11
12
  from enum import Enum
12
13
  from pathlib import Path
@@ -15,15 +16,15 @@ from typing import TYPE_CHECKING
15
16
  import gemmi.cif
16
17
  from qtpy import QtCore
17
18
  from qtpy.QtWidgets import QListWidgetItem, QMenu
18
- from gemmi.cif import Loop, as_string
19
+ from gemmi.cif import as_string
19
20
 
20
21
  from finalcif.cif.cif_file_io import CifContainer
21
22
  from finalcif.cif.text import utf8_to_str, quote, retranslate_delimiter, string_to_utf8
22
23
  from finalcif.equip_property.tools import read_document_from_cif_file
24
+ from finalcif.gui.custom_classes import Column
23
25
  from finalcif.gui.dialogs import cif_file_save_dialog, show_general_warning, cif_file_open_dialog
24
26
  from finalcif.gui.finalcif_gui_ui import Ui_FinalCifWindow
25
27
  from finalcif.gui.timers import single_shot
26
- from finalcif.tools.misc import grouper
27
28
  from finalcif.tools.settings import FinalCifSettings
28
29
 
29
30
  if TYPE_CHECKING:
@@ -151,25 +152,44 @@ class AuthorLoops:
151
152
 
152
153
  def save_author_to_loop(self) -> None:
153
154
  author = self.get_author_info()
154
- row = [author.name, author.address, author.email, author.phone, author.orcid, author.iucr_id, author.footnote]
155
155
  author_loop_tags = self.get_author_loop(author)
156
+ row = [author.name, author.address, author.email, author.phone, author.orcid, author.iucr_id,
157
+ author.footnote][:len(author_loop_tags)]
156
158
  table: gemmi.cif.Table = self.cif.block.find(author_loop_tags)
157
- if table.width():
158
- gemmi_loop: Loop = table.loop
159
- if tuple(row) in list(grouper(gemmi_loop.values, gemmi_loop.width())):
159
+ if author.contact_author and self._any_key_is_pair(author_loop_tags):
160
+ # Contact author items are not loopable in coreCIF, so the existing pairs get overwritten:
161
+ self._set_main_table_values(author_loop_tags, row)
162
+ self.app.status_bar.show_message('Contact author was set in the main table.', 15)
163
+ elif table.width():
164
+ if tuple(row) in [tuple(table_row) for table_row in table]:
160
165
  self.app.status_bar.show_message('This author already exists.', 15)
161
- print('dbg> Author already exists.')
162
166
  return
163
- else:
164
- gemmi_loop = self.cif.init_loop(author_loop_tags)
165
- table = self.cif.block.find(author_loop_tags)
166
- if gemmi_loop.width() < len(row):
167
- row = row[:gemmi_loop.width()]
168
- if row not in table:
167
+ table.ensure_loop()
169
168
  table.append_row(row)
169
+ self._remove_keys_from_main_table(author_loop_tags)
170
+ else:
171
+ self.cif.init_loop(author_loop_tags).add_row(row)
170
172
  self.app.ui.loops_page.make_loops_tables()
171
173
  self.show_authors_list()
172
174
 
175
+ def _any_key_is_pair(self, keys: list[str]) -> bool:
176
+ return any(self.cif.block.find_pair(key) for key in keys)
177
+
178
+ def _set_main_table_values(self, keys: list[str], values: list[str]) -> None:
179
+ main_table = self.app.ui.cif_main_table
180
+ for key, value in zip(keys, values, strict=True):
181
+ if not main_table.has_key(key):
182
+ self.app.add_row(key, '?', position=bisect(main_table.model().vheaderitems, key))
183
+ text = retranslate_delimiter(as_string(value)) or '?'
184
+ main_table.setText(key=key, column=Column.EDIT, txt=text)
185
+
186
+ def _remove_keys_from_main_table(self, keys: list[str]) -> None:
187
+ """Removes rows of keys that were converted from pairs into a loop."""
188
+ main_table = self.app.ui.cif_main_table
189
+ for key in keys:
190
+ if main_table.has_key(key):
191
+ main_table.delete_row(main_table.row_from_key(key))
192
+
173
193
  def get_author_info(self) -> Author:
174
194
  if self.ui.authorEditTabWidget.currentWidget().objectName() == 'page_publication':
175
195
  name = quote(utf8_to_str(self.ui.FullNameLineEdit.text()))
@@ -32,7 +32,7 @@ classifiers = [
32
32
 
33
33
 
34
34
  dependencies = [
35
- "certifi==2026.6.17",
35
+ "certifi==2026.10.23",
36
36
  "chardet",
37
37
  "gemmi>=0.7.5",
38
38
  "html2text",
@@ -41,18 +41,18 @@ dependencies = [
41
41
  "pybind11>=3",
42
42
  "python-docx",
43
43
  "packaging==26.3",
44
- "QtAwesome",
45
- "QtPy",
46
- "numpy==2.4.6",
44
+ "qtawesome==1.4.2",
45
+ "qtpy==2.4.3",
46
+ "numpy==2.5.5",
47
47
  "requests",
48
- "urllib3==2.7.0",
49
- "docxtpl[subdoc]>=0.20.2",
48
+ "urllib3==2.8.0",
49
+ "docxtpl[subdoc]==0.20.2",
50
50
  "shelxfile>=24",
51
51
  "fastmolwidget>=1.2.0", # needs set_model_source/ResidualDensityControls and the web submodule
52
52
  "pyenchant",
53
53
  "charset-normalizer",
54
54
  "pyside6-essentials",
55
- "docxcompose>=2.2.0",
55
+ "docxcompose==2.2.0",
56
56
  ]
57
57
 
58
58
  [dependency-groups]