Skip to content

Commit 6a15e3c

Browse files
EslickEslick
authored andcommitted
Run black
1 parent 53fa926 commit 6a15e3c

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

pyomo/contrib/sensitivity_toolbox/pynumero.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def get_dsdp_dfdp(model, theta):
6262
Returns
6363
-------
6464
scipy.sparse.csc_matrix, csc_matrix, ComponentMap, ComponentMap
65-
ds/dp (ns by np), df/dp (1 by np), row map, column map.
65+
ds/dp (ns + np by np), df/dp (1 by np), row map, column map.
6666
The column map maps Pyomo variables p to columns and the
6767
row map maps Pyomo variables s to rows.
6868
"""
@@ -101,10 +101,7 @@ def get_dsdp_dfdp(model, theta):
101101

102102
# Add independent variables to the rows as the end
103103
dsdp = scipy.sparse.vstack(
104-
[
105-
dsdp,
106-
scipy.sparse.identity(len(column_map), format="csc"),
107-
]
104+
[dsdp, scipy.sparse.identity(len(column_map), format="csc")]
108105
)
109106
n = len(row_map)
110107
for p, i in column_map.items():

pyomo/contrib/sensitivity_toolbox/tests/test_pynumero.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def test_dsdp_dfdp_pyomo_nlp(self):
8383
np.testing.assert_almost_equal(dsdp[rmap[m.p1], cmap[m.p1]], 1.0)
8484
np.testing.assert_almost_equal(dsdp[rmap[m.p2], cmap[m.p1]], 0.0)
8585

86-
8786
# if x1 = 2 * p1 and x2 = p2 then
8887
# df/dp1 = 6 p1**2 + p2 = 45.0
8988
# df/dp2 = 3 p2 + p1 = 85.0

0 commit comments

Comments
 (0)