Skip to content

Commit

Permalink
handle warnings and linting more granularly
Browse files Browse the repository at this point in the history
  • Loading branch information
jGaboardi committed Oct 22, 2023
1 parent 29924a3 commit c60e8ec
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
4 changes: 3 additions & 1 deletion giddy/tests/test_ergodic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest
import unittest
from .. import ergodic
import numpy as np
Expand Down Expand Up @@ -58,7 +59,8 @@ def test_mfpt(self):
)
np.testing.assert_array_almost_equal(exp, obs)

obs = ergodic.fmpt(self.p2)
with pytest.warns(DeprecationWarning, match="fmpt is deprecated."):
obs = ergodic.fmpt(self.p2)
exp = np.array(
[
[2.66666667, 2.0, np.inf],
Expand Down
40 changes: 25 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,33 +77,33 @@ extend-exclude = '''
line-length = 88
select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
target-version = "py39"
ignore = [
"B006",
"B008",
"B009",
"B010",
"C408",
"E731",
"F401",
"F403",
"N803",
"N806",
"N999",
"UP007"
]
exclude = ["giddy/tests/*", "docs/*"]
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"] # imported but unused
"giddy/directional.py" = [
"ARG002", # Unused method argument
"N803", # Argument name should be lowercase
"N806", # Variable in function should be lowercase
]
"giddy/ergodic.py" = [
"N803", # Argument name should be lowercase
"N806", # Variable in function should be lowercase
]
"giddy/markov.py" = [
"B006", # Do not use mutable data structures for argument defaults
"N801", # Class name should use CapWords convention
"N802", # Function name should be lowercase
"N803",
"N806",
]
"giddy/rank.py" = [
"N801",
"ARG002",
"N801",
"N803",
"N806",
]
"giddy/sequence.py" = ["N806"]
"giddy/util.py" = ["N803"]

[tool.coverage.run]
source = ["./giddy"]
Expand All @@ -118,3 +118,13 @@ exclude_lines = [
]
ignore_errors = true
omit = ["giddy/tests/*", "docs/conf.py"]

[tool.pytest.ini_options]
filterwarnings = [
"ignore:The weights matrix is not fully connected", # libpysal
"ignore:Objects based on the `Geometry` class will deprecated", # libpysa
"ignore:divide by zero encountered",
"ignore:invalid value encountered",
"ignore:numba.generated_jit is deprecated.", # numba/quantecon
"ignore:::.*quantecon.lss:19", # numba/quantecon
]

0 comments on commit c60e8ec

Please sign in to comment.