|
46 | 46 |
|
47 | 47 | os.chdir(constants.NETPYNE_WORKDIR_PATH) |
48 | 48 |
|
49 | | -neuron.nrn_dll_loaded.append(os.path.join(NETPYNE_WORKDIR_PATH, 'mod')) # Avoids to load workspace modfiles twice |
50 | 49 |
|
51 | 50 | class NetPyNEGeppetto: |
52 | 51 |
|
@@ -80,17 +79,6 @@ def __init__(self): |
80 | 79 | if not simulations.local.is_running(): |
81 | 80 | [experiments.set_to_error(e) for e in running_exps] |
82 | 81 |
|
83 | | - # sys.stdin = open(os.path.join(constants.HERE, "stdin.txt"),'r') # FIXES library asking for input to download -- eg lfpykit models |
84 | | - |
85 | | - # from ipykernel import kernelbase |
86 | | - |
87 | | - # def raw_input(self, prompt=''): |
88 | | - # return "y" |
89 | | - # kernelbase.Kernel.raw_input = raw_input |
90 | | - |
91 | | - # from lfpykit.eegmegcalc import NYHeadModel |
92 | | - # NYHeadModel() |
93 | | - |
94 | 82 | def getData(self): |
95 | 83 | return { |
96 | 84 | "metadata": metadata, |
@@ -550,7 +538,7 @@ def importModel(self, modelParameters): |
550 | 538 | # Shouldn't be specific to Import |
551 | 539 | sim.clearAll() |
552 | 540 | try: |
553 | | - loadModMechFiles(modelParameters['compileMod'], modelParameters['modFolder']) |
| 541 | + loadModMechFiles(modelParameters['compileMod'], modelParameters['modFolder'], modelParameters.get("forceRecompile", True)) |
554 | 542 | except Exception: |
555 | 543 | message = "Error while importing/compiling mods" |
556 | 544 | logging.exception(message) |
@@ -592,7 +580,7 @@ def importModel(self, modelParameters): |
592 | 580 | # Only on import or better before every simulation or network instantiation? |
593 | 581 | sim.initialize() |
594 | 582 | return utils.getJSONReply() |
595 | | - except Exception: |
| 583 | + except: |
596 | 584 | message = "Error while importing the NetPyNE model" |
597 | 585 | logging.exception(message) |
598 | 586 | return utils.getJSONError(message, sys.exc_info()) |
@@ -943,10 +931,10 @@ def getAvailableCellTypes(self): |
943 | 931 | cell_types.add(p) |
944 | 932 | return sorted(cell_types) |
945 | 933 |
|
946 | | - def getAvailableRxDSections(self, selectedRegion): |
| 934 | + def getAvailableRxDSections(self, selectedRegion = None): |
947 | 935 | sections = set([]) |
948 | 936 | sections.add('all') |
949 | | - if selectedRegion in self.netParams.rxdParams.regions and self.netParams.rxdParams.regions[selectedRegion].get('cells'): |
| 937 | + if selectedRegion and selectedRegion in self.netParams.rxdParams.regions and self.netParams.rxdParams.regions[selectedRegion].get('cells'): |
950 | 938 | if 'all' in self.netParams.rxdParams.regions[selectedRegion]['cells']: |
951 | 939 | for cellRule in self.netParams.cellParams: |
952 | 940 | for cellSect in self.netParams.cellParams[cellRule]['secs']: |
|
0 commit comments