Skip to content

Commit

Permalink
Merge branch 'main' into fix/cmgrp-command
Browse files Browse the repository at this point in the history
  • Loading branch information
clatapie authored Jun 29, 2023
2 parents 3757498 + 4e5e387 commit 03d960f
Show file tree
Hide file tree
Showing 7 changed files with 287 additions and 144 deletions.
21 changes: 18 additions & 3 deletions src/ansys/mapdl/core/common_grpc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Common gRPC functions"""
from typing import List, Literal, get_args

import numpy as np

from ansys.mapdl.core.errors import MapdlConnectionError
Expand All @@ -7,7 +9,6 @@
DEFAULT_CHUNKSIZE = 256 * 1024 # 256 kB
DEFAULT_FILE_CHUNK_SIZE = 1024 * 1024 # 1MB


ANSYS_VALUE_TYPE = {
0: None, # UNKNOWN
1: np.int32, # INTEGER
Expand All @@ -21,7 +22,18 @@
}


VGET_ENTITY_TYPES = [
VGET_ENTITY_TYPES: List[str] = [
"NODE",
"ELEM",
"KP",
"LINE",
"AREA",
"VOLU",
"CDSY",
"RCON",
"TLAB",
]
VGET_ENTITY_TYPES_TYPING = Literal[
"NODE",
"ELEM",
"KP",
Expand All @@ -32,6 +44,9 @@
"RCON",
"TLAB",
]

VGET_ENTITY_TYPES: List[str] = list(get_args(VGET_ENTITY_TYPES_TYPING))

STRESS_TYPES = ["X", "Y", "Z", "XY", "YZ", "XZ", "1", "2", "3", "INT", "EQV"]
COMP_TYPE = ["X", "Y", "Z", "SUM"]
VGET_NODE_ENTITY_TYPES = {
Expand Down Expand Up @@ -66,7 +81,7 @@ def __init__(self, msg=""):
RuntimeError.__init__(self, msg)


def check_vget_input(entity, item, itnum):
def check_vget_input(entity: str, item: str, itnum: str) -> str:
"""Verify that entity and item for VGET are valid.
Raises a ``ValueError`` when invalid.
Expand Down
Loading

0 comments on commit 03d960f

Please sign in to comment.