Skip to content

Commit

Permalink
ci: relax numpy<=2.0.0 constraint (#3504)
Browse files Browse the repository at this point in the history
* ci(ruff): add `numpy` rules

https://docs.astral.sh/ruff/rules/#numpy-specific-rules-npy

* fix(ruff): Replace legacy random `NPY002`

https://docs.astral.sh/ruff/rules/numpy-legacy-random/

* ci: remove `numpy` upper bound
  • Loading branch information
dangotbanned committed Jul 25, 2024
1 parent 355f888 commit 679a7ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ all = [
"vega_datasets>=0.9.0",
"vl-convert-python>=1.5.0",
"pandas>=0.25.3",
"numpy<2.0.0",
"numpy",
"pyarrow>=11",
"vegafusion[embed]>=1.6.6",
"anywidget>=0.9.0",
Expand Down Expand Up @@ -305,6 +305,8 @@ select = [
"D",
# multi-line-summary-second-line
"D213",
# numpy-specific-rules
"NPY",
]
ignore = [
# Whitespace before ':'
Expand Down
3 changes: 2 additions & 1 deletion tests/utils/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def _check(arr, typ):
_check(pd.date_range("2012", "2013"), "temporal")
_check(pd.timedelta_range(365, periods=12), "temporal")

nulled = pd.Series(np.random.randint(10, size=10))
rng = np.random.default_rng()
nulled = pd.Series(rng.integers(10, size=10))
nulled[0] = None
_check(nulled, "quantitative")
_check(["a", "b", "c"], "nominal")
Expand Down

0 comments on commit 679a7ce

Please sign in to comment.