Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typing errors in asv_bench and tests #253

Merged
merged 17 commits into from
Jul 8, 2023

Conversation

Illviljan
Copy link
Contributor

@Illviljan Illviljan commented Jul 7, 2023

Fix some typing issues in the asv_bench and tests folders. Also allow mypy to check these folders.

@Illviljan Illviljan marked this pull request as draft July 7, 2023 18:51
@Illviljan
Copy link
Contributor Author

 tests/conftest.py:8: error: Skipping analyzing "numba": module is installed, but missing library stubs or py.typed marker  [import]
asv_bench/benchmarks/cohorts.py:45: error: "Callable[[Cohorts], Any]" has no attribute "unit"  [attr-defined]
asv_bench/benchmarks/cohorts.py:46: error: "Callable[[Cohorts], Any]" has no attribute "unit"  [attr-defined]
asv_bench/benchmarks/cohorts.py:47: error: "Callable[[Cohorts], Any]" has no attribute "unit"  [attr-defined]
asv_bench/benchmarks/combine.py:73: error: Argument 5 to "_initialize_aggregation" has incompatible type "None"; expected "int"  [arg-type]
tests/test_core.py:11: error: Skipping analyzing "numpy_groupies.aggregate_numpy": module is installed, but missing library stubs or py.typed marker  [import]
tests/test_core.py:11: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
tests/test_core.py:81: error: Module "flox.core" has no attribute "T_Func2"; maybe "T_Func" or "T_Funcs"?  [attr-defined]
tests/test_core.py:995: error: Argument "method" to "groupby_reduce" has incompatible type "Literal['split-reduce']"; expected "Literal['map-reduce', 'blockwise', 'cohorts']"  [arg-type]
tests/test_core.py:1362: error: Argument 3 to "_validate_reindex" has incompatible type "str"; expected "Literal['map-reduce', 'blockwise', 'cohorts']"  [arg-type]
tests/test_core.py:1368: error: Argument 3 to "_validate_reindex" has incompatible type "str"; expected "Literal['map-reduce', 'blockwise', 'cohorts']"  [arg-type]
tests/test_core.py:1373: error: Argument 3 to "_validate_reindex" has incompatible type "str"; expected "Literal['map-reduce', 'blockwise', 'cohorts']"  [arg-type]

@Illviljan Illviljan marked this pull request as ready for review July 7, 2023 21:50
@Illviljan Illviljan changed the title Let mypy check asv_bench Fix some typing errors in asv_bench and tests Jul 7, 2023
@Illviljan Illviljan merged commit 40b300c into xarray-contrib:main Jul 8, 2023
18 checks passed
dcherian added a commit that referenced this pull request Sep 28, 2023
* main: (68 commits)
  convert datetime: micro-optimizations (#261)
  compatibility with `numpy>=2.0` (#257)
  replace the deprecated `provision-with-micromamba` with `setup-micromamba` (#258)
  Fix some typing errors in asv_bench and tests (#253)
  [pre-commit.ci] pre-commit autoupdate (#250)
  typing fixes (#235)
  Fix test failure on i386 (#248)
  Delete resample_reduce (#246)
  Bump codecov/codecov-action from 3.1.3 to 3.1.4 (#243)
  Enable nanargmax, nanargmin (#171)
  Support nanfirst, nanlast with simple combine algo (#240)
  Check method only for dask reductions. (#241)
  Optimize broadcasting (#230)
  Handle min_count=0 (#238)
  Try and fix dtypes on 3.8,3.10 windows
  Preserve input dtypes now that pandas can do it.
  Add pytest-pretty to envs
  factorize early as much as possible
  Bump codecov/codecov-action from 3.1.1 to 3.1.3 (#239)
  [pre-commit.ci] pre-commit autoupdate (#229)
  ...
dcherian added a commit that referenced this pull request Nov 3, 2023
* main: (24 commits)
  Add `packaging` as dependency
  use engine flox for ordered groups (#266)
  Update pyproject.toml: py3.12
  Bump numpy to >=1.22 (#278)
  Cleanups (#276)
  benchmarks updates (#273)
  repo-review comments (#270)
  Significantly faster cohorts detection. (#272)
  Add engine="numbagg" (#72)
  Support quantile, median, mode with method="blockwise". (#269)
  Add multidimensional binning demo (#203)
  [pre-commit.ci] pre-commit autoupdate (#268)
  Drop python 3.8, test python 3.11 (#209)
  tests: move xfail out of functions (#265)
  Bump actions/checkout from 3 to 4 (#267)
  convert datetime: micro-optimizations (#261)
  compatibility with `numpy>=2.0` (#257)
  replace the deprecated `provision-with-micromamba` with `setup-micromamba` (#258)
  Fix some typing errors in asv_bench and tests (#253)
  [pre-commit.ci] pre-commit autoupdate (#250)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant