Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate PyMEOS #4

Closed
wants to merge 21 commits into from
Closed

Integrate PyMEOS #4

wants to merge 21 commits into from

Conversation

chaitan94
Copy link
Member

@chaitan94 chaitan94 commented Jul 5, 2020

Overview

For a quick idea / shorter diff check the first commit of this PR which serves as the PoC of this integration.

Major changes this diff introduces

  1. All core processing logic has now been delegated to an underlying library PyMEOS (which is private as of now). As a result, we are able to remove a lot of code, and the code is now more focused on dealing with psycopg and asyncpg.
  2. All "N-th" functions (like instantN, timestampN etc) are now 0-indexed instead of 1-indexed
  3. STBox - Coordinates not allowed as strings anymore
    • I do not support this at PyMEOS level, and I think it is fair to ask the user to provide floats
  4. PeriodSet, TimestampSet, Instant Sets, Sequences, and Sequence Sets
    • List and Tuples not allowed anymore - instead users are expected to pass python Sets.
  5. For Temporal Types, the .duration() function is now a property .duration and returns an enum instead

Work in Progress

  • Example py scripts need to be fixed

Testing

CI status can be checked for a quick idea.

Note: In CI you will see that stbox tests fail. This is because this PR assumes the patch MobilityDB/MobilityDB#17, but it is not applied in the docker image yet. However, you can see that all other tests pass successfully.

It can also be tested locally. To do so, follow these steps:

# Get the code for this PR
$ git clone https://github.com/chaitan94/python-mobilitydb.git -b meos
$ cd python-mobilitydb

# Optional - setup a temporary virtual env
$ python -m venv ENV
$ source ./ENV/bin/activate

# Install dependencies (along with PyMEOS)
$ pip install .[test]

# Before running pytest, make sure you have MobilityDB instance running, if not, do:
$ docker volume create mobilitydb_data
$ docker run --name "mobilitydb" --rm -d -p 25432:5432 -v mobilitydb_data:/var/lib/postgresql codewit/mobilitydb

# Run pytest
$ time PGPORT=25432 PGHOST=0.0.0.0 PGDATABASE=mobilitydb PGUSER=docker PGPASSWORD=docker pytest

@chaitan94 chaitan94 changed the title Make use of Period type from PyMEOS Integrate PyMEOS Jul 9, 2020
@Diviloper
Copy link
Member

Closing due to the deprecation of the package in favor of PyMEOS

@Diviloper Diviloper closed this Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants