Skip to content

Commit 1d6bd48

Browse files
Merge pull request #2844 from pybamm-team/issue-2833-random-tests
Fix random seed on tests
2 parents 7c69f1d + 6f1a384 commit 1d6bd48

File tree

146 files changed

+371
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+371
-186
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@
2929

3030
## Bug fixes
3131

32+
- Fix non-deteministic outcome of some tests in the test suite ([#2844](https://github.com/pybamm-team/PyBaMM/pull/2844))
3233
- Fixed excessive RAM consumption when running multiple simulations ([#2823](https://github.com/pybamm-team/PyBaMM/pull/2823))
34+
- Fixed use of last_state as starting_solution in Simulation.solve() ([#2822](https://github.com/pybamm-team/PyBaMM/pull/2822))
3335
- Fixed a bug where variable bounds could not contain `InputParameters` ([#2795](https://github.com/pybamm-team/PyBaMM/pull/2795))
3436
- Improved `model.latexify()` to have a cleaner and more readable output ([#2764](https://github.com/pybamm-team/PyBaMM/pull/2764))
3537
- Fixed electrolyte conservation in the case of concentration-dependent transference number ([#2758](https://github.com/pybamm-team/PyBaMM/pull/2758))
3638
- Fixed `plot_voltage_components` so that the sum of overpotentials is now equal to the voltage ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740))
37-
- Fixed use of last_state as starting_solution in Simulation.solve() ([#2822](https://github.com/pybamm-team/PyBaMM/pull/2822))
3839

3940
## Optimizations
4041

tests/integration/test_experiments.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#
22
# Test some experiments
33
#
4+
from tests import TestCase
45
import pybamm
56
import numpy as np
67
import unittest
78

89

9-
class TestExperiments(unittest.TestCase):
10+
class TestExperiments(TestCase):
1011
def test_discharge_rest_charge(self):
1112
experiment = pybamm.Experiment(
1213
[

tests/integration/test_models/test_full_battery_models/test_equivalent_circuit/test_thevenin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import pybamm
22
import unittest
33
import tests
4+
from tests import TestCase
45

56

6-
class TestThevenin(unittest.TestCase):
7+
class TestThevenin(TestCase):
78
def test_basic_processing(self):
89
model = pybamm.equivalent_circuit.Thevenin()
910
modeltest = tests.StandardModelTest(model)

tests/integration/test_models/test_full_battery_models/test_lead_acid/test_asymptotics_convergence.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#
22
# Tests for the asymptotic convergence of the simplified models
33
#
4+
from tests import TestCase
45
import pybamm
56

67
import numpy as np
78
import unittest
89

910

10-
class TestAsymptoticConvergence(unittest.TestCase):
11+
class TestAsymptoticConvergence(TestCase):
1112
def test_leading_order_convergence(self):
1213
"""
1314
Check that the leading-order model solution converges linearly in C_e to the

tests/integration/test_models/test_full_battery_models/test_lead_acid/test_compare_basic_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#
22
# Compare basic models with full models
33
#
4+
from tests import TestCase
45
import pybamm
56

67
import numpy as np
78
import unittest
89

910

10-
class TestCompareBasicModels(unittest.TestCase):
11+
class TestCompareBasicModels(TestCase):
1112
def test_compare_full(self):
1213
basic_full = pybamm.lead_acid.BasicFull()
1314
full = pybamm.lead_acid.Full()

tests/integration/test_models/test_full_battery_models/test_lead_acid/test_compare_outputs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#
22
# Tests for the asymptotic convergence of the simplified models
33
#
4+
from tests import TestCase
45
import pybamm
56
import numpy as np
67
import unittest
78
from tests import StandardOutputComparison
89

910

10-
class TestCompareOutputs(unittest.TestCase):
11+
class TestCompareOutputs(TestCase):
1112
def test_compare_averages_asymptotics(self):
1213
"""
1314
Check that the average value of certain variables is constant across submodels

tests/integration/test_models/test_full_battery_models/test_lead_acid/test_full.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#
22
# Tests for the lead-acid Full model
33
#
4+
from tests import TestCase
45
import pybamm
56
import tests
67

78
import unittest
89
import numpy as np
910

1011

11-
class TestLeadAcidFull(unittest.TestCase):
12+
class TestLeadAcidFull(TestCase):
1213
def test_basic_processing(self):
1314
options = {"thermal": "isothermal"}
1415
model = pybamm.lead_acid.Full(options)
@@ -55,7 +56,7 @@ def test_basic_processing_1plus1D(self):
5556
modeltest.test_all(skip_output_tests=True)
5657

5758

58-
class TestLeadAcidFullSurfaceForm(unittest.TestCase):
59+
class TestLeadAcidFullSurfaceForm(TestCase):
5960
def test_basic_processing_differential(self):
6061
options = {"surface form": "differential"}
6162
model = pybamm.lead_acid.Full(options)

tests/integration/test_models/test_full_battery_models/test_lead_acid/test_loqs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#
22
# Tests for the lead-acid LOQS model
33
#
4+
from tests import TestCase
45
import pybamm
56
import tests
67

78
import unittest
89
import numpy as np
910

1011

11-
class TestLOQS(unittest.TestCase):
12+
class TestLOQS(TestCase):
1213
def test_basic_processing(self):
1314
model = pybamm.lead_acid.LOQS()
1415
modeltest = tests.StandardModelTest(model)

tests/integration/test_models/test_full_battery_models/test_lead_acid/test_loqs_surface_form.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#
22
# Tests for the lead-acid LOQS model with capacitance
33
#
4+
from tests import TestCase
45
import pybamm
56
import tests
67

@@ -9,7 +10,7 @@
910
import numpy as np
1011

1112

12-
class TestLeadAcidLoqsSurfaceForm(unittest.TestCase):
13+
class TestLeadAcidLoqsSurfaceForm(TestCase):
1314
def test_basic_processing(self):
1415
options = {"surface form": "algebraic"}
1516
model = pybamm.lead_acid.LOQS(options)

tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_full_side_reactions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#
22
# Tests for the lead-acid Full model
33
#
4+
from tests import TestCase
45
import pybamm
56
import tests
67

78
import unittest
89
import numpy as np
910

1011

11-
class TestLeadAcidFullSideReactions(unittest.TestCase):
12+
class TestLeadAcidFullSideReactions(TestCase):
1213
def test_basic_processing(self):
1314
options = {"hydrolysis": "true"}
1415
model = pybamm.lead_acid.Full(options)

0 commit comments

Comments
 (0)