-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add typehints; build Python 3.12 (#17)
* add type hints * finalize typehints: * clean up PYBIN * Python 3.8 typing compatiblity * skip python 3.12 for win nt plotting
- Loading branch information
1 parent
ff383e4
commit 5169198
Showing
15 changed files
with
366 additions
and
204 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
"""MAPDL archive reader.""" | ||
|
||
from mapdl_archive import examples | ||
from mapdl_archive._version import __version__ | ||
from mapdl_archive.archive import Archive, save_as_archive, write_cmblock, write_nblock | ||
from mapdl_archive import examples # noqa: F401 | ||
from mapdl_archive._version import __version__ # noqa: F401 | ||
from mapdl_archive.archive import ( # noqa: F401 | ||
Archive, | ||
save_as_archive, | ||
write_cmblock, | ||
write_nblock, | ||
) |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import numpy as np | ||
import numpy.typing as npt | ||
|
||
def py_write_nblock( | ||
filename: str, | ||
node_id: npt.NDArray[np.int32], | ||
max_node_id: int, | ||
pos: npt.NDArray[np.float64], | ||
angles: npt.NDArray[np.float64], | ||
mode: str = "w", | ||
sig_digits: int = 13, | ||
) -> None: ... | ||
def py_write_nblock_float( | ||
filename: str, | ||
node_id: npt.NDArray[np.int32], | ||
max_node_id: int, | ||
pos: npt.NDArray[np.float32], | ||
angles: npt.NDArray[np.float32], | ||
mode: str = "w", | ||
sig_digits: int = 13, | ||
) -> None: ... | ||
def py_write_eblock( | ||
filename: str, | ||
elem_id: npt.NDArray[np.int32], | ||
etype: npt.NDArray[np.int32], | ||
mtype: npt.NDArray[np.int32], | ||
rcon: npt.NDArray[np.int32], | ||
elem_nnodes: npt.NDArray[np.int32], | ||
cells: npt.NDArray[np.int32], | ||
offset: npt.NDArray[np.int32], | ||
celltypes: npt.NDArray[np.uint8], | ||
typenum: npt.NDArray[np.int32], | ||
nodenum: npt.NDArray[np.int32], | ||
mode: str = "w", | ||
) -> None: ... | ||
def cmblock_items_from_array(array: npt.NDArray[np.int32]) -> npt.NDArray[np.int32]: ... |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from typing import Dict, List, Tuple, TypedDict, Union | ||
|
||
import numpy as np | ||
import numpy.typing as npt | ||
|
||
class ReadReturnDict(TypedDict): | ||
rnum: npt.NDArray[np.int64] | ||
rdat: List[List[float]] | ||
ekey: npt.NDArray[np.int32] | ||
nnum: npt.NDArray[np.int32] | ||
nodes: npt.NDArray[np.float64] | ||
elem: npt.NDArray[np.int32] | ||
elem_off: npt.NDArray[np.int32] | ||
node_comps: Dict[str, npt.NDArray[np.int32]] | ||
elem_comps: Dict[str, npt.NDArray[np.int32]] | ||
keyopt: Dict[int, List[List[int]]] | ||
parameters: Dict[str, np.ndarray] | ||
nblock_start: int | ||
nblock_end: int | ||
|
||
def read( | ||
filename: str, | ||
read_parameters: bool = False, | ||
debug: bool = False, | ||
read_eblock: bool = True, | ||
) -> ReadReturnDict: ... | ||
def node_block_format( | ||
string: Union[bytes, str] | ||
) -> Tuple[npt.NDArray[np.int32], int, int, int]: ... | ||
def ans_vtk_convert( | ||
elem: npt.NDArray[np.int32], | ||
elem_off: npt.NDArray[np.int32], | ||
type_ref: npt.NDArray[np.int32], | ||
nnum: npt.NDArray[np.int32], | ||
build_offset: int, | ||
) -> Tuple[npt.NDArray[np.int64], npt.NDArray[np.uint8], npt.NDArray[np.int64]]: ... | ||
def read_from_nwrite( | ||
filename: str, nnodes: int | ||
) -> Tuple[npt.NDArray[np.int32], npt.NDArray[np.float64]]: ... | ||
def write_array(filename: str, arr: npt.NDArray[np.float64]) -> None: ... |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import numpy as np | ||
import numpy.typing as npt | ||
|
||
def reset_midside( | ||
cellarr: npt.NDArray[np.int64], | ||
celltypes: npt.NDArray[np.uint8], | ||
offset: npt.NDArray[np.int64], | ||
pts: npt.NDArray[np.float64], | ||
) -> None: ... |
Oops, something went wrong.