From b1c40f9e82480243b07442bcf1083fee3a1410b7 Mon Sep 17 00:00:00 2001 From: Simon Bowly Date: Fri, 1 Dec 2023 14:46:25 +1100 Subject: [PATCH 1/2] Clean up unstable tests --- docs/source/mods/portfolio.rst | 22 ---------------------- tests/opf/test_solver.py | 1 + 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/docs/source/mods/portfolio.rst b/docs/source/mods/portfolio.rst index 941194b31..7d650e6c8 100644 --- a/docs/source/mods/portfolio.rst +++ b/docs/source/mods/portfolio.rst @@ -131,8 +131,6 @@ from this DataFrame: ... Model has 55 quadratic objective terms ... - Presolved: 1 rows, 10 columns, 10 nonzeros - ... Solution -------- @@ -241,14 +239,10 @@ the following example, which mimics a single-factor model: ... Model has 6 quadratic objective terms ... - Presolved: 1 rows, 3 columns, 3 nonzeros - ... Optimize a model with 30 rows, 32 columns and 67 nonzeros ... Model has 4 quadratic objective terms ... - Presolved: 2 rows, 4 columns, 6 nonzeros - ... The two computed portfolios are the same, up to numerical noise. @@ -301,8 +295,6 @@ portfolio value (130-30 strategy), you can do: ... Model has 55 quadratic objective terms ... - Presolved: 62 rows, 70 columns, 160 nonzeros - ... By incorporating leverage, we now obtain an optimal portfolio with three short positions, totaling about 14% of assets: @@ -356,8 +348,6 @@ optimal portfolio :math:`x`, you can use the keyword parameters ``fees_buy`` ... Model has 55 quadratic objective terms ... - Presolved: 26 rows, 25 columns, 65 nonzeros - ... Transaction fees can be provided either as a constant fee, applying the same amount uniformly to all assets, or as numpy array or pandas Series @@ -413,8 +403,6 @@ trades) keyword parameters as follows: ... Model has 55 quadratic objective terms ... - Presolved: 1 rows, 10 columns, 10 nonzeros - ... Transaction costs can be provided either as a constant value, applying the same cost uniformly to all assets, or as a numpy array or pandas Series, @@ -470,14 +458,10 @@ allocated to each trade: ... Model has 55 quadratic objective terms ... - Presolved: 62 rows, 70 columns, 160 nonzeros - ... Optimize a model with 102 rows, 91 columns and 240 nonzeros ... Model has 55 quadratic objective terms ... - Presolved: 82 rows, 70 columns, 210 nonzeros - ... Comparing the two portfolios ``x_plain``, which has no minimum position constraints set with ``x_minpos``, which defines these constraints, we see that @@ -531,8 +515,6 @@ total number of open positions to three can be achieved as follows: ... Model has 55 quadratic objective terms ... - Presolved: 27 rows, 25 columns, 65 nonzeros - ... The returned solution now suggests to trade only the assets "AA", "DD", and "HH". @@ -595,8 +577,6 @@ the risk-free return rate is 0.25%: ... Model has 55 quadratic objective terms ... - Presolved: 1 rows, 11 columns, 11 nonzeros - ... If a risk-free return rate has been specified, the returned :class:`~gurobi_optimods.portfolio.PortfolioResult` instance's ``x_rf`` @@ -682,8 +662,6 @@ using at most two trades: ... Model has 55 quadratic objective terms ... - Presolved: 37 rows, 43 columns, 125 nonzeros - ... .. doctest:: mod :options: +NORMALIZE_WHITESPACE diff --git a/tests/opf/test_solver.py b/tests/opf/test_solver.py index e88050685..ed44ce5a7 100644 --- a/tests/opf/test_solver.py +++ b/tests/opf/test_solver.py @@ -368,6 +368,7 @@ def test_ac_relax(self): ) +@unittest.skip("unstable") class TestAPIBranchSwitching(unittest.TestCase): def setUp(self): # Modification of case9 where branch switching has an effect From 9254f127445d2cb2774363cf12bee78a8f8c562f Mon Sep 17 00:00:00 2001 From: Simon Bowly Date: Fri, 1 Dec 2023 15:33:55 +1100 Subject: [PATCH 2/2] skip test --- tests/opf/test_internal.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/opf/test_internal.py b/tests/opf/test_internal.py index e202cbf14..fa730db42 100644 --- a/tests/opf/test_internal.py +++ b/tests/opf/test_internal.py @@ -185,6 +185,7 @@ def test_ivopf(self): self.assertLess(abs(solution["branch"][4]["Qt"] + 18.431373), 1e1) +@unittest.skip("varies between versions") class TestFingerprints(unittest.TestCase): # Check model fingerprints for some specific cases. Useful while # refactoring the code, but