Skip to content

Commit d5e2397

Browse files
authored
1.2 - Backport performance improvement to 1.2 (#385)
* Compile list and dictionary parsing regexes (#381) * Bump version * Update ci_cd.yml * Update conf.py
1 parent 82d86db commit d5e2397

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.github/workflows/ci_cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
# Label used to access the service container
5151
kdc-server:
5252
# Github container registry address
53-
image: ghcr.io/pyansys/kdc-container:v0.2
53+
image: ghcr.io/ansys/kdc-container:v0.2
5454
credentials:
5555
username: ${{ github.actor }}
5656
password: ${{ secrets.GITHUB_TOKEN }}

doc/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
# sphinx.ext.intersphinx
4040
intersphinx_mapping = {
41-
"python": ("https://docs.python.org/dev", None),
41+
"python": ("https://docs.python.org/3.11", None),
4242
"requests": ("https://requests.readthedocs.io/en/latest", None),
4343
}
4444

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
55
[tool.poetry]
66
name = "ansys-openapi-common"
77
description = "Provides a helper to create sessions for use with Ansys OpenAPI clients."
8-
version = "1.2.1"
8+
version = "1.2.2"
99
license = "MIT"
1010
authors = ["ANSYS, Inc."]
1111
maintainers = ["PyAnsys Maintainers <pyansys.maintainers@ansys.com>"]

src/ansys/openapi/common/_api_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ class ApiClient(ApiClientBase):
7575
"date": datetime.date,
7676
"datetime": datetime.datetime,
7777
}
78+
LIST_MATCH_REGEX = re.compile(r"list\[(.*)]")
79+
DICT_MATCH_REGEX = re.compile(r"dict\(([^,]*), (.*)\)")
7880

7981
def __init__(
8082
self,
@@ -349,13 +351,13 @@ def __deserialize(self, data: SerializedType, klass_name: str) -> DeserializedTy
349351
if data is None:
350352
return None
351353

352-
list_match = re.match(r"list\[(.*)]", klass_name)
354+
list_match = self.LIST_MATCH_REGEX.match(klass_name)
353355
if list_match is not None:
354356
assert isinstance(data, list)
355357
sub_kls = list_match.group(1)
356358
return [self.__deserialize(sub_data, sub_kls) for sub_data in data]
357359

358-
dict_match = re.match(r"dict\(([^,]*), (.*)\)", klass_name)
360+
dict_match = self.DICT_MATCH_REGEX.match(klass_name)
359361
if dict_match is not None:
360362
assert isinstance(data, dict)
361363
sub_kls = dict_match.group(2)

0 commit comments

Comments
 (0)