Skip to main content

A python package for operations research and data science problems.

Project description

(In Development)

python package

pyords

A library for operations research and data science.

implementation types

  • graph theory
  • genetic algorithm
  • simulation
  • machine learning

motivation behind the project

Self-learning:

  1. Open-source software development
  2. Data Science
  3. Operations Research
  4. Financial Engineering
  5. Visualizations in Python or JavaScript
  6. Big splash! NumPy, Pandas, D3.js, Plotly, Matplotlib, IPython and jupyter, scikit-learn and SciPy, git, Google OR Tools (ortools), Pyomo, Supply Chain Guru, Keras, Hadoop, AWS, GCP, Vagrant

Development & Documentation

pyords Bundles

Bundles are self-contained problem definitions implemented as modular instances. That's wanna-be fancy for packaged units of code that are very plug-in and play. Contributing to Bundle development:

  1. Design the problem as a Case where the Case can be tested against various Bundles that solve the problem defined in the Case. For the purposes of this README we'll use VrpVehicleCase. Cases must help define what is required of a feature implementation (or the improvement of one). For our VrpVehicleCase we'll assume a set of data and configurations for basic vrp model requirements and a desired output of optimized vehicles to append to our data.

  2. Build a Bundle. The bundle should be specific to the Case(s) it solves. Maybe you see where I'm going with this. There are two core components of this library:

    • Bundles
    • Cases
  3. Test the Case against its Bundle.

  4. Submit implementation with documentation supporting the reason for its development.

VrpVehicleCase

  • defines allowable data for one or many vehicles outputs via vrp optimization
  • defines input expectations & tests
  • defines Case expectations & tests
  • defines output expectations & tests
  • related:
    • GeoBundle
    • OrBundle

GeoBundle

  • processed zipcode outputs, lat and lon outputs, haversine distance outputs, and lat and lon cluster outputs
  • integrations:
  • related:
    • ZipcodeCleanCase
    • LatLonCase
    • LatLonDistanceCase
    • LatLonClusterCase

OrBundle

  • operations research optimizations: vrp, network optimization, scheduling.
  • opportunity analysis, health checks.
  • implementations:
    • Vrp optimization via Google OrTools
    • Schedule optimization via Genetic Algorithm
  • integrations:

using pyords Bundles for vehicle optimization

import pyords as pyr


df = pd.read_csv('my_shipment_data.csv')

# TODO: implement this bundle (currently not refactored)
geobndl = pyr.GeoBundle(zipcodes=df.zipcodes)
lats, lons = geo_bndl.pgeo('US')
matrix = geobndl.haversine_all_from(origin=origin, 'mi')
clusters = geobndl.cluster(by='geocodes')

vrpbndl = pyr.VrpBundle(matrix=matrix, demand=df.pallets)
df = vrpbndl.run().cast_solution_to_df(clustered_df)

Testing pyords Bundles :white_check_mark:

import pyords as pyr

class VrpVehicleCase:
    inputs = {
        'matrix': [[0, 1, 2], [1, 0, 2], [2, 2, 0]],
        'demand': [0, 3, 4],
        'max_vehicle_capacity': 5,
        'partitions': [1, 1, 1],
        'max_search_seconds': 30
    }

    outputs = {
        'vehicle_id': [1, 2]
    }

    implementation = None # TODO: pyr.ortools.vrp

    def run(self):
        bndl = pyr.VrpBundle(case=self)

        assert bndl.test()

        return self

if __name__ == '__main__':
    VrpVehicleCase.run()

Project details


Download files

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

Source Distribution

pyords-0.0.9.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

pyords-0.0.9-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file pyords-0.0.9.tar.gz.

File metadata

  • Download URL: pyords-0.0.9.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for pyords-0.0.9.tar.gz
Algorithm Hash digest
SHA256 3ffb8573289d3f84741d56cc6d52eb7b3d8adadb79cf8801e41e904c3e40a4e1
MD5 ca58e90440ff4b53f656453000cf829b
BLAKE2b-256 abdb0b7b9e54148c85fa8a282bb5923df3f7b2649d2a965428b35ea45b690ec5

See more details on using hashes here.

File details

Details for the file pyords-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: pyords-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for pyords-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 a6050364a626c21daddcc7afdb50ea7d7c578ae6ae74f5cdbcdd7bdd3bffa0dd
MD5 37a31bc74c3a7ac8c42c39b30ea2eae5
BLAKE2b-256 7c59a6048551a1ce8d628e07560bfd4f47ab4b61d093fd3893b173cc90b226ab

See more details on using hashes here.

Supported by

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