Skip to content

Commit ca20525

Browse files
committed
Print cost breakdown in estimate_cost if there is mode or post-processing charge
1 parent e176ec5 commit ca20525

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tidy3d/web/api/webapi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,12 @@ def estimate_cost(task_id: str, verbose: bool = True) -> float:
760760
"task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit "
761761
"cost after a simulation run."
762762
)
763+
fc_mode = task_info.estFlexCreditMode
764+
fc_post = task_info.estFlexCreditPostProcess
765+
if fc_mode:
766+
console.log(f" {fc_mode:1.3f} FlexCredit of the total cost from mode solves.")
767+
if fc_post:
768+
console.log(f" {fc_post:1.3f} FlexCredit of the total cost from post-processing.")
763769
return task_info.estFlexUnit
764770

765771
log.warning(

tidy3d/web/core/task_info.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class TaskInfo(TaskBase):
6262
realFlexUnit: float = None
6363
oriRealFlexUnit: float = None
6464
estFlexUnit: float = None
65+
estFlexCreditTimeStepping: float = None
66+
estFlexCreditPostProcess: float = None
67+
estFlexCreditMode: float = None
6568
s3Storage: float = None
6669
startSolverTime: Optional[datetime] = None
6770
finishSolverTime: Optional[datetime] = None

0 commit comments

Comments
 (0)