karabo.native 3.0.2__tar.gz → 3.0.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 (175) hide show
  1. {karabo_native-3.0.2/src/karabo.native.egg-info → karabo_native-3.0.3}/PKG-INFO +2 -2
  2. {karabo_native-3.0.2 → karabo_native-3.0.3}/pyproject.toml +2 -2
  3. karabo_native-3.0.3/src/karabo/__init__.py +1 -0
  4. karabo_native-3.0.3/src/karabo/_version.py +1 -0
  5. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/shapes.py +45 -32
  6. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_shapes.py +66 -0
  7. karabo_native-3.0.3/src/karabo/common/tests/test_util.py +78 -0
  8. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/utils.py +18 -0
  9. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/descriptors.py +0 -2
  10. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/tests/descriptor_test.py +11 -8
  11. karabo_native-3.0.3/src/karabo/version.py +1 -0
  12. {karabo_native-3.0.2 → karabo_native-3.0.3/src/karabo.native.egg-info}/PKG-INFO +2 -2
  13. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo.native.egg-info/requires.txt +1 -1
  14. karabo_native-3.0.2/src/karabo/__init__.py +0 -1
  15. karabo_native-3.0.2/src/karabo/_version.py +0 -1
  16. karabo_native-3.0.2/src/karabo/common/tests/test_util.py +0 -36
  17. karabo_native-3.0.2/src/karabo/version.py +0 -1
  18. {karabo_native-3.0.2 → karabo_native-3.0.3}/LICENSE.md +0 -0
  19. {karabo_native-3.0.2 → karabo_native-3.0.3}/README.md +0 -0
  20. {karabo_native-3.0.2 → karabo_native-3.0.3}/setup.cfg +0 -0
  21. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/__init__.py +0 -0
  22. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/alarm_conditions.py +0 -0
  23. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/api.py +0 -0
  24. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/const.py +0 -0
  25. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/decorators.py +0 -0
  26. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/display_types.py +0 -0
  27. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/enums.py +0 -0
  28. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/module.py +0 -0
  29. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/packaging/__init__.py +0 -0
  30. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/packaging/tests/__init__.py +0 -0
  31. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/packaging/tests/test_utils.py +0 -0
  32. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/packaging/utils.py +0 -0
  33. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/__init__.py +0 -0
  34. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/api.py +0 -0
  35. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/bases.py +0 -0
  36. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/cache.py +0 -0
  37. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/const.py +0 -0
  38. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/device.py +0 -0
  39. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/device_config.py +0 -0
  40. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/lazy.py +0 -0
  41. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/macro.py +0 -0
  42. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/model.py +0 -0
  43. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/server.py +0 -0
  44. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/tests/__init__.py +0 -0
  45. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/tests/test_base.py +0 -0
  46. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/tests/test_cache.py +0 -0
  47. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/tests/test_device.py +0 -0
  48. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/tests/test_macro.py +0 -0
  49. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/tests/test_model.py +0 -0
  50. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/tests/test_server.py +0 -0
  51. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/tests/test_utils.py +0 -0
  52. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/project/utils.py +0 -0
  53. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/sanity_check.py +0 -0
  54. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/savable.py +0 -0
  55. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/__init__.py +0 -0
  56. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/api.py +0 -0
  57. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/bases.py +0 -0
  58. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/const.py +0 -0
  59. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/exceptions.py +0 -0
  60. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/generic_scenes.py +0 -0
  61. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/io_utils.py +0 -0
  62. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/layouts.py +0 -0
  63. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/model.py +0 -0
  64. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/modelio.py +0 -0
  65. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/registry.py +0 -0
  66. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/__init__.py +0 -0
  67. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/all.svg +0 -0
  68. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/all2.svg +0 -0
  69. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/inkscape/all.svg +0 -0
  70. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/inkscape/drawing.svg +0 -0
  71. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/inkscape/funny_mix.svg +0 -0
  72. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/inkscape/shapes.svg +0 -0
  73. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/legacy/icon-widgets.svg +0 -0
  74. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/legacy/icon_data/flag.svg +0 -0
  75. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/version_one_0.svg +0 -0
  76. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/version_one_1.svg +0 -0
  77. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/version_one_2.svg +0 -0
  78. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/version_one_3.svg +0 -0
  79. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/version_one_4.svg +0 -0
  80. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/data/version_one_5.svg +0 -0
  81. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_data_model_structure.py +0 -0
  82. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_graph_images.py +0 -0
  83. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_graph_plots.py +0 -0
  84. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_io.py +0 -0
  85. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_registry.py +0 -0
  86. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_unknown_widget_model.py +0 -0
  87. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_widgets_complex.py +0 -0
  88. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_widgets_icon.py +0 -0
  89. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_widgets_links.py +0 -0
  90. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_widgets_plot.py +0 -0
  91. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_widgets_simple.py +0 -0
  92. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_widgets_statefulicon.py +0 -0
  93. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/test_widgets_tools.py +0 -0
  94. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/tests/utils.py +0 -0
  95. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/__init__.py +0 -0
  96. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/complex.py +0 -0
  97. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/graph_image.py +0 -0
  98. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/graph_plots.py +0 -0
  99. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/graph_utils.py +0 -0
  100. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/icon.py +0 -0
  101. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/links.py +0 -0
  102. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/plot.py +0 -0
  103. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/simple.py +0 -0
  104. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/statefulicon.py +0 -0
  105. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/scenemodel/widgets/tools.py +0 -0
  106. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/services.py +0 -0
  107. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/states.py +0 -0
  108. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/tests/__init__.py +0 -0
  109. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/tests/test_alarm_condition.py +0 -0
  110. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/tests/test_const.py +0 -0
  111. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/tests/test_decorators.py +0 -0
  112. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/tests/test_macro_sanity_check.py +0 -0
  113. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/tests/test_module.py +0 -0
  114. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/tests/test_savable.py +0 -0
  115. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/tests/test_services.py +0 -0
  116. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/tests/test_states.py +0 -0
  117. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/common/tests/test_traits.py +0 -0
  118. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/__init__.py +0 -0
  119. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/__init__.py +0 -0
  120. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/bin_reader.py +0 -0
  121. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/bin_writer.py +0 -0
  122. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/compare.py +0 -0
  123. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/enums.py +0 -0
  124. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/hash.py +0 -0
  125. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/schema.py +0 -0
  126. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/str_converter.py +0 -0
  127. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/tests/__init__.py +0 -0
  128. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/tests/test_compare.py +0 -0
  129. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/tests/test_converters.py +0 -0
  130. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/tests/test_enums.py +0 -0
  131. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/tests/test_hash.py +0 -0
  132. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/tests/test_schema.py +0 -0
  133. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/tests/test_serializers.py +0 -0
  134. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/tests/test_timestamp.py +0 -0
  135. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/tests/test_utils.py +0 -0
  136. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/timestamp.py +0 -0
  137. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/typenums.py +0 -0
  138. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/utils.py +0 -0
  139. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/xml_reader.py +0 -0
  140. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/data/xml_writer.py +0 -0
  141. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/exceptions.py +0 -0
  142. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/project/__init__.py +0 -0
  143. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/project/api.py +0 -0
  144. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/project/convert.py +0 -0
  145. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/project/io.py +0 -0
  146. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/project/old.py +0 -0
  147. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/project/tests/__init__.py +0 -0
  148. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/project/tests/test_io.py +0 -0
  149. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/__init__.py +0 -0
  150. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/basetypes.py +0 -0
  151. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/configurable.py +0 -0
  152. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/image_data.py +0 -0
  153. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/jsonencoder.py +0 -0
  154. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/ndarray.py +0 -0
  155. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/tests/__init__.py +0 -0
  156. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/tests/basetypes_test.py +0 -0
  157. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/tests/cast_test.py +0 -0
  158. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/tests/configurable_test.py +0 -0
  159. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/tests/json_test.py +0 -0
  160. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/tests/ufunc_test.py +0 -0
  161. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/tests/utils.py +0 -0
  162. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/tests/utils_test.py +0 -0
  163. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/schema/utils.py +0 -0
  164. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/tests/__init__.py +0 -0
  165. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/tests/time_mixin_test.py +0 -0
  166. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/tests/weak_test.py +0 -0
  167. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/time_mixin.py +0 -0
  168. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/native/weak.py +0 -0
  169. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/testing/__init__.py +0 -0
  170. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/testing/import_checker.py +0 -0
  171. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/testing/resources/reference.krb +0 -0
  172. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo/testing/utils.py +0 -0
  173. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo.native.egg-info/SOURCES.txt +0 -0
  174. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo.native.egg-info/dependency_links.txt +0 -0
  175. {karabo_native-3.0.2 → karabo_native-3.0.3}/src/karabo.native.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: karabo.native
3
- Version: 3.0.2
3
+ Version: 3.0.3
4
4
  Summary: Karabo's native data Python types and models
5
5
  Author-email: European XFEL GmbH <opensource@xfel.eu>
6
6
  Maintainer-email: "S. Hauf" <steffen.hauf@xfel.eu>, "D. Goeries" <dennis.goeries@xfel.eu>
@@ -15,7 +15,7 @@ Classifier: Intended Audience :: Science/Research
15
15
  Requires-Python: >=3.12
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE.md
18
- Requires-Dist: lxml==6.0.0
18
+ Requires-Dist: lxml==6.0.1
19
19
  Requires-Dist: numpy==2.1.3
20
20
  Requires-Dist: pint>=0.24.4
21
21
  Requires-Dist: pytest==8.3.3
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" # If not defined, then legacy behavior c
6
6
 
7
7
 
8
8
  [project]
9
- version = "3.0.2"
9
+ version = "3.0.3"
10
10
  name = "karabo.native"
11
11
  description = "Karabo's native data Python types and models"
12
12
  readme = "README.md"
@@ -41,7 +41,7 @@ classifiers = [
41
41
  # For an analysis of this field vs pip's requirements files see:
42
42
  # https://packaging.python.org/discussions/install-requires-vs-requirements/
43
43
  dependencies = [
44
- "lxml==6.0.0",
44
+ "lxml==6.0.1",
45
45
  "numpy==2.1.3",
46
46
  "pint>=0.24.4",
47
47
  "pytest==8.3.3",
@@ -0,0 +1 @@
1
+ __version__ = '3.0.3'
@@ -0,0 +1 @@
1
+ version = '3.0.3'
@@ -17,6 +17,8 @@ from xml.etree.ElementTree import SubElement
17
17
 
18
18
  from traits.api import CInt, Property, String
19
19
 
20
+ from karabo.common.utils import get_arrowhead_points
21
+
20
22
  from .bases import BaseShapeObjectData
21
23
  from .const import ARROW_MIN_SIZE, NS_KARABO, NS_SVG, SVG_GROUP_TAG
22
24
  from .io_utils import get_numbers, set_numbers
@@ -180,16 +182,11 @@ def _write_base_shape_data(model, element):
180
182
  write("fill-opacity", str(model.fill_opacity))
181
183
 
182
184
 
183
- def _write_arrow_data(model, element):
184
- _write_base_shape_data(model, element)
185
- set_numbers(("x", "y", "width", "height", "x1", "y1", "x2", "y2", "hx1",
186
- "hy1", "hx2", "hy2", ), model, element)
187
-
188
-
189
185
  @register_scene_reader("Line", xmltag=NS_SVG + "line", version=1)
190
186
  def __line_reader(element):
191
187
  """A reader for Line objects in Version 1 scenes"""
192
- # Check if it is an older arrow with XML defs arrow head.
188
+ # The arrow created in Karabogui2.20 or older has arrow head as
189
+ # marker-end. We have a separate reader for this.
193
190
  if "marker-end" in element.attrib:
194
191
  return __arrow_reader(element)
195
192
 
@@ -209,23 +206,39 @@ def __line_writer(model, parent):
209
206
 
210
207
  # Don't register because this is called from the line reader
211
208
  def __arrow_reader(element):
209
+ """Reader for arrow with marker-end as header, from Karabogui 2.20 or
210
+ older. Karabogui 2.21 onwards, the arrow head is stored as polygon which
211
+ can be calculated from the line coordinates x1,y1, x2,y2.
212
+
213
+ This can be deleted when all the arrows with marker-end are updated to
214
+ arrows with polygon.
215
+ """
212
216
  traits = _read_base_shape_data(element)
213
- traits.update(get_numbers(("x1", "y1", "x2", "y2"), element))
217
+ points = get_numbers(("x1", "y1", "x2", "y2"), element)
218
+ hx1, hy1, hx2, hy2 = get_arrowhead_points(**points)
219
+ points.update({"hx1": hx1, "hy1": hy1, "hx2": hx2, "hy2": hy2})
220
+ traits.update(points)
214
221
  return ArrowPolygonModel(**traits)
215
222
 
216
223
 
217
- def __set_points(model, polygon_element):
218
- """ Sets the arrowhead points as string. eg 'x1,y1 x2,y2 x3,y3' """
224
+ def _write_arrow_polygon(model, element):
225
+ """Sets the arrowhead points as string. Eg 'x1,y1 x2,y2 x3,y3'.
226
+
227
+ The points are only written to svg files so that the arrow header can
228
+ appear in any svg editor - like inkscape.
229
+ They are never read by model, as they are calculated from the line points.
230
+ """
231
+
219
232
  points = (f"{model.x2},{model.y2} "
220
233
  f"{model.hx1},{model.hy1} "
221
234
  f"{model.hx2},{model.hy2} ")
222
- polygon_element.set("points", points)
235
+ element.set("points", points)
223
236
 
224
237
 
225
- def __get_points(polygon_element):
226
- """Reads the polygon element's points . Point is stored as
227
- 'x1,y1 x2,y2 x3,y3' """
228
- points = polygon_element.get("points").strip()
238
+ def _read_arrow_polygon(element):
239
+ """Reads the polygon element's points. SVG stores the points,
240
+ for example, for triangle as 'x1,y1 x2,y2 x3,y3' """
241
+ points = element.get("points").strip()
229
242
  _, hp1, hp2 = points.split(" ")
230
243
  hx1, hy1 = hp1.split(",")
231
244
  hx2, hy2 = hp2.split(",")
@@ -235,25 +248,27 @@ def __get_points(polygon_element):
235
248
  @register_scene_reader("ArrowPolygonModel", xmltag=SVG_GROUP_TAG,
236
249
  version=2)
237
250
  def arrow_polygon_reader(element):
251
+ # Read the line
238
252
  line = element.find(NS_SVG + "line")
239
- polygon = element.find(NS_SVG + "polygon")
240
- # line and polygon are None if the model is written by UnknownWidget,
241
- # from older KaraboGUI.
253
+
254
+ # The line and polygon sub-elements are not present if the model is
255
+ # written by 'UnknownWidget' for arrow with polygon, from Karabogui 2.20 or
256
+ # older. However, the parent element still has the information to
257
+ # regenerate the line. Hence, reading the data from the parent 'element'.
242
258
  if line is None:
243
259
  traits = _read_base_shape_data(element)
260
+ points = get_numbers(("x1", "y1", "x2", "y2"), element)
261
+ hx1, hy1, hx2, hy2 = get_arrowhead_points(**points)
262
+ points.update({"hx1": hx1, "hy1": hy1, "hx2": hx2, "hy2": hy2})
263
+ traits.update(points)
244
264
  else:
245
265
  traits = _read_base_shape_data(line)
266
+ traits.update(get_numbers(("x1", "y1", "x2", "y2"), line))
267
+
268
+ polygon = element.find(NS_SVG + "polygon")
269
+ points = _read_arrow_polygon(element=polygon)
270
+ traits.update(points)
246
271
 
247
- if polygon is None:
248
- hx1 = element.attrib["hx1"]
249
- hx2 = element.attrib["hx2"]
250
- hy1 = element.attrib["hy1"]
251
- hy2 = element.attrib["hy2"]
252
- points = {"hx1": hx1, "hy1": hy1, "hx2": hx2, "hy2": hy2}
253
- else:
254
- points = __get_points(polygon_element=polygon)
255
- traits.update(points)
256
- traits.update(get_numbers(("x", "y", "x1", "y1", "x2", "y2"), element))
257
272
  return ArrowPolygonModel(**traits)
258
273
 
259
274
 
@@ -269,12 +284,10 @@ def arrow_polygon_writer(model, parent):
269
284
  set_numbers(("x1", "y1", "x2", "y2"), model, line)
270
285
 
271
286
  polygon_element = SubElement(element, NS_SVG + "polygon")
272
- __set_points(model=model, polygon_element=polygon_element)
287
+ _write_arrow_polygon(model, polygon_element)
273
288
  model.fill = model.stroke
274
- # Write all the model values to element also, so that in KaraboGUI
275
- # older than 2.21 the unsupported widget is shown.
276
- _write_arrow_data(model, element)
277
289
  _write_base_shape_data(model, polygon_element)
290
+
278
291
  return element
279
292
 
280
293
 
@@ -13,6 +13,7 @@
13
13
  # Karabo is distributed in the hope that it will be useful, but WITHOUT ANY
14
14
  # WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
15
  # FITNESS FOR A PARTICULAR PURPOSE.
16
+ from karabo.common.utils import get_arrowhead_points
16
17
  from karabo.testing.utils import temp_xml_file
17
18
 
18
19
  from ..model import UnknownXMLDataModel
@@ -143,10 +144,75 @@ def test_svg_arrow():
143
144
  assert arrow_model.y1 == 50
144
145
  assert arrow_model.x2 == 95
145
146
  assert arrow_model.y2 == 75
147
+ hx1, hy1, hx2, hy2 = get_arrowhead_points(
148
+ arrow_model.x1, arrow_model.y1, arrow_model.x2, arrow_model.y2)
149
+
150
+ assert hx1 == arrow_model.hx1
151
+ assert hy1 == arrow_model.hy1
152
+ assert hx2 == arrow_model.hx2
153
+ assert hy2 == arrow_model.hy2
146
154
 
147
155
  assert arrow_model.stroke == "#000"
148
156
  assert arrow_model.stroke_width == 5
149
157
 
158
+ read_model = single_model_round_trip(arrow_model)
159
+ assert read_model.x1 == arrow_model.x1
160
+ assert read_model.x2 == arrow_model.x2
161
+ assert read_model.y1 == arrow_model.y1
162
+ assert read_model.y2 == arrow_model.y2
163
+
164
+
165
+ def test_arrow_with_polygon():
166
+ # A round trip for the model
167
+ traits = _base_shape_traits()
168
+ traits.update({"x1": 0, "y1": 1, "x2": 2, "y2": 3})
169
+ arrow_model = ArrowPolygonModel(**traits)
170
+ read_model = single_model_round_trip(arrow_model)
171
+
172
+ assert read_model.x1 == 0
173
+ assert read_model.y1 == 1
174
+ assert read_model.x2 == 2
175
+ assert read_model.y2 == 3
176
+
177
+ assert arrow_model.hx1 == read_model.hx1
178
+ assert arrow_model.hy1 == read_model.hy1
179
+ assert arrow_model.hx2 == read_model.hx2
180
+ assert arrow_model.hy2 == read_model.hy2
181
+
182
+
183
+ def test_polygon_arrow_from_xml_def():
184
+
185
+ # SVG from UnknownWidget in Karabo2.20 for the polygon arrow created in
186
+ # Karabo2.21
187
+ SCENE_SVG = (
188
+ """<svg:svg xmlns:krb="http://karabo.eu/scene" xmlns:svg='http://www.w3.org/2000/svg'
189
+ krb:version="2" krb:uuid="7bf41ba7-e675-46d4-82d3-a56b5662e965" height="768" width="1024">
190
+ <svg:rect krb:class="ArrowPolygonModel" krb:widget="ArrowPolygonModel" krb:keys=""
191
+ x="50" y="130" width="150" height="10" stroke="#000000" stroke-opacity="1.0"
192
+ stroke-linecap="butt" stroke-dashoffset="0.0" stroke-width="1.0"
193
+ stroke-dasharray="" stroke-style="1" stroke-linejoin="miter"
194
+ stroke-miterlimit="4.0" fill="#000000" fill-opacity="1.0" x1="50" y1="130"
195
+ x2="200" y2="130" hx1="190" hy1="133" hx2="190" hy2="127">
196
+ </svg:rect>
197
+ </svg:svg>""" # noqa
198
+ )
199
+ with temp_xml_file(SCENE_SVG) as fn:
200
+ scene_model = read_scene(fn)
201
+ assert len(scene_model.children) == 1
202
+ arrow = scene_model.children[0]
203
+ assert isinstance(arrow, ArrowPolygonModel)
204
+ assert arrow.x == 50
205
+ assert arrow.y == 130
206
+ assert arrow.x1 == 50
207
+ assert arrow.y1 == 130
208
+ assert arrow.x2 == 200
209
+ assert arrow.y2 == 130
210
+
211
+ assert arrow.hx1 == 190
212
+ assert arrow.hy1 == 133
213
+ assert arrow.hx2 == 190
214
+ assert arrow.hy2 == 127
215
+
150
216
 
151
217
  def test_svg_defs():
152
218
  SCENE_SVG = (
@@ -0,0 +1,78 @@
1
+ # This file is part of Karabo.
2
+ #
3
+ # http://www.karabo.eu
4
+ #
5
+ # Copyright (C) European XFEL GmbH Schenefeld. All rights reserved.
6
+ #
7
+ # Karabo is free software: you can redistribute it and/or modify it under
8
+ # the terms of the MPL-2 Mozilla Public License.
9
+ #
10
+ # You should have received a copy of the MPL-2 Public License along with
11
+ # Karabo. If not, see <https://www.mozilla.org/en-US/MPL/2.0/>.
12
+ #
13
+ # Karabo is distributed in the hope that it will be useful, but WITHOUT ANY
14
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
+ # FITNESS FOR A PARTICULAR PURPOSE.
16
+ from karabo.common.api import WeakMethodRef
17
+ from karabo.common.utils import get_arrowhead_points
18
+
19
+
20
+ def test_weak_method_ref():
21
+ """Test that we can safely call bound methods"""
22
+ global called
23
+ called = False
24
+
25
+ class Device:
26
+ def move(self):
27
+ global called
28
+ called = True
29
+
30
+ device = Device()
31
+ func = WeakMethodRef(device.move)
32
+ func()
33
+ assert called is True
34
+ called = False
35
+ del device
36
+ func()
37
+ assert called is False
38
+
39
+
40
+ def test_get_arrowhead_points():
41
+ # Test case 1: Horizontal line
42
+ x1, y1, x2, y2 = 0, 0, 100, 0
43
+ hx1, hy1, hx2, hy2 = get_arrowhead_points(x1, y1, x2, y2)
44
+
45
+ assert hx1 < x2 and hx2 < x2, (
46
+ "Arrowhead points should be behind the endpoint")
47
+ assert hx1 == hx2, (
48
+ "Arrowhead points should have the same x-coordinate")
49
+ assert hy1 == - hy2, "Left y should be negative of right y "
50
+
51
+ # Test case 2: Vertical line
52
+ x1, y1, x2, y2 = 0, 0, 0, 100
53
+ hx1, hy1, hx2, hy2 = get_arrowhead_points(x1, y1, x2, y2)
54
+ assert hy1 < y2 and hy2 < y2, (
55
+ "Arrowhead points should be above the endpoint")
56
+ assert round(hx1, 9) == round(-hx2, 9), (
57
+ "left x should be negative right x")
58
+ assert hy1 == hy2
59
+
60
+ # Test case 3: Diagonal line
61
+ x1, y1, x2, y2 = 0, 0, 100, 100
62
+ hx1, hy1, hx2, hy2 = get_arrowhead_points(x1, y1, x2, y2)
63
+
64
+ assert not hx1 == hx2, "Arrowhead points X-coordinates should be distinct"
65
+ assert not hy1 == hy2, "Arrowhead points Y-coordinates should be distinct"
66
+ assert hx1 < x2 and hx2 < x2, (
67
+ "Arrowhead points should be behind the endpoint")
68
+ assert hy1 < y2 and hy2 < y2, (
69
+ "Arrowhead points should be below the endpoint")
70
+
71
+ # Test case 4: Negative coordinates
72
+ x1, y1, x2, y2 = -100, -100, -200, -200
73
+ hx1, hy1, hx2, hy2 = get_arrowhead_points(x1, y1, x2, y2)
74
+
75
+ assert not hx1 == hx2, "Arrowhead points X-coordinates should be distinct"
76
+ assert not hy1 == hy2, "Arrowhead points Y-coordinates should be distinct"
77
+ assert hx1 == hy2
78
+ assert hy1 == hx2
@@ -17,6 +17,7 @@
17
17
  # WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
18
  # FITNESS FOR A PARTICULAR PURPOSE.
19
19
  #############################################################################
20
+ import math
20
21
  import weakref
21
22
  from inspect import signature
22
23
  from types import MethodType
@@ -105,3 +106,20 @@ class WeakMethodRef:
105
106
 
106
107
  def _owner_deleted(self, ref):
107
108
  self.obj = None
109
+
110
+
111
+ def get_arrowhead_points(x1: int, y1: int, x2: int, y2: int) -> (
112
+ tuple)[int, int, int, int]:
113
+ """Calculate the two points for the arrow head for the given lines"""
114
+ arrow_size = 10
115
+ angle_offset = math.pi / 10
116
+ angle = math.atan2(y2 - y1, x2 - x1)
117
+
118
+ # The points for the arrowhead triangle
119
+ hx1 = round(x2 - arrow_size * math.cos(angle - angle_offset))
120
+ hy1 = round(y2 - arrow_size * math.sin(angle - angle_offset))
121
+
122
+ hx2 = round(x2 - arrow_size * math.cos(angle + angle_offset))
123
+ hy2 = round(y2 - arrow_size * math.sin(angle + angle_offset))
124
+
125
+ return hx1, hy1, hx2, hy2
@@ -69,8 +69,6 @@ class Attribute:
69
69
  __slots__ = ["default", "dtype", "name"]
70
70
 
71
71
  def __init__(self, default=None, dtype=None):
72
- if dtype is np.float32:
73
- dtype = np.float64
74
72
  self.name = None
75
73
  self.dtype = dtype
76
74
  self.default = self.check(default)
@@ -337,7 +337,7 @@ class Tests(TestCase):
337
337
  defaultValue=[1, 2, 3])
338
338
  default = d.defaultValue
339
339
  # Test that the values are casted to floats
340
- self.assertEqual(type(default[0]), np.float64)
340
+ self.assertEqual(type(default[0]), np.float32)
341
341
  self.assertEqual(d.defaultValue, [1.0, 2.0, 3.0])
342
342
 
343
343
  v = d.toKaraboValue([2, 3, 4])
@@ -1117,13 +1117,16 @@ class Tests(TestCase):
1117
1117
  desc, 1, 10, 0, 11, # Desc, minInc, maxInc, minExc, maxExc,
1118
1118
  3) # value
1119
1119
 
1120
- # We assert numpy attributes as well for Float and Double, they will
1121
- # be casted, but all attribute for floating points have 64 bit!
1122
- for desc in [Float, Double]:
1123
- self.assert_numpy_attributes(
1124
- desc, 1.30, 10.02, # Desc, minInc, maxInc,
1125
- 0.12, 11.37, # minExc, maxExc,
1126
- 3.07, dtype=np.float64) # default value, dtype
1120
+ # We assert numpy attributes as well for Float and Double
1121
+ self.assert_numpy_attributes(
1122
+ Float, 1.30, 10.02, # Desc, minInc, maxInc,
1123
+ 0.12, 11.37, # minExc, maxExc,
1124
+ 3.07, dtype=np.float32) # default value, dtype
1125
+
1126
+ self.assert_numpy_attributes(
1127
+ Double, 1.30, 10.02, # Desc, minInc, maxInc,
1128
+ 0.12, 11.37, # minExc, maxExc,
1129
+ 3.07, dtype=np.float64) # default value, dtype
1127
1130
 
1128
1131
  # Attributes are casted to their numpy type
1129
1132
  d = Int8(defaultValue=8.2)
@@ -0,0 +1 @@
1
+ version = '3.0.3'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: karabo.native
3
- Version: 3.0.2
3
+ Version: 3.0.3
4
4
  Summary: Karabo's native data Python types and models
5
5
  Author-email: European XFEL GmbH <opensource@xfel.eu>
6
6
  Maintainer-email: "S. Hauf" <steffen.hauf@xfel.eu>, "D. Goeries" <dennis.goeries@xfel.eu>
@@ -15,7 +15,7 @@ Classifier: Intended Audience :: Science/Research
15
15
  Requires-Python: >=3.12
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE.md
18
- Requires-Dist: lxml==6.0.0
18
+ Requires-Dist: lxml==6.0.1
19
19
  Requires-Dist: numpy==2.1.3
20
20
  Requires-Dist: pint>=0.24.4
21
21
  Requires-Dist: pytest==8.3.3
@@ -1,4 +1,4 @@
1
- lxml==6.0.0
1
+ lxml==6.0.1
2
2
  numpy==2.1.3
3
3
  pint>=0.24.4
4
4
  pytest==8.3.3
@@ -1 +0,0 @@
1
- __version__ = '3.0.2'
@@ -1 +0,0 @@
1
- version = '3.0.2'
@@ -1,36 +0,0 @@
1
- # This file is part of Karabo.
2
- #
3
- # http://www.karabo.eu
4
- #
5
- # Copyright (C) European XFEL GmbH Schenefeld. All rights reserved.
6
- #
7
- # Karabo is free software: you can redistribute it and/or modify it under
8
- # the terms of the MPL-2 Mozilla Public License.
9
- #
10
- # You should have received a copy of the MPL-2 Public License along with
11
- # Karabo. If not, see <https://www.mozilla.org/en-US/MPL/2.0/>.
12
- #
13
- # Karabo is distributed in the hope that it will be useful, but WITHOUT ANY
14
- # WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
- # FITNESS FOR A PARTICULAR PURPOSE.
16
- from karabo.common.api import WeakMethodRef
17
-
18
-
19
- def test_weak_method_ref():
20
- """Test that we can safely call bound methods"""
21
- global called
22
- called = False
23
-
24
- class Device:
25
- def move(self):
26
- global called
27
- called = True
28
-
29
- device = Device()
30
- func = WeakMethodRef(device.move)
31
- func()
32
- assert called is True
33
- called = False
34
- del device
35
- func()
36
- assert called is False
@@ -1 +0,0 @@
1
- version = '3.0.2'
File without changes
File without changes
File without changes