Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3eadb4d
Fix test workflow and add release workflow
Diviloper Dec 1, 2024
5bf0aa9
Add border_inc parameter in STBox tile method
Diviloper Dec 1, 2024
d3dd7bb
Update pymeos_cffi requirement version
Diviloper Jul 28, 2025
8bb9c97
Update references to geoset functions (geoset -> spatialset)
Diviloper Jul 28, 2025
b5b3c43
Update reference to temporal point extent aggregator
Diviloper Jul 28, 2025
0fa0da8
Drop support for python 3.8 and 3.9 and require 3.10 minimum
Diviloper Aug 1, 2025
b6ad0ba
Start syncing
Diviloper Aug 1, 2025
6b247e9
Move functionalities only available to planar object (TGeoms) from TP…
Diviloper Aug 6, 2025
70f6d7f
Drop python versions 3.8 and 3.9 from workflows
Diviloper Aug 8, 2025
b8b1f27
Ditch black in favour of ruff.
Diviloper Aug 8, 2025
0f977e7
added correct function
1-ARIjitS Aug 5, 2024
0a0b482
Close PR #72 1.3 bump: circular imports + 1 test typo
estebanzimanyi May 14, 2026
b398ddc
Merge remote-tracking branch 'origin/master' into bump/meos-1.3
estebanzimanyi May 14, 2026
52e8237
Bump apt postgresql-server-dev to 16 in the test workflow
estebanzimanyi May 14, 2026
ca1c81b
ruff format on collections after master merge
estebanzimanyi May 14, 2026
d8f9c02
Look up matching MobilityDB/PyMEOS-CFFI branch by head_ref first
estebanzimanyi May 14, 2026
22110ef
Derive MEOS branch from package version in test workflow
estebanzimanyi May 14, 2026
4504334
Correct pre-existing test fixture bugs
estebanzimanyi May 14, 2026
b22b81a
ruff format
estebanzimanyi May 14, 2026
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
20 changes: 0 additions & 20 deletions .github/workflows/black.yml

This file was deleted.

157 changes: 157 additions & 0 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Release and Publish PyMEOS

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
checks:
name: Make checks
runs-on: ubuntu-latest

outputs:
is_alpha: ${{ steps.check_alpha.outputs.is_alpha }}
is_beta: ${{ steps.check_beta.outputs.is_beta }}
is_rc: ${{ steps.check_rc.outputs.is_rc }}
is_prerelease: ${{ steps.check_prerelease.outputs.is_prerelease }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check if publishing an alpha version
id: check_alpha
run: |
VERSION=${GITHUB_REF#refs/tags/}

if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+-alpha ]]; then
echo "Releasing an alpha version."
echo "is_alpha=true" >> "$GITHUB_OUTPUT"
else
echo "is_alpha=false" >> "$GITHUB_OUTPUT"
fi

- name: Check if publishing a beta version
id: check_beta
run: |
VERSION=${GITHUB_REF#refs/tags/}

if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+-beta ]]; then
echo "Releasing a beta version."
echo "is_beta=true" >> "$GITHUB_OUTPUT"
else
echo "is_beta=false" >> "$GITHUB_OUTPUT"
fi

- name: Check if publishing a release candidate version
id: check_rc
run: |
VERSION=${GITHUB_REF#refs/tags/}

if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc ]]; then
echo "Releasing an rc version."
echo "is_rc=true" >> "$GITHUB_OUTPUT"
else
echo "is_rc=false" >> "$GITHUB_OUTPUT"
fi

- name: Check if publishing a prerelease version
id: check_prerelease
run: |
is_alpha=${{ steps.check_alpha.outputs.is_alpha }}
is_beta=${{ steps.check_beta.outputs.is_beta }}
is_rc=${{ steps.check_rc.outputs.is_rc }}

if [ "$is_alpha" == "true" ] || [ "$is_beta" == "true" ] || [ "$is_rc" == "true" ]; then
echo "Releasing an prerelease version."
echo "is_prerelease=true" >> "$GITHUB_OUTPUT"
else
echo "is_prerelease=false" >> "$GITHUB_OUTPUT"
fi

- name: Check package version matches tag
run: |
tag_version=${GITHUB_REF#refs/tags/v}
python_version=$(grep -oP '__version__ = "\K[^"]+' pymeos/__init__.py)

if [[ "$tag_version" != "$python_version" ]]; then
echo "Tag Version ($tag_version) doesn't match Code Version ($python_version)"
echo "::error title=Version mismatch::Tag Version ($tag_version) doesn't match Code Version ($python_version)"
exit 1
fi


build:
name: Build PyMEOS
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.10
cache: "pip"

- name: Setup pip
run: |
python -m pip install --upgrade pip
python -m pip install build

- name: Build package
run: python -m build

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: |
./dist/pymeos-*.tar.gz
./dist/pymeos-*.whl

release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [ checks, build ]

permissions:
contents: write

steps:
- name: Get artifacts
uses: actions/download-artifact@v4
with:
path: ./dist
merge-multiple: true

- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: ./dist/*
prerelease: ${{ needs.checks.outputs.is_prerelease }}
generate_release_notes: true

publish:
name: Upload to PyPI
needs: [ build ]
runs-on: ubuntu-latest

if: github.repository == 'MobilityDB/PyMEOS'
environment:
name: pypi
url: https://pypi.org/p/pymeos
permissions:
id-token: write

steps:
- name: Get artifacts
uses: actions/download-artifact@v4
with:
path: ./dist
merge-multiple: true

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

26 changes: 26 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint code with Ruff

on:
push:
branches: [ "master", "stable-[0-9]+.[0-9]+" ]
pull_request:
branches: [ "master", "stable-[0-9]+.[0-9]+" ]

jobs:
lint:
name: Lint code with Ruff
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Ruff
uses: astral-sh/ruff-action@v3
with:
args: "--version"

- name: Check rules
run: "ruff check"

- name: Check format
run: "ruff format --check --diff"
38 changes: 26 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
os: [ ubuntu-latest, macos-13, macos-14 ]
include:
- ld_path: "/usr/local/lib"
- ld_prefix: "/usr/local"
- os: macos-14
ld_path: "/opt/homebrew/lib"
ld_prefix: "/opt/homebrew"

steps:
- name: Checkout
Expand All @@ -38,7 +38,7 @@ jobs:
uses: awalsh128/cache-apt-pkgs-action@latest
if: runner.os == 'Linux'
with:
packages: build-essential cmake postgresql-server-dev-14 libproj-dev libjson-c-dev libgsl-dev libgeos-dev
packages: build-essential cmake postgresql-server-dev-16 libproj-dev libjson-c-dev libgsl-dev libgeos-dev
version: 1.0

- name: Get dependencies from homebrew (cache)
Expand All @@ -56,17 +56,30 @@ jobs:
brew reinstall python@3.11 || brew link --overwrite python@3.11
brew update

- name: Derive MEOS branch from package version
id: meos_branch
shell: bash
run: |
pymeos_version=$(sed -nE 's/^__version__ = "([^"]+)".*/\1/p' pymeos/__init__.py)
major_minor=$(echo "$pymeos_version" | sed -nE 's/^([0-9]+\.[0-9]+).*/\1/p')
candidate="stable-${major_minor}"
if git ls-remote --exit-code https://github.com/MobilityDB/MobilityDB "$candidate" >/dev/null 2>&1; then
meos_branch=$candidate
else
meos_branch="master"
fi
echo "Package version $pymeos_version => MEOS branch $meos_branch"
echo "meos_branch=$meos_branch" >> "$GITHUB_OUTPUT"

- name: Fetch MEOS sources
env:
BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
run: |
git clone --branch ${{ env.BRANCH_NAME }} --depth 1 https://github.com/MobilityDB/MobilityDB
git clone --branch ${{ steps.meos_branch.outputs.meos_branch }} --depth 1 https://github.com/MobilityDB/MobilityDB

- name: Install MEOS
run: |
mkdir MobilityDB/build
cd MobilityDB/build
cmake .. -DMEOS=on
cmake .. -DMEOS=on -DCMAKE_INSTALL_PREFIX=${{ matrix.ld_prefix }}
make -j
sudo make install

Expand All @@ -78,9 +91,10 @@ jobs:

- name: Fetch PyMEOS CFFI sources
env:
BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
git clone --branch ${{ env.BRANCH_NAME }} --depth 1 https://github.com/MobilityDB/PyMEOS-CFFI
git clone --branch ${{ env.BRANCH_NAME }} --depth 1 https://github.com/MobilityDB/PyMEOS-CFFI \
|| git clone --branch ${{ github.base_ref || 'master' }} --depth 1 https://github.com/MobilityDB/PyMEOS-CFFI

- name: Install python dependencies
run: |
Expand All @@ -97,6 +111,6 @@ jobs:

- name: Test PyMEOS with pytest
run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ matrix.ld_path }}
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${{ matrix.ld_path }}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ matrix.ld_prefix }}/lib
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${{ matrix.ld_prefix }}/lib
pytest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ docs/_build
sandbox.py
sandbox.ipynb

coverage.xml
coverage.xml.venv/
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![pypi](https://img.shields.io/pypi/v/pymeos.svg)](https://pypi.python.org/pypi/pymeos/)
[![docs status](https://readthedocs.org/projects/pymeos/badge/?version=latest)](https://pymeos.readthedocs.io/en/latest/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

[MEOS (Mobility Engine, Open Source)](https://www.libmeos.org/) is a C library which enables the manipulation of
temporal and spatio-temporal data based on [MobilityDB](https://mobilitydb.com/)'s data types and functions.
Expand Down
3 changes: 2 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
python-dateutil
shapely
geopandas
pytest
pytest
ruff
4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,4 @@ def download_file(url, dest_path):

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"
)
download_file(f"{prefix}PyMEOS_Examples/BerlinMOD.ipynb", "src/examples/BerlinMOD.ipynb")
33 changes: 17 additions & 16 deletions pymeos/__init__.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
from .aggregators import *
from .boxes import *
from .main import *
from .meos_init import *
from .temporal import *
from .collections import *
from pymeos_cffi import (
MeosException,
MeosInternalError,
MeosArgumentError,
MeosIoError,
MeosInternalTypeError,
MeosValueOutOfRangeError,
MeosDivisionByZeroError,
MeosMemoryAllocError,
MeosAggregationError,
MeosArgumentError,
MeosDirectoryError,
MeosDivisionByZeroError,
MeosException,
MeosFileError,
MeosGeoJsonInputError,
MeosGeoJsonOutputError,
MeosInternalError,
MeosInternalTypeError,
MeosInvalidArgError,
MeosInvalidArgTypeError,
MeosInvalidArgValueError,
MeosIoError,
MeosMemoryAllocError,
MeosMfJsonInputError,
MeosMfJsonOutputError,
MeosTextInputError,
MeosTextOutputError,
MeosValueOutOfRangeError,
MeosWkbInputError,
MeosWkbOutputError,
MeosGeoJsonInputError,
MeosGeoJsonOutputError,
)

from .aggregators import *
from .boxes import *
from .collections import *
from .main import *
from .meos_init import *
from .temporal import *

__version__ = "1.3.0-alpha-1"
__all__ = [
# initialization
Expand Down
2 changes: 1 addition & 1 deletion pymeos/aggregators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from .bool_aggregators import *
from .general_aggregators import *
from .number_aggregators import *
from .text_aggregators import *
from .point_aggregators import *
from .text_aggregators import *
from .time_aggregators import *

__all__ = [
Expand Down
Loading
Loading