Skip to content

Commit

Permalink
Remove shapely from dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoOpenCosmos committed Feb 14, 2025
1 parent be4c9c3 commit 9669f05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
Expand All @@ -33,8 +31,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
Expand All @@ -51,8 +47,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
Expand All @@ -69,8 +63,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
Expand All @@ -88,8 +80,6 @@ jobs:
needs: [bandit, cognitive, lint, pydocstyle]
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
Expand All @@ -108,8 +98,6 @@ jobs:
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: Install GEOS
run: sudo apt update && sudo apt install libgeos-dev
- name: Install uv
run: pip install uv
- name: Set up uv environment
Expand Down
12 changes: 8 additions & 4 deletions datacosmos/stac/item/models/item_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from pydantic import BaseModel, Field, model_validator
from pystac import Asset, Link
from shapely.geometry import mapping


class ItemUpdate(BaseModel):
Expand All @@ -21,9 +20,14 @@ class ItemUpdate(BaseModel):
assets: Optional[dict[str, Asset]] = None
links: Optional[list[Link]] = None

def set_geometry(self, geom) -> None:
"""Convert a shapely geometry to GeoJSON format."""
self.geometry = mapping(geom)
def set_geometry(self, geom_type: str, coordinates: list[Any]) -> None:
"""Set the geometry manually without using shapely.
Args:
geom_type (str): The type of geometry (e.g., 'Point', 'Polygon').
coordinates (list[Any]): The coordinates defining the geometry.
"""
self.geometry = {"type": geom_type, "coordinates": coordinates}

@staticmethod
def has_valid_datetime(properties: dict[str, Any]) -> bool:
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ dependencies = [
"oauthlib==3.2.0",
"requests-oauthlib==1.3.1",
"pydantic==2.10.6",
"pystac==1.12.1",
"shapely==1.8.0"
"pystac==1.12.1"
]

[project.optional-dependencies]
Expand Down

0 comments on commit 9669f05

Please sign in to comment.