scx

MIT's Supply Chain Python Package

https://github.com/connor-makowski/scx

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.1%) to scientific vocabulary

Keywords

optimization python
Last synced: 6 months ago · JSON representation ·

Repository

MIT's Supply Chain Python Package

Basic Info
  • Host: GitHub
  • Owner: connor-makowski
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 1.97 MB
Statistics
  • Stars: 25
  • Watchers: 3
  • Forks: 3
  • Open Issues: 0
  • Releases: 5
Topics
optimization python
Created over 3 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

SCx

PyPI version License: MIT

MIT's Supply Chain Micromaster (SCx) Python Package

Documentation

Technical documentation can be found here.

Examples

Setup

Cloud Setup (Google Colab)

  • You can access google colab here
  • Create a new notebook
  • Install the scx package by adding the following to a new code cell at the top of your notebook and running it:
    • pip install scx

Local Setup

Make sure you have Python 3.11.x (or higher) installed on your system. You can download it here.

Recommended (but Optional) -> Expand this section to setup and activate a virtual environment.

  • Install (or upgrade) virtualenv: python3 -m pip install --upgrade virtualenv
  • Create your virtualenv named venv: python3 -m virtualenv venv
  • Activate your virtual environment
    • On Unix (Mac or Linux): source venv/bin/activate
    • On Windows: venv\scripts\activate

pip install scx

Optimization Getting Started

See all of the optimization examples here.

Basic Usage

py from scx.optimize import Model

Simple Optimization

```py from scx.optimize import Model

Create variables

product1amt = Model.variable(name="product1", lowBound=0) product2amt = Model.variable(name="product2", lowBound=0)

Initialize the model

mymodel = Model(name="GenericProblem", sense='maximize')

Add the Objective Fn

mymodel.addobjective( fn = (product1amt1)+(product2amt1) )

Add Constraints

mymodel.addconstraint( name = 'input1constraint', fn = product1amt1+product2amt2 <= 100 ) mymodel.addconstraint( name = 'input2constraint', fn = product1amt3+product2amt1 <= 200 )

Solve the model

mymodel.solve(getduals=True, get_slacks=True)

Show the outputs

NOTE: outputs can be fetched directly as a dictionary with my_model.get_outputs()

mymodel.showoutputs() Outputs: py {'duals': {'input1constraint': 0.4, 'input2constraint': 0.2}, 'objective': 80.0, 'slacks': {'input1constraint': -0.0, 'input2constraint': -0.0}, 'status': 'Optimal', 'variables': {'product1': 60.0, 'product2': 20.0}}

```

Database Getting Started

See all of the database examples here

Basic Usage

```py from scx.database import Database

Specify the S3 path to the data

data_folder = 's3://scx-dev/databases/supermarket/'

Create the database

db = Database(f''' CREATE TABLE Customers AS SELECT * FROM readparquet('{datafolder}customers.parquet'); ''')

Show the database Schema

db.show_info()

Query the database

db.query("SELECT * FROM Customers LIMIT 5") ```

Owner

  • Name: Connor Makowski
  • Login: connor-makowski
  • Kind: user
  • Location: Cambridge, MA

Cave Lab Project Manager and Digital Learning Lead at MIT

Citation (CITATION.cff)

cff-version: 1.2.1
title: >-
  SCX
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Connor
    family-names: Makowski
    email: conmak@mit.edu
    affiliation: MIT
    orcid: 'https://orcid.org/0009-0005-1522-022X'
repository-code: 'https://github.com/connor-makowski/scx'
url: >-
  https://connor-makowski.github.io/scx/scx.html
abstract: >-
  MIT's Supply Chain Micromaster (SCx) Python Package
license: MIT

GitHub Events

Total
  • Release event: 4
  • Watch event: 5
  • Delete event: 16
  • Push event: 4
  • Fork event: 1
  • Create event: 8
Last Year
  • Release event: 4
  • Watch event: 5
  • Delete event: 16
  • Push event: 4
  • Fork event: 1
  • Create event: 8

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 58
  • Total Committers: 1
  • Avg Commits per committer: 58.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 10
  • Committers: 1
  • Avg Commits per committer: 10.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Connor Makowski c****8@g****m 58

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 17
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • connor-makowski (19)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 925 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 14
  • Total maintainers: 1
pypi.org: scx

MIT Supply Chain Python Package

  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 925 Last month
Rankings
Dependent packages count: 10.1%
Stargazers count: 16.5%
Average: 19.5%
Downloads: 19.5%
Dependent repos count: 21.6%
Forks count: 29.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

requirements.txt pypi
  • Mako ==1.1.4
  • Markdown ==3.3.4
  • MarkupSafe ==1.1.1
  • autoflake ==1.4
  • black ==22.3.0
  • pamda ==0.0.13
  • pdoc3 ==0.9.2
  • twine ==4.0.0
pyproject.toml pypi
  • PuLP ==2.7.0
  • duckdb ==1.0.0
  • type_enforced >=1.2.0
Dockerfile docker
  • python 3.13-slim build