Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions .github/workflows/test-master.yml

This file was deleted.

18 changes: 12 additions & 6 deletions .github/workflows/test-develop.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Test Develop
name: Test PyMEOS

on:
push:
branches: [ "develop" ]
branches: [ "develop", "master" ]
pull_request:
branches: [ "develop" ]
branches: [ "develop", "master" ]

jobs:
build:
Expand All @@ -16,18 +16,24 @@ jobs:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: build-essential cmake postgresql-server-dev-14 libproj-dev libjson-c-dev libgsl-dev libgeos-dev
version: 1.0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install MEOS
env:
BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
run: |
git clone --branch develop https://github.com/MobilityDB/MobilityDB
git clone --branch ${{ env.BRANCH_NAME }} --depth 1 https://github.com/MobilityDB/MobilityDB
mkdir MobilityDB/build
cd MobilityDB/build
cmake .. -DMEOS=on
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
.idea
Pipfile.lock
*-checkpoint.ipynb
docs/_build
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ temporal and spatio-temporal data based on [MobilityDB](https://mobilitydb.com/)

PyMEOS is a library built on top of MEOS that provides all of its functionality wrapped in a set of Python classes.

This repository contains 3 subprojects:
This repository contains 2 subprojects:

- [PyMEOS CFFI](./pymeos_cffi): wrapper of the MEOS C Library built using CFFI.
- [PyMEOS](./pymeos): library that exposes the set of classes that should be used by the developer. Built on top of
PyMEOS CFFI.
- [PyMEOS Examples](./pymeos_examples): set of example programs using PyMEOS.

# Usage

Expand Down Expand Up @@ -50,6 +49,8 @@ print(f'Speeds: {speed}')
pymeos_finalize()
````

For more examples, see [PyMEOS Examples repository](https://github.com/MobilityDB/PyMEOS-Examples)

# Documentation

Visit our [ReadTheDocs page](https://pymeos.readthedocs.io/en/latest/) for a more complete and detailed documentation, including an installation manual and several examples.
20 changes: 20 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,23 @@

html_theme = 'sphinx_book_theme'
html_static_path = ['_static']

import requests


def download_file(url, dest_path):
response = requests.get(url, stream=True)
response.raise_for_status() # Ensure we got a successful response

with open(dest_path, 'wb') as file:
for chunk in response.iter_content(chunk_size=8192):
file.write(chunk)


prefix = "https://raw.githubusercontent.com/MobilityDB/PyMEOS-Examples/main/"
download_file(
f"{prefix}PyMEOS_Examples/AIS.ipynb",
"src/examples/AIS.ipynb")
download_file(
f"{prefix}PyMEOS_Examples/BerlinMOD.ipynb",
"src/examples/BerlinMOD.ipynb")
1 change: 0 additions & 1 deletion docs/src/examples

This file was deleted.

2 changes: 1 addition & 1 deletion docs/src/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Examples
====================

Section under construction. However, you can check the existing examples available in the
`PyMEOS repository <https://github.com/MobilityDB/PyMEOS>`__ and the
`PyMEOS Examples repository <https://github.com/MobilityDB/PyMEOS_Examples>`__ and the
`PyMEOS-Demo repository <https://github.com/Diviloper/PyMEOS-demo>`__.

.. toctree::
Expand Down
6 changes: 3 additions & 3 deletions docs/src/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ time of the PyMEOS release. Install the binary wheel with pip as follows:
$ pip install pymeos


Installation using conda (incoming, not available yet)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Installation using conda
^^^^^^^^^^^^^^^^^^^^^^^^

PyMEOS is available on the conda-forge channel. Install as follows::

$ conda install pymeos --channel conda-forge
$ conda install conda-forge::pymeos


Installation from source with custom MEOS library
Expand Down
3 changes: 1 addition & 2 deletions pymeos/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ classifiers = [
'Programming Language :: C',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Expand All @@ -32,7 +31,7 @@ classifiers = [
readme = 'README.md'
license = { file = 'LICENSE' }

requires-python = '>=3.7'
requires-python = '>=3.8'
dependencies = [
'pymeos-cffi >=1.1.0, <2',
'python-dateutil',
Expand Down
11 changes: 9 additions & 2 deletions pymeos_cffi/pymeos_cffi/builder/build_header.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os.path
import platform
import re
import subprocess
import sys
Expand Down Expand Up @@ -36,7 +37,7 @@ def remove_if_not_defined(m):


def remove_repeated_functions(
content: str, seen_functions: set
content: str, seen_functions: set
) -> Tuple[str, Set[str]]:
def remove_if_repeated(m):
function = m.group(0).replace("\n", "").strip()
Expand Down Expand Up @@ -101,4 +102,10 @@ def main(include_dir, so_path=None, destination_path="pymeos_cffi/builder/meos.h
if len(sys.argv) > 1:
main(*sys.argv[1:])
else:
main("/usr/local/include", "/usr/local/lib/libmeos.so")
if sys.platform == "linux":
main("/usr/local/include", "/usr/local/lib/libmeos.so")
elif sys.platform == "darwin":
if platform.processor() == 'arm':
main("/opt/homebrew/include", "/opt/homebrew/lib/libmeos.dylib")
else:
main("/usr/local/include", "/usr/local/lib/libmeos.dylib")
18 changes: 17 additions & 1 deletion pymeos_cffi/pymeos_cffi/builder/build_pymeos.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import platform
import sys

from cffi import FFI

ffibuilder = FFI()
Expand All @@ -7,11 +10,24 @@

ffibuilder.cdef(content)


def get_library_dirs():
if sys.platform == "linux":
return ["/usr/local/lib"]
elif sys.platform == "darwin":
if platform.processor() == "arm":
return ["/opt/homebrew/lib"]
else:
return ["/usr/local/lib"]
else:
raise NotImplementedError("Unsupported platform")


ffibuilder.set_source(
"_meos_cffi",
'#include "meos.h"\n' '#include "meos_catalog.h"\n' '#include "meos_internal.h"',
libraries=["meos"],
library_dirs=["/usr/local/lib"],
library_dirs=get_library_dirs(),
) # library name, for the linker

if __name__ == "__main__": # not when running with setuptools
Expand Down
3 changes: 1 addition & 2 deletions pymeos_cffi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ classifiers = [
'Programming Language :: C',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Expand All @@ -33,7 +32,7 @@ classifiers = [
readme = 'README.md'
license = { file = 'LICENSE' }

requires-python = '>=3.7'
requires-python = '>=3.8'
dependencies = [
'cffi',
'python-dateutil',
Expand Down
511 changes: 0 additions & 511 deletions pymeos_examples/MovingPandas/2-computing-speed.ipynb

This file was deleted.

Loading