Skip to content

Commit cb5940d

Browse files
committed
fix CI
1 parent cafe83d commit cb5940d

File tree

4 files changed

+40
-10
lines changed

4 files changed

+40
-10
lines changed

.github/workflows/test_hiopbbpy.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,39 @@ jobs:
1414
uses: actions/checkout@v4
1515

1616
- name: Set up Python
17-
uses: actions/setup-python@v4 # Set up Python environment
17+
uses: actions/setup-python@v4
1818
with:
19-
python-version: '3.13'
20-
21-
- name: Set up Conda environment
19+
python-version: "3.13"
20+
21+
- name: Set up Conda
2222
uses: conda-incubator/setup-miniconda@v2
2323
with:
2424
auto-activate-base: true
2525
channels: conda-forge
2626

27-
- name: Install HiOpBBPy and its dependencies
27+
- name: Install IPOPT via conda
28+
run: |
29+
conda init bash
30+
conda install -c conda-forge cyipopt pkg-config
31+
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
32+
33+
- name: Verify cyipopt installation
2834
run: |
35+
source ~/.bashrc
36+
conda activate base
37+
python -c "import cyipopt; print('cyipopt OK')"
38+
39+
- name: Install HiOpBBPy
40+
run: |
41+
source ~/.bashrc
42+
conda activate base
43+
export SKIP_CYIPOPT=1
2944
python -m pip install --upgrade pip
3045
pip install .
3146
3247
- name: Run Tests
3348
run: |
49+
source ~/.bashrc
50+
conda activate base
3451
python src/Drivers/hiopbbpy/BODriverCI.py 10
3552
continue-on-error: false
36-
37-

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ["setuptools", "wheel", "numpy", "smt", "cyipopt"]
2+
requires = ["setuptools", "wheel", "numpy", "smt"]
33
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@
66
'''
77

88
import sys
9+
import os
910
import numpy as np
1011
from setuptools import setup, find_packages
1112

1213

14+
install_requires = ["smt"]
15+
16+
if os.getenv("SKIP_CYIPOPT", "0") != "1":
17+
install_requires.append("cyipopt")
18+
1319
metadata = dict(
1420
name="hiopbbpy",
1521
version="0.0.4",
@@ -19,7 +25,7 @@
1925
license="BSD-3",
2026
packages=find_packages(where="src"),
2127
package_dir={"": "src"},
22-
install_requires=["smt","cyipopt"],
28+
install_requires=install_requires,
2329
python_requires=">=3.9",
2430
zip_safe=False,
2531
url="https://github.com/LLNL/hiop",

src/Drivers/hiopbbpy/BODriverCI.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@
7070
min_obj[prob_type][acq_type] = np.inf
7171
y_opt[prob_type][acq_type] = np.zeros(num_repeat)
7272

73+
options = {
74+
'acquisition_type': acq_type,
75+
'bo_maxiter': 20,
76+
'opt_solver': 'SLSQP', #"SLSQP" "IPOPT"
77+
'solver_options': {
78+
'maxiter': 200
79+
}
80+
}
81+
7382
print("Problem name: ", problem.name)
7483
print("Acquisition type: ", acq_type)
7584

@@ -84,7 +93,7 @@
8493
gp_model.train(x_train, y_train)
8594

8695
# Instantiate and run Bayesian Optimization
87-
bo = BOAlgorithm(gp_model, x_train, y_train, acquisition_type = acq_type) #EI or LCB
96+
bo = BOAlgorithm(gp_model, x_train, y_train, options = options) #EI or LCB
8897
bo.optimize(problem)
8998

9099
# Retrieve optimal objec

0 commit comments

Comments
 (0)