Skip to content

Commit

Permalink
Downgrade matplotlib dependency to 3.2 and fix numerous pylint issues (
Browse files Browse the repository at this point in the history
…#2201)

* Update requirements.txt

* Disable pylint

* Reenable pylint

* Update requirements.txt

* Disable dict literal

* Fix or disable more pylint

* Fix black
  • Loading branch information
canyon289 committed Feb 9, 2023
1 parent 631bbfe commit 4fc5000
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ disable=missing-docstring,
consider-using-with,
consider-using-f-string,
# TODO: Remove this once update the code base.
unnecessary-lambda-assignment
unnecessary-lambda-assignment,
use-dict-literal

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
2 changes: 1 addition & 1 deletion arviz/data/inference_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def to_dataframe(
for df in dfs_tail:
dfs = dfs.merge(df, how="outer", copy=False)
else:
(dfs,) = dfs.values()
(dfs,) = dfs.values() # pylint: disable=unbalanced-dict-unpacking
return dfs

def to_zarr(self, store=None):
Expand Down
2 changes: 1 addition & 1 deletion arviz/plots/elpdplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def plot_elpd(
coord_labels = format_coords_as_labels(pointwise_data[0]) if xlabels else None

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

elpd_plot_kwargs = dict(
ax=ax,
Expand Down
6 changes: 3 additions & 3 deletions arviz/tests/base_tests/test_rcparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,18 +288,18 @@ def test_stats_information_criterion(models):

def test_http_type_request(monkeypatch):
def _urlretrive(url, _):
raise Exception(f"URL Retrieved: {url}")
raise ValueError(f"URL Retrieved: {url}")

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

# Test HTTPS default
with pytest.raises(Exception) as error:
with pytest.raises(ValueError) as error:
datasets.load_arviz_data("radon")
assert "https://" in str(error)

# Test HTTP setting
with pytest.raises(Exception) as error:
with pytest.raises(ValueError) as error:
rcParams["data.http_protocol"] = "http"
datasets.load_arviz_data("radon")
assert "http://" in str(error)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
setuptools>=60.0.0
matplotlib>=3.5
matplotlib>=3.2
numpy>=1.20.0
scipy>=1.8.0
packaging
Expand Down

0 comments on commit 4fc5000

Please sign in to comment.