Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix run info / progress bars #763

Merged
merged 3 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tidy3d/web/http_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ def api_key_auth(request: requests.request) -> requests.request:
key = api_key()
if not key:
raise ValueError(
"API key not found, please set it by commandline or environment,"
" eg: tidy3d configure or export "
"SIMCLOUD_APIKEY=xxx"
"API key not found. To get your API key, sign into 'https://tidy3d.simulation.cloud' "
"and copy it from your 'Account' page. Then you can configure tidy3d through command "
"line 'tidy3d configure' and enter your API key when prompted. "
"Alternatively, especially if using windows, you can manually create the configuration "
"file by creating a file at their home directory '~/.tidy3d/config' (unix) or "
"'.tidy3d/config' (windows) containing the following line: "
"apikey = 'XXX'. Here XXX is your API key copied from your account page within quotes."
)
request.headers["simcloud-api-key"] = key
request.headers["tidy3d-python-version"] = __version__
Expand Down
3 changes: 2 additions & 1 deletion tidy3d/web/simulation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@ def get_running_info(self) -> Tuple[float, float]:
download_file(self.task_id, RUNNING_INFO, to_file=temp.name, verbose=False)
with open(temp.name, "r", encoding="utf-8") as csv:
progress_string = csv.readlines()
perc_done, field_decay = progress_string[-1].split(",")

perc_done, field_decay = progress_string[-1].split(",")[:2]

perc_done = float(perc_done)
field_decay = float(field_decay)
Expand Down