Skip to main content

moveq-core

Pure NumPy algorithms for measuring transport equity.

PyPI Python versions License

  • Population-weighted Gini coefficient via numerical Lorenz curve integration
  • Palma ratio (top 10% highest-service vs bottom 40% lowest-service population)
  • Wagstaff Concentration Index via fractional-rank weighted covariance
  • Weighted composite scoring with dynamic missing-term renormalization

No I/O, no database, no framework lock-in: pass NumPy arrays, get numbers back.

Most applications should install the umbrella package instead:

pip install moveq

Installation

Requires Python 3.10+.

pip install moveq-core

Pandas DataFrame helpers:

pip install "moveq-core[frames]"

Quickstart

import numpy as np
from moveq_core import (
    compute_gini,
    compute_palma_ratio,
    compute_concentration_index,
    compute_score,
)

service = np.array([10.0, 20.0, 5.0, 50.0, 8.0])
population = np.array([1000, 800, 1200, 300, 900])
deprivation_rank = np.array([1, 3, 2, 5, 4])  # 1 = most deprived

gini = compute_gini(service, population)
palma = compute_palma_ratio(service, population)
ci = compute_concentration_index(service, deprivation_rank, population)

score_res = compute_score(
    terms={"coverage": 0.75, "evening": 0.50, "night": None},
    weights={"coverage": 0.50, "evening": 0.30, "night": 0.20},
)
print(f"Score: {score_res.score:.1f} ({score_res.note})")

DataFrame helpers (moveq_core.frames)

import pandas as pd
from moveq_core.frames import compute_vulnerability_index, identify_multiply_deprived

df = pd.DataFrame({
    "unemployment_pct": [5.0, 12.0, 20.0],
    "no_car_pct": [10.0, 30.0, 60.0],
    "elderly_pct": [15.0, 25.0, 35.0],
})

vulnerability = compute_vulnerability_index(
    df, ["unemployment_pct", "no_car_pct", "elderly_pct"]
)
flagged = identify_multiply_deprived(
    df, ["unemployment_pct", "no_car_pct", "elderly_pct"], min_factors=2
)

Documentation

License

BSD 3-Clause.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moveq_core-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moveq_core-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file moveq_core-0.1.0.tar.gz.

File metadata

  • Download URL: moveq_core-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for moveq_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 50af16963cc0ee95f2450d8735d2729e5837e5bf1c32d7aab7f8f91b2f65c39d
MD5 b2ff99a90962975abe87a13415ce466c
BLAKE2b-256 568c030e329dbeb09b4eb120674b036af592151d070b3b1a80edea53fba1c2c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for moveq_core-0.1.0.tar.gz:

Publisher: publish.yml on SVamseekar/moveq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moveq_core-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: moveq_core-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for moveq_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95076ef5263aa74d4a89bf2ab70c9ce333c2ac1046c856b6cb986def99bc44fb
MD5 66b766cb67155177e870fc027ccf78f7
BLAKE2b-256 2db13c79f2ca3a694b71fafc48715584571c790e5285fcc15e3e90f2ed63fbff

See more details on using hashes here.

Provenance

The following attestation bundles were made for moveq_core-0.1.0-py3-none-any.whl:

Publisher: publish.yml on SVamseekar/moveq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page