-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle non-availability of certain simulators
(e.g. NEST on Windows)
- Loading branch information
Showing
18 changed files
with
257 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
import pytest | ||
|
||
available_modules = {} | ||
|
||
try: | ||
import pyNN.neuron | ||
available_modules["neuron"] = pyNN.neuron | ||
except ImportError: | ||
pass | ||
|
||
try: | ||
import pyNN.nest | ||
available_modules["nest"] = pyNN.nest | ||
except ImportError: | ||
pass | ||
|
||
try: | ||
import pyNN.brian2 | ||
available_modules["brian2"] = pyNN.brian2 | ||
except ImportError: | ||
pass | ||
|
||
|
||
def get_simulator(sim_name): | ||
if sim_name in available_modules: | ||
return available_modules[sim_name] | ||
else: | ||
pytest.skip(f"{sim_name} not available") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.