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 Apr 11, 2024
1 parent b0bf59b commit cef9c35
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 146 deletions.
21 changes: 10 additions & 11 deletions notebooks/chokepoints/red-sea-chokepoints.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"outputs": [],
"source": [
"import os\n",
"import sys\n",
"from os.path import join, exists\n",
"\n",
"import pandas as pd\n",
Expand Down Expand Up @@ -906,8 +905,8 @@
" text=element_text(family=\"Roboto\", size=13),\n",
" plot_title=element_text(family=\"Roboto\", size=16, weight=\"bold\"),\n",
" axis_text_x=element_text(rotation=45, hjust=1),\n",
" legend_position=\"none\"\n",
" )\n",
" legend_position=\"none\",\n",
" )\n",
" + facet_wrap(\"~portname\", scales=\"fixed\", ncol=1)\n",
")\n",
"display(p0)\n",
Expand Down Expand Up @@ -1077,8 +1076,8 @@
" text=element_text(family=\"Roboto\", size=13),\n",
" plot_title=element_text(family=\"Roboto\", size=16, weight=\"bold\"),\n",
" axis_text_x=element_text(rotation=45, hjust=1),\n",
" legend_position=\"none\"\n",
" )\n",
" legend_position=\"none\",\n",
" )\n",
" + scale_x_datetime(breaks=date_breaks(\"2 month\"), labels=date_format(\"%Y-%m\"))\n",
" + scale_color_brewer(type=\"qual\", palette=2)\n",
" + theme(legend_position=\"bottom\")\n",
Expand Down Expand Up @@ -1159,8 +1158,8 @@
" text=element_text(family=\"Roboto\", size=13),\n",
" plot_title=element_text(family=\"Roboto\", size=16, weight=\"bold\"),\n",
" axis_text_x=element_text(rotation=45, hjust=1),\n",
" legend_position=\"none\"\n",
" )\n",
" legend_position=\"none\",\n",
" )\n",
" + scale_x_datetime(breaks=date_breaks(\"2 month\"), labels=date_format(\"%Y-%m\"))\n",
" + scale_color_brewer(type=\"qual\", palette=2)\n",
" + facet_wrap(\"~portname\", scales=\"fixed\", ncol=1)\n",
Expand Down Expand Up @@ -1240,8 +1239,8 @@
" text=element_text(family=\"Roboto\", size=13),\n",
" plot_title=element_text(family=\"Roboto\", size=16, weight=\"bold\"),\n",
" axis_text_x=element_text(rotation=45, hjust=1),\n",
" legend_position=\"none\"\n",
" )\n",
" legend_position=\"none\",\n",
" )\n",
" + scale_x_datetime(breaks=date_breaks(\"1 month\"), labels=date_format(\"%Y-%m\"))\n",
" + scale_color_brewer(type=\"qual\", palette=2)\n",
" + scale_y_continuous(labels=percent_format())\n",
Expand Down Expand Up @@ -1511,7 +1510,7 @@
}
],
"source": [
"print(table.reset_index().to_markdown(tablefmt='github', index=False))"
"print(table.reset_index().to_markdown(tablefmt=\"github\", index=False))"
]
},
{
Expand Down Expand Up @@ -1713,7 +1712,7 @@
}
],
"source": [
"print(df_agg_pct.reset_index().to_markdown(tablefmt='github', index=False))"
"print(df_agg_pct.reset_index().to_markdown(tablefmt=\"github\", index=False))"
]
},
{
Expand Down
35 changes: 19 additions & 16 deletions notebooks/ports/red-sea-ports.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"outputs": [],
"source": [
"import os\n",
"import sys\n",
"from os.path import join, exists\n",
"\n",
"import pandas as pd\n",
Expand Down Expand Up @@ -971,7 +970,9 @@
" },\n",
" inplace=True,\n",
")\n",
"df_filt = df_filt.merge(df_ref, on=[\"portname\", \"portid\", \"w\"], how=\"left\", validate=\"m:1\")"
"df_filt = df_filt.merge(\n",
" df_ref, on=[\"portname\", \"portid\", \"w\"], how=\"left\", validate=\"m:1\"\n",
")"
]
},
{
Expand Down Expand Up @@ -1093,8 +1094,8 @@
" text=element_text(family=\"Roboto\", size=13),\n",
" plot_title=element_text(family=\"Roboto\", size=16, weight=\"bold\"),\n",
" axis_text_x=element_text(rotation=45, hjust=1),\n",
" legend_position=\"none\"\n",
" )\n",
" legend_position=\"none\",\n",
" )\n",
" + scale_x_datetime(breaks=date_breaks(\"2 month\"), labels=date_format(\"%Y-%m\"))\n",
" + scale_y_continuous(labels=comma_format())\n",
" )\n",
Expand Down Expand Up @@ -1146,7 +1147,7 @@
"metadata": {},
"outputs": [],
"source": [
"df = df.loc[df.date<\"2024-04-01\"].copy()"
"df = df.loc[df.date < \"2024-04-01\"].copy()"
]
},
{
Expand Down Expand Up @@ -1231,7 +1232,9 @@
"outputs": [],
"source": [
"df_filt = df.loc[(df.date >= \"2023-01-01\")].copy()\n",
"df_filt = df_filt.merge(df_ref, on=[\"portid\", \"portname\", \"m\"], how=\"left\", validate=\"m:1\")"
"df_filt = df_filt.merge(\n",
" df_ref, on=[\"portid\", \"portname\", \"m\"], how=\"left\", validate=\"m:1\"\n",
")"
]
},
{
Expand Down Expand Up @@ -1372,8 +1375,8 @@
" text=element_text(family=\"Roboto\", size=13),\n",
" plot_title=element_text(family=\"Roboto\", size=16, weight=\"bold\"),\n",
" axis_text_x=element_text(rotation=45, hjust=1),\n",
" legend_position=\"none\"\n",
" )\n",
" legend_position=\"none\",\n",
" )\n",
" + scale_x_datetime(breaks=date_breaks(\"2 month\"), labels=date_format(\"%Y-%m\"))\n",
" + scale_y_continuous(labels=comma_format())\n",
" # + scale_fill_brewer(type='qual', palette=1)\n",
Expand Down Expand Up @@ -2404,8 +2407,8 @@
" text=element_text(family=\"Roboto\", size=13),\n",
" plot_title=element_text(family=\"Roboto\", size=16, weight=\"bold\"),\n",
" axis_text_x=element_text(rotation=45, hjust=1),\n",
" legend_position=\"none\"\n",
" )\n",
" legend_position=\"none\",\n",
" )\n",
" + scale_y_continuous(labels=comma_format())\n",
" + scale_fill_manual(values=[\"#d73027\", \"#1a9850\"])\n",
")\n",
Expand Down Expand Up @@ -2485,8 +2488,8 @@
" text=element_text(family=\"Roboto\", size=13),\n",
" plot_title=element_text(family=\"Roboto\", size=16, weight=\"bold\"),\n",
" axis_text_x=element_text(rotation=45, hjust=1),\n",
" legend_position=\"none\"\n",
" )\n",
" legend_position=\"none\",\n",
" )\n",
" + scale_y_continuous(labels=comma_format())\n",
" + scale_fill_manual(values=[\"#d73027\", \"#1a9850\"])\n",
")\n",
Expand Down Expand Up @@ -2591,8 +2594,8 @@
" text=element_text(family=\"Roboto\", size=13),\n",
" plot_title=element_text(family=\"Roboto\", size=16, weight=\"bold\"),\n",
" axis_text_x=element_text(rotation=45, hjust=1),\n",
" legend_position=\"none\"\n",
" )\n",
" legend_position=\"none\",\n",
" )\n",
" + scale_y_continuous(labels=percent_format())\n",
" + scale_fill_manual(values=[\"#d73027\", \"#1a9850\"])\n",
")\n",
Expand Down Expand Up @@ -2674,8 +2677,8 @@
" text=element_text(family=\"Roboto\", size=13),\n",
" plot_title=element_text(family=\"Roboto\", size=16, weight=\"bold\"),\n",
" axis_text_x=element_text(rotation=45, hjust=1),\n",
" legend_position=\"none\"\n",
" )\n",
" legend_position=\"none\",\n",
" )\n",
" + scale_y_continuous(labels=percent_format())\n",
" + scale_fill_manual(values=[\"#d73027\", \"#1a9850\"])\n",
")\n",
Expand Down
Loading

0 comments on commit cef9c35

Please sign in to comment.