Skip to content

Commit 6ffbae8

Browse files
committed
updated notebooks
1 parent 114ac30 commit 6ffbae8

13 files changed

+4950
-5139
lines changed

notebooks/01_Exploring_MoveDataFrame.ipynb

Lines changed: 589 additions & 589 deletions
Large diffs are not rendered by default.

notebooks/02_Exploring_Preprossessing.ipynb

Lines changed: 799 additions & 799 deletions
Large diffs are not rendered by default.

notebooks/03_Exploring_Visualization.ipynb

Lines changed: 243 additions & 255 deletions
Large diffs are not rendered by default.

notebooks/04_Exploring_Grid.ipynb

Lines changed: 164 additions & 155 deletions
Large diffs are not rendered by default.

notebooks/05_Exploring_Utils.ipynb

Lines changed: 852 additions & 886 deletions
Large diffs are not rendered by default.

notebooks/06_Exploring_Integrations.ipynb

Lines changed: 1706 additions & 1868 deletions
Large diffs are not rendered by default.

notebooks/07_Exploring_Query.ipynb

Lines changed: 339 additions & 327 deletions
Large diffs are not rendered by default.

notebooks/08_Exploring_Semantic.ipynb

Lines changed: 244 additions & 244 deletions
Large diffs are not rendered by default.

pymove/core/dataframe.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""MoveDataFrame class."""
22
from __future__ import annotations
33

4+
from typing import TYPE_CHECKING
5+
46
from dateutil.parser._parser import ParserError
57
from pandas.core.frame import DataFrame
68

@@ -13,12 +15,16 @@
1315
TYPE_PANDAS,
1416
)
1517

18+
if TYPE_CHECKING:
19+
from pymove.core.dask import DaskMoveDataFrame
20+
from pymove.core.pandas import PandasMoveDataFrame
21+
1622

1723
class MoveDataFrame:
1824
"""Auxiliary class to check and transform data into Pymove Dataframes."""
1925

2026
@staticmethod
21-
def __new__(
27+
def __new__( # type: ignore[misc]
2228
self,
2329
data: DataFrame | dict | list,
2430
latitude: str = LATITUDE,
@@ -27,7 +33,7 @@ def __new__(
2733
traj_id: str = TRAJ_ID,
2834
type_: str = TYPE_PANDAS,
2935
n_partitions: int = 1,
30-
):
36+
) -> 'PandasMoveDataFrame' | 'DaskMoveDataFrame':
3137
"""
3238
Creates the PyMove dataframe, which must contain latitude, longitude and datetime.
3339
@@ -68,6 +74,9 @@ def __new__(
6874
return DaskMoveDataFrame(
6975
data, latitude, longitude, datetime, traj_id, n_partitions
7076
)
77+
raise TypeError(
78+
f'Unknown MoveDataFrame type {type_}, use {TYPE_PANDAS} or {TYPE_DASK}'
79+
)
7180

7281
@staticmethod
7382
def has_columns(data: DataFrame) -> bool:

pymove/core/pandas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def lng(self) -> Series:
167167
return self[LONGITUDE]
168168

169169
@property
170-
def datetime(self):
170+
def datetime(self) -> Series:
171171
"""
172172
Checks for the DATETIME column and returns its value.
173173

0 commit comments

Comments
 (0)