Skip to content

Commit

Permalink
Merge branch 'main' into docs/en/tutorial/tsp_sampling_with_openjij_a…
Browse files Browse the repository at this point in the history
…dapter
  • Loading branch information
Shitaro authored Feb 13, 2025
2 parents e29a92a + e1015eb commit 859e3a4
Show file tree
Hide file tree
Showing 21 changed files with 1,003 additions and 226 deletions.
31 changes: 4 additions & 27 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,14 @@ jobs:
- name: Setup Environment
uses: ./.github/actions/setup-test-environment

- name: Install dependencies
run: |
pip install "python/ommx[dev]"
pip install "python/ommx-python-mip-adapter[dev]"
- name: Build Python documentation
run: |
sphinx-build -b html ./python/ommx/docs/source ./python/ommx/docs/build
run: task api_reference:build

- name: Upload HTML
uses: actions/upload-artifact@v4
with:
name: doc-python-ommx
path: ./python/ommx/docs/build
retention-days: 30

- name: Build Python documentation
run: |
sphinx-build -b html ./python/ommx-python-mip-adapter/docs/source ./python/ommx-python-mip-adapter/docs/build
- name: Upload HTML
uses: actions/upload-artifact@v4
with:
name: doc-python-ommx-python-mip-adapter
path: ./python/ommx-python-mip-adapter/docs/build
name: doc-python
path: ./docs/api_reference/_build/html
retention-days: 30

package:
Expand Down Expand Up @@ -164,15 +147,9 @@ jobs:
- name: Download HTML of python
uses: actions/download-artifact@v4
with:
name: doc-python-ommx
name: doc-python
path: ./doc/python/ommx

- name: Download HTML of python
uses: actions/download-artifact@v4
with:
name: doc-python-ommx-python-mip-adapter
path: ./doc/python/ommx-python-mip-adapter

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down
31 changes: 31 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "23"
# rust: "1.82"
# golang: "1.23"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/api_reference/conf.py
# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/api_reference/requirements.txt
52 changes: 26 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ license = "MIT OR Apache-2.0"
anyhow = "1.0.95"
approx = "0.5.1"
base64 = "0.22.1"
built = { version = "0.7.5", features = ["git2"] }
built = { version = "0.7.6", features = ["git2"] }
chrono = "0.4.39"
clap = { version = "4.5.27", features = ["derive"] }
clap = { version = "4.5.28", features = ["derive"] }
colored = "2.2.0"
csv = "1.3.0"
derive_more = "0.99.18"
derive_more = "0.99.19"
directories = "5.0.1"
env_logger = "0.11.6"
flate2 = "1.0.35"
Expand All @@ -40,5 +40,5 @@ serde-pyobject = "0.3.0"
serde_json = "1.0.138"
thiserror = "2.0.11"
url = "2.5.3"
uuid = { version = "1.12.1", features = ["v4"] }
uuid = { version = "1.13.1", features = ["v4"] }
zip = "2.2.2"
41 changes: 15 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,23 @@

Open Mathematical prograMming eXchange (OMMX) is an open ecosystem that empowers mathematical programming and optimization developers and reserchers.

# Design

OMMX introduces two specification to solve the problem of data exchange in optimization field:

- Protocol buffers based data schema called [OMMX Message](./MESSAGE.md). This helps to store the optimization models and their solutions in language and framework agnostic way.
- OCI Artifact based packaging and distribution specification called [OMMX Artifact](./ARTIFACT.md). This helps to store your data with metadata and to exchange them with others as a container image.

# Tutorial

| Notebook | Open in Binder | Open in Colab |
|:---------|:---------------|:--------------|
| [OMMX Message](./notebooks/message.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Jij-Inc/ommx/main?labpath=notebooks%2Fmessage.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Jij-Inc/ommx/blob/main/notebooks/message.ipynb) |
| [OMMX Artifact](./notebooks/artifact.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Jij-Inc/ommx/main?labpath=notebooks%2Fartifact.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Jij-Inc/ommx/blob/main/notebooks/artifact.ipynb) |
| [Cookbook](./notebooks/cookbook.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Jij-Inc/ommx/main?labpath=notebooks%2Fcookbook.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Jij-Inc/ommx/blob/main/notebooks/cookbook.ipynb) |
| [Create OMMX Adapters](./notebooks/create_adapter.ipynb) | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Jij-Inc/ommx/main?labpath=notebooks%2Fcreate_adapter.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Jij-Inc/ommx/blob/main/notebooks/create_adapter.ipynb) |


To run the notebooks locally, you need to install required packages listed in [requirements.txt](./requirements.txt)
## English

```bash
# Optional: create a virtual environment
python -m venv .venv && source .venv/bin/activate
| Title | Jupyter Book |
|:------|:-------------|
| Solving Optimization Problems with OMMX Adapter | [![Book](https://img.shields.io/badge/Book-English-blue)](https://jij-inc.github.io/ommx/en/tutorial/solve_with_ommx_adapter.html) |
| Sampling from QUBO with OMMX Adapter | [![Book](https://img.shields.io/badge/Book-English-blue)](https://jij-inc.github.io/ommx/en/tutorial/tsp_sampling_with_openjij_adapter.html) |
| Downloading a MIPLIB Instance | [![Book](https://img.shields.io/badge/Book-English-blue)](https://jij-inc.github.io/ommx/en/tutorial/download_miplib_instance.html) |

# Install required packages (including Jupyter)
pip install -r requirements.txt
## 日本語

# Start Jupyter
jupyter lab
```
| タイトル | Jupyter Book |
|:------|:-------------|
| OMMX Adapterで最適化問題を解く | [![Book](https://img.shields.io/badge/Book-日本語-blue)](https://jij-inc.github.io/ommx/ja/tutorial/solve_with_ommx_adapter.html) |
| OMMX AdapterでQUBOからサンプリングする | [![Book](https://img.shields.io/badge/Book-日本語-blue)](https://jij-inc.github.io/ommx/ja/tutorial/tsp_sampling_with_openjij_adapter.html) |
| MIPLIBインスタンスをダウンロードする | [![Book](https://img.shields.io/badge/Book-日本語-blue)](https://jij-inc.github.io/ommx/ja/tutorial/download_miplib_instance.html) |

# API Reference

Expand All @@ -52,8 +40,9 @@ See [DEVELOPMENT.md](./DEVELOPMENT.md) about developing this project.
| Package name | PyPI | API Reference (main) |
|:--- |:--- |:--- |
| [ommx](./python/ommx) | [![ommx](https://img.shields.io/pypi/v/ommx)](https://pypi.org/project/ommx/) | [![main](https://img.shields.io/badge/API_Reference-main-blue)](https://jij-inc.github.io/ommx/python/ommx/autoapi/index.html) |
| [ommx-python-mip-adapter](./python/ommx-python-mip-adapter/) | [![ommx-python-mip-adapter](https://img.shields.io/pypi/v/ommx-python-mip-adapter)](https://pypi.org/project/ommx-python-mip-adapter/) | [![main](https://img.shields.io/badge/API_Reference-main-blue)](https://jij-inc.github.io/ommx/python/ommx-python-mip-adapter/autoapi/index.html)|
| [ommx-pyscipopt-adapter](./python/ommx-pyscipopt-adapter/) | [![ommx-pyscipopt-adapter](https://img.shields.io/pypi/v/ommx-pyscipopt-adapter)](https://pypi.org/project/ommx-pyscipopt-adapter/) | Preparing |
| [ommx-python-mip-adapter](./python/ommx-python-mip-adapter/) | [![ommx-python-mip-adapter](https://img.shields.io/pypi/v/ommx-python-mip-adapter)](https://pypi.org/project/ommx-python-mip-adapter/) | [![main](https://img.shields.io/badge/API_Reference-main-blue)](https://jij-inc.github.io/ommx/python/ommx/autoapi/ommx_python_mip_adapter/index.html)|
| [ommx-pyscipopt-adapter](./python/ommx-pyscipopt-adapter/) | [![ommx-pyscipopt-adapter](https://img.shields.io/pypi/v/ommx-pyscipopt-adapter)](https://pypi.org/project/ommx-pyscipopt-adapter/) | [![main](https://img.shields.io/badge/API_Reference-main-blue)](https://jij-inc.github.io/ommx/python/ommx/autoapi/ommx_pyscipopt_adapter/index.html) |
| [ommx-openjij-adapter](./python/ommx-openjij-adapter/) | [![ommx-openjij-adapter](https://img.shields.io/pypi/v/ommx-openjij-adapter)](https://pypi.org/project/ommx-openjij-adapter/) | [![main](https://img.shields.io/badge/API_Reference-main-blue)](https://jij-inc.github.io/ommx/python/ommx/autoapi/ommx_openjij_adapter/index.html) |

# License
© 2024 Jij Inc.
Expand Down
33 changes: 8 additions & 25 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"

includes:
api_reference:
taskfile: docs/api_reference/Taskfile.yml
dir: docs/api_reference

tasks:
# Documents
build_book_ja:
Expand Down Expand Up @@ -91,6 +96,8 @@ tasks:

install_python_mip_adapter:
cmds:
# Since python-mip for Apple Silicon is not available on PyPI, we need to install it from the source.
- pip install git+https://github.com/coin-or/python-mip.git
- pip install -ve "python/ommx-python-mip-adapter[dev]"

install_pyscipopt_adapter:
Expand All @@ -106,8 +113,7 @@ tasks:
- task: install_python_sdk
- task: install_pyscipopt_adapter
- task: install_openjij_adapter
# Skip because Python-MIP is not available on macOS
# - task: install_python_mip_adapter
- task: install_python_mip_adapter

format_python:
cmds:
Expand Down Expand Up @@ -142,29 +148,6 @@ tasks:
- pytest -vv --doctest-modules python/ommx-openjij-adapter/
- pyright python/ommx-openjij-adapter/

doc_python:
cmds:
- task: doc_python_sdk
- task: doc_python_mip_adapter

doc_python_sdk:
cmds:
- sphinx-build -b html source build
dir: python/ommx/docs

doc_python_mip_adapter:
cmds:
- sphinx-build -b html source build
dir: python/ommx-python-mip-adapter/docs

open_doc_python_sdk:
cmds:
- python -m webbrowser file:///$(pwd)/python/ommx/docs/build/index.html

open_doc_python_mip_adapter:
cmds:
- python -m webbrowser file:///$(pwd)/python/ommx-python-mip-adapter/docs/build/index.html

stubgen:
cmds:
- cargo run --bin stub_gen --features=stub_gen
Expand Down
Loading

0 comments on commit 859e3a4

Please sign in to comment.