Skip to content

Commit

Permalink
Cover parameters property in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianusler committed Sep 23, 2024
1 parent 5df719f commit 8b563fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions impedance/tests/test_circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def test_BaseCircuit():
# check initial_guess is loaded in correctly
base_circuit = BaseCircuit(initial_guess)
assert base_circuit.initial_guess == initial_guess
assert base_circuit.parameters is None

# improper input_guess types raise an TypeError
with pytest.raises(TypeError):
Expand Down Expand Up @@ -69,6 +70,8 @@ def test_Randles():
np.array([1.86235717e-02, 1.16804085e-02,
6.27121224e-02, 2.21232935e+02,
1.17171440e+00]), decimal=2)
np.testing.assert_array_equal(randles.parameters, randles.parameters_)


# compare with known impedance predictions
assert np.isclose(randles.predict(np.array([10.0])),
Expand Down Expand Up @@ -193,6 +196,10 @@ def test_CustomCircuit():
circuit=custom_string)
custom_circuit.fit([1, 2, 3], [4, 4, 4])
assert custom_circuit.parameters_[0] == 4
np.testing.assert_array_equal(
custom_circuit.parameters,
custom_circuit.parameters_
)

# space in circuit string
circuit = circuit = 'R0-p(R1, C1)'
Expand Down

0 comments on commit 8b563fa

Please sign in to comment.