Skip to content

Commit 4fc5000

Browse files
authored
Downgrade matplotlib dependency to 3.2 and fix numerous pylint issues (#2201)
* Update requirements.txt * Disable pylint * Reenable pylint * Update requirements.txt * Disable dict literal * Fix or disable more pylint * Fix black
1 parent 631bbfe commit 4fc5000

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ disable=missing-docstring,
7575
consider-using-with,
7676
consider-using-f-string,
7777
# TODO: Remove this once update the code base.
78-
unnecessary-lambda-assignment
78+
unnecessary-lambda-assignment,
79+
use-dict-literal
7980

8081
# Enable the message, report, category or checker with the given id(s). You can
8182
# either give multiple identifier separated by comma (,) or put this option

arviz/data/inference_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def to_dataframe(
678678
for df in dfs_tail:
679679
dfs = dfs.merge(df, how="outer", copy=False)
680680
else:
681-
(dfs,) = dfs.values()
681+
(dfs,) = dfs.values() # pylint: disable=unbalanced-dict-unpacking
682682
return dfs
683683

684684
def to_zarr(self, store=None):

arviz/plots/elpdplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def plot_elpd(
133133
coord_labels = format_coords_as_labels(pointwise_data[0]) if xlabels else None
134134

135135
if numvars < 2:
136-
raise Exception("Number of models to compare must be 2 or greater.")
136+
raise ValueError("Number of models to compare must be 2 or greater.")
137137

138138
elpd_plot_kwargs = dict(
139139
ax=ax,

arviz/tests/base_tests/test_rcparams.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,18 +288,18 @@ def test_stats_information_criterion(models):
288288

289289
def test_http_type_request(monkeypatch):
290290
def _urlretrive(url, _):
291-
raise Exception(f"URL Retrieved: {url}")
291+
raise ValueError(f"URL Retrieved: {url}")
292292

293293
# Hijack url retrieve to inspect url passed
294294
monkeypatch.setattr(datasets, "urlretrieve", _urlretrive)
295295

296296
# Test HTTPS default
297-
with pytest.raises(Exception) as error:
297+
with pytest.raises(ValueError) as error:
298298
datasets.load_arviz_data("radon")
299299
assert "https://" in str(error)
300300

301301
# Test HTTP setting
302-
with pytest.raises(Exception) as error:
302+
with pytest.raises(ValueError) as error:
303303
rcParams["data.http_protocol"] = "http"
304304
datasets.load_arviz_data("radon")
305305
assert "http://" in str(error)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
setuptools>=60.0.0
2-
matplotlib>=3.5
2+
matplotlib>=3.2
33
numpy>=1.20.0
44
scipy>=1.8.0
55
packaging

0 commit comments

Comments
 (0)