Introduction
This project provides a Python package and REST API applications for dividing a set of units into two most comparable groups based on their characteristics.
Problem Statement
Balancing Numeric Characteristics Across Two Groups
Input:
-
A set of units, where each unit possesses one or more numeric characteristics.
-
Desired size for each of the two groups.
-
(Optional) Pre-assignment constraints:
- Specify units that must belong to a particular group (Group A or Group B).
- Specify units that cannot belong to a particular group (Group A or Group B).
Objective:
Partition the units into two groups (Group A and Group B) of the specified size, ensuring maximum similarity between the groups. Similarity is measured by minimizing the sum of absolute differences in mean values for each characteristic across the two groups.
Constraints:
- Each unit is assigned to either Group A, Group B, or remains unassigned.
- The final size of Group A and Group B must match the specified desired size.
Output:
- A list of units assigned to Group A and Group B.
- The mean values for each characteristic in Group A and Group B.
- The sum of absolute differences in mean values for each characteristic across the two groups.
Local development
You are more than welcome to contribute to this project. To make your start easier we have prepared a docker image with all the necessary tools to run it as interpreter for Pycharm or to run tests.
Build docker image
docker build `
--tag surquest/surquest/split-balancer:latest `
--file package.base.dockerfile `
--target test .
Run docker container
docker run --rm -it `
-v "${pwd}:/opt/project" `
-w "/opt/project/test" `
surquest/surquest/split-balancer:latest pytest
REST API Quick Start
# Build the docker image
docker build `
--no-cache `
--tag surquest/app-split-balancer:latest `
--file app.base.dockerfile `
--target base .
docker build `
--no-cache `
--tag python/instore/pmp-integration-proxy `
--file app.base.dockerfile `
--target app .
# Run the docker container
docker run --rm -it `
--name pmp-integration-proxy `
-v "$(pwd):/opt/project" `
-p 1010:8080 surquest/app-split-balancer:latest
Metadata
Release files for surquest-split-balancer 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| surquest_split_balancer-0.0.6.tar.gz | 14.9 kB | Without provenance | Details for surquest_split_balancer-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| surquest_split_balancer-0.0.6-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for surquest_split_balancer-0.0.6-py2.py3-none-any.whl |
Total release size: 22.0 kB
Release files / surquest_split_balancer-0.0.6.tar.gz
| Download URL | surquest_split_balancer-0.0.6.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28ce67214e26a568609541adc7a0d6958057cb2ced9ecb95266baa2345bb4b8c
|
|
BLAKE2b-256 checksum How to use checksums |
dccabd59f3171575f93a55c25eb04b3bf81ddb959572eb044979d2a2c1e3fef9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / surquest_split_balancer-0.0.6-py2.py3-none-any.whl
| Download URL | surquest_split_balancer-0.0.6-py2.py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d576a1dab5e8a4110fc65752c1bfba6f2545b55519a9421185d7bf97000f5ff3
|
|
BLAKE2b-256 checksum How to use checksums |
92c3845613cf08e00baa56065a148e47e14bb336ef95b50909c296d18df2b504
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for surquest-split-balancer 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.