Skip to content

Commit

Permalink
addressing pylint hints
Browse files Browse the repository at this point in the history
  • Loading branch information
slayoo committed Oct 20, 2024
1 parent d73e26e commit 3d950d7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions examples/particle_simulation_with_camp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 25,
"id": "cc3bdd53-5da9-45f4-9a45-b6f1cc457fb5",
"metadata": {},
"outputs": [
Expand All @@ -112,7 +112,10 @@
}
],
"source": [
"CAMP_URL = 'https://raw.githubusercontent.com/open-atmos/camp/refs/heads/main/data/CAMP_v1_paper/modal/monarch_box_modal/'\n",
"CAMP_URL = (\n",
" 'https://raw.githubusercontent.com/open-atmos/camp/refs/heads/main'\n",
" '/data/CAMP_v1_paper/modal/monarch_box_modal/'\n",
")\n",
"for path in PATHS:\n",
" print(path)\n",
" with open(path, 'w', encoding='utf-8') as fout:\n",
Expand Down Expand Up @@ -451,7 +454,10 @@
"OUTPUT = defaultdict(list)\n",
"last = defaultdict(float)\n",
"i_output = 1\n",
"for i_time in range(0, int(RUN_PART_ARGS['run_part_opt'].t_max / RUN_PART_ARGS['run_part_opt'].del_t) + 1):\n",
"for i_time in range(\n",
" 0,\n",
" int(RUN_PART_ARGS['run_part_opt'].t_max / RUN_PART_ARGS['run_part_opt'].del_t) + 1\n",
"):\n",
" if i_time != 0:\n",
" (last[\"output_time\"], last[\"progress_time\"], i_output) = ppmc.run_part_timestep(\n",
" *[RUN_PART_ARGS[key] for key in (\n",
Expand Down Expand Up @@ -1750,7 +1756,7 @@
"metadata": {},
"outputs": [],
"source": [
"def set_tickmarks(axes, n_ticks):\n",
"def set_tickmarks(axes, n_yticks):\n",
" ylims = axes.get_ylim()\n",
" if np.log10(ylims[0]) > 1:\n",
" val = -int(np.ceil(np.abs(np.log10(ylims[0])))) + 1\n",
Expand All @@ -1759,7 +1765,7 @@
" ymin = round(ylims[0] - .1 * ylims[0], val)\n",
" ymax = round(ylims[1] + .1 * ylims[1], val)\n",
" plt.ylim([ymin, ymax])\n",
" plt.yticks(np.linspace(ymin, ymax, n_ticks))"
" plt.yticks(np.linspace(ymin, ymax, n_yticks))"
]
},
{
Expand Down Expand Up @@ -3059,7 +3065,7 @@
"plt.plot(OUTPUT['elapsed_time'], OUTPUT['total_mass_conc'], \"b\", label=\"mass conc\")\n",
"plt.ylabel(\"Mass concentration (kg m$^{-3}$)\", color='b')\n",
"plt.xlabel(\"Time (s)\")\n",
"n_ticks = 5\n",
"n_yticks = 5\n",
"set_tickmarks(plt.gca(), n_ticks)\n",
"plt.twinx()\n",
"plt.plot(OUTPUT['elapsed_time'], OUTPUT['total_num_conc'], \"g\", label=\"num conc\")\n",
Expand Down

0 comments on commit 3d950d7

Please sign in to comment.