Skip to content

Commit 72955b8

Browse files
Gregory Robertsgroberts-flex
authored andcommitted
change[webapi]: propagate verbose argument to start function
1 parent 55f188e commit 72955b8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4848
- Restructured the smatrix plugin with backwards-incompatible changes for a more robust architecture. Notably, `ComponentModeler` has been renamed to `ModalComponentModeler` and internal web API methods have been removed. Please see our migration guide for details on updating your workflows.
4949
- Prevent small bandwidth sources from being created in `TerminalComponentModeler` when modeler frequencies are close together.
5050
- `Simulation.epsilon` now samples off-diagonal elements of fully tensorial permittivity at grid *boundaries*, to be consistent with the how these enter the FDTD simulation. This means that all off-diagonal components are now sampled at the same locations.
51+
- Propagate `verbose` to `start` function in web API.
5152

5253
### Fixed
5354
- Bug in `TerminalComponentModeler.get_antenna_metrics_data` when port amplitudes are set to zero.

tidy3d/web/api/webapi.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ def run(
215215
)
216216
start(
217217
task_id,
218+
verbose=verbose,
218219
solver_version=solver_version,
219220
worker_group=worker_group,
220221
pay_type=pay_type,
@@ -473,6 +474,7 @@ def get_info(task_id: TaskId, verbose: bool = True) -> TaskInfo:
473474
@wait_for_connection
474475
def start(
475476
task_id: TaskId,
477+
verbose: bool = True,
476478
solver_version: Optional[str] = None,
477479
worker_group: Optional[str] = None,
478480
pay_type: Union[PayType, str] = PayType.AUTO,
@@ -485,6 +487,8 @@ def start(
485487
486488
task_id : str
487489
Unique identifier of task on server. Returned by :meth:`upload`.
490+
verbose : bool = True
491+
If ``True``, will print log messages, otherwise, will run silently.
488492
solver_version: str = None
489493
target solver version.
490494
worker_group: str = None
@@ -499,7 +503,7 @@ def start(
499503
To monitor progress, can call :meth:`monitor` after starting simulation.
500504
"""
501505

502-
console = get_logging_console()
506+
console = get_logging_console() if verbose else None
503507

504508
# Component modeler batch path: hide split/check/submit
505509
if _is_modeler_batch(task_id):
@@ -509,7 +513,8 @@ def start(
509513
status = detail.totalStatus
510514
status_str = status.value
511515
if status_str in ("validate_success", "validate_warn"):
512-
console.log("Component modeler batch validation has been successful.")
516+
if verbose:
517+
console.log("Component modeler batch validation has been successful.")
513518
if status_str not in ("validate_success", "validate_warn"):
514519
raise WebError(f"Batch task {task_id} is blocked: {status_str}")
515520
# Submit batch to start runs after validation

0 commit comments

Comments
 (0)