Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sum constraint back in #26

Merged
merged 20 commits into from
Feb 24, 2024
Merged
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
21 changes: 8 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ on:
workflow_dispatch: # Allow manually triggering the workflow
schedule:
# Run roughly every 15 days at 00:00 UTC
# (useful to check if updates on dependencies break the package)
- cron: '0 0 1,16 * *'
- cron: '0 0 1,16 * *' # Run roughly every 15 days at 00:00 UTC

permissions:
contents: read

concurrency:
group: >-
${{ github.workflow }}-${{ github.ref_type }}-
${{ github.event.pull_request.number || github.sha }}
group: ${{ github.workflow }}-${{ github.ref_type }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
Expand All @@ -40,9 +37,7 @@ jobs:
- name: Run static analysis and format checkers
run: pipx run pre-commit run --all-files --show-diff-on-failure
- name: Build package distribution files
run: >-
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
tox -e clean,build
run: pipx run --python '${{ steps.setup-python.outputs.python-path }}' tox -e clean,build
- name: Record the path of wheel distribution
id: wheel-distribution
run: echo "path=$(ls dist/*.whl)" >> $GITHUB_OUTPUT
Expand All @@ -58,6 +53,7 @@ jobs:
test:
needs: prepare
strategy:
fail-fast: false
matrix:
python:
- "3.8" # oldest Python supported by PSF
Expand All @@ -66,6 +62,7 @@ jobs:
- ubuntu-latest
# - macos-latest
# - windows-latest
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] # number of groups
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
Expand All @@ -77,10 +74,8 @@ jobs:
uses: actions/download-artifact@v3
with: {name: python-distribution-files, path: dist/}
- name: Run tests
run: >-
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
tox --installpkg '${{ needs.prepare.outputs.wheel-distribution }}'
-- -rFEx --durations 10 --color yes # pytest args
run: pipx run --python '${{ steps.setup-python.outputs.python-path }}' tox --installpkg '${{ needs.prepare.outputs.wheel-distribution }}' -- -rFEx --durations 10 --color yes --group=${{ matrix.group }} --splits=19 --splitting-algorithm least_duration # pytest args

# - name: Generate coverage report
# run: pipx run coverage lcov -o coverage.lcov
# - name: Upload partial coverage report
Expand Down Expand Up @@ -116,7 +111,7 @@ jobs:
with: {name: python-distribution-files, path: dist/}
- name: Publish Package
env:
# TODO: Set your PYPI_TOKEN as a secret using GitHub UI
# Ensure PYPI_TOKEN set as a secret using GitHub UI
# - https://pypi.org/help/#apitoken
# - https://docs.github.com/en/actions/security-guides/encrypted-secrets
TWINE_REPOSITORY: pypi
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ MANIFEST

# Per-project virtualenvs
.venv*/
venv/*
.conda*/
.python-version
reports/~$honegumi-logo.pptx
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:

# If you want to avoid flake8 errors due to unused vars or imports:
- repo: https://github.com/PyCQA/autoflake
rev: v2.2.1
rev: v2.3.0
hooks:
- id: autoflake
args: [
Expand All @@ -42,14 +42,14 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.2.0
hooks:
- id: black
exclude: ^tests/generated_scripts/
language_version: python3

- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.2.0
hooks:
- id: black
exclude: ^(?!tests/generated_scripts/).* # any string that does not start with tests/generated_scripts/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"id": "1e89e727",
"id": "8094c7b9",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-False+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-False+custom_threshold-False+synchrony-batch.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-True+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-False+custom_threshold-False+synchrony-batch.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2e4a348b",
"id": "0d3ca609",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -21,7 +21,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c69bdeb0",
"id": "09e6c837",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -83,6 +83,9 @@
" obj1_name: ObjectiveProperties(minimize=True),\n",
" obj2_name: ObjectiveProperties(minimize=True),\n",
" },\n",
" parameter_constraints=[\n",
" \"x1 + x2 <= 15.0\", # example of a sum constraint\n",
" ],\n",
")\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"id": "6085c430",
"id": "1f3e2156",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-False+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-False+custom_threshold-False+synchrony-single.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-True+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-False+custom_threshold-False+synchrony-single.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b34b6676",
"id": "541781f2",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -21,7 +21,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "0f1868d4",
"id": "3dc1a03d",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -83,6 +83,9 @@
" obj1_name: ObjectiveProperties(minimize=True),\n",
" obj2_name: ObjectiveProperties(minimize=True),\n",
" },\n",
" parameter_constraints=[\n",
" \"x1 + x2 <= 15.0\", # example of a sum constraint\n",
" ],\n",
")\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"id": "d9ef58c8",
"id": "a9045c10",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-False+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-False+custom_threshold-True+synchrony-batch.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-True+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-False+custom_threshold-True+synchrony-batch.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cb7874ba",
"id": "448d9492",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -21,7 +21,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "cf799029",
"id": "664fe2ff",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -83,6 +83,9 @@
" obj1_name: ObjectiveProperties(minimize=True, threshold=25.0),\n",
" obj2_name: ObjectiveProperties(minimize=True, threshold=15.0),\n",
" },\n",
" parameter_constraints=[\n",
" \"x1 + x2 <= 15.0\", # example of a sum constraint\n",
" ],\n",
")\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"id": "e507de08",
"id": "ad0529e0",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-False+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-False+custom_threshold-True+synchrony-single.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-True+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-False+custom_threshold-True+synchrony-single.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a2c7a5fa",
"id": "8b3ea5db",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -21,7 +21,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "28a9c794",
"id": "f95a16d2",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -83,6 +83,9 @@
" obj1_name: ObjectiveProperties(minimize=True, threshold=25.0),\n",
" obj2_name: ObjectiveProperties(minimize=True, threshold=15.0),\n",
" },\n",
" parameter_constraints=[\n",
" \"x1 + x2 <= 15.0\", # example of a sum constraint\n",
" ],\n",
")\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"id": "b4a73b81",
"id": "0806c11c",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-False+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-True+custom_threshold-False+synchrony-batch.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-True+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-True+custom_threshold-False+synchrony-batch.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c97a936b",
"id": "3e4721a3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -21,7 +21,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "78d9b878",
"id": "693c4f65",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -97,6 +97,9 @@
" obj1_name: ObjectiveProperties(minimize=True),\n",
" obj2_name: ObjectiveProperties(minimize=True),\n",
" },\n",
" parameter_constraints=[\n",
" \"x1 + x2 <= 15.0\", # example of a sum constraint\n",
" ],\n",
")\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"id": "bd6422c7",
"id": "eebd5936",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-False+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-True+custom_threshold-False+synchrony-single.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-True+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-True+custom_threshold-False+synchrony-single.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fcb63c00",
"id": "41e30cdd",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -21,7 +21,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "70ecc10d",
"id": "28ba6783",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -97,6 +97,9 @@
" obj1_name: ObjectiveProperties(minimize=True),\n",
" obj2_name: ObjectiveProperties(minimize=True),\n",
" },\n",
" parameter_constraints=[\n",
" \"x1 + x2 <= 15.0\", # example of a sum constraint\n",
" ],\n",
")\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"cells": [
{
"cell_type": "markdown",
"id": "1fa263c2",
"id": "e8703de1",
"metadata": {},
"source": [
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-False+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-True+custom_threshold-True+synchrony-batch.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
"<a href=\"https://colab.research.google.com/github/sgbaird/honegumi/blob/main/docs\\generated_notebooks\\ax\\objective-multi+model-FULLYBAYESIAN+custom_gen-True+existing_data-False+sum_constraint-True+order_constraint-False+linear_constraint-False+composition_constraint-False+categorical-True+custom_threshold-True+synchrony-batch.ipynb\"><img alt=\"Open In Colab\" src=\"https://colab.research.google.com/assets/colab-badge.svg\"></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c679be44",
"id": "1d080cbe",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -21,7 +21,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "ec26719c",
"id": "bedfb772",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -97,6 +97,9 @@
" obj1_name: ObjectiveProperties(minimize=True, threshold=25.0),\n",
" obj2_name: ObjectiveProperties(minimize=True, threshold=15.0),\n",
" },\n",
" parameter_constraints=[\n",
" \"x1 + x2 <= 15.0\", # example of a sum constraint\n",
" ],\n",
")\n",
"\n",
"\n",
Expand Down
Loading
Loading