Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
floriscalkoen committed Aug 28, 2024
1 parent 109a54a commit e3e06a5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ MIT license. Data licenses can be found in the respective STAC collection.

## Credits

Initial template of `coastpy` was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).
Initial template of `coastpy` was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).
12 changes: 6 additions & 6 deletions scripts/python/make_gcts.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def sort_line_segments(segments, original_line):
with fsspec.open(utm_grid_url, **storage_options) as f:
utm_grid = gpd.read_parquet(f)

withr fsspec.open(countries_url, **storage_options) as f:
with fsspec.open(countries_url, **storage_options) as f:
countries = gpd.read_parquet(f)

utm_grid = utm_grid.dissolve("epsg").to_crs(prc_epsg).reset_index()
Expand Down Expand Up @@ -539,8 +539,8 @@ def generate_filtered_transects(
# )
# partitioner.process()

# logging.info("Done!")
# elapsed_time = time.time() - start_time
# logging.info(
# f"Time (H:M:S): {time.strftime('%H:%M:%S', time.gmtime(elapsed_time))}"
# )
logging.info("Done!")
elapsed_time = time.time() - start_time
logging.info(
f"Time (H:M:S): {time.strftime('%H:%M:%S', time.gmtime(elapsed_time))}"
)
2 changes: 1 addition & 1 deletion src/coastpy/geo/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def extract_coordinates(pt: Point | tuple[float, float]) -> tuple[float, float]:
elif (
isinstance(pt, tuple)
and len(pt) == 2
and all(isinstance(coord, (float, int)) for coord in pt)
and all(isinstance(coord, (float | int)) for coord in pt)
):
return float(pt[0]), float(pt[1])
else:
Expand Down
4 changes: 3 additions & 1 deletion src/coastpy/geo/quadtiles_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ def get_point_from_geometry(geom):
# Add quadkey column
if "quadkey" in geo_columns:
if quadkey_zoom_level is None:
raise ValueError(
message = (
"quadkey_zoom_level must be provided when 'quadkey' is in geo_columns."
)
raise ValueError(message)

if "lon" in df.columns and "lat" in df.columns:
points = gpd.GeoSeries(
[Point(xy) for xy in zip(df.lon, df.lat, strict=False)], crs="EPSG:4326"
Expand Down

0 comments on commit e3e06a5

Please sign in to comment.