c2cwsgiutils 6.2.0.dev52__tar.gz → 6.2.0.dev55__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 (66) hide show
  1. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/PKG-INFO +1 -1
  2. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/acceptance/image.py +10 -3
  3. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/pyproject.toml +1 -1
  4. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/LICENSE +0 -0
  5. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/README.md +0 -0
  6. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/__init__.py +0 -0
  7. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/acceptance/__init__.py +0 -0
  8. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/acceptance/connection.py +0 -0
  9. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/acceptance/package-lock.json +0 -0
  10. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/acceptance/package.json +0 -0
  11. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/acceptance/print.py +0 -0
  12. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/acceptance/screenshot.js +0 -0
  13. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/acceptance/utils.py +0 -0
  14. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/auth.py +0 -0
  15. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/broadcast/__init__.py +0 -0
  16. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/broadcast/interface.py +0 -0
  17. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/broadcast/local.py +0 -0
  18. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/broadcast/redis.py +0 -0
  19. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/broadcast/utils.py +0 -0
  20. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/client_info.py +0 -0
  21. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/config_utils.py +0 -0
  22. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/coverage_setup.py +0 -0
  23. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/db.py +0 -0
  24. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/db_maintenance_view.py +0 -0
  25. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/debug/__init__.py +0 -0
  26. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/debug/_listeners.py +0 -0
  27. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/debug/_views.py +0 -0
  28. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/debug/utils.py +0 -0
  29. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/errors.py +0 -0
  30. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/health_check.py +0 -0
  31. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/index.py +0 -0
  32. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/loader.py +0 -0
  33. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/logging_view.py +0 -0
  34. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/models_graph.py +0 -0
  35. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/pretty_json.py +0 -0
  36. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/profiler.py +0 -0
  37. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/prometheus.py +0 -0
  38. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/py.typed +0 -0
  39. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/pyramid.py +0 -0
  40. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/pyramid_logging.py +0 -0
  41. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/redis_stats.py +0 -0
  42. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/redis_utils.py +0 -0
  43. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/request_tracking/__init__.py +0 -0
  44. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/request_tracking/_sql.py +0 -0
  45. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/scripts/__init__.py +0 -0
  46. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/scripts/genversion.py +0 -0
  47. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/scripts/stats_db.py +0 -0
  48. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/scripts/test_print.py +0 -0
  49. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/sentry.py +0 -0
  50. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/services.py +0 -0
  51. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/setup_process.py +0 -0
  52. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/sql_profiler/__init__.py +0 -0
  53. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/sql_profiler/_impl.py +0 -0
  54. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/sqlalchemylogger/README.md +0 -0
  55. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/sqlalchemylogger/__init__.py +0 -0
  56. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/sqlalchemylogger/_filters.py +0 -0
  57. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/sqlalchemylogger/_models.py +0 -0
  58. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/sqlalchemylogger/examples/example.py +0 -0
  59. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/sqlalchemylogger/handlers.py +0 -0
  60. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/static/favicon-16x16.png +0 -0
  61. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/static/favicon-32x32.png +0 -0
  62. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/stats_pyramid/__init__.py +0 -0
  63. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/stats_pyramid/_db_spy.py +0 -0
  64. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/stats_pyramid/_pyramid_spy.py +0 -0
  65. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/templates/index.html.mako +0 -0
  66. {c2cwsgiutils-6.2.0.dev52 → c2cwsgiutils-6.2.0.dev55}/c2cwsgiutils/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: c2cwsgiutils
3
- Version: 6.2.0.dev52
3
+ Version: 6.2.0.dev55
4
4
  Summary: Common utilities for Camptocamp WSGI applications
5
5
  Home-page: https://github.com/camptocamp/c2cwsgiutils
6
6
  License: BSD-2-Clause
@@ -58,7 +58,7 @@ def normalize_image(image: NpNdarrayInt) -> NpNdarrayInt:
58
58
  return image
59
59
 
60
60
 
61
- def check_image(
61
+ def check_image( # pylint: disable=too-many-locals,too-many-statements
62
62
  result_folder: str,
63
63
  image_to_check: NpNdarrayInt,
64
64
  expected_filename: str,
@@ -109,6 +109,13 @@ def check_image(
109
109
 
110
110
  mask = None
111
111
  if mask_filename is not None:
112
+ background_color = [255, 255, 255]
113
+ for color in range(3):
114
+ img_hist, _ = skimage.exposure.histogram(
115
+ image_to_check[..., color], nbins=256, source_range="dtype"
116
+ )
117
+ background_color[color] = np.argmax(img_hist)
118
+
112
119
  mask = skimage.io.imread(mask_filename)
113
120
 
114
121
  assert mask is not None, "Wrong mask: " + mask_filename
@@ -131,7 +138,7 @@ def check_image(
131
138
  assert (
132
139
  mask.shape[0] == image_to_check.shape[0] and mask.shape[1] == image_to_check.shape[1]
133
140
  ), f"Mask and image should have the same shape ({mask.shape} != {image_to_check.shape})"
134
- image_to_check[mask] = [255, 255, 255]
141
+ image_to_check[mask] = background_color
135
142
 
136
143
  if not os.path.exists(result_folder):
137
144
  os.makedirs(result_folder)
@@ -149,7 +156,7 @@ def check_image(
149
156
  assert (
150
157
  expected.shape[0] == mask.shape[0] and expected.shape[1] == mask.shape[1]
151
158
  ), f"Mask and expected image should have the same shape ({mask.shape} != {expected.shape})"
152
- expected[mask] = [255, 255, 255]
159
+ expected[mask] = background_color
153
160
 
154
161
  assert (
155
162
  expected.shape == image_to_check.shape
@@ -16,7 +16,7 @@ strict = true
16
16
 
17
17
  [tool.poetry]
18
18
  name = "c2cwsgiutils"
19
- version = "6.2.0.dev52"
19
+ version = "6.2.0.dev55"
20
20
  description = "Common utilities for Camptocamp WSGI applications"
21
21
  readme = "README.md"
22
22
  authors = ["Camptocamp <info@camptocamp.com>"]