Skip to content

Commit

Permalink
style: spelling and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtanker committed Jan 29, 2024
1 parent eb5e47d commit a7347ba
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 22 deletions.
4 changes: 3 additions & 1 deletion docs/gallery/3D_stack.ipynb
Expand Up @@ -27,8 +27,10 @@
"# set Python's logging level to get information\n",
"import logging\n",
"\n",
"from polartoolkit import fetch, maps, regions\n",
"import pyogrio\n",
"\n",
"from polartoolkit import fetch, maps, regions\n",
"\n",
"logging.getLogger().setLevel(logging.INFO)"
]
},
Expand Down
8 changes: 5 additions & 3 deletions docs/tips.ipynb
Expand Up @@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2022-09-20T03:34:13.751777Z",
Expand All @@ -46,7 +46,6 @@
],
"source": [
"import pygmt\n",
"from polartoolkit import utils\n",
"\n",
"fig = pygmt.Figure()\n",
"region = (-2700000, 2700000, -2700000, 2700000)\n",
Expand All @@ -58,7 +57,10 @@
"fig_proj_ll = \"s0/-90/-71/1:\" + str(fig_ratio)\n",
"\n",
"fig.coast(\n",
" region=region+(\"+ue\",), projection=fig_proj_ll, shorelines=\"0.5p,black\", land=\"skyblue\"\n",
" region=(*region, \"+ue\"),\n",
" projection=fig_proj_ll,\n",
" shorelines=\"0.5p,black\",\n",
" land=\"skyblue\",\n",
")\n",
"fig.coast(\n",
" projection=fig_proj_ll, area_thresh=\"+ag\", shorelines=\"0.5p,black\", land=\"gray\"\n",
Expand Down
18 changes: 9 additions & 9 deletions docs/tutorial/utils_walkthrough.ipynb
Expand Up @@ -58,7 +58,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -106,7 +106,7 @@
"\n",
"fig.plot(\n",
" projection=utils.set_proj(figure_region)[1],\n",
" region=utils.gmt_str_to_list(figure_region)+\"+ue\",\n",
" region=(*figure_region, \"+ue\"),\n",
" x=[pig_latlon[0], pig_latlon[0], pig_latlon[1], pig_latlon[1], pig_latlon[0]],\n",
" y=[pig_latlon[2], pig_latlon[3], pig_latlon[3], pig_latlon[2], pig_latlon[2]],\n",
" pen=\"2p,red\",\n",
Expand Down Expand Up @@ -144,7 +144,7 @@
"lis = regions.larsen_ice_shelf\n",
"print(lis)\n",
"\n",
"# convert to decimal degress\n",
"# convert to decimal degrees\n",
"lis_latlon = utils.region_xy_to_ll(lis)\n",
"print(lis_latlon)\n",
"\n",
Expand All @@ -162,7 +162,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand All @@ -171,7 +171,7 @@
"[-360000.0, -1100000.0]"
]
},
"execution_count": 6,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -185,7 +185,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -201,7 +201,7 @@
"[-360000.0000000289, -1100000.0000000878]"
]
},
"execution_count": 7,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -218,7 +218,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -253,7 +253,7 @@
"fig.plot(\n",
" x=RI_center_latlon[1],\n",
" y=RI_center_latlon[0],\n",
" region=regions.roosevelt_island+(\"+ue\",),\n",
" region=(*regions.roosevelt_island, \"+ue\"),\n",
" projection=utils.set_proj(regions.roosevelt_island)[1],\n",
" style=\"t.8c\",\n",
" pen=\"2p,red\",\n",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -45,7 +45,7 @@ dependencies = [
"rioxarray",
"scipy",
"numpy",
"pygmt>=0.10.0", # need paramter "log" for colorbar
"pygmt>=0.10.0", # need parameter "log" for colorbar
"geopandas",
"zarr",
"python-dotenv",
Expand Down
14 changes: 7 additions & 7 deletions src/polartoolkit/maps.py
Expand Up @@ -849,7 +849,7 @@ def add_gridlines(
region = tuple(lib.extract_region())
assert len(region) == 4

region = utils.gmt_str_to_list(region)+"+ue"
region_converted = (*region, "+ue") # codespell-ignore

if x_spacing is None:
x_frames = ["xag", "xa"]
Expand Down Expand Up @@ -884,7 +884,7 @@ def add_gridlines(
# plot semi-transparent lines and annotations with black font and white shadow
fig.basemap(
projection=projection,
region=region,
region=region_converted,
frame=[
"NSWE",
x_frames[0],
Expand All @@ -897,7 +897,7 @@ def add_gridlines(
with pygmt.config(FONT_ANNOT_PRIMARY="8p,black"):
fig.basemap(
projection=projection,
region=region,
region=region_converted,
frame=[
"NSWE",
x_frames[0],
Expand Down Expand Up @@ -999,7 +999,7 @@ def add_scalebar(
region = tuple(lib.extract_region())
assert len(region) == 4

region_str = utils.gmt_str_to_list(region)+"+ue"
region_converted = (*region, "+ue") # codespell-ignore

def round_to_1(x: float) -> float:
return round(x, -int(floor(log10(abs(x)))))
Expand All @@ -1015,7 +1015,7 @@ def round_to_1(x: float) -> float:
MAP_TICK_PEN_PRIMARY=f"0.5p,{font_color}",
):
fig.basemap(
region=region_str,
region=region_converted,
projection=projection,
map_scale=f'{position}+w{scale_length}k+f+l"km"+ar',
# verbose="e",
Expand Down Expand Up @@ -1053,12 +1053,12 @@ def add_north_arrow(
region = tuple(lib.extract_region())
assert len(region) == 4

region = utils.gmt_str_to_list(region)+"+ue"
region_converted = (*region, "+ue") # codespell-ignore

rose_str = kwargs.get("rose_str", f"{position}+w{rose_size}")

fig.basemap(
region=region,
region=region_converted,
projection=projection,
rose=rose_str,
verbose="e",
Expand Down
2 changes: 1 addition & 1 deletion src/polartoolkit/profile.py
Expand Up @@ -774,7 +774,7 @@ def plot_profile(
fig.plot(
x=df_layers.dist,
y=df_layers[k],
close="+yb", # close the polygons,
close="+yb", # close the polygons,
fill=v["color"],
frame=kwargs.get("layers_frame", ["nSew", "a"]),
transparency=kwargs.get(
Expand Down

0 comments on commit a7347ba

Please sign in to comment.