Skip to content

Commit

Permalink
post-merge mypy/stubtest fixes. Allow any numpy generic or array in f…
Browse files Browse the repository at this point in the history
…illvalue.
  • Loading branch information
RandallPittmanOrSt committed Oct 22, 2024
1 parent 9cd78c9 commit 6a31be4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/stubtest-allowlist
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ netCDF4.NumericVarT
netCDF4.Dimension.__reduce_cython__
netCDF4.Dimension.__setstate_cython__
netCDF4.Variable.auto_complex
netCDF4.Variable.get_fill_value
netCDF4.Variable.__iter__
netCDF4._netCDF4.Dimension.__reduce_cython__
netCDF4._netCDF4.Dimension.__setstate_cython__
netCDF4._netCDF4.NC_DISKLESS
netCDF4._netCDF4.NC_PERSIST
netCDF4._netCDF4.Variable.auto_complex
netCDF4._netCDF4.Variable.get_fill_value
netCDF4._netCDF4.Variable.__iter__
netCDF4._netCDF4.__reduce_cython__
netCDF4._netCDF4.__setstate_cython__
Expand Down
14 changes: 7 additions & 7 deletions src/netCDF4/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class Dataset:
least_significant_digit: int | None = None,
significant_digits: int | None = None,
quantize_mode: QuantizeMode = "BitGroom",
fill_value: int | float | np.number | str | bytes | Literal[False] | None = None,
fill_value: int | float | np.generic | str | bytes | Literal[False] | np.ndarray | None = None,
chunk_cache: int | None = None,
) -> Variable[NumericVarT]: ...
@overload
Expand All @@ -318,7 +318,7 @@ class Dataset:
least_significant_digit: int | None = None,
significant_digits: int | None = None,
quantize_mode: QuantizeMode = "BitGroom",
fill_value: int | float | np.number | str | bytes | Literal[False] | None = None,
fill_value: int | float | np.generic | str | bytes | Literal[False] | np.ndarray | None = None,
chunk_cache: int | None = None,
) -> Variable[str]: ...
@overload
Expand All @@ -341,7 +341,7 @@ class Dataset:
least_significant_digit: int | None = None,
significant_digits: int | None = None,
quantize_mode: QuantizeMode = "BitGroom",
fill_value: int | float | np.number | str | bytes | Literal[False] | None = None,
fill_value: int | float | np.generic | str | bytes | Literal[False] | np.ndarray | None = None,
chunk_cache: int | None = None,
) -> Variable: ...
def renameVariable(self, oldname: str, newname: str) -> None: ...
Expand Down Expand Up @@ -450,7 +450,7 @@ class Variable(Generic[VarT]):
least_significant_digit: int | None = None,
significant_digits: int | None = None,
quantize_mode: QuantizeMode = "BitGroom",
fill_value: int | float | np.number | str | bytes | Literal[False] | None = None,
fill_value: int | float | np.generic | str | bytes | Literal[False] | np.ndarray | None = None,
chunk_cache: int | None = None,
**kwargs: Any,
) -> Variable[NumericVarT]: ...
Expand All @@ -475,7 +475,7 @@ class Variable(Generic[VarT]):
least_significant_digit: int | None = None,
significant_digits: int | None = None,
quantize_mode: QuantizeMode = "BitGroom",
fill_value: int | float | np.number | str | bytes | Literal[False] | None = None,
fill_value: int | float | np.generic | str | bytes | Literal[False] | np.ndarray | None = None,
chunk_cache: int | None = None,
**kwargs: Any,
) -> Variable[str]: ...
Expand All @@ -500,7 +500,7 @@ class Variable(Generic[VarT]):
least_significant_digit: int | None = None,
significant_digits: int | None = None,
quantize_mode: QuantizeMode = "BitGroom",
fill_value: int | float | np.number | str | bytes | Literal[False] | None = None,
fill_value: int | float | np.generic | str | bytes | Literal[False] | np.ndarray | None = None,
chunk_cache: int | None = None,
**kwargs: Any,
) -> Variable: ...
Expand All @@ -524,7 +524,7 @@ class Variable(Generic[VarT]):
least_significant_digit: int | None = None,
significant_digits: int | None = None,
quantize_mode: QuantizeMode = "BitGroom",
fill_value: int | float | np.number | str | bytes | Literal[False] | None = None,
fill_value: int | float | np.generic | str | bytes | Literal[False] | np.ndarray | None = None,
chunk_cache: int | None = None,
**kwargs: Any,
) -> None: ...
Expand Down

0 comments on commit 6a31be4

Please sign in to comment.