From 7536f631a252526acad96fefeaf1710f6138baac Mon Sep 17 00:00:00 2001 From: yao-cqc Date: Fri, 17 May 2024 12:47:14 +0100 Subject: [PATCH] Fix unreliable calendar demo --- .../Quantinuum_hseries_queue_visibility.ipynb | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/examples/Quantinuum_hseries_queue_visibility.ipynb b/examples/Quantinuum_hseries_queue_visibility.ipynb index 25bb9612..2f614df7 100644 --- a/examples/Quantinuum_hseries_queue_visibility.ipynb +++ b/examples/Quantinuum_hseries_queue_visibility.ipynb @@ -799,12 +799,13 @@ "metadata": {}, "outputs": [], "source": [ - "print(\n", - " \"Time Range: \",\n", - " calendar[3].get(\"start-date\").strftime(\"%Y-%m-%d %H:%M %Z\"),\n", - " \"-\",\n", - " calendar[3].get(\"end-date\").strftime(\"%Y-%m-%d %H:%M %Z\"),\n", - ")" + "if len(calendar) > 0:\n", + " print(\n", + " \"Time Range: \",\n", + " calendar[0].get(\"start-date\").strftime(\"%Y-%m-%d %H:%M %Z\"),\n", + " \"-\",\n", + " calendar[0].get(\"end-date\").strftime(\"%Y-%m-%d %H:%M %Z\"),\n", + " )" ] }, { @@ -821,13 +822,13 @@ "outputs": [], "source": [ "calendar_utc = quantum_backend.get_calendar(start_date, end_date, localise=False)\n", - "\n", - "print(\n", - " \"Time Range:\",\n", - " calendar_utc[3].get(\"start-date\").strftime(\"%Y-%m-%d %H:%M %Z\"),\n", - " \"-\",\n", - " calendar_utc[3].get(\"end-date\").strftime(\"%Y-%m-%d %H:%M %Z\"),\n", - ")" + "if len(calendar) > 0:\n", + " print(\n", + " \"Time Range:\",\n", + " calendar_utc[0].get(\"start-date\").strftime(\"%Y-%m-%d %H:%M %Z\"),\n", + " \"-\",\n", + " calendar_utc[0].get(\"end-date\").strftime(\"%Y-%m-%d %H:%M %Z\"),\n", + " )" ] }, {