[med-svn] [Git][python-team/packages/python-wordcloud][upstream] New upstream version 1.9.2+dfsg

Andreas Tille (@tille) gitlab at salsa.debian.org
Mon Jul 10 10:09:41 BST 2023



Andreas Tille pushed to branch upstream at Debian Python Team / packages / python-wordcloud


Commits:
606d8dad by Andreas Tille at 2023-07-10T10:48:45+02:00
New upstream version 1.9.2+dfsg
- - - - -


7 changed files:

- + CITATION.cff
- README.md
- requirements-dev.txt
- test/test_wordcloud.py
- wordcloud/_version.py
- wordcloud/color_from_image.py
- wordcloud/wordcloud.py


Changes:

=====================================
CITATION.cff
=====================================
@@ -0,0 +1,10 @@
+cff-version: 1.2.0
+authors:
+- family-names: "Mueller"
+  given-names: "Andreas C"
+  orcid: "https://orcid.org/0000-0002-2349-9428"
+
+title: "Wordcloud"
+version: 1.9.1
+date-released: 2023-4-27
+url: "https://github.com/amueller/wordcloud"
\ No newline at end of file


=====================================
README.md
=====================================
@@ -8,7 +8,7 @@ word_cloud
 A little word cloud generator in Python. Read more about it on the [blog
 post][blog-post] or the [website][website].
 
-The code is tested against Python 2.7, 3.4, 3.5, 3.6 and 3.7.
+The code is tested against Python 3.7, 3.8, 3.9, 3.10, 3.11.
 
 ## Installation
 
@@ -23,9 +23,7 @@ If you are using conda, you can install from the `conda-forge` channel:
 
 #### Installation notes
 
-wordcloud depends on `numpy` and `pillow`.
-
-To save the wordcloud into a file, `matplotlib` can also be installed. See [examples](#examples) below.
+wordcloud depends on `numpy`, `pillow`, and `matplotlib`.
 
 If there are no wheels available for your version of python, installing the
 package requires having a C compiler set up. Before installing a compiler, report


=====================================
requirements-dev.txt
=====================================
@@ -1,10 +1,10 @@
 codecov
 coverage
-flake8==3.8.0
+flake8>=3.8.0
 mock
-pytest<5.4.0
+pytest
 pytest-cov
 pytest-sugar
 setuptools>=28.0.0
 twine
-wheel==0.34.1
+wheel>=0.38.1


=====================================
test/test_wordcloud.py
=====================================
@@ -239,13 +239,13 @@ def test_mask():
     # check that using an empty mask is equivalent to not using a mask
     wc = WordCloud(random_state=42)
     wc.generate(THIS)
-    mask = np.zeros(np.array(wc).shape[:2], dtype=np.int)
+    mask = np.zeros(np.array(wc).shape[:2], dtype=int)
     wc_mask = WordCloud(mask=mask, random_state=42)
     wc_mask.generate(THIS)
     assert_array_equal(wc, wc_mask)
 
     # use actual nonzero mask
-    mask = np.zeros((234, 456), dtype=np.int)
+    mask = np.zeros((234, 456), dtype=int)
     mask[100:150, 300:400] = 255
 
     wc = WordCloud(mask=mask)
@@ -259,7 +259,7 @@ def test_mask():
 def test_mask_contour():
     # test mask contour is created, learn more at:
     # https://github.com/amueller/word_cloud/pull/348#issuecomment-370883873
-    mask = np.zeros((234, 456), dtype=np.int)
+    mask = np.zeros((234, 456), dtype=int)
     mask[100:150, 300:400] = 255
 
     sm = WordCloud(mask=mask, contour_width=1, contour_color='blue')
@@ -491,7 +491,7 @@ def test_max_font_size_as_mask_height():
     size = (default_size[0] * 2, default_size[1] * 2)
 
     # using mask, all drawable
-    mask = np.zeros(size, dtype=np.int)
+    mask = np.zeros(size, dtype=int)
     mask[:, :] = 0
     wc = WordCloud(mask=mask, random_state=42)
     wc.generate(x)


=====================================
wordcloud/_version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
     # setup.py/versioneer.py will grep for the variable names, so they must
     # each be defined on a line of their own. _version.py will just call
     # get_keywords().
-    git_refnames = " (tag: 1.8.2.2, refs/pull/683/head, different_workflow)"
-    git_full = "d8c6624e9547587d6c57d27c97fb7fea717455e7"
-    git_date = "2022-06-23 17:03:26 -0700"
+    git_refnames = " (HEAD -> main, tag: 1.9.2)"
+    git_full = "f011a3146b6e1f279c0cb7a4f837781e12e30174"
+    git_date = "2023-05-18 10:21:01 -0700"
     keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
     return keywords
 


=====================================
wordcloud/color_from_image.py
=====================================
@@ -38,11 +38,11 @@ class ImageColorGenerator(object):
         transposed_font = ImageFont.TransposedFont(font,
                                                    orientation=orientation)
         # get size of resulting text
-        box_size = transposed_font.getsize(word)
+        box_size = transposed_font.getbbox(word)
         x = position[0]
         y = position[1]
         # cut out patch under word box
-        patch = self.image[x:x + box_size[0], y:y + box_size[1]]
+        patch = self.image[x:x + box_size[2], y:y + box_size[3]]
         if patch.ndim == 3:
             # drop alpha channel if any
             patch = patch[:, :, :3]


=====================================
wordcloud/wordcloud.py
=====================================
@@ -291,7 +291,7 @@ class WordCloud(object):
             ``words_`` is now a dictionary
 
     ``layout_`` : list of tuples ((string, float), int, (int, int), int, color))
-        Encodes the fitted word cloud. For each word, it encodes the string, 
+        Encodes the fitted word cloud. For each word, it encodes the string,
         normalized frequency, font size, position, orientation, and color.
         The frequencies are normalized by the most commonly occurring word.
         The color is in the format of 'rgb(R, G, B).'
@@ -505,10 +505,10 @@ class WordCloud(object):
                 transposed_font = ImageFont.TransposedFont(
                     font, orientation=orientation)
                 # get size of resulting text
-                box_size = draw.textsize(word, font=transposed_font)
+                box_size = draw.textbbox((0, 0), word, font=transposed_font, anchor="lt")
                 # find possible places using integral image:
-                result = occupancy.sample_position(box_size[1] + self.margin,
-                                                   box_size[0] + self.margin,
+                result = occupancy.sample_position(box_size[3] + self.margin,
+                                                   box_size[2] + self.margin,
                                                    random_state)
                 if result is not None or font_size < self.min_font_size:
                     # either we found a place or font-size went too small



View it on GitLab: https://salsa.debian.org/python-team/packages/python-wordcloud/-/commit/606d8dad21240f14617d461f5560d105e9f44a45

-- 
View it on GitLab: https://salsa.debian.org/python-team/packages/python-wordcloud/-/commit/606d8dad21240f14617d461f5560d105e9f44a45
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230710/0992fc1a/attachment-0001.htm>


More information about the debian-med-commit mailing list