newsworthycharts 1.54.1__tar.gz → 1.54.4__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 (63) hide show
  1. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/PKG-INFO +21 -2
  2. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/README.rst +19 -0
  3. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/__init__.py +1 -1
  4. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/chart.py +14 -8
  5. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/lib/formatter.py +4 -4
  6. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/serialchart.py +2 -1
  7. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts.egg-info/PKG-INFO +21 -2
  8. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts.egg-info/requires.txt +5 -5
  9. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/requirements.txt +5 -5
  10. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/setup.py +5 -5
  11. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/.flake8 +0 -0
  12. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/.github/workflows/lint.yml +0 -0
  13. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/.pre-commit-config.yaml +0 -0
  14. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/.pylintrc +0 -0
  15. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/LICENSE.txt +0 -0
  16. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/MANIFEST.in +0 -0
  17. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/bubblemap.py +0 -0
  18. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/categoricalchart.py +0 -0
  19. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/choroplethmap.py +0 -0
  20. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/custom/__init__.py +0 -0
  21. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/custom/climate_cars.py +0 -0
  22. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/datawrapper.py +0 -0
  23. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/lib/__init__.py +0 -0
  24. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/lib/color_fn.py +0 -0
  25. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/lib/colors.py +0 -0
  26. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/lib/datalist.py +0 -0
  27. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/lib/geography.py +0 -0
  28. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/lib/locator.py +0 -0
  29. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/lib/mimetypes.py +0 -0
  30. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/lib/utils.py +0 -0
  31. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/map.py +0 -0
  32. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/maps/se-4.gpkg +0 -0
  33. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/maps/se-7.gpkg +0 -0
  34. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/rangeplot.py +0 -0
  35. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/rc/newsworthy +0 -0
  36. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/scatterplot.py +0 -0
  37. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/seasonalchart.py +0 -0
  38. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/storage.py +0 -0
  39. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/stripechart.py +0 -0
  40. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/translations/datawrapper_regions.csv +0 -0
  41. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/translations/regions.py +0 -0
  42. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts/translations/se_municipalities.csv +0 -0
  43. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts.egg-info/SOURCES.txt +0 -0
  44. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts.egg-info/dependency_links.txt +0 -0
  45. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts.egg-info/not-zip-safe +0 -0
  46. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/newsworthycharts.egg-info/top_level.txt +0 -0
  47. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/setup.cfg +0 -0
  48. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/__init__.py +0 -0
  49. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/data/__init__.py +0 -0
  50. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/data/elpriser.json +0 -0
  51. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/data/range_plot_with_long_labels.json +0 -0
  52. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/data/scatterplot.py +0 -0
  53. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/data/test-so2.csv +0 -0
  54. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/images/logo.png +0 -0
  55. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/test_categorical_chart.py +0 -0
  56. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/test_choropleth_maps.py +0 -0
  57. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/test_custom_climate_cars.py +0 -0
  58. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/test_data_list.py +0 -0
  59. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/test_datawrapper.py +0 -0
  60. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/test_main.py +0 -0
  61. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/test_rangeplot.py +0 -0
  62. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/test_scatterplot.py +0 -0
  63. {newsworthycharts-1.54.1 → newsworthycharts-1.54.4}/test/test_serial_chart.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsworthycharts
3
- Version: 1.54.1
3
+ Version: 1.54.4
4
4
  Summary: Matplotlib wrapper to create charts and publish them on Amazon S3
5
5
  Home-page: https://github.com/jplusplus/newsworthycharts
6
- Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.54.1.tar.gz
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.54.4.tar.gz
7
7
  Author: Jens Finnäs and Leo Wallentin, J++ Stockholm
8
8
  Author-email: stockholm@jplusplus.org
9
9
  License: MIT
@@ -168,6 +168,25 @@ Roadmap
168
168
  Changelog
169
169
  ---------
170
170
 
171
+ - 1.54.4
172
+
173
+ - Use Babel 2.14, and pin version
174
+ - Require numpy>=1.21.0 (now required by Matplotlib)
175
+ - Patch upgrades: matplotlib==3.8.2; geopandas==0.14.1
176
+
177
+ - 1.54.3
178
+
179
+ - Fix duplicated integer values in y axis
180
+
181
+ - 1.54.2
182
+
183
+ - Make sure that legend is always on top of bars in stacked bar charts
184
+ - Support more stacked categories in serial bar charts
185
+
186
+ - 1.52.2+
187
+
188
+ - Backport various 1.54.x fixes
189
+
171
190
  - 1.54.1
172
191
 
173
192
  - Patch upgrade Matplotlib to 3.8.1
@@ -155,6 +155,25 @@ Roadmap
155
155
  Changelog
156
156
  ---------
157
157
 
158
+ - 1.54.4
159
+
160
+ - Use Babel 2.14, and pin version
161
+ - Require numpy>=1.21.0 (now required by Matplotlib)
162
+ - Patch upgrades: matplotlib==3.8.2; geopandas==0.14.1
163
+
164
+ - 1.54.3
165
+
166
+ - Fix duplicated integer values in y axis
167
+
168
+ - 1.54.2
169
+
170
+ - Make sure that legend is always on top of bars in stacked bar charts
171
+ - Support more stacked categories in serial bar charts
172
+
173
+ - 1.52.2+
174
+
175
+ - Backport various 1.54.x fixes
176
+
158
177
  - 1.54.1
159
178
 
160
179
  - Patch upgrade Matplotlib to 3.8.1
@@ -1,4 +1,4 @@
1
- __version__ = "1.54.1"
1
+ __version__ = "1.54.4"
2
2
 
3
3
  from .chart import Chart
4
4
  from .choroplethmap import ChoroplethMap
@@ -376,7 +376,6 @@ class Chart(object):
376
376
  loc = get_best_locator(delta, len(dates), self.interval)
377
377
  self.ax.xaxis.set_major_locator(loc)
378
378
  formatter = Formatter(self._language)
379
- print(self._language)
380
379
 
381
380
  # if isinstance(loc, WeekdayLocator):
382
381
  if self.interval == "weekly":
@@ -473,13 +472,20 @@ class Chart(object):
473
472
  keep_trying = False
474
473
  try_dec += 1
475
474
  # If we still have duplicates; remove them!
476
- """
477
- tl = [x.get_text() for x in self.value_axis.get_ticklabels()]
478
- tl_ = [x for (i, x) in enumerate(tl) if tl[i - 1] != x]
479
- if len(tl_) < len(tl):
480
- tl = [x if i < len(tl) - 1 and tl[i + 1] != x else "" for (i, x) in enumerate(tl)]
481
- self.value_axis.set_ticklabels(tl)
482
- """
475
+ # If we still have duplicates; remove them!
476
+ ticks = self.value_axis.get_ticklabels()
477
+ ticks_ = [x for (i, x) in enumerate(ticks) if ticks[i - 1].get_text() != x.get_text()]
478
+ if len(ticks_) < len(ticks):
479
+ y = [float(x._y) for x in ticks_]
480
+ if self.decimals == 0:
481
+ # Recrate with integeres
482
+ import math
483
+ _bottom = min(y)
484
+ _top = math.ceil(max(y))
485
+ _bottom, _top = int(_bottom), int(_top)
486
+ y = range(_bottom, _top + 1)
487
+ y = [float(x) for x in y]
488
+ self.value_axis.set_ticks(y)
483
489
 
484
490
  for a in self.annotations:
485
491
  self._annotate_point(a["text"], a["xy"], a["direction"])
@@ -67,7 +67,7 @@ class Formatter(object):
67
67
  pattern[1] = ".#" + pattern[1]
68
68
  pattern = "0".join(pattern)
69
69
  string = format_decimal(x, locale=self.l, format=pattern)
70
- minus = self.l.number_symbols["minusSign"]
70
+ minus = self.l.number_symbols["latn"]["minusSign"]
71
71
  string = string.replace("-", minus)
72
72
  return string
73
73
 
@@ -79,7 +79,7 @@ class Formatter(object):
79
79
 
80
80
  x = round(Decimal(x), decimals)
81
81
  string = format_unit(x, 'temperature-generic', "short", locale=self.l)
82
- minus = self.l.number_symbols["minusSign"]
82
+ minus = self.l.number_symbols["latn"]["minusSign"]
83
83
  string = string.replace("-", minus)
84
84
  # if x > 0:
85
85
  # string = "+" + string
@@ -94,7 +94,7 @@ class Formatter(object):
94
94
  scale = "temperature-{}".format(self.scale)
95
95
  x = round(Decimal(x), decimals)
96
96
  string = format_unit(x, scale, "short", locale=self.l)
97
- minus = self.l.number_symbols["minusSign"]
97
+ minus = self.l.number_symbols["latn"]["minusSign"]
98
98
  string = string.replace("-", minus)
99
99
  return string
100
100
 
@@ -117,7 +117,7 @@ class Formatter(object):
117
117
  pattern[1] = "0" * decimals + pattern[1]
118
118
  pattern = ".".join(pattern)
119
119
  string = format_decimal(x, locale=self.l, format=pattern)
120
- minus = self.l.number_symbols["minusSign"]
120
+ minus = self.l.number_symbols["latn"]["minusSign"]
121
121
  string = string.replace("-", minus)
122
122
  return string
123
123
 
@@ -529,7 +529,8 @@ class SerialChart(Chart):
529
529
  # title is assumed to self-explanatory
530
530
  if len(self.labels) > 1:
531
531
  if self.label_placement == "legend":
532
- self.ax.legend(loc="best")
532
+ _ = self.ax.legend(loc="best")
533
+ _.set(zorder=10)
533
534
  elif self.label_placement == "outside":
534
535
  self.ax.legend(bbox_to_anchor=(0, 1, 1, 0), loc="lower right")
535
536
  elif self.label_placement == "inline":
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: newsworthycharts
3
- Version: 1.54.1
3
+ Version: 1.54.4
4
4
  Summary: Matplotlib wrapper to create charts and publish them on Amazon S3
5
5
  Home-page: https://github.com/jplusplus/newsworthycharts
6
- Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.54.1.tar.gz
6
+ Download-URL: https://github.com/jplusplus/newsworthycharts/archive/1.54.4.tar.gz
7
7
  Author: Jens Finnäs and Leo Wallentin, J++ Stockholm
8
8
  Author-email: stockholm@jplusplus.org
9
9
  License: MIT
@@ -168,6 +168,25 @@ Roadmap
168
168
  Changelog
169
169
  ---------
170
170
 
171
+ - 1.54.4
172
+
173
+ - Use Babel 2.14, and pin version
174
+ - Require numpy>=1.21.0 (now required by Matplotlib)
175
+ - Patch upgrades: matplotlib==3.8.2; geopandas==0.14.1
176
+
177
+ - 1.54.3
178
+
179
+ - Fix duplicated integer values in y axis
180
+
181
+ - 1.54.2
182
+
183
+ - Make sure that legend is always on top of bars in stacked bar charts
184
+ - Support more stacked categories in serial bar charts
185
+
186
+ - 1.52.2+
187
+
188
+ - Backport various 1.54.x fixes
189
+
171
190
  - 1.54.1
172
191
 
173
192
  - Patch upgrade Matplotlib to 3.8.1
@@ -1,13 +1,13 @@
1
- Babel>=2.12
1
+ Babel<3,>=2.14.0
2
2
  Pillow==10.1.0
3
3
  PyYAML>=3
4
4
  adjustText==0.7.3
5
5
  boto3>=1.26
6
- geopandas==0.14.0
6
+ geopandas==0.14.1
7
7
  langcodes>=3.3
8
8
  mapclassify==2.6.1
9
9
  matplotlib-label-lines==0.5.1
10
- matplotlib==3.8.1
11
- numpy<2,>=1.19.1
12
- python-dateutil>=2
10
+ matplotlib==3.8.2
11
+ numpy<2,>=1.21.0
12
+ python-dateutil<3,>=2
13
13
  requests>=2.22
@@ -1,10 +1,10 @@
1
- boto3==1.28.72
2
- matplotlib==3.8.1
1
+ boto3==1.34.2
2
+ matplotlib==3.8.2
3
3
  langcodes==3.3.0
4
- Babel==2.13.1
4
+ Babel==2.14.0
5
5
  PyYAML==6.0.1
6
6
  adjustText==0.7.3
7
- numpy==1.26.1
7
+ numpy==1.26.2
8
8
  python-dateutil==2.8.2
9
9
  pytest==7.4.3
10
10
  flake8==6.1.0
@@ -12,5 +12,5 @@ requests==2.31.0
12
12
  python-dotenv==1.0.0
13
13
  matplotlib-label-lines==0.5.1
14
14
  Pillow==10.1.0
15
- geopandas==0.14.0
15
+ geopandas==0.14.1
16
16
  mapclassify==2.6.1
@@ -25,17 +25,17 @@ setup(
25
25
  python_requires='>=3.9',
26
26
  install_requires=[
27
27
  "boto3>=1.26",
28
- "matplotlib==3.8.1",
28
+ "matplotlib==3.8.2",
29
29
  "langcodes>=3.3",
30
- "Babel>=2.12",
30
+ "Babel>=2.14.0,<3",
31
31
  "PyYAML>=3",
32
32
  "adjustText==0.7.3",
33
- "numpy>=1.19.1,<2",
34
- "python-dateutil>=2",
33
+ "numpy>=1.21.0,<2",
34
+ "python-dateutil>=2,<3",
35
35
  "Pillow==10.1.0",
36
36
  "requests>=2.22",
37
37
  "matplotlib-label-lines==0.5.1",
38
- "geopandas==0.14.0",
38
+ "geopandas==0.14.1",
39
39
  "mapclassify==2.6.1",
40
40
  ],
41
41
  setup_requires=["flake8"],