Skip to content
Snippets Groups Projects
Commit 9f510284 authored by Maximilian Schmidt's avatar Maximilian Schmidt
Browse files

Properly raise a NotImplementedError if trying to use the not yet implemented...

Properly raise a NotImplementedError if trying to use the not yet implemented stabilization procedure and test for this

Exclude parameters with explicit paths from label determination of classes because they might differ between systems
parent 49c2b476
No related branches found
No related tags found
1 merge request!1Add all necessary files for the multi-area model
......@@ -136,7 +136,8 @@ class MultiAreaModel:
self.K = ind
else:
if self.params['connection_params']['K_stable'] is True:
print('Stabilization procedure has to be integrated.')
raise NotImplementedError('Stabilization procedure has '
'to be integrated.')
elif isinstance(self.params['connection_params']['K_stable'], np.ndarray):
raise ValueError("Not supported. Please store the "
"matrix in a file and define the path to the file as "
......@@ -160,7 +161,14 @@ class MultiAreaModel:
self.label = dicthash.generate_hash_from_dict({'params': self.params,
'K': self.K,
'N': self.N,
'structure': self.structure})
'structure': self.structure},
blacklist=[('params', 'fullscale_rates'),
('params',
'connection_params',
'K_stable'),
('params',
'connection_params',
'replace_cc_input_source')])
if isinstance(network_spec, dict):
parameter_fn = os.path.join(base_path,
......
from multiarea_model import MultiAreaModel
import pytest
def test_meanfield():
"""
Test stabilization procedure. Since this algorithm is not
implemented yet, we here test if this properly raises a
NotImplementedError.
"""
network_params = {'connection_params': {'K_stable': True}}
theory_params = {}
with pytest.raises(NotImplementedError):
MultiAreaModel(network_params, theory=True, theory_spec=theory_params)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment