Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Rémi Delaporte-Mathurin <[email protected]>
  • Loading branch information
jhdark and RemDelaporteMathurin authored Jan 14, 2025
1 parent b548f50 commit bbeb1f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/userguide/stepsize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ This will modify the stepsize as needed.

.. note::

When defining the simulation, if your stepsize is constant, you can define it simply by providing it as a `float`` or `int`:
If your stepsize is constant, you can define it simply as a ``float`` or ``int``:

.. testcode::

Expand Down
3 changes: 2 additions & 1 deletion test/unit/test_stepsize.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_hit_stepsize_max_with_t_stop(time):
assert my_stepsize.adaptive_stepsize["max_stepsize"](time) == max_stepsize(time)


@pytest.mark.parametrize("time", [1, 2.5, "coucou", np.array([1, 2]), [1, 2]])
@pytest.mark.parametrize("time", [1, 2.5, festim.Stepsize(1.0),"coucou", np.array([1, 2]), [1, 2]])
def test_stepsize_as_value(time):
"""
A test to check that users can pass an int or float to the dt attribute when
Expand All @@ -143,6 +143,7 @@ def test_stepsize_as_value(time):

if isinstance(time, (int, float, festim.Stepsize)):
my_model.dt = time
assert isinstance(my_model.dt, festim.Stepsize)
else:
with pytest.raises(
TypeError, match="dt must be an int, float, or festim.Stepsize"
Expand Down

0 comments on commit bbeb1f9

Please sign in to comment.