-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The get_info API returns run_statuses and end_statuses.
- Loading branch information
wei
committed
Aug 16, 2024
1 parent
b08633c
commit 9d87959
Showing
3 changed files
with
88 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""Tidy3d system config.""" | ||
|
||
from __future__ import annotations | ||
|
||
from typing import Optional | ||
|
||
from pydantic.v1 import Extra, Field | ||
|
||
from .http_util import http | ||
from .types import Tidy3DResource | ||
|
||
|
||
class SystemConfig(Tidy3DResource, extra=Extra.allow): | ||
"""Tidy3D system config.""" | ||
|
||
end_statuses: Optional[tuple] = Field( | ||
None, | ||
title="endStatuses", | ||
description="end statuses", | ||
alias="endStatuses", | ||
) | ||
run_statuses: Optional[tuple] = Field( | ||
0, title="runStatuses", description="run statuses", alias="runStatuses" | ||
) | ||
|
||
@classmethod | ||
def get(cls): | ||
"""Get user SystemConfig information. | ||
Parameters | ||
---------- | ||
Returns | ||
------- | ||
systemConfig : SystemConfig | ||
""" | ||
resp = http.get("tidy3d/system/py/config") | ||
if resp: | ||
config = SystemConfig(**resp) | ||
return config | ||
else: | ||
return None |