From 79531014ba0d8fc239fcb63fadee7c62239b947b Mon Sep 17 00:00:00 2001 From: Tianqi Cheng Date: Wed, 11 Oct 2023 15:09:11 -0400 Subject: [PATCH] Oct11 update error msg --- hnn_core/drives.py | 10 +++++++--- hnn_core/tests/test_drives.py | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hnn_core/drives.py b/hnn_core/drives.py index 78c8054b5..834f31a41 100644 --- a/hnn_core/drives.py +++ b/hnn_core/drives.py @@ -38,9 +38,13 @@ def _get_target_properties(weights_ampa, weights_nmda, synaptic_delays, # Distal drives should not target L5 basket cells according to the # canonical Jones model if location == 'distal' and 'L5_basket' in target_populations: - raise ValueError('When adding a distal drive, synaptic weight cannot ' - 'be defined for the L5_basket cell type as this ' - 'connection does not exist. Please delete the L5_basket part from the code.') + raise ValueError('Due to physiological/anatomical constraints, ' + 'a distal drive cannot target L5_basket cell types. ' + 'L5_basket cell types must remain undefined by ' + 'the user in all synaptic weights dictionaries ' + 'for this drive. ' + 'Therefore, please remove the L5_basket entries ' + 'from the corresponding dictionaries.') if isinstance(synaptic_delays, float): delays_by_type = {cell_type: synaptic_delays for cell_type in diff --git a/hnn_core/tests/test_drives.py b/hnn_core/tests/test_drives.py index ca7aea8a5..34bfbb77d 100644 --- a/hnn_core/tests/test_drives.py +++ b/hnn_core/tests/test_drives.py @@ -254,8 +254,8 @@ def test_add_drives(): net.add_evoked_drive('evdist1', mu=10, sigma=1, numspikes=1, location='distal') with pytest.raises(ValueError, - match='When adding a distal drive, synaptic weight ' - 'cannot be defined for the L5_basket cell type'): + match='Due to physiological/anatomical constraints, ' + 'a distal drive cannot target L5_basket cell types. '): net.add_evoked_drive('evdist1', mu=10, sigma=1, numspikes=1, location='distal', weights_ampa={'L5_basket': 1.}, synaptic_delays={'L5_basket': .1})