Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 16, 2024
1 parent 1e0d4e2 commit cf77d0c
Showing 1 changed file with 3 additions and 64 deletions.
67 changes: 3 additions & 64 deletions notebooks/experiment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"setp = 92°C\n",
"file = results.csv_2023-09-20T15-26-45\n",
"done = 2023-09-20 15:42:55.897233\n"
]
}
],
"outputs": [],
"source": [
"(setp, file, done) = run(92)"
]
Expand All @@ -58,17 +48,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"setp = 100°C\n",
"file = results.csv_2023-09-20T15-26-47\n",
"done = 2023-09-20 16:18:43.152778\n"
]
}
],
"outputs": [],
"source": [
"(setp, file, done) = run(100)"
]
Expand All @@ -84,48 +64,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"setp = 102°C\n",
"file = results.csv_2023-09-20T16-20-05\n",
"VI_ERROR_IO (-1073807298): Could not perform operation because of I/O error.\n",
"VI_ERROR_IO (-1073807298): Could not perform operation because of I/O error.\n",
"VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.\n",
"VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.\n",
"VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.\n",
"VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.\n",
"VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.\n",
"VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.\n",
"VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.\n",
"VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.\n",
"VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.\n",
"VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.\n"
]
},
{
"ename": "VisaIOError",
"evalue": "VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge.",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mVisaIOError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[2], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m (setp, file, done) \u001b[39m=\u001b[39m run(\u001b[39m102\u001b[39;49m)\n",
"Cell \u001b[1;32mIn[1], line 10\u001b[0m, in \u001b[0;36mrun\u001b[1;34m(setpoint)\u001b[0m\n\u001b[0;32m 8\u001b[0m file \u001b[39m=\u001b[39m \u001b[39mlist\u001b[39m(PARAMS\u001b[39m.\u001b[39mpaths\u001b[39m.\u001b[39mresults\u001b[39m.\u001b[39miterdir())[\u001b[39m-\u001b[39m\u001b[39m1\u001b[39m]\u001b[39m.\u001b[39mstem\n\u001b[0;32m 9\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39msetp = \u001b[39m\u001b[39m{\u001b[39;00msetpoint\u001b[39m}\u001b[39;00m\u001b[39m°C\u001b[39m\u001b[39m\\n\u001b[39;00m\u001b[39mfile = \u001b[39m\u001b[39m{\u001b[39;00mfile\u001b[39m}\u001b[39;00m\u001b[39m\"\u001b[39m)\n\u001b[1;32m---> 10\u001b[0m looper(setpoint)\u001b[39m.\u001b[39;49mstart()\n\u001b[0;32m 11\u001b[0m done \u001b[39m=\u001b[39m datetime\u001b[39m.\u001b[39mnow()\n\u001b[0;32m 12\u001b[0m \u001b[39mprint\u001b[39m(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mdone = \u001b[39m\u001b[39m{\u001b[39;00mdone\u001b[39m}\u001b[39;00m\u001b[39m\"\u001b[39m)\n",
"File \u001b[1;32m~\\Code\\mine\\boilerdaq\\src\\boilerdaq\\daq.py:831\u001b[0m, in \u001b[0;36mLooper.start\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 829\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mapp\u001b[39m.\u001b[39mquit()\n\u001b[0;32m 830\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcontroller:\n\u001b[1;32m--> 831\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mcontroller\u001b[39m.\u001b[39;49mclose()\n",
"File \u001b[1;32m~\\Code\\mine\\boilerdaq\\src\\boilerdaq\\daq.py:605\u001b[0m, in \u001b[0;36mController.close\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 603\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mclose\u001b[39m(\u001b[39mself\u001b[39m):\n\u001b[0;32m 604\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\"Close the instrument to be controlled.\"\"\"\u001b[39;00m\n\u001b[1;32m--> 605\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mcontrol_result\u001b[39m.\u001b[39;49mclose()\n",
"File \u001b[1;32m~\\Code\\mine\\boilerdaq\\src\\boilerdaq\\daq.py:502\u001b[0m, in \u001b[0;36mPowerResult.close\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 499\u001b[0m \u001b[39mreturn\u001b[39;00m\n\u001b[0;32m 500\u001b[0m \u001b[39m# We don't actually write zero here because the PID will get `starting_output`\u001b[39;00m\n\u001b[0;32m 501\u001b[0m \u001b[39m# by querying voltage next time the supply is turned on.\u001b[39;00m\n\u001b[1;32m--> 502\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49minstrument\u001b[39m.\u001b[39;49mwrite(\u001b[39m\"\u001b[39;49m\u001b[39moutput:state off\u001b[39;49m\u001b[39m\"\u001b[39;49m) \u001b[39m# type: ignore\u001b[39;00m\n\u001b[0;32m 503\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39minstrument\u001b[39m.\u001b[39mclose() \u001b[39m# type: ignore\u001b[39;00m\n\u001b[0;32m 504\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39minstrument \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m\n",
"File \u001b[1;32mc:\\Users\\Blake\\Code\\mine\\boilerdaq\\.venv\\Lib\\site-packages\\pyvisa\\resources\\messagebased.py:197\u001b[0m, in \u001b[0;36mMessageBasedResource.write\u001b[1;34m(self, message, termination, encoding)\u001b[0m\n\u001b[0;32m 191\u001b[0m warnings\u001b[39m.\u001b[39mwarn(\n\u001b[0;32m 192\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mwrite message already ends with \u001b[39m\u001b[39m\"\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mtermination characters\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[0;32m 193\u001b[0m stacklevel\u001b[39m=\u001b[39m\u001b[39m2\u001b[39m,\n\u001b[0;32m 194\u001b[0m )\n\u001b[0;32m 195\u001b[0m message \u001b[39m+\u001b[39m\u001b[39m=\u001b[39m term\n\u001b[1;32m--> 197\u001b[0m count \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mwrite_raw(message\u001b[39m.\u001b[39;49mencode(enco))\n\u001b[0;32m 199\u001b[0m \u001b[39mreturn\u001b[39;00m count\n",
"File \u001b[1;32mc:\\Users\\Blake\\Code\\mine\\boilerdaq\\.venv\\Lib\\site-packages\\pyvisa\\resources\\messagebased.py:157\u001b[0m, in \u001b[0;36mMessageBasedResource.write_raw\u001b[1;34m(self, message)\u001b[0m\n\u001b[0;32m 143\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mwrite_raw\u001b[39m(\u001b[39mself\u001b[39m, message: \u001b[39mbytes\u001b[39m) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m \u001b[39mint\u001b[39m:\n\u001b[0;32m 144\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\"Write a byte message to the device.\u001b[39;00m\n\u001b[0;32m 145\u001b[0m \n\u001b[0;32m 146\u001b[0m \u001b[39m Parameters\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 155\u001b[0m \n\u001b[0;32m 156\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[1;32m--> 157\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mvisalib\u001b[39m.\u001b[39;49mwrite(\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49msession, message)[\u001b[39m0\u001b[39m]\n",
"File \u001b[1;32mc:\\Users\\Blake\\Code\\mine\\boilerdaq\\.venv\\Lib\\site-packages\\pyvisa\\ctwrapper\\functions.py:2796\u001b[0m, in \u001b[0;36mwrite\u001b[1;34m(library, session, data)\u001b[0m\n\u001b[0;32m 2794\u001b[0m return_count \u001b[39m=\u001b[39m ViUInt32()\n\u001b[0;32m 2795\u001b[0m \u001b[39m# [ViSession, ViBuf, ViUInt32, ViPUInt32]\u001b[39;00m\n\u001b[1;32m-> 2796\u001b[0m ret \u001b[39m=\u001b[39m library\u001b[39m.\u001b[39;49mviWrite(session, data, \u001b[39mlen\u001b[39;49m(data), byref(return_count))\n\u001b[0;32m 2797\u001b[0m \u001b[39mreturn\u001b[39;00m return_count\u001b[39m.\u001b[39mvalue, ret\n",
"File \u001b[1;32mc:\\Users\\Blake\\Code\\mine\\boilerdaq\\.venv\\Lib\\site-packages\\pyvisa\\ctwrapper\\highlevel.py:226\u001b[0m, in \u001b[0;36mIVIVisaLibrary._return_handler\u001b[1;34m(self, ret_value, func, arguments)\u001b[0m\n\u001b[0;32m 223\u001b[0m \u001b[39m# Set session back to a safe value\u001b[39;00m\n\u001b[0;32m 224\u001b[0m session \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m\n\u001b[1;32m--> 226\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mhandle_return_value(session, ret_value)\n",
"File \u001b[1;32mc:\\Users\\Blake\\Code\\mine\\boilerdaq\\.venv\\Lib\\site-packages\\pyvisa\\highlevel.py:251\u001b[0m, in \u001b[0;36mVisaLibraryBase.handle_return_value\u001b[1;34m(self, session, status_code)\u001b[0m\n\u001b[0;32m 248\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_last_status_in_session[session] \u001b[39m=\u001b[39m rv\n\u001b[0;32m 250\u001b[0m \u001b[39mif\u001b[39;00m rv \u001b[39m<\u001b[39m \u001b[39m0\u001b[39m:\n\u001b[1;32m--> 251\u001b[0m \u001b[39mraise\u001b[39;00m errors\u001b[39m.\u001b[39mVisaIOError(rv)\n\u001b[0;32m 253\u001b[0m \u001b[39mif\u001b[39;00m rv \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39missue_warning_on:\n\u001b[0;32m 254\u001b[0m \u001b[39mif\u001b[39;00m session \u001b[39mand\u001b[39;00m rv \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_ignore_warning_in_session[session]:\n",
"\u001b[1;31mVisaIOError\u001b[0m: VI_ERROR_NCIC (-1073807264): The interface associated with this session is not currently the controller in charge."
]
}
],
"outputs": [],
"source": [
"(setp, file, done) = run(102)"
]
Expand Down

0 comments on commit cf77d0c

Please sign in to comment.