Skip to content

Commit

Permalink
MAINT: duck typing?
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmainak committed Mar 16, 2023
1 parent fbc01cd commit 194ca10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions hnn_core/tests/test_dipole.py
Expand Up @@ -45,6 +45,8 @@ def test_dipole(tmpdir, run_hnn_core_fixture):
# Test wrong argument to plot_dipole()
with pytest.raises(TypeError, match='dpl must be an instance of'):
plot_dipole([dipole, 10], show=False)
with pytest.raises(AttributeError, match="object has no attribute 'append"):
plot_dipole(np.array([dipole, dipole]), average=True, show=False)

# Test IO
dipole.write(dpl_out_fname)
Expand Down
2 changes: 1 addition & 1 deletion hnn_core/viz.py
Expand Up @@ -274,7 +274,7 @@ def plot_dipole(dpl, tmin=None, tmax=None, ax=None, layer='agg', decim=None,
_validate_type(this_dpl, Dipole, 'dpl', 'Dipole, list of Dipole')

if average:
dpl = dpl + [average_dipoles(dpl)]
dpl.append(average_dipoles(dpl))

scale_applied = dpl[0].scale_applied

Expand Down

0 comments on commit 194ca10

Please sign in to comment.