Skip to content

Commit 744a69a

Browse files
committed
docs[webapi]: add missing webapi and autograd plugin methods to docs and reorganize sections
1 parent 82bf4ba commit 744a69a

File tree

3 files changed

+160
-23
lines changed

3 files changed

+160
-23
lines changed

docs/api/plugins/autograd.rst

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,74 @@ Automatic Differentiation with Autograd
77

88
./../../../tidy3d/plugins/autograd/README
99

10+
Differential Operators
11+
~~~~~~~~~~~~~~~~~~~~~~
12+
1013
.. autosummary::
1114
:toctree: ../_autosummary/
1215
:template: module.rst
1316

14-
tidy3d.plugins.autograd.functions.threshold
15-
tidy3d.plugins.autograd.functions.rescale
16-
tidy3d.plugins.autograd.functions.morphological_gradient_external
17-
tidy3d.plugins.autograd.functions.morphological_gradient_internal
18-
tidy3d.plugins.autograd.functions.morphological_gradient
17+
tidy3d.plugins.autograd.differential_operators.grad
18+
tidy3d.plugins.autograd.differential_operators.value_and_grad
19+
20+
Functions
21+
~~~~~~~~~
22+
23+
.. autosummary::
24+
:toctree: ../_autosummary/
25+
:template: module.rst
26+
27+
tidy3d.plugins.autograd.functions.add_at
28+
tidy3d.plugins.autograd.functions.convolve
1929
tidy3d.plugins.autograd.functions.grey_closing
20-
tidy3d.plugins.autograd.functions.grey_opening
21-
tidy3d.plugins.autograd.functions.grey_erosion
2230
tidy3d.plugins.autograd.functions.grey_dilation
31+
tidy3d.plugins.autograd.functions.grey_erosion
32+
tidy3d.plugins.autograd.functions.grey_opening
33+
tidy3d.plugins.autograd.functions.interpn
34+
tidy3d.plugins.autograd.functions.least_squares
35+
tidy3d.plugins.autograd.functions.morphological_gradient
36+
tidy3d.plugins.autograd.functions.morphological_gradient_external
37+
tidy3d.plugins.autograd.functions.morphological_gradient_internal
2338
tidy3d.plugins.autograd.functions.pad
24-
tidy3d.plugins.autograd.functions.convolve
39+
tidy3d.plugins.autograd.functions.rescale
40+
tidy3d.plugins.autograd.functions.smooth_max
41+
tidy3d.plugins.autograd.functions.smooth_min
42+
tidy3d.plugins.autograd.functions.threshold
43+
tidy3d.plugins.autograd.functions.trapz
44+
45+
Utilities
46+
~~~~~~~~~
47+
48+
.. autosummary::
49+
:toctree: ../_autosummary/
50+
:template: module.rst
2551

2652
tidy3d.plugins.autograd.utilities.chain
27-
tidy3d.plugins.autograd.utilities.make_kernel
2853
tidy3d.plugins.autograd.utilities.get_kernel_size_px
54+
tidy3d.plugins.autograd.utilities.make_kernel
55+
tidy3d.plugins.autograd.utilities.scalar_objective
56+
57+
Primitives
58+
~~~~~~~~~~
59+
60+
.. autosummary::
61+
:toctree: ../_autosummary/
62+
:template: module.rst
2963

3064
tidy3d.plugins.autograd.primitives.gaussian_filter
65+
tidy3d.plugins.autograd.primitives.interpolate_spline
66+
67+
Inverse Design
68+
~~~~~~~~~~~~~~
3169

70+
.. autosummary::
71+
:toctree: ../_autosummary/
72+
:template: module.rst
73+
74+
tidy3d.plugins.autograd.invdes.CircularFilter
75+
tidy3d.plugins.autograd.invdes.ConicFilter
76+
tidy3d.plugins.autograd.invdes.ErosionDilationPenalty
77+
tidy3d.plugins.autograd.invdes.FilterAndProject
3278
tidy3d.plugins.autograd.invdes.grey_indicator
3379
tidy3d.plugins.autograd.invdes.make_circular_filter
3480
tidy3d.plugins.autograd.invdes.make_conic_filter
@@ -39,6 +85,3 @@ Automatic Differentiation with Autograd
3985
tidy3d.plugins.autograd.invdes.ramp_projection
4086
tidy3d.plugins.autograd.invdes.tanh_projection
4187

42-
tidy3d.plugins.autograd.types.PaddingType
43-
tidy3d.plugins.autograd.types.KernelType
44-

docs/api/submit_simulations.rst

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
.. currentmodule:: tidy3d
32

43
Submitting Simulations
@@ -7,24 +6,74 @@ Submitting Simulations
76
Generic Web API
87
----------------
98

9+
Core Workflow
10+
~~~~~~~~~~~~~
11+
1012
.. autosummary::
1113
:toctree: _autosummary/
1214
:template: module.rst
1315

1416
tidy3d.web.api.webapi.run
1517
tidy3d.web.api.webapi.upload
16-
tidy3d.web.api.webapi.estimate_cost
17-
tidy3d.web.api.webapi.real_cost
18-
tidy3d.web.api.webapi.get_info
1918
tidy3d.web.api.webapi.start
2019
tidy3d.web.api.webapi.monitor
2120
tidy3d.web.api.webapi.download
2221
tidy3d.web.api.webapi.load
23-
tidy3d.web.api.webapi.delete
24-
tidy3d.web.api.webapi.download_log
22+
tidy3d.web.api.asynchronous.run_async
23+
24+
Download Utilities
25+
~~~~~~~~~~~~~~~~~~
26+
27+
.. autosummary::
28+
:toctree: _autosummary/
29+
:template: module.rst
30+
2531
tidy3d.web.api.webapi.download_json
32+
tidy3d.web.api.webapi.download_hdf5
33+
tidy3d.web.api.webapi.download_log
2634
tidy3d.web.api.webapi.load_simulation
27-
tidy3d.web.api.asynchronous.run_async
35+
36+
Task Information
37+
~~~~~~~~~~~~~~~~
38+
39+
.. autosummary::
40+
:toctree: _autosummary/
41+
:template: module.rst
42+
43+
tidy3d.web.api.webapi.get_info
44+
tidy3d.web.api.webapi.get_run_info
45+
tidy3d.web.api.webapi.get_tasks
46+
47+
Cost Estimation
48+
~~~~~~~~~~~~~~~
49+
50+
.. autosummary::
51+
:toctree: _autosummary/
52+
:template: module.rst
53+
54+
tidy3d.web.api.webapi.estimate_cost
55+
tidy3d.web.api.webapi.real_cost
56+
57+
Task Management
58+
~~~~~~~~~~~~~~~
59+
60+
.. autosummary::
61+
:toctree: _autosummary/
62+
:template: module.rst
63+
64+
tidy3d.web.api.webapi.delete
65+
tidy3d.web.api.webapi.delete_old
66+
tidy3d.web.api.webapi.abort
67+
68+
Account and System
69+
~~~~~~~~~~~~~~~~~~
70+
71+
.. autosummary::
72+
:toctree: _autosummary/
73+
:template: module.rst
74+
75+
tidy3d.web.api.webapi.account
76+
tidy3d.web.api.webapi.test
2877

2978
Job and Batch Containers
3079
-------------------------

tidy3d/web/api/webapi.py

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def start(
401401

402402

403403
@wait_for_connection
404-
def get_run_info(task_id: TaskId):
404+
def get_run_info(task_id: TaskId) -> tuple[Optional[float], Optional[float]]:
405405
"""Gets the % done and field_decay for a running task.
406406
407407
Parameters
@@ -866,7 +866,7 @@ def delete_old(
866866

867867

868868
@wait_for_connection
869-
def abort(task_id: TaskId):
869+
def abort(task_id: TaskId) -> TaskInfo:
870870
"""Abort server-side data associated with task.
871871
872872
Parameters
@@ -1078,6 +1078,31 @@ def real_cost(task_id: str, verbose=True) -> float:
10781078

10791079
@wait_for_connection
10801080
def account(verbose=True) -> Account:
1081+
"""Get account information including FlexCredit balance and usage limits.
1082+
1083+
Parameters
1084+
----------
1085+
verbose : bool = True
1086+
If ``True``, prints account information including credit balance, expiration,
1087+
and free simulation counts.
1088+
1089+
Returns
1090+
-------
1091+
Account
1092+
Object containing account information such as credit balance, expiration dates,
1093+
and daily free simulation counts.
1094+
1095+
Examples
1096+
--------
1097+
Get account information:
1098+
1099+
.. code-block:: python
1100+
1101+
account_info = web.account()
1102+
# Displays:
1103+
# Current FlexCredit balance: 10.00 and expiration date: 2024-12-31 23:59:59.
1104+
# Remaining daily free simulations: 3.
1105+
"""
10811106
account_info = Account.get()
10821107
if verbose and account_info:
10831108
console = get_logging_console()
@@ -1110,8 +1135,28 @@ def account(verbose=True) -> Account:
11101135

11111136
@wait_for_connection
11121137
def test() -> None:
1113-
"""
1114-
Confirm whether Tidy3D authentication is configured. Raises exception if not.
1138+
"""Confirm whether Tidy3D authentication is configured.
1139+
1140+
Raises
1141+
------
1142+
WebError
1143+
If Tidy3D authentication is not configured correctly.
1144+
1145+
Notes
1146+
-----
1147+
This method tests the authentication configuration by attempting to retrieve
1148+
the task list. If authentication is not properly set up, it will raise an
1149+
exception with instructions on how to configure authentication.
1150+
1151+
Examples
1152+
--------
1153+
Test authentication:
1154+
1155+
.. code-block:: python
1156+
1157+
web.test()
1158+
# If successful, displays:
1159+
# Authentication configured successfully!
11151160
"""
11161161
try:
11171162
# note, this is a little slow, but the only call that doesn't require providing a task id.

0 commit comments

Comments
 (0)