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
Code for the paper "Attention Approximates Sparse Distributed Memory"

Attention Approximates Sparse Distributed Memory - Codebase This is all of the code used to run analyses in the paper "Attention Approximates Sparse D

Trenton Bricken 14 Dec 05, 2022
A fast Protein Chain / Ligand Extractor and organizer.

Are you tired of using visualization software, or full blown suites just to separate protein chains / ligands ? Are you tired of organizing the mess o

Amine Abdz 9 Nov 06, 2022
ECAENet (TensorFlow and Keras)

ECAENet: EfficientNet with Efficient Channel Attention for Plant Species Recognition (SCI:Q3) (Journal of Intelligent & Fuzzy Systems)

4 Dec 22, 2022
Solution of Kaggle competition: Sartorius - Cell Instance Segmentation

Sartorius - Cell Instance Segmentation https://www.kaggle.com/c/sartorius-cell-instance-segmentation Environment setup Build docker image bash .dev_sc

68 Dec 09, 2022
A Comparative Review of Recent Kinect-Based Action Recognition Algorithms (TIP2020, Matlab codes)

A Comparative Review of Recent Kinect-Based Action Recognition Algorithms This repo contains: the HDG implementation (Matlab codes) for 'Analysis and

Lei Wang 5 Oct 22, 2022
Unofficial TensorFlow implementation of Protein Interface Prediction using Graph Convolutional Networks.

[TensorFlow] Protein Interface Prediction using Graph Convolutional Networks Unofficial TensorFlow implementation of Protein Interface Prediction usin

YeongHyeon Park 9 Oct 25, 2022
Complementary Patch for Weakly Supervised Semantic Segmentation, ICCV21 (poster)

CPN (ICCV2021) This is an implementation of Complementary Patch for Weakly Supervised Semantic Segmentation, which is accepted by ICCV2021 poster. Thi

Ferenas 20 Dec 12, 2022
Extremely simple and fast extreme multi-class and multi-label classifiers.

napkinXC napkinXC is an extremely simple and fast library for extreme multi-class and multi-label classification, that focus of implementing various m

Marek Wydmuch 43 Nov 14, 2022
Flexible Networks for Learning Physical Dynamics of Deformable Objects (2021)

Flexible Networks for Learning Physical Dynamics of Deformable Objects (2021) By Jinhyung Park, Dohae Lee, In-Kwon Lee from Yonsei University (Seoul,

Jinhyung Park 0 Jan 09, 2022
tmm_fast is a lightweight package to speed up optical planar multilayer thin-film device computation.

tmm_fast tmm_fast or transfer-matrix-method_fast is a lightweight package to speed up optical planar multilayer thin-film device computation. It is es

26 Dec 11, 2022
Your interactive network visualizing dashboard

Your interactive network visualizing dashboard Documentation: Here What is Jaal Jaal is a python based interactive network visualizing tool built usin

Mohit 177 Jan 04, 2023
NNR conformation conditional and global probabilities estimation and analysis in peptides or proteins fragments

NNR and global probabilities estimation and analysis in peptides or protein fragments This module calculates global and NNR conformation dependent pro

0 Jul 15, 2021
An Efficient Implementation of Analytic Mesh Algorithm for 3D Iso-surface Extraction from Neural Networks

AnalyticMesh Analytic Marching is an exact meshing solution from neural networks. Compared to standard methods, it completely avoids geometric and top

Karbo 45 Dec 21, 2022
TLDR: Twin Learning for Dimensionality Reduction

TLDR (Twin Learning for Dimensionality Reduction) is an unsupervised dimensionality reduction method that combines neighborhood embedding learning with the simplicity and effectiveness of recent self

NAVER 105 Dec 28, 2022
This is an early in-development version of training CLIP models with hivemind.

A transformer that does not hog your GPU memory This is an early in-development codebase: if you want a stable and documented hivemind codebase, look

<a href=[email protected]"> 4 Nov 06, 2022
Group Fisher Pruning for Practical Network Compression(ICML2021)

Group Fisher Pruning for Practical Network Compression (ICML2021) By Liyang Liu*, Shilong Zhang*, Zhanghui Kuang, Jing-Hao Xue, Aojun Zhou, Xinjiang W

Shilong Zhang 129 Dec 13, 2022
Flybirds - BDD-driven natural language automated testing framework, present by Trip Flight

Flybird | English Version 行为驱动开发(Behavior-driven development,缩写BDD),是一种软件过程的思想或者

Ctrip, Inc. 706 Dec 30, 2022
Pretrained models for Jax/Haiku; MobileNet, ResNet, VGG, Xception.

Pre-trained image classification models for Jax/Haiku Jax/Haiku Applications are deep learning models that are made available alongside pre-trained we

Alper Baris CELIK 14 Dec 20, 2022
This repository contains answers of the Shopify Summer 2022 Data Science Intern Challenge.

Data-Science-Intern-Challenge This repository contains answers of the Shopify Summer 2022 Data Science Intern Challenge. Summer 2022 Data Science Inte

1 Jan 11, 2022
Explicable Reward Design for Reinforcement Learning Agents [NeurIPS'21]

Explicable Reward Design for Reinforcement Learning Agents [NeurIPS'21]

3 May 12, 2022