-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from jorenham/stubtest/scipy.io
completed `scipy.io`
- Loading branch information
Showing
34 changed files
with
962 additions
and
645 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,31 @@ | ||
from . import arff as arff, harwell_boeing as harwell_boeing, idl as idl, mmio as mmio, netcdf as netcdf, wavfile as wavfile | ||
from ._fast_matrix_market import mminfo as mminfo, mmread as mmread, mmwrite as mmwrite | ||
from ._fortran import ( | ||
FortranEOFError as FortranEOFError, | ||
FortranFile as FortranFile, | ||
FortranFormattingError as FortranFormattingError, | ||
) | ||
from ._harwell_boeing import hb_read as hb_read, hb_write as hb_write | ||
from ._idl import readsav as readsav | ||
from ._netcdf import netcdf_file as netcdf_file, netcdf_variable as netcdf_variable | ||
from .matlab import loadmat as loadmat, savemat as savemat, whosmat as whosmat | ||
from . import arff, harwell_boeing, idl, matlab, mmio, netcdf, wavfile | ||
from ._fast_matrix_market import mminfo, mmread, mmwrite | ||
from ._fortran import FortranEOFError, FortranFile, FortranFormattingError | ||
from ._harwell_boeing import hb_read, hb_write | ||
from ._idl import readsav | ||
from ._netcdf import netcdf_file, netcdf_variable | ||
from .matlab import loadmat, savemat, whosmat | ||
|
||
__all__ = [ | ||
"FortranEOFError", | ||
"FortranFile", | ||
"FortranFormattingError", | ||
"arff", | ||
"harwell_boeing", | ||
"hb_read", | ||
"hb_write", | ||
"idl", | ||
"loadmat", | ||
"matlab", | ||
"mminfo", | ||
"mmio", | ||
"mmread", | ||
"mmwrite", | ||
"netcdf", | ||
"netcdf_file", | ||
"netcdf_variable", | ||
"readsav", | ||
"savemat", | ||
"wavfile", | ||
"whosmat", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,53 @@ | ||
import io | ||
from typing_extensions import override | ||
from typing import Final, Literal, TypeAlias, type_check_only | ||
from typing_extensions import TypedDict, Unpack, override | ||
|
||
from scipy._typing import Untyped | ||
import numpy as np | ||
import numpy.typing as npt | ||
import optype.numpy as onpt | ||
from scipy._typing import FileName | ||
from scipy.sparse import coo_matrix, sparray, spmatrix | ||
|
||
__all__ = ["mminfo", "mmread", "mmwrite"] | ||
|
||
PARALLELISM: int | ||
ALWAYS_FIND_SYMMETRY: bool | ||
_Format: TypeAlias = Literal["coordinate", "array"] | ||
_Field: TypeAlias = Literal["real", "complex", "pattern", "integer"] | ||
_Symmetry: TypeAlias = Literal["general", "symmetric", "skew-symmetric", "hermitian"] | ||
|
||
PARALLELISM: Final = 0 | ||
ALWAYS_FIND_SYMMETRY: Final = False | ||
|
||
@type_check_only | ||
class _TextToBytesWrapperKwargs(TypedDict, total=False): | ||
buffer_size: int | ||
|
||
class _TextToBytesWrapper(io.BufferedReader): | ||
encoding: Untyped | ||
errors: Untyped | ||
def __init__(self, text_io_buffer, encoding: Untyped | None = None, errors: Untyped | None = None, **kwargs): ... | ||
encoding: Final[str] | ||
errors: Final[str] | ||
def __init__( | ||
self, | ||
/, | ||
text_io_buffer: io.TextIOBase, | ||
encoding: str | None = None, | ||
errors: str | None = None, | ||
**kwargs: Unpack[_TextToBytesWrapperKwargs], | ||
) -> None: ... | ||
@override | ||
def read(self, /, size: int | None = -1) -> bytes: ... | ||
@override | ||
def read1(self, /, size: int = -1) -> bytes: ... | ||
@override | ||
def peek(self, /, size: int = -1) -> bytes: ... | ||
@override | ||
def seek(self, offset: int, whence: int = 0, /) -> None: ... # type: ignore[override] | ||
def seek(self, /, offset: int, whence: int = 0) -> None: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] | ||
|
||
def mmread(source) -> Untyped: ... | ||
def mmread(source: FileName) -> npt.NDArray[np.generic] | coo_matrix: ... | ||
def mmwrite( | ||
target, | ||
a, | ||
comment: Untyped | None = None, | ||
field: Untyped | None = None, | ||
precision: Untyped | None = None, | ||
symmetry: str = "AUTO", | ||
): ... | ||
def mminfo(source) -> Untyped: ... | ||
target: FileName, | ||
a: onpt.CanArray | list[object] | tuple[object, ...] | sparray | spmatrix, | ||
comment: str | None = None, | ||
field: _Field | None = None, | ||
precision: int | None = None, | ||
symmetry: _Symmetry | Literal["AUTO"] = "AUTO", | ||
) -> None: ... | ||
def mminfo(source: FileName) -> tuple[int, int, int, _Format, _Field, _Symmetry]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,41 @@ | ||
from types import TracebackType | ||
from typing import Any, TypedDict, final, overload, type_check_only | ||
from typing_extensions import Self, Unpack | ||
|
||
from scipy._typing import Untyped | ||
import numpy as np | ||
import numpy.typing as npt | ||
import optype.numpy as onpt | ||
from scipy._typing import FileLike, FileModeRW | ||
|
||
__all__ = ["FortranEOFError", "FortranFile", "FortranFormattingError"] | ||
|
||
@type_check_only | ||
@final | ||
class _DTypeKwargs(TypedDict): | ||
dtype: npt.DTypeLike | ||
|
||
class FortranEOFError(TypeError, OSError): ... | ||
class FortranFormattingError(TypeError, OSError): ... | ||
|
||
class FortranFile: | ||
def __init__(self, filename, mode: str = "r", header_dtype=...): ... | ||
def write_record(self, *items): ... | ||
def read_record(self, *dtypes, **kwargs) -> Untyped: ... | ||
def read_ints(self, dtype: str = "i4") -> Untyped: ... | ||
def read_reals(self, dtype: str = "f8") -> Untyped: ... | ||
def close(self): ... | ||
def __enter__(self) -> Untyped: ... | ||
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None): ... | ||
def __init__(self, /, filename: FileLike[bytes], mode: FileModeRW = "r", header_dtype: npt.DTypeLike = ...) -> None: ... | ||
def __enter__(self, /) -> Self: ... | ||
def __exit__(self, /, type: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> None: ... | ||
def close(self, /) -> None: ... | ||
def write_record(self, /, *items: npt.ArrayLike) -> None: ... | ||
@overload | ||
def read_record(self, /, *dtypes: npt.DTypeLike) -> onpt.Array[tuple[int], np.void]: ... | ||
@overload | ||
def read_record(self, /, *dtypes: npt.DTypeLike, **kwargs: Unpack[_DTypeKwargs]) -> onpt.Array[tuple[int], np.void]: ... | ||
@overload | ||
def read_ints(self, /) -> onpt.Array[tuple[int], np.int32]: ... | ||
@overload | ||
def read_ints(self, /, dtype: onpt.AnyIntegerDType) -> onpt.Array[tuple[int], np.integer[Any]]: ... | ||
@overload | ||
def read_ints(self, /, dtype: npt.DTypeLike) -> onpt.Array[tuple[int]]: ... | ||
@overload | ||
def read_reals(self, /) -> onpt.Array[tuple[int], np.float64]: ... | ||
@overload | ||
def read_reals(self, /, dtype: onpt.AnyFloatingDType) -> onpt.Array[tuple[int], np.floating[Any]]: ... | ||
@overload | ||
def read_reals(self, /, dtype: npt.DTypeLike) -> onpt.Array[tuple[int]]: ... |
Oops, something went wrong.