Skip to content

Commit

Permalink
Fix build break
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph-hellerstein committed May 21, 2024
1 parent a802059 commit 1fd6aeb
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
7 changes: 7 additions & 0 deletions examples/Analysis-of-Immune-Response-Pneumocci.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,13 @@
"<img src=\"https://github.com/ModelEngineering/controlSBML/raw/main/docs/images/pneumocci_design_output.png\" alt=\"drawing\" width=\"600\"/>\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The dynamics are preserved when we change the set point."
]
},
{
"cell_type": "code",
"execution_count": 23,
Expand Down
43 changes: 43 additions & 0 deletions examples/Analysis-of-mTOR.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,49 @@
"source": [
"_ = CTLSB.plotDesign(kP_spec=CTLSB.kP, kI_spec=CTLSB.kI, setpoint=80)"
]
},
{
"cell_type": "markdown",
"id": "3efeb9bb-77d1-4d62-8b87-b592de66bb25",
"metadata": {},
"source": [
"# Effect of Noise"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "7cdae250-12cb-42c1-b2b4-6757b2f5e85b",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'ControlSBML' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m ctlsb \u001b[38;5;241m=\u001b[39m \u001b[43mControlSBML\u001b[49m(URL, figsize\u001b[38;5;241m=\u001b[39m(\u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m5\u001b[39m), times\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39mlinspace(\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m3000\u001b[39m, \u001b[38;5;241m30000\u001b[39m),\n\u001b[1;32m 2\u001b[0m markers\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, xlabel_angle\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m45\u001b[39m,\n\u001b[1;32m 3\u001b[0m input_name\u001b[38;5;241m=\u001b[39mINPUT_NAME, output_name\u001b[38;5;241m=\u001b[39mOUTPUT_NAME)\n",
"\u001b[0;31mNameError\u001b[0m: name 'ControlSBML' is not defined"
]
}
],
"source": [
"%%time\n",
"noise_spec = ctl.NoiseSpec(random_mag=5, random_std=0.1, offset=1)\n",
"ctlsb = ControlSBML(URL, figsize=(5, 5), times=np.linspace(0, 3000, 30000),\n",
" markers=False, xlabel_angle=45,\n",
" input_name=INPUT_NAME, output_name=OUTPUT_NAME,\n",
" noise_spec=noise_spec)\n",
"grid = ctlsb.getGrid(kP_spec=True, kI_spec=True, num_coordinate=11)\n",
"axis = grid.getAxis(\"kP\", min)\n",
"axis.setMinValue(0.1)\n",
"axis.setMaxValue(2)\n",
"axis = GRID.getAxis(\"kI\")\n",
"axis.setMinValue(0.001)\n",
"axis.setMaxValue(0.01)\n",
"_ = ctlsb.plotGridDesign(GRID, setpoint=120, times=np.linspace(0, 3000, 30000))"
]
}
],
"metadata": {
Expand Down
3 changes: 2 additions & 1 deletion src/controlSBML/sbml_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,8 @@ def plotSISOClosedLoop(self, timeseries:Timeseries, setpoint, selections=None,
df = pd.DataFrame(timeseries[columns], columns=columns)
# Plot the other left axis lines
if cn.O_LEGEND in new_kwargs.keys():
new_kwargs[cn.O_LEGEND].append(cn.O_SETPOINT)
if isinstance(new_kwargs[cn.O_LEGEND], list):
new_kwargs[cn.O_LEGEND].append(cn.O_SETPOINT)
new_kwargs.setdefault(cn.O_AX2, 0)
plot_result = util.plotOneTS(df, colors=colors, **new_kwargs)
ax = plot_result.ax
Expand Down

0 comments on commit 1fd6aeb

Please sign in to comment.