Skip to content

Commit e824ac6

Browse files
committed
docs[webapi]: add missing webapi and autograd plugin methods to docs and reorganize sections
1 parent 6e5dd73 commit e824ac6

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
@@ -400,7 +400,7 @@ def start(
400400

401401

402402
@wait_for_connection
403-
def get_run_info(task_id: TaskId):
403+
def get_run_info(task_id: TaskId) -> tuple[Optional[float], Optional[float]]:
404404
"""Gets the % done and field_decay for a running task.
405405
406406
Parameters
@@ -865,7 +865,7 @@ def delete_old(
865865

866866

867867
@wait_for_connection
868-
def abort(task_id: TaskId):
868+
def abort(task_id: TaskId) -> TaskInfo:
869869
"""Abort server-side data associated with task.
870870
871871
Parameters
@@ -1077,6 +1077,31 @@ def real_cost(task_id: str, verbose=True) -> float:
10771077

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

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

0 commit comments

Comments
 (0)