dclab 0.62.11__tar.gz → 2.18.0__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.

Potentially problematic release.


This version of dclab might be problematic. Click here for more details.

Files changed (327) hide show
  1. {dclab-0.62.11 → dclab-2.18.0}/.readthedocs.yml +2 -0
  2. {dclab-0.62.11 → dclab-2.18.0}/CHANGELOG +3 -60
  3. {dclab-0.62.11 → dclab-2.18.0}/MANIFEST.in +1 -1
  4. {dclab-0.62.11 → dclab-2.18.0}/PKG-INFO +5 -3
  5. {dclab-0.62.11 → dclab-2.18.0}/dclab/_version.py +2 -2
  6. {dclab-0.62.11 → dclab-2.18.0}/dclab/definitions/meta_const.py +1 -11
  7. {dclab-0.62.11 → dclab-2.18.0}/dclab/http_utils.py +2 -12
  8. dclab-2.18.0/dclab/lme4/__init__.py +5 -0
  9. dclab-2.18.0/dclab/lme4/rlibs.py +93 -0
  10. dclab-2.18.0/dclab/lme4/rsetup.py +207 -0
  11. {dclab-0.62.11 → dclab-2.18.0}/dclab/lme4/wrapr.py +129 -93
  12. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/check.py +6 -74
  13. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/copier.py +19 -73
  14. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/core.py +2 -12
  15. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/export.py +12 -16
  16. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_basin.py +3 -30
  17. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_dcor/tables.py +4 -6
  18. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hdf5/base.py +2 -7
  19. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hdf5/events.py +3 -3
  20. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hierarchy/base.py +1 -0
  21. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hierarchy/events.py +3 -4
  22. dclab-2.18.0/dclab/rtdc_dataset/linker.py +124 -0
  23. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/writer.py +11 -30
  24. {dclab-0.62.11 → dclab-2.18.0}/dclab/util.py +0 -6
  25. {dclab-0.62.11 → dclab-2.18.0}/dclab.egg-info/PKG-INFO +5 -3
  26. {dclab-0.62.11 → dclab-2.18.0}/dclab.egg-info/SOURCES.txt +3 -1
  27. {dclab-0.62.11 → dclab-2.18.0}/dclab.egg-info/requires.txt +4 -1
  28. {dclab-0.62.11 → dclab-2.18.0}/docs/conf.py +6 -3
  29. {dclab-0.62.11 → dclab-2.18.0}/docs/requirements.txt +2 -0
  30. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_basins/index.rst +36 -97
  31. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_lme4.rst +1 -3
  32. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_s3.rst +2 -2
  33. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_changelog.rst +0 -1
  34. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_code_reference.rst +5 -0
  35. {dclab-0.62.11 → dclab-2.18.0}/pyproject.toml +2 -1
  36. {dclab-0.62.11 → dclab-2.18.0}/tests/test_cli_condense.py +6 -13
  37. {dclab-0.62.11 → dclab-2.18.0}/tests/test_cli_repack.py +0 -37
  38. {dclab-0.62.11 → dclab-2.18.0}/tests/test_lme4.py +30 -10
  39. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_check_dataset.py +10 -86
  40. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_copier.py +0 -175
  41. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_core_feat.py +0 -26
  42. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_export_hdf5.py +0 -21
  43. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_feat_anc_plugin.py +13 -6
  44. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_feat_basin.py +0 -62
  45. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_dcor_basin.py +0 -2
  46. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_hdf5_basins_internal.py +0 -105
  47. dclab-2.18.0/tests/test_rtdc_fmt_hdf5_linker.py +136 -0
  48. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_http_basin.py +0 -5
  49. dclab-0.62.11/dclab/lme4/__init__.py +0 -5
  50. dclab-0.62.11/dclab/lme4/lme4_template.R +0 -94
  51. dclab-0.62.11/dclab/lme4/rsetup.py +0 -204
  52. {dclab-0.62.11 → dclab-2.18.0}/.gitignore +0 -0
  53. {dclab-0.62.11 → dclab-2.18.0}/LICENSE +0 -0
  54. {dclab-0.62.11 → dclab-2.18.0}/README.rst +0 -0
  55. {dclab-0.62.11 → dclab-2.18.0}/dclab/__init__.py +0 -0
  56. {dclab-0.62.11 → dclab-2.18.0}/dclab/cached.py +0 -0
  57. {dclab-0.62.11 → dclab-2.18.0}/dclab/cli/__init__.py +0 -0
  58. {dclab-0.62.11 → dclab-2.18.0}/dclab/cli/common.py +0 -0
  59. {dclab-0.62.11 → dclab-2.18.0}/dclab/cli/task_compress.py +0 -0
  60. {dclab-0.62.11 → dclab-2.18.0}/dclab/cli/task_condense.py +0 -0
  61. {dclab-0.62.11 → dclab-2.18.0}/dclab/cli/task_join.py +0 -0
  62. {dclab-0.62.11 → dclab-2.18.0}/dclab/cli/task_repack.py +0 -0
  63. {dclab-0.62.11 → dclab-2.18.0}/dclab/cli/task_split.py +0 -0
  64. {dclab-0.62.11 → dclab-2.18.0}/dclab/cli/task_tdms2rtdc.py +0 -0
  65. {dclab-0.62.11 → dclab-2.18.0}/dclab/cli/task_verify_dataset.py +0 -0
  66. {dclab-0.62.11 → dclab-2.18.0}/dclab/definitions/__init__.py +0 -0
  67. {dclab-0.62.11 → dclab-2.18.0}/dclab/definitions/feat_const.py +0 -0
  68. {dclab-0.62.11 → dclab-2.18.0}/dclab/definitions/feat_logic.py +0 -0
  69. {dclab-0.62.11 → dclab-2.18.0}/dclab/definitions/meta_logic.py +0 -0
  70. {dclab-0.62.11 → dclab-2.18.0}/dclab/definitions/meta_parse.py +0 -0
  71. {dclab-0.62.11 → dclab-2.18.0}/dclab/downsampling.pyx +0 -0
  72. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/__init__.py +0 -0
  73. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/packaging/LICENSE +0 -0
  74. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/packaging/LICENSE.APACHE +0 -0
  75. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/packaging/LICENSE.BSD +0 -0
  76. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/packaging/__init__.py +0 -0
  77. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/packaging/_structures.py +0 -0
  78. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/packaging/version.py +0 -0
  79. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/skimage/LICENSE +0 -0
  80. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/skimage/__init__.py +0 -0
  81. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/skimage/_find_contours.py +0 -0
  82. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/skimage/_find_contours_cy.pyx +0 -0
  83. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/skimage/_pnpoly.pyx +0 -0
  84. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/skimage/_shared/__init__.py +0 -0
  85. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/skimage/_shared/geometry.pxd +0 -0
  86. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/skimage/_shared/geometry.pyx +0 -0
  87. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/skimage/measure.py +0 -0
  88. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/skimage/pnpoly.py +0 -0
  89. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/statsmodels/LICENSE +0 -0
  90. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/statsmodels/__init__.py +0 -0
  91. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/statsmodels/nonparametric/__init__.py +0 -0
  92. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/statsmodels/nonparametric/_kernel_base.py +0 -0
  93. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/statsmodels/nonparametric/kernel_density.py +0 -0
  94. {dclab-0.62.11 → dclab-2.18.0}/dclab/external/statsmodels/nonparametric/kernels.py +0 -0
  95. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/__init__.py +0 -0
  96. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/bright.py +0 -0
  97. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/bright_bc.py +0 -0
  98. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/bright_perc.py +0 -0
  99. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/contour.py +0 -0
  100. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/emodulus/__init__.py +0 -0
  101. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/emodulus/load.py +0 -0
  102. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/emodulus/lut_HE-2D-FEM-22.txt +0 -0
  103. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/emodulus/lut_HE-3D-FEM-22.txt +0 -0
  104. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/emodulus/lut_LE-2D-FEM-19.txt +0 -0
  105. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/emodulus/pxcorr.py +0 -0
  106. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/emodulus/scale_linear.py +0 -0
  107. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/emodulus/viscosity.py +0 -0
  108. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/fl_crosstalk.py +0 -0
  109. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/inert_ratio.py +0 -0
  110. {dclab-0.62.11 → dclab-2.18.0}/dclab/features/volume.py +0 -0
  111. {dclab-0.62.11 → dclab-2.18.0}/dclab/isoelastics/__init__.py +0 -0
  112. {dclab-0.62.11 → dclab-2.18.0}/dclab/isoelastics/iso_HE-2D-FEM-22-area_um-deform.txt +0 -0
  113. {dclab-0.62.11 → dclab-2.18.0}/dclab/isoelastics/iso_HE-2D-FEM-22-volume-deform.txt +0 -0
  114. {dclab-0.62.11 → dclab-2.18.0}/dclab/isoelastics/iso_HE-3D-FEM-22-area_um-deform.txt +0 -0
  115. {dclab-0.62.11 → dclab-2.18.0}/dclab/isoelastics/iso_HE-3D-FEM-22-volume-deform.txt +0 -0
  116. {dclab-0.62.11 → dclab-2.18.0}/dclab/isoelastics/iso_LE-2D-FEM-19-area_um-deform.txt +0 -0
  117. {dclab-0.62.11 → dclab-2.18.0}/dclab/isoelastics/iso_LE-2D-FEM-19-volume-deform.txt +0 -0
  118. {dclab-0.62.11 → dclab-2.18.0}/dclab/isoelastics/iso_LE-2D-ana-18-area_um-deform.txt +0 -0
  119. {dclab-0.62.11 → dclab-2.18.0}/dclab/kde_contours.py +0 -0
  120. {dclab-0.62.11 → dclab-2.18.0}/dclab/kde_methods.py +0 -0
  121. {dclab-0.62.11 → dclab-2.18.0}/dclab/polygon_filter.py +0 -0
  122. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/__init__.py +0 -0
  123. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/config.py +0 -0
  124. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_anc_core/__init__.py +0 -0
  125. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_anc_core/af_basic.py +0 -0
  126. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_anc_core/af_emodulus.py +0 -0
  127. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_anc_core/af_fl_max_ctc.py +0 -0
  128. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_anc_core/af_image_contour.py +0 -0
  129. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_anc_core/af_ml_class.py +0 -0
  130. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_anc_core/ancillary_feature.py +0 -0
  131. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_anc_ml/__init__.py +0 -0
  132. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_anc_plugin/__init__.py +0 -0
  133. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_anc_plugin/plugin_feature.py +0 -0
  134. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/feat_temp.py +0 -0
  135. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/filter.py +0 -0
  136. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_dcor/__init__.py +0 -0
  137. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_dcor/access_token.py +0 -0
  138. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_dcor/api.py +0 -0
  139. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_dcor/base.py +0 -0
  140. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_dcor/basin.py +0 -0
  141. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_dcor/logs.py +0 -0
  142. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_dict.py +0 -0
  143. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hdf5/__init__.py +0 -0
  144. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hdf5/basin.py +0 -0
  145. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hdf5/feat_defect.py +0 -0
  146. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hdf5/logs.py +0 -0
  147. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hdf5/tables.py +0 -0
  148. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hierarchy/__init__.py +0 -0
  149. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hierarchy/hfilter.py +0 -0
  150. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_hierarchy/mapper.py +0 -0
  151. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_http.py +0 -0
  152. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_s3.py +0 -0
  153. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_tdms/__init__.py +0 -0
  154. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_tdms/event_contour.py +0 -0
  155. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_tdms/event_image.py +0 -0
  156. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_tdms/event_mask.py +0 -0
  157. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_tdms/event_trace.py +0 -0
  158. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_tdms/exc.py +0 -0
  159. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/fmt_tdms/naming.py +0 -0
  160. {dclab-0.62.11 → dclab-2.18.0}/dclab/rtdc_dataset/load.py +0 -0
  161. {dclab-0.62.11 → dclab-2.18.0}/dclab/statistics.py +0 -0
  162. {dclab-0.62.11 → dclab-2.18.0}/dclab/warn.py +0 -0
  163. {dclab-0.62.11 → dclab-2.18.0}/dclab.egg-info/dependency_links.txt +0 -0
  164. {dclab-0.62.11 → dclab-2.18.0}/dclab.egg-info/entry_points.txt +0 -0
  165. {dclab-0.62.11 → dclab-2.18.0}/dclab.egg-info/top_level.txt +0 -0
  166. {dclab-0.62.11 → dclab-2.18.0}/docs/.gitignore +0 -0
  167. {dclab-0.62.11 → dclab-2.18.0}/docs/README.md +0 -0
  168. {dclab-0.62.11 → dclab-2.18.0}/docs/data/example.poly +0 -0
  169. {dclab-0.62.11 → dclab-2.18.0}/docs/data/example.rtdc +0 -0
  170. {dclab-0.62.11 → dclab-2.18.0}/docs/data/example_plugin.py +0 -0
  171. {dclab-0.62.11 → dclab-2.18.0}/docs/data/example_plugin_metadata.py +0 -0
  172. {dclab-0.62.11 → dclab-2.18.0}/docs/data/example_traces.rtdc +0 -0
  173. {dclab-0.62.11 → dclab-2.18.0}/docs/data/example_video.rtdc +0 -0
  174. {dclab-0.62.11 → dclab-2.18.0}/docs/dclab.bib +0 -0
  175. {dclab-0.62.11 → dclab-2.18.0}/docs/extensions/dclab_defs.py +0 -0
  176. {dclab-0.62.11 → dclab-2.18.0}/docs/extensions/fancy_include.py +0 -0
  177. {dclab-0.62.11 → dclab-2.18.0}/docs/extensions/github_changelog.py +0 -0
  178. {dclab-0.62.11 → dclab-2.18.0}/docs/extensions/simple_argparse.py +0 -0
  179. {dclab-0.62.11 → dclab-2.18.0}/docs/figures/DCOR_API_Token_website.png +0 -0
  180. {dclab-0.62.11 → dclab-2.18.0}/docs/index.rst +0 -0
  181. {dclab-0.62.11 → dclab-2.18.0}/docs/logo/dc_logo.png +0 -0
  182. {dclab-0.62.11 → dclab-2.18.0}/docs/logo/dc_logo.svg +0 -0
  183. {dclab-0.62.11 → dclab-2.18.0}/docs/logo/dclab.png +0 -0
  184. {dclab-0.62.11 → dclab-2.18.0}/docs/logo/dclab.svg +0 -0
  185. {dclab-0.62.11 → dclab-2.18.0}/docs/logo/dclab_large_white.png +0 -0
  186. {dclab-0.62.11 → dclab-2.18.0}/docs/logo/dclab_large_white.svg +0 -0
  187. {dclab-0.62.11 → dclab-2.18.0}/docs/logo/favicon.ico +0 -0
  188. {dclab-0.62.11 → dclab-2.18.0}/docs/logo/favicon.svg +0 -0
  189. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_advanced_usage.rst +0 -0
  190. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_dc_io.rst +0 -0
  191. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_dc_usage.rst +0 -0
  192. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_dcor.rst +0 -0
  193. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_emodulus/figures_emodulus/.gitignore +0 -0
  194. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_emodulus/figures_emodulus/emodulus_20um_HE-2D-FEM-22.png +0 -0
  195. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_emodulus/figures_emodulus/emodulus_20um_HE-3D-FEM-22.png +0 -0
  196. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_emodulus/figures_emodulus/emodulus_20um_LE-2D-FEM-19.png +0 -0
  197. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_emodulus/figures_emodulus/plot_emodulus_lut.py +0 -0
  198. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_emodulus/figures_emodulus/requirements.txt +0 -0
  199. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_emodulus/figures_viscosity/LICENSE +0 -0
  200. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_emodulus/figures_viscosity/buyukurganci_22_fig3a.jpg +0 -0
  201. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_emodulus/figures_viscosity/buyukurganci_22_fig3a.pdf +0 -0
  202. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_emodulus/index.rst +0 -0
  203. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_feat_plugin.rst +0 -0
  204. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_feat_temp.rst +0 -0
  205. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_fluorescence.rst +0 -0
  206. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_notation.rst +0 -0
  207. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_av_scatter.rst +0 -0
  208. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_cli.rst +0 -0
  209. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_examples.rst +0 -0
  210. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_getting_started.rst +0 -0
  211. {dclab-0.62.11 → dclab-2.18.0}/docs/sec_z_bib.rst +0 -0
  212. {dclab-0.62.11 → dclab-2.18.0}/examples/emodulus_dcor.jpg +0 -0
  213. {dclab-0.62.11 → dclab-2.18.0}/examples/emodulus_dcor.py +0 -0
  214. {dclab-0.62.11 → dclab-2.18.0}/examples/generate_example_images.py +0 -0
  215. {dclab-0.62.11 → dclab-2.18.0}/examples/isoelastics.jpg +0 -0
  216. {dclab-0.62.11 → dclab-2.18.0}/examples/isoelastics.py +0 -0
  217. {dclab-0.62.11 → dclab-2.18.0}/examples/isoelastics_custom.jpg +0 -0
  218. {dclab-0.62.11 → dclab-2.18.0}/examples/isoelastics_custom.py +0 -0
  219. {dclab-0.62.11 → dclab-2.18.0}/examples/lme4_glmer_diff.py +0 -0
  220. {dclab-0.62.11 → dclab-2.18.0}/examples/lme4_lmer.jpg +0 -0
  221. {dclab-0.62.11 → dclab-2.18.0}/examples/lme4_lmer.py +0 -0
  222. {dclab-0.62.11 → dclab-2.18.0}/examples/overview_plot.jpg +0 -0
  223. {dclab-0.62.11 → dclab-2.18.0}/examples/overview_plot.py +0 -0
  224. {dclab-0.62.11 → dclab-2.18.0}/examples/plugin_example.py +0 -0
  225. {dclab-0.62.11 → dclab-2.18.0}/examples/plugin_usage.jpg +0 -0
  226. {dclab-0.62.11 → dclab-2.18.0}/examples/plugin_usage.py +0 -0
  227. {dclab-0.62.11 → dclab-2.18.0}/examples/viscosity_models.jpg +0 -0
  228. {dclab-0.62.11 → dclab-2.18.0}/examples/viscosity_models.py +0 -0
  229. {dclab-0.62.11 → dclab-2.18.0}/scripts/.gitignore +0 -0
  230. {dclab-0.62.11 → dclab-2.18.0}/scripts/README.md +0 -0
  231. {dclab-0.62.11 → dclab-2.18.0}/scripts/fem2iso_volume.py +0 -0
  232. {dclab-0.62.11 → dclab-2.18.0}/scripts/fem2lutiso_std.py +0 -0
  233. {dclab-0.62.11 → dclab-2.18.0}/scripts/fem2rtdc.py +0 -0
  234. {dclab-0.62.11 → dclab-2.18.0}/scripts/lut_recipes/__init__.py +0 -0
  235. {dclab-0.62.11 → dclab-2.18.0}/scripts/lut_recipes/hooks/LUT_analytical_linear-elastic_2Daxis.txt +0 -0
  236. {dclab-0.62.11 → dclab-2.18.0}/scripts/lut_recipes/hooks/README.md +0 -0
  237. {dclab-0.62.11 → dclab-2.18.0}/scripts/lut_recipes/hooks/__init__.py +0 -0
  238. {dclab-0.62.11 → dclab-2.18.0}/scripts/lut_recipes/hooks/common.py +0 -0
  239. {dclab-0.62.11 → dclab-2.18.0}/scripts/lut_recipes/hooks/he_2d_fem_22.py +0 -0
  240. {dclab-0.62.11 → dclab-2.18.0}/scripts/lut_recipes/hooks/he_3d_fem_22.py +0 -0
  241. {dclab-0.62.11 → dclab-2.18.0}/scripts/lut_recipes/hooks/le_2d_fem_19.py +0 -0
  242. {dclab-0.62.11 → dclab-2.18.0}/scripts/lut_recipes/lut_processor.py +0 -0
  243. {dclab-0.62.11 → dclab-2.18.0}/scripts/pixelation_correction.py +0 -0
  244. {dclab-0.62.11 → dclab-2.18.0}/scripts/pixelation_correction_2020.png +0 -0
  245. {dclab-0.62.11 → dclab-2.18.0}/scripts/pixelation_correction_2022.png +0 -0
  246. {dclab-0.62.11 → dclab-2.18.0}/scripts/requirements.txt +0 -0
  247. {dclab-0.62.11 → dclab-2.18.0}/setup.cfg +0 -0
  248. {dclab-0.62.11 → dclab-2.18.0}/setup.py +0 -0
  249. {dclab-0.62.11 → dclab-2.18.0}/tests/README.md +0 -0
  250. {dclab-0.62.11 → dclab-2.18.0}/tests/conftest.py +0 -0
  251. {dclab-0.62.11 → dclab-2.18.0}/tests/data/README.md +0 -0
  252. {dclab-0.62.11 → dclab-2.18.0}/tests/data/example_access_token.dcor-access +0 -0
  253. {dclab-0.62.11 → dclab-2.18.0}/tests/data/example_isoelastics.txt +0 -0
  254. {dclab-0.62.11 → dclab-2.18.0}/tests/data/feat_anc_plugin_creative.py +0 -0
  255. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_fl-no-contour_2019.zip +0 -0
  256. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_fl_2017.zip +0 -0
  257. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_fl_2018.zip +0 -0
  258. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_fl_wide-channel_2023.zip +0 -0
  259. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_image-bg_2020.zip +0 -0
  260. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_image-mask-blood_2021.zip +0 -0
  261. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_mask-contour_2018.zip +0 -0
  262. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_polygon_gate_2021.zip +0 -0
  263. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_raw-cytoshot-exported.zip +0 -0
  264. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_segfault-compound_2023.zip +0 -0
  265. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-hdf5_wide-channel_2023.zip +0 -0
  266. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-tdms_2fl-no-image_2017.zip +0 -0
  267. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-tdms_fl-image-bright_2017.zip +0 -0
  268. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-tdms_fl-image-large-fov_2017.zip +0 -0
  269. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-tdms_fl-image_2016.zip +0 -0
  270. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-tdms_fl_2015.zip +0 -0
  271. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-tdms_minimal_2016.zip +0 -0
  272. {dclab-0.62.11 → dclab-2.18.0}/tests/data/fmt-tdms_shapein-2.0.1-no-image_2017.zip +0 -0
  273. {dclab-0.62.11 → dclab-2.18.0}/tests/helper_methods.py +0 -0
  274. {dclab-0.62.11 → dclab-2.18.0}/tests/requirements.txt +0 -0
  275. {dclab-0.62.11 → dclab-2.18.0}/tests/test_cache.py +0 -0
  276. {dclab-0.62.11 → dclab-2.18.0}/tests/test_cli.py +0 -0
  277. {dclab-0.62.11 → dclab-2.18.0}/tests/test_cli_argparse.py +0 -0
  278. {dclab-0.62.11 → dclab-2.18.0}/tests/test_cli_compress.py +0 -0
  279. {dclab-0.62.11 → dclab-2.18.0}/tests/test_cli_join.py +0 -0
  280. {dclab-0.62.11 → dclab-2.18.0}/tests/test_cli_split.py +0 -0
  281. {dclab-0.62.11 → dclab-2.18.0}/tests/test_config_value_mapping.py +0 -0
  282. {dclab-0.62.11 → dclab-2.18.0}/tests/test_dfn.py +0 -0
  283. {dclab-0.62.11 → dclab-2.18.0}/tests/test_downsampling.py +0 -0
  284. {dclab-0.62.11 → dclab-2.18.0}/tests/test_feat_bright.py +0 -0
  285. {dclab-0.62.11 → dclab-2.18.0}/tests/test_feat_bright_bc.py +0 -0
  286. {dclab-0.62.11 → dclab-2.18.0}/tests/test_feat_bright_perc.py +0 -0
  287. {dclab-0.62.11 → dclab-2.18.0}/tests/test_feat_contour.py +0 -0
  288. {dclab-0.62.11 → dclab-2.18.0}/tests/test_feat_emodulus.py +0 -0
  289. {dclab-0.62.11 → dclab-2.18.0}/tests/test_feat_emodulus_viscosity.py +0 -0
  290. {dclab-0.62.11 → dclab-2.18.0}/tests/test_feat_fl_crosstalk.py +0 -0
  291. {dclab-0.62.11 → dclab-2.18.0}/tests/test_feat_inert_ratio.py +0 -0
  292. {dclab-0.62.11 → dclab-2.18.0}/tests/test_feat_volume.py +0 -0
  293. {dclab-0.62.11 → dclab-2.18.0}/tests/test_http_utils.py +0 -0
  294. {dclab-0.62.11 → dclab-2.18.0}/tests/test_isoelastics.py +0 -0
  295. {dclab-0.62.11 → dclab-2.18.0}/tests/test_kde_contours.py +0 -0
  296. {dclab-0.62.11 → dclab-2.18.0}/tests/test_kde_methods.py +0 -0
  297. {dclab-0.62.11 → dclab-2.18.0}/tests/test_lut_he_2d_fem_22.py +0 -0
  298. {dclab-0.62.11 → dclab-2.18.0}/tests/test_lut_he_3d_fem_22.py +0 -0
  299. {dclab-0.62.11 → dclab-2.18.0}/tests/test_polygon_contains.py +0 -0
  300. {dclab-0.62.11 → dclab-2.18.0}/tests/test_polygon_filter.py +0 -0
  301. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_config.py +0 -0
  302. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_downsampling.py +0 -0
  303. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_export.py +0 -0
  304. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_export_avi.py +0 -0
  305. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_export_fcs.py +0 -0
  306. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_export_tsv.py +0 -0
  307. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_feat_anc_core.py +0 -0
  308. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_feat_anc_ml.py +0 -0
  309. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_feat_basin_mapped.py +0 -0
  310. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_feat_temp.py +0 -0
  311. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_filter.py +0 -0
  312. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_dcor.py +0 -0
  313. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_dcor_access_token.py +0 -0
  314. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_dict.py +0 -0
  315. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_hdf5.py +0 -0
  316. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_hdf5_basins.py +0 -0
  317. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_hierarchy.py +0 -0
  318. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_http.py +0 -0
  319. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_s3.py +0 -0
  320. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_s3_basin.py +0 -0
  321. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_fmt_tdms.py +0 -0
  322. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_hash.py +0 -0
  323. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_kde.py +0 -0
  324. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_limit_events.py +0 -0
  325. {dclab-0.62.11 → dclab-2.18.0}/tests/test_rtdc_writer.py +0 -0
  326. {dclab-0.62.11 → dclab-2.18.0}/tests/test_statistics.py +0 -0
  327. {dclab-0.62.11 → dclab-2.18.0}/tests/test_util.py +0 -0
@@ -8,6 +8,8 @@ build:
8
8
  jobs:
9
9
  post_checkout:
10
10
  - git fetch --unshallow || true
11
+ pre_install:
12
+ - RPY2_CFFI_MODE=ABI
11
13
  python:
12
14
  install:
13
15
  - requirements: docs/requirements.txt
@@ -1,60 +1,3 @@
1
- 0.62.11
2
- - enh: support plain `numpy.array` tables
3
- 0.62.10
4
- - fix: `basin_definition_copy` failed when more than one basins defined
5
- due to redundant loop
6
- - fix: JSON logs during export were not sorted and indented
7
- 0.62.9
8
- - enh: sort basin definition before exporting to JSON; the side-effect
9
- is that the unique key for a basin changes, possibly resulting in
10
- duplicated basin definitions for existing datasets
11
- - enh: make sure every basin can be identified with a key created from
12
- its definition; important for connecting the basin dictionaries
13
- with the instantiated basins
14
- 0.62.8
15
- - fix: metadata of tables not copied by `copier.py`
16
- - docs: formatting typo (#270)
17
- 0.62.7
18
- - fix: IntegrityChecker must not load basins
19
- - fix: KeyError in IntegrityChecker when "basin_events" group missing (#268)
20
- - fix: warn user about missing internal basin features while still loading
21
- those that are available (#268)
22
- - fix: do not copy internal basin definitions for non-existent features (#269)
23
- - docs: clarify interpretation of [qpi]: "filter size" metadata (#267)
24
- - tests: avoid architecture and Python-version dependent test
25
- 0.62.6
26
- - enh: support passing pathlib.Path to lme4.rsetup.set_*_path methods
27
- - docs: correct keyword arguments for advanced section on S3
28
- 0.62.5
29
- - enh: make set_r_lib_path available in lme4 submodule
30
- 0.62.4
31
- - enh: honor R_LIBS_USER environment variable when running R
32
- 0.62.3
33
- - fix: get_r_version string conversion not necessary
34
- 0.62.2
35
- - fix: use full path to R executable when running lme4 analysis in rsetup
36
- - enh: properly catch CalledProcessError in run_command
37
- - enh: improve search for R executable path
38
- - ref: replace sp.check_output with run_command in lme4 submodule
39
- 0.62.1
40
- - fix: numpy-version-specific default for `copy` in `__array__()`
41
- 0.62.0
42
- - BREAKING: removed the `rtdc_dataset.linker` module, because it is not
43
- used by any other piece of software and because combining file-like
44
- objects external links are quirky and their combination finally broke
45
- with h5py 3.12
46
- - enh: added integrity check for external links
47
- - tests: reduce warnings
48
- 0.61.5
49
- - fix: integrity check failed for empty datasets
50
- 0.61.4
51
- - docs: update basins section
52
- - docs: cleanup build process
53
- 0.61.3
54
- - fix: TypeError when of R_HOME is not set
55
- 0.61.2
56
- - ref: migrate from rpy2 to custom wrapper around R and Rscript binary
57
- - setup: remove extra [lme4] and rpy2 requirement
58
1
  0.61.1
59
2
  - fix: properly catch warnings for determining bad event image for fmt_tdms
60
3
  - fix: make sure integer features are always written as uint,
@@ -70,7 +13,7 @@
70
13
  - enh: improve availability check for HDF5 basin data
71
14
  - enh: cache list of features available via all basins
72
15
  - enh: speed up feature retrieval for non-ancillary features
73
- - ref: replace `np.string_` with `np.bytes_`
16
+ - ref: replace np.string_ with np.bytes_
74
17
  0.60.9
75
18
  - build: build with macos-latest and macos-13 images
76
19
  0.60.8
@@ -302,7 +245,7 @@
302
245
  - ref: HDF5Basin gets its own submodule
303
246
  - setup: oldest-supported-numpy is not required anymore, since numpy
304
247
  is backwards-compatible now
305
- 0.52.3
248
+ 0.52.3
306
249
  - maintenance release
307
250
  0.52.2
308
251
  - maintenance release
@@ -427,7 +370,7 @@
427
370
  0.47.3
428
371
  - fix: np.histrogram2d does not expect broken normed argument
429
372
  - docs: fixed GH Actions badge
430
- - enh: implement `RTDC_HDF5.__len__`
373
+ - enh: implement RTDC_HDF5.__len__
431
374
  0.47.2
432
375
  - enh: add --version flag to CLI
433
376
  0.47.1
@@ -3,7 +3,7 @@ include CREDITS
3
3
  include LICENSE
4
4
  include README.rst
5
5
  include pyproject.toml
6
- recursive-include dclab *.txt *.md *.pxd *.R
6
+ recursive-include dclab *.txt *.md *.pxd
7
7
  recursive-include docs *.py *.md *.txt *.rst *.bib *.gif *.jpg
8
8
  recursive-include examples *.py *.jpg *.npy *.npz
9
9
  recursive-include tests *.zip *.md *.py *.txt
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.1
2
2
  Name: dclab
3
- Version: 0.62.11
3
+ Version: 2.18.0
4
4
  Summary: Library for real-time deformability cytometry (RT-DC)
5
5
  Author: Benedikt Hartmann, Eoghan O'Connell, Maik Herbig, Maximilian Schlögel, Nadia Sbaa, Paul Müller, Philipp Rosendahl, Raghava Alajangi
6
6
  Maintainer-email: Paul Müller <dev@craban.de>
@@ -23,7 +23,7 @@ Requires-Dist: importlib-resources>=6.0
23
23
  Requires-Dist: numpy<3,>=1.21
24
24
  Requires-Dist: scipy<2,>=1.10.0
25
25
  Provides-Extra: all
26
- Requires-Dist: dclab[dcor,export,http,s3,tdms]; extra == "all"
26
+ Requires-Dist: dclab[dcor,export,http,lme4,s3,tdms]; extra == "all"
27
27
  Provides-Extra: dcor
28
28
  Requires-Dist: requests<3,>=2.31.0; extra == "dcor"
29
29
  Provides-Extra: export
@@ -31,6 +31,8 @@ Requires-Dist: fcswrite>=0.5.0; extra == "export"
31
31
  Requires-Dist: imageio[ffmpeg]; extra == "export"
32
32
  Provides-Extra: http
33
33
  Requires-Dist: requests<3,>=2.31.0; extra == "http"
34
+ Provides-Extra: lme4
35
+ Requires-Dist: rpy2>=2.9.4; extra == "lme4"
34
36
  Provides-Extra: s3
35
37
  Requires-Dist: boto3>=1.34.31; extra == "s3"
36
38
  Provides-Extra: tdms
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.62.11'
16
- __version_tuple__ = version_tuple = (0, 62, 11)
15
+ __version__ = version = '2.18.0'
16
+ __version_tuple__ = version_tuple = (2, 18, 0)
@@ -161,17 +161,7 @@ CFG_METADATA = {
161
161
  ["subtract mean", fbool, "Subtract mean before processing"],
162
162
  # pipeline_kws
163
163
  ["filter name", str, "Fourier filter used"],
164
- # qpretrieve defines the keyword argument `filter_size_interpretation`
165
- # for determining the filter size in Fourier space. In DC, we
166
- # need a well-defined value for the filter size. The most logical
167
- # choice is to interpret the filter size as "frequency index", which
168
- # is independent of the image shape and yields a good approximation
169
- # of the actual resolution one can expect. The default value
170
- # ("sideband distance") is a good choice for general QPI analysis,
171
- # but there is no meaningful information one could extract from it
172
- # by just looking at the number. Thus, the "filter size" that we
173
- # see here corresponds to a filter size set in qpretrieve where
174
- # `filter_size_interpretation="frequency index"`.
164
+ # Corresponds to `filter_size_interpretation="frequency index"`
175
165
  ["filter size", float, "Fourier filter size [1/pix]"],
176
166
  ["scale to filter", fboolorfloat, "Scale QPI data to filter size"],
177
167
  # x, y coordinates, don't set if you wish None to be the default
@@ -27,14 +27,6 @@ REGEXP_HTTP_URL = re.compile(
27
27
  )
28
28
 
29
29
 
30
- class ETagNotInResponseHeaderWarning(UserWarning):
31
- """Used for cases where the requests.Response does not contain an ETag"""
32
-
33
-
34
- class ConnectionTimeoutWarning(UserWarning):
35
- """Used when a connection fails or times out"""
36
-
37
-
38
30
  class HTTPFile(io.IOBase):
39
31
  def __init__(self, url, chunk_size=2**18, keep_chunks=200):
40
32
  """Chunk-cached access to a URL supporting range requests
@@ -86,8 +78,7 @@ class HTTPFile(io.IOBase):
86
78
  etag = resp.headers.get("etag", "").strip("'").strip('"')
87
79
  if len(etag) < 5:
88
80
  etag = None
89
- warnings.warn(f"Got empty ETag header for {self.url}",
90
- ETagNotInResponseHeaderWarning)
81
+ warnings.warn(f"Got empty ETag header for {self.url}")
91
82
  self._etag = etag
92
83
 
93
84
  @property
@@ -247,8 +238,7 @@ class ResoluteRequestsSession(requests.Session):
247
238
  requests.exceptions.ConnectTimeout,
248
239
  requests.urllib3.exceptions.ConnectionError,
249
240
  requests.urllib3.exceptions.ReadTimeoutError) as e:
250
- warnings.warn(f"Encountered {e} for {args} {kwargs}",
251
- ConnectionTimeoutWarning)
241
+ warnings.warn(f"Encountered {e} for {args} {kwargs}")
252
242
  continue
253
243
  else:
254
244
  break
@@ -0,0 +1,5 @@
1
+ """A wrapper around R with the lme4 package"""
2
+ # flake8: noqa: F401
3
+ from . import rlibs, rsetup, wrapr
4
+ from .wrapr import Rlme4, bootstrapped_median_distributions
5
+ from .rsetup import get_r_path, get_r_version, install_lme4, set_r_path
@@ -0,0 +1,93 @@
1
+ import importlib
2
+ import os
3
+ import warnings
4
+
5
+ from ..external.packaging import parse as parse_version
6
+
7
+ #: Minimum R version
8
+ #: This is actually a dependency for rpy2, because the API changed then
9
+ #: (ffi.error: symbol 'R_tryCatchError' not found in library).
10
+ R_MIN_VERSION = "3.6.0"
11
+
12
+ #: Minimum rpy2 version
13
+ RPY2_MIN_VERSION = "2.9.4"
14
+
15
+ R_SUBMODULES = [
16
+ "rpy2.robjects.packages",
17
+ "rpy2.situation",
18
+ "rpy2.robjects.vectors",
19
+ ]
20
+
21
+ R_SUBMODULES_3 = [
22
+ "rpy2.rinterface_lib.callbacks",
23
+ ]
24
+
25
+
26
+ class RPY2UnavailableError(BaseException):
27
+ pass
28
+
29
+
30
+ class RPY2ImportError(RPY2UnavailableError):
31
+ pass
32
+
33
+
34
+ class RPY2OutdatedError(RPY2UnavailableError):
35
+ pass
36
+
37
+
38
+ class RUnavailableError(BaseException):
39
+ pass
40
+
41
+
42
+ class ROutdatedError(RUnavailableError):
43
+ pass
44
+
45
+
46
+ class MockRPackage:
47
+ def __init__(self, exception):
48
+ self.exception = exception
49
+
50
+ def __getattr__(self, item):
51
+ raise self.exception
52
+
53
+
54
+ def import_r_submodules():
55
+ importlib.import_module("rpy2.situation")
56
+ r_home = rpy2.situation.get_r_home()
57
+ if r_home is not None:
58
+ if os.environ.get("R_HOME", None) is None:
59
+ # set R_HOME globally (https://github.com/rpy2/rpy2/issues/796)
60
+ os.environ["R_HOME"] = r_home
61
+ if rpy2_is_version_3:
62
+ mods = R_SUBMODULES + R_SUBMODULES_3
63
+ else:
64
+ mods = R_SUBMODULES
65
+ try:
66
+ for sm in mods:
67
+ importlib.import_module(sm)
68
+ except rpy2.rinterface_lib.openrlib.ffi.error as exc:
69
+ # This error happens when the installed R version is too old:
70
+ # "ffi.error: symbol 'R_tryCatchError' not found in library"
71
+ raise ROutdatedError(
72
+ f"Encountered '{exc.__class__.__name__}: {exc}'. "
73
+ f"Please make sure you have 'R>={R_MIN_VERSION}'!")
74
+
75
+
76
+ try:
77
+ rpy2 = importlib.import_module("rpy2")
78
+ if parse_version(rpy2.__version__) < parse_version(RPY2_MIN_VERSION):
79
+ raise RPY2OutdatedError(f"Please install 'rpy2>={RPY2_MIN_VERSION}'!")
80
+ except ImportError:
81
+ rpy2 = MockRPackage(
82
+ RPY2ImportError(f"Please install 'rpy2>={RPY2_MIN_VERSION}'!"))
83
+ rpy2_is_version_3 = False
84
+ except BaseException as e:
85
+ rpy2 = MockRPackage(e)
86
+ rpy2_is_version_3 = False
87
+ else:
88
+ rpy2_is_version_3 = parse_version(rpy2.__version__) >= parse_version("3.0")
89
+ try:
90
+ import_r_submodules()
91
+ except RUnavailableError as e:
92
+ warnings.warn("There is an issue with the linked R version: "
93
+ + f"{e.__class__.__name__}: {e}")
@@ -0,0 +1,207 @@
1
+ import logging
2
+ import os
3
+ import subprocess as sp
4
+
5
+ from .rlibs import (
6
+ RUnavailableError, rpy2, rpy2_is_version_3, import_r_submodules)
7
+
8
+ # Disable rpy2 logger because of unnecessary prints to stdout
9
+ logging.getLogger("rpy2.rinterface_lib.callbacks").disabled = True
10
+
11
+
12
+ class RNotFoundError(BaseException):
13
+ pass
14
+
15
+
16
+ class AutoRConsole(object):
17
+ """Helper class for catching R console output"""
18
+ lock = False
19
+ perform_lock = rpy2_is_version_3
20
+
21
+ def __init__(self):
22
+ """
23
+ By default, this console always returns "yes" when asked a
24
+ question. If you need something different, you can subclass
25
+ and override `consoleread` fucntion. The console stream is
26
+ recorded in `self.stream`.
27
+ """
28
+ self.stream = [["init", "Starting RConsole class\n"]]
29
+ if AutoRConsole.perform_lock:
30
+ if AutoRConsole.lock:
31
+ raise ValueError("Only one RConsole instance allowed!")
32
+ AutoRConsole.lock = True
33
+ self.original_funcs = {
34
+ "consoleread": rpy2.rinterface_lib.callbacks.consoleread,
35
+ "consolewrite_print":
36
+ rpy2.rinterface_lib.callbacks.consolewrite_print,
37
+ "consolewrite_warnerror":
38
+ rpy2.rinterface_lib.callbacks.consolewrite_warnerror,
39
+ }
40
+ rpy2.rinterface_lib.callbacks.consoleread = self.consoleread
41
+ rpy2.rinterface_lib.callbacks.consolewrite_print = \
42
+ self.consolewrite_print
43
+ rpy2.rinterface_lib.callbacks.showmessage = \
44
+ self.consolewrite_print
45
+
46
+ rpy2.rinterface_lib.callbacks.consolewrite_warnerror = \
47
+ self.consolewrite_warnerror
48
+ # Set locale (to get always English messages)
49
+ rpy2.robjects.r('Sys.setlocale("LC_MESSAGES", "C")')
50
+ rpy2.robjects.r('Sys.setlocale("LC_CTYPE", "C")')
51
+
52
+ def __enter__(self):
53
+ return self
54
+
55
+ def __exit__(self, *args):
56
+ if AutoRConsole.perform_lock:
57
+ AutoRConsole.lock = False
58
+ rpy2.rinterface_lib.callbacks.consoleread = \
59
+ self.original_funcs["consoleread"]
60
+ rpy2.rinterface_lib.callbacks.consolewrite_print = \
61
+ self.original_funcs["consolewrite_print"]
62
+ rpy2.rinterface_lib.callbacks.consolewrite_warnerror = \
63
+ self.original_funcs["consolewrite_warnerror"]
64
+
65
+ def close(self):
66
+ """Remove the rpy2 monkeypatches"""
67
+ self.__exit__()
68
+
69
+ def consoleread(self, prompt):
70
+ """Read user input, returns "yes" by default"""
71
+ self.write_to_stream("consoleread", prompt + "YES")
72
+ return "yes"
73
+
74
+ def consolewrite_print(self, s):
75
+ self.write_to_stream("consolewrite_print", s)
76
+
77
+ def consolewrite_warnerror(self, s):
78
+ self.write_to_stream("consolewrite_warnerror", s)
79
+
80
+ def write_to_stream(self, topic, s):
81
+ prev_topic = self.stream[-1][0]
82
+ same_topic = prev_topic == topic
83
+ unfinished_line = self.stream[-1][1][-1] not in ["\n", "\r"]
84
+ if same_topic and unfinished_line:
85
+ # append to previous line
86
+ self.stream[-1][1] += s
87
+ else:
88
+ self.stream.append([topic, s])
89
+
90
+ def get_prints(self):
91
+ prints = []
92
+ for line in self.stream:
93
+ if line[0] == "consolewrite_print":
94
+ prints.append(line[1].strip())
95
+ return prints
96
+
97
+ def get_warnerrors(self):
98
+ warnerrors = []
99
+ for line in self.stream:
100
+ if line[0] == "consolewrite_warnerror":
101
+ warnerrors.append(line[1].strip())
102
+ return warnerrors
103
+
104
+
105
+ def check_r():
106
+ """Make sure R is installed an R HOME is set"""
107
+ if not has_r():
108
+ raise RNotFoundError("Cannot find R, please set its path with the "
109
+ + "`set_r_path` function.")
110
+
111
+
112
+ def get_r_path():
113
+ """Get the path of the R executable/binary from rpy2"""
114
+ r_home = rpy2.situation.get_r_home()
115
+ return rpy2.situation.get_r_exec(r_home)
116
+
117
+
118
+ def get_r_version():
119
+ check_r()
120
+ ver_string = rpy2.situation.r_version_from_subprocess().strip()
121
+ if ver_string:
122
+ # get the actual version string
123
+ if ver_string.startswith("R version "):
124
+ ver_string = ver_string.split(" ")[2]
125
+ return ver_string
126
+
127
+
128
+ def has_lme4():
129
+ """Return True if the lme4 package is installed"""
130
+ check_r()
131
+ lme4_there = rpy2.robjects.packages.isinstalled("lme4")
132
+ statmod_there = rpy2.robjects.packages.isinstalled("statmod")
133
+ nloptr_there = rpy2.robjects.packages.isinstalled("nloptr")
134
+ return lme4_there and statmod_there and nloptr_there
135
+
136
+
137
+ def has_r():
138
+ """Return True if R is available"""
139
+ try:
140
+ hasr = rpy2.situation.get_r_home() is not None
141
+ except RUnavailableError:
142
+ hasr = False
143
+ return hasr
144
+
145
+
146
+ def import_lme4():
147
+ check_r()
148
+ if has_lme4():
149
+ lme4pkg = rpy2.robjects.packages.importr("lme4")
150
+ else:
151
+ raise ValueError(
152
+ "The R package 'lme4' is not installed, please install it via "
153
+ + "`dclab.lme4.rsetup.install_lme4()` or by executing "
154
+ + "in a shell: R -e " + '"install.packages(' + "'lme4', "
155
+ + "repos='http://cran.rstudio.org')" + '"')
156
+ return lme4pkg
157
+
158
+
159
+ def install_lme4():
160
+ """Install the lme4 package (if not already installed)
161
+
162
+ The packages are installed to the user data directory
163
+ given in :const:`lib_path`.
164
+ """
165
+ check_r()
166
+ if not has_lme4():
167
+ # import R's utility package
168
+ utils = rpy2.robjects.packages.importr('utils')
169
+ # select the first mirror in the list
170
+ utils.chooseCRANmirror(ind=1)
171
+ # install lme4 to user data directory (say yes to user dir install)
172
+ with AutoRConsole() as rc:
173
+ # install statmod and nloptr first
174
+ # (Doesn't R have package dependencies?!)
175
+ utils.install_packages(
176
+ rpy2.robjects.vectors.StrVector(["statmod", "nloptr", "lme4"]))
177
+ return rc
178
+
179
+
180
+ def set_r_path(r_path):
181
+ """Set the path of the R executable/binary for rpy2"""
182
+ if hasattr(sp, 'STARTUPINFO'):
183
+ # On Windows, subprocess calls will pop up a command window by
184
+ # default when run from Pyinstaller with the ``--noconsole``
185
+ # option. Avoid this distraction.
186
+ si = sp.STARTUPINFO()
187
+ si.dwFlags |= sp.STARTF_USESHOWWINDOW
188
+ # Windows doesn't search the path by default. Pass it an
189
+ # environment so it will.
190
+ env = os.environ
191
+ else:
192
+ si = None
193
+ env = None
194
+
195
+ tmp = sp.check_output((r_path, 'RHOME'),
196
+ startupinfo=si,
197
+ env=env,
198
+ text=True,
199
+ )
200
+
201
+ r_home = tmp.split(os.linesep)
202
+ if r_home[0].startswith('WARNING'):
203
+ res = r_home[1]
204
+ else:
205
+ res = r_home[0].strip()
206
+ os.environ["R_HOME"] = res
207
+ import_r_submodules()