PyMove is a Python library to simplify queries and visualization of trajectories and other spatial-temporal data

Overview

Use PyMove and go much further


Information

Package Status
License
Python Version
Platforms
Build Status
PyPi version
PyPi Downloads
Conda version
Conda Downloads
Code Quality
Code Coverage

What is PyMove

PyMove is a Python library for processing and visualization of trajectories and other spatial-temporal data.

We will also release wrappers to some useful Java libraries frequently used in the mobility domain.

Read the full documentation on ReadTheDocs


Main Features

PyMove proposes:

  • A familiar and similar syntax to Pandas;

  • Clear documentation;

  • Extensibility, since you can implement your main data structure by manipulating other data structures such as Dask DataFrame, numpy arrays, etc., in addition to adding new modules;

  • Flexibility, as the user can switch between different data structures;

  • Operations for data preprocessing, pattern mining and data visualization.


Creating a Virtual Environment

It is recommended to create a virtual environment to use pymove.

Requirements: Anaconda Python distribution installed and accessible

  1. In the terminal client enter the following where env_name is the name you want to call your environment, and replace x.x with the Python version you wish to use. (To see a list of available python versions first, type conda search "^python$" and press enter.)

    • conda create -n python=x.x

    • Press y to proceed. This will install the Python version and all the associated anaconda packaged libraries at path_to_your_anaconda_location/anaconda/envs/env_name

  2. Activate your virtual environment. To activate or switch into your virtual environment, simply type the following where yourenvname is the name you gave to your environment at creation.

    • conda activate
  3. Now install the package from either conda, pip or github


Conda instalation

  1. conda install -c conda-forge pymove

Pip installation

  1. pip install pymove

Github installation

  1. Clone this repository

    • git clone https://github.com/InsightLab/PyMove
  2. Switch to folder PyMove

    • cd PyMove
  3. Switch to a new branch

    • git checkout -b developer
  4. Make a pull of branch

    • git pull origin developer
  5. Install pymove in developer mode

    • make dev

For windows users

If you installed from pip or github, you may encounter an error related to shapely due to some dll dependencies. To fix this, run conda install shapely.


Examples

You can see examples of how to use PyMove here


Mapping PyMove methods with the Paradigms of Trajectory Data Mining

ZHENG 2015.

  • 1: Spatial Trajectoriespymove.core

    • MoveDataFrame
    • DiscreteMoveDataFrame
  • 2: Stay Point Detectionpymove.preprocessing.stay_point_detection

    • create_or_update_move_stop_by_dist_time
    • create_or_update_move_and_stop_by_radius
  • 3: Map-Matchingpymove-osmnx

  • 4: Noise Filteringpymove.preprocessing.filters

    • by_bbox
    • by_datetime
    • by_label
    • by_id
    • by_tid
    • clean_consecutive_duplicates
    • clean_gps_jumps_by_distance
    • clean_gps_nearby_points_by_distances
    • clean_gps_nearby_points_by_speed
    • clean_gps_speed_max_radius
    • clean_trajectories_with_few_points
    • clean_trajectories_short_and_few_points
    • clean_id_by_time_max
  • 5: Compressionpymove.preprocessing.compression

    • compress_segment_stop_to_point
  • 6: Segmentationpymove.preprocessing.segmentation

    • bbox_split
    • by_dist_time_speed
    • by_max_dist
    • by_max_time
    • by_max_speed
  • 7: Distance Measurespymove.distances

    • medp
    • medt
    • euclidean_distance_in_meters
    • haversine
  • 8: Query Historical Trajectoriespymove.query.query

    • range_query
    • knn_query
  • 9: Managing Recent Trajectories

  • 10: Privacy Preserving

  • 11: Reducing Uncertainty

  • 12: Moving Together Patterns

  • 13: Clusteringpymove.models.pattern_mining.clustering

    • elbow_method
    • gap_statistics
    • dbscan_clustering
  • 14: Freq. Seq. Patterns

  • 15: Periodic Patterns

  • 16: Trajectory Classification

  • 17: Trajectory Outlier / Anomaly Detectionpymove.semantic.semantic

    • outliers
    • create_or_update_out_of_the_bbox
    • create_or_update_gps_deactivated_signal
    • create_or_update_gps_jump
    • create_or_update_short_trajectory
    • create_or_update_gps_block_signal
    • filter_block_signal_by_repeated_amount_of_points
    • filter_block_signal_by_time
    • filter_longer_time_to_stop_segment_by_id

Cite

The library was originally created during the bachelor's thesis of 2 students from the Federal University of Ceará, so you can cite using both works.

@mastersthesis{arina2019,
	title        = {Uma arquitetura e implementação do módulo de pré-processamento para biblioteca PyMove},
	author       = {Arina De Jesus Amador Monteiro Sanches},
	year         = 2019,
	school       = {Universidade Federal Do Ceará},
	type         = {Bachelor's thesis}
}
@mastersthesis{andreza2019,
	title        = {Uma arquitetura e implementação do módulo de visualização para biblioteca PyMove},
	author       = {Andreza Fernandes De Oliveira},
	year         = 2019,
	school       = {Universidade Federal Do Ceará},
	type         = {Bachelor's thesis}
}

Publications


Useful list of related libraries and links

Comments
  • Visualizaçoes

    Visualizaçoes

    • [x] HeatMap (https://towardsdatascience.com/data-101s-spatial-visualizations-and-analysis-in-python-with-folium-39730da2adf)
    • [x] HeatMapWithTime (https://towardsdatascience.com/data-101s-spatial-visualizations-and-analysis-in-python-with-folium-39730da2adf)
    • [x] Plotagem de uma trajectory/lista de pontos sob o mapa (https://deparkes.co.uk/2016/06/03/plot-lines-in-folium/) -> botar as setinhas de direção
    • [x] Clustered marker

    OBS

    • [x] Delimitar escopo da plotagem se for muito dado- por exemplo por janela de tempo, por boundbox e tempo
    • [x] Opcao de gerar .html
    • [x] Opcao de mostrar no jupyter
    • [x] Opcao de printar o id e o datetime de cada ponto

    Fontes

    • https://blog.dominodatalab.com/creating-interactive-crime-maps-with-folium/
    • https://towardsdatascience.com/data-101s-spatial-visualizations-and-analysis-in-python-with-folium-39730da2adf
    • https://deparkes.co.uk/2016/06/03/plot-lines-in-folium/
    • https://blog.dominodatalab.com/creating-interactive-crime-maps-with-folium/
    opened by AndyFernandes 3
  • Padronização funções.

    Padronização funções.

    • [x] Tirar dúvidas das operações de memória e tempo com Nicksson.
    • [x] Verificar se as colunas com a outro nome dá certo ou ele trava.
    • [x] Padronização dos imports
    • [x] Terminar de documentar as funções
    • [x] Verificar se as funções estão de acordo com PEP 8
    • [x] Revisar documentação das funções => Verificar se estão completas e legíveis.
    • [x] Verificar se realmente todas as funções que chamavam create_update_... => generate_...
    • [x] Padronização dos init
    • [x] Limpeza do código
    • [x] Verificar TODOs
    • [x] Ajeitar notebooks em seções e organiza-los em pastas.
    enhancement 
    opened by AndyFernandes 3
  • How to Cite Cite PyMove in an academic paper?

    How to Cite Cite PyMove in an academic paper?

    I am along with other contributors, writing an evaluation of PyMove library in an academic paper and we want to cite the authors. Can you please help us with the citation?

    opened by YakshHaranwala 2
  • Verbose

    Verbose

    Types of changes

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [X] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] I have read the CONTRIBUTING document.
    • [ ] My code follows the code style of this project (see .code-style.md).
    • [X] All new and existing tests passed (see .testing.md).
    • [ ] I have added tests to cover my changes.
    • [ ] My change requires a change to the documentation.
    • [ ] I have updated the documentation accordingly (see .documentation.md).

    Description

    • What is the current behavior? (You can also link to an open issue here) see #177

    • What is the new behavior (if this is a feature change)? Added a utils.log.logger to control logging. INFO shows only useful information, like progress bars DEBUG shows information from various steps in the functions WARN hides all output except warnings and errors Default behaviour shows is INFO. Can be controlled with utils.log.set_verbose or by creating an environment variable PYMOVE_VERBOSE

    closes #177

    opened by mxaviersmp 2
  • Ajustes nas funções de core.dataframe

    Ajustes nas funções de core.dataframe

    Sugestões de alterações dos locais das funções, parâmetros e padronização de semelhantes

    • [x] generate_day_of_the_week, generate_time_of_day => padronizar os nomes das colunas para caixa baixa ou capitalizados

    • [x] generate_time_of_day => trecho do print está mal formatado

    • [x] generate_datetime_in_format_cyclical => não esta perto de outros geradores de features que usam datetime

    • [x] generate_weekend_features =>

      • [x] não esta perto de outros geradores de features que usam datetime
      • [x] create_day_of_week=True não funciona
      • [x] não retorna dataframe indicando fds se inplace=False
      • [x] executar mais de uma vez levanta erro
        AttributeError: 'DataFrame' object has no attribute 'delete'
        
    • [x] plot_all_features, plot_trajs, plot_traj_id => padronizar parâmetros e retorno

    • [x] plot_traj_id =>

      IndexError: single positional indexer is out-of-bounds
      
    • [x] any => não existe all

    • [x] isin => existem dois métodos isin

    • [x] to_csv => não possui parametro index

    • [x] last_operation =>

      • [x] às vezes não exibe a última exibindo {'name': 'dtypes', 'time': 0, 'mem': 0}
      • [x] exibir valores de tempo e memoria de forma mais legível
    • [x] impedir que os métodos que modifiquem as colunas removam as colunas necessárias ao MoveDataFrame => dropna, drop, set_index, astype

    • [x] write_file => não esta perto de to_csv

    • [x] len => não esta perto de shape

    • [x] nomes de colunas com ' e "

    low 
    opened by mxaviersmp 2
  • Bugs

    Bugs

    • [x] Ajeitar o negocio do resources que tá comentado (solução aqui https://stackoverflow.com/questions/938733/total-memory-used-by-python-process)
    • [x] Revisar docs das funções
    • [x] Botar pra sempre retornar um objeto do tipo MoveDataFrame -> O que tá acontecendo: tenho um move dataframe, quando ponho uma operação .loc, .iloc, at ele retorna um dataframe
    • [x] Melhorar exibição de legendas no folium
    • [x] Validar colunas ao gerar dataframe.
    >>> list_data = [
                 [39.984094, 116.319236, '2008-10-23 05:53:05', 1],
                 [39.984198, 116.319322, '2008-10-23 05:53:06', 1],
                 [39.984224, 116.319402, '2008-10-23 05:53:11', 1],
                 [39.984224, 116.319402, '2008-10-23 05:53:11', 1],
                 [39.984224, 116.319402, '2008-10-23 05:53:11', 1],
                 [39.984224, 116.319402, '2008-10-23 05:53:11', 1]
    ]
    >>> move_df = pymove.PandasMoveDataFrame(data=list_data, latitude="lat", longitude="lon", datetime="datetime", traj_id="id")
    >>> print(move_df.dtypes)
    lat         float64
    lon         float64
    datetime     object
    id            int64
    dtype: object
    
    • [x] Tratar caso de dataframe sem as colunas do tipo especificado em plot_all_features
    • [x] Exibir versão correta do pymove instalado através do pip
    >>> import pymove
    >>> pymove.__version__
    '0+unknown'
    
    • [x] Corrigir erro ao ler dataframe usando pm.read_csv com coluna de data com nome não padrão
    df = pd.read_csv(filename, sep=sep, encoding=encoding, parse_dates=["datetime"])
    
    • [x] Permitir a leitura de arquivos sem header utilizando pymove.read_csv(filename)
    • [x] Erro ao instalar no windows devido ao README.md “path_to_your_anaconda_location/anaconda/envs/yourenvname”
    • [x] Erro ao importar o pymove no windows devido aos módulos pwd e resource
    • [x] Rever funções em pymove.utils.datetime
      • slot_of_day_to_time
      • slot_of_day
      • slot
      • str_to_min_slot
    • [x] Ao plotar multiplas trajetória no foliim, é exibido apenas um marcador de início e fim
    • [x] Modificar os marcadores de início e fim de trajetória para ficarem mais legíveis
    Priority 
    opened by AndyFernandes 2
  • ImportError: cannot import name 'FilePathOrBuffer' from 'pandas._typing'

    ImportError: cannot import name 'FilePathOrBuffer' from 'pandas._typing'

    Describe the bug Importing pymove raises ImportError: cannot import name 'FilePathOrBuffer' from 'pandas._typing'

    To Reproduce Steps to reproduce the behavior:

    1. Conda install pymove
    2. Run import pymove
    (pymove) PS C:\Users\anita> python
    Python 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:34:17) [MSC v.1929 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pymove
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "H:\miniconda3\envs\pymove\lib\site-packages\pymove\__init__.py", line 13, in <module>
        from .core.pandas import PandasMoveDataFrame
      File "H:\miniconda3\envs\pymove\lib\site-packages\pymove\core\pandas.py", line 47, in <module>
        from pymove.utils.trajectories import shift
      File "H:\miniconda3\envs\pymove\lib\site-packages\pymove\utils\trajectories.py", line 23, in <module>
        from pandas._typing import FilePathOrBuffer
    ImportError: cannot import name 'FilePathOrBuffer' from 'pandas._typing' (H:\miniconda3\envs\pymove\lib\site-packages\pandas\_typing.py)
    

    Desktop (please complete the following information):

    • OS: Win10
    (pymove) PS C:\Users\anita> conda list
    # packages in environment at H:\miniconda3\envs\pymove:
    #
    # Name                    Version                   Build  Channel
    argon2-cffi               21.3.0             pyhd8ed1ab_0    conda-forge
    argon2-cffi-bindings      21.2.0          py310he2412df_2    conda-forge
    asttokens                 2.0.5              pyhd8ed1ab_0    conda-forge
    attrs                     21.4.0             pyhd8ed1ab_0    conda-forge
    backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
    backports                 1.0                        py_2    conda-forge
    backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
    beautifulsoup4            4.11.1             pyha770c72_0    conda-forge
    bleach                    5.0.0              pyhd8ed1ab_0    conda-forge
    bokeh                     2.4.2           py310h5588dad_1    conda-forge
    branca                    0.4.2              pyhd8ed1ab_0    conda-forge
    brotli                    1.0.9                h8ffe710_7    conda-forge
    brotli-bin                1.0.9                h8ffe710_7    conda-forge
    brotlipy                  0.7.0           py310he2412df_1004    conda-forge
    bzip2                     1.0.8                h8ffe710_4    conda-forge
    ca-certificates           2021.10.8            h5b45459_0    conda-forge
    certifi                   2021.10.8       py310h5588dad_2    conda-forge
    cffi                      1.15.0          py310hcbf9ad4_0    conda-forge
    charset-normalizer        2.0.12             pyhd8ed1ab_0    conda-forge
    click                     8.1.2           py310h5588dad_0    conda-forge
    cloudpickle               2.0.0              pyhd8ed1ab_0    conda-forge
    colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
    convertdate               2.4.0              pyhd8ed1ab_0    conda-forge
    cryptography              36.0.2          py310ha857299_1    conda-forge
    cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
    cytoolz                   0.11.2          py310he2412df_2    conda-forge
    dask                      2022.4.1           pyhd8ed1ab_0    conda-forge
    dask-core                 2022.4.1           pyhd8ed1ab_0    conda-forge
    debugpy                   1.6.0           py310h8a704f9_0    conda-forge
    decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
    defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
    distributed               2022.4.1           pyhd8ed1ab_0    conda-forge
    entrypoints               0.4                pyhd8ed1ab_0    conda-forge
    executing                 0.8.3              pyhd8ed1ab_0    conda-forge
    flit-core                 3.7.1              pyhd8ed1ab_0    conda-forge
    folium                    0.12.1.post1       pyhd8ed1ab_1    conda-forge
    fonttools                 4.32.0          py310he2412df_0    conda-forge
    freetype                  2.10.4               h546665d_1    conda-forge
    fsspec                    2022.3.0           pyhd8ed1ab_0    conda-forge
    geohash2                  1.1                        py_0    conda-forge
    geojson                   2.5.0                      py_0    conda-forge
    geos                      3.10.2               h39d44d4_0    conda-forge
    heapdict                  1.0.1                      py_0    conda-forge
    hijri-converter           2.2.3              pyhd8ed1ab_0    conda-forge
    holidays                  0.13               pyhd8ed1ab_0    conda-forge
    idna                      3.3                pyhd8ed1ab_0    conda-forge
    importlib-metadata        4.11.3          py310h5588dad_1    conda-forge
    importlib_resources       5.7.1              pyhd8ed1ab_0    conda-forge
    intel-openmp              2022.0.0          h57928b3_3663    conda-forge
    ipykernel                 6.13.0          py310hbbfc1a7_0    conda-forge
    ipython                   8.2.0           py310h5588dad_0    conda-forge
    ipython_genutils          0.2.0                      py_1    conda-forge
    ipywidgets                7.7.0              pyhd8ed1ab_0    conda-forge
    jbig                      2.1               h8d14728_2003    conda-forge
    jedi                      0.18.1          py310h5588dad_1    conda-forge
    jinja2                    3.1.1              pyhd8ed1ab_0    conda-forge
    joblib                    1.1.0              pyhd8ed1ab_0    conda-forge
    jpeg                      9e                   h8ffe710_0    conda-forge
    jsonschema                4.4.0              pyhd8ed1ab_0    conda-forge
    jupyter_client            7.2.2              pyhd8ed1ab_1    conda-forge
    jupyter_core              4.9.2           py310h5588dad_0    conda-forge
    jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
    jupyterlab_widgets        1.1.0              pyhd8ed1ab_0    conda-forge
    kiwisolver                1.4.2           py310h476a331_1    conda-forge
    korean_lunar_calendar     0.2.1              pyh9f0ad1d_0    conda-forge
    lcms2                     2.12                 h2a16943_0    conda-forge
    lerc                      3.0                  h0e60522_0    conda-forge
    libblas                   3.9.0              14_win64_mkl    conda-forge
    libbrotlicommon           1.0.9                h8ffe710_7    conda-forge
    libbrotlidec              1.0.9                h8ffe710_7    conda-forge
    libbrotlienc              1.0.9                h8ffe710_7    conda-forge
    libcblas                  3.9.0              14_win64_mkl    conda-forge
    libdeflate                1.10                 h8ffe710_0    conda-forge
    libffi                    3.4.2                h8ffe710_5    conda-forge
    liblapack                 3.9.0              14_win64_mkl    conda-forge
    libpng                    1.6.37               h1d00b33_2    conda-forge
    libsodium                 1.0.18               h8d14728_1    conda-forge
    libtiff                   4.3.0                hc4061b1_3    conda-forge
    libwebp                   1.2.2                h57928b3_0    conda-forge
    libwebp-base              1.2.2                h8ffe710_1    conda-forge
    libxcb                    1.13              hcd874cb_1004    conda-forge
    libzlib                   1.2.11            h8ffe710_1014    conda-forge
    locket                    0.2.0                      py_2    conda-forge
    lz4                       4.0.0           py310h7b86b54_1    conda-forge
    lz4-c                     1.9.3                h8ffe710_1    conda-forge
    m2w64-gcc-libgfortran     5.3.0                         6    conda-forge
    m2w64-gcc-libs            5.3.0                         7    conda-forge
    m2w64-gcc-libs-core       5.3.0                         7    conda-forge
    m2w64-gmp                 6.1.0                         2    conda-forge
    m2w64-libwinpthread-git   5.0.0.4634.697f757               2    conda-forge
    markupsafe                2.1.1           py310he2412df_1    conda-forge
    matplotlib-base           3.5.1           py310h79a7439_0    conda-forge
    matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
    mistune                   0.8.4           py310he2412df_1005    conda-forge
    mkl                       2022.0.0           h0e2418a_796    conda-forge
    mplleaflet                0.0.5                      py_4    conda-forge
    msgpack-python            1.0.3           py310h476a331_1    conda-forge
    msys2-conda-epoch         20160418                      1    conda-forge
    munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
    nbclient                  0.6.0              pyhd8ed1ab_0    conda-forge
    nbconvert                 6.5.0              pyhd8ed1ab_0    conda-forge
    nbconvert-core            6.5.0              pyhd8ed1ab_0    conda-forge
    nbconvert-pandoc          6.5.0              pyhd8ed1ab_0    conda-forge
    nbformat                  5.3.0              pyhd8ed1ab_0    conda-forge
    nest-asyncio              1.5.5              pyhd8ed1ab_0    conda-forge
    notebook                  6.4.10             pyha770c72_0    conda-forge
    numpy                     1.22.3          py310hcae7c84_2    conda-forge
    openjpeg                  2.4.0                hb211442_1    conda-forge
    openssl                   1.1.1n               h8ffe710_0    conda-forge
    packaging                 21.3               pyhd8ed1ab_0    conda-forge
    pandas                    1.4.2           py310hf5e1058_1    conda-forge
    pandoc                    2.18                 h57928b3_0    conda-forge
    pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
    parso                     0.8.3              pyhd8ed1ab_0    conda-forge
    partd                     1.2.0              pyhd8ed1ab_0    conda-forge
    pickleshare               0.7.5                   py_1003    conda-forge
    pillow                    9.1.0           py310h767b3fd_2    conda-forge
    pip                       22.0.4             pyhd8ed1ab_0    conda-forge
    prometheus_client         0.14.1             pyhd8ed1ab_0    conda-forge
    prompt-toolkit            3.0.29             pyha770c72_0    conda-forge
    psutil                    5.9.0           py310he2412df_1    conda-forge
    pthread-stubs             0.4               hcd874cb_1001    conda-forge
    pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
    pycparser                 2.21               pyhd8ed1ab_0    conda-forge
    pygments                  2.11.2             pyhd8ed1ab_0    conda-forge
    pymeeus                   0.5.10             pyhd8ed1ab_0    conda-forge
    pymove                    3.0.0              pyhd8ed1ab_0    conda-forge
    pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
    pyparsing                 3.0.8              pyhd8ed1ab_0    conda-forge
    pyrsistent                0.18.1          py310he2412df_1    conda-forge
    pysocks                   1.7.1           py310h5588dad_5    conda-forge
    python                    3.10.4          h9a09f29_0_cpython    conda-forge
    python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
    python-fastjsonschema     2.15.3             pyhd8ed1ab_0    conda-forge
    python_abi                3.10                    2_cp310    conda-forge
    pytz                      2022.1             pyhd8ed1ab_0    conda-forge
    pywin32                   303             py310he2412df_0    conda-forge
    pywinpty                  2.0.5           py310h00ffb61_1    conda-forge
    pyyaml                    6.0             py310he2412df_4    conda-forge
    pyzmq                     22.3.0          py310h73ada01_2    conda-forge
    requests                  2.27.1             pyhd8ed1ab_0    conda-forge
    scikit-learn              1.0.2           py310h4dafddf_0    conda-forge
    scipy                     1.8.0           py310h33db832_1    conda-forge
    send2trash                1.8.0              pyhd8ed1ab_0    conda-forge
    setuptools                62.1.0          py310h5588dad_0    conda-forge
    shapely                   1.8.0           py310h3578588_6    conda-forge
    six                       1.16.0             pyh6c4a22f_0    conda-forge
    sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
    soupsieve                 2.3.1              pyhd8ed1ab_0    conda-forge
    sqlite                    3.38.2               h8ffe710_0    conda-forge
    stack_data                0.2.0              pyhd8ed1ab_0    conda-forge
    tbb                       2021.5.0             h2d74725_1    conda-forge
    tblib                     1.7.0              pyhd8ed1ab_0    conda-forge
    terminado                 0.13.3          py310h5588dad_1    conda-forge
    threadpoolctl             3.1.0              pyh8a188c0_0    conda-forge
    tinycss2                  1.1.1              pyhd8ed1ab_0    conda-forge
    tk                        8.6.12               h8ffe710_0    conda-forge
    toolz                     0.11.2             pyhd8ed1ab_0    conda-forge
    tornado                   6.1             py310he2412df_3    conda-forge
    tqdm                      4.64.0             pyhd8ed1ab_0    conda-forge
    traitlets                 5.1.1              pyhd8ed1ab_0    conda-forge
    typing_extensions         4.2.0              pyha770c72_0    conda-forge
    tzdata                    2022a                h191b570_0    conda-forge
    ucrt                      10.0.20348.0         h57928b3_0    conda-forge
    unicodedata2              14.0.0          py310he2412df_1    conda-forge
    urllib3                   1.26.9             pyhd8ed1ab_0    conda-forge
    vc                        14.2                 hb210afc_6    conda-forge
    vs2015_runtime            14.29.30037          h902a5da_6    conda-forge
    wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
    webencodings              0.5.1                      py_1    conda-forge
    wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
    widgetsnbextension        3.6.0           py310h5588dad_0    conda-forge
    win_inet_pton             1.1.0           py310h5588dad_4    conda-forge
    winpty                    0.4.3                         4    conda-forge
    xorg-libxau               1.0.9                hcd874cb_0    conda-forge
    xorg-libxdmcp             1.1.3                hcd874cb_0    conda-forge
    xz                        5.2.5                h62dcd97_1    conda-forge
    yaml                      0.2.5                h8ffe710_2    conda-forge
    zeromq                    4.3.4                h0e60522_1    conda-forge
    zict                      2.1.0              pyhd8ed1ab_0    conda-forge
    zipp                      3.8.0              pyhd8ed1ab_0    conda-forge
    zlib                      1.2.11            h8ffe710_1014    conda-forge
    zstd                      1.5.2                h6255e5f_0    conda-forge
    
    opened by anitagraser 1
  • How to carry around a feature column?

    How to carry around a feature column?

    Is your feature request related to a problem? Please describe. When building the MoveDataFrame, there is no clear way on how to carry around an extra feature column that might be useful. For instance, I am working with bus gps data, but I need to carry the trip_id associated to that bus. However, trip_id is not the traj_id. So, I couldn't figure out how to add this extra info to my MoveDataFrame

    Describe the solution you'd like Maybe something like:

        @staticmethod
        def __new__(
            self,
            data: Union[DataFrame, Dict, List],
            latitude: Optional[Text] = LATITUDE,
            longitude: Optional[Text] = LONGITUDE,
            datetime: Optional[Text] = DATETIME,
            traj_id: Optional[Text] = TRAJ_ID,
            feature_cols: Optional[List[str]] = [],
            type_: Optional[Text] = TYPE_PANDAS,
            n_partitions: Optional[int] = 1,
        ):
            """
            Creates the PyMove dataframe, which must contain latitude, longitude and datetime.
    
            The dataframe can be a pandas or dask dataframe.
    
            Parameters
            ----------
            data : DataFrame or PandasMoveDataFrame or dict or list
                Input trajectory data.
            latitude : str, optional
                Represents column name latitude, by default LATITUDE
            longitude : str, optional
                Represents column name longitude, by default LONGITUDE
            datetime : str, optional
                Represents column name datetime, by default DATETIME
            traj_id : str, optional
                Represents column name trajectory id, by default TRAJ_ID
            feature_cols: list, optional
                Extra columns that will be carried by the dataframe, by default []
            type_ : str, optional
                Number of partitions of the dask dataframe, by default TYPE_PANDAS
            n_partitions : Optional[int], optional
                Amount of partitions for dask dataframe, by default 1
    
            Raises
            ------
            KeyError
                If missing one of lat, lon, datetime columns
            ValueError, ParserError
                If the data types can't be converted.
            """
    
    opened by JoaoCarabetta 1
  • Turn off prints

    Turn off prints

    Is your feature request related to a problem? Please describe. There is too much printing. I rather have an API that does not print as much. For instance, if I want to use it on another project, I want it to run silently.

    I'd recommend setting the verbosity to False by default.

    Describe the solution you'd like To have a way to control the verbosity of the logging. Maybe a global parameter that I toggle, ex: pymove.params.verbose=True/False, which controls the printing.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    opened by JoaoCarabetta 1
  • Query Functions and new Distances functions

    Query Functions and new Distances functions

    Types of changes

    • [ ] Bug fix (non-breaking change which fixes an issue)
    • [x] New feature (non-breaking change which adds functionality)
    • [x] Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] I have read the CONTRIBUTING document.
    • [x] My code follows the code style of this project (see .code-style.md).
    • [x] All new and existing tests passed (see .testing.md).
    • [x] I have added tests to cover my changes.
    • [x] My change requires a change to the documentation.
    • [x] I have updated the documentation accordingly (see .documentation.md).

    Description

    • What is the new behavior (if this is a feature change)? Query Functions (Range and KNN) and new Distances functions (Mean Euclidean Distance Predictive and Mean Euclidean Distance Trajectory)
    opened by MCavalcante16 1
  • Script pra atualizar versão PyMove no pip

    Script pra atualizar versão PyMove no pip

    • https://dzone.com/articles/executable-package-pip-install

    • Esse parece ser mais completinho: https://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56

    • MAIS DO MAIS completo: https://realpython.com/pypi-publish-python-package/

    • https://github.com/bast/pypi-howto

    • https://stackoverflow.com/questions/32204769/pypi-is-it-possible-to-set-up-git-to-auto-update-my-package-on-pypi

    • https://sherif.io/2016/09/30/Python-package-with-GitHub-PyPI.html

    • https://pypi.org/project/auto-pypi/

    • PRA UPLOAD: https://stackoverflow.com/questions/52700692/a-guide-for-updating-packages-on-pypi

    • https://www.freecodecamp.org/news/how-to-use-github-as-a-pypi-server-1c3b0d07db2/

    Medium 
    opened by AndyFernandes 1
  • create_or_update_move_stop_by_dist_time - does not create stay point using distance

    create_or_update_move_stop_by_dist_time - does not create stay point using distance

    Describe the bug The function create_or_update_move_stop_by_dist_time claims to create a stay point based on both time and distance metrics. Because the documentation is sparse, I went looking in the source code for an explanation of how it works. I can clearly see where the data is aggregated and queried by the time to the previous point, but I see no where that the data is queried by the distance. The input dist_radius appears nowhere in the actual function.

    To Reproduce Go to: https://github.com/InsightLab/PyMove/blob/ee5b68282502bfcb9cf38b52dcdefed5bd927a90/pymove/preprocessing/stay_point_detection.py

    ctrl+F: dist_radius

    Appears only in the doc string of the function. No other distance parameter is apparent.

    opened by ddileonardo 0
  • Units - no units on stay points inputs; is it possible to use arbitrary x,y units

    Units - no units on stay points inputs; is it possible to use arbitrary x,y units

    Discussed in https://github.com/InsightLab/PyMove/discussions/213

    Originally posted by ddileonardo March 11, 2022 Hello,

    I am investigating pymove for use in a project I am working on. Specifically I need to find stay points. I have questions about the units that I can use with pymove.

    MoveDataFrame: The function inputs specify latitude and longitude. But could I use an arbitrary coordinate system. For example could I use UTM northing and easting instead? Or really any arbitrary x and y coordinate system?

    stay_point_detection.create_or_update_move_stop_by_dist_time: the function does not specify the units of time and distance that should be used. What is the unit of time that you are using? Should the units for distance match whatever the coordinate system unit is? Is the unit of distance degrees to match a lat/lon coordinate system or something else? The example from the documentation just says 40, but 40 degrees doesn't seem to make sense as a distance value.

    I couldn't find any documentation about the appropriate units.

    Thanks.

    opened by ddileonardo 0
  • Folium throwing a bunch of errors

    Folium throwing a bunch of errors

    Hi,

    I'm just trying out PyMove because it seems like it could bring a lot to my current project. But I can't get any folium functionality to work, though.

    Here's an extract of what I'm doing:

    df.head()
    

    absolute_time | lat | lng | id -- | -- | -- | -- 2021-09-09 10:32:27.000 | 45.818459 | 3.139887 | 54 2021-09-09 10:32:28.000 | 45.818459 | 3.139887 | 54 2021-09-09 10:32:29.044 | 45.818459 | 3.139887 | 54 2021-09-09 10:32:30.000 | 45.818459 | 3.139887 | 54 2021-09-09 10:32:31.000 | 45.818459 | 3.139887 | 54

    move_df = MoveDataFrame(data=df, latitude='lat', longitude='lng', datetime='absolute_time')
    
    from pymove import folium as f
    f.plot_trajectories(move_df)
    
    ---------------------------------------------------------------------------
    TypeError                                 Traceback (most recent call last)
    <ipython-input-159-487305dba7d4> in <module>()
          1 from pymove import folium as f
    ----> 2 f.plot_trajectories(move_df)
    
    2 frames
    /usr/local/lib/python3.7/dist-packages/pymove/visualization/folium.py in plot_trajectories(move_data, n_rows, lat_origin, lon_origin, zoom_start, legend, base_map, tile, save_as_html, color, color_by_id, filename)
        993 
        994     _add_trajectories_to_map(
    --> 995         mv_df, items, base_map, legend, save_as_html, filename
        996     )
        997 
    
    /usr/local/lib/python3.7/dist-packages/pymove/visualization/folium.py in _add_trajectories_to_map(move_data, items, base_map, legend, save_as_html, filename)
        896         mv = move_data[move_data[TRAJ_ID] == _id]
        897 
    --> 898         _add_begin_end_markers_to_map(mv, base_map, color, _id)
        899 
        900         folium.PolyLine(
    
    /usr/local/lib/python3.7/dist-packages/pymove/visualization/folium.py in _add_begin_end_markers_to_map(move_data, base_map, color, _id)
        837         popup='Início',
        838         icon=plugins.BeautifyIcon(
    --> 839             icon='play', icon_shape='marker', background_color=color or 'green'
        840         )
        841     ).add_to(points)
    
    TypeError: __init__() got an unexpected keyword argument 'color'
    

    Or if I just try to plot the bounding box, I get a different error.

    f.plot_bbox(move_df.get_bbox(), color='blue')
    
    ---------------------------------------------------------------------------
    TypeError                                 Traceback (most recent call last)
    <ipython-input-161-03377951b622> in <module>()
    ----> 1 f.plot_bbox(move_df.get_bbox(), color='blue')
    
    6 frames
    /usr/local/lib/python3.7/dist-packages/pymove/visualization/folium.py in plot_bbox(bbox_tuple, base_map, tiles, color, save_as_html, filename)
       1688         base_map = folium.Map(tiles=tiles)
       1689     base_map.fit_bounds(
    -> 1690         [[bbox_tuple[0], bbox_tuple[1]], [bbox_tuple[2], bbox_tuple[3]]]
       1691     )
       1692     points_ = [
    
    /usr/local/lib/python3.7/dist-packages/folium/folium.py in fit_bounds(self, bounds, padding_top_left, padding_bottom_right, padding, max_zoom)
        411             'Choropleth class, which has the same arguments. See the example '
        412             'notebook \'GeoJSON_and_choropleth\' for how to do this.',
    --> 413             FutureWarning
        414         )
        415         from folium.features import Choropleth
    
    /usr/local/lib/python3.7/dist-packages/folium/map.py in __init__(self, bounds, padding_top_left, padding_bottom_right, padding, max_zoom)
        456         Bounding box specified as two points [southwest, northeast]
        457     padding_top_left: (x, y) point, default None
    --> 458         Padding in the top left corner. Useful if some elements in
        459         the corner, such as controls, might obscure objects you're zooming
        460         to.
    
    /usr/lib/python3.7/json/__init__.py in dumps(obj, skipkeys, ensure_ascii, check_circular, allow_nan, cls, indent, separators, default, sort_keys, **kw)
        229         cls is None and indent is None and separators is None and
        230         default is None and not sort_keys and not kw):
    --> 231         return _default_encoder.encode(obj)
        232     if cls is None:
        233         cls = JSONEncoder
    
    /usr/lib/python3.7/json/encoder.py in encode(self, o)
        197         # exceptions aren't as detailed.  The list call should be roughly
        198         # equivalent to the PySequence_Fast that ''.join() would do.
    --> 199         chunks = self.iterencode(o, _one_shot=True)
        200         if not isinstance(chunks, (list, tuple)):
        201             chunks = list(chunks)
    
    /usr/lib/python3.7/json/encoder.py in iterencode(self, o, _one_shot)
        255                 self.key_separator, self.item_separator, self.sort_keys,
        256                 self.skipkeys, _one_shot)
    --> 257         return _iterencode(o, 0)
        258 
        259 def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
    
    /usr/lib/python3.7/json/encoder.py in default(self, o)
        177 
        178         """
    --> 179         raise TypeError(f'Object of type {o.__class__.__name__} '
        180                         f'is not JSON serializable')
        181 
    
    TypeError: Object of type float16 is not JSON serializable
    

    I'm using python version 3.7, PyMove version 3.0.0, and folium version 0.8.3

    opened by LaurentBerder 1
  • [docs] filters.clean_gps_nearby_points_by_distances radius lacking unit of measure

    [docs] filters.clean_gps_nearby_points_by_distances radius lacking unit of measure

    Describe the bug There is no unit on the radius of filters.clean_gps_nearby_points_by_distances

    I suppose that it is meters, but it should be explicit.

    Current docstring

    Removes points from the trajectories when the distance between them and the
    point before is smaller than the value set by the user.
    
    Parameters
    ----------
    move_data : dataframe
        The input trajectory data
    label_id : str, optional
         Indicates the label of the id column in the user dataframe, by default TRAJ_ID
    radius_area : float, optional
        Species the minimum distance a point must have to it"srs previous point
        in order not to be dropped, by default 10
    label_dtype : type, optional
        Represents column id type, ,y default np.float64.
    inplace : boolean, optional
        if set to true the operation is done in place, the original
        dataframe will be altered and None is returned, be default False
    

    Proposed Docstring

    Removes points from the trajectories when the distance in meters between them and the
    point before is smaller than the value set by the user.
    
    Parameters
    ----------
    move_data : dataframe
        The input trajectory data
    label_id : str, optional
         Indicates the label of the id column in the user dataframe, by default TRAJ_ID
    radius_area : float, optional
        Species the minimum distance in meters a point must have to it's previous point
        in order not to be dropped, by default 10
    label_dtype : type, optional
        Represents column id type, ,y default np.float64.
    inplace : boolean, optional
        if set to true the operation is done in place, the original
        dataframe will be altered and None is returned, be default False
    
    opened by JoaoCarabetta 1
Releases(3.0.1)
Owner
Insight Data Science Lab
Research group at Federal University of Ceará (UFC)
Insight Data Science Lab
A super lightweight Lagrangian model for calculating millions of trajectories using ERA5 data

Easy-ERA5-Trck Easy-ERA5-Trck Galleries Install Usage Repository Structure Module Files Version iteration Easy-ERA5-Trck is a super lightweight Lagran

Zhenning Li 26 Nov 19, 2022
data/code repository of "C2F-FWN: Coarse-to-Fine Flow Warping Network for Spatial-Temporal Consistent Motion Transfer"

C2F-FWN data/code repository of "C2F-FWN: Coarse-to-Fine Flow Warping Network for Spatial-Temporal Consistent Motion Transfer" (https://arxiv.org/abs/

EKILI 46 Dec 14, 2022
We utilize deep reinforcement learning to obtain favorable trajectories for visual-inertial system calibration.

Unified Data Collection for Visual-Inertial Calibration via Deep Reinforcement Learning Update: The lastest code will be updated in this branch. Pleas

ETHZ ASL 27 Dec 29, 2022
Official code for our CVPR '22 paper "Dataset Distillation by Matching Training Trajectories"

Dataset Distillation by Matching Training Trajectories Project Page | Paper This repo contains code for training expert trajectories and distilling sy

George Cazenavette 256 Jan 5, 2023
Unofficial implementation of "TTNet: Real-time temporal and spatial video analysis of table tennis" (CVPR 2020)

TTNet-Pytorch The implementation for the paper "TTNet: Real-time temporal and spatial video analysis of table tennis" An introduction of the project c

Nguyen Mau Dung 438 Dec 29, 2022
The project is an official implementation of our paper "3D Human Pose Estimation with Spatial and Temporal Transformers".

3D Human Pose Estimation with Spatial and Temporal Transformers This repo is the official implementation for 3D Human Pose Estimation with Spatial and

Ce Zheng 363 Dec 28, 2022
Implementation of the paper NAST: Non-Autoregressive Spatial-Temporal Transformer for Time Series Forecasting.

Non-AR Spatial-Temporal Transformer Introduction Implementation of the paper NAST: Non-Autoregressive Spatial-Temporal Transformer for Time Series For

Chen Kai 66 Nov 28, 2022
This is the official Pytorch implementation of the paper "Diverse Motion Stylization for Multiple Style Domains via Spatial-Temporal Graph-Based Generative Model"

Diverse Motion Stylization (Official) This is the official Pytorch implementation of this paper. Diverse Motion Stylization for Multiple Style Domains

Soomin Park 28 Dec 16, 2022
Graph Self-Attention Network for Learning Spatial-Temporal Interaction Representation in Autonomous Driving

GSAN Introduction Code for paper GSAN: Graph Self-Attention Network for Learning Spatial-Temporal Interaction Representation in Autonomous Driving, wh

YE Luyao 6 Oct 27, 2022
Spatial Temporal Graph Convolutional Networks (ST-GCN) for Skeleton-Based Action Recognition in PyTorch

Reminder ST-GCN has transferred to MMSkeleton, and keep on developing as an flexible open source toolbox for skeleton-based human understanding. You a

sijie yan 1.1k Dec 25, 2022
Code for paper Decoupled Dynamic Spatial-Temporal Graph Neural Network for Traffic Forecasting

Decoupled Spatial-Temporal Graph Neural Networks Code for our paper: Decoupled Dynamic Spatial-Temporal Graph Neural Network for Traffic Forecasting.

S22 43 Jan 4, 2023
Group Activity Recognition with Clustered Spatial Temporal Transformer

GroupFormer Group Activity Recognition with Clustered Spatial-TemporalTransformer Backbone Style Action Acc Activity Acc Config Download Inv3+flow+pos

null 28 Dec 12, 2022
CVPR2021: Temporal Context Aggregation Network for Temporal Action Proposal Refinement

Temporal Context Aggregation Network - Pytorch This repo holds the pytorch-version codes of paper: "Temporal Context Aggregation Network for Temporal

Zhiwu Qing 63 Sep 27, 2022
Implementation of temporal pooling methods studied in [ICIP'20] A Comparative Evaluation Of Temporal Pooling Methods For Blind Video Quality Assessment

Implementation of temporal pooling methods studied in [ICIP'20] A Comparative Evaluation Of Temporal Pooling Methods For Blind Video Quality Assessment

Zhengzhong Tu 5 Sep 16, 2022
Code for our CVPR 2022 Paper "GEN-VLKT: Simplify Association and Enhance Interaction Understanding for HOI Detection"

GEN-VLKT Code for our CVPR 2022 paper "GEN-VLKT: Simplify Association and Enhance Interaction Understanding for HOI Detection". Contributed by Yue Lia

Yue Liao 47 Dec 4, 2022
Spatial Sparse Convolution Library

SpConv: Spatially Sparse Convolution Library PyPI Install Downloads CPU (Linux Only) pip install spconv CUDA 10.2 pip install spconv-cu102 CUDA 11.1 p

Yan Yan 1.2k Jan 7, 2023
Data Preparation, Processing, and Visualization for MoVi Data

MoVi-Toolbox Data Preparation, Processing, and Visualization for MoVi Data, https://www.biomotionlab.ca/movi/ MoVi is a large multipurpose dataset of

Saeed Ghorbani 51 Nov 27, 2022
Team nan solution repository for FPT data-centric competition. Data augmentation, Albumentation, Mosaic, Visualization, KNN application

FPT_data_centric_competition - Team nan solution repository for FPT data-centric competition. Data augmentation, Albumentation, Mosaic, Visualization, KNN application

Pham Viet Hoang (Harry) 2 Oct 30, 2022
Fast image augmentation library and easy to use wrapper around other libraries. Documentation: https://albumentations.ai/docs/ Paper about library: https://www.mdpi.com/2078-2489/11/2/125

Albumentations Albumentations is a Python library for image augmentation. Image augmentation is used in deep learning and computer vision tasks to inc

null 11.4k Jan 9, 2023