From dc582dd07f17a4c249569806a5944b73bd185723 Mon Sep 17 00:00:00 2001 From: Tyler Hughes Date: Thu, 16 Mar 2023 13:42:31 -0400 Subject: [PATCH 1/3] fix run_info --- tidy3d/web/simulation_task.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tidy3d/web/simulation_task.py b/tidy3d/web/simulation_task.py index ea1dfb9b9..1ac376932 100644 --- a/tidy3d/web/simulation_task.py +++ b/tidy3d/web/simulation_task.py @@ -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) From 29c4a3d13d84ef0ddaae624b21f19418fe23f4f7 Mon Sep 17 00:00:00 2001 From: Tyler Hughes Date: Thu, 16 Mar 2023 13:51:20 -0400 Subject: [PATCH 2/3] more helpful api key error --- tidy3d/web/http_management.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tidy3d/web/http_management.py b/tidy3d/web/http_management.py index 9b161d99c..4c51701db 100644 --- a/tidy3d/web/http_management.py +++ b/tidy3d/web/http_management.py @@ -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 '~/.tidy3d/config' (unix) or " + "'C:\Users\USERNAME\.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__ From 767387b190af5cf2f789d219c3462c72120af42e Mon Sep 17 00:00:00 2001 From: Tyler Hughes Date: Thu, 16 Mar 2023 14:18:06 -0400 Subject: [PATCH 3/3] fix unicode problem --- tidy3d/web/http_management.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tidy3d/web/http_management.py b/tidy3d/web/http_management.py index 4c51701db..ba1e5fee2 100644 --- a/tidy3d/web/http_management.py +++ b/tidy3d/web/http_management.py @@ -55,8 +55,8 @@ def api_key_auth(request: requests.request) -> requests.request: "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 '~/.tidy3d/config' (unix) or " - "'C:\Users\USERNAME\.tidy3d/config' (windows) containing the following line: " + "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