Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
# GDPlib

[![codecov](https://codecov.io/gh/SECQUOIA/gdplib/branch/main/graph/badge.svg)](https://codecov.io/gh/SECQUOIA/gdplib)
[![Tests](https://github.com/SECQUOIA/gdplib/workflows/Test/badge.svg)](https://github.com/SECQUOIA/gdplib/actions?query=workflow%3ATest)
[![Lint](https://github.com/SECQUOIA/gdplib/workflows/Lint/badge.svg)](https://github.com/SECQUOIA/gdplib/actions?query=workflow%3ALint)

We envision GDPlib as an open library of GDP models to provide examples for prospective modelers, and to provide a benchmarking set for algorithm developers.
We invite contributions to this library from the community, provided under the same BSD-3-clause or compatible license.

## Model Size Comparison

The following table shows the size metrics for all models in GDPlib:

| Component | [batch_processing](./gdplib/batch_processing/) | [biofuel](./gdplib/biofuel/) | [cstr](./gdplib/cstr/) | [disease_model](./gdplib/disease_model/) | [ex1_linan_2023](./gdplib/ex1_linan_2023/) | [gdp_col](./gdplib/gdp_col/) | [hda](./gdplib/hda/) | [jobshop](./gdplib/jobshop/) | [med_term_purchasing](./gdplib/med_term_purchasing/) | [methanol](./gdplib/methanol/) | [modprodnet](./gdplib/modprodnet/) | [positioning](./gdplib/positioning/) | [small_batch](./gdplib/small_batch/) | [spectralog](./gdplib/spectralog/) | [stranded_gas](./gdplib/stranded_gas/) | [syngas](./gdplib/syngas/) | [water_network](./gdplib/water_network/) |
|:----------------------|-------------------------------------------------:|-------------------------------:|-------------------------:|-------------------------------------------:|---------------------------------------------:|-------------------------------:|-----------------------:|-------------------------------:|-------------------------------------------------------:|---------------------------------:|-------------------------------------:|---------------------------------------:|---------------------------------------:|-------------------------------------:|-----------------------------------------:|-----------------------------:|-------------------------------------------:|
| variables | 288 | 36840 | 76 | 1250 | 12 | 442 | 1158 | 10 | 1165 | 287 | 488 | 56 | 37 | 128 | 57810 | 367 | 395 |
| binary_variables | 138 | 516 | 20 | 52 | 10 | 30 | 12 | 6 | 216 | 8 | 2 | 50 | 18 | 60 | 192 | 46 | 10 |
| integer_variables | 0 | 4356 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 363 | 0 | 0 | 0 | 45360 | 0 | 0 |
| continuous_variables | 150 | 31968 | 56 | 1198 | 2 | 412 | 1146 | 4 | 949 | 279 | 123 | 6 | 19 | 68 | 12258 | 321 | 385 |
| disjunctions | 9 | 252 | 10 | 26 | 2 | 15 | 6 | 3 | 72 | 4 | 1 | 25 | 9 | 30 | 96 | 23 | 5 |
| disjuncts | 18 | 516 | 20 | 52 | 10 | 30 | 12 | 6 | 216 | 8 | 2 | 50 | 18 | 60 | 192 | 46 | 10 |
| constraints | 601 | 12884 | 100 | 831 | 10 | 610 | 728 | 9 | 762 | 429 | 486 | 30 | 34 | 158 | 14959 | 543 | 329 |
| nonlinear_constraints | 1 | 12 | 17 | 0 | 0 | 262 | 151 | 0 | 0 | 55 | 1 | 25 | 1 | 8 | 18 | 48 | 33 |

This table was automatically generated using the `generate_model_size_report.py` script.


## Installation

GDPlib is an installable model library in Python.
Expand All @@ -18,7 +40,36 @@ To update GDPlib:
pip install --upgrade gdplib
```

For a developer install, please clone this repository, activate the correct python environment, and run `python setup.py develop` on the `setup.py` file in this directory.
For a developer install, please clone this repository, activate the correct python environment, and run:

```bash
pip install -r requirements.txt
pip install -e .
```

### Development Setup

For development work with enhanced Copilot integration:

1. **Install development dependencies:**
```bash
pip install -r requirements-dev.txt
```

2. **Set up GitHub Copilot with custom instructions:**
- The repository includes custom Copilot instructions in `.github/copilot-instructions.md`
- Project-specific configurations are available in `.copilot/`

3. **Run tests:**
```bash
pytest tests/
```

4. **Code formatting and linting:**
```bash
black gdplib/
flake8 gdplib/
```

## Model descriptions

Expand Down
10 changes: 10 additions & 0 deletions gdplib/batch_processing/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 288 |
| binary_variables | 138 |
| integer_variables | 0 |
| continuous_variables | 150 |
| disjunctions | 9 |
| disjuncts | 18 |
| constraints | 601 |
| nonlinear_constraints | 1 |
10 changes: 10 additions & 0 deletions gdplib/biofuel/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 36840 |
| binary_variables | 516 |
| integer_variables | 4356 |
| continuous_variables | 31968 |
| disjunctions | 252 |
| disjuncts | 516 |
| constraints | 12884 |
| nonlinear_constraints | 12 |
10 changes: 10 additions & 0 deletions gdplib/cstr/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 76 |
| binary_variables | 20 |
| integer_variables | 0 |
| continuous_variables | 56 |
| disjunctions | 10 |
| disjuncts | 20 |
| constraints | 100 |
| nonlinear_constraints | 17 |
10 changes: 10 additions & 0 deletions gdplib/disease_model/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 1250 |
| binary_variables | 52 |
| integer_variables | 0 |
| continuous_variables | 1198 |
| disjunctions | 26 |
| disjuncts | 52 |
| constraints | 831 |
| nonlinear_constraints | 0 |
10 changes: 10 additions & 0 deletions gdplib/ex1_linan_2023/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 12 |
| binary_variables | 10 |
| integer_variables | 0 |
| continuous_variables | 2 |
| disjunctions | 2 |
| disjuncts | 10 |
| constraints | 10 |
| nonlinear_constraints | 0 |
10 changes: 10 additions & 0 deletions gdplib/gdp_col/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 442 |
| binary_variables | 30 |
| integer_variables | 0 |
| continuous_variables | 412 |
| disjunctions | 15 |
| disjuncts | 30 |
| constraints | 610 |
| nonlinear_constraints | 262 |
10 changes: 10 additions & 0 deletions gdplib/hda/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 1158 |
| binary_variables | 12 |
| integer_variables | 0 |
| continuous_variables | 1146 |
| disjunctions | 6 |
| disjuncts | 12 |
| constraints | 728 |
| nonlinear_constraints | 151 |
10 changes: 10 additions & 0 deletions gdplib/jobshop/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 10 |
| binary_variables | 6 |
| integer_variables | 0 |
| continuous_variables | 4 |
| disjunctions | 3 |
| disjuncts | 6 |
| constraints | 9 |
| nonlinear_constraints | 0 |
10 changes: 10 additions & 0 deletions gdplib/med_term_purchasing/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 1165 |
| binary_variables | 216 |
| integer_variables | 0 |
| continuous_variables | 949 |
| disjunctions | 72 |
| disjuncts | 216 |
| constraints | 762 |
| nonlinear_constraints | 0 |
10 changes: 10 additions & 0 deletions gdplib/methanol/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 287 |
| binary_variables | 8 |
| integer_variables | 0 |
| continuous_variables | 279 |
| disjunctions | 4 |
| disjuncts | 8 |
| constraints | 429 |
| nonlinear_constraints | 55 |
10 changes: 10 additions & 0 deletions gdplib/modprodnet/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 488 |
| binary_variables | 2 |
| integer_variables | 363 |
| continuous_variables | 123 |
| disjunctions | 1 |
| disjuncts | 2 |
| constraints | 486 |
| nonlinear_constraints | 1 |
10 changes: 10 additions & 0 deletions gdplib/positioning/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 56 |
| binary_variables | 50 |
| integer_variables | 0 |
| continuous_variables | 6 |
| disjunctions | 25 |
| disjuncts | 50 |
| constraints | 30 |
| nonlinear_constraints | 25 |
10 changes: 10 additions & 0 deletions gdplib/small_batch/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 37 |
| binary_variables | 18 |
| integer_variables | 0 |
| continuous_variables | 19 |
| disjunctions | 9 |
| disjuncts | 18 |
| constraints | 34 |
| nonlinear_constraints | 1 |
10 changes: 10 additions & 0 deletions gdplib/spectralog/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 128 |
| binary_variables | 60 |
| integer_variables | 0 |
| continuous_variables | 68 |
| disjunctions | 30 |
| disjuncts | 60 |
| constraints | 158 |
| nonlinear_constraints | 8 |
10 changes: 10 additions & 0 deletions gdplib/stranded_gas/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 57810 |
| binary_variables | 192 |
| integer_variables | 45360 |
| continuous_variables | 12258 |
| disjunctions | 96 |
| disjuncts | 192 |
| constraints | 14959 |
| nonlinear_constraints | 18 |
10 changes: 10 additions & 0 deletions gdplib/syngas/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 367 |
| binary_variables | 46 |
| integer_variables | 0 |
| continuous_variables | 321 |
| disjunctions | 23 |
| disjuncts | 46 |
| constraints | 543 |
| nonlinear_constraints | 48 |
10 changes: 10 additions & 0 deletions gdplib/water_network/model_size_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Component | Number |
|:----------------------|---------:|
| variables | 395 |
| binary_variables | 10 |
| integer_variables | 0 |
| continuous_variables | 385 |
| disjunctions | 5 |
| disjuncts | 10 |
| constraints | 329 |
| nonlinear_constraints | 33 |
Loading