Skip to content

Commit 7f3c898

Browse files
committed
add not implemented errors
1 parent 199aeb8 commit 7f3c898

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tidy3d/web/api/webapi.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ def get_run_info(task_id: TaskId) -> tuple[Optional[float], Optional[float]]:
741741
Average field intensity normalized to max value (1.0).
742742
Is ``None`` if run info not available.
743743
"""
744+
if _is_modeler_batch(task_id):
745+
raise NotImplementedError("Operation not implemented for modeler batches.")
744746
task = SimulationTask(taskId=task_id)
745747
return task.get_running_info()
746748

@@ -1062,6 +1064,8 @@ def download_json(task_id: TaskId, path: PathLike = SIM_FILE_JSON, verbose: bool
10621064
If ``True``, will print progressbars and status, otherwise, will run silently.
10631065
10641066
"""
1067+
if _is_modeler_batch(task_id):
1068+
raise NotImplementedError("Operation not implemented for modeler batches.")
10651069
task = SimulationTask(taskId=task_id)
10661070
task.get_simulation_json(path, verbose=verbose)
10671071

@@ -1093,6 +1097,8 @@ def load_simulation(
10931097
Union[:class:`.Simulation`, :class:`.HeatSimulation`, :class:`.EMESimulation`]
10941098
Simulation loaded from downloaded json file.
10951099
"""
1100+
if _is_modeler_batch(task_id):
1101+
raise NotImplementedError("Operation not implemented for modeler batches.")
10961102
task = SimulationTask.get(task_id)
10971103
path = Path(path)
10981104
if path.suffix == ".json":
@@ -1128,6 +1134,8 @@ def download_log(
11281134
----
11291135
To load downloaded results into data, call :meth:`load` with option ``replace_existing=False``.
11301136
"""
1137+
if _is_modeler_batch(task_id):
1138+
raise NotImplementedError("Operation not implemented for modeler batches.")
11311139
task = SimulationTask(taskId=task_id)
11321140
task.get_log(path, verbose=verbose, progress_callback=progress_callback)
11331141

@@ -1370,6 +1378,8 @@ def delete(task_id: TaskId, versions: bool = False) -> TaskInfo:
13701378
Object containing information about status, size, credits of task.
13711379
13721380
"""
1381+
if _is_modeler_batch(task_id):
1382+
raise NotImplementedError("Delete operation not implemented for modeler batches.")
13731383
if not task_id:
13741384
raise ValueError("Task id not found.")
13751385
task = SimulationTask.get(task_id, verbose=False)
@@ -1398,6 +1408,8 @@ def download_simulation(
13981408
Optional callback function called when downloading file with ``bytes_in_chunk`` as argument.
13991409
14001410
"""
1411+
if _is_modeler_batch(task_id):
1412+
raise NotImplementedError("Operation not implemented for modeler batches.")
14011413
task_info = get_info(task_id)
14021414
task_type = task_info.taskType
14031415

0 commit comments

Comments
 (0)