Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Commit bf1ed35

Browse files
committed
Update version and add pip installation instructions, adjust test tolerance for new NumPy
1 parent 218065c commit bf1ed35

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
trust-constr optimization algorithm from the SciPy project that was originally implemented by [Antonio Horta Ribeiro](https://github.com/antonior92). This is a version of the trust-constr algorithm that does not depend on the rest of SciPy. The only dependency is NumPy. The goal is to have a version of the trust-constr algorithm that can run within the Pyodide environment.
44

5+
# Installation
6+
7+
`pip install trust-constr`
8+
59
# Examples Using trust-constr
610

711
Since the trust-constr algorithm was extracted from the `scipy.optimize` library, it uses the [same interface](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html#scipy.optimize.minimize) as `scipy.optimize.minimize`. The main different is that everything is imported from `trust_constr` rather than from `scipy.optimize`. The other difference is that the only optimization method available is 'trust-const'. The examples below show how to use trust-constr with a variety of different types of constraints.

README.tex.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
trust-constr optimization algorithm from the SciPy project that was originally implemented by [Antonio Horta Ribeiro](https://github.com/antonior92). This is a version of the trust-constr algorithm that does not depend on the rest of SciPy. The only dependency is NumPy. The goal is to have a version of the trust-constr algorithm that can run within the Pyodide environment.
44

5+
# Installation
6+
7+
`pip install trust-constr`
8+
59
# Examples Using trust-constr
610

711
Since the trust-constr algorithm was extracted from the `scipy.optimize` library, it uses the [same interface](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html#scipy.optimize.minimize) as `scipy.optimize.minimize`. The main different is that everything is imported from `trust_constr` rather than from `scipy.optimize`. The other difference is that the only optimization method available is 'trust-const'. The examples below show how to use trust-constr with a variety of different types of constraints.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="trust-constr",
8-
version="0.0.1",
8+
version="1.0.0",
99
description="trust-constr optimization algorithm from the SciPy project.",
1010
long_description=long_description,
1111
long_description_content_type="text/markdown",

tests/test_response_surface.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ def evaluate_response_surface_grad(
6868

6969

7070
@pytest.mark.parametrize(
71-
"data,factorization_method,rtol",
71+
"data,factorization_method,rtol,iter_buffer",
7272
[
73-
(bottle_data_set, "SVDFactorization", 1e-5),
74-
(bottle_data_set, "AugmentedSystem", 1e-5),
75-
(panel_data_set, "SVDFactorization", 1e-5),
76-
(panel_data_set, "AugmentedSystem", 1e-5),
77-
(brake_data_set, "SVDFactorization", 2e-4),
78-
(brake_data_set, "AugmentedSystem", 2e-4),
73+
(bottle_data_set, "SVDFactorization", 1e-5, 10),
74+
(bottle_data_set, "AugmentedSystem", 1e-5, 10),
75+
(panel_data_set, "SVDFactorization", 1e-5, 40), # 10->40 NumPy 1.19.2 -> 1.19.5
76+
(panel_data_set, "AugmentedSystem", 1e-5, 20), # 10->20 NumPy 1.19.2 -> 1.19.5
77+
(brake_data_set, "SVDFactorization", 2e-4, 10),
78+
(brake_data_set, "AugmentedSystem", 2e-4, 10),
7979
],
8080
)
81-
def test_generate_pareto_data(data, factorization_method, rtol):
81+
def test_generate_pareto_data(data, factorization_method, rtol, iter_buffer):
8282
inputs = np.array(data["inputs"])
8383
outputs = np.array(data["outputs"])
8484
y_axis_index = data["y_axis_index"]
@@ -213,7 +213,7 @@ def objective_func_grad(x, index, sign=1.0):
213213

214214
pareto_output_values = np.array(pareto_output_values)
215215

216-
assert total_iterations < baseline_total_iterations + 10
216+
assert total_iterations < baseline_total_iterations + iter_buffer
217217
assert_allclose(pareto_output_values, baseline_pareto_points, rtol=rtol)
218218

219219

0 commit comments

Comments
 (0)