Skip to content

Commit 2fcd393

Browse files
committed
Merge remote-tracking branch 'origin/release-1.1.0' into release-1.1.0
2 parents 7a3facd + 076d846 commit 2fcd393

File tree

4 files changed

+9
-33
lines changed

4 files changed

+9
-33
lines changed

examples/plot_knowledge_word.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
In this example, we use the ``KnowledgeClassifier`` to build
1010
a representation of the learner's knowledge. You could also use
1111
other classifiers like ``NoveltyClassifier``.
12-
13-
.. warning:: You need to use ``WordPlotter`` with caution because
14-
15-
- Compatibility: it fails to work on some systems with Python 3.11.
16-
- Stability: it is not actively maintained.
1712
"""
1813
from truelearn import learning, datasets
1914
from truelearn.utils import visualisations

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,15 @@ classifiers = [
4848
"Topic :: Education",
4949
]
5050
dependencies = [
51-
'typing-extensions>=4.4.0',
51+
'typing-extensions>=4.7.1',
5252
'trueskill>=0.4.5',
53+
'mpmath>=1.3.0',
54+
'circlify>=0.15.0',
55+
56+
# Bump these versions if we remove support for Python 3.7
5357
'scikit-learn>=1.0.2',
54-
'mpmath>=1.2.1',
5558
'matplotlib>=3.5.3',
56-
'circlify>=0.15.0',
59+
5760

5861
# We lock these dependencies because our usage
5962
# might be broken by their updates. We want to

truelearn/utils/visualisations/_bubble_plotter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing_extensions import Self
33

44
import circlify
5-
from matplotlib import cm, colors, colormaps, patches
5+
from matplotlib import cm, colors, colormaps, patches # type: ignore
66
import matplotlib.pyplot as plt
77

88
from truelearn.models import Knowledge

truelearn/utils/visualisations/_word_plotter.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import warnings
21
from typing import Iterable, Optional
32
from typing_extensions import Self
43

4+
from wordcloud import WordCloud
5+
56
from truelearn.models import Knowledge
67
from truelearn.utils.visualisations._base import (
78
MatplotlibBasePlotter,
@@ -56,29 +57,6 @@ def plot(
5657
You can refer to `wordcloud` documentation for all the supported
5758
arguments.
5859
"""
59-
try:
60-
# pylint: disable=import-outside-toplevel
61-
from wordcloud import WordCloud # type: ignore
62-
except ImportError: # pragma: no cover
63-
# no cover because:
64-
#
65-
# In some systems, users can install wordcloud by themselves.
66-
# So, if we want to test this, we must specify a system
67-
# and python version that will never be able to install wordcloud.
68-
# (Therefore, all users running this test will get consistent behaviour,
69-
# regardless of what other packages they have installed).
70-
#
71-
# We think this significantly increases the complexity of the tests
72-
# as we have no control over the upstream library.
73-
# Thus, we decide to mark this as no cover.
74-
warnings.warn(
75-
"Missing `wordcloud` dependency. "
76-
"You can try installing it via `pip install wordcloud`.",
77-
FutureWarning,
78-
stacklevel=2,
79-
)
80-
return self
81-
8260
content_dict, _ = self._standardise_data(content, False, topics)
8361
content_dict = content_dict[:top_n]
8462

0 commit comments

Comments
 (0)