Skip to content

Commit

Permalink
fix!: remove geopandas
Browse files Browse the repository at this point in the history
Removing geopandas since we tend to index by time not geometry.
  • Loading branch information
gadomski committed Dec 20, 2021
1 parent 59fc0f5 commit d113653
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 25 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Removed

- geopandas support

## [0.1.5] - 2021-12-09

### Added
Expand Down
3 changes: 0 additions & 3 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[mypy]
strict = True

[mypy-geopandas.*]
ignore_missing_imports = True
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ install_requires =
dask[distributed] ~= 2021.08
pandas ~= 1.3
pyarrow ~= 6.0
geopandas ~= 0.8.0


[options.packages.find]
Expand Down
17 changes: 0 additions & 17 deletions src/isd/pandas.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import datetime
from typing import Iterable, Optional

import geopandas
import pandas
from geopandas import GeoDataFrame
from pandas import CategoricalDtype, DataFrame

from isd import Record
Expand Down Expand Up @@ -165,18 +163,3 @@ def data_frame(
return data_frame[data_frame["timestamp"] > since]
else:
return data_frame


def geo_data_frame(records: Iterable[Record]) -> GeoDataFrame:
"""Creates a GeoDataFrame from an iterable of Records.
Just like `data_frame`, but add the geometry attribute from the lat/lon of
the records.
"""
pandas_data_frame = data_frame(records)
return GeoDataFrame(
pandas_data_frame,
geometry=geopandas.points_from_xy(
pandas_data_frame.longitude, pandas_data_frame.latitude, crs="EPSG:4326"
),
)
4 changes: 0 additions & 4 deletions tests/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@

def test_data_frame(records: List[Record]) -> None:
isd.pandas.data_frame(records)


def test_geo_data_frame(records: List[Record]) -> None:
isd.pandas.geo_data_frame(records)

0 comments on commit d113653

Please sign in to comment.