diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..033cb5e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "Ubuntu", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:jammy", + "features": { + "ghcr.io/devcontainers/features/python:1": {} + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "uname -a", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.gitignore b/.gitignore index c590f49..45623de 100644 --- a/.gitignore +++ b/.gitignore @@ -3,12 +3,6 @@ __pycache__/ *.py[cod] *$py.class - - - - - - # Distribution / packaging .Python build/ @@ -105,3 +99,9 @@ venv.bak/ # mypy .mypy_cache/ + +# macos +.DS_Store + +# outputs +outputs/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6ba1afd --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter" + }, + "python.formatting.provider": "none" +} \ No newline at end of file diff --git a/analysis_main.py b/analysis_main.py index 769c9c4..3250ccc 100644 --- a/analysis_main.py +++ b/analysis_main.py @@ -13,31 +13,35 @@ @author: daniel """ +import pdb + +# from burst_generator_inhomogeneous_poisson import inhom_poiss +import shelve + +import matplotlib.pyplot as plt import numpy as np +import pylab from scipy.signal import convolve from scipy.stats import pearsonr from sklearn.preprocessing import normalize -#from burst_generator_inhomogeneous_poisson import inhom_poiss -import shelve -import matplotlib.pyplot as plt -import pylab -import pdb + def tri_filter(signal, kernel_delta): """ kernel_delta width of kernel in datapoints """ - kernel = np.append(np.arange(kernel_delta/2),np.arange(kernel_delta/2,-1,-1)) + kernel = np.append(np.arange(kernel_delta / 2), np.arange(kernel_delta / 2, -1, -1)) # convolve2d has proven PAINFULLY slow for some reason - #signal_conv = convolve2d(signal,kernel,'same') + # signal_conv = convolve2d(signal,kernel,'same') new_signal = [] for x in signal: - new_signal.append(convolve(x, kernel, 'same')) + new_signal.append(convolve(x, kernel, "same")) signal_conv = np.array(new_signal) return signal_conv -def correlate_signals(signal1,signal2): + +def correlate_signals(signal1, signal2): """Correlates two nxm dimensional signals. Correlates sig1n with Sign2n along m and then averages all n correlation coefficients. @@ -48,216 +52,216 @@ def correlate_signals(signal1,signal2): for idx in range(signal1.shape[0]): sig1 = signal1[idx] - pylab.std(signal1[idx]) sig2 = signal2[idx] - pylab.std(signal2[idx]) - #cor = sum(sig1*sig2)/(len(sig1)*pylab.std(sig1)*pylab.std(sig2)) - cor = sum(sig1*sig2)/(np.sqrt(sum(sig1**2))*np.sqrt(sum(sig2**2))) + # cor = sum(sig1*sig2)/(len(sig1)*pylab.std(sig1)*pylab.std(sig2)) + cor = sum(sig1 * sig2) / (np.sqrt(sum(sig1**2)) * np.sqrt(sum(sig2**2))) corrs.append(cor) - + corrs = np.array(corrs) return np.nanmean(corrs) -def avg_dotprod_signals(signal1,signal2): + +def avg_dotprod_signals(signal1, signal2): """Average dot product of signal1 and signal2 excluding silent cells""" - non_silent_sigs = np.unique(np.concatenate((np.argwhere(signal1.any(axis=1)),np.argwhere(signal2.any(axis=1))))) + non_silent_sigs = np.unique(np.concatenate((np.argwhere(signal1.any(axis=1)), np.argwhere(signal2.any(axis=1))))) non_silent_sigs.sort() - product = signal1[non_silent_sigs]*signal2[non_silent_sigs] + product = signal1[non_silent_sigs] * signal2[non_silent_sigs] prod_sum = product.sum(axis=1) avg_dot_product = prod_sum.mean() return avg_dot_product + def ndp_signals(signal1, signal2): - #pdb.set_trace() + # pdb.set_trace() dotproduct = (signal1 * signal2).sum() - #pdb.set_trace() - normalization = np.sqrt((signal1*signal1).sum())*np.sqrt((signal2*signal2).sum()) - #pdb.set_trace() - return dotproduct/normalization + # pdb.set_trace() + normalization = np.sqrt((signal1 * signal1).sum()) * np.sqrt((signal2 * signal2).sum()) + # pdb.set_trace() + return dotproduct / normalization + def ndp_signals_tresolved(signal1, signal2, len_bin): pdb.set_trace() - signal1 = np.reshape(signal1[:,0:int(len_bin*int(signal1.shape[1]/len_bin))], (signal1.shape[0],int(signal1.shape[1]/len_bin),len_bin)) + signal1 = np.reshape(signal1[:, 0 : int(len_bin * int(signal1.shape[1] / len_bin))], (signal1.shape[0], int(signal1.shape[1] / len_bin), len_bin)) signal1 = signal1.sum(axis=2) pdb.set_trace() - signal2 = np.reshape(signal2[:,0:int(len_bin*int(signal2.shape[1]/len_bin))], (signal2.shape[0],int(signal2.shape[1]/len_bin),len_bin)) + signal2 = np.reshape(signal2[:, 0 : int(len_bin * int(signal2.shape[1] / len_bin))], (signal2.shape[0], int(signal2.shape[1] / len_bin), len_bin)) signal2 = signal2.sum(axis=2) pdb.set_trace() dotproduct = (signal1 * signal2).sum(axis=0) pdb.set_trace() - normalization = np.sqrt((signal1*signal1).sum(axis=0))*np.sqrt((signal2*signal2).sum(axis=0)) - - return dotproduct/normalization + normalization = np.sqrt((signal1 * signal1).sum(axis=0)) * np.sqrt((signal2 * signal2).sum(axis=0)) + + return dotproduct / normalization + -def avg_dotprod_signals_tbinned(signal1,signal2, len_bin = 1000): +def avg_dotprod_signals_tbinned(signal1, signal2, len_bin=1000): """Average dot product of signal1 and signal2""" # Normalize every time bin invididually - - signal1 = np.reshape(signal1[:,0:int((signal1.shape[1]/len_bin)*len_bin)], - (signal1.shape[0], signal1.shape[1]/len_bin,len_bin), len_bin) - signal1 = signal1[:,0:5,:] - signal2 = np.reshape(signal2[:,0:int((signal2.shape[1]/len_bin)*len_bin)], - (signal2.shape[0], signal2.shape[1]/len_bin,len_bin), len_bin) - signal2 = signal2[:,0:5,:] + + signal1 = np.reshape(signal1[:, 0 : int((signal1.shape[1] / len_bin) * len_bin)], (signal1.shape[0], signal1.shape[1] / len_bin, len_bin), len_bin) + signal1 = signal1[:, 0:5, :] + signal2 = np.reshape(signal2[:, 0 : int((signal2.shape[1] / len_bin) * len_bin)], (signal2.shape[0], signal2.shape[1] / len_bin, len_bin), len_bin) + signal2 = signal2[:, 0:5, :] sig1 = [] for x in signal1: - sig1.append(normalize(x,axis=1)) + sig1.append(normalize(x, axis=1)) signal1 = np.array(sig1) - + sig2 = [] for x in signal2: sig2.append(normalize(x, axis=1)) signal2 = np.array(sig2) - product = signal1*signal2 + product = signal1 * signal2 prod_sum = product.sum(axis=2) silent_sigs = np.argwhere(np.logical_and(np.invert(signal1.any(axis=2)), np.invert(signal2.any(axis=2)))) for x in silent_sigs: - prod_sum[x[0],x[1]] = np.NaN + prod_sum[x[0], x[1]] = np.NaN avg_dot_product = np.nanmean(prod_sum, axis=0) return avg_dot_product + def time_stamps_to_signal(time_stamps, dt_signal, t_start, t_stop): """Convert an array of timestamps to a signal where 0 is absence and 1 is presence of spikes """ # Construct a zero array with size corresponding to desired output signal - sig = np.zeros((np.shape(time_stamps)[0],int((t_stop-t_start)/dt_signal))) + sig = np.zeros((np.shape(time_stamps)[0], int((t_stop - t_start) / dt_signal))) # Find the indices where spikes occured according to time_stamps time_idc = [] for x in time_stamps: curr_idc = [] if np.any(x): for y in x: - curr_idc.append((y-t_start)/ dt_signal) + curr_idc.append((y - t_start) / dt_signal) time_idc.append(curr_idc) - + # Set the spike indices to 1 try: for sig_idx, idc in enumerate(time_idc): - sig[sig_idx,np.array(idc,dtype=np.int)] = 1 + sig[sig_idx, np.array(idc, dtype=np.int)] = 1 except: - for sig_idx, idc in enumerate(time_idc): - sig[sig_idx,np.array(idc,dtype=np.int)-1] = 1 + sig[sig_idx, np.array(idc, dtype=np.int) - 1] = 1 return sig -def population_similarity_measure_ob(signal1,signal2, len_bin): - signal1 = np.reshape(signal1[:,0:int((signal1.shape[1]/len_bin)*len_bin)], - (signal1.shape[0], signal1.shape[1]/len_bin,len_bin), len_bin) + +def population_similarity_measure_ob(signal1, signal2, len_bin): + signal1 = np.reshape(signal1[:, 0 : int((signal1.shape[1] / len_bin) * len_bin)], (signal1.shape[0], signal1.shape[1] / len_bin, len_bin), len_bin) signal1 = signal1.mean(axis=2) - signal2 = np.reshape(signal2[:,0:int((signal2.shape[1]/len_bin)*len_bin)], - (signal2.shape[0], signal2.shape[1]/len_bin,len_bin), len_bin) + signal2 = np.reshape(signal2[:, 0 : int((signal2.shape[1] / len_bin) * len_bin)], (signal2.shape[0], signal2.shape[1] / len_bin, len_bin), len_bin) signal2 = signal2.mean(axis=2) - #Normalize + # Normalize signal1 = normalize(signal1, axis=0) signal2 = normalize(signal2, axis=0) - product = signal1*signal2 + product = signal1 * signal2 prod_sum = product.sum(axis=0) return prod_sum.mean() -def similarity_measure_leutgeb_BUGGY(signal1,signal2, len_bin): - """Oriented on the """ - signal1 = np.reshape(signal1[:,0:int((signal1.shape[1]/len_bin)*len_bin)], - (signal1.shape[0], signal1.shape[1]/len_bin,len_bin), len_bin) + +def similarity_measure_leutgeb_BUGGY(signal1, signal2, len_bin): + """Oriented on the""" + signal1 = np.reshape(signal1[:, 0 : int((signal1.shape[1] / len_bin) * len_bin)], (signal1.shape[0], signal1.shape[1] / len_bin, len_bin), len_bin) signal1 = signal1.sum(axis=2) - signal2 = np.reshape(signal2[:,0:int((signal2.shape[1]/len_bin)*len_bin)], - (signal2.shape[0], signal2.shape[1]/len_bin,len_bin), len_bin) + signal2 = np.reshape(signal2[:, 0 : int((signal2.shape[1] / len_bin) * len_bin)], (signal2.shape[0], signal2.shape[1] / len_bin, len_bin), len_bin) signal2 = signal2.sum(axis=2) corr_vector = [] for x in range(signal1.shape[1]): - corr_vector.append(pearsonr(signal1[:,x], signal2[:,x])[0]) + corr_vector.append(pearsonr(signal1[:, x], signal2[:, x])[0]) return np.array(corr_vector) -def similarity_measure_leutgeb(signal1,signal2, len_bin): + +def similarity_measure_leutgeb(signal1, signal2, len_bin): pdb.set_trace() - signal1 = np.reshape(signal1[:,0:int(len_bin*int(signal1.shape[1]/len_bin))], (signal1.shape[0],int(signal1.shape[1]/len_bin),len_bin)) + signal1 = np.reshape(signal1[:, 0 : int(len_bin * int(signal1.shape[1] / len_bin))], (signal1.shape[0], int(signal1.shape[1] / len_bin), len_bin)) signal1 = signal1.sum(axis=2) pdb.set_trace() - signal2 = np.reshape(signal2[:,0:int(len_bin*int(signal2.shape[1]/len_bin))], (signal2.shape[0],int(signal2.shape[1]/len_bin),len_bin)) + signal2 = np.reshape(signal2[:, 0 : int(len_bin * int(signal2.shape[1] / len_bin))], (signal2.shape[0], int(signal2.shape[1] / len_bin), len_bin)) signal2 = signal2.sum(axis=2) pdb.set_trace() corr_vector = [] for x in range(signal1.shape[1]): - corr_vector.append(pearsonr(signal1[:,x], signal2[:,x])[0]) + corr_vector.append(pearsonr(signal1[:, x], signal2[:, x])[0]) pdb.set_trace() return np.array(corr_vector) + def sqrt_diff(signal1, signal2, len_bin): - signal1 = np.reshape(signal1[:,0:int((signal1.shape[1]/len_bin)*len_bin)], - (signal1.shape[0], signal1.shape[1]/len_bin,len_bin), len_bin) - - signal2 = np.reshape(signal2[:,0:int((signal2.shape[1]/len_bin)*len_bin)], - (signal2.shape[0], signal2.shape[1]/len_bin,len_bin), len_bin) - - subtr = np.sqrt((signal1 - signal2)**2) - subtr_sum = subtr.sum(axis = 2).sum(axis=0) + signal1 = np.reshape(signal1[:, 0 : int((signal1.shape[1] / len_bin) * len_bin)], (signal1.shape[0], signal1.shape[1] / len_bin, len_bin), len_bin) + + signal2 = np.reshape(signal2[:, 0 : int((signal2.shape[1] / len_bin) * len_bin)], (signal2.shape[0], signal2.shape[1] / len_bin, len_bin), len_bin) + + subtr = np.sqrt((signal1 - signal2) ** 2) + subtr_sum = subtr.sum(axis=2).sum(axis=0) print(subtr_sum) return subtr_sum + def sqrt_diff_norm_TRESOLVED(signal1, signal2, len_bin): - signal1 = np.reshape(signal1[:,0:int((signal1.shape[1]/len_bin)*len_bin)], - (signal1.shape[0], signal1.shape[1]/len_bin,len_bin), len_bin) + signal1 = np.reshape(signal1[:, 0 : int((signal1.shape[1] / len_bin) * len_bin)], (signal1.shape[0], signal1.shape[1] / len_bin, len_bin), len_bin) - signal2 = np.reshape(signal2[:,0:int((signal2.shape[1]/len_bin)*len_bin)], - (signal2.shape[0], signal2.shape[1]/len_bin,len_bin), len_bin) + signal2 = np.reshape(signal2[:, 0 : int((signal2.shape[1] / len_bin) * len_bin)], (signal2.shape[0], signal2.shape[1] / len_bin, len_bin), len_bin) total_spikes = signal1.sum(axis=2).sum(axis=0) + signal1.sum(axis=2).sum(axis=0) - subtr = np.sqrt((signal1 - signal2)**2) - subtr_sum = subtr.sum(axis = 2).sum(axis=0) / total_spikes + subtr = np.sqrt((signal1 - signal2) ** 2) + subtr_sum = subtr.sum(axis=2).sum(axis=0) / total_spikes print(subtr_sum) return subtr_sum + def coactivity(signal1, signal2): - coactive = (np.array(signal1 >0) * np.array(signal2 > 0)).sum() - total_active = np.logical_or(np.array(signal1 >0), np.array(signal2 > 0)).sum() - return coactive/float(total_active) + coactive = (np.array(signal1 > 0) * np.array(signal2 > 0)).sum() + total_active = np.logical_or(np.array(signal1 > 0), np.array(signal2 > 0)).sum() + return coactive / float(total_active) + def overlap(signal1, signal2): - total_overlap = ((signal1 > 0) == (signal2 >0)).sum() + total_overlap = ((signal1 > 0) == (signal2 > 0)).sum() return total_overlap / float(len(signal1)) + def sqrt_diff_norm(signal1, signal2, len_bin): total_spikes = signal1.sum() + signal2.sum() - subtr = np.sqrt((signal1 - signal2)**2).sum() - return subtr/total_spikes + subtr = np.sqrt((signal1 - signal2) ** 2).sum() + return subtr / total_spikes + def inner_pearsonr_BUGGY(signal1, len_bin): - signal1 = np.reshape(signal1[:,0:int((signal1.shape[1]/len_bin)*len_bin)], - (signal1.shape[0], signal1.shape[1]/len_bin,len_bin), len_bin) + signal1 = np.reshape(signal1[:, 0 : int((signal1.shape[1] / len_bin) * len_bin)], (signal1.shape[0], signal1.shape[1] / len_bin, len_bin), len_bin) return signal1 signal1 = signal1.sum(axis=2) corr_vector = [] for x in range(signal1.shape[1]): - corr_vector.append(pearsonr(signal1[:,0], signal1[:,x])[0]) + corr_vector.append(pearsonr(signal1[:, 0], signal1[:, x])[0]) return corr_vector + def inner_pearsonr(signal1, len_bin): - signal1 = np.reshape(signal1, (signal1.shape[0],signal1.shape[1]/len_bin,len_bin)) + signal1 = np.reshape(signal1, (signal1.shape[0], signal1.shape[1] / len_bin, len_bin)) signal1 = signal1.sum(axis=2) corr_vector = [] for x in range(signal1.shape[1]): - corr_vector.append(pearsonr(signal1[:,0], signal1[:,x])[0]) + corr_vector.append(pearsonr(signal1[:, 0], signal1[:, x])[0]) return corr_vector - -if __name__ == '__main__': + +if __name__ == "__main__": temporal_patterns = inhom_poiss() - time_sig = time_stamps_to_signal(temporal_patterns, - dt_signal=0.1, - t_start=0, - t_stop=1000) + time_sig = time_stamps_to_signal(temporal_patterns, dt_signal=0.1, t_start=0, t_stop=1000) diff --git a/intrinsic_properties.png b/intrinsic_properties.png new file mode 100644 index 0000000..e5d8135 Binary files /dev/null and b/intrinsic_properties.png differ diff --git a/intrinsic_properties.py b/intrinsic_properties.py index 2cb4fe9..ebdf294 100644 --- a/intrinsic_properties.py +++ b/intrinsic_properties.py @@ -5,23 +5,22 @@ @author: daniel """ -from neuron import h, gui -import os -import numpy as np -from granulecell import GranuleCell -from mossycell import MossyCell -from basketcell import BasketCell -from hippcell import HippCell import matplotlib.pyplot as plt +import numpy as np +from neuron import h + +h.load_file("stdrun.hoc") -dll_files = ["C:\\Users\\DanielM\\Repos\\models_dentate\\dentate_gyrus_Santhakumar2005_and_Yim_patterns\\dentategyrusnet2005\\nrnmech.dll", - "C:\\Users\\daniel\\repos\\nrnmech.dll", - "C:\\Users\\Daniel\\repos\\dentate_gyrus_Santhakumar2005_and_Yim_patterns\\dentategyrusnet2005\\nrnmech.dll"] -for x in dll_files: - if os.path.isfile(x): - dll_dir = x -print("DLL loaded from: " + str(dll_dir)) -h.nrn_load_dll(dll_dir) +from pydentate import BasketCell, GranuleCell, HippCell, MossyCell + +# dll_files = ["C:\\Users\\DanielM\\Repos\\models_dentate\\dentate_gyrus_Santhakumar2005_and_Yim_patterns\\dentategyrusnet2005\\nrnmech.dll", +# "C:\\Users\\daniel\\repos\\nrnmech.dll", +# "C:\\Users\\Daniel\\repos\\dentate_gyrus_Santhakumar2005_and_Yim_patterns\\dentategyrusnet2005\\nrnmech.dll"] +# for x in dll_files: +# if os.path.isfile(x): +# dll_dir = x +# print("DLL loaded from: " + str(dll_dir)) +h.nrn_load_dll("./pydentate/x86_64/.libs/libnrnmech.so") current_steps = np.arange(0, 0.6, 0.025) gc_voltages = [] @@ -35,7 +34,6 @@ hc_apcs = [] for x in current_steps: - gc = GranuleCell() mc = MossyCell() bc = BasketCell() @@ -61,7 +59,7 @@ h.cvode.active(0) dt = 0.1 - h.steps_per_ms = 1.0/dt + h.steps_per_ms = 1.0 / dt h.tstop = 1500 h.finitialize(-60) h.t = -2000 @@ -69,7 +67,7 @@ h.dt = 10 while h.t < -100: h.fadvance() - print(h.t) + # print(h.t) h.secondorder = 2 h.t = 0 @@ -85,29 +83,33 @@ mc_voltages.append(np.array(mc_rec)) bc_voltages.append(np.array(bc_rec)) hc_voltages.append(np.array(hc_rec)) - + gc_apcs.append(gc_apc_curr.n / 0.5) mc_apcs.append(mc_apc_curr.n / 0.5) bc_apcs.append(bc_apc_curr.n / 0.5) hc_apcs.append(hc_apc_curr.n / 0.5) -plt.figure() -plt.plot(current_steps*1000, gc_apcs, marker = 'o') -plt.title("GC F-I Curve") -plt.xlabel("Current Injection (pA)") -plt.ylabel("Frequency (Hz)") -plt.figure() -plt.plot(current_steps*1000, mc_apcs, marker = 'o') -plt.title("MC F-I Curve") -plt.xlabel("Current Injection (pA)") -plt.ylabel("Frequency (Hz)") -plt.figure() -plt.plot(current_steps*1000, bc_apcs, marker = 'o') -plt.title("BC F-I Curve") -plt.xlabel("Current Injection (pA)") -plt.ylabel("Frequency (Hz)") -plt.figure() -plt.plot(current_steps*1000, hc_apcs, marker = 'o') -plt.title("HC F-I Curve") -plt.xlabel("Current Injection (pA)") -plt.ylabel("Frequency (Hz)") +fig, axes = plt.subplots(nrows=4, ncols=1, figsize=(8.27, 11.69)) + +axes[0].plot(current_steps * 1000, gc_apcs, marker="o") +axes[0].set_title("GC F-I Curve") +axes[0].set_xlabel("Current Injection (pA)") +axes[0].set_ylabel("Frequency (Hz)") + +axes[1].plot(current_steps * 1000, mc_apcs, marker="o") +axes[1].set_title("MC F-I Curve") +axes[1].set_xlabel("Current Injection (pA)") +axes[1].set_ylabel("Frequency (Hz)") + +axes[2].plot(current_steps * 1000, bc_apcs, marker="o") +axes[2].set_title("BC F-I Curve") +axes[2].set_xlabel("Current Injection (pA)") +axes[2].set_ylabel("Frequency (Hz)") + +axes[3].plot(current_steps * 1000, hc_apcs, marker="o") +axes[3].set_title("HC F-I Curve") +axes[3].set_xlabel("Current Injection (pA)") +axes[3].set_ylabel("Frequency (Hz)") + +fig.tight_layout() +fig.savefig("intrinsic_properties.png") diff --git a/mechs/gskch.mod b/mechs/gskch.mod index 67a781a..a771c33 100644 --- a/mechs/gskch.mod +++ b/mechs/gskch.mod @@ -67,9 +67,7 @@ PROCEDURE state() { :Computes state variable q at current v and dt. cai = ncai + lcai + tcai rate(cai) q = q + (qinf-q) * qexp - VERBATIM - return 0; - ENDVERBATIM + } LOCAL q10 diff --git a/mechs/hyperde3.mod b/mechs/hyperde3.mod index dc0e40d..832c76e 100644 --- a/mechs/hyperde3.mod +++ b/mechs/hyperde3.mod @@ -102,9 +102,6 @@ INITIAL { hys = hysinf hyhtf = hyhtfinf hyhts = hyhtsinf - VERBATIM - return 0; - ENDVERBATIM } ? states @@ -116,9 +113,6 @@ PROCEDURE states() { :Computes state variables m, h, and n hyhtf = hyhtf + hyhtfexp*(hyhtfinf-hyhtf) hyhts = hyhts + hyhtsexp*(hyhtsinf-hyhts) - VERBATIM - return 0; - ENDVERBATIM } LOCAL q10 diff --git a/mechs/ichan2.mod b/mechs/ichan2.mod index 4d79f53..536d4f8 100644 --- a/mechs/ichan2.mod +++ b/mechs/ichan2.mod @@ -89,10 +89,7 @@ INITIAL { h = hinf nf = nfinf ns = nsinf - - VERBATIM - return 0; - ENDVERBATIM + } ? states @@ -102,9 +99,7 @@ PROCEDURE states() { :Computes state variables m, h, and n h = h + hexp*(hinf-h) nf = nf + nfexp*(nfinf-nf) ns = ns + nsexp*(nsinf-ns) - VERBATIM - return 0; - ENDVERBATIM + } LOCAL q10 diff --git a/mechs/nca.mod b/mechs/nca.mod index 701923e..070761b 100644 --- a/mechs/nca.mod +++ b/mechs/nca.mod @@ -68,9 +68,7 @@ PROCEDURE states() { :Computes state variables m, h, and n trates(v) : at the current v and dt. c = c + cexp*(cinf-c) d = d + dexp*(dinf-d) - VERBATIM - return 0; - ENDVERBATIM + } LOCAL q10 diff --git a/ouropy/genconnection.py b/ouropy/genconnection.py index 0c5a433..ee5df69 100644 --- a/ouropy/genconnection.py +++ b/ouropy/genconnection.py @@ -1026,7 +1026,7 @@ def write_aps(self, directory='', fname=''): directory = os.getcwd() if not os.path.isdir(directory): os.mkdir(directory) - path = directory + '\\' + fname + '.npz' + path = os.path.join(directory, f'{fname}.npz') try: ap_list = [x[0].as_numpy() for x in self.ap_counters] except: diff --git a/ouropy/gennetwork.py b/ouropy/gennetwork.py index 1f7e0b7..5e55be6 100644 --- a/ouropy/gennetwork.py +++ b/ouropy/gennetwork.py @@ -6,15 +6,16 @@ @author: DanielM """ -from neuron import h -import random -import numpy as np -import matplotlib.pyplot as plt import math -import time import os +import random import shelve +import time + +import matplotlib.pyplot as plt +import numpy as np import scipy.stats as stats +from neuron import h class GenNetwork(object): @@ -97,7 +98,7 @@ def mk_population(self, cell_type, n_cells): """ - if not hasattr(self, 'populations'): + if not hasattr(self, "populations"): self.populations = [] self.populations.append(Population(cell_type, n_cells, self)) @@ -117,7 +118,7 @@ def set_numpy_seed(self, seed): return np.random.seed def run_network(self, tstop=1000, dt=1): - raise NotImplemented("run_network is not implemented yet") + raise NotImplementedError("run_network is not implemented yet") h.tstop = tstop h.run() @@ -136,10 +137,9 @@ def plot_aps(self, time=200): if not np.array(cells[0]).any(): cells[0] = np.array([0], dtype=float) - plt.subplot(4, 1, idx+1) + plt.subplot(4, 1, idx + 1) plt.eventplot(cells) - plt.ylabel(str(pop) + '\n' + str(pop.perc_active_cells())[0:4] + - '% active') + plt.ylabel(str(pop) + "\n" + str(pop.perc_active_cells())[0:4] + "% active") plt.xlim((0, time)) plt.xlabel("time (ms)") return fig @@ -148,24 +148,21 @@ def save_ap_fig(self, fig, directory=None, file_name=None): if not directory: directory = os.getcwd() if not file_name: - loc_time_str = '_'.join(time.asctime(time.localtime()).split(' ')) - file_name = str(self) + '_' + loc_time_str + loc_time_str = "_".join(time.asctime(time.localtime()).split(" ")) + file_name = str(self) + "_" + loc_time_str if not os.path.isdir(directory): os.mkdir(directory) - full_file_path = directory + "\\" + file_name + full_file_path = os.path.join(directory, file_name) if os.path.isfile(full_file_path): - raise ValueError("The file already exists.\n" + - "shelve_network does not overwrite files.") + raise ValueError("The file already exists.\n" + "shelve_network does not overwrite files.") - fig.savefig(full_file_path + ".pdf", dpi=300, format='pdf') - fig.savefig(full_file_path + ".eps", dpi=300, format='eps') + fig.savefig(full_file_path + ".pdf", dpi=300, format="pdf") + fig.savefig(full_file_path + ".eps", dpi=300, format="eps") plt.close() def get_properties(self): - properties = {'populations': [x.get_properties() - for x in self.populations], - 'init_params': self.init_params} + properties = {"populations": [x.get_properties() for x in self.populations], "init_params": self.init_params} return properties def shelve_network(self, directory=None, file_name=None): @@ -176,26 +173,40 @@ def shelve_network(self, directory=None, file_name=None): if not directory: directory = os.getcwd() if not file_name: - loc_time_str = '_'.join(time.asctime(time.localtime()).split(' ')) - file_name = str(self) + '_' + loc_time_str + loc_time_str = "_".join(time.asctime(time.localtime()).split(" ")) + file_name = str(self) + "_" + loc_time_str if not os.path.isdir(directory): os.mkdir(directory) - full_file_path = directory + "\\" + file_name + '.pydd' + full_file_path = os.path.join(directory, file_name + ".pydd") if os.path.isfile(full_file_path): - raise ValueError("The file already exists.\n" + - "shelve_network does not overwrite files.") + raise ValueError("The file already exists.\n" + "shelve_network does not overwrite files.") - curr_shelve = shelve.open(full_file_path, flag='n') + curr_shelve = shelve.open(full_file_path, flag="n") # BUG with paradigm_frequency_inhibition at 1Hz, possibly too long sim? curr_shelve[str(self)] = self.get_properties() curr_shelve.close() - def __str__(self): - return str(self.__class__).split("'")[1] + def shelve_aps(self, directory=None, file_name=None): + if not directory: + directory = os.getcwd() + if not file_name: + loc_time_str = "_".join(time.asctime(time.localtime()).split(" ")) + file_name = str(self) + "_" + loc_time_str + if not os.path.isdir(directory): + os.mkdir(directory) + full_file_path = os.path.join(directory, file_name + ".pydd") + if os.path.isfile(full_file_path): + raise ValueError("The file already exists.\n" + "shelve_aps does not overwrite files.") + curr_shelve = shelve.open(full_file_path, flag="n") + # BUG with paradigm_frequency_inhibition at 1Hz, possibly too long sim? + curr_shelve["populations"] = [[(i, timestamps) for i, timestamps in enumerate(p.get_timestamps()) if len(timestamps) > 0] for p in self.populations] + curr_shelve.close() + def __str__(self): + return str(self.__class__).split("'")[1] class GenConnection(object): @@ -204,36 +215,30 @@ def __init__(self): def get_description(self): """Return a descriptive string for the connection""" - name = self.pre_pop.name + ' to ' + self.post_pop.name + '\n' - pre_cell_targets = '\n'.join([str(x) for x in self.pre_cell_targets]) + name = self.pre_pop.name + " to " + self.post_pop.name + "\n" + pre_cell_targets = "\n".join([str(x) for x in self.pre_cell_targets]) return name + pre_cell_targets def get_name(self): if type(self.pre_pop) == str: - return self.pre_pop + ' to ' + str(self.post_pop) + return self.pre_pop + " to " + str(self.post_pop) else: - return str(self.pre_pop) + ' to ' + str(self.post_pop) + return str(self.pre_pop) + " to " + str(self.post_pop) def get_properties(self): """Get the and make them suitable for pickling""" - properties = {'name': self.get_name(), - 'init_parameters': self.init_parameters, - 'pre_cell_targets': self.pre_cell_targets} - properties['init_parameters']['post_pop'] = str(properties['init_parameters']['post_pop']) - properties['init_parameters']['self'] = str(properties['init_parameters']['self']) + properties = {"name": self.get_name(), "init_parameters": self.init_parameters, "pre_cell_targets": self.pre_cell_targets} + properties["init_parameters"]["post_pop"] = str(properties["init_parameters"]["post_pop"]) + properties["init_parameters"]["self"] = str(properties["init_parameters"]["self"]) try: - properties['init_parameters']['pre_pop'] = str(properties['init_parameters']['pre_pop']) + properties["init_parameters"]["pre_pop"] = str(properties["init_parameters"]["pre_pop"]) except: pass return {self.get_name(): properties} class tmgsynConnection(GenConnection): - - def __init__(self, pre_pop, post_pop, - target_pool, target_segs, divergence, - tau_1, tau_facil, U, tau_rec, e, thr, delay, weight, - rec_cond=False): + def __init__(self, pre_pop, post_pop, target_pool, target_segs, divergence, tau_1, tau_facil, U, tau_rec, e, thr, delay, weight, rec_cond=False): """Create a connection with tmgsyn as published by Tsodyks, Pawelzik & Markram, 1998. The tmgsyn is a dynamic three state implicit resource synapse model. @@ -296,10 +301,8 @@ def __init__(self, pre_pop, post_pop, self.post_pop = post_pop pre_pop.add_connection(self) post_pop.add_connection(self) - pre_pop_rad = (np.arange(pre_pop.get_cell_number(), dtype=float) / - pre_pop.get_cell_number()) * (2*np.pi) - post_pop_rad = (np.arange(post_pop.get_cell_number(), dtype=float) / - post_pop.get_cell_number()) * (2*np.pi) + pre_pop_rad = (np.arange(pre_pop.get_cell_number(), dtype=float) / pre_pop.get_cell_number()) * (2 * np.pi) + post_pop_rad = (np.arange(post_pop.get_cell_number(), dtype=float) / post_pop.get_cell_number()) * (2 * np.pi) pre_pop_pos = pos(pre_pop_rad) post_pop_pos = pos(post_pop_rad) @@ -309,19 +312,15 @@ def __init__(self, pre_pop, post_pop, conductances = [] for idx, curr_cell_pos in enumerate(pre_pop_pos): - curr_dist = [] for post_cell_pos in post_pop_pos: curr_dist.append(euclidian_dist(curr_cell_pos, post_cell_pos)) sort_idc = np.argsort(curr_dist) closest_cells = sort_idc[0:target_pool] - picked_cells = np.random.choice(closest_cells, - divergence, - replace=False) + picked_cells = np.random.choice(closest_cells, divergence, replace=False) pre_cell_target.append(picked_cells) for tar_c in picked_cells: - curr_syns = [] curr_netcons = [] curr_conductances = [] @@ -336,9 +335,7 @@ def __init__(self, pre_pop, post_pop, curr_syn.e = e curr_syn.tau_rec = tau_rec curr_syns.append(curr_syn) - curr_netcon = h.NetCon(pre_pop[idx].soma(0.5)._ref_v, - curr_syn, thr, delay, - weight, sec=pre_pop[idx].soma) + curr_netcon = h.NetCon(pre_pop[idx].soma(0.5)._ref_v, curr_syn, thr, delay, weight, sec=pre_pop[idx].soma) curr_gvec = h.Vector() curr_gvec.record(curr_syn._ref_g) curr_conductances.append(curr_gvec) @@ -354,10 +351,7 @@ def __init__(self, pre_pop, post_pop, class tmgsynConnectionExponentialProb(GenConnection): - - def __init__(self, pre_pop, post_pop, - scale, target_segs, divergence, - tau_1, tau_facil, U, tau_rec, e, thr, delay, weight): + def __init__(self, pre_pop, post_pop, scale, target_segs, divergence, tau_1, tau_facil, U, tau_rec, e, thr, delay, weight): """Create a connection with tmgsyn as published by Tsodyks, Pawelzik & Markram, 1998. The tmgsyn is a dynamic three state implicit resource synapse model. @@ -420,10 +414,8 @@ def __init__(self, pre_pop, post_pop, self.post_pop = post_pop pre_pop.add_connection(self) post_pop.add_connection(self) - pre_pop_rad = (np.arange(pre_pop.get_cell_number(), dtype=float) / - pre_pop.get_cell_number()) * (2*np.pi) - post_pop_rad = (np.arange(post_pop.get_cell_number(), dtype=float) / - post_pop.get_cell_number()) * (2*np.pi) + pre_pop_rad = (np.arange(pre_pop.get_cell_number(), dtype=float) / pre_pop.get_cell_number()) * (2 * np.pi) + post_pop_rad = (np.arange(post_pop.get_cell_number(), dtype=float) / post_pop.get_cell_number()) * (2 * np.pi) pre_pop_pos = pos(pre_pop_rad) post_pop_pos = pos(post_pop_rad) @@ -435,20 +427,17 @@ def __init__(self, pre_pop, post_pop, loc = post_pop.get_cell_number() / 2 gauss = stats.expon(loc=0, scale=scale) pdf = gauss.pdf(np.arange(post_pop.get_cell_number())) - pdf = pdf/pdf.sum() + pdf = pdf / pdf.sum() for idx, curr_cell_pos in enumerate(pre_pop_pos): - curr_dist = [] for post_cell_pos in post_pop_pos: curr_dist.append(euclidian_dist(curr_cell_pos, post_cell_pos)) sort_idc = np.argsort(curr_dist) - picked_cells = np.random.choice(sort_idc, divergence, - replace=True, p=pdf) + picked_cells = np.random.choice(sort_idc, divergence, replace=True, p=pdf) pre_cell_target.append(picked_cells) for target_cell in picked_cells: - curr_syns = [] curr_netcons = [] @@ -462,9 +451,7 @@ def __init__(self, pre_pop, post_pop, curr_syn.e = e curr_syn.tau_rec = tau_rec curr_syns.append(curr_syn) - curr_netcon = h.NetCon(pre_pop[idx].soma(0.5)._ref_v, - curr_syn, thr, delay, weight, - sec=pre_pop[idx].soma) + curr_netcon = h.NetCon(pre_pop[idx].soma(0.5)._ref_v, curr_syn, thr, delay, weight, sec=pre_pop[idx].soma) curr_netcons.append(curr_netcon) netcons.append(curr_netcons) synapses.append(curr_syns) @@ -475,10 +462,7 @@ def __init__(self, pre_pop, post_pop, class tmgsynConnection_old(GenConnection): - - def __init__(self, pre_pop, post_pop, - target_pool, target_segs, divergence, - tau_1, tau_facil, U, tau_rec, e, thr, delay, weight): + def __init__(self, pre_pop, post_pop, target_pool, target_segs, divergence, tau_1, tau_facil, U, tau_rec, e, thr, delay, weight): """Create a connection with tmgsyn as published by Tsodyks, Pawelzik & Markram, 1998. The tmgsyn is a dynamic three state implicit resource synapse model. @@ -541,10 +525,8 @@ def __init__(self, pre_pop, post_pop, self.post_pop = post_pop pre_pop.add_connection(self) post_pop.add_connection(self) - pre_pop_rad = (np.arange(pre_pop.get_cell_number(), dtype=float) / - pre_pop.get_cell_number()) * (2*np.pi) - post_pop_rad = (np.arange(post_pop.get_cell_number(), dtype=float) / - post_pop.get_cell_number()) * (2*np.pi) + pre_pop_rad = (np.arange(pre_pop.get_cell_number(), dtype=float) / pre_pop.get_cell_number()) * (2 * np.pi) + post_pop_rad = (np.arange(post_pop.get_cell_number(), dtype=float) / post_pop.get_cell_number()) * (2 * np.pi) pre_pop_pos = pos(pre_pop_rad) post_pop_pos = pos(post_pop_rad) @@ -559,12 +541,9 @@ def __init__(self, pre_pop, post_pop, sort_idc = np.argsort(curr_dist) closest_cells = sort_idc[0:target_pool] - picked_cells = np.random.choice(closest_cells, - divergence, - replace=False) + picked_cells = np.random.choice(closest_cells, divergence, replace=False) pre_cell_target.append(picked_cells) for tar_c in picked_cells: - curr_syns = [] curr_netcons = [] @@ -578,9 +557,7 @@ def __init__(self, pre_pop, post_pop, curr_syn.e = e curr_syn.tau_rec = tau_rec curr_syns.append(curr_syn) - curr_netcon = h.NetCon(pre_pop[idx].soma(0.5)._ref_v, - curr_syn, thr, delay, weight, - sec=pre_pop[idx].soma) + curr_netcon = h.NetCon(pre_pop[idx].soma(0.5)._ref_v, curr_syn, thr, delay, weight, sec=pre_pop[idx].soma) curr_netcons.append(curr_netcon) netcons.append(curr_netcons) synapses.append(curr_syns) @@ -596,21 +573,18 @@ class Exp2SynConnection(GenConnection): synapse. """ - def __init__(self, pre_pop, post_pop, target_pool, target_segs, divergence, - tau1, tau2, e, thr, delay, weight): + def __init__(self, pre_pop, post_pop, target_pool, target_segs, divergence, tau1, tau2, e, thr, delay, weight): """ divergence, tau1, tau2, e, g_max, thr, delay, weight, name = "GC->MC" - """ + """ self.init_parameters = locals() self.pre_pop = pre_pop self.post_pop = post_pop pre_pop.add_connection(self) post_pop.add_connection(self) - pre_pop_rad = (np.arange(pre_pop.get_cell_number(), dtype=float) / - pre_pop.get_cell_number()) * (2*np.pi) - post_pop_rad = (np.arange(post_pop.get_cell_number(), dtype=float) / - post_pop.get_cell_number()) * (2*np.pi) + pre_pop_rad = (np.arange(pre_pop.get_cell_number(), dtype=float) / pre_pop.get_cell_number()) * (2 * np.pi) + post_pop_rad = (np.arange(post_pop.get_cell_number(), dtype=float) / post_pop.get_cell_number()) * (2 * np.pi) self.pre_pop_rad = pre_pop_rad self.post_pop_rad = post_pop_rad @@ -621,16 +595,13 @@ def __init__(self, pre_pop, post_pop, target_pool, target_segs, divergence, netcons = [] for idx, curr_cell_pos in enumerate(pre_pop_pos): - curr_dist = [] for post_cell_pos in post_pop_pos: curr_dist.append(euclidian_dist(curr_cell_pos, post_cell_pos)) sort_idc = np.argsort(curr_dist) closest_cells = sort_idc[0:target_pool] - picked_cells = np.random.choice(closest_cells, - divergence, - replace=False) + picked_cells = np.random.choice(closest_cells, divergence, replace=False) pre_cell_target.append(picked_cells) for tar_c in picked_cells: curr_syns = [] @@ -644,9 +615,7 @@ def __init__(self, pre_pop, post_pop, target_pool, target_segs, divergence, curr_syn.tau2 = tau2 curr_syn.e = e curr_syns.append(curr_syn) - curr_netcon = h.NetCon(pre_pop[idx].soma(0.5)._ref_v, - curr_syn, thr, delay, weight, - sec=pre_pop[idx].soma) + curr_netcon = h.NetCon(pre_pop[idx].soma(0.5)._ref_v, curr_syn, thr, delay, weight, sec=pre_pop[idx].soma) curr_netcons.append(curr_netcon) netcons.append(curr_netcons) synapses.append(curr_syns) @@ -662,8 +631,7 @@ class PerforantPathStimulation(object): synapse. """ - def __init__(self, stim, post_pop, n_targets, target_segs, - tau1, tau2, e, thr, delay, weight): + def __init__(self, stim, post_pop, n_targets, target_segs, tau1, tau2, e, thr, delay, weight): """ divergence, tau1, tau2, e, g_max, thr, delay, weight, name = "GC->MC" @@ -677,8 +645,7 @@ def __init__(self, stim, post_pop, n_targets, target_segs, if type(n_targets) == int: # Select n_targets from post_pop - target_cells = np.random.choice(post_pop.cells, n_targets, - replace=False) + target_cells = np.random.choice(post_pop.cells, n_targets, replace=False) else: target_cells = post_pop.cells[n_targets] @@ -703,9 +670,8 @@ class PerforantPathPoissonStimulation(object): Patterned Perforant Path stimulation as in Yim et al. 2015. uses vecevent.mod -> h.VecStim """ - def __init__(self, post_pop, t_pattern, spat_pattern, target_segs, - tau1, tau2, e, weight): + def __init__(self, post_pop, t_pattern, spat_pattern, target_segs, tau1, tau2, e, weight): post_pop.add_connection(self) synapses = [] netcons = [] @@ -747,16 +713,15 @@ class PerforantPathPoissonTmgsyn(GenConnection): Patterned Perforant Path simulation as in Yim et al. 2015. uses vecevent.mod -> h.VecStim """ - def __init__(self, post_pop, t_pattern, spat_pattern, target_segs, - tau_1, tau_facil, U, tau_rec, e, weight, rec_cond=False): + def __init__(self, post_pop, t_pattern, spat_pattern, target_segs, tau_1, tau_facil, U, tau_rec, e, weight, rec_cond=False): self.init_parameters = locals() post_pop.add_connection(self) synapses = [] netcons = [] t_pattern = list(t_pattern) # nrn does not like np.ndarrays? target_cells = post_pop[spat_pattern] - self.pre_pop = 'Implicit' + self.pre_pop = "Implicit" self.post_pop = post_pop self.vecstim = h.VecStim() self.pattern_vec = h.Vector(t_pattern) @@ -788,8 +753,11 @@ def __init__(self, post_pop, t_pattern, spat_pattern, target_segs, self.pre_cell_targets = np.array(spat_pattern) self.synapses = synapses + """Population ONLY REMAINS IN gennetwork TO KEEP pyDentate RUNNING. THE NEW IMPLEMENTATION OF POPULATION IS IN genpopulation""" + + class Population(object): """This is the model of a generic population. A population is a number of cells of a specific type derived from @@ -876,13 +844,13 @@ def make_cells(self, cell_type, n_cells): Create an empty population within nw and then create 500 granule cells """ - if hasattr(self, 'cell_type'): + if hasattr(self, "cell_type"): if self.cell_type != cell_type: raise TypeError("cell_type inconsistent with population") else: self.cell_type = cell_type - if not hasattr(self, 'cells'): + if not hasattr(self, "cells"): self.cells = [] for x in range(n_cells): @@ -891,12 +859,11 @@ def make_cells(self, cell_type, n_cells): self.cells = np.array(self.cells, dtype=object) def mk_2dtopology(self, width, height): - loc_matrix = np.ndarray(self.get_cell_number(), 2) - aspect = width/height + np.ndarray(self.get_cell_number(), 2) + aspect = width / height n_cells = self.get_cell_number() - n_height = n_cells / aspect + n_cells / aspect n_width - def get_cell_number(self): """Return the number of cells""" @@ -910,7 +877,7 @@ def record_aps(self): self.ap_counters = counters return counters - def plot_aps(self, color='k'): + def plot_aps(self, color="k"): cells = [] for x in self.ap_counters: # as_numpy() doesn't work on windows 10 ??? @@ -926,20 +893,20 @@ def plot_aps(self, color='k'): plt.eventplot(cells, linewidth=2, color=color) - def write_aps(self, directory='', fname=''): + def write_aps(self, directory="", fname=""): if not fname: time_tup = time.gmtime() time_str = time.asctime(time_tup) - time_str = '_'.join(time_str.split(' ')) + time_str = "_".join(time_str.split(" ")) nw_name = self.parent_network.__class__.name pop_name = self.cell_type.name - fname = nw_name + '_' + pop_name + '_' + time_str - fname = fname.replace(':', '-') + fname = nw_name + "_" + pop_name + "_" + time_str + fname = fname.replace(":", "-") if not directory: directory = os.getcwd() if not os.path.isdir(directory): os.mkdir(directory) - path = directory + '\\' + fname + '.npz' + path = os.path.join(directory, f"{fname}.npz") try: ap_list = [x[0].as_numpy() for x in self.ap_counters] except: @@ -960,20 +927,21 @@ def perc_active_cells(self): return (active_counter / float(self.get_cell_number())) * 100 def mk_current_clamp(self, cells, amp=0.3, dur=5, delays=3): - if not hasattr(cells, '__iter__'): - cells = np.random.choice(self.get_cell_number(), cells, - replace=False) + if not hasattr(cells, "__iter__"): + cells = np.random.choice(self.get_cell_number(), cells, replace=False) - if not hasattr(delays, '__iter__'): + if not hasattr(delays, "__iter__"): delays = np.array(delays) for cell in cells: for delay in delays: - self.cells[cell]._current_clamp_soma(amp=amp, dur=dur, - delay=delay) + self.cells[cell]._current_clamp_soma(amp=amp, dur=dur, delay=delay) + def get_timestamps(self): - ap_list = [np.array(x[0]) for x in self.ap_counters] - return ap_list + try: + return [x[0].as_numpy() for x in self.ap_counters] + except: + return [np.array(x[0]) for x in self.ap_counters] def current_clamp_rnd(self, n_cells, amp=0.3, dur=5, delay=3): """DEPRECATE""" @@ -1003,10 +971,7 @@ def add_connection(self, conn): def get_properties(self): """Get the properties of the network""" - try: - ap_time_stamps = [x[0].as_numpy() for x in self.ap_counters] - except: - ap_time_stamps = [np.array(x[0]) for x in self.ap_counters] + ap_time_stamps = self.get_timestamps() ap_numbers = [x[1].n for x in self.ap_counters] try: v_rec = [x.as_numpy() for x in self.VRecords] @@ -1014,21 +979,12 @@ def get_properties(self): except: v_rec = [np.array(x) for x in self.VRecords] vclamp_i = [np.array(x) for x in self.VClamps_i] - properties = {'parent_network': str(self.parent_network), - 'cell_type': self.cell_type.name, - 'cell_number': self.get_cell_number(), - 'connections': [conn.get_properties() - for conn in self.connections], - 'ap_time_stamps': ap_time_stamps, - 'ap_number': ap_numbers, - 'v_records': v_rec, - 'VClamps_i': vclamp_i} - - properties + properties = {"parent_network": str(self.parent_network), "cell_type": self.cell_type.name, "cell_number": self.get_cell_number(), "connections": [conn.get_properties() for conn in self.connections], "ap_time_stamps": ap_time_stamps, "ap_number": ap_numbers, "v_records": v_rec, "VClamps_i": vclamp_i} + return properties def __str__(self): - return self.cell_type.name + 'Population' + return self.cell_type.name + "Population" def __iter__(self): return self @@ -1048,6 +1004,7 @@ def __next__(self): def next(self): return self.__next__() + # HELPERS def pos(rad): """ @@ -1065,5 +1022,5 @@ def pos(rad): def euclidian_dist(p1, p2): - """ p1 and p2 must both be of len 2 where p1 = (x1,y1); p2 = (x2,y2)""" - return math.sqrt((p1[0] - p2[0])**2 + (p1[1] - p2[1])**2) + """p1 and p2 must both be of len 2 where p1 = (x1,y1); p2 = (x2,y2)""" + return math.sqrt((p1[0] - p2[0]) ** 2 + (p1[1] - p2[1]) ** 2) diff --git a/ouropy/genpopulation.py b/ouropy/genpopulation.py index b280fcf..9fc5078 100644 --- a/ouropy/genpopulation.py +++ b/ouropy/genpopulation.py @@ -158,7 +158,7 @@ def write_aps(self, directory='', fname=''): directory = os.getcwd() if not os.path.isdir(directory): os.mkdir(directory) - path = directory + '\\' + fname + '.npz' + path = os.path.join(directory, f'{fname}.npz') try: ap_list = [x[0].as_numpy() for x in self.ap_counters] except: diff --git a/paradigm_pattern_separation_baseline.py b/paradigm_pattern_separation_baseline.py index b77d9c6..b5f1ca9 100644 --- a/paradigm_pattern_separation_baseline.py +++ b/paradigm_pattern_separation_baseline.py @@ -5,48 +5,26 @@ @author: DanielM """ -from neuron import h, gui # gui necessary for some parameters to h namespace +import argparse +import os + +import matplotlib.pyplot as plt import numpy as np +import scipy.stats as stats +from neuron import gui # noqa: F401 +from scipy import interpolate + from pydentate import net_tunedrev, neuron_tools from pydentate.inputs import inhom_poiss -import os -import argparse -import scipy.stats as stats -import platform # Handle command line inputs -pr = argparse.ArgumentParser(description='Local pattern separation paradigm') -pr.add_argument('-runs', - nargs=3, - type=int, - help='start stop range for the range of runs', - default=[0, 1, 1], - dest='runs') -pr.add_argument('-savedir', - type=str, - help='complete directory where data is saved', - default=os.getcwd(), - dest='savedir') -pr.add_argument('-scale', - type=int, - help='standard deviation of gaussian distribution', - default=1000, - dest='input_scale') -pr.add_argument('-input_seed', - type=int, - help='input_seed', - default=[10000], - dest='input_seed') -pr.add_argument('-network_seed', - type=int, - help='standard deviation of gaussian distribution', - default=[10000], - dest='nw_seed') -pr.add_argument('-input_frequency', - type=int, - help='standard deviation of gaussian distribution', - default=[10], - dest='input_frequency') +pr = argparse.ArgumentParser(description="Local pattern separation paradigm") +pr.add_argument("-runs", nargs=3, type=int, help="start stop range for the range of runs", default=[0, 1, 1], dest="runs") +pr.add_argument("-savedir", type=str, help="complete directory where data is saved", default=os.getcwd(), dest="savedir") +pr.add_argument("-scale", type=int, help="standard deviation of gaussian distribution", default=1000, dest="input_scale") +pr.add_argument("-input_seed", type=int, help="input_seed", default=[10000], dest="input_seed") +pr.add_argument("-network_seed", type=int, help="standard deviation of gaussian distribution", default=[10000], dest="nw_seed") +pr.add_argument("-input_frequency", type=int, help="standard deviation of gaussian distribution", default=[10], dest="input_frequency") args = pr.parse_args() runs = range(args.runs[0], args.runs[1], args.runs[2]) @@ -65,51 +43,92 @@ dll_dir = os.path.join(dirname, 'x86_64', 'libnrnmech.so') print("DLL loaded from: " + dll_dir) # h.nrn_load_dll(dll_dir) -""" -neuron_tools.load_compiled_mechanisms(path='precompiled') +""" +neuron_tools.load_compiled_mechanisms(path="precompiled") + + +def inhomogeneous_poisson_process(t_start: float, t_stop: float, sampling_interval: float, rate_profile_frequency: int, rate_profile_amplitude: int, refractory_period: float = 0) -> np.ndarray: + """ + Generates a spike train from an inhomogeneous Poisson process. + NOTE: units are seconds. + """ + + t = np.arange(t_start, t_stop, sampling_interval) + + rate_profile = rate_profile_amplitude * (np.sin(t * rate_profile_frequency * np.pi * 2 - np.pi / 2) + 1) / 2 + + cumulative_rate = np.cumsum(rate_profile) * sampling_interval + max_cumulative_rate = cumulative_rate[-1] + n_spikes = np.round(max_cumulative_rate).astype(int) + + random_numbers = np.random.uniform(0, max_cumulative_rate, n_spikes) + + inv_cumulative_rate_func = interpolate.interp1d(cumulative_rate, t) + + spike_times: np.ndarray = inv_cumulative_rate_func(random_numbers) + spike_times.sort() + + if refractory_period is None: + return spike_times + + thinned_spike_times = np.empty(0) + previous_spike_time = t_start - refractory_period + + for spike_time in spike_times: + if spike_time - previous_spike_time > refractory_period: + thinned_spike_times = np.append(thinned_spike_times, spike_time) + previous_spike_time = spike_time + + return thinned_spike_times + # Start the runs of the model for run in runs: # Seed the numpy random number generator for replication - np.random.seed(input_seed[0]+run) + np.random.seed(input_seed[0] + run) # Randomly choose target cells for the PP lines gauss_gc = stats.norm(loc=1000, scale=input_scale) - gauss_bc = stats.norm(loc=12, scale=(input_scale/2000.0)*24) + gauss_bc = stats.norm(loc=12, scale=(input_scale / 2000.0) * 24) pdf_gc = gauss_gc.pdf(np.arange(2000)) - pdf_gc = pdf_gc/pdf_gc.sum() + pdf_gc = pdf_gc / pdf_gc.sum() pdf_bc = gauss_bc.pdf(np.arange(24)) - pdf_bc = pdf_bc/pdf_bc.sum() + pdf_bc = pdf_bc / pdf_bc.sum() GC_indices = np.arange(2000) start_idc = np.random.randint(0, 1999, size=400) PP_to_GCs = [] for x in start_idc: curr_idc = np.concatenate((GC_indices[x:2000], GC_indices[0:x])) - PP_to_GCs.append(np.random.choice(curr_idc, size=100, replace=False, - p=pdf_gc)) + PP_to_GCs.append(np.random.choice(curr_idc, size=100, replace=False, p=pdf_gc)) PP_to_GCs = np.array(PP_to_GCs) PP_to_GCs = PP_to_GCs[0:24] BC_indices = np.arange(24) - start_idc = np.array(((start_idc/2000.0)*24), dtype=int) + start_idc = np.array(((start_idc / 2000.0) * 24), dtype=int) PP_to_BCs = [] for x in start_idc: curr_idc = np.concatenate((BC_indices[x:24], BC_indices[0:x])) - PP_to_BCs.append(np.random.choice(curr_idc, size=1, replace=False, - p=pdf_bc)) + PP_to_BCs.append(np.random.choice(curr_idc, size=1, replace=False, p=pdf_bc)) PP_to_BCs = np.array(PP_to_BCs) PP_to_BCs = PP_to_BCs[0:24] # Generate temporal patterns for the 100 PP inputs - temporal_patterns = inhom_poiss(modulation_rate=input_frequency) - temporal_patterns[0:24] - nw = net_tunedrev.TunedNetwork(nw_seed[0], temporal_patterns, - PP_to_GCs, - PP_to_BCs) + + # original + temporal_patterns = inhom_poiss(modulation_rate=input_frequency, n_cells=24) + + # refactored + # temporal_patterns = np.array([(inhomogeneous_poisson_process(t_start=0, t_stop=0.5, sampling_interval=0.001, rate_profile_frequency=10, rate_profile_amplitude=110) * 1000).round(1) for _ in range(24)]) + + print(len(temporal_patterns), len(temporal_patterns[0]), temporal_patterns[0]) + plt.eventplot(temporal_patterns) + plt.show() + # raise Exception("Check the temporal patterns") + nw = net_tunedrev.TunedNetwork(nw_seed[0], temporal_patterns, PP_to_GCs, PP_to_BCs) # Attach voltage recordings to all cells nw.populations[0].voltage_recording(range(2000)) @@ -119,23 +138,16 @@ # Run the model """Initialization for -2000 to -100""" print("Running model") + + # in order to get the model view using gui + input("Press Enter to continue...") + neuron_tools.run_neuron_simulator() - tuned_save_file_name = (str(nw) + "-data-paradigm-local-pattern" + - "-separation_nw-seed_input-seed_input-frequency_scale_run_" + - str(nw_seed[0]) + '_' + - str(input_seed[0]) + '_' + - str(input_frequency[0]) + '_' + - str(input_scale).zfill(3) + '_' + - str(run).zfill(3) + '_') + tuned_save_file_name = str(nw) + "-data-paradigm-local-pattern" + "-separation_nw-seed_input-seed_input-frequency_scale_run_" + str(nw_seed[0]) + "_" + str(input_seed[0]) + "_" + str(input_frequency[0]) + "_" + str(input_scale).zfill(3) + "_" + str(run).zfill(3) + "_" - nw.shelve_network(savedir, tuned_save_file_name) + nw.shelve_aps(savedir, tuned_save_file_name) fig = nw.plot_aps(time=600) - tuned_fig_file_name = (str(nw) + "_spike-plot_paradigm_local-pattern" + - "-separation_run_scale_seed_input-seed_nw-seed_" + - str(run).zfill(3) + '_' + - str(input_scale).zfill(3) + '_' + str(10000) + - str(input_seed) + str(nw_seed)) - nw.save_ap_fig(fig, savedir, tuned_fig_file_name) - + tuned_fig_file_name = str(nw) + "_spike-plot_paradigm_local-pattern" + "-separation_run_scale_seed_input-seed_nw-seed_" + str(run).zfill(3) + "_" + str(input_scale).zfill(3) + "_" + str(10000) + str(input_seed) + str(nw_seed) + nw.save_ap_fig(fig, savedir, tuned_fig_file_name) # type: ignore diff --git a/pydentate.net_tunedrev.TunedNetwork-data-paradigm-local-pattern-separation_nw-seed_input-seed_input-frequency_scale_run_10000_10000_10_1000_000_.pydd b/pydentate.net_tunedrev.TunedNetwork-data-paradigm-local-pattern-separation_nw-seed_input-seed_input-frequency_scale_run_10000_10000_10_1000_000_.pydd new file mode 100644 index 0000000..80b5e45 Binary files /dev/null and b/pydentate.net_tunedrev.TunedNetwork-data-paradigm-local-pattern-separation_nw-seed_input-seed_input-frequency_scale_run_10000_10000_10_1000_000_.pydd differ diff --git a/pydentate.net_tunedrev.TunedNetwork-data-paradigm-local-pattern-separation_nw-seed_input-seed_input-frequency_scale_run_10000_10000_10_1000_000_.pydd.db b/pydentate.net_tunedrev.TunedNetwork-data-paradigm-local-pattern-separation_nw-seed_input-seed_input-frequency_scale_run_10000_10000_10_1000_000_.pydd.db new file mode 100644 index 0000000..f4308ee Binary files /dev/null and b/pydentate.net_tunedrev.TunedNetwork-data-paradigm-local-pattern-separation_nw-seed_input-seed_input-frequency_scale_run_10000_10000_10_1000_000_.pydd.db differ diff --git a/pydentate.net_tunedrev.TunedNetwork_spike-plot_paradigm_local-pattern-separation_run_scale_seed_input-seed_nw-seed_000_1000_10000[10000][10000].eps b/pydentate.net_tunedrev.TunedNetwork_spike-plot_paradigm_local-pattern-separation_run_scale_seed_input-seed_nw-seed_000_1000_10000[10000][10000].eps new file mode 100644 index 0000000..8afe62e --- /dev/null +++ b/pydentate.net_tunedrev.TunedNetwork_spike-plot_paradigm_local-pattern-separation_run_scale_seed_input-seed_nw-seed_000_1000_10000[10000][10000].eps @@ -0,0 +1,5713 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: pydentate.net_tunedrev.TunedNetwork_spike-plot_paradigm_local-pattern-separation_run_scale_seed_input-seed_nw-seed_000_1000_10000[10000][10000].eps +%%Creator: Matplotlib v3.7.2, https://matplotlib.org/ +%%CreationDate: Fri Jul 28 12:22:37 2023 +%%Orientation: portrait +%%BoundingBox: 8 -24 604 817 +%%HiResBoundingBox: 8.280000 -24.840000 603.720000 816.840000 +%%EndComments +%%BeginProlog +/mpldict 11 dict def +mpldict begin +/_d { bind def } bind def +/m { moveto } _d +/l { lineto } _d +/r { rlineto } _d +/c { curveto } _d +/cl { closepath } _d +/ce { closepath eofill } _d +/box { + m + 1 index 0 r + 0 exch r + neg 0 r + cl + } _d +/clipbox { + box + clip + newpath + } _d +/sc { setcachedevice } _d +%!PS-Adobe-3.0 Resource-Font +%%Creator: Converted from TrueType to Type 3 by Matplotlib. +10 dict begin +/FontName /DejaVuSans def +/PaintType 0 def +/FontMatrix [0.00048828125 0 0 0.00048828125 0 0] def +/FontBBox [-2090 -948 3673 2524] def +/FontType 3 def +/Encoding [/space /percent /parenleft /parenright /period /zero /one /two /three /four /five /six /seven /eight /nine /B /C /G /H /M /P /a /c /e /i /k /l /m /n /o /p /r /s /t /u /v /y] def +/CharStrings 38 dict dup begin +/.notdef 0 def +/space{651 0 0 0 0 0 sc +ce} _d +/percent{1946 0 113 -29 1833 1520 sc +1489 657 m +1431 657 1385 632 1352 583 c +1319 534 1303 465 1303 377 c +1303 290 1319 222 1352 172 c +1385 123 1431 98 1489 98 c +1546 98 1590 123 1623 172 c +1656 222 1673 290 1673 377 c +1673 464 1656 533 1623 582 c +1590 632 1546 657 1489 657 c + +1489 784 m +1594 784 1678 747 1740 674 c +1802 601 1833 502 1833 377 c +1833 252 1802 153 1739 80 c +1677 7 1594 -29 1489 -29 c +1382 -29 1298 7 1236 80 c +1174 153 1143 252 1143 377 c +1143 502 1174 601 1236 674 c +1299 747 1383 784 1489 784 c + +457 1393 m +400 1393 354 1368 321 1318 c +288 1269 272 1201 272 1114 c +272 1026 288 957 321 908 c +354 859 399 834 457 834 c +515 834 560 859 593 908 c +626 957 643 1026 643 1114 c +643 1200 626 1268 593 1318 c +560 1368 514 1393 457 1393 c + +1360 1520 m +1520 1520 l +586 -29 l +426 -29 l +1360 1520 l + +457 1520 m +562 1520 646 1483 709 1410 c +772 1337 803 1239 803 1114 c +803 988 772 889 709 816 c +647 743 563 707 457 707 c +351 707 267 743 205 816 c +144 889 113 989 113 1114 c +113 1238 144 1337 206 1410 c +268 1483 352 1520 457 1520 c + +ce} _d +/parenleft{799 0 176 -270 635 1554 sc +635 1554 m +546 1401 479 1249 436 1099 c +393 949 371 797 371 643 c +371 489 393 336 436 185 c +480 34 546 -117 635 -270 c +475 -270 l +375 -113 300 41 250 192 c +201 343 176 494 176 643 c +176 792 201 941 250 1092 c +299 1243 374 1397 475 1554 c +635 1554 l + +ce} _d +/parenright{799 0 164 -270 623 1554 sc +164 1554 m +324 1554 l +424 1397 499 1243 548 1092 c +598 941 623 792 623 643 c +623 494 598 343 548 192 c +499 41 424 -113 324 -270 c +164 -270 l +253 -117 319 34 362 185 c +406 336 428 489 428 643 c +428 797 406 949 362 1099 c +319 1249 253 1401 164 1554 c + +ce} _d +/period{651 0 219 0 430 254 sc +219 254 m +430 254 l +430 0 l +219 0 l +219 254 l + +ce} _d +/zero{1303 0 135 -29 1167 1520 sc +651 1360 m +547 1360 469 1309 416 1206 c +364 1104 338 950 338 745 c +338 540 364 387 416 284 c +469 182 547 131 651 131 c +756 131 834 182 886 284 c +939 387 965 540 965 745 c +965 950 939 1104 886 1206 c +834 1309 756 1360 651 1360 c + +651 1520 m +818 1520 946 1454 1034 1321 c +1123 1189 1167 997 1167 745 c +1167 494 1123 302 1034 169 c +946 37 818 -29 651 -29 c +484 -29 356 37 267 169 c +179 302 135 494 135 745 c +135 997 179 1189 267 1321 c +356 1454 484 1520 651 1520 c + +ce} _d +/one{1303 0 225 0 1114 1493 sc +254 170 m +584 170 l +584 1309 l +225 1237 l +225 1421 l +582 1493 l +784 1493 l +784 170 l +1114 170 l +1114 0 l +254 0 l +254 170 l + +ce} _d +/two{1303 0 150 0 1098 1520 sc +393 170 m +1098 170 l +1098 0 l +150 0 l +150 170 l +227 249 331 356 463 489 c +596 623 679 709 713 748 c +778 821 823 882 848 932 c +874 983 887 1032 887 1081 c +887 1160 859 1225 803 1275 c +748 1325 675 1350 586 1350 c +523 1350 456 1339 385 1317 c +315 1295 240 1262 160 1217 c +160 1421 l +241 1454 317 1478 388 1495 c +459 1512 523 1520 582 1520 c +737 1520 860 1481 952 1404 c +1044 1327 1090 1223 1090 1094 c +1090 1033 1078 974 1055 919 c +1032 864 991 800 930 725 c +913 706 860 650 771 557 c +682 465 556 336 393 170 c + +ce} _d +/three{1303 0 156 -29 1139 1520 sc +831 805 m +928 784 1003 741 1057 676 c +1112 611 1139 530 1139 434 c +1139 287 1088 173 987 92 c +886 11 742 -29 555 -29 c +492 -29 428 -23 361 -10 c +295 2 227 20 156 45 c +156 240 l +212 207 273 183 340 166 c +407 149 476 141 549 141 c +676 141 772 166 838 216 c +905 266 938 339 938 434 c +938 522 907 591 845 640 c +784 690 698 715 588 715 c +414 715 l +414 881 l +596 881 l +695 881 771 901 824 940 c +877 980 903 1037 903 1112 c +903 1189 876 1247 821 1288 c +767 1329 689 1350 588 1350 c +533 1350 473 1344 410 1332 c +347 1320 277 1301 201 1276 c +201 1456 l +278 1477 349 1493 416 1504 c +483 1515 547 1520 606 1520 c +759 1520 881 1485 970 1415 c +1059 1346 1104 1252 1104 1133 c +1104 1050 1080 980 1033 923 c +986 866 918 827 831 805 c + +ce} _d +/four{1303 0 100 0 1188 1493 sc +774 1317 m +264 520 l +774 520 l +774 1317 l + +721 1493 m +975 1493 l +975 520 l +1188 520 l +1188 352 l +975 352 l +975 0 l +774 0 l +774 352 l +100 352 l +100 547 l +721 1493 l + +ce} _d +/five{1303 0 158 -29 1124 1493 sc +221 1493 m +1014 1493 l +1014 1323 l +406 1323 l +406 957 l +435 967 465 974 494 979 c +523 984 553 987 582 987 c +749 987 881 941 978 850 c +1075 759 1124 635 1124 479 c +1124 318 1074 193 974 104 c +874 15 733 -29 551 -29 c +488 -29 424 -24 359 -13 c +294 -2 227 14 158 35 c +158 238 l +218 205 280 181 344 165 c +408 149 476 141 547 141 c +662 141 754 171 821 232 c +888 293 922 375 922 479 c +922 583 888 665 821 726 c +754 787 662 817 547 817 c +493 817 439 811 385 799 c +332 787 277 768 221 743 c +221 1493 l + +ce} _d +/six{1303 0 143 -29 1174 1520 sc +676 827 m +585 827 513 796 460 734 c +407 672 381 587 381 479 c +381 372 407 287 460 224 c +513 162 585 131 676 131 c +767 131 838 162 891 224 c +944 287 971 372 971 479 c +971 587 944 672 891 734 c +838 796 767 827 676 827 c + +1077 1460 m +1077 1276 l +1026 1300 975 1318 923 1331 c +872 1344 821 1350 770 1350 c +637 1350 535 1305 464 1215 c +394 1125 354 989 344 807 c +383 865 433 909 492 940 c +551 971 617 987 688 987 c +838 987 956 941 1043 850 c +1130 759 1174 636 1174 479 c +1174 326 1129 203 1038 110 c +947 17 827 -29 676 -29 c +503 -29 371 37 280 169 c +189 302 143 494 143 745 c +143 981 199 1169 311 1309 c +423 1450 573 1520 762 1520 c +813 1520 864 1515 915 1505 c +967 1495 1021 1480 1077 1460 c + +ce} _d +/seven{1303 0 168 0 1128 1493 sc +168 1493 m +1128 1493 l +1128 1407 l +586 0 l +375 0 l +885 1323 l +168 1323 l +168 1493 l + +ce} _d +/eight{1303 0 139 -29 1163 1520 sc +651 709 m +555 709 479 683 424 632 c +369 581 342 510 342 420 c +342 330 369 259 424 208 c +479 157 555 131 651 131 c +747 131 823 157 878 208 c +933 260 961 331 961 420 c +961 510 933 581 878 632 c +823 683 748 709 651 709 c + +449 795 m +362 816 295 857 246 916 c +198 975 174 1048 174 1133 c +174 1252 216 1347 301 1416 c +386 1485 503 1520 651 1520 c +800 1520 916 1485 1001 1416 c +1086 1347 1128 1252 1128 1133 c +1128 1048 1104 975 1055 916 c +1007 857 940 816 854 795 c +951 772 1027 728 1081 662 c +1136 596 1163 515 1163 420 c +1163 275 1119 164 1030 87 c +942 10 816 -29 651 -29 c +486 -29 360 10 271 87 c +183 164 139 275 139 420 c +139 515 166 596 221 662 c +276 728 352 772 449 795 c + +375 1114 m +375 1037 399 976 447 933 c +496 890 564 868 651 868 c +738 868 805 890 854 933 c +903 976 928 1037 928 1114 c +928 1191 903 1252 854 1295 c +805 1338 738 1360 651 1360 c +564 1360 496 1338 447 1295 c +399 1252 375 1191 375 1114 c + +ce} _d +/nine{1303 0 129 -29 1159 1520 sc +225 31 m +225 215 l +276 191 327 173 379 160 c +431 147 482 141 532 141 c +665 141 767 186 837 275 c +908 365 948 501 958 684 c +919 627 870 583 811 552 c +752 521 686 506 614 506 c +465 506 346 551 259 641 c +172 732 129 855 129 1012 c +129 1165 174 1288 265 1381 c +356 1474 476 1520 627 1520 c +800 1520 931 1454 1022 1321 c +1113 1189 1159 997 1159 745 c +1159 510 1103 322 991 181 c +880 41 730 -29 541 -29 c +490 -29 439 -24 387 -14 c +335 -4 281 11 225 31 c + +627 664 m +718 664 789 695 842 757 c +895 819 922 904 922 1012 c +922 1119 895 1204 842 1266 c +789 1329 718 1360 627 1360 c +536 1360 464 1329 411 1266 c +358 1204 332 1119 332 1012 c +332 904 358 819 411 757 c +464 695 536 664 627 664 c + +ce} _d +/B{1405 0 201 0 1260 1493 sc +403 713 m +403 166 l +727 166 l +836 166 916 188 968 233 c +1021 278 1047 347 1047 440 c +1047 533 1021 602 968 646 c +916 691 836 713 727 713 c +403 713 l + +403 1327 m +403 877 l +702 877 l +801 877 874 895 922 932 c +971 969 995 1026 995 1102 c +995 1177 971 1234 922 1271 c +874 1308 801 1327 702 1327 c +403 1327 l + +201 1493 m +717 1493 l +871 1493 990 1461 1073 1397 c +1156 1333 1198 1242 1198 1124 c +1198 1033 1177 960 1134 906 c +1091 852 1029 818 946 805 c +1045 784 1122 739 1177 671 c +1232 604 1260 519 1260 418 c +1260 285 1215 182 1124 109 c +1033 36 904 0 737 0 c +201 0 l +201 1493 l + +ce} _d +/C{1430 0 115 -29 1319 1520 sc +1319 1378 m +1319 1165 l +1251 1228 1178 1276 1101 1307 c +1024 1338 943 1354 856 1354 c +685 1354 555 1302 464 1197 c +373 1093 328 942 328 745 c +328 548 373 398 464 293 c +555 189 685 137 856 137 c +943 137 1024 153 1101 184 c +1178 215 1251 263 1319 326 c +1319 115 l +1248 67 1173 31 1094 7 c +1015 -17 932 -29 844 -29 c +618 -29 440 40 310 178 c +180 317 115 506 115 745 c +115 985 180 1174 310 1312 c +440 1451 618 1520 844 1520 c +933 1520 1017 1508 1096 1484 c +1175 1461 1250 1425 1319 1378 c + +ce} _d +/G{1587 0 115 -29 1419 1520 sc +1219 213 m +1219 614 l +889 614 l +889 780 l +1419 780 l +1419 139 l +1341 84 1255 42 1161 13 c +1067 -15 967 -29 860 -29 c +627 -29 444 39 312 175 c +181 312 115 502 115 745 c +115 989 181 1179 312 1315 c +444 1452 627 1520 860 1520 c +957 1520 1050 1508 1137 1484 c +1225 1460 1306 1425 1380 1378 c +1380 1163 l +1305 1226 1226 1274 1142 1306 c +1058 1338 970 1354 877 1354 c +694 1354 557 1303 465 1201 c +374 1099 328 947 328 745 c +328 544 374 392 465 290 c +557 188 694 137 877 137 c +948 137 1012 143 1068 155 c +1124 168 1174 187 1219 213 c + +ce} _d +/H{1540 0 201 0 1339 1493 sc +201 1493 m +403 1493 l +403 881 l +1137 881 l +1137 1493 l +1339 1493 l +1339 0 l +1137 0 l +1137 711 l +403 711 l +403 0 l +201 0 l +201 1493 l + +ce} _d +/M{1767 0 201 0 1567 1493 sc +201 1493 m +502 1493 l +883 477 l +1266 1493 l +1567 1493 l +1567 0 l +1370 0 l +1370 1311 l +985 287 l +782 287 l +397 1311 l +397 0 l +201 0 l +201 1493 l + +ce} _d +/P{1235 0 201 0 1165 1493 sc +403 1327 m +403 766 l +657 766 l +751 766 824 790 875 839 c +926 888 952 957 952 1047 c +952 1136 926 1205 875 1254 c +824 1303 751 1327 657 1327 c +403 1327 l + +201 1493 m +657 1493 l +824 1493 951 1455 1036 1379 c +1122 1304 1165 1193 1165 1047 c +1165 900 1122 788 1036 713 c +951 638 824 600 657 600 c +403 600 l +403 0 l +201 0 l +201 1493 l + +ce} _d +/a{1255 0 123 -29 1069 1147 sc +702 563 m +553 563 450 546 393 512 c +336 478 307 420 307 338 c +307 273 328 221 371 182 c +414 144 473 125 547 125 c +649 125 731 161 792 233 c +854 306 885 402 885 522 c +885 563 l +702 563 l + +1069 639 m +1069 0 l +885 0 l +885 170 l +843 102 791 52 728 19 c +665 -13 589 -29 498 -29 c +383 -29 292 3 224 67 c +157 132 123 218 123 326 c +123 452 165 547 249 611 c +334 675 460 707 627 707 c +885 707 l +885 725 l +885 810 857 875 801 921 c +746 968 668 991 567 991 c +503 991 441 983 380 968 c +319 953 261 930 205 899 c +205 1069 l +272 1095 338 1114 401 1127 c +464 1140 526 1147 586 1147 c +748 1147 869 1105 949 1021 c +1029 937 1069 810 1069 639 c + +ce} _d +/c{1126 0 113 -29 999 1147 sc +999 1077 m +999 905 l +947 934 895 955 842 969 c +790 984 737 991 684 991 c +565 991 472 953 406 877 c +340 802 307 696 307 559 c +307 422 340 316 406 240 c +472 165 565 127 684 127 c +737 127 790 134 842 148 c +895 163 947 184 999 213 c +999 43 l +948 19 894 1 839 -11 c +784 -23 726 -29 664 -29 c +495 -29 361 24 262 130 c +163 236 113 379 113 559 c +113 742 163 885 263 990 c +364 1095 501 1147 676 1147 c +733 1147 788 1141 842 1129 c +896 1118 948 1100 999 1077 c + +ce} _d +/e{1260 0 113 -29 1151 1147 sc +1151 606 m +1151 516 l +305 516 l +313 389 351 293 419 226 c +488 160 583 127 705 127 c +776 127 844 136 910 153 c +977 170 1043 196 1108 231 c +1108 57 l +1042 29 974 8 905 -7 c +836 -22 765 -29 694 -29 c +515 -29 374 23 269 127 c +165 231 113 372 113 549 c +113 732 162 878 261 985 c +360 1093 494 1147 662 1147 c +813 1147 932 1098 1019 1001 c +1107 904 1151 773 1151 606 c + +967 660 m +966 761 937 841 882 901 c +827 961 755 991 664 991 c +561 991 479 962 417 904 c +356 846 320 764 311 659 c +967 660 l + +ce} _d +/i{569 0 193 0 377 1556 sc +193 1120 m +377 1120 l +377 0 l +193 0 l +193 1120 l + +193 1556 m +377 1556 l +377 1323 l +193 1323 l +193 1556 l + +ce} _d +/k{1186 0 186 0 1180 1556 sc +186 1556 m +371 1556 l +371 637 l +920 1120 l +1155 1120 l +561 596 l +1180 0 l +940 0 l +371 547 l +371 0 l +186 0 l +186 1556 l + +ce} _d +/l{569 0 193 0 377 1556 sc +193 1556 m +377 1556 l +377 0 l +193 0 l +193 1556 l + +ce} _d +/m{1995 0 186 0 1821 1147 sc +1065 905 m +1111 988 1166 1049 1230 1088 c +1294 1127 1369 1147 1456 1147 c +1573 1147 1663 1106 1726 1024 c +1789 943 1821 827 1821 676 c +1821 0 l +1636 0 l +1636 670 l +1636 777 1617 857 1579 909 c +1541 961 1483 987 1405 987 c +1310 987 1234 955 1179 892 c +1124 829 1096 742 1096 633 c +1096 0 l +911 0 l +911 670 l +911 778 892 858 854 909 c +816 961 757 987 678 987 c +584 987 509 955 454 891 c +399 828 371 742 371 633 c +371 0 l +186 0 l +186 1120 l +371 1120 l +371 946 l +413 1015 463 1065 522 1098 c +581 1131 650 1147 731 1147 c +812 1147 881 1126 938 1085 c +995 1044 1038 984 1065 905 c + +ce} _d +/n{1298 0 186 0 1124 1147 sc +1124 676 m +1124 0 l +940 0 l +940 670 l +940 776 919 855 878 908 c +837 961 775 987 692 987 c +593 987 514 955 457 892 c +400 829 371 742 371 633 c +371 0 l +186 0 l +186 1120 l +371 1120 l +371 946 l +415 1013 467 1064 526 1097 c +586 1130 655 1147 733 1147 c +862 1147 959 1107 1025 1027 c +1091 948 1124 831 1124 676 c + +ce} _d +/o{1253 0 113 -29 1141 1147 sc +627 991 m +528 991 450 952 393 875 c +336 798 307 693 307 559 c +307 425 335 319 392 242 c +449 165 528 127 627 127 c +725 127 803 166 860 243 c +917 320 946 426 946 559 c +946 692 917 797 860 874 c +803 952 725 991 627 991 c + +627 1147 m +787 1147 913 1095 1004 991 c +1095 887 1141 743 1141 559 c +1141 376 1095 232 1004 127 c +913 23 787 -29 627 -29 c +466 -29 340 23 249 127 c +158 232 113 376 113 559 c +113 743 158 887 249 991 c +340 1095 466 1147 627 1147 c + +ce} _d +/p{1300 0 186 -426 1188 1147 sc +371 168 m +371 -426 l +186 -426 l +186 1120 l +371 1120 l +371 950 l +410 1017 458 1066 517 1098 c +576 1131 647 1147 729 1147 c +865 1147 975 1093 1060 985 c +1145 877 1188 735 1188 559 c +1188 383 1145 241 1060 133 c +975 25 865 -29 729 -29 c +647 -29 576 -13 517 19 c +458 52 410 101 371 168 c + +997 559 m +997 694 969 800 913 877 c +858 954 781 993 684 993 c +587 993 510 954 454 877 c +399 800 371 694 371 559 c +371 424 399 317 454 240 c +510 163 587 125 684 125 c +781 125 858 163 913 240 c +969 317 997 424 997 559 c + +ce} _d +/r{842 0 186 0 842 1147 sc +842 948 m +821 960 799 969 774 974 c +750 980 723 983 694 983 c +590 983 510 949 454 881 c +399 814 371 717 371 590 c +371 0 l +186 0 l +186 1120 l +371 1120 l +371 946 l +410 1014 460 1064 522 1097 c +584 1130 659 1147 748 1147 c +761 1147 775 1146 790 1144 c +805 1143 822 1140 841 1137 c +842 948 l + +ce} _d +/s{1067 0 111 -29 967 1147 sc +907 1087 m +907 913 l +855 940 801 960 745 973 c +689 986 631 993 571 993 c +480 993 411 979 365 951 c +320 923 297 881 297 825 c +297 782 313 749 346 724 c +379 700 444 677 543 655 c +606 641 l +737 613 829 573 884 522 c +939 471 967 400 967 309 c +967 205 926 123 843 62 c +761 1 648 -29 504 -29 c +444 -29 381 -23 316 -11 c +251 0 183 18 111 41 c +111 231 l +179 196 246 169 312 151 c +378 134 443 125 508 125 c +595 125 661 140 708 169 c +755 199 778 241 778 295 c +778 345 761 383 727 410 c +694 437 620 462 506 487 c +442 502 l +328 526 246 563 195 612 c +144 662 119 730 119 817 c +119 922 156 1004 231 1061 c +306 1118 412 1147 549 1147 c +617 1147 681 1142 741 1132 c +801 1122 856 1107 907 1087 c + +ce} _d +/t{803 0 55 0 754 1438 sc +375 1438 m +375 1120 l +754 1120 l +754 977 l +375 977 l +375 369 l +375 278 387 219 412 193 c +437 167 488 154 565 154 c +754 154 l +754 0 l +565 0 l +423 0 325 26 271 79 c +217 132 190 229 190 369 c +190 977 l +55 977 l +55 1120 l +190 1120 l +190 1438 l +375 1438 l + +ce} _d +/u{1298 0 174 -29 1112 1147 sc +174 442 m +174 1120 l +358 1120 l +358 449 l +358 343 379 263 420 210 c +461 157 523 131 606 131 c +705 131 784 163 841 226 c +899 289 928 376 928 485 c +928 1120 l +1112 1120 l +1112 0 l +928 0 l +928 172 l +883 104 831 53 772 20 c +713 -13 645 -29 567 -29 c +438 -29 341 11 274 91 c +207 171 174 288 174 442 c + +637 1147 m +637 1147 l + +ce} _d +/v{1212 0 61 0 1151 1120 sc +61 1120 m +256 1120 l +606 180 l +956 1120 l +1151 1120 l +731 0 l +481 0 l +61 1120 l + +ce} _d +/y{1212 0 61 -426 1151 1120 sc +659 -104 m +607 -237 556 -324 507 -365 c +458 -406 392 -426 309 -426 c +162 -426 l +162 -272 l +270 -272 l +321 -272 360 -260 388 -236 c +416 -212 447 -155 481 -66 c +514 18 l +61 1120 l +256 1120 l +606 244 l +956 1120 l +1151 1120 l +659 -104 l + +ce} _d +end readonly def + +/BuildGlyph { + exch begin + CharStrings exch + 2 copy known not {pop /.notdef} if + true 3 1 roll get exec + end +} _d + +/BuildChar { + 1 index /Encoding get exch get + 1 index /BuildGlyph get exec +} _d + +FontName currentdict end definefont pop +end +%%EndProlog +mpldict begin +8.28 -24.84 translate +595.44 841.68 0 0 clipbox +gsave +0 0 m +595.44 0 l +595.44 841.68 l +0 841.68 l +cl +1.000 setgray +fill +grestore +gsave +74.43 599.788487 m +535.896 599.788487 l +535.896 740.6784 l +74.43 740.6784 l +cl +1.000 setgray +fill +grestore +0.800 setlinewidth +1 setlinejoin +0 setlinecap +[] 0 setdash +0.000 setgray +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 599.788 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +71.2503 585.195 translate +0 rotate +0 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +151.341 599.788 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +141.802 585.195 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +228.252 599.788 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +218.713 585.195 translate +0 rotate +0 0 m /two glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +305.163 599.788 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +295.624 585.195 translate +0 rotate +0 0 m /three glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +382.074 599.788 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +372.535 585.195 translate +0 rotate +0 0 m /four glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +458.985 599.788 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +449.446 585.195 translate +0 rotate +0 0 m /five glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +535.896 599.788 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +526.357 585.195 translate +0 rotate +0 0 m /six glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 606.257 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +61.0706 602.46 translate +0 rotate +0 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 638.261 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +48.3519 634.464 translate +0 rotate +0 0 m /five glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 670.265 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +41.9925 666.469 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +19.0869 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 702.27 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +41.9925 698.473 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /five glyphshow +12.7246 0 m /zero glyphshow +19.0869 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 734.274 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +41.9925 730.477 translate +0 rotate +0 0 m /two glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +19.0869 0 m /zero glyphshow +grestore +/DejaVuSans 10.000 selectfont +gsave + +24.7237 614.804 translate +90 rotate +0 0 m /G glyphshow +7.74902 0 m /r glyphshow +11.8604 0 m /a glyphshow +17.9883 0 m /n glyphshow +24.3262 0 m /u glyphshow +30.6641 0 m /l glyphshow +33.4424 0 m /e glyphshow +39.5947 0 m /C glyphshow +46.5771 0 m /e glyphshow +52.7295 0 m /l glyphshow +55.5078 0 m /l glyphshow +58.2861 0 m /P glyphshow +63.9414 0 m /o glyphshow +70.0596 0 m /p glyphshow +76.4072 0 m /u glyphshow +82.7451 0 m /l glyphshow +85.5234 0 m /a glyphshow +91.6514 0 m /t glyphshow +95.5723 0 m /i glyphshow +98.3506 0 m /o glyphshow +104.469 0 m /n glyphshow +grestore +/DejaVuSans 10.000 selectfont +gsave + +35.9144 637.554 translate +90 rotate +0 0 m /six glyphshow +6.3623 0 m /period glyphshow +9.54102 0 m /one glyphshow +15.9033 0 m /five glyphshow +22.2656 0 m /percent glyphshow +31.7676 0 m /space glyphshow +34.9463 0 m /a glyphshow +41.0742 0 m /c glyphshow +46.5723 0 m /t glyphshow +50.4932 0 m /i glyphshow +53.2715 0 m /v glyphshow +59.1895 0 m /e glyphshow +grestore +1.500 setlinewidth +0.122 0.467 0.706 setrgbcolor +gsave +461.466 140.89 74.43 599.788 clipbox +74.43 606.288587 m +74.43 606.224578 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +424.990338 606.736649 m +424.990338 606.67264 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +350.771223 607.184711 m +350.771223 607.120702 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +124.037595 607.760791 m +124.037595 607.696782 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +194.180427 607.760791 m +194.180427 607.696782 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +122.499375 607.888809 m +122.499375 607.8248 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +304.240068 608.144844 m +304.240068 608.080835 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +114.346809 611.473305 m +114.346809 611.409296 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +193.565139 611.473305 m +193.565139 611.409296 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +193.718961 612.369429 m +193.718961 612.305421 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +425.297982 612.369429 m +425.297982 612.305421 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +352.540176 613.45758 m +352.540176 613.393571 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +126.72948 613.585598 m +126.72948 613.521589 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +269.553207 613.585598 m +269.553207 613.521589 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +354.770595 613.585598 m +354.770595 613.521589 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +128.036967 614.03366 m +128.036967 613.969651 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +194.488071 614.03366 m +194.488071 613.969651 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +345.002898 614.03366 m +345.002898 613.969651 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +124.960527 614.161678 m +124.960527 614.097669 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +196.641579 614.161678 m +196.641579 614.097669 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +271.937448 614.161678 m +271.937448 614.097669 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +351.001956 614.161678 m +351.001956 614.097669 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +198.487443 616.27397 m +198.487443 616.209961 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +350.771223 616.27397 m +350.771223 616.209961 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +283.089543 616.401988 m +283.089543 616.337979 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +196.257024 616.786041 m +196.257024 616.722032 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +278.24415 616.85005 m +278.24415 616.786041 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +426.990024 616.85005 m +426.990024 616.786041 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +121.730265 617.298112 m +121.730265 617.234103 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +352.617087 617.618156 m +352.617087 617.554147 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +125.268171 618.322254 m +125.268171 618.258245 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +436.834632 618.322254 m +436.834632 618.258245 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +124.499061 619.218378 m +124.499061 619.154369 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +352.155621 619.218378 m +352.155621 619.154369 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +427.297668 619.218378 m +427.297668 619.154369 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +192.334563 620.370538 m +192.334563 620.306529 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +353.232375 620.882608 m +353.232375 620.8186 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +122.653197 621.010626 m +122.653197 620.946617 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +123.960684 621.138644 m +123.960684 621.074635 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +193.795872 621.138644 m +193.795872 621.074635 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +277.244307 621.138644 m +277.244307 621.074635 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +279.243993 621.650715 m +279.243993 621.586706 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +198.487443 621.970759 m +198.487443 621.90675 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +106.73262 622.098777 m +106.73262 622.034768 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +191.257809 622.098777 m +191.257809 622.034768 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +199.179642 623.698999 m +199.179642 623.63499 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +120.038223 625.747282 m +120.038223 625.683273 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +194.026605 625.747282 m +194.026605 625.683273 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +348.386982 625.747282 m +348.386982 625.683273 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +201.871527 626.259353 m +201.871527 626.195344 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +343.695411 626.45138 m +343.695411 626.387371 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +195.718647 626.707415 m +195.718647 626.643406 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +266.169123 626.707415 m +266.169123 626.643406 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +424.221228 626.707415 m +424.221228 626.643406 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +431.066307 627.091468 m +431.066307 627.02746 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +199.564197 627.475522 m +199.564197 627.411513 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +196.257024 629.011734 m +196.257024 628.947725 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +122.037909 629.395788 m +122.037909 629.331779 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +120.192045 629.84385 m +120.192045 629.779841 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +349.156092 629.84385 m +349.156092 629.779841 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +428.143689 630.035876 m +428.143689 629.971867 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +116.577228 632.724249 m +116.577228 632.66024 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +272.322003 632.724249 m +272.322003 632.66024 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +422.683008 632.724249 m +422.683008 632.66024 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +122.807019 633.940417 m +122.807019 633.876408 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +195.487914 633.940417 m +195.487914 633.876408 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +431.681595 635.156585 m +431.681595 635.092577 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +116.884872 635.284603 m +116.884872 635.220594 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +196.564668 635.284603 m +196.564668 635.220594 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +351.463422 635.284603 m +351.463422 635.220594 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +116.807961 635.860683 m +116.807961 635.796674 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +191.180898 635.860683 m +191.180898 635.796674 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +117.961626 637.012842 m +117.961626 636.948834 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +341.541903 637.012842 m +341.541903 636.948834 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +350.463579 637.204869 m +350.463579 637.14086 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +431.989239 637.652931 m +431.989239 637.588922 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +273.475668 638.485046 m +273.475668 638.421038 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +198.564354 638.805091 m +198.564354 638.741082 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +355.078239 638.805091 m +355.078239 638.741082 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +116.654139 639.701215 m +116.654139 639.637206 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +196.026291 639.701215 m +196.026291 639.637206 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +342.926301 639.701215 m +342.926301 639.637206 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +118.807647 640.53333 m +118.807647 640.469321 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +195.334092 640.53333 m +195.334092 640.469321 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +278.936349 640.597339 m +278.936349 640.53333 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +196.71849 640.661348 m +196.71849 640.597339 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +423.144474 640.661348 m +423.144474 640.597339 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +125.498904 641.365445 m +125.498904 641.301436 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +194.026605 641.365445 m +194.026605 641.301436 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +278.474883 641.365445 m +278.474883 641.301436 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +423.375207 642.005534 m +423.375207 641.941525 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +120.653511 642.389587 m +120.653511 642.325578 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +118.26927 642.709631 m +118.26927 642.645623 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +346.079652 642.709631 m +346.079652 642.645623 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +423.144474 642.709631 m +423.144474 642.645623 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +124.652883 642.837649 m +124.652883 642.77364 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +349.77138 643.477738 m +349.77138 643.413729 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +348.771537 644.117827 m +348.771537 644.053818 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +196.795401 644.309853 m +196.795401 644.245844 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +199.564197 644.757915 m +199.564197 644.693906 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +422.83683 644.757915 m +422.83683 644.693906 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +278.090328 645.013951 m +278.090328 644.949942 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +430.220286 646.230119 m +430.220286 646.16611 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +120.730422 646.934217 m +120.730422 646.870208 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +280.166925 649.366553 m +280.166925 649.302545 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +120.884244 651.094793 m +120.884244 651.030784 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +119.961312 651.414837 m +119.961312 651.350828 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +194.872626 651.414837 m +194.872626 651.350828 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +426.759291 651.414837 m +426.759291 651.350828 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +342.464835 655.19136 m +342.464835 655.127351 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +123.268485 655.383387 m +123.268485 655.319378 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +122.730108 656.983608 m +122.730108 656.9196 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +189.7965 658.519821 m +189.7965 658.455812 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +110.885814 666.584938 m +110.885814 666.520929 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +188.181369 666.584938 m +188.181369 666.520929 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +269.01483 666.584938 m +269.01483 666.520929 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +339.542217 666.584938 m +339.542217 666.520929 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +422.683008 666.584938 m +422.683008 666.520929 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +354.001485 668.633222 m +354.001485 668.569213 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +115.577385 671.57763 m +115.577385 671.513621 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +118.346181 672.217718 m +118.346181 672.153709 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +202.10226 672.217718 m +202.10226 672.153709 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +348.848448 672.217718 m +348.848448 672.153709 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +429.989553 673.369878 m +429.989553 673.305869 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +110.424348 673.945958 m +110.424348 673.881949 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +121.422621 674.009967 m +121.422621 673.945958 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +197.564511 674.009967 m +197.564511 673.945958 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +273.475668 674.009967 m +273.475668 673.945958 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +121.038066 675.48217 m +121.038066 675.418162 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +194.41116 675.48217 m +194.41116 675.418162 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +426.836202 677.658472 m +426.836202 677.594463 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +273.244935 680.858915 m +273.244935 680.794906 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +423.60594 680.858915 m +423.60594 680.794906 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +124.191417 682.395128 m +124.191417 682.331119 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +348.23316 682.395128 m +348.23316 682.331119 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +425.067249 682.395128 m +425.067249 682.331119 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +356.154993 682.715172 m +356.154993 682.651163 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +192.026919 686.171651 m +192.026919 686.107642 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +349.540647 686.171651 m +349.540647 686.107642 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +350.232846 687.003766 m +350.232846 686.939757 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +355.001328 687.195793 m +355.001328 687.131784 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +115.346652 687.515837 m +115.346652 687.451828 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +190.027233 687.515837 m +190.027233 687.451828 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +270.476139 687.515837 m +270.476139 687.451828 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +347.387139 687.515837 m +347.387139 687.451828 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +428.451333 688.860023 m +428.451333 688.796014 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +430.758663 689.180068 m +430.758663 689.116059 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +352.924731 691.420378 m +352.924731 691.356369 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +196.949223 691.484387 m +196.949223 691.420378 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +423.682851 691.484387 m +423.682851 691.420378 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +200.794773 693.148617 m +200.794773 693.084608 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +352.924731 693.148617 m +352.924731 693.084608 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +191.950008 693.980732 m +191.950008 693.916724 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +273.398757 696.669105 m +273.398757 696.605096 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +428.374422 696.669105 m +428.374422 696.605096 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +106.886442 703.134 m +106.886442 703.069991 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +190.950165 703.134 m +190.950165 703.069991 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +347.387139 703.134 m +347.387139 703.069991 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +198.25671 703.71008 m +198.25671 703.646071 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +348.079338 703.71008 m +348.079338 703.646071 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +423.759762 703.71008 m +423.759762 703.646071 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +272.398914 707.038541 m +272.398914 706.974532 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +431.066307 707.038541 m +431.066307 706.974532 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +268.861008 708.702771 m +268.861008 708.638763 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +429.835731 708.702771 m +429.835731 708.638763 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +199.02582 710.49502 m +199.02582 710.431011 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +430.758663 710.49502 m +430.758663 710.431011 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +349.540647 710.815064 m +349.540647 710.751055 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +194.718804 711.647179 m +194.718804 711.58317 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +424.682694 711.647179 m +424.682694 711.58317 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +191.565453 711.711188 m +191.565453 711.647179 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +348.617715 711.711188 m +348.617715 711.647179 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +192.87294 712.223259 m +192.87294 712.15925 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +119.730579 713.951498 m +119.730579 713.887489 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +193.872783 713.951498 m +193.872783 713.887489 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +264.861636 713.951498 m +264.861636 713.887489 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +193.718961 714.015507 m +193.718961 713.951498 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +427.374579 714.015507 m +427.374579 713.951498 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +117.807804 714.39956 m +117.807804 714.335552 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +187.642992 714.39956 m +187.642992 714.335552 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +347.617872 714.39956 m +347.617872 714.335552 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +425.297982 714.39956 m +425.297982 714.335552 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +124.652883 714.591587 m +124.652883 714.527578 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +123.345396 714.911631 m +123.345396 714.847622 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +201.102417 715.039649 m +201.102417 714.97564 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +117.423249 717.535995 m +117.423249 717.471986 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +112.8855 717.984057 m +112.8855 717.920048 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +191.488542 717.984057 m +191.488542 717.920048 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +281.012946 717.984057 m +281.012946 717.920048 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +344.925987 717.984057 m +344.925987 717.920048 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +426.528558 717.984057 m +426.528558 717.920048 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +347.925516 720.288376 m +347.925516 720.224367 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +117.269427 726.689263 m +117.269427 726.625254 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +191.950008 726.689263 m +191.950008 726.625254 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +279.78237 726.689263 m +279.78237 726.625254 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +348.617715 728.353493 m +348.617715 728.289484 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +115.269741 728.801555 m +115.269741 728.737546 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +194.795715 728.801555 m +194.795715 728.737546 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +352.463265 728.801555 m +352.463265 728.737546 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +190.027233 729.569661 m +190.027233 729.505653 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +347.387139 729.569661 m +347.387139 729.505653 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +348.156249 731.233892 m +348.156249 731.169883 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +115.423563 731.681954 m +115.423563 731.617945 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +190.257966 731.681954 m +190.257966 731.617945 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +429.528087 731.745963 m +429.528087 731.681954 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +282.320433 732.706096 m +282.320433 732.642087 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +352.001799 732.706096 m +352.001799 732.642087 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +120.653511 732.770105 m +120.653511 732.706096 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +194.488071 732.770105 m +194.488071 732.706096 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +347.694783 732.770105 m +347.694783 732.706096 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +423.529029 732.898122 m +423.529029 732.834114 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +424.528872 734.114291 m +424.528872 734.050282 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +124.960527 734.1783 m +124.960527 734.114291 l +stroke +grestore +gsave +461.466 140.89 74.43 599.788 clipbox +350.925045 734.1783 m +350.925045 734.114291 l +stroke +grestore +0.800 setlinewidth +0 setlinejoin +2 setlinecap +0.000 setgray +gsave +74.43 599.788487 m +74.43 740.6784 l +stroke +grestore +gsave +535.896 599.788487 m +535.896 740.6784 l +stroke +grestore +gsave +74.43 599.788487 m +535.896 599.788487 l +stroke +grestore +gsave +74.43 740.6784 m +535.896 740.6784 l +stroke +grestore +gsave +74.43 430.720591 m +535.896 430.720591 l +535.896 571.610504 l +74.43 571.610504 l +cl +1.000 setgray +fill +grestore +1 setlinejoin +0 setlinecap +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 430.721 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +71.2503 416.127 translate +0 rotate +0 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +151.341 430.721 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +141.802 416.127 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +228.252 430.721 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +218.713 416.127 translate +0 rotate +0 0 m /two glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +305.163 430.721 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +295.624 416.127 translate +0 rotate +0 0 m /three glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +382.074 430.721 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +372.535 416.127 translate +0 rotate +0 0 m /four glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +458.985 430.721 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +449.446 416.127 translate +0 rotate +0 0 m /five glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +535.896 430.721 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +526.357 416.127 translate +0 rotate +0 0 m /six glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 439.224 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +61.0706 435.428 translate +0 rotate +0 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 460.221 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 456.425 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 481.218 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 477.422 translate +0 rotate +0 0 m /two glyphshow +6.3623 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 502.215 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 498.419 translate +0 rotate +0 0 m /three glyphshow +6.3623 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 523.212 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 519.416 translate +0 rotate +0 0 m /four glyphshow +6.3623 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 544.209 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 540.413 translate +0 rotate +0 0 m /five glyphshow +6.3623 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 565.206 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 561.41 translate +0 rotate +0 0 m /six glyphshow +6.3623 0 m /zero glyphshow +grestore +/DejaVuSans 10.000 selectfont +gsave + +37.4425 449.986 translate +90 rotate +0 0 m /M glyphshow +8.62793 0 m /o glyphshow +14.7461 0 m /s glyphshow +19.9561 0 m /s glyphshow +25.166 0 m /y glyphshow +31.084 0 m /C glyphshow +38.0664 0 m /e glyphshow +44.2188 0 m /l glyphshow +46.9971 0 m /l glyphshow +49.7754 0 m /P glyphshow +55.4307 0 m /o glyphshow +61.5488 0 m /p glyphshow +67.8965 0 m /u glyphshow +74.2344 0 m /l glyphshow +77.0127 0 m /a glyphshow +83.1406 0 m /t glyphshow +87.0615 0 m /i glyphshow +89.8398 0 m /o glyphshow +95.958 0 m /n glyphshow +grestore +/DejaVuSans 10.000 selectfont +gsave + +48.6331 468.486 translate +90 rotate +0 0 m /five glyphshow +6.3623 0 m /three glyphshow +12.7246 0 m /period glyphshow +15.9033 0 m /three glyphshow +22.2656 0 m /percent glyphshow +31.7676 0 m /space glyphshow +34.9463 0 m /a glyphshow +41.0742 0 m /c glyphshow +46.5723 0 m /t glyphshow +50.4932 0 m /i glyphshow +53.2715 0 m /v glyphshow +59.1895 0 m /e glyphshow +grestore +1.500 setlinewidth +0.122 0.467 0.706 setrgbcolor +gsave +461.466 140.89 74.43 430.721 clipbox +450.986256 440.274229 m +450.986256 438.174529 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +210.870114 442.37393 m +210.870114 440.274229 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +175.798698 444.473631 m +175.798698 442.37393 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +204.794145 444.473631 m +204.794145 442.37393 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +361.692585 444.473631 m +361.692585 442.37393 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +313.007922 446.573331 m +313.007922 444.473631 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +213.023622 448.673032 m +213.023622 446.573331 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +435.9117 448.673032 m +435.9117 446.573331 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +213.561999 454.972134 m +213.561999 452.872433 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +229.405665 459.171535 m +229.405665 457.071834 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +196.257024 465.470637 m +196.257024 463.370936 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +155.95566 467.570338 m +155.95566 465.470637 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +448.448193 467.570338 m +448.448193 465.470637 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +133.805292 469.670038 m +133.805292 467.570338 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +462.06144 469.670038 m +462.06144 467.570338 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +207.101475 471.769739 m +207.101475 469.670038 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +363.000072 471.769739 m +363.000072 469.670038 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +138.573774 473.869439 m +138.573774 471.769739 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +151.264089 478.068841 m +151.264089 475.96914 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +232.328283 480.168541 m +232.328283 478.068841 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +165.723357 494.866446 m +165.723357 492.766745 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +214.561842 496.966147 m +214.561842 494.866446 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +234.558702 505.364949 m +234.558702 503.265248 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +230.482419 509.56435 m +230.482419 507.46465 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +436.757721 509.56435 m +436.757721 507.46465 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +247.787394 515.863452 m +247.787394 513.763752 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +207.716763 517.963153 m +207.716763 515.863452 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +373.921434 517.963153 m +373.921434 515.863452 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +235.097079 528.461656 m +235.097079 526.361956 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +443.064423 530.561357 m +443.064423 528.461656 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +209.02425 532.661057 m +209.02425 530.561357 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +360.462009 532.661057 m +360.462009 530.561357 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +203.64048 536.860459 m +203.64048 534.760758 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +399.532797 536.860459 m +399.532797 534.760758 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +201.486972 538.960159 m +201.486972 536.860459 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +350.155935 538.960159 m +350.155935 536.860459 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +440.680182 538.960159 m +440.680182 536.860459 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +227.867445 543.159561 m +227.867445 541.05986 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +506.285265 551.558363 m +506.285265 549.458663 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +157.186236 553.658064 m +157.186236 551.558363 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +208.178229 553.658064 m +208.178229 551.558363 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +449.140392 555.757765 m +449.140392 553.658064 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +205.563255 557.857465 m +205.563255 555.757765 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +302.471115 562.056866 m +302.471115 559.957166 l +stroke +grestore +gsave +461.466 140.89 74.43 430.721 clipbox +211.716135 564.156567 m +211.716135 562.056866 l +stroke +grestore +0.800 setlinewidth +0 setlinejoin +2 setlinecap +0.000 setgray +gsave +74.43 430.720591 m +74.43 571.610504 l +stroke +grestore +gsave +535.896 430.720591 m +535.896 571.610504 l +stroke +grestore +gsave +74.43 430.720591 m +535.896 430.720591 l +stroke +grestore +gsave +74.43 571.610504 m +535.896 571.610504 l +stroke +grestore +gsave +74.43 261.652696 m +535.896 261.652696 l +535.896 402.542609 l +74.43 402.542609 l +cl +1.000 setgray +fill +grestore +1 setlinejoin +0 setlinecap +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 261.653 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +71.2503 247.059 translate +0 rotate +0 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +151.341 261.653 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +141.802 247.059 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +228.252 261.653 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +218.713 247.059 translate +0 rotate +0 0 m /two glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +305.163 261.653 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +295.624 247.059 translate +0 rotate +0 0 m /three glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +382.074 261.653 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +372.535 247.059 translate +0 rotate +0 0 m /four glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +458.985 261.653 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +449.446 247.059 translate +0 rotate +0 0 m /five glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +535.896 261.653 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +526.357 247.059 translate +0 rotate +0 0 m /six glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 273.18 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +61.0706 269.383 translate +0 rotate +0 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 298.796 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +61.0706 295 translate +0 rotate +0 0 m /five glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 324.413 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 320.616 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 350.029 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 346.232 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /five glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 375.645 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 371.849 translate +0 rotate +0 0 m /two glyphshow +6.3623 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 401.262 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 397.465 translate +0 rotate +0 0 m /two glyphshow +6.3623 0 m /five glyphshow +grestore +/DejaVuSans 10.000 selectfont +gsave + +37.4425 279.621 translate +90 rotate +0 0 m /B glyphshow +6.86035 0 m /a glyphshow +12.9883 0 m /s glyphshow +18.1982 0 m /k glyphshow +23.6143 0 m /e glyphshow +29.7666 0 m /t glyphshow +33.6875 0 m /C glyphshow +40.6699 0 m /e glyphshow +46.8223 0 m /l glyphshow +49.6006 0 m /l glyphshow +52.3789 0 m /P glyphshow +58.0342 0 m /o glyphshow +64.1523 0 m /p glyphshow +70.5 0 m /u glyphshow +76.8379 0 m /l glyphshow +79.6162 0 m /a glyphshow +85.7441 0 m /t glyphshow +89.665 0 m /i glyphshow +92.4434 0 m /o glyphshow +98.5615 0 m /n glyphshow +grestore +/DejaVuSans 10.000 selectfont +gsave + +48.6331 299.418 translate +90 rotate +0 0 m /nine glyphshow +6.3623 0 m /one glyphshow +12.7246 0 m /period glyphshow +15.9033 0 m /six glyphshow +22.2656 0 m /percent glyphshow +31.7676 0 m /space glyphshow +34.9463 0 m /a glyphshow +41.0742 0 m /c glyphshow +46.5723 0 m /t glyphshow +50.4932 0 m /i glyphshow +53.2715 0 m /v glyphshow +59.1895 0 m /e glyphshow +grestore +1.500 setlinewidth +0.122 0.467 0.706 setrgbcolor +gsave +461.466 140.89 74.43 261.653 clipbox +130.959585 275.741687 m +130.959585 270.618417 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +199.02582 275.741687 m +199.02582 270.618417 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +208.408962 280.864957 m +208.408962 275.741687 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +356.078082 280.864957 m +356.078082 275.741687 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +125.268171 285.988226 m +125.268171 280.864957 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +198.102888 285.988226 m +198.102888 280.864957 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +364.692114 285.988226 m +364.692114 280.864957 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +206.255454 291.111496 m +206.255454 285.988226 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +355.15515 291.111496 m +355.15515 285.988226 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +196.410846 296.234765 m +196.410846 291.111496 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +204.486501 296.234765 m +204.486501 291.111496 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +287.242737 296.234765 m +287.242737 291.111496 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +360.231276 296.234765 m +360.231276 291.111496 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +426.220914 296.234765 m +426.220914 291.111496 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +440.449449 296.234765 m +440.449449 291.111496 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +353.847663 301.358035 m +353.847663 296.234765 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +126.883302 306.481304 m +126.883302 301.358035 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +347.156406 306.481304 m +347.156406 301.358035 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +360.000543 306.481304 m +360.000543 301.358035 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +438.142119 306.481304 m +438.142119 301.358035 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +122.499375 311.604574 m +122.499375 306.481304 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +133.959114 311.604574 m +133.959114 306.481304 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +197.949066 311.604574 m +197.949066 306.481304 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +205.563255 311.604574 m +205.563255 306.481304 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +270.014673 311.604574 m +270.014673 306.481304 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +282.0897 311.604574 m +282.0897 306.481304 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +355.616616 311.604574 m +355.616616 306.481304 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +430.989396 311.604574 m +430.989396 306.481304 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +112.577856 316.727843 m +112.577856 311.604574 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +147.956916 316.727843 m +147.956916 311.604574 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +190.796343 316.727843 m +190.796343 311.604574 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +216.869172 316.727843 m +216.869172 311.604574 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +265.015458 316.727843 m +265.015458 311.604574 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +349.233003 316.727843 m +349.233003 311.604574 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +417.914526 316.727843 m +417.914526 311.604574 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +430.835574 316.727843 m +430.835574 311.604574 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +124.499061 321.851113 m +124.499061 316.727843 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +135.266601 321.851113 m +135.266601 316.727843 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +197.718333 321.851113 m +197.718333 316.727843 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +210.101004 321.851113 m +210.101004 316.727843 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +279.01326 321.851113 m +279.01326 316.727843 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +354.693684 321.851113 m +354.693684 316.727843 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +121.34571 326.974383 m +121.34571 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +130.267386 326.974383 m +130.267386 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +158.109168 326.974383 m +158.109168 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +194.41116 326.974383 m +194.41116 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +203.409747 326.974383 m +203.409747 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +213.792732 326.974383 m +213.792732 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +255.324672 326.974383 m +255.324672 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +289.7808 326.974383 m +289.7808 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +334.696824 326.974383 m +334.696824 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +350.54049 326.974383 m +350.54049 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +359.692899 326.974383 m +359.692899 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +405.685677 326.974383 m +405.685677 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +423.529029 326.974383 m +423.529029 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +431.220129 326.974383 m +431.220129 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +442.06458 326.974383 m +442.06458 321.851113 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +127.883145 337.220922 m +127.883145 332.097652 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +121.807176 347.467461 m +121.807176 342.344191 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +191.719275 347.467461 m +191.719275 342.344191 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +204.255768 347.467461 m +204.255768 342.344191 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +273.014202 347.467461 m +273.014202 342.344191 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +346.848762 347.467461 m +346.848762 342.344191 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +355.385883 347.467461 m +355.385883 342.344191 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +425.605626 347.467461 m +425.605626 342.344191 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +437.065365 347.467461 m +437.065365 342.344191 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +107.655552 352.59073 m +107.655552 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +117.038694 352.59073 m +117.038694 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +126.037281 352.59073 m +126.037281 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +138.035397 352.59073 m +138.035397 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +186.027861 352.59073 m +186.027861 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +196.257024 352.59073 m +196.257024 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +219.330324 352.59073 m +219.330324 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +263.400327 352.59073 m +263.400327 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +274.3986 352.59073 m +274.3986 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +297.702633 352.59073 m +297.702633 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +334.850646 352.59073 m +334.850646 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +348.463893 352.59073 m +348.463893 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +364.538292 352.59073 m +364.538292 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +404.839656 352.59073 m +404.839656 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +418.606725 352.59073 m +418.606725 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +426.528558 352.59073 m +426.528558 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +436.450077 352.59073 m +436.450077 347.467461 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +105.655866 357.714 m +105.655866 352.59073 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +115.577385 357.714 m +115.577385 352.59073 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +126.114192 357.714 m +126.114192 352.59073 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +185.566395 357.714 m +185.566395 352.59073 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +198.948909 357.714 m +198.948909 352.59073 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +208.716606 357.714 m +208.716606 352.59073 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +96.580368 362.83727 m +96.580368 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +119.499846 362.83727 m +119.499846 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +183.259065 362.83727 m +183.259065 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +192.642207 362.83727 m +192.642207 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +200.871684 362.83727 m +200.871684 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +214.40802 362.83727 m +214.40802 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +250.402368 362.83727 m +250.402368 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +262.86195 362.83727 m +262.86195 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +274.244778 362.83727 m +274.244778 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +281.935878 362.83727 m +281.935878 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +330.54363 362.83727 m +330.54363 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +342.618657 362.83727 m +342.618657 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +360.846564 362.83727 m +360.846564 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +414.914997 362.83727 m +414.914997 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +431.29704 362.83727 m +431.29704 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +436.911543 362.83727 m +436.911543 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +449.909502 362.83727 m +449.909502 357.714 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +130.267386 367.960539 m +130.267386 362.83727 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +192.488385 367.960539 m +192.488385 362.83727 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +273.244935 367.960539 m +273.244935 362.83727 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +349.848291 367.960539 m +349.848291 362.83727 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +428.451333 367.960539 m +428.451333 362.83727 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +128.2677 373.083809 m +128.2677 367.960539 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +197.179956 373.083809 m +197.179956 367.960539 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +269.091741 373.083809 m +269.091741 367.960539 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +117.50016 378.207078 m +117.50016 373.083809 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +194.872626 378.207078 m +194.872626 373.083809 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +285.089229 378.207078 m +285.089229 373.083809 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +347.310228 378.207078 m +347.310228 373.083809 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +363.999915 378.207078 m +363.999915 373.083809 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +436.757721 378.207078 m +436.757721 373.083809 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +118.807647 383.330348 m +118.807647 378.207078 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +133.343826 383.330348 m +133.343826 378.207078 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +193.488228 383.330348 m +193.488228 378.207078 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +204.40959 383.330348 m +204.40959 378.207078 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +350.002113 383.330348 m +350.002113 378.207078 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +361.231119 383.330348 m +361.231119 378.207078 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +428.2206 383.330348 m +428.2206 378.207078 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +127.114035 388.453617 m +127.114035 383.330348 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +195.103359 388.453617 m +195.103359 383.330348 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +275.475354 388.453617 m +275.475354 383.330348 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +285.627606 388.453617 m +285.627606 383.330348 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +355.847349 388.453617 m +355.847349 383.330348 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +423.221385 388.453617 m +423.221385 383.330348 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +198.641265 393.576887 m +198.641265 388.453617 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +352.770909 393.576887 m +352.770909 388.453617 l +stroke +grestore +gsave +461.466 140.89 74.43 261.653 clipbox +430.451019 393.576887 m +430.451019 388.453617 l +stroke +grestore +0.800 setlinewidth +0 setlinejoin +2 setlinecap +0.000 setgray +gsave +74.43 261.652696 m +74.43 402.542609 l +stroke +grestore +gsave +535.896 261.652696 m +535.896 402.542609 l +stroke +grestore +gsave +74.43 261.652696 m +535.896 261.652696 l +stroke +grestore +gsave +74.43 402.542609 m +535.896 402.542609 l +stroke +grestore +gsave +74.43 92.5848 m +535.896 92.5848 l +535.896 233.474713 l +74.43 233.474713 l +cl +1.000 setgray +fill +grestore +1 setlinejoin +0 setlinecap +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 92.5848 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +71.2503 77.991 translate +0 rotate +0 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +151.341 92.5848 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +141.802 77.991 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +228.252 92.5848 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +218.713 77.991 translate +0 rotate +0 0 m /two glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +305.163 92.5848 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +295.624 77.991 translate +0 rotate +0 0 m /three glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +382.074 92.5848 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +372.535 77.991 translate +0 rotate +0 0 m /four glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +458.985 92.5848 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +449.446 77.991 translate +0 rotate +0 0 m /five glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +0 0 m +0 -3.5 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +535.896 92.5848 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +526.357 77.991 translate +0 rotate +0 0 m /six glyphshow +6.3623 0 m /zero glyphshow +12.7246 0 m /zero glyphshow +grestore +/DejaVuSans 10.000 selectfont +gsave + +280.874 64.3192 translate +0 rotate +0 0 m /t glyphshow +3.9209 0 m /i glyphshow +6.69922 0 m /m glyphshow +16.4404 0 m /e glyphshow +22.5928 0 m /space glyphshow +25.7715 0 m /parenleft glyphshow +29.6729 0 m /m glyphshow +39.4141 0 m /s glyphshow +44.624 0 m /parenright glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 104.112 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +61.0706 100.315 translate +0 rotate +0 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 129.729 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +61.0706 125.932 translate +0 rotate +0 0 m /five glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 155.345 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 151.548 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 180.961 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 177.164 translate +0 rotate +0 0 m /one glyphshow +6.3623 0 m /five glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 206.578 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 202.781 translate +0 rotate +0 0 m /two glyphshow +6.3623 0 m /zero glyphshow +grestore +gsave +/o { +gsave +newpath +translate +0.8 setlinewidth +1 setlinejoin + +0 setlinecap + +-0 0 m +-3.5 0 l + +gsave +0.000 setgray +fill +grestore +stroke +grestore +} bind def +74.43 232.194 o +grestore +/DejaVuSans 10.000 selectfont +gsave + +54.7112 228.397 translate +0 rotate +0 0 m /two glyphshow +6.3623 0 m /five glyphshow +grestore +/DejaVuSans 10.000 selectfont +gsave + +37.4425 115.913 translate +90 rotate +0 0 m /H glyphshow +7.51953 0 m /i glyphshow +10.2979 0 m /p glyphshow +16.6455 0 m /p glyphshow +22.9932 0 m /C glyphshow +29.9756 0 m /e glyphshow +36.1279 0 m /l glyphshow +38.9062 0 m /l glyphshow +41.6846 0 m /P glyphshow +47.3398 0 m /o glyphshow +53.458 0 m /p glyphshow +59.8057 0 m /u glyphshow +66.1436 0 m /l glyphshow +68.9219 0 m /a glyphshow +75.0498 0 m /t glyphshow +78.9707 0 m /i glyphshow +81.749 0 m /o glyphshow +87.8672 0 m /n glyphshow +grestore +/DejaVuSans 10.000 selectfont +gsave + +48.6331 130.35 translate +90 rotate +0 0 m /eight glyphshow +6.3623 0 m /seven glyphshow +12.7246 0 m /period glyphshow +15.9033 0 m /five glyphshow +22.2656 0 m /percent glyphshow +31.7676 0 m /space glyphshow +34.9463 0 m /a glyphshow +41.0742 0 m /c glyphshow +46.5723 0 m /t glyphshow +50.4932 0 m /i glyphshow +53.2715 0 m /v glyphshow +59.1895 0 m /e glyphshow +grestore +1.500 setlinewidth +0.122 0.467 0.706 setrgbcolor +gsave +461.466 140.89 74.43 92.585 clipbox +74.43 106.673791 m +74.43 101.550522 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +282.320433 111.797061 m +282.320433 106.673791 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +433.296726 111.797061 m +433.296726 106.673791 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +126.72948 116.92033 m +126.72948 111.797061 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +358.923789 116.92033 m +358.923789 111.797061 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +432.83526 116.92033 m +432.83526 111.797061 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +119.884401 122.0436 m +119.884401 116.92033 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +126.883302 122.0436 m +126.883302 116.92033 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +200.102574 122.0436 m +200.102574 116.92033 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +355.078239 122.0436 m +355.078239 116.92033 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +434.450391 122.0436 m +434.450391 116.92033 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +123.883773 137.413409 m +123.883773 132.290139 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +203.64048 137.413409 m +203.64048 132.290139 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +352.84782 137.413409 m +352.84782 132.290139 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +359.0007 137.413409 m +359.0007 132.290139 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +428.758977 137.413409 m +428.758977 132.290139 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +434.911857 137.413409 m +434.911857 132.290139 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +130.036653 142.536678 m +130.036653 137.413409 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +200.640951 142.536678 m +200.640951 137.413409 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +286.089072 142.536678 m +286.089072 137.413409 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +355.308972 142.536678 m +355.308972 137.413409 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +203.255925 147.659948 m +203.255925 142.536678 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +366.614889 147.659948 m +366.614889 142.536678 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +123.883773 152.783217 m +123.883773 147.659948 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +209.254983 152.783217 m +209.254983 147.659948 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +358.154679 152.783217 m +358.154679 147.659948 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +124.652883 157.906487 m +124.652883 152.783217 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +199.256553 157.906487 m +199.256553 152.783217 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +350.079024 157.906487 m +350.079024 152.783217 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +357.923946 157.906487 m +357.923946 152.783217 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +202.10226 163.029757 m +202.10226 157.906487 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +430.912485 163.029757 m +430.912485 157.906487 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +126.652569 168.153026 m +126.652569 163.029757 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +129.190632 173.276296 m +129.190632 168.153026 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +196.872312 173.276296 m +196.872312 168.153026 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +205.486344 173.276296 m +205.486344 168.153026 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +354.078396 173.276296 m +354.078396 168.153026 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +117.653982 178.399565 m +117.653982 173.276296 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +195.94938 178.399565 m +195.94938 173.276296 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +203.025192 178.399565 m +203.025192 173.276296 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +278.397972 178.399565 m +278.397972 173.276296 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +289.473156 178.399565 m +289.473156 173.276296 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +350.617401 178.399565 m +350.617401 173.276296 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +427.836045 178.399565 m +427.836045 173.276296 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +433.988925 178.399565 m +433.988925 173.276296 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +125.96037 183.522835 m +125.96037 178.399565 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +196.410846 183.522835 m +196.410846 178.399565 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +289.165512 183.522835 m +289.165512 178.399565 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +358.539234 183.522835 m +358.539234 178.399565 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +130.805763 188.646104 m +130.805763 183.522835 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +201.640794 188.646104 m +201.640794 183.522835 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +281.012946 188.646104 m +281.012946 183.522835 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +354.001485 188.646104 m +354.001485 183.522835 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +361.615674 188.646104 m +361.615674 183.522835 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +132.574716 193.769374 m +132.574716 188.646104 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +197.256867 193.769374 m +197.256867 188.646104 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +351.463422 193.769374 m +351.463422 188.646104 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +435.296412 193.769374 m +435.296412 188.646104 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +431.835417 198.892643 m +431.835417 193.769374 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +121.422621 204.015913 m +121.422621 198.892643 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +132.88236 204.015913 m +132.88236 198.892643 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +195.872469 204.015913 m +195.872469 198.892643 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +203.486658 204.015913 m +203.486658 198.892643 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +274.475511 204.015913 m +274.475511 198.892643 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +283.320276 204.015913 m +283.320276 198.892643 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +345.848919 204.015913 m +345.848919 198.892643 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +358.000857 204.015913 m +358.000857 198.892643 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +428.528244 204.015913 m +428.528244 198.892643 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +199.179642 209.139183 m +199.179642 204.015913 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +217.48446 209.139183 m +217.48446 204.015913 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +281.858967 209.139183 m +281.858967 204.015913 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +356.847192 209.139183 m +356.847192 204.015913 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +437.526831 209.139183 m +437.526831 204.015913 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +127.114035 214.262452 m +127.114035 209.139183 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +198.410532 214.262452 m +198.410532 209.139183 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +353.770752 214.262452 m +353.770752 209.139183 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +364.153737 214.262452 m +364.153737 209.139183 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +433.065993 214.262452 m +433.065993 209.139183 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +124.499061 219.385722 m +124.499061 214.262452 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +198.410532 219.385722 m +198.410532 214.262452 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +272.783469 219.385722 m +272.783469 214.262452 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +434.911857 219.385722 m +434.911857 214.262452 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +121.960998 224.508991 m +121.960998 219.385722 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +197.179956 224.508991 m +197.179956 219.385722 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +206.71692 224.508991 m +206.71692 219.385722 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +277.859595 224.508991 m +277.859595 219.385722 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +352.770909 224.508991 m +352.770909 219.385722 l +stroke +grestore +gsave +461.466 140.89 74.43 92.585 clipbox +434.450391 224.508991 m +434.450391 219.385722 l +stroke +grestore +0.800 setlinewidth +0 setlinejoin +2 setlinecap +0.000 setgray +gsave +74.43 92.5848 m +74.43 233.474713 l +stroke +grestore +gsave +535.896 92.5848 m +535.896 233.474713 l +stroke +grestore +gsave +74.43 92.5848 m +535.896 92.5848 l +stroke +grestore +gsave +74.43 233.474713 m +535.896 233.474713 l +stroke +grestore + +end +showpage diff --git a/pydentate.net_tunedrev.TunedNetwork_spike-plot_paradigm_local-pattern-separation_run_scale_seed_input-seed_nw-seed_000_1000_10000[10000][10000].pdf b/pydentate.net_tunedrev.TunedNetwork_spike-plot_paradigm_local-pattern-separation_run_scale_seed_input-seed_nw-seed_000_1000_10000[10000][10000].pdf new file mode 100644 index 0000000..99df381 Binary files /dev/null and b/pydentate.net_tunedrev.TunedNetwork_spike-plot_paradigm_local-pattern-separation_run_scale_seed_input-seed_nw-seed_000_1000_10000[10000][10000].pdf differ diff --git a/pydentate/__init__.py b/pydentate/__init__.py index a4f139b..1044842 100644 --- a/pydentate/__init__.py +++ b/pydentate/__init__.py @@ -1,8 +1,12 @@ +# ruff: noqa: F401 import os -from . import net_tunedrev, inputs, input_generator - dirname = os.path.dirname(__file__) -linux_precompiled = os.path.join(dirname, 'x86_64', 'libnrnmech.so') -windows_precompiled = os.path.join(dirname, 'win64', 'nrnmech.dll') +linux_precompiled = os.path.join(dirname, "x86_64", ".libs", "libnrnmech.so") +windows_precompiled = os.path.join(dirname, "win64", "./libs", "nrnmech.dll") + +from .basketcell import BasketCell +from .granulecell import GranuleCell +from .hippcell import HippCell +from .mossycell_cat import MossyCell diff --git a/pydentate/inputs.py b/pydentate/inputs.py index 3da87de..18b0ed5 100644 --- a/pydentate/inputs.py +++ b/pydentate/inputs.py @@ -5,14 +5,13 @@ @author: Daniel & barisckuru """ + import numpy as np +import quantities as pq from elephant import spike_train_generation as stg from neo.core import AnalogSignal -import quantities as pq -from scipy.stats import skewnorm -from skimage.measure import profile_line from scipy import stats -import pdb +from scipy.stats import skewnorm def inhom_poiss(modulation_rate=10, max_rate=100, n_cells=400): @@ -26,13 +25,9 @@ def inhom_poiss(modulation_rate=10, max_rate=100, n_cells=400): t = np.arange(0, 0.5, sampling_interval.magnitude) - rate_profile = (np.sin(t*modulation_rate*np.pi*2-np.pi/2) + 1) * max_rate / 2 + rate_profile = (np.sin(t * modulation_rate * np.pi * 2 - np.pi / 2) + 1) * max_rate / 2 - rate_profile_as_asig = AnalogSignal(rate_profile, - units=1*pq.Hz, - t_start=0*pq.s, - t_stop=0.5*pq.s, - sampling_period=sampling_interval) + rate_profile_as_asig = AnalogSignal(rate_profile, units=1 * pq.Hz, t_start=0 * pq.s, t_stop=0.5 * pq.s, sampling_period=sampling_interval) spike_trains = [] for x in range(n_cells): @@ -41,11 +36,10 @@ def inhom_poiss(modulation_rate=10, max_rate=100, n_cells=400): # If there is not, we move the next spike by 0.1ms spike_trains.append(curr_train) - array_like = np.array([np.around(np.array(x.times)*1000, decimals=1) - for x in spike_trains], dtype=np.object) + array_like = np.array([np.around(np.array(x.times) * 1000, decimals=1) for x in spike_trains], dtype=object) for arr_idx in range(array_like.shape[0]): bad_idc = np.argwhere(np.diff(array_like[arr_idx]) == 0).flatten() - bad_idc = bad_idc+1 + bad_idc = bad_idc + 1 while bad_idc.any(): for bad_idx in bad_idc: array_like[arr_idx][bad_idx] = array_like[arr_idx][bad_idx] + 0.1 @@ -54,11 +48,20 @@ def inhom_poiss(modulation_rate=10, max_rate=100, n_cells=400): return array_like + def gaussian_connectivity_gc_bc(n_pre, n_gc, n_bc, n_syn_gc, n_syn_bc, scale_gc, scale_bc): """TODO""" pass -def gaussian_connectivity(n_pre, n_post, n_syn=[100,], scale=[1000, 12]): + +def gaussian_connectivity( + n_pre, + n_post, + n_syn=[ + 100, + ], + scale=[1000, 12], +): """TODO THIS IS A STUB FOR A GENERALIZED VERSION OF gaussian_connectivity_gc_bc Choose n_syn postsynaptic cells for each presynaptic cells. Clean up this function. It is not Pythonic. @@ -84,9 +87,9 @@ def gaussian_connectivity(n_pre, n_post, n_syn=[100,], scale=[1000, 12]): center = np.array(n_post) // 2 gauss = stats.norm(loc=center[0], scale=scale[0]) pdf = gauss.pdf(np.arange(n_post[0])) - pdf = pdf/pdf.sum() + pdf = pdf / pdf.sum() post_idc = np.arange(n_post[0]) - start_idc = np.random.randint(0, n_post[0]-1, size=n_pre) + start_idc = np.random.randint(0, n_post[0] - 1, size=n_pre) out_list = [] for idx, n_post_pop in enumerate(n_post): @@ -95,66 +98,68 @@ def gaussian_connectivity(n_pre, n_post, n_syn=[100,], scale=[1000, 12]): for x in start_idc: curr_idc = np.concatenate((post_idc[x:n_post_pop], post_idc[0:x])) # pdb.set_trace() - pre_to_post.append(np.random.choice(curr_idc, size=n_syn[idx], replace=False, - p=pdf)) + pre_to_post.append(np.random.choice(curr_idc, size=n_syn[idx], replace=False, p=pdf)) out_list.append(pre_to_post) - if idx+1 < len(n_post): - gauss = stats.norm(loc=center[idx+1], scale=scale[idx+1]) - pdf = gauss.pdf(n_post[idx+1]) - pdf = pdf/pdf.sum() - post_idc = np.arange(n_post[idx+1]) - start_idc = np.array(((start_idc/n_post_pop)*n_post[idx+1]), dtype=int) - + if idx + 1 < len(n_post): + gauss = stats.norm(loc=center[idx + 1], scale=scale[idx + 1]) + pdf = gauss.pdf(n_post[idx + 1]) + pdf = pdf / pdf.sum() + post_idc = np.arange(n_post[idx + 1]) + start_idc = np.array(((start_idc / n_post_pop) * n_post[idx + 1]), dtype=int) return np.array(pre_to_post) -#Solstad 2006 Grid Model + +# Solstad 2006 Grid Model def _grid_maker(spacing, orientation, pos_peak, arr_size, sizexy, max_rate): - #define the params from input here, scale the resulting array for maxrate and sperate the xy for size and shift - arr_size = arr_size #200*200 dp was good enough in terms of resolution + # define the params from input here, scale the resulting array for maxrate and sperate the xy for size and shift + arr_size = arr_size # 200*200 dp was good enough in terms of resolution x, y = pos_peak - pos_peak = np.array([x,y]) + pos_peak = np.array([x, y]) max_rate = max_rate - lambda_spacing = spacing*(arr_size/100) #100 required for conversion - k = (4*np.pi)/(lambda_spacing*np.sqrt(3)) + lambda_spacing = spacing * (arr_size / 100) # 100 required for conversion + k = (4 * np.pi) / (lambda_spacing * np.sqrt(3)) degrees = orientation - theta = np.pi*(degrees/180) + theta = np.pi * (degrees / 180) meterx, metery = sizexy - arrx = meterx*arr_size # *arr_size for defining the 2d array size - arry = metery*arr_size - dims = np.array([arrx,arry]) + arrx = meterx * arr_size # *arr_size for defining the 2d array size + arry = metery * arr_size + dims = np.array([arrx, arry]) rate = np.ones(dims) - #implementation of grid function + # implementation of grid function # 3 k values for 3 cos gratings with different angles to generate grid fields - k1 = ((k/np.sqrt(2))*np.array((np.cos(theta+(np.pi)/12) + np.sin(theta+(np.pi)/12), - np.cos(theta+(np.pi)/12) - np.sin(theta+(np.pi)/12)))).reshape(2,) - k2 = ((k/np.sqrt(2))*np.array((np.cos(theta+(5*np.pi)/12) + np.sin(theta+(5*np.pi)/12), - np.cos(theta+(5*np.pi)/12) - np.sin(theta+(5*np.pi)/12)))).reshape(2,) - k3 = ((k/np.sqrt(2))*np.array((np.cos(theta+(9*np.pi)/12) + np.sin(theta+(9*np.pi)/12), - np.cos(theta+(9*np.pi)/12) - np.sin(theta+(9*np.pi)/12)))).reshape(2,) - - rate[i,j] = (np.cos(np.dot(k1, curr_dist))+ - np.cos(np.dot(k2, curr_dist))+ np.cos(np.dot(k3, curr_dist)))/3 - rate = max_rate*2/3*(rate+1/2) # arr is the resulting 2d grid out of 3 gratings + k1 = ((k / np.sqrt(2)) * np.array((np.cos(theta + (np.pi) / 12) + np.sin(theta + (np.pi) / 12), np.cos(theta + (np.pi) / 12) - np.sin(theta + (np.pi) / 12)))).reshape( + 2, + ) + k2 = ((k / np.sqrt(2)) * np.array((np.cos(theta + (5 * np.pi) / 12) + np.sin(theta + (5 * np.pi) / 12), np.cos(theta + (5 * np.pi) / 12) - np.sin(theta + (5 * np.pi) / 12)))).reshape( + 2, + ) + k3 = ((k / np.sqrt(2)) * np.array((np.cos(theta + (9 * np.pi) / 12) + np.sin(theta + (9 * np.pi) / 12), np.cos(theta + (9 * np.pi) / 12) - np.sin(theta + (9 * np.pi) / 12)))).reshape( + 2, + ) + + rate[i, j] = (np.cos(np.dot(k1, curr_dist)) + np.cos(np.dot(k2, curr_dist)) + np.cos(np.dot(k3, curr_dist))) / 3 + rate = max_rate * 2 / 3 * (rate + 1 / 2) # arr is the resulting 2d grid out of 3 gratings return rate - -def _grid_population(n_grid, max_rate, seed, arena_size=[1,1], arr_size=200): + + +def _grid_population(n_grid, max_rate, seed, arena_size=[1, 1], arr_size=200): # skewed normal distribution for grid spacings np.random.seed(seed) median_spc = 43 spc_max = 100 - skewness = 6 #Negative values are left skewed, positive values are right skewed. - grid_spc = skewnorm.rvs(a = skewness,loc=spc_max, size=n_grid) #Skewnorm function - grid_spc = grid_spc - min(grid_spc) #Shift the set so the minimum value is equal to zero. - grid_spc = grid_spc / max(grid_spc) #Standadize all the vlues between 0 and 1. - grid_spc = grid_spc * spc_max #Multiply the standardized values by the maximum value. + skewness = 6 # Negative values are left skewed, positive values are right skewed. + grid_spc = skewnorm.rvs(a=skewness, loc=spc_max, size=n_grid) # Skewnorm function + grid_spc = grid_spc - min(grid_spc) # Shift the set so the minimum value is equal to zero. + grid_spc = grid_spc / max(grid_spc) # Standadize all the vlues between 0 and 1. + grid_spc = grid_spc * spc_max # Multiply the standardized values by the maximum value. grid_spc = grid_spc + (median_spc - np.median(grid_spc)) - - grid_ori = np.random.randint(0, high=60, size=[n_grid,1]) #uniform dist for orientation btw 0-60 degrees - grid_phase = np.random.randint(0, high=(arr_size-1), size=[n_grid,2]) #uniform dist grid phase - + + grid_ori = np.random.randint(0, high=60, size=[n_grid, 1]) # uniform dist for orientation btw 0-60 degrees + grid_phase = np.random.randint(0, high=(arr_size - 1), size=[n_grid, 2]) # uniform dist grid phase + # create a 3d array with grids for n_grid - rate_grids = np.zeros((arr_size, arr_size, n_grid))#empty array + rate_grids = np.zeros((arr_size, arr_size, n_grid)) # empty array for i in range(n_grid): x = grid_phase[i][0] y = grid_phase[i][1] @@ -166,17 +171,11 @@ def _grid_population(n_grid, max_rate, seed, arena_size=[1,1], arr_size=200): def _inhom_poiss(arr, dur_s, poiss_seed=0, dt_s=0.025): np.random.seed(poiss_seed) n_cells = arr.shape[0] - spi_arr = np.zeros((n_cells), dtype = np.ndarray) + spi_arr = np.zeros((n_cells), dtype=np.ndarray) for grid_idc in range(n_cells): - np.random.seed(poiss_seed+grid_idc) - rate_profile = arr[grid_idc,:] - asig = AnalogSignal(rate_profile, - units=1*pq.Hz, - t_start=0*pq.s, - t_stop=dur_s*pq.s, - sampling_period=dt_s*pq.s, - sampling_interval=dt_s*pq.s) + np.random.seed(poiss_seed + grid_idc) + rate_profile = arr[grid_idc, :] + asig = AnalogSignal(rate_profile, units=1 * pq.Hz, t_start=0 * pq.s, t_stop=dur_s * pq.s, sampling_period=dt_s * pq.s, sampling_interval=dt_s * pq.s) curr_train = stg.inhomogeneous_poisson_process(asig) - spi_arr[grid_idc] = np.array(curr_train.times*1000) #time conv to ms + spi_arr[grid_idc] = np.array(curr_train.times * 1000) # time conv to ms return spi_arr - diff --git a/pydentate/net_tunedrev.py b/pydentate/net_tunedrev.py index 697fd9f..04a8521 100644 --- a/pydentate/net_tunedrev.py +++ b/pydentate/net_tunedrev.py @@ -9,37 +9,33 @@ @author: DanielM """ -from ouropy import gennetwork import numpy as np + +from ouropy import gennetwork + # from granulecell import GranuleCell # from mossycell_cat import MossyCell # from basketcell import BasketCell # from hippcell import HippCell - -from . import granulecell -from . import mossycell_cat -from . import basketcell -from . import hippcell +from . import basketcell, granulecell, hippcell, mossycell_cat GranuleCell = granulecell.GranuleCell MossyCell = mossycell_cat.MossyCell BasketCell = basketcell.BasketCell HippCell = hippcell.HippCell + class TunedNetwork(gennetwork.GenNetwork): - """ This model implements the ring model from Santhakumar et al. 2005. + """This model implements the ring model from Santhakumar et al. 2005. with some changes as in Yim et al. 2015. It features inhibition but omits the MC->GC connection. """ + name = "TunedNetwork" - def __init__(self, seed=None, temporal_patterns=np.array([]), - spatial_patterns_gcs=np.array([]), - spatial_patterns_bcs=np.array([]), - network_type='full', - pp_weight=1e-3): + def __init__(self, seed=None, temporal_patterns=np.array([]), spatial_patterns_gcs=np.array([]), spatial_patterns_bcs=np.array([]), network_type="full", pp_weight=1e-3): self.init_params = locals() - self.init_params['self'] = str(self.init_params['self']) + self.init_params["self"] = str(self.init_params["self"]) # Setup cells self.mk_population(GranuleCell, 2000) self.mk_population(MossyCell, 60) @@ -86,92 +82,61 @@ def __init__(self, seed=None, temporal_patterns=np.array([]), 'no-feedback', 'no-feedforward' or 'disinhibited'""" ) - if (type(spatial_patterns_gcs) == np.ndarray and - type(temporal_patterns) == np.ndarray): + if type(spatial_patterns_gcs) == np.ndarray and type(temporal_patterns) == np.ndarray: + print(len(spatial_patterns_gcs)) for pa in range(len(spatial_patterns_gcs)): # PP -> GC - gennetwork.PerforantPathPoissonTmgsyn(self.populations[0], - temporal_patterns[pa], - spatial_patterns_gcs[pa], - 'midd', 10, 0, 1, 0, 0, - pp_weight) - - if (type(spatial_patterns_bcs) == np.ndarray and - type(temporal_patterns) == np.ndarray): + gennetwork.PerforantPathPoissonTmgsyn(self.populations[0], temporal_patterns[pa], spatial_patterns_gcs[pa], "midd", 10, 0, 1, 0, 0, pp_weight) + + if type(spatial_patterns_bcs) == np.ndarray and type(temporal_patterns) == np.ndarray: + print(len(spatial_patterns_bcs)) for pa in range(len(spatial_patterns_bcs)): # PP -> BC - gennetwork.PerforantPathPoissonTmgsyn(self.populations[2], - temporal_patterns[pa], - spatial_patterns_bcs[pa], - 'ddend', 6.3, 0, 1, 0, 0, - pp_bc) + gennetwork.PerforantPathPoissonTmgsyn(self.populations[2], temporal_patterns[pa], spatial_patterns_bcs[pa], "ddend", 6.3, 0, 1, 0, 0, pp_bc) # GC -> MC - gennetwork.tmgsynConnection(self.populations[0], self.populations[1], - 12, 'proxd', 1, 7.6, 500, 0.1, 0, 0, 10, - 1.5, gc_mc) + gennetwork.tmgsynConnection(self.populations[0], self.populations[1], 12, "proxd", 1, 7.6, 500, 0.1, 0, 0, 10, 1.5, gc_mc) # GC -> BC # Weight x4, target_pool = 2 - gennetwork.tmgsynConnection(self.populations[0], self.populations[2], - 8, 'proxd', 1, 8.7, 500, 0.1, 0, 0, 10, - 0.8, gc_bc) + gennetwork.tmgsynConnection(self.populations[0], self.populations[2], 8, "proxd", 1, 8.7, 500, 0.1, 0, 0, 10, 0.8, gc_bc) # GC -> HC # Divergence x4; Weight doubled; Connected randomly. - gennetwork.tmgsynConnection(self.populations[0], self.populations[3], - 24, 'proxd', 1, 8.7, 500, 0.1, 0, 0, 10, - 1.5, gc_hc) + gennetwork.tmgsynConnection(self.populations[0], self.populations[3], 24, "proxd", 1, 8.7, 500, 0.1, 0, 0, 10, 1.5, gc_hc) # MC -> MC - gennetwork.tmgsynConnection(self.populations[1], self. populations[1], - 24, 'proxd', 3, 2.2, 0, 1, 0, 0, 10, - 2, 5e-4) + # pre_pop, post_pop, target_pool, target_segs, divergence, tau_1, tau_facil, U, tau_rec, e, thr, delay, weight + gennetwork.tmgsynConnection(self.populations[1], self.populations[1], 24, "proxd", 3, 2.2, 0, 1, 0, 0, 10, 2, 5e-4) # MC -> BC - gennetwork.tmgsynConnection(self.populations[1], self.populations[2], - 12, 'proxd', 1, 2, 0, 1, 0, 0, 10, - 3, 3e-4) + gennetwork.tmgsynConnection(self.populations[1], self.populations[2], 12, "proxd", 1, 2, 0, 1, 0, 0, 10, 3, 3e-4) # MC -> HC - gennetwork.tmgsynConnection(self.populations[1], self.populations[3], - 20, 'midd', 2, 6.2, 0, 1, 0, 0, 10, - 3, 2e-4) + gennetwork.tmgsynConnection(self.populations[1], self.populations[3], 20, "midd", 2, 6.2, 0, 1, 0, 0, 10, 3, 2e-4) # BC -> GC # # synapses x3; Weight *1/4; tau from 5.5 to 20 (Hefft & Jonas, 2005) - gennetwork.tmgsynConnection(self.populations[2], self.populations[0], - 560, 'soma', 400, 20, 0, 1, 0, -70, 10, - 0.85, bc_gc) + gennetwork.tmgsynConnection(self.populations[2], self.populations[0], 560, "soma", 400, 20, 0, 1, 0, -70, 10, 0.85, bc_gc) # We reseed here to make sure that those connections are consistent # between this and net_global which has a global target pool for # BC->GC. if seed: - self.set_numpy_seed(seed+1) + self.set_numpy_seed(seed + 1) # BC -> MC - gennetwork.tmgsynConnection(self.populations[2], self.populations[1], - 28, 'proxd', 3, 3.3, 0, 1, 0, -70, 10, - 1.5, 1.5e-3) + gennetwork.tmgsynConnection(self.populations[2], self.populations[1], 28, "proxd", 3, 3.3, 0, 1, 0, -70, 10, 1.5, 1.5e-3) # BC -> BC - gennetwork.tmgsynConnection(self.populations[2], self.populations[2], - 12, 'proxd', 2, 1.8, 0, 1, 0, -70, 10, - 0.8, 7.6e-3) + gennetwork.tmgsynConnection(self.populations[2], self.populations[2], 12, "proxd", 2, 1.8, 0, 1, 0, -70, 10, 0.8, 7.6e-3) # HC -> GC # Weight x10; Nr synapses x4; tau from 6 to 20 (Hefft & Jonas, 2005) - gennetwork.tmgsynConnection(self.populations[3], self.populations[0], - 2000, 'dd', 640, 20, 0, 1, 0, -70, 10, - 3.8, hc_gc) + gennetwork.tmgsynConnection(self.populations[3], self.populations[0], 2000, "dd", 640, 20, 0, 1, 0, -70, 10, 3.8, hc_gc) # HC -> MC - gennetwork.tmgsynConnection(self.populations[3], self.populations[1], - 60, ['mid1d', 'mid2d'], 4, 6, 0, 1, 0, -70, - 10, 1, 1.5e-3) + gennetwork.tmgsynConnection(self.populations[3], self.populations[1], 60, ["mid1d", "mid2d"], 4, 6, 0, 1, 0, -70, 10, 1, 1.5e-3) # HC -> BC - gennetwork.tmgsynConnection(self.populations[3], self.populations[2], - 24, 'ddend', 4, 5.8, 0, 1, 0, -70, 10, - 1.6, 5e-4) + gennetwork.tmgsynConnection(self.populations[3], self.populations[2], 24, "ddend", 4, 5.8, 0, 1, 0, -70, 10, 1.6, 5e-4) diff --git a/pydentate/neuron_tools.py b/pydentate/neuron_tools.py index 9d96893..25d77db 100644 --- a/pydentate/neuron_tools.py +++ b/pydentate/neuron_tools.py @@ -1,24 +1,32 @@ -from neuron import h, gui -from pydentate import windows_precompiled, linux_precompiled import platform -def load_compiled_mechanisms(path='precompiled'): +from neuron import h + +from pydentate import linux_precompiled, windows_precompiled + + +def load_compiled_mechanisms(path="precompiled"): """Loads precompiled mechanisms in pyDentate unless path defines the full path to a compiled mechanism file.""" - if path != 'precompiled': + if path != "precompiled": h.nrn_load_dll(path) else: - if platform.system() == 'Windows': + if platform.system() == "Windows": h.nrn_load_dll(windows_precompiled) else: + print("DLL loaded from: " + linux_precompiled) h.nrn_load_dll(linux_precompiled) -def run_neuron_simulator(warmup=2000, dt_warmup=10, dt_sim=0.1, t_start=0, - t_stop=600, v_init=-60): + +def run_neuron_simulator(warmup=2000, dt_warmup=10, dt_sim=0.1, t_start=0, t_stop=600, v_init=-60): + h.load_file("stdrun.hoc") + h.cvode.active(0) dt = 0.1 - h.steps_per_ms = 1.0/dt + h.steps_per_ms = 1.0 / dt + h.finitialize(v_init) + h.t = -warmup h.secondorder = 0 h.dt = dt_warmup diff --git a/pydentate/win64/gskch.mod b/pydentate/win64/gskch.mod index 67a781a..a771c33 100644 --- a/pydentate/win64/gskch.mod +++ b/pydentate/win64/gskch.mod @@ -67,9 +67,7 @@ PROCEDURE state() { :Computes state variable q at current v and dt. cai = ncai + lcai + tcai rate(cai) q = q + (qinf-q) * qexp - VERBATIM - return 0; - ENDVERBATIM + } LOCAL q10 diff --git a/pydentate/win64/hyperde3.mod b/pydentate/win64/hyperde3.mod index dc0e40d..6240ce0 100644 --- a/pydentate/win64/hyperde3.mod +++ b/pydentate/win64/hyperde3.mod @@ -102,9 +102,7 @@ INITIAL { hys = hysinf hyhtf = hyhtfinf hyhts = hyhtsinf - VERBATIM - return 0; - ENDVERBATIM + } ? states @@ -116,9 +114,6 @@ PROCEDURE states() { :Computes state variables m, h, and n hyhtf = hyhtf + hyhtfexp*(hyhtfinf-hyhtf) hyhts = hyhts + hyhtsexp*(hyhtsinf-hyhts) - VERBATIM - return 0; - ENDVERBATIM } LOCAL q10 diff --git a/pydentate/win64/ichan2.mod b/pydentate/win64/ichan2.mod index 4d79f53..3c6a147 100644 --- a/pydentate/win64/ichan2.mod +++ b/pydentate/win64/ichan2.mod @@ -90,9 +90,7 @@ INITIAL { nf = nfinf ns = nsinf - VERBATIM - return 0; - ENDVERBATIM + } ? states @@ -102,9 +100,7 @@ PROCEDURE states() { :Computes state variables m, h, and n h = h + hexp*(hinf-h) nf = nf + nfexp*(nfinf-nf) ns = ns + nsexp*(nsinf-ns) - VERBATIM - return 0; - ENDVERBATIM + } LOCAL q10 diff --git a/pydentate/win64/nca.mod b/pydentate/win64/nca.mod index 701923e..070761b 100644 --- a/pydentate/win64/nca.mod +++ b/pydentate/win64/nca.mod @@ -68,9 +68,7 @@ PROCEDURE states() { :Computes state variables m, h, and n trates(v) : at the current v and dt. c = c + cexp*(cinf-c) d = d + dexp*(dinf-d) - VERBATIM - return 0; - ENDVERBATIM + } LOCAL q10 diff --git a/pydentate/x86_64/.libs/libnrnmech.so b/pydentate/x86_64/.libs/libnrnmech.so old mode 100644 new mode 100755 index 7922274..4c1bcb8 Binary files a/pydentate/x86_64/.libs/libnrnmech.so and b/pydentate/x86_64/.libs/libnrnmech.so differ diff --git a/pydentate/x86_64/CaBK.c b/pydentate/x86_64/CaBK.c index 1ebbd56..17afdcc 100644 --- a/pydentate/x86_64/CaBK.c +++ b/pydentate/x86_64/CaBK.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -46,15 +46,25 @@ extern double hoc_Exp(double); #define t nrn_threads->_t #define dt nrn_threads->_dt #define gkbar _p[0] +#define gkbar_columnindex 0 #define ik _p[1] +#define ik_columnindex 1 #define gkca _p[2] +#define gkca_columnindex 2 #define o _p[3] +#define o_columnindex 3 #define ek _p[4] +#define ek_columnindex 4 #define lcai _p[5] +#define lcai_columnindex 5 #define ncai _p[6] +#define ncai_columnindex 6 #define tcai _p[7] +#define tcai_columnindex 7 #define Do _p[8] +#define Do_columnindex 8 #define _g _p[9] +#define _g_columnindex 9 #define _ion_ncai *_ppvar[0]._pval #define _ion_lcai *_ppvar[1]._pval #define _ion_tcai *_ppvar[2]._pval @@ -183,15 +193,15 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); static int _ode_count(int); static void _ode_map(int, double**, double**, double*, Datum*, double*, int); -static void _ode_spec(_NrnThread*, _Memb_list*, int); -static void _ode_matsol(_NrnThread*, _Memb_list*, int); +static void _ode_spec(NrnThread*, _Memb_list*, int); +static void _ode_matsol(NrnThread*, _Memb_list*, int); #define _cvode_ieq _ppvar[6]._i static void _ode_matsol_instance1(_threadargsproto_); @@ -250,7 +260,7 @@ static void nrn_alloc(Prop* _prop) { static void _update_ion_pointer(Datum*); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -284,7 +294,7 @@ extern void _cvode_abstol( Symbol**, double*, int); hoc_register_cvode(_mechtype, _ode_count, _ode_map, _ode_spec, _ode_matsol); hoc_register_tolerance(_mechtype, _hoc_state_tol, &_atollist); hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 cagk /home/danielmk/repos/pyDentate/mechs/CaBK.mod\n"); + ivoc_help("help ?1 cagk /Users/temma/ghq/pydentate/mechs/CaBK.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -383,7 +393,7 @@ static void _hoc_rate(void) { static int _ode_count(int _type){ return 1;} -static void _ode_spec(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_spec(NrnThread* _nt, _Memb_list* _ml, int _type) { Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -412,7 +422,7 @@ static void _ode_matsol_instance1(_threadargsproto_) { _ode_matsol1 (); } -static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_matsol(NrnThread* _nt, _Memb_list* _ml, int _type) { Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -453,7 +463,7 @@ static void initmodel() { } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -487,7 +497,7 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ { } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -527,7 +537,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -547,7 +557,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -582,12 +592,12 @@ static void terminal(){} static void _initlists() { int _i; static int _first = 1; if (!_first) return; - _slist1[0] = &(o) - _p; _dlist1[0] = &(Do) - _p; + _slist1[0] = o_columnindex; _dlist1[0] = Do_columnindex; _first = 0; } #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/CaBK.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/CaBK.mod"; static const char* nmodl_file_text = "TITLE CaGk\n" ": Calcium activated K channel.\n" diff --git a/pydentate/x86_64/CaBK.o b/pydentate/x86_64/CaBK.o index d50cbea..e21d7d6 100644 Binary files a/pydentate/x86_64/CaBK.o and b/pydentate/x86_64/CaBK.o differ diff --git a/pydentate/x86_64/Gfluct2.c b/pydentate/x86_64/Gfluct2.c index 00bb19a..5a0d17b 100644 --- a/pydentate/x86_64/Gfluct2.c +++ b/pydentate/x86_64/Gfluct2.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -46,25 +46,45 @@ extern double hoc_Exp(double); #define t nrn_threads->_t #define dt nrn_threads->_dt #define E_e _p[0] +#define E_e_columnindex 0 #define E_i _p[1] +#define E_i_columnindex 1 #define g_e0 _p[2] +#define g_e0_columnindex 2 #define g_i0 _p[3] +#define g_i0_columnindex 3 #define std_e _p[4] +#define std_e_columnindex 4 #define std_i _p[5] +#define std_i_columnindex 5 #define tau_e _p[6] +#define tau_e_columnindex 6 #define tau_i _p[7] +#define tau_i_columnindex 7 #define i _p[8] +#define i_columnindex 8 #define g_e _p[9] +#define g_e_columnindex 9 #define g_i _p[10] +#define g_i_columnindex 10 #define g_e1 _p[11] +#define g_e1_columnindex 11 #define g_i1 _p[12] +#define g_i1_columnindex 12 #define D_e _p[13] +#define D_e_columnindex 13 #define D_i _p[14] +#define D_i_columnindex 14 #define exp_e _p[15] +#define exp_e_columnindex 15 #define exp_i _p[16] +#define exp_i_columnindex 16 #define amp_e _p[17] +#define amp_e_columnindex 17 #define amp_i _p[18] +#define amp_i_columnindex 18 #define _g _p[19] +#define _g_columnindex 19 #define _nd_area *_ppvar[0]._pval #if MAC @@ -82,8 +102,8 @@ extern "C" { static int hoc_nrnpointerindex = -1; /* external NEURON variables */ /* declaration of user functions */ - static double _hoc_new_seed(); - static double _hoc_oup(); + static double _hoc_new_seed(void*); + static double _hoc_oup(void*); static int _mechtype; extern void _nrn_cacheloop_reg(int, int); extern void hoc_register_prop_size(int, int, int); @@ -102,18 +122,18 @@ extern void hoc_reg_nmodl_filename(int, const char*); extern Prop* nrn_point_prop_; static int _pointtype; - static void* _hoc_create_pnt(_ho) Object* _ho; { void* create_point_process(); + static void* _hoc_create_pnt(Object* _ho) { void* create_point_process(int, Object*); return create_point_process(_pointtype, _ho); } - static void _hoc_destroy_pnt(); - static double _hoc_loc_pnt(_vptr) void* _vptr; {double loc_point_process(); + static void _hoc_destroy_pnt(void*); + static double _hoc_loc_pnt(void* _vptr) {double loc_point_process(int, void*); return loc_point_process(_pointtype, _vptr); } - static double _hoc_has_loc(_vptr) void* _vptr; {double has_loc_point(); + static double _hoc_has_loc(void* _vptr) {double has_loc_point(void*); return has_loc_point(_vptr); } - static double _hoc_get_loc_pnt(_vptr)void* _vptr; { - double get_loc_point_process(); return (get_loc_point_process(_vptr)); + static double _hoc_get_loc_pnt(void* _vptr) { + double get_loc_point_process(void*); return (get_loc_point_process(_vptr)); } extern void _nrn_setdata_reg(int, void(*)(Prop*)); static void _setdata(Prop* _prop) { @@ -169,11 +189,11 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); - static void _hoc_destroy_pnt(_vptr) void* _vptr; { +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); + static void _hoc_destroy_pnt(void* _vptr) { destroy_point_process(_vptr); } @@ -235,7 +255,7 @@ static void nrn_alloc(Prop* _prop) { static void _initlists(); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -257,7 +277,7 @@ extern void _cvode_abstol( Symbol**, double*, int); hoc_register_dparam_semantics(_mechtype, 1, "pntproc"); hoc_register_cvode(_mechtype, _ode_count, 0, 0, 0); hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 Gfluct2 /home/danielmk/repos/pyDentate/mechs/Gfluct2.mod\n"); + ivoc_help("help ?1 Gfluct2 /Users/temma/ghq/pydentate/mechs/Gfluct2.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -329,7 +349,7 @@ static void initmodel() { } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -372,7 +392,7 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ { } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -406,7 +426,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -426,7 +446,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -461,7 +481,7 @@ _first = 0; } #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/Gfluct2.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/Gfluct2.mod"; static const char* nmodl_file_text = "TITLE Fluctuating conductances\n" "\n" diff --git a/pydentate/x86_64/Gfluct2.o b/pydentate/x86_64/Gfluct2.o index 3c11770..87dd1b3 100644 Binary files a/pydentate/x86_64/Gfluct2.o and b/pydentate/x86_64/Gfluct2.o differ diff --git a/pydentate/x86_64/LcaMig.c b/pydentate/x86_64/LcaMig.c index a18a738..2510c25 100644 --- a/pydentate/x86_64/LcaMig.c +++ b/pydentate/x86_64/LcaMig.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -46,14 +46,23 @@ extern double hoc_Exp(double); #define t nrn_threads->_t #define dt nrn_threads->_dt #define glcabar _p[0] +#define glcabar_columnindex 0 #define ilca _p[1] +#define ilca_columnindex 1 #define m _p[2] +#define m_columnindex 2 #define cai _p[3] +#define cai_columnindex 3 #define cao _p[4] +#define cao_columnindex 4 #define Dm _p[5] +#define Dm_columnindex 5 #define glca _p[6] +#define glca_columnindex 6 #define elca _p[7] +#define elca_columnindex 7 #define _g _p[8] +#define _g_columnindex 8 #define _ion_elca *_ppvar[0]._pval #define _ion_ilca *_ppvar[1]._pval #define _ion_dilcadv *_ppvar[2]._pval @@ -177,15 +186,15 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); static int _ode_count(int); static void _ode_map(int, double**, double**, double*, Datum*, double*, int); -static void _ode_spec(_NrnThread*, _Memb_list*, int); -static void _ode_matsol(_NrnThread*, _Memb_list*, int); +static void _ode_spec(NrnThread*, _Memb_list*, int); +static void _ode_matsol(NrnThread*, _Memb_list*, int); #define _cvode_ieq _ppvar[5]._i static void _ode_matsol_instance1(_threadargsproto_); @@ -236,7 +245,7 @@ static void nrn_alloc(Prop* _prop) { static void _update_ion_pointer(Datum*); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -265,7 +274,7 @@ extern void _cvode_abstol( Symbol**, double*, int); hoc_register_cvode(_mechtype, _ode_count, _ode_map, _ode_spec, _ode_matsol); hoc_register_tolerance(_mechtype, _hoc_state_tol, &_atollist); hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 lca /home/danielmk/repos/pyDentate/mechs/LcaMig.mod\n"); + ivoc_help("help ?1 lca /Users/temma/ghq/pydentate/mechs/LcaMig.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -490,7 +499,7 @@ static void _hoc_rate(void) { static int _ode_count(int _type){ return 1;} -static void _ode_spec(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_spec(NrnThread* _nt, _Memb_list* _ml, int _type) { Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -518,7 +527,7 @@ static void _ode_matsol_instance1(_threadargsproto_) { _ode_matsol1 (); } -static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_matsol(NrnThread* _nt, _Memb_list* _ml, int _type) { Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -559,7 +568,7 @@ static void initmodel() { } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -592,7 +601,7 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ { } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -631,7 +640,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -651,7 +660,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -687,12 +696,12 @@ static void _initlists() { if (!_first) return; _t_alp = makevector(201*sizeof(double)); _t_bet = makevector(201*sizeof(double)); - _slist1[0] = &(m) - _p; _dlist1[0] = &(Dm) - _p; + _slist1[0] = m_columnindex; _dlist1[0] = Dm_columnindex; _first = 0; } #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/LcaMig.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/LcaMig.mod"; static const char* nmodl_file_text = "TITLE l-calcium channel\n" ": l-type calcium channel\n" diff --git a/pydentate/x86_64/LcaMig.o b/pydentate/x86_64/LcaMig.o index d89c238..2b547a2 100644 Binary files a/pydentate/x86_64/LcaMig.o and b/pydentate/x86_64/LcaMig.o differ diff --git a/pydentate/x86_64/bgka.c b/pydentate/x86_64/bgka.c index 3effd27..0db07e6 100644 --- a/pydentate/x86_64/bgka.c +++ b/pydentate/x86_64/bgka.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -46,14 +46,23 @@ extern double hoc_Exp(double); #define t nrn_threads->_t #define dt nrn_threads->_dt #define gkabar _p[0] +#define gkabar_columnindex 0 #define ik _p[1] +#define ik_columnindex 1 #define gka _p[2] +#define gka_columnindex 2 #define n _p[3] +#define n_columnindex 3 #define l _p[4] +#define l_columnindex 4 #define ek _p[5] +#define ek_columnindex 5 #define Dn _p[6] +#define Dn_columnindex 6 #define Dl _p[7] +#define Dl_columnindex 7 #define _g _p[8] +#define _g_columnindex 8 #define _ion_ek *_ppvar[0]._pval #define _ion_ik *_ppvar[1]._pval #define _ion_dikdv *_ppvar[2]._pval @@ -190,15 +199,15 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); static int _ode_count(int); static void _ode_map(int, double**, double**, double*, Datum*, double*, int); -static void _ode_spec(_NrnThread*, _Memb_list*, int); -static void _ode_matsol(_NrnThread*, _Memb_list*, int); +static void _ode_spec(NrnThread*, _Memb_list*, int); +static void _ode_matsol(NrnThread*, _Memb_list*, int); #define _cvode_ieq _ppvar[3]._i static void _ode_matsol_instance1(_threadargsproto_); @@ -246,7 +255,7 @@ static void nrn_alloc(Prop* _prop) { static void _update_ion_pointer(Datum*); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -271,7 +280,7 @@ extern void _cvode_abstol( Symbol**, double*, int); hoc_register_cvode(_mechtype, _ode_count, _ode_map, _ode_spec, _ode_matsol); hoc_register_tolerance(_mechtype, _hoc_state_tol, &_atollist); hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 borgka /home/danielmk/repos/pyDentate/mechs/bgka.mod\n"); + ivoc_help("help ?1 borgka /Users/temma/ghq/pydentate/mechs/bgka.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -386,7 +395,7 @@ static void _hoc_rates(void) { static int _ode_count(int _type){ return 2;} -static void _ode_spec(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_spec(NrnThread* _nt, _Memb_list* _ml, int _type) { Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -412,7 +421,7 @@ static void _ode_matsol_instance1(_threadargsproto_) { _ode_matsol1 (); } -static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_matsol(NrnThread* _nt, _Memb_list* _ml, int _type) { Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -448,7 +457,7 @@ static void initmodel() { } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -479,7 +488,7 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ { } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -516,7 +525,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -536,7 +545,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -568,13 +577,13 @@ static void terminal(){} static void _initlists() { int _i; static int _first = 1; if (!_first) return; - _slist1[0] = &(n) - _p; _dlist1[0] = &(Dn) - _p; - _slist1[1] = &(l) - _p; _dlist1[1] = &(Dl) - _p; + _slist1[0] = n_columnindex; _dlist1[0] = Dn_columnindex; + _slist1[1] = l_columnindex; _dlist1[1] = Dl_columnindex; _first = 0; } #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/bgka.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/bgka.mod"; static const char* nmodl_file_text = "TITLE Borg-Graham type generic K-A channel\n" "UNITS {\n" diff --git a/pydentate/x86_64/bgka.o b/pydentate/x86_64/bgka.o index ca3ce3f..0123815 100644 Binary files a/pydentate/x86_64/bgka.o and b/pydentate/x86_64/bgka.o differ diff --git a/pydentate/x86_64/ccanl.c b/pydentate/x86_64/ccanl.c index 2b41684..0db80cc 100644 --- a/pydentate/x86_64/ccanl.c +++ b/pydentate/x86_64/ccanl.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -45,22 +45,39 @@ extern double hoc_Exp(double); #define t nrn_threads->_t #define dt nrn_threads->_dt #define catau _p[0] +#define catau_columnindex 0 #define caiinf _p[1] +#define caiinf_columnindex 1 #define cai _p[2] +#define cai_columnindex 2 #define eca _p[3] +#define eca_columnindex 3 #define inca _p[4] +#define inca_columnindex 4 #define ilca _p[5] +#define ilca_columnindex 5 #define itca _p[6] +#define itca_columnindex 6 #define enca _p[7] +#define enca_columnindex 7 #define elca _p[8] +#define elca_columnindex 8 #define etca _p[9] +#define etca_columnindex 9 #define ncai _p[10] +#define ncai_columnindex 10 #define Dncai _p[11] +#define Dncai_columnindex 11 #define lcai _p[12] +#define lcai_columnindex 12 #define Dlcai _p[13] +#define Dlcai_columnindex 13 #define tcai _p[14] +#define tcai_columnindex 14 #define Dtcai _p[15] +#define Dtcai_columnindex 15 #define _g _p[16] +#define _g_columnindex 16 #define _ion_ncai *_ppvar[0]._pval #define _ion_inca *_ppvar[1]._pval #define _ion_enca *_ppvar[2]._pval @@ -163,15 +180,15 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); static int _ode_count(int); static void _ode_map(int, double**, double**, double*, Datum*, double*, int); -static void _ode_spec(_NrnThread*, _Memb_list*, int); -static void _ode_matsol(_NrnThread*, _Memb_list*, int); +static void _ode_spec(NrnThread*, _Memb_list*, int); +static void _ode_matsol(NrnThread*, _Memb_list*, int); #define _cvode_ieq _ppvar[12]._i static void _ode_matsol_instance1(_threadargsproto_); @@ -238,7 +255,7 @@ static void nrn_alloc(Prop* _prop) { static void _update_ion_pointer(Datum*); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -277,7 +294,7 @@ extern void _cvode_abstol( Symbol**, double*, int); hoc_register_cvode(_mechtype, _ode_count, _ode_map, _ode_spec, _ode_matsol); hoc_register_tolerance(_mechtype, _hoc_state_tol, &_atollist); hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 ccanl /home/danielmk/repos/pyDentate/mechs/ccanl.mod\n"); + ivoc_help("help ?1 ccanl /Users/temma/ghq/pydentate/mechs/ccanl.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -351,7 +368,7 @@ static void _hoc_ktf(void) { static int _ode_count(int _type){ return 3;} -static void _ode_spec(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_spec(NrnThread* _nt, _Memb_list* _ml, int _type) { Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -397,7 +414,7 @@ static void _ode_matsol_instance1(_threadargsproto_) { _ode_matsol1 (); } -static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_matsol(NrnThread* _nt, _Memb_list* _ml, int _type) { Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -458,7 +475,7 @@ static void initmodel() { } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -504,7 +521,7 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -524,7 +541,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -544,7 +561,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; double _dtsav = dt; if (secondorder) { dt *= 0.5; } @@ -609,17 +626,17 @@ static void terminal(){} static void _initlists() { int _i; static int _first = 1; if (!_first) return; - _slist1[0] = &(ncai) - _p; _dlist1[0] = &(Dncai) - _p; - _slist1[1] = &(lcai) - _p; _dlist1[1] = &(Dlcai) - _p; - _slist1[2] = &(tcai) - _p; _dlist1[2] = &(Dtcai) - _p; - _slist2[0] = &(lcai) - _p; - _slist2[1] = &(ncai) - _p; - _slist2[2] = &(tcai) - _p; + _slist1[0] = ncai_columnindex; _dlist1[0] = Dncai_columnindex; + _slist1[1] = lcai_columnindex; _dlist1[1] = Dlcai_columnindex; + _slist1[2] = tcai_columnindex; _dlist1[2] = Dtcai_columnindex; + _slist2[0] = lcai_columnindex; + _slist2[1] = ncai_columnindex; + _slist2[2] = tcai_columnindex; _first = 0; } #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/ccanl.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/ccanl.mod"; static const char* nmodl_file_text = "COMMENT\n" " calcium accumulation into a volume of area*depth next to the\n" diff --git a/pydentate/x86_64/ccanl.o b/pydentate/x86_64/ccanl.o index 2c0aa38..7e4f535 100644 Binary files a/pydentate/x86_64/ccanl.o and b/pydentate/x86_64/ccanl.o differ diff --git a/pydentate/x86_64/gskch.c b/pydentate/x86_64/gskch.c index c343fc0..1e19a39 100644 --- a/pydentate/x86_64/gskch.c +++ b/pydentate/x86_64/gskch.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -46,18 +46,31 @@ extern double hoc_Exp(double); #define t nrn_threads->_t #define dt nrn_threads->_dt #define gskbar _p[0] +#define gskbar_columnindex 0 #define isk _p[1] +#define isk_columnindex 1 #define gsk _p[2] +#define gsk_columnindex 2 #define qinf _p[3] +#define qinf_columnindex 3 #define qtau _p[4] +#define qtau_columnindex 4 #define q _p[5] +#define q_columnindex 5 #define esk _p[6] +#define esk_columnindex 6 #define ncai _p[7] +#define ncai_columnindex 7 #define lcai _p[8] +#define lcai_columnindex 8 #define tcai _p[9] +#define tcai_columnindex 9 #define Dq _p[10] +#define Dq_columnindex 10 #define qexp _p[11] +#define qexp_columnindex 11 #define _g _p[12] +#define _g_columnindex 12 #define _ion_esk *_ppvar[0]._pval #define _ion_isk *_ppvar[1]._pval #define _ion_diskdv *_ppvar[2]._pval @@ -144,10 +157,10 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); static int _ode_count(int); /* connect range variables in _p that hoc is supposed to know about */ @@ -202,7 +215,7 @@ static void nrn_alloc(Prop* _prop) { static void _update_ion_pointer(Datum*); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -234,7 +247,7 @@ extern void _cvode_abstol( Symbol**, double*, int); hoc_register_dparam_semantics(_mechtype, 5, "tca_ion"); hoc_register_cvode(_mechtype, _ode_count, 0, 0, 0); hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 gskch /home/danielmk/repos/pyDentate/mechs/gskch.mod\n"); + ivoc_help("help ?1 gskch /Users/temma/ghq/pydentate/mechs/gskch.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -253,10 +266,7 @@ static int state ( ) { cai = ncai + lcai + tcai ; rate ( _threadargscomma_ cai ) ; q = q + ( qinf - q ) * qexp ; - -/*VERBATIM*/ - return 0; - return 0; } + return 0; } static void _hoc_state(void) { double _r; @@ -315,7 +325,7 @@ static void initmodel() { } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -349,7 +359,7 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ { } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -389,7 +399,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -409,7 +419,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -448,7 +458,7 @@ _first = 0; } #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/gskch.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/gskch.mod"; static const char* nmodl_file_text = "TITLE gskch.mod calcium-activated potassium channel (non-voltage-dependent)\n" "\n" @@ -519,9 +529,7 @@ static const char* nmodl_file_text = " cai = ncai + lcai + tcai\n" " rate(cai)\n" " q = q + (qinf-q) * qexp\n" - " VERBATIM\n" - " return 0;\n" - " ENDVERBATIM\n" + "\n" "}\n" "\n" "LOCAL q10\n" diff --git a/pydentate/x86_64/gskch.o b/pydentate/x86_64/gskch.o index 51435d4..8301c21 100644 Binary files a/pydentate/x86_64/gskch.o and b/pydentate/x86_64/gskch.o differ diff --git a/pydentate/x86_64/hyperde3.c b/pydentate/x86_64/hyperde3.c index bf24787..2ebadab 100644 --- a/pydentate/x86_64/hyperde3.c +++ b/pydentate/x86_64/hyperde3.c @@ -1,10 +1,10 @@ /* Created by Language version: 7.7.0 */ -/* NOT VECTORIZED */ -#define NRN_VECTORIZED 0 +/* VECTORIZED */ +#define NRN_VECTORIZED 1 #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -34,56 +34,95 @@ extern double hoc_Exp(double); #define states states__hyperde3 #define trates trates__hyperde3 -#define _threadargscomma_ /**/ -#define _threadargsprotocomma_ /**/ -#define _threadargs_ /**/ -#define _threadargsproto_ /**/ +#define _threadargscomma_ _p, _ppvar, _thread, _nt, +#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, +#define _threadargs_ _p, _ppvar, _thread, _nt +#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt /*SUPPRESS 761*/ /*SUPPRESS 762*/ /*SUPPRESS 763*/ /*SUPPRESS 765*/ extern double *getarg(); - static double *_p; static Datum *_ppvar; + /* Thread safe. No static _p or _ppvar. */ -#define t nrn_threads->_t -#define dt nrn_threads->_dt +#define t _nt->_t +#define dt _nt->_dt #define ghyfbar _p[0] +#define ghyfbar_columnindex 0 #define ghysbar _p[1] +#define ghysbar_columnindex 1 #define ghyhtfbar _p[2] +#define ghyhtfbar_columnindex 2 #define ghyhtsbar _p[3] +#define ghyhtsbar_columnindex 3 #define ghyf _p[4] +#define ghyf_columnindex 4 #define ghys _p[5] +#define ghys_columnindex 5 #define ghyhtf _p[6] +#define ghyhtf_columnindex 6 #define ghyhts _p[7] +#define ghyhts_columnindex 7 #define ihyf _p[8] +#define ihyf_columnindex 8 #define ihys _p[9] +#define ihys_columnindex 9 #define hyfinf _p[10] +#define hyfinf_columnindex 10 #define hysinf _p[11] +#define hysinf_columnindex 11 #define hyhtfinf _p[12] +#define hyhtfinf_columnindex 12 #define hyhtsinf _p[13] +#define hyhtsinf_columnindex 13 #define hyftau _p[14] +#define hyftau_columnindex 14 #define hystau _p[15] +#define hystau_columnindex 15 #define hyhtftau _p[16] +#define hyhtftau_columnindex 16 #define hyhtstau _p[17] +#define hyhtstau_columnindex 17 #define hyf _p[18] +#define hyf_columnindex 18 #define hys _p[19] +#define hys_columnindex 19 #define hyhtf _p[20] +#define hyhtf_columnindex 20 #define hyhts _p[21] +#define hyhts_columnindex 21 #define ehyf _p[22] +#define ehyf_columnindex 22 #define ehys _p[23] +#define ehys_columnindex 23 #define ehyhtf _p[24] +#define ehyhtf_columnindex 24 #define ehyhts _p[25] +#define ehyhts_columnindex 25 #define Dhyf _p[26] +#define Dhyf_columnindex 26 #define Dhys _p[27] +#define Dhys_columnindex 27 #define Dhyhtf _p[28] +#define Dhyhtf_columnindex 28 #define Dhyhts _p[29] +#define Dhyhts_columnindex 29 #define ihyhtf _p[30] +#define ihyhtf_columnindex 30 #define ihyhts _p[31] +#define ihyhts_columnindex 31 #define hyfexp _p[32] +#define hyfexp_columnindex 32 #define hysexp _p[33] +#define hysexp_columnindex 33 #define hyhtfexp _p[34] +#define hyhtfexp_columnindex 34 #define hyhtsexp _p[35] -#define _g _p[36] +#define hyhtsexp_columnindex 35 +#define v _p[36] +#define v_columnindex 36 +#define _g _p[37] +#define _g_columnindex 37 #define _ion_ehyf *_ppvar[0]._pval #define _ion_ihyf *_ppvar[1]._pval #define _ion_dihyfdv *_ppvar[2]._pval @@ -110,6 +149,8 @@ extern double hoc_Exp(double); extern "C" { #endif static int hoc_nrnpointerindex = -1; + static Datum* _extcall_thread; + static Prop* _extcall_prop; /* external NEURON variables */ extern double celsius; /* declaration of user functions */ @@ -135,7 +176,7 @@ extern void hoc_reg_nmodl_filename(int, const char*); extern void _nrn_setdata_reg(int, void(*)(Prop*)); static void _setdata(Prop* _prop) { - _p = _prop->param; _ppvar = _prop->dparam; + _extcall_prop = _prop; } static void _hoc_setdata() { Prop *_prop, *hoc_getdata_range(int); @@ -153,7 +194,13 @@ extern void hoc_reg_nmodl_filename(int, const char*); 0, 0 }; #define vtrap vtrap_hyperde3 - extern double vtrap( double , double ); + extern double vtrap( _threadargsprotocomma_ double , double ); + +static void _check_trates(double*, Datum*, Datum*, NrnThread*); +static void _check_table_thread(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, int _type) { + _check_trates(_p, _ppvar, _thread, _nt); + } + #define _zq10 _thread[0]._pval[0] /* declare global and static user variables */ #define usetable usetable_hyperde3 double usetable = 1; @@ -184,7 +231,6 @@ extern void hoc_reg_nmodl_filename(int, const char*); static double hyhtf0 = 0; static double hys0 = 0; static double hyf0 = 0; - static double v = 0; /* connect global user variables to hoc */ static DoubScal hoc_scdoub[] = { "usetable_hyperde3", &usetable_hyperde3, @@ -195,10 +241,10 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); static int _ode_count(int); /* connect range variables in _p that hoc is supposed to know about */ @@ -241,14 +287,14 @@ extern Prop* need_memb(Symbol*); static void nrn_alloc(Prop* _prop) { Prop *prop_ion; double *_p; Datum *_ppvar; - _p = nrn_prop_data_alloc(_mechtype, 37, _prop); + _p = nrn_prop_data_alloc(_mechtype, 38, _prop); /*initialize range parameters*/ ghyfbar = 0; ghysbar = 0; ghyhtfbar = 0; ghyhtsbar = 0; _prop->param = _p; - _prop->param_size = 37; + _prop->param_size = 38; _ppvar = nrn_prop_datum_alloc(_mechtype, 12, _prop); _prop->dparam = _ppvar; /*connect ionic variables to this model*/ @@ -275,15 +321,17 @@ static void nrn_alloc(Prop* _prop) { } static void _initlists(); + static void _thread_mem_init(Datum*); + static void _thread_cleanup(Datum*); static void _update_ion_pointer(Datum*); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); void _hyperde3_reg() { - int _vectorized = 0; + int _vectorized = 1; _initlists(); ion_reg("hyf", 1.0); ion_reg("hys", 1.0); @@ -293,15 +341,20 @@ extern void _cvode_abstol( Symbol**, double*, int); _hys_sym = hoc_lookup("hys_ion"); _hyhtf_sym = hoc_lookup("hyhtf_ion"); _hyhts_sym = hoc_lookup("hyhts_ion"); - register_mech(_mechanism, nrn_alloc,nrn_cur, nrn_jacob, nrn_state, nrn_init, hoc_nrnpointerindex, 0); + register_mech(_mechanism, nrn_alloc,nrn_cur, nrn_jacob, nrn_state, nrn_init, hoc_nrnpointerindex, 2); + _extcall_thread = (Datum*)ecalloc(1, sizeof(Datum)); + _thread_mem_init(_extcall_thread); _mechtype = nrn_get_mechtype(_mechanism[1]); _nrn_setdata_reg(_mechtype, _setdata); + _nrn_thread_reg(_mechtype, 1, _thread_mem_init); + _nrn_thread_reg(_mechtype, 0, _thread_cleanup); _nrn_thread_reg(_mechtype, 2, _update_ion_pointer); + _nrn_thread_table_reg(_mechtype, _check_table_thread); #if NMODL_TEXT hoc_reg_nmodl_text(_mechtype, nmodl_file_text); hoc_reg_nmodl_filename(_mechtype, nmodl_filename); #endif - hoc_register_prop_size(_mechtype, 37, 12); + hoc_register_prop_size(_mechtype, 38, 12); hoc_register_dparam_semantics(_mechtype, 0, "hyf_ion"); hoc_register_dparam_semantics(_mechtype, 1, "hyf_ion"); hoc_register_dparam_semantics(_mechtype, 2, "hyf_ion"); @@ -316,13 +369,13 @@ extern void _cvode_abstol( Symbol**, double*, int); hoc_register_dparam_semantics(_mechtype, 11, "hyhts_ion"); hoc_register_cvode(_mechtype, _ode_count, 0, 0, 0); hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 hyperde3 /home/danielmk/repos/pyDentate/mechs/hyperde3.mod\n"); + ivoc_help("help ?1 hyperde3 /Users/temma/ghq/pydentate/mechs/hyperde3.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } static double FARADAY = 96520.0; static double R = 8.3134; - static double _zq10 ; + /*Top LOCAL _zq10 */ static double *_t_hyfinf; static double *_t_hyhtfinf; static double *_t_hyfexp; @@ -342,31 +395,32 @@ static int error; static int _ninits = 0; static int _match_recurse=1; static void _modl_cleanup(){ _match_recurse=1;} -static int _f_trates(double); -static int rates(double); -static int states(); -static int trates(double); - static void _n_trates(double); +static int _f_trates(_threadargsprotocomma_ double); +static int rates(_threadargsprotocomma_ double); +static int states(_threadargsproto_); +static int trates(_threadargsprotocomma_ double); + static void _n_trates(_threadargsprotocomma_ double _lv); -static int states ( ) { +static int states ( _threadargsproto_ ) { trates ( _threadargscomma_ v ) ; hyf = hyf + hyfexp * ( hyfinf - hyf ) ; hys = hys + hysexp * ( hysinf - hys ) ; hyhtf = hyhtf + hyhtfexp * ( hyhtfinf - hyhtf ) ; hyhts = hyhts + hyhtsexp * ( hyhtsinf - hyhts ) ; - -/*VERBATIM*/ - return 0; - return 0; } + return 0; } static void _hoc_states(void) { double _r; - _r = 1.; - states ( ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + _r = 1.; + states ( _p, _ppvar, _thread, _nt ); hoc_retpushx(_r); } -static int rates ( double _lv ) { +static int rates ( _threadargsprotocomma_ double _lv ) { double _lalpha , _lbeta , _lsum ; _zq10 = pow( 3.0 , ( ( celsius - 6.3 ) / 10.0 ) ) ; hyfinf = 1.0 / ( 1.0 + exp ( ( _lv + 91.0 ) / 10.0 ) ) ; @@ -381,13 +435,16 @@ static int rates ( double _lv ) { static void _hoc_rates(void) { double _r; - _r = 1.; - rates ( *getarg(1) ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + _r = 1.; + rates ( _p, _ppvar, _thread, _nt, *getarg(1) ); hoc_retpushx(_r); } static double _mfac_trates, _tmin_trates; - static void _check_trates(); - static void _check_trates() { + static void _check_trates(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { static int _maktable=1; int _i, _j, _ix = 0; double _xi, _tmax; static double _sav_dt; @@ -400,7 +457,7 @@ static void _hoc_rates(void) { _tmax = 100.0 ; _dx = (_tmax - _tmin_trates)/220.; _mfac_trates = 1./_dx; for (_i=0, _x=_tmin_trates; _i < 221; _x += _dx, _i++) { - _f_trates(_x); + _f_trates(_p, _ppvar, _thread, _nt, _x); _t_hyfinf[_i] = hyfinf; _t_hyhtfinf[_i] = hyhtfinf; _t_hyfexp[_i] = hyfexp; @@ -419,15 +476,18 @@ static void _hoc_rates(void) { } } - static int trates(double _lv){ _check_trates(); - _n_trates(_lv); + static int trates(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _lv) { +#if 0 +_check_trates(_p, _ppvar, _thread, _nt); +#endif + _n_trates(_p, _ppvar, _thread, _nt, _lv); return 0; } - static void _n_trates(double _lv){ int _i, _j; + static void _n_trates(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _lv){ int _i, _j; double _xi, _theta; if (!usetable) { - _f_trates(_lv); return; + _f_trates(_p, _ppvar, _thread, _nt, _lv); return; } _xi = _mfac_trates * (_lv - _tmin_trates); if (isnan(_xi)) { @@ -490,7 +550,7 @@ static void _hoc_rates(void) { } -static int _f_trates ( double _lv ) { +static int _f_trates ( _threadargsprotocomma_ double _lv ) { double _ltinc ; rates ( _threadargscomma_ _lv ) ; _ltinc = - dt * _zq10 ; @@ -502,12 +562,20 @@ static int _f_trates ( double _lv ) { static void _hoc_trates(void) { double _r; - _r = 1.; - trates ( *getarg(1) ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + +#if 1 + _check_trates(_p, _ppvar, _thread, _nt); +#endif + _r = 1.; + trates ( _p, _ppvar, _thread, _nt, *getarg(1) ); hoc_retpushx(_r); } -double vtrap ( double _lx , double _ly ) { +double vtrap ( _threadargsprotocomma_ double _lx , double _ly ) { double _lvtrap; if ( fabs ( _lx / _ly ) < 1e-6 ) { _lvtrap = _ly * ( 1.0 - _lx / _ly / 2.0 ) ; @@ -521,11 +589,23 @@ return _lvtrap; static void _hoc_vtrap(void) { double _r; - _r = vtrap ( *getarg(1) , *getarg(2) ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + _r = vtrap ( _p, _ppvar, _thread, _nt, *getarg(1) , *getarg(2) ); hoc_retpushx(_r); } static int _ode_count(int _type){ hoc_execerror("hyperde3", "cannot be used with CVODE"); return 0;} + +static void _thread_mem_init(Datum* _thread) { + _thread[0]._pval = (double*)ecalloc(1, sizeof(double)); + } + +static void _thread_cleanup(Datum* _thread) { + free((void*)(_thread[0]._pval)); + } extern void nrn_update_ion_pointer(Symbol*, Datum*, int, int); static void _update_ion_pointer(Datum* _ppvar) { nrn_update_ion_pointer(_hyf_sym, _ppvar, 0, 0); @@ -542,11 +622,8 @@ static int _ode_count(int _type){ hoc_execerror("hyperde3", "cannot be used with nrn_update_ion_pointer(_hyhts_sym, _ppvar, 11, 4); } -static void initmodel() { - int _i; double _save;_ninits++; - _save = t; - t = 0.0; -{ +static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { + int _i; double _save;{ hyhts = hyhts0; hyhtf = hyhtf0; hys = hys0; @@ -557,23 +634,25 @@ static void initmodel() { hys = hysinf ; hyhtf = hyhtfinf ; hyhts = hyhtsinf ; - -/*VERBATIM*/ - return 0; - } - _sav_indep = t; t = _save; - + } + } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; + +#if 0 + _check_trates(_p, _ppvar, _thread, _nt); +#endif #if CACHEVEC if (use_cachevec) { _v = VEC_V(_ni[_iml]); @@ -588,10 +667,11 @@ for (_iml = 0; _iml < _cntml; ++_iml) { ehys = _ion_ehys; ehyhtf = _ion_ehyhtf; ehyhts = _ion_ehyhts; - initmodel(); - }} + initmodel(_p, _ppvar, _thread, _nt); + } +} -static double _nrn_current(double _v){double _current=0.;v=_v;{ { +static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _v){double _current=0.;v=_v;{ { ghyf = ghyfbar * hyf * hyf ; ihyf = ghyf * ( v - ehyf ) ; ghys = ghysbar * hys * hys ; @@ -609,12 +689,14 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ { } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type) { +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; #if CACHEVEC @@ -630,7 +712,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { ehys = _ion_ehys; ehyhtf = _ion_ehyhtf; ehyhts = _ion_ehyhts; - _g = _nrn_current(_v + .001); + _g = _nrn_current(_p, _ppvar, _thread, _nt, _v + .001); { double _dihyhts; double _dihyhtf; double _dihys; @@ -639,7 +721,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { _dihys = ihys; _dihyhtf = ihyhtf; _dihyhts = ihyhts; - _rhs = _nrn_current(_v); + _rhs = _nrn_current(_p, _ppvar, _thread, _nt, _v); _ion_dihyfdv += (_dihyf - ihyf)/.001 ; _ion_dihysdv += (_dihys - ihys)/.001 ; _ion_dihyhtfdv += (_dihyhtf - ihyhtf)/.001 ; @@ -659,14 +741,18 @@ for (_iml = 0; _iml < _cntml; ++_iml) { NODERHS(_nd) -= _rhs; } -}} +} + +} -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type) { +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; #if CACHEVEC @@ -679,14 +765,18 @@ for (_iml = 0; _iml < _cntml; ++_iml) { NODED(_nd) += _g; } -}} +} + +} -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type) { +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; _nd = _ml->_nodelist[_iml]; @@ -705,15 +795,15 @@ for (_iml = 0; _iml < _cntml; ++_iml) { ehys = _ion_ehys; ehyhtf = _ion_ehyhtf; ehyhts = _ion_ehyhts; - { error = states(); - if(error){fprintf(stderr,"at line 83 in file hyperde3.mod:\n\n"); nrn_complain(_p); abort_run(error);} - } }} + { { states(_p, _ppvar, _thread, _nt); } + } }} } static void terminal(){} -static void _initlists() { +static void _initlists(){ + double _x; double* _p = &_x; int _i; static int _first = 1; if (!_first) return; _t_hyfinf = makevector(221*sizeof(double)); @@ -731,8 +821,12 @@ static void _initlists() { _first = 0; } +#if defined(__cplusplus) +} /* extern "C" */ +#endif + #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/hyperde3.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/hyperde3.mod"; static const char* nmodl_file_text = "TITLE hyperde3.mod \n" " \n" @@ -838,9 +932,6 @@ static const char* nmodl_file_text = " hys = hysinf\n" " hyhtf = hyhtfinf\n" " hyhts = hyhtsinf\n" - " VERBATIM\n" - " return 0;\n" - " ENDVERBATIM\n" "}\n" "\n" "? states\n" @@ -852,9 +943,6 @@ static const char* nmodl_file_text = " hyhtf = hyhtf + hyhtfexp*(hyhtfinf-hyhtf)\n" " hyhts = hyhts + hyhtsexp*(hyhtsinf-hyhts)\n" "\n" - " VERBATIM\n" - " return 0;\n" - " ENDVERBATIM\n" "}\n" " \n" "LOCAL q10\n" diff --git a/pydentate/x86_64/hyperde3.o b/pydentate/x86_64/hyperde3.o index 347665f..24da16e 100644 Binary files a/pydentate/x86_64/hyperde3.o and b/pydentate/x86_64/hyperde3.o differ diff --git a/pydentate/x86_64/ichan2.c b/pydentate/x86_64/ichan2.c index 0d9079d..8787b28 100644 --- a/pydentate/x86_64/ichan2.c +++ b/pydentate/x86_64/ichan2.c @@ -1,10 +1,10 @@ /* Created by Language version: 7.7.0 */ -/* NOT VECTORIZED */ -#define NRN_VECTORIZED 0 +/* VECTORIZED */ +#define NRN_VECTORIZED 1 #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -34,55 +34,93 @@ extern double hoc_Exp(double); #define states states__ichan2 #define trates trates__ichan2 -#define _threadargscomma_ /**/ -#define _threadargsprotocomma_ /**/ -#define _threadargs_ /**/ -#define _threadargsproto_ /**/ +#define _threadargscomma_ _p, _ppvar, _thread, _nt, +#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, +#define _threadargs_ _p, _ppvar, _thread, _nt +#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt /*SUPPRESS 761*/ /*SUPPRESS 762*/ /*SUPPRESS 763*/ /*SUPPRESS 765*/ extern double *getarg(); - static double *_p; static Datum *_ppvar; + /* Thread safe. No static _p or _ppvar. */ -#define t nrn_threads->_t -#define dt nrn_threads->_dt +#define t _nt->_t +#define dt _nt->_dt #define gnatbar _p[0] +#define gnatbar_columnindex 0 #define gkfbar _p[1] +#define gkfbar_columnindex 1 #define gksbar _p[2] +#define gksbar_columnindex 2 #define gl _p[3] +#define gl_columnindex 3 #define el _p[4] +#define el_columnindex 4 #define gnat _p[5] +#define gnat_columnindex 5 #define gkf _p[6] +#define gkf_columnindex 6 #define gks _p[7] +#define gks_columnindex 7 #define inat _p[8] +#define inat_columnindex 8 #define ikf _p[9] +#define ikf_columnindex 9 #define iks _p[10] +#define iks_columnindex 10 #define il _p[11] +#define il_columnindex 11 #define minf _p[12] +#define minf_columnindex 12 #define hinf _p[13] +#define hinf_columnindex 13 #define nfinf _p[14] +#define nfinf_columnindex 14 #define nsinf _p[15] +#define nsinf_columnindex 15 #define mtau _p[16] +#define mtau_columnindex 16 #define htau _p[17] +#define htau_columnindex 17 #define nftau _p[18] +#define nftau_columnindex 18 #define nstau _p[19] +#define nstau_columnindex 19 #define m _p[20] +#define m_columnindex 20 #define h _p[21] +#define h_columnindex 21 #define nf _p[22] +#define nf_columnindex 22 #define ns _p[23] +#define ns_columnindex 23 #define enat _p[24] +#define enat_columnindex 24 #define ekf _p[25] +#define ekf_columnindex 25 #define eks _p[26] +#define eks_columnindex 26 #define Dm _p[27] +#define Dm_columnindex 27 #define Dh _p[28] +#define Dh_columnindex 28 #define Dnf _p[29] +#define Dnf_columnindex 29 #define Dns _p[30] +#define Dns_columnindex 30 #define mexp _p[31] +#define mexp_columnindex 31 #define hexp _p[32] +#define hexp_columnindex 32 #define nfexp _p[33] +#define nfexp_columnindex 33 #define nsexp _p[34] -#define _g _p[35] +#define nsexp_columnindex 34 +#define v _p[35] +#define v_columnindex 35 +#define _g _p[36] +#define _g_columnindex 36 #define _ion_enat *_ppvar[0]._pval #define _ion_inat *_ppvar[1]._pval #define _ion_dinatdv *_ppvar[2]._pval @@ -106,6 +144,8 @@ extern double hoc_Exp(double); extern "C" { #endif static int hoc_nrnpointerindex = -1; + static Datum* _extcall_thread; + static Prop* _extcall_prop; /* external NEURON variables */ extern double celsius; /* declaration of user functions */ @@ -131,7 +171,7 @@ extern void hoc_reg_nmodl_filename(int, const char*); extern void _nrn_setdata_reg(int, void(*)(Prop*)); static void _setdata(Prop* _prop) { - _p = _prop->param; _ppvar = _prop->dparam; + _extcall_prop = _prop; } static void _hoc_setdata() { Prop *_prop, *hoc_getdata_range(int); @@ -149,7 +189,13 @@ extern void hoc_reg_nmodl_filename(int, const char*); 0, 0 }; #define vtrap vtrap_ichan2 - extern double vtrap( double , double ); + extern double vtrap( _threadargsprotocomma_ double , double ); + +static void _check_trates(double*, Datum*, Datum*, NrnThread*); +static void _check_table_thread(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, int _type) { + _check_trates(_p, _ppvar, _thread, _nt); + } + #define _zq10 _thread[0]._pval[0] /* declare global and static user variables */ #define usetable usetable_ichan2 double usetable = 1; @@ -182,7 +228,6 @@ extern void hoc_reg_nmodl_filename(int, const char*); static double m0 = 0; static double ns0 = 0; static double nf0 = 0; - static double v = 0; /* connect global user variables to hoc */ static DoubScal hoc_scdoub[] = { "usetable_ichan2", &usetable_ichan2, @@ -193,10 +238,10 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); static int _ode_count(int); /* connect range variables in _p that hoc is supposed to know about */ @@ -240,7 +285,7 @@ extern Prop* need_memb(Symbol*); static void nrn_alloc(Prop* _prop) { Prop *prop_ion; double *_p; Datum *_ppvar; - _p = nrn_prop_data_alloc(_mechtype, 36, _prop); + _p = nrn_prop_data_alloc(_mechtype, 37, _prop); /*initialize range parameters*/ gnatbar = 0; gkfbar = 0; @@ -248,7 +293,7 @@ static void nrn_alloc(Prop* _prop) { gl = 0; el = 0; _prop->param = _p; - _prop->param_size = 36; + _prop->param_size = 37; _ppvar = nrn_prop_datum_alloc(_mechtype, 9, _prop); _prop->dparam = _ppvar; /*connect ionic variables to this model*/ @@ -270,15 +315,17 @@ static void nrn_alloc(Prop* _prop) { } static void _initlists(); + static void _thread_mem_init(Datum*); + static void _thread_cleanup(Datum*); static void _update_ion_pointer(Datum*); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); void _ichan2_reg() { - int _vectorized = 0; + int _vectorized = 1; _initlists(); ion_reg("nat", 1.0); ion_reg("kf", 1.0); @@ -286,15 +333,20 @@ extern void _cvode_abstol( Symbol**, double*, int); _nat_sym = hoc_lookup("nat_ion"); _kf_sym = hoc_lookup("kf_ion"); _ks_sym = hoc_lookup("ks_ion"); - register_mech(_mechanism, nrn_alloc,nrn_cur, nrn_jacob, nrn_state, nrn_init, hoc_nrnpointerindex, 0); + register_mech(_mechanism, nrn_alloc,nrn_cur, nrn_jacob, nrn_state, nrn_init, hoc_nrnpointerindex, 2); + _extcall_thread = (Datum*)ecalloc(1, sizeof(Datum)); + _thread_mem_init(_extcall_thread); _mechtype = nrn_get_mechtype(_mechanism[1]); _nrn_setdata_reg(_mechtype, _setdata); + _nrn_thread_reg(_mechtype, 1, _thread_mem_init); + _nrn_thread_reg(_mechtype, 0, _thread_cleanup); _nrn_thread_reg(_mechtype, 2, _update_ion_pointer); + _nrn_thread_table_reg(_mechtype, _check_table_thread); #if NMODL_TEXT hoc_reg_nmodl_text(_mechtype, nmodl_file_text); hoc_reg_nmodl_filename(_mechtype, nmodl_filename); #endif - hoc_register_prop_size(_mechtype, 36, 9); + hoc_register_prop_size(_mechtype, 37, 9); hoc_register_dparam_semantics(_mechtype, 0, "nat_ion"); hoc_register_dparam_semantics(_mechtype, 1, "nat_ion"); hoc_register_dparam_semantics(_mechtype, 2, "nat_ion"); @@ -306,13 +358,13 @@ extern void _cvode_abstol( Symbol**, double*, int); hoc_register_dparam_semantics(_mechtype, 8, "ks_ion"); hoc_register_cvode(_mechtype, _ode_count, 0, 0, 0); hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 ichan2 /home/danielmk/repos/pyDentate/mechs/ichan2.mod\n"); + ivoc_help("help ?1 ichan2 /Users/temma/ghq/pydentate/mechs/ichan2.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } static double FARADAY = 96520.0; static double R = 8.3134; - static double _zq10 ; + /*Top LOCAL _zq10 */ static double *_t_minf; static double *_t_mexp; static double *_t_hinf; @@ -332,31 +384,32 @@ static int error; static int _ninits = 0; static int _match_recurse=1; static void _modl_cleanup(){ _match_recurse=1;} -static int _f_trates(double); -static int rates(double); -static int states(); -static int trates(double); - static void _n_trates(double); +static int _f_trates(_threadargsprotocomma_ double); +static int rates(_threadargsprotocomma_ double); +static int states(_threadargsproto_); +static int trates(_threadargsprotocomma_ double); + static void _n_trates(_threadargsprotocomma_ double _lv); -static int states ( ) { +static int states ( _threadargsproto_ ) { trates ( _threadargscomma_ v ) ; m = m + mexp * ( minf - m ) ; h = h + hexp * ( hinf - h ) ; nf = nf + nfexp * ( nfinf - nf ) ; ns = ns + nsexp * ( nsinf - ns ) ; - -/*VERBATIM*/ - return 0; - return 0; } + return 0; } static void _hoc_states(void) { double _r; - _r = 1.; - states ( ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + _r = 1.; + states ( _p, _ppvar, _thread, _nt ); hoc_retpushx(_r); } -static int rates ( double _lv ) { +static int rates ( _threadargsprotocomma_ double _lv ) { double _lalpha , _lbeta , _lsum ; _zq10 = pow( 3.0 , ( ( celsius - 6.3 ) / 10.0 ) ) ; _lalpha = - 0.3 * vtrap ( _threadargscomma_ ( _lv + 60.0 - 17.0 ) , - 5.0 ) ; @@ -383,13 +436,16 @@ static int rates ( double _lv ) { static void _hoc_rates(void) { double _r; - _r = 1.; - rates ( *getarg(1) ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + _r = 1.; + rates ( _p, _ppvar, _thread, _nt, *getarg(1) ); hoc_retpushx(_r); } static double _mfac_trates, _tmin_trates; - static void _check_trates(); - static void _check_trates() { + static void _check_trates(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { static int _maktable=1; int _i, _j, _ix = 0; double _xi, _tmax; static double _sav_dt; @@ -402,7 +458,7 @@ static void _hoc_rates(void) { _tmax = 100.0 ; _dx = (_tmax - _tmin_trates)/200.; _mfac_trates = 1./_dx; for (_i=0, _x=_tmin_trates; _i < 201; _x += _dx, _i++) { - _f_trates(_x); + _f_trates(_p, _ppvar, _thread, _nt, _x); _t_minf[_i] = minf; _t_mexp[_i] = mexp; _t_hinf[_i] = hinf; @@ -421,15 +477,18 @@ static void _hoc_rates(void) { } } - static int trates(double _lv){ _check_trates(); - _n_trates(_lv); + static int trates(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _lv) { +#if 0 +_check_trates(_p, _ppvar, _thread, _nt); +#endif + _n_trates(_p, _ppvar, _thread, _nt, _lv); return 0; } - static void _n_trates(double _lv){ int _i, _j; + static void _n_trates(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _lv){ int _i, _j; double _xi, _theta; if (!usetable) { - _f_trates(_lv); return; + _f_trates(_p, _ppvar, _thread, _nt, _lv); return; } _xi = _mfac_trates * (_lv - _tmin_trates); if (isnan(_xi)) { @@ -492,7 +551,7 @@ static void _hoc_rates(void) { } -static int _f_trates ( double _lv ) { +static int _f_trates ( _threadargsprotocomma_ double _lv ) { double _ltinc ; rates ( _threadargscomma_ _lv ) ; _ltinc = - dt * _zq10 ; @@ -504,12 +563,20 @@ static int _f_trates ( double _lv ) { static void _hoc_trates(void) { double _r; - _r = 1.; - trates ( *getarg(1) ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + +#if 1 + _check_trates(_p, _ppvar, _thread, _nt); +#endif + _r = 1.; + trates ( _p, _ppvar, _thread, _nt, *getarg(1) ); hoc_retpushx(_r); } -double vtrap ( double _lx , double _ly ) { +double vtrap ( _threadargsprotocomma_ double _lx , double _ly ) { double _lvtrap; if ( fabs ( _lx / _ly ) < 1e-6 ) { _lvtrap = _ly * ( 1.0 - _lx / _ly / 2.0 ) ; @@ -523,11 +590,23 @@ return _lvtrap; static void _hoc_vtrap(void) { double _r; - _r = vtrap ( *getarg(1) , *getarg(2) ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + _r = vtrap ( _p, _ppvar, _thread, _nt, *getarg(1) , *getarg(2) ); hoc_retpushx(_r); } static int _ode_count(int _type){ hoc_execerror("ichan2", "cannot be used with CVODE"); return 0;} + +static void _thread_mem_init(Datum* _thread) { + _thread[0]._pval = (double*)ecalloc(1, sizeof(double)); + } + +static void _thread_cleanup(Datum* _thread) { + free((void*)(_thread[0]._pval)); + } extern void nrn_update_ion_pointer(Symbol*, Datum*, int, int); static void _update_ion_pointer(Datum* _ppvar) { nrn_update_ion_pointer(_nat_sym, _ppvar, 0, 0); @@ -541,11 +620,8 @@ static int _ode_count(int _type){ hoc_execerror("ichan2", "cannot be used with C nrn_update_ion_pointer(_ks_sym, _ppvar, 8, 4); } -static void initmodel() { - int _i; double _save;_ninits++; - _save = t; - t = 0.0; -{ +static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { + int _i; double _save;{ h = h0; m = m0; ns = ns0; @@ -556,23 +632,25 @@ static void initmodel() { h = hinf ; nf = nfinf ; ns = nsinf ; - -/*VERBATIM*/ - return 0; - } - _sav_indep = t; t = _save; - + } + } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; + +#if 0 + _check_trates(_p, _ppvar, _thread, _nt); +#endif #if CACHEVEC if (use_cachevec) { _v = VEC_V(_ni[_iml]); @@ -586,10 +664,11 @@ for (_iml = 0; _iml < _cntml; ++_iml) { enat = _ion_enat; ekf = _ion_ekf; eks = _ion_eks; - initmodel(); - }} + initmodel(_p, _ppvar, _thread, _nt); + } +} -static double _nrn_current(double _v){double _current=0.;v=_v;{ { +static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _v){double _current=0.;v=_v;{ { gnat = gnatbar * m * m * m * h ; inat = gnat * ( v - enat ) ; gkf = gkfbar * nf * nf * nf * nf ; @@ -606,12 +685,14 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ { } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type) { +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; #if CACHEVEC @@ -626,14 +707,14 @@ for (_iml = 0; _iml < _cntml; ++_iml) { enat = _ion_enat; ekf = _ion_ekf; eks = _ion_eks; - _g = _nrn_current(_v + .001); + _g = _nrn_current(_p, _ppvar, _thread, _nt, _v + .001); { double _diks; double _dikf; double _dinat; _dinat = inat; _dikf = ikf; _diks = iks; - _rhs = _nrn_current(_v); + _rhs = _nrn_current(_p, _ppvar, _thread, _nt, _v); _ion_dinatdv += (_dinat - inat)/.001 ; _ion_dikfdv += (_dikf - ikf)/.001 ; _ion_diksdv += (_diks - iks)/.001 ; @@ -651,14 +732,18 @@ for (_iml = 0; _iml < _cntml; ++_iml) { NODERHS(_nd) -= _rhs; } -}} +} + +} -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type) { +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; #if CACHEVEC @@ -671,14 +756,18 @@ for (_iml = 0; _iml < _cntml; ++_iml) { NODED(_nd) += _g; } -}} +} + +} -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type) { +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; _nd = _ml->_nodelist[_iml]; @@ -696,15 +785,15 @@ for (_iml = 0; _iml < _cntml; ++_iml) { enat = _ion_enat; ekf = _ion_ekf; eks = _ion_eks; - { error = states(); - if(error){fprintf(stderr,"at line 72 in file ichan2.mod:\n SOLVE states\n"); nrn_complain(_p); abort_run(error);} - } }} + { { states(_p, _ppvar, _thread, _nt); } + } }} } static void terminal(){} -static void _initlists() { +static void _initlists(){ + double _x; double* _p = &_x; int _i; static int _first = 1; if (!_first) return; _t_minf = makevector(201*sizeof(double)); @@ -722,8 +811,12 @@ static void _initlists() { _first = 0; } +#if defined(__cplusplus) +} /* extern "C" */ +#endif + #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/ichan2.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/ichan2.mod"; static const char* nmodl_file_text = "TITLE ichan2.mod \n" " \n" @@ -816,10 +909,7 @@ static const char* nmodl_file_text = " h = hinf\n" " nf = nfinf\n" " ns = nsinf\n" - " \n" - " VERBATIM\n" - " return 0;\n" - " ENDVERBATIM\n" + "\n" "}\n" "\n" "? states\n" @@ -829,9 +919,7 @@ static const char* nmodl_file_text = " h = h + hexp*(hinf-h)\n" " nf = nf + nfexp*(nfinf-nf)\n" " ns = ns + nsexp*(nsinf-ns)\n" - " VERBATIM\n" - " return 0;\n" - " ENDVERBATIM\n" + "\n" "}\n" " \n" "LOCAL q10\n" diff --git a/pydentate/x86_64/ichan2.o b/pydentate/x86_64/ichan2.o index 04c4b82..2b8f6d0 100644 Binary files a/pydentate/x86_64/ichan2.o and b/pydentate/x86_64/ichan2.o differ diff --git a/pydentate/x86_64/libnrnmech.dylib b/pydentate/x86_64/libnrnmech.dylib new file mode 100755 index 0000000..4c1bcb8 Binary files /dev/null and b/pydentate/x86_64/libnrnmech.dylib differ diff --git a/pydentate/x86_64/libnrnmech.so b/pydentate/x86_64/libnrnmech.so deleted file mode 100644 index 7922274..0000000 Binary files a/pydentate/x86_64/libnrnmech.so and /dev/null differ diff --git a/pydentate/x86_64/makemod2c_inc b/pydentate/x86_64/makemod2c_inc index a4f90c9..d3225cb 100644 --- a/pydentate/x86_64/makemod2c_inc +++ b/pydentate/x86_64/makemod2c_inc @@ -1,121 +1,120 @@ +./CaBK.c: ../CaBK.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "CaBK.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") -./bgka.c: ../mechs/bgka.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) bgka.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./CaBK.o: ./CaBK.c + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./bgka.o: ./bgka.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ +./Gfluct2.c: ../Gfluct2.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "Gfluct2.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") -./CaBK.c: ../mechs/CaBK.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) CaBK.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./Gfluct2.o: ./Gfluct2.c + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./CaBK.o: ./CaBK.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ +./LcaMig.c: ../LcaMig.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "LcaMig.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") -./ccanl.c: ../mechs/ccanl.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) ccanl.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./LcaMig.o: ./LcaMig.c + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./ccanl.o: ./ccanl.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ +./bgka.c: ../bgka.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "bgka.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") -./Gfluct2.c: ../mechs/Gfluct2.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) Gfluct2.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./bgka.o: ./bgka.c + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./Gfluct2.o: ./Gfluct2.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ +./ccanl.c: ../ccanl.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "ccanl.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") + +./ccanl.o: ./ccanl.c + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./gskch.c: ../mechs/gskch.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) gskch.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./gskch.c: ../gskch.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "gskch.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") ./gskch.o: ./gskch.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./hyperde3.c: ../mechs/hyperde3.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) hyperde3.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./hyperde3.c: ../hyperde3.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "hyperde3.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") ./hyperde3.o: ./hyperde3.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./ichan2.c: ../mechs/ichan2.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) ichan2.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./ichan2.c: ../ichan2.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "ichan2.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") ./ichan2.o: ./ichan2.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ - -./LcaMig.c: ../mechs/LcaMig.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) LcaMig.mod -o "/home/danielmk/repos/pyDentate/x86_64") - -./LcaMig.o: ./LcaMig.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./nca.c: ../mechs/nca.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) nca.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./nca.c: ../nca.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "nca.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") ./nca.o: ./nca.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./netstim125.c: ../mechs/netstim125.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) netstim125.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./netstim125.c: ../netstim125.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "netstim125.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") ./netstim125.o: ./netstim125.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./netstimbox.c: ../mechs/netstimbox.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) netstimbox.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./netstimbox.c: ../netstimbox.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "netstimbox.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") ./netstimbox.o: ./netstimbox.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./tca.c: ../mechs/tca.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) tca.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./tca.c: ../tca.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "tca.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") ./tca.o: ./tca.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./tmgexp2syn.c: ../mechs/tmgexp2syn.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) tmgexp2syn.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./tmgexp2syn.c: ../tmgexp2syn.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "tmgexp2syn.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") ./tmgexp2syn.o: ./tmgexp2syn.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./tmgsyn.c: ../mechs/tmgsyn.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) tmgsyn.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./tmgsyn.c: ../tmgsyn.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "tmgsyn.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") ./tmgsyn.o: ./tmgsyn.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ -./vecevent.c: ../mechs/vecevent.mod - @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\n" - (cd "../mechs"; MODLUNIT=$(NRNUNITS) $(NOCMODL) vecevent.mod -o "/home/danielmk/repos/pyDentate/x86_64") +./vecevent.c: ../vecevent.mod + @printf " -> $(C_GREEN)NMODL$(C_RESET) $<\\n" + (cd ".."; MODLUNIT=$(NRNUNITS) $(NOCMODL) "vecevent.mod" -o "/Users/temma/ghq/pydentate/mechs/x86_64") ./vecevent.o: ./vecevent.c - @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\n" - $(COMPILE) -I"../mechs" $(INCLUDES) -fPIC -c $< -o $@ + @printf " -> $(C_GREEN)Compiling$(C_RESET) $<\\n" + $(COMPILE) -I".." $(INCLUDES) -fPIC -c $< -o $@ diff --git a/pydentate/x86_64/mod_func.c b/pydentate/x86_64/mod_func.cpp similarity index 57% rename from pydentate/x86_64/mod_func.c rename to pydentate/x86_64/mod_func.cpp index 2af39f7..7b9ee80 100644 --- a/pydentate/x86_64/mod_func.c +++ b/pydentate/x86_64/mod_func.cpp @@ -2,15 +2,18 @@ #include "hocdec.h" extern int nrnmpi_myid; extern int nrn_nobanner_; +#if defined(__cplusplus) +extern "C" { +#endif -extern void _bgka_reg(void); extern void _CaBK_reg(void); -extern void _ccanl_reg(void); extern void _Gfluct2_reg(void); +extern void _LcaMig_reg(void); +extern void _bgka_reg(void); +extern void _ccanl_reg(void); extern void _gskch_reg(void); extern void _hyperde3_reg(void); extern void _ichan2_reg(void); -extern void _LcaMig_reg(void); extern void _nca_reg(void); extern void _netstim125_reg(void); extern void _netstimbox_reg(void); @@ -19,35 +22,34 @@ extern void _tmgexp2syn_reg(void); extern void _tmgsyn_reg(void); extern void _vecevent_reg(void); -void modl_reg(){ +void modl_reg() { if (!nrn_nobanner_) if (nrnmpi_myid < 1) { fprintf(stderr, "Additional mechanisms from files\n"); - - fprintf(stderr," \"mechs/bgka.mod\""); - fprintf(stderr," \"mechs/CaBK.mod\""); - fprintf(stderr," \"mechs/ccanl.mod\""); - fprintf(stderr," \"mechs/Gfluct2.mod\""); - fprintf(stderr," \"mechs/gskch.mod\""); - fprintf(stderr," \"mechs/hyperde3.mod\""); - fprintf(stderr," \"mechs/ichan2.mod\""); - fprintf(stderr," \"mechs/LcaMig.mod\""); - fprintf(stderr," \"mechs/nca.mod\""); - fprintf(stderr," \"mechs/netstim125.mod\""); - fprintf(stderr," \"mechs/netstimbox.mod\""); - fprintf(stderr," \"mechs/tca.mod\""); - fprintf(stderr," \"mechs/tmgexp2syn.mod\""); - fprintf(stderr," \"mechs/tmgsyn.mod\""); - fprintf(stderr," \"mechs/vecevent.mod\""); + fprintf(stderr, " \"CaBK.mod\""); + fprintf(stderr, " \"Gfluct2.mod\""); + fprintf(stderr, " \"LcaMig.mod\""); + fprintf(stderr, " \"bgka.mod\""); + fprintf(stderr, " \"ccanl.mod\""); + fprintf(stderr, " \"gskch.mod\""); + fprintf(stderr, " \"hyperde3.mod\""); + fprintf(stderr, " \"ichan2.mod\""); + fprintf(stderr, " \"nca.mod\""); + fprintf(stderr, " \"netstim125.mod\""); + fprintf(stderr, " \"netstimbox.mod\""); + fprintf(stderr, " \"tca.mod\""); + fprintf(stderr, " \"tmgexp2syn.mod\""); + fprintf(stderr, " \"tmgsyn.mod\""); + fprintf(stderr, " \"vecevent.mod\""); fprintf(stderr, "\n"); } - _bgka_reg(); _CaBK_reg(); - _ccanl_reg(); _Gfluct2_reg(); + _LcaMig_reg(); + _bgka_reg(); + _ccanl_reg(); _gskch_reg(); _hyperde3_reg(); _ichan2_reg(); - _LcaMig_reg(); _nca_reg(); _netstim125_reg(); _netstimbox_reg(); @@ -56,3 +58,7 @@ void modl_reg(){ _tmgsyn_reg(); _vecevent_reg(); } + +#if defined(__cplusplus) +} +#endif diff --git a/pydentate/x86_64/mod_func.o b/pydentate/x86_64/mod_func.o index 7657775..98e0948 100644 Binary files a/pydentate/x86_64/mod_func.o and b/pydentate/x86_64/mod_func.o differ diff --git a/pydentate/x86_64/nca.c b/pydentate/x86_64/nca.c index 6e4ed3a..8ba1f7a 100644 --- a/pydentate/x86_64/nca.c +++ b/pydentate/x86_64/nca.c @@ -1,10 +1,10 @@ /* Created by Language version: 7.7.0 */ -/* NOT VECTORIZED */ -#define NRN_VECTORIZED 0 +/* VECTORIZED */ +#define NRN_VECTORIZED 1 #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -34,34 +34,51 @@ extern double hoc_Exp(double); #define states states__nca #define trates trates__nca -#define _threadargscomma_ /**/ -#define _threadargsprotocomma_ /**/ -#define _threadargs_ /**/ -#define _threadargsproto_ /**/ +#define _threadargscomma_ _p, _ppvar, _thread, _nt, +#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, +#define _threadargs_ _p, _ppvar, _thread, _nt +#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt /*SUPPRESS 761*/ /*SUPPRESS 762*/ /*SUPPRESS 763*/ /*SUPPRESS 765*/ extern double *getarg(); - static double *_p; static Datum *_ppvar; + /* Thread safe. No static _p or _ppvar. */ -#define t nrn_threads->_t -#define dt nrn_threads->_dt +#define t _nt->_t +#define dt _nt->_dt #define gncabar _p[0] +#define gncabar_columnindex 0 #define gnca _p[1] +#define gnca_columnindex 1 #define inca _p[2] +#define inca_columnindex 2 #define cinf _p[3] +#define cinf_columnindex 3 #define dinf _p[4] +#define dinf_columnindex 4 #define ctau _p[5] +#define ctau_columnindex 5 #define dtau _p[6] +#define dtau_columnindex 6 #define c _p[7] +#define c_columnindex 7 #define d _p[8] +#define d_columnindex 8 #define Dc _p[9] +#define Dc_columnindex 9 #define Dd _p[10] +#define Dd_columnindex 10 #define enca _p[11] +#define enca_columnindex 11 #define cexp _p[12] +#define cexp_columnindex 12 #define dexp _p[13] -#define _g _p[14] +#define dexp_columnindex 13 +#define v _p[14] +#define v_columnindex 14 +#define _g _p[15] +#define _g_columnindex 15 #define _ion_enca *_ppvar[0]._pval #define _ion_inca *_ppvar[1]._pval #define _ion_dincadv *_ppvar[2]._pval @@ -79,6 +96,8 @@ extern double hoc_Exp(double); extern "C" { #endif static int hoc_nrnpointerindex = -1; + static Datum* _extcall_thread; + static Prop* _extcall_prop; /* external NEURON variables */ extern double celsius; /* declaration of user functions */ @@ -104,7 +123,7 @@ extern void hoc_reg_nmodl_filename(int, const char*); extern void _nrn_setdata_reg(int, void(*)(Prop*)); static void _setdata(Prop* _prop) { - _p = _prop->param; _ppvar = _prop->dparam; + _extcall_prop = _prop; } static void _hoc_setdata() { Prop *_prop, *hoc_getdata_range(int); @@ -122,7 +141,13 @@ extern void hoc_reg_nmodl_filename(int, const char*); 0, 0 }; #define vtrap vtrap_nca - extern double vtrap( double , double ); + extern double vtrap( _threadargsprotocomma_ double , double ); + +static void _check_trates(double*, Datum*, Datum*, NrnThread*); +static void _check_table_thread(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, int _type) { + _check_trates(_p, _ppvar, _thread, _nt); + } + #define _zq10 _thread[0]._pval[0] /* declare global and static user variables */ #define usetable usetable_nca double usetable = 1; @@ -142,7 +167,6 @@ extern void hoc_reg_nmodl_filename(int, const char*); static double c0 = 0; static double delta_t = 1; static double d0 = 0; - static double v = 0; /* connect global user variables to hoc */ static DoubScal hoc_scdoub[] = { "usetable_nca", &usetable_nca, @@ -153,10 +177,10 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); static int _ode_count(int); /* connect range variables in _p that hoc is supposed to know about */ @@ -183,11 +207,11 @@ extern Prop* need_memb(Symbol*); static void nrn_alloc(Prop* _prop) { Prop *prop_ion; double *_p; Datum *_ppvar; - _p = nrn_prop_data_alloc(_mechtype, 15, _prop); + _p = nrn_prop_data_alloc(_mechtype, 16, _prop); /*initialize range parameters*/ gncabar = 0; _prop->param = _p; - _prop->param_size = 15; + _prop->param_size = 16; _ppvar = nrn_prop_datum_alloc(_mechtype, 3, _prop); _prop->dparam = _ppvar; /*connect ionic variables to this model*/ @@ -199,39 +223,46 @@ static void nrn_alloc(Prop* _prop) { } static void _initlists(); + static void _thread_mem_init(Datum*); + static void _thread_cleanup(Datum*); static void _update_ion_pointer(Datum*); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); void _nca_reg() { - int _vectorized = 0; + int _vectorized = 1; _initlists(); ion_reg("nca", 2.0); _nca_sym = hoc_lookup("nca_ion"); - register_mech(_mechanism, nrn_alloc,nrn_cur, nrn_jacob, nrn_state, nrn_init, hoc_nrnpointerindex, 0); + register_mech(_mechanism, nrn_alloc,nrn_cur, nrn_jacob, nrn_state, nrn_init, hoc_nrnpointerindex, 2); + _extcall_thread = (Datum*)ecalloc(1, sizeof(Datum)); + _thread_mem_init(_extcall_thread); _mechtype = nrn_get_mechtype(_mechanism[1]); _nrn_setdata_reg(_mechtype, _setdata); + _nrn_thread_reg(_mechtype, 1, _thread_mem_init); + _nrn_thread_reg(_mechtype, 0, _thread_cleanup); _nrn_thread_reg(_mechtype, 2, _update_ion_pointer); + _nrn_thread_table_reg(_mechtype, _check_table_thread); #if NMODL_TEXT hoc_reg_nmodl_text(_mechtype, nmodl_file_text); hoc_reg_nmodl_filename(_mechtype, nmodl_filename); #endif - hoc_register_prop_size(_mechtype, 15, 3); + hoc_register_prop_size(_mechtype, 16, 3); hoc_register_dparam_semantics(_mechtype, 0, "nca_ion"); hoc_register_dparam_semantics(_mechtype, 1, "nca_ion"); hoc_register_dparam_semantics(_mechtype, 2, "nca_ion"); hoc_register_cvode(_mechtype, _ode_count, 0, 0, 0); hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 nca /home/danielmk/repos/pyDentate/mechs/nca.mod\n"); + ivoc_help("help ?1 nca /Users/temma/ghq/pydentate/mechs/nca.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } static double FARADAY = 96520.0; static double R = 8.3134; - static double _zq10 ; + /*Top LOCAL _zq10 */ static double *_t_cinf; static double *_t_cexp; static double *_t_dinf; @@ -245,29 +276,30 @@ static int error; static int _ninits = 0; static int _match_recurse=1; static void _modl_cleanup(){ _match_recurse=1;} -static int _f_trates(double); -static int rates(double); -static int states(); -static int trates(double); - static void _n_trates(double); +static int _f_trates(_threadargsprotocomma_ double); +static int rates(_threadargsprotocomma_ double); +static int states(_threadargsproto_); +static int trates(_threadargsprotocomma_ double); + static void _n_trates(_threadargsprotocomma_ double _lv); -static int states ( ) { +static int states ( _threadargsproto_ ) { trates ( _threadargscomma_ v ) ; c = c + cexp * ( cinf - c ) ; d = d + dexp * ( dinf - d ) ; - -/*VERBATIM*/ - return 0; - return 0; } + return 0; } static void _hoc_states(void) { double _r; - _r = 1.; - states ( ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + _r = 1.; + states ( _p, _ppvar, _thread, _nt ); hoc_retpushx(_r); } -static int rates ( double _lv ) { +static int rates ( _threadargsprotocomma_ double _lv ) { double _lalpha , _lbeta , _lsum ; _zq10 = pow( 3.0 , ( ( celsius - 6.3 ) / 10.0 ) ) ; _lalpha = - 0.19 * vtrap ( _threadargscomma_ _lv - 19.88 , - 10.0 ) ; @@ -284,13 +316,16 @@ static int rates ( double _lv ) { static void _hoc_rates(void) { double _r; - _r = 1.; - rates ( *getarg(1) ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + _r = 1.; + rates ( _p, _ppvar, _thread, _nt, *getarg(1) ); hoc_retpushx(_r); } static double _mfac_trates, _tmin_trates; - static void _check_trates(); - static void _check_trates() { + static void _check_trates(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { static int _maktable=1; int _i, _j, _ix = 0; double _xi, _tmax; static double _sav_dt; @@ -303,7 +338,7 @@ static void _hoc_rates(void) { _tmax = 100.0 ; _dx = (_tmax - _tmin_trates)/200.; _mfac_trates = 1./_dx; for (_i=0, _x=_tmin_trates; _i < 201; _x += _dx, _i++) { - _f_trates(_x); + _f_trates(_p, _ppvar, _thread, _nt, _x); _t_cinf[_i] = cinf; _t_cexp[_i] = cexp; _t_dinf[_i] = dinf; @@ -316,15 +351,18 @@ static void _hoc_rates(void) { } } - static int trates(double _lv){ _check_trates(); - _n_trates(_lv); + static int trates(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _lv) { +#if 0 +_check_trates(_p, _ppvar, _thread, _nt); +#endif + _n_trates(_p, _ppvar, _thread, _nt, _lv); return 0; } - static void _n_trates(double _lv){ int _i, _j; + static void _n_trates(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _lv){ int _i, _j; double _xi, _theta; if (!usetable) { - _f_trates(_lv); return; + _f_trates(_p, _ppvar, _thread, _nt, _lv); return; } _xi = _mfac_trates * (_lv - _tmin_trates); if (isnan(_xi)) { @@ -363,7 +401,7 @@ static void _hoc_rates(void) { } -static int _f_trates ( double _lv ) { +static int _f_trates ( _threadargsprotocomma_ double _lv ) { double _ltinc ; rates ( _threadargscomma_ _lv ) ; _ltinc = - dt * _zq10 ; @@ -373,12 +411,20 @@ static int _f_trates ( double _lv ) { static void _hoc_trates(void) { double _r; - _r = 1.; - trates ( *getarg(1) ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + +#if 1 + _check_trates(_p, _ppvar, _thread, _nt); +#endif + _r = 1.; + trates ( _p, _ppvar, _thread, _nt, *getarg(1) ); hoc_retpushx(_r); } -double vtrap ( double _lx , double _ly ) { +double vtrap ( _threadargsprotocomma_ double _lx , double _ly ) { double _lvtrap; if ( fabs ( _lx / _ly ) < 1e-6 ) { _lvtrap = _ly * ( 1.0 - _lx / _ly / 2.0 ) ; @@ -392,11 +438,23 @@ return _lvtrap; static void _hoc_vtrap(void) { double _r; - _r = vtrap ( *getarg(1) , *getarg(2) ); + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + if (_extcall_prop) {_p = _extcall_prop->param; _ppvar = _extcall_prop->dparam;}else{ _p = (double*)0; _ppvar = (Datum*)0; } + _thread = _extcall_thread; + _nt = nrn_threads; + _r = vtrap ( _p, _ppvar, _thread, _nt, *getarg(1) , *getarg(2) ); hoc_retpushx(_r); } static int _ode_count(int _type){ hoc_execerror("nca", "cannot be used with CVODE"); return 0;} + +static void _thread_mem_init(Datum* _thread) { + _thread[0]._pval = (double*)ecalloc(1, sizeof(double)); + } + +static void _thread_cleanup(Datum* _thread) { + free((void*)(_thread[0]._pval)); + } extern void nrn_update_ion_pointer(Symbol*, Datum*, int, int); static void _update_ion_pointer(Datum* _ppvar) { nrn_update_ion_pointer(_nca_sym, _ppvar, 0, 0); @@ -404,11 +462,8 @@ static int _ode_count(int _type){ hoc_execerror("nca", "cannot be used with CVOD nrn_update_ion_pointer(_nca_sym, _ppvar, 2, 4); } -static void initmodel() { - int _i; double _save;_ninits++; - _save = t; - t = 0.0; -{ +static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { + int _i; double _save;{ c = c0; d = d0; { @@ -416,19 +471,24 @@ static void initmodel() { c = cinf ; d = dinf ; } - _sav_indep = t; t = _save; - + } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; + +#if 0 + _check_trates(_p, _ppvar, _thread, _nt); +#endif #if CACHEVEC if (use_cachevec) { _v = VEC_V(_ni[_iml]); @@ -440,10 +500,11 @@ for (_iml = 0; _iml < _cntml; ++_iml) { } v = _v; enca = _ion_enca; - initmodel(); - }} + initmodel(_p, _ppvar, _thread, _nt); + } +} -static double _nrn_current(double _v){double _current=0.;v=_v;{ { +static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _v){double _current=0.;v=_v;{ { gnca = gncabar * c * c * d ; inca = gnca * ( v - enca ) ; } @@ -452,12 +513,14 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ { } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type) { +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; #if CACHEVEC @@ -470,10 +533,10 @@ for (_iml = 0; _iml < _cntml; ++_iml) { _v = NODEV(_nd); } enca = _ion_enca; - _g = _nrn_current(_v + .001); + _g = _nrn_current(_p, _ppvar, _thread, _nt, _v + .001); { double _dinca; _dinca = inca; - _rhs = _nrn_current(_v); + _rhs = _nrn_current(_p, _ppvar, _thread, _nt, _v); _ion_dincadv += (_dinca - inca)/.001 ; } _g = (_g - _rhs)/.001; @@ -487,14 +550,18 @@ for (_iml = 0; _iml < _cntml; ++_iml) { NODERHS(_nd) -= _rhs; } -}} +} + +} -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type) { +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; #if CACHEVEC @@ -507,14 +574,18 @@ for (_iml = 0; _iml < _cntml; ++_iml) { NODED(_nd) += _g; } -}} +} + +} -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type) { +double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; #endif _cntml = _ml->_nodecount; +_thread = _ml->_thread; for (_iml = 0; _iml < _cntml; ++_iml) { _p = _ml->_data[_iml]; _ppvar = _ml->_pdata[_iml]; _nd = _ml->_nodelist[_iml]; @@ -530,15 +601,15 @@ for (_iml = 0; _iml < _cntml; ++_iml) { v=_v; { enca = _ion_enca; - { error = states(); - if(error){fprintf(stderr,"at line 53 in file nca.mod:\n SOLVE states\n"); nrn_complain(_p); abort_run(error);} - } }} + { { states(_p, _ppvar, _thread, _nt); } + } }} } static void terminal(){} -static void _initlists() { +static void _initlists(){ + double _x; double* _p = &_x; int _i; static int _first = 1; if (!_first) return; _t_cinf = makevector(201*sizeof(double)); @@ -550,8 +621,12 @@ static void _initlists() { _first = 0; } +#if defined(__cplusplus) +} /* extern "C" */ +#endif + #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/nca.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/nca.mod"; static const char* nmodl_file_text = "TITLE nca.mod \n" " \n" @@ -623,9 +698,7 @@ static const char* nmodl_file_text = " trates(v) : at the current v and dt.\n" " c = c + cexp*(cinf-c)\n" " d = d + dexp*(dinf-d)\n" - " VERBATIM\n" - " return 0;\n" - " ENDVERBATIM\n" + "\n" "}\n" " \n" "LOCAL q10\n" diff --git a/pydentate/x86_64/nca.o b/pydentate/x86_64/nca.o index b8aef7a..2621588 100644 Binary files a/pydentate/x86_64/nca.o and b/pydentate/x86_64/nca.o differ diff --git a/pydentate/x86_64/netstim125.c b/pydentate/x86_64/netstim125.c index c8db4bc..09bc455 100644 --- a/pydentate/x86_64/netstim125.c +++ b/pydentate/x86_64/netstim125.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -35,9 +35,9 @@ extern double hoc_Exp(double); #define seed seed__NetStim125 #define _threadargscomma_ _p, _ppvar, _thread, _nt, -#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, +#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, #define _threadargs_ _p, _ppvar, _thread, _nt -#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt +#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt /*SUPPRESS 761*/ /*SUPPRESS 762*/ /*SUPPRESS 763*/ @@ -48,15 +48,25 @@ extern double hoc_Exp(double); #define t _nt->_t #define dt _nt->_dt #define interval _p[0] +#define interval_columnindex 0 #define number _p[1] +#define number_columnindex 1 #define start _p[2] +#define start_columnindex 2 #define forcestop _p[3] +#define forcestop_columnindex 3 #define noise _p[4] +#define noise_columnindex 4 #define event _p[5] +#define event_columnindex 5 #define on _p[6] +#define on_columnindex 6 #define ispike _p[7] +#define ispike_columnindex 7 #define v _p[8] +#define v_columnindex 8 #define _tsav _p[9] +#define _tsav_columnindex 9 #define _nd_area *_ppvar[0]._pval #define donotuse *_ppvar[2]._pval #define _p_donotuse _ppvar[2]._pval @@ -78,12 +88,12 @@ extern "C" { static Prop* _extcall_prop; /* external NEURON variables */ /* declaration of user functions */ - static double _hoc_erand(); - static double _hoc_init_sequence(); - static double _hoc_invl(); - static double _hoc_next_invl(); - static double _hoc_noiseFromRandom(); - static double _hoc_seed(); + static double _hoc_erand(void*); + static double _hoc_init_sequence(void*); + static double _hoc_invl(void*); + static double _hoc_next_invl(void*); + static double _hoc_noiseFromRandom(void*); + static double _hoc_seed(void*); static int _mechtype; extern void _nrn_cacheloop_reg(int, int); extern void hoc_register_prop_size(int, int, int); @@ -102,18 +112,18 @@ extern void hoc_reg_nmodl_filename(int, const char*); extern Prop* nrn_point_prop_; static int _pointtype; - static void* _hoc_create_pnt(_ho) Object* _ho; { void* create_point_process(); + static void* _hoc_create_pnt(Object* _ho) { void* create_point_process(int, Object*); return create_point_process(_pointtype, _ho); } - static void _hoc_destroy_pnt(); - static double _hoc_loc_pnt(_vptr) void* _vptr; {double loc_point_process(); + static void _hoc_destroy_pnt(void*); + static double _hoc_loc_pnt(void* _vptr) {double loc_point_process(int, void*); return loc_point_process(_pointtype, _vptr); } - static double _hoc_has_loc(_vptr) void* _vptr; {double has_loc_point(); + static double _hoc_has_loc(void* _vptr) {double has_loc_point(void*); return has_loc_point(_vptr); } - static double _hoc_get_loc_pnt(_vptr)void* _vptr; { - double get_loc_point_process(); return (get_loc_point_process(_vptr)); + static double _hoc_get_loc_pnt(void* _vptr) { + double get_loc_point_process(void*); return (get_loc_point_process(_vptr)); } extern void _nrn_setdata_reg(int, void(*)(Prop*)); static void _setdata(Prop* _prop) { @@ -166,9 +176,9 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void _hoc_destroy_pnt(_vptr) void* _vptr; { +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void _hoc_destroy_pnt(void* _vptr) { destroy_point_process(_vptr); } /* connect range variables in _p that hoc is supposed to know about */ @@ -219,7 +229,7 @@ static void nrn_alloc(Prop* _prop) { static void _net_receive(Point_process*, double*, double); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -246,7 +256,7 @@ extern void _cvode_abstol( Symbol**, double*, int); pnt_receive[_mechtype] = _net_receive; pnt_receive_size[_mechtype] = 1; hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 NetStim125 /home/danielmk/repos/pyDentate/mechs/netstim125.mod\n"); + ivoc_help("help ?1 NetStim125 /Users/temma/ghq/pydentate/mechs/netstim125.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -268,11 +278,11 @@ static int seed ( _threadargsprotocomma_ double _lx ) { static double _hoc_seed(void* _vptr) { double _r; - double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; _p = ((Point_process*)_vptr)->_prop->param; _ppvar = ((Point_process*)_vptr)->_prop->dparam; _thread = _extcall_thread; - _nt = (_NrnThread*)((Point_process*)_vptr)->_vnt; + _nt = (NrnThread*)((Point_process*)_vptr)->_vnt; _r = 1.; seed ( _p, _ppvar, _thread, _nt, *getarg(1) ); return(_r); @@ -288,11 +298,11 @@ static int init_sequence ( _threadargsprotocomma_ double _lt ) { static double _hoc_init_sequence(void* _vptr) { double _r; - double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; _p = ((Point_process*)_vptr)->_prop->param; _ppvar = ((Point_process*)_vptr)->_prop->dparam; _thread = _extcall_thread; - _nt = (_NrnThread*)((Point_process*)_vptr)->_vnt; + _nt = (NrnThread*)((Point_process*)_vptr)->_vnt; _r = 1.; init_sequence ( _p, _ppvar, _thread, _nt, *getarg(1) ); return(_r); @@ -315,11 +325,11 @@ return _linvl; static double _hoc_invl(void* _vptr) { double _r; - double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; _p = ((Point_process*)_vptr)->_prop->param; _ppvar = ((Point_process*)_vptr)->_prop->dparam; _thread = _extcall_thread; - _nt = (_NrnThread*)((Point_process*)_vptr)->_vnt; + _nt = (NrnThread*)((Point_process*)_vptr)->_vnt; _r = invl ( _p, _ppvar, _thread, _nt, *getarg(1) ); return(_r); } @@ -354,11 +364,11 @@ return _lerand; static double _hoc_erand(void* _vptr) { double _r; - double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; _p = ((Point_process*)_vptr)->_prop->param; _ppvar = ((Point_process*)_vptr)->_prop->dparam; _thread = _extcall_thread; - _nt = (_NrnThread*)((Point_process*)_vptr)->_vnt; + _nt = (NrnThread*)((Point_process*)_vptr)->_vnt; _r = erand ( _p, _ppvar, _thread, _nt ); return(_r); } @@ -378,11 +388,11 @@ static int noiseFromRandom ( _threadargsproto_ ) { static double _hoc_noiseFromRandom(void* _vptr) { double _r; - double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; _p = ((Point_process*)_vptr)->_prop->param; _ppvar = ((Point_process*)_vptr)->_prop->dparam; _thread = _extcall_thread; - _nt = (_NrnThread*)((Point_process*)_vptr)->_vnt; + _nt = (NrnThread*)((Point_process*)_vptr)->_vnt; _r = 1.; noiseFromRandom ( _p, _ppvar, _thread, _nt ); return(_r); @@ -399,19 +409,19 @@ static int next_invl ( _threadargsproto_ ) { static double _hoc_next_invl(void* _vptr) { double _r; - double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; _p = ((Point_process*)_vptr)->_prop->param; _ppvar = ((Point_process*)_vptr)->_prop->dparam; _thread = _extcall_thread; - _nt = (_NrnThread*)((Point_process*)_vptr)->_vnt; + _nt = (NrnThread*)((Point_process*)_vptr)->_vnt; _r = 1.; next_invl ( _p, _ppvar, _thread, _nt ); return(_r); } -static void _net_receive (_pnt, _args, _lflag) Point_process* _pnt; double* _args; double _lflag; -{ double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; - _thread = (Datum*)0; _nt = (_NrnThread*)_pnt->_vnt; _p = _pnt->_prop->param; _ppvar = _pnt->_prop->dparam; +static void _net_receive (Point_process* _pnt, double* _args, double _lflag) +{ double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + _thread = (Datum*)0; _nt = (NrnThread*)_pnt->_vnt; _p = _pnt->_prop->param; _ppvar = _pnt->_prop->dparam; if (_tsav > t){ extern char* hoc_object_name(); hoc_execerror(hoc_object_name(_pnt->ob), ":Event arrived out of order. Must call ParallelContext.set_maxstep AFTER assigning minimum NetCon.delay");} _tsav = t; if (_lflag == 1. ) {*(_tqitem) = 0;} { @@ -444,7 +454,7 @@ static void _net_receive (_pnt, _args, _lflag) Point_process* _pnt; double* _arg } } } -static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { +static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { int _i; double _save;{ { on = 0.0 ; @@ -470,7 +480,7 @@ static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC @@ -485,11 +495,11 @@ for (_iml = 0; _iml < _cntml; ++_iml) { } } -static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, double _v){double _current=0.;v=_v;{ +static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _v){double _current=0.;v=_v;{ } return _current; } -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC @@ -520,7 +530,7 @@ _first = 0; #endif #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/netstim125.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/netstim125.mod"; static const char* nmodl_file_text = ": $Id: netstim.mod 2212 2008-09-08 14:32:26Z hines $\n" ": adapted by A. Hanuschkin 2011\n" diff --git a/pydentate/x86_64/netstim125.o b/pydentate/x86_64/netstim125.o index b4ecb06..05d9c81 100644 Binary files a/pydentate/x86_64/netstim125.o and b/pydentate/x86_64/netstim125.o differ diff --git a/pydentate/x86_64/netstimbox.c b/pydentate/x86_64/netstimbox.c index b2952a3..cea424f 100644 --- a/pydentate/x86_64/netstimbox.c +++ b/pydentate/x86_64/netstimbox.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -32,9 +32,9 @@ extern double hoc_Exp(double); #define noiseFromRandom noiseFromRandom__NetStimBox #define _threadargscomma_ _p, _ppvar, _thread, _nt, -#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, +#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, #define _threadargs_ _p, _ppvar, _thread, _nt -#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt +#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt /*SUPPRESS 761*/ /*SUPPRESS 762*/ /*SUPPRESS 763*/ @@ -45,14 +45,23 @@ extern double hoc_Exp(double); #define t _nt->_t #define dt _nt->_dt #define start _p[0] +#define start_columnindex 0 #define forcestop _p[1] +#define forcestop_columnindex 1 #define status _p[2] +#define status_columnindex 2 #define nspk _p[3] +#define nspk_columnindex 3 #define event _p[4] +#define event_columnindex 4 #define on _p[5] +#define on_columnindex 5 #define ispike _p[6] +#define ispike_columnindex 6 #define v _p[7] +#define v_columnindex 7 #define _tsav _p[8] +#define _tsav_columnindex 8 #define _nd_area *_ppvar[0]._pval #define donotuse *_ppvar[2]._pval #define _p_donotuse _ppvar[2]._pval @@ -74,9 +83,9 @@ extern "C" { static Prop* _extcall_prop; /* external NEURON variables */ /* declaration of user functions */ - static double _hoc_erand(); - static double _hoc_invl(); - static double _hoc_noiseFromRandom(); + static double _hoc_erand(void*); + static double _hoc_invl(void*); + static double _hoc_noiseFromRandom(void*); static int _mechtype; extern void _nrn_cacheloop_reg(int, int); extern void hoc_register_prop_size(int, int, int); @@ -95,18 +104,18 @@ extern void hoc_reg_nmodl_filename(int, const char*); extern Prop* nrn_point_prop_; static int _pointtype; - static void* _hoc_create_pnt(_ho) Object* _ho; { void* create_point_process(); + static void* _hoc_create_pnt(Object* _ho) { void* create_point_process(int, Object*); return create_point_process(_pointtype, _ho); } - static void _hoc_destroy_pnt(); - static double _hoc_loc_pnt(_vptr) void* _vptr; {double loc_point_process(); + static void _hoc_destroy_pnt(void*); + static double _hoc_loc_pnt(void* _vptr) {double loc_point_process(int, void*); return loc_point_process(_pointtype, _vptr); } - static double _hoc_has_loc(_vptr) void* _vptr; {double has_loc_point(); + static double _hoc_has_loc(void* _vptr) {double has_loc_point(void*); return has_loc_point(_vptr); } - static double _hoc_get_loc_pnt(_vptr)void* _vptr; { - double get_loc_point_process(); return (get_loc_point_process(_vptr)); + static double _hoc_get_loc_pnt(void* _vptr) { + double get_loc_point_process(void*); return (get_loc_point_process(_vptr)); } extern void _nrn_setdata_reg(int, void(*)(Prop*)); static void _setdata(Prop* _prop) { @@ -152,9 +161,9 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void _hoc_destroy_pnt(_vptr) void* _vptr; { +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void _hoc_destroy_pnt(void* _vptr) { destroy_point_process(_vptr); } /* connect range variables in _p that hoc is supposed to know about */ @@ -201,7 +210,7 @@ static void nrn_alloc(Prop* _prop) { static void _net_receive(Point_process*, double*, double); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -227,7 +236,7 @@ extern void _cvode_abstol( Symbol**, double*, int); pnt_receive[_mechtype] = _net_receive; pnt_receive_size[_mechtype] = 1; hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 NetStimBox /home/danielmk/repos/pyDentate/mechs/netstimbox.mod\n"); + ivoc_help("help ?1 NetStimBox /Users/temma/ghq/pydentate/mechs/netstimbox.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -248,11 +257,11 @@ return _linvl; static double _hoc_invl(void* _vptr) { double _r; - double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; _p = ((Point_process*)_vptr)->_prop->param; _ppvar = ((Point_process*)_vptr)->_prop->dparam; _thread = _extcall_thread; - _nt = (_NrnThread*)((Point_process*)_vptr)->_vnt; + _nt = (NrnThread*)((Point_process*)_vptr)->_vnt; _r = invl ( _p, _ppvar, _thread, _nt, *getarg(1) ); return(_r); } @@ -288,11 +297,11 @@ return _lerand; static double _hoc_erand(void* _vptr) { double _r; - double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; _p = ((Point_process*)_vptr)->_prop->param; _ppvar = ((Point_process*)_vptr)->_prop->dparam; _thread = _extcall_thread; - _nt = (_NrnThread*)((Point_process*)_vptr)->_vnt; + _nt = (NrnThread*)((Point_process*)_vptr)->_vnt; _r = erand ( _p, _ppvar, _thread, _nt ); return(_r); } @@ -312,19 +321,19 @@ static int noiseFromRandom ( _threadargsproto_ ) { static double _hoc_noiseFromRandom(void* _vptr) { double _r; - double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; + double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; _p = ((Point_process*)_vptr)->_prop->param; _ppvar = ((Point_process*)_vptr)->_prop->dparam; _thread = _extcall_thread; - _nt = (_NrnThread*)((Point_process*)_vptr)->_vnt; + _nt = (NrnThread*)((Point_process*)_vptr)->_vnt; _r = 1.; noiseFromRandom ( _p, _ppvar, _thread, _nt ); return(_r); } -static void _net_receive (_pnt, _args, _lflag) Point_process* _pnt; double* _args; double _lflag; -{ double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; - _thread = (Datum*)0; _nt = (_NrnThread*)_pnt->_vnt; _p = _pnt->_prop->param; _ppvar = _pnt->_prop->dparam; +static void _net_receive (Point_process* _pnt, double* _args, double _lflag) +{ double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + _thread = (Datum*)0; _nt = (NrnThread*)_pnt->_vnt; _p = _pnt->_prop->param; _ppvar = _pnt->_prop->dparam; if (_tsav > t){ extern char* hoc_object_name(); hoc_execerror(hoc_object_name(_pnt->ob), ":Event arrived out of order. Must call ParallelContext.set_maxstep AFTER assigning minimum NetCon.delay");} _tsav = t; { if ( status == 1.0 ) { @@ -340,7 +349,7 @@ static void _net_receive (_pnt, _args, _lflag) Point_process* _pnt; double* _arg } } } -static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { +static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { int _i; double _save;{ { on = 0.0 ; @@ -349,7 +358,7 @@ static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC @@ -364,11 +373,11 @@ for (_iml = 0; _iml < _cntml; ++_iml) { } } -static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, double _v){double _current=0.;v=_v;{ +static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _v){double _current=0.;v=_v;{ } return _current; } -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC @@ -399,7 +408,7 @@ _first = 0; #endif #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/netstimbox.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/netstimbox.mod"; static const char* nmodl_file_text = ": $Id: netstim.mod 2212 2008-09-08 14:32:26Z hines $\n" ": adapted by A. Hanuschkin 2011 -> output of a 'nspk' spikes in a given interval, if activated!\n" diff --git a/pydentate/x86_64/netstimbox.o b/pydentate/x86_64/netstimbox.o index 07eb8bb..2cdd022 100644 Binary files a/pydentate/x86_64/netstimbox.o and b/pydentate/x86_64/netstimbox.o differ diff --git a/pydentate/x86_64/special b/pydentate/x86_64/special old mode 100644 new mode 100755 index 7f51295..a97bdd2 --- a/pydentate/x86_64/special +++ b/pydentate/x86_64/special @@ -1,17 +1,103 @@ -#!/bin/sh -if test "x${NRNHOME}" = "x" ; then - NRNHOME="/home/danielmk/miniconda3/envs/pydentate/lib/python3.8/site-packages/neuron/.data" -fi -if test "${NEURONHOME}" = "" ; then - NEURONHOME=${NRNHOME}/share/nrn - export NEURONHOME -fi -if test "x${NRNBIN}" = "x" ; then - NRNBIN="/home/danielmk/miniconda3/envs/pydentate/bin" -fi -if test "" = "yes" ; then - NRNIV="${NRNBIN}/nrniv.app/Contents/MacOS/nrniv" -else - NRNIV="${NRNBIN}/nrniv" -fi -"${NRNIV}" -dll "/home/danielmk/repos/pyDentate/x86_64/.libs/libnrnmech.so" "$@" +#!/Users/temma/ghq/pydentate/venv/bin/python3.9 +""" +A generic wrapper to access nrn binaries from a python installation +Please create a softlink with the binary name to be called. +""" +import os +import shutil +import subprocess +import sys +from pkg_resources import working_set +from distutils.ccompiler import new_compiler +from sysconfig import get_config_vars, get_config_var + + +# This replaces the now depricated distutils.sysutils.customize_compiler +def _customize_compiler(compiler): + """Do platform-sepcific customizations of compilers on unix platforms.""" + if compiler.compiler_type == "unix": + (cc, cxx, cflags) = get_config_vars("CC", "CXX", "CFLAGS") + if "CC" in os.environ: + cc = os.environ["CC"] + if "CXX" in os.environ: + cxx = os.environ["CXX"] + if "CFLAGS" in os.environ: + cflags = cflags + " " + os.environ["CFLAGS"] + cc_cmd = cc + " " + cflags + # We update executables in compiler to take advantage of distutils arg splitting + compiler.set_executables(compiler=cc_cmd, compiler_cxx=cxx) + + +def _set_default_compiler(): + """Set (dont overwrite) CC/CXX so that apps dont use the build-time ones""" + ccompiler = new_compiler() + _customize_compiler(ccompiler) + # xcrun wrapper must bring all args + if ccompiler.compiler[0] == "xcrun": + ccompiler.compiler[0] = get_config_var("CC") + ccompiler.compiler_cxx[0] = get_config_var("CXX") + os.environ.setdefault("CC", ccompiler.compiler[0]) + os.environ.setdefault("CXX", ccompiler.compiler_cxx[0]) + + +def _config_exe(exe_name): + """Sets the environment to run the real executable (returned)""" + + package_name = "neuron" + + # determine package to find the install location + if "neuron-gpu-nightly" in working_set.by_key: + print("INFO : Using neuron-gpu-nightly Package (Alpha Developer Version)") + package_name = "neuron-gpu-nightly" + elif "neuron-gpu" in working_set.by_key: + print("INFO : Using neuron-gpu Package (Alpha Version)") + package_name = "neuron-gpu" + elif "neuron-nightly" in working_set.by_key: + print("INFO : Using neuron-nightly Package (Developer Version)") + package_name = "neuron-nightly" + elif "neuron" in working_set.by_key: + package_name = "neuron" + else: + raise RuntimeError("NEURON package not found! Verify PYTHONPATH") + + NRN_PREFIX = os.path.join( + working_set.by_key[package_name].location, "neuron", ".data" + ) + os.environ["NEURONHOME"] = os.path.join(NRN_PREFIX, "share/nrn") + os.environ["NRNHOME"] = NRN_PREFIX + os.environ["CORENRNHOME"] = NRN_PREFIX + os.environ["NRN_PYTHONEXE"] = sys.executable + os.environ["CORENRN_PYTHONEXE"] = sys.executable + os.environ["CORENRN_PERLEXE"] = shutil.which("perl") + os.environ["NRNBIN"] = os.path.dirname(__file__) + + _set_default_compiler() + return os.path.join(NRN_PREFIX, "bin", exe_name) + + +def _wrap_executable(output_name): + """Create a wrapper for an executable in same dir. Requires renaming the original file. + Executables are typically found under arch_name + """ + release_dir = os.path.join(os.environ["NEURONHOME"], "demo/release") + arch_name = next(os.walk(release_dir))[1][0] # first dir + file_path = os.path.join(arch_name, output_name) + shutil.move(file_path, file_path + ".nrn") + shutil.copy(__file__, file_path) + + +if __name__ == "__main__": + exe = _config_exe(os.path.basename(sys.argv[0])) + + if exe.endswith("nrnivmodl"): + # To create a wrapper for special (so it also gets ENV vars) we intercept nrnivmodl + subprocess.check_call([exe, *sys.argv[1:]]) + _wrap_executable("special") + sys.exit(0) + + if exe.endswith("special"): + exe = os.path.join( + sys.argv[0] + ".nrn" + ) # original special is renamed special.nrn + + os.execv(exe, sys.argv) diff --git a/pydentate/x86_64/special.nrn b/pydentate/x86_64/special.nrn new file mode 100755 index 0000000..c6dc310 Binary files /dev/null and b/pydentate/x86_64/special.nrn differ diff --git a/pydentate/x86_64/tca.c b/pydentate/x86_64/tca.c index cbbeae4..892a2ad 100644 --- a/pydentate/x86_64/tca.c +++ b/pydentate/x86_64/tca.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -45,16 +45,27 @@ extern double hoc_Exp(double); #define t nrn_threads->_t #define dt nrn_threads->_dt #define gcatbar _p[0] +#define gcatbar_columnindex 0 #define itca _p[1] +#define itca_columnindex 1 #define m _p[2] +#define m_columnindex 2 #define h _p[3] +#define h_columnindex 3 #define cai _p[4] +#define cai_columnindex 4 #define cao _p[5] +#define cao_columnindex 5 #define Dm _p[6] +#define Dm_columnindex 6 #define Dh _p[7] +#define Dh_columnindex 7 #define gcat _p[8] +#define gcat_columnindex 8 #define etca _p[9] +#define etca_columnindex 9 #define _g _p[10] +#define _g_columnindex 10 #define _ion_etca *_ppvar[0]._pval #define _ion_itca *_ppvar[1]._pval #define _ion_ditcadv *_ppvar[2]._pval @@ -171,15 +182,15 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); static int _ode_count(int); static void _ode_map(int, double**, double**, double*, Datum*, double*, int); -static void _ode_spec(_NrnThread*, _Memb_list*, int); -static void _ode_matsol(_NrnThread*, _Memb_list*, int); +static void _ode_spec(NrnThread*, _Memb_list*, int); +static void _ode_matsol(NrnThread*, _Memb_list*, int); #define _cvode_ieq _ppvar[5]._i static void _ode_matsol_instance1(_threadargsproto_); @@ -231,7 +242,7 @@ static void nrn_alloc(Prop* _prop) { static void _update_ion_pointer(Datum*); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -260,7 +271,7 @@ extern void _cvode_abstol( Symbol**, double*, int); hoc_register_cvode(_mechtype, _ode_count, _ode_map, _ode_spec, _ode_matsol); hoc_register_tolerance(_mechtype, _hoc_state_tol, &_atollist); hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 cat /home/danielmk/repos/pyDentate/mechs/tca.mod\n"); + ivoc_help("help ?1 cat /Users/temma/ghq/pydentate/mechs/tca.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -575,7 +586,7 @@ static void _hoc_h_tau(void) { static int _ode_count(int _type){ return 2;} -static void _ode_spec(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_spec(NrnThread* _nt, _Memb_list* _ml, int _type) { Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -603,7 +614,7 @@ static void _ode_matsol_instance1(_threadargsproto_) { _ode_matsol1 (); } -static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_matsol(NrnThread* _nt, _Memb_list* _ml, int _type) { Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -645,7 +656,7 @@ static void initmodel() { } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -678,7 +689,7 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ { } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -717,7 +728,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -737,7 +748,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { }} -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -771,8 +782,8 @@ static void terminal(){} static void _initlists() { int _i; static int _first = 1; if (!_first) return; - _slist1[0] = &(m) - _p; _dlist1[0] = &(Dm) - _p; - _slist1[1] = &(h) - _p; _dlist1[1] = &(Dh) - _p; + _slist1[0] = m_columnindex; _dlist1[0] = Dm_columnindex; + _slist1[1] = h_columnindex; _dlist1[1] = Dh_columnindex; _t_hinf = makevector(201*sizeof(double)); _t_minf = makevector(201*sizeof(double)); _t_m_tau = makevector(201*sizeof(double)); @@ -781,7 +792,7 @@ _first = 0; } #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/tca.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/tca.mod"; static const char* nmodl_file_text = "TITLE T-calcium channel From Migliore CA3\n" ": T-type calcium channel\n" diff --git a/pydentate/x86_64/tca.o b/pydentate/x86_64/tca.o index b84b258..e2d27d8 100644 Binary files a/pydentate/x86_64/tca.o and b/pydentate/x86_64/tca.o differ diff --git a/pydentate/x86_64/tmgexp2syn.c b/pydentate/x86_64/tmgexp2syn.c index cf7ac07..6232d7d 100644 --- a/pydentate/x86_64/tmgexp2syn.c +++ b/pydentate/x86_64/tmgexp2syn.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -32,9 +32,9 @@ extern double hoc_Exp(double); #define state state__tmgexp2syn #define _threadargscomma_ _p, _ppvar, _thread, _nt, -#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, +#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, #define _threadargs_ _p, _ppvar, _thread, _nt -#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt +#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt /*SUPPRESS 761*/ /*SUPPRESS 762*/ /*SUPPRESS 763*/ @@ -45,23 +45,41 @@ extern double hoc_Exp(double); #define t _nt->_t #define dt _nt->_dt #define e _p[0] +#define e_columnindex 0 #define tau_1 _p[1] +#define tau_1_columnindex 1 #define tau_2 _p[2] +#define tau_2_columnindex 2 #define tau_rec _p[3] +#define tau_rec_columnindex 3 #define tau_facil _p[4] +#define tau_facil_columnindex 4 #define U _p[5] +#define U_columnindex 5 #define u0 _p[6] +#define u0_columnindex 6 #define i _p[7] +#define i_columnindex 7 #define g _p[8] +#define g_columnindex 8 #define A _p[9] +#define A_columnindex 9 #define B _p[10] +#define B_columnindex 10 #define x _p[11] +#define x_columnindex 11 #define factor _p[12] +#define factor_columnindex 12 #define DA _p[13] +#define DA_columnindex 13 #define DB _p[14] +#define DB_columnindex 14 #define v _p[15] +#define v_columnindex 15 #define _g _p[16] +#define _g_columnindex 16 #define _tsav _p[17] +#define _tsav_columnindex 17 #define _nd_area *_ppvar[0]._pval #if MAC @@ -99,18 +117,18 @@ extern void hoc_reg_nmodl_filename(int, const char*); extern Prop* nrn_point_prop_; static int _pointtype; - static void* _hoc_create_pnt(_ho) Object* _ho; { void* create_point_process(); + static void* _hoc_create_pnt(Object* _ho) { void* create_point_process(int, Object*); return create_point_process(_pointtype, _ho); } - static void _hoc_destroy_pnt(); - static double _hoc_loc_pnt(_vptr) void* _vptr; {double loc_point_process(); + static void _hoc_destroy_pnt(void*); + static double _hoc_loc_pnt(void* _vptr) {double loc_point_process(int, void*); return loc_point_process(_pointtype, _vptr); } - static double _hoc_has_loc(_vptr) void* _vptr; {double has_loc_point(); + static double _hoc_has_loc(void* _vptr) {double has_loc_point(void*); return has_loc_point(_vptr); } - static double _hoc_get_loc_pnt(_vptr)void* _vptr; { - double get_loc_point_process(); return (get_loc_point_process(_vptr)); + static double _hoc_get_loc_pnt(void* _vptr) { + double get_loc_point_process(void*); return (get_loc_point_process(_vptr)); } extern void _nrn_setdata_reg(int, void(*)(Prop*)); static void _setdata(Prop* _prop) { @@ -165,18 +183,18 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); - static void _hoc_destroy_pnt(_vptr) void* _vptr; { +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); + static void _hoc_destroy_pnt(void* _vptr) { destroy_point_process(_vptr); } static int _ode_count(int); static void _ode_map(int, double**, double**, double*, Datum*, double*, int); -static void _ode_spec(_NrnThread*, _Memb_list*, int); -static void _ode_matsol(_NrnThread*, _Memb_list*, int); +static void _ode_spec(NrnThread*, _Memb_list*, int); +static void _ode_matsol(NrnThread*, _Memb_list*, int); #define _cvode_ieq _ppvar[2]._i static void _ode_matsol_instance1(_threadargsproto_); @@ -239,7 +257,7 @@ static void nrn_alloc(Prop* _prop) { static void _net_init(Point_process*, double*, double); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -266,7 +284,7 @@ extern void _cvode_abstol( Symbol**, double*, int); pnt_receive_init[_mechtype] = _net_init; pnt_receive_size[_mechtype] = 5; hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 tmgexp2syn /home/danielmk/repos/pyDentate/mechs/tmgexp2syn.mod\n"); + ivoc_help("help ?1 tmgexp2syn /Users/temma/ghq/pydentate/mechs/tmgexp2syn.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -284,28 +302,28 @@ static int _ode_spec1(_threadargsproto_); static int state(_threadargsproto_); /*CVODE*/ - static int _ode_spec1 (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) {int _reset = 0; { + static int _ode_spec1 (double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) {int _reset = 0; { DA = - A / tau_1 ; DB = - B / tau_2 ; } return _reset; } - static int _ode_matsol1 (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { + static int _ode_matsol1 (double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { DA = DA / (1. - dt*( ( - 1.0 ) / tau_1 )) ; DB = DB / (1. - dt*( ( - 1.0 ) / tau_2 )) ; return 0; } /*END CVODE*/ - static int state (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { { + static int state (double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { { A = A + (1. - exp(dt*(( - 1.0 ) / tau_1)))*(- ( 0.0 ) / ( ( - 1.0 ) / tau_1 ) - A) ; B = B + (1. - exp(dt*(( - 1.0 ) / tau_2)))*(- ( 0.0 ) / ( ( - 1.0 ) / tau_2 ) - B) ; } return 0; } -static void _net_receive (_pnt, _args, _lflag) Point_process* _pnt; double* _args; double _lflag; -{ double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; - _thread = (Datum*)0; _nt = (_NrnThread*)_pnt->_vnt; _p = _pnt->_prop->param; _ppvar = _pnt->_prop->dparam; +static void _net_receive (Point_process* _pnt, double* _args, double _lflag) +{ double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + _thread = (Datum*)0; _nt = (NrnThread*)_pnt->_vnt; _p = _pnt->_prop->param; _ppvar = _pnt->_prop->dparam; if (_tsav > t){ extern char* hoc_object_name(); hoc_execerror(hoc_object_name(_pnt->ob), ":Event arrived out of order. Must call ParallelContext.set_maxstep AFTER assigning minimum NetCon.delay");} _tsav = t; { _args[2] = _args[2] * exp ( - ( t - _args[4] ) / tau_rec ) ; @@ -348,7 +366,7 @@ static void _net_init(Point_process* _pnt, double* _args, double _lflag) { double* _p = _pnt->_prop->param; Datum* _ppvar = _pnt->_prop->dparam; Datum* _thread = (Datum*)0; - _NrnThread* _nt = (_NrnThread*)_pnt->_vnt; + NrnThread* _nt = (NrnThread*)_pnt->_vnt; _args[1] = 0.0 ; _args[2] = 0.0 ; _args[3] = u0 ; @@ -357,7 +375,7 @@ static void _net_init(Point_process* _pnt, double* _args, double _lflag) { static int _ode_count(int _type){ return 2;} -static void _ode_spec(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_spec(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -383,7 +401,7 @@ static void _ode_matsol_instance1(_threadargsproto_) { _ode_matsol1 (_p, _ppvar, _thread, _nt); } -static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_matsol(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -395,7 +413,7 @@ static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { _ode_matsol_instance1(_threadargs_); }} -static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { +static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { int _i; double _save;{ A = A0; B = B0; @@ -418,7 +436,7 @@ static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC @@ -443,7 +461,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { } } -static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, double _v){double _current=0.;v=_v;{ { +static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _v){double _current=0.;v=_v;{ { g = B - A ; i = g * ( v - e ) ; } @@ -452,7 +470,7 @@ static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC @@ -490,7 +508,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { } -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC @@ -514,7 +532,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { } -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC @@ -547,8 +565,8 @@ static void _initlists(){ double _x; double* _p = &_x; int _i; static int _first = 1; if (!_first) return; - _slist1[0] = &(A) - _p; _dlist1[0] = &(DA) - _p; - _slist1[1] = &(B) - _p; _dlist1[1] = &(DB) - _p; + _slist1[0] = A_columnindex; _dlist1[0] = DA_columnindex; + _slist1[1] = B_columnindex; _dlist1[1] = DB_columnindex; _first = 0; } @@ -557,7 +575,7 @@ _first = 0; #endif #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/tmgexp2syn.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/tmgexp2syn.mod"; static const char* nmodl_file_text = "COMMENT\n" "Revised 12/15/2000 in light of a personal communication \n" diff --git a/pydentate/x86_64/tmgexp2syn.o b/pydentate/x86_64/tmgexp2syn.o index b78b3e0..dc44f13 100644 Binary files a/pydentate/x86_64/tmgexp2syn.o and b/pydentate/x86_64/tmgexp2syn.o differ diff --git a/pydentate/x86_64/tmgsyn.c b/pydentate/x86_64/tmgsyn.c index 23589fa..b28d5bc 100644 --- a/pydentate/x86_64/tmgsyn.c +++ b/pydentate/x86_64/tmgsyn.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -32,9 +32,9 @@ extern double hoc_Exp(double); #define state state__tmgsyn #define _threadargscomma_ _p, _ppvar, _thread, _nt, -#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, +#define _threadargsprotocomma_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, #define _threadargs_ _p, _ppvar, _thread, _nt -#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt +#define _threadargsproto_ double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt /*SUPPRESS 761*/ /*SUPPRESS 762*/ /*SUPPRESS 763*/ @@ -45,18 +45,31 @@ extern double hoc_Exp(double); #define t _nt->_t #define dt _nt->_dt #define e _p[0] +#define e_columnindex 0 #define tau_1 _p[1] +#define tau_1_columnindex 1 #define tau_rec _p[2] +#define tau_rec_columnindex 2 #define tau_facil _p[3] +#define tau_facil_columnindex 3 #define U _p[4] +#define U_columnindex 4 #define u0 _p[5] +#define u0_columnindex 5 #define i _p[6] +#define i_columnindex 6 #define g _p[7] +#define g_columnindex 7 #define x _p[8] +#define x_columnindex 8 #define Dg _p[9] +#define Dg_columnindex 9 #define v _p[10] +#define v_columnindex 10 #define _g _p[11] +#define _g_columnindex 11 #define _tsav _p[12] +#define _tsav_columnindex 12 #define _nd_area *_ppvar[0]._pval #if MAC @@ -94,18 +107,18 @@ extern void hoc_reg_nmodl_filename(int, const char*); extern Prop* nrn_point_prop_; static int _pointtype; - static void* _hoc_create_pnt(_ho) Object* _ho; { void* create_point_process(); + static void* _hoc_create_pnt(Object* _ho) { void* create_point_process(int, Object*); return create_point_process(_pointtype, _ho); } - static void _hoc_destroy_pnt(); - static double _hoc_loc_pnt(_vptr) void* _vptr; {double loc_point_process(); + static void _hoc_destroy_pnt(void*); + static double _hoc_loc_pnt(void* _vptr) {double loc_point_process(int, void*); return loc_point_process(_pointtype, _vptr); } - static double _hoc_has_loc(_vptr) void* _vptr; {double has_loc_point(); + static double _hoc_has_loc(void* _vptr) {double has_loc_point(void*); return has_loc_point(_vptr); } - static double _hoc_get_loc_pnt(_vptr)void* _vptr; { - double get_loc_point_process(); return (get_loc_point_process(_vptr)); + static double _hoc_get_loc_pnt(void* _vptr) { + double get_loc_point_process(void*); return (get_loc_point_process(_vptr)); } extern void _nrn_setdata_reg(int, void(*)(Prop*)); static void _setdata(Prop* _prop) { @@ -157,18 +170,18 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void nrn_cur(_NrnThread*, _Memb_list*, int); -static void nrn_jacob(_NrnThread*, _Memb_list*, int); - static void _hoc_destroy_pnt(_vptr) void* _vptr; { +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void nrn_cur(NrnThread*, _Memb_list*, int); +static void nrn_jacob(NrnThread*, _Memb_list*, int); + static void _hoc_destroy_pnt(void* _vptr) { destroy_point_process(_vptr); } static int _ode_count(int); static void _ode_map(int, double**, double**, double*, Datum*, double*, int); -static void _ode_spec(_NrnThread*, _Memb_list*, int); -static void _ode_matsol(_NrnThread*, _Memb_list*, int); +static void _ode_spec(NrnThread*, _Memb_list*, int); +static void _ode_matsol(NrnThread*, _Memb_list*, int); #define _cvode_ieq _ppvar[2]._i static void _ode_matsol_instance1(_threadargsproto_); @@ -227,7 +240,7 @@ static void nrn_alloc(Prop* _prop) { static void _net_init(Point_process*, double*, double); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -254,7 +267,7 @@ extern void _cvode_abstol( Symbol**, double*, int); pnt_receive_init[_mechtype] = _net_init; pnt_receive_size[_mechtype] = 5; hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 tmgsyn /home/danielmk/repos/pyDentate/mechs/tmgsyn.mod\n"); + ivoc_help("help ?1 tmgsyn /Users/temma/ghq/pydentate/mechs/tmgsyn.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -272,25 +285,25 @@ static int _ode_spec1(_threadargsproto_); static int state(_threadargsproto_); /*CVODE*/ - static int _ode_spec1 (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) {int _reset = 0; { + static int _ode_spec1 (double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) {int _reset = 0; { Dg = - g / tau_1 ; } return _reset; } - static int _ode_matsol1 (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { + static int _ode_matsol1 (double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { Dg = Dg / (1. - dt*( ( - 1.0 ) / tau_1 )) ; return 0; } /*END CVODE*/ - static int state (double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { { + static int state (double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { { g = g + (1. - exp(dt*(( - 1.0 ) / tau_1)))*(- ( 0.0 ) / ( ( - 1.0 ) / tau_1 ) - g) ; } return 0; } -static void _net_receive (_pnt, _args, _lflag) Point_process* _pnt; double* _args; double _lflag; -{ double* _p; Datum* _ppvar; Datum* _thread; _NrnThread* _nt; - _thread = (Datum*)0; _nt = (_NrnThread*)_pnt->_vnt; _p = _pnt->_prop->param; _ppvar = _pnt->_prop->dparam; +static void _net_receive (Point_process* _pnt, double* _args, double _lflag) +{ double* _p; Datum* _ppvar; Datum* _thread; NrnThread* _nt; + _thread = (Datum*)0; _nt = (NrnThread*)_pnt->_vnt; _p = _pnt->_prop->param; _ppvar = _pnt->_prop->dparam; if (_tsav > t){ extern char* hoc_object_name(); hoc_execerror(hoc_object_name(_pnt->ob), ":Event arrived out of order. Must call ParallelContext.set_maxstep AFTER assigning minimum NetCon.delay");} _tsav = t; { _args[2] = _args[2] * exp ( - ( t - _args[4] ) / tau_rec ) ; @@ -323,7 +336,7 @@ static void _net_init(Point_process* _pnt, double* _args, double _lflag) { double* _p = _pnt->_prop->param; Datum* _ppvar = _pnt->_prop->dparam; Datum* _thread = (Datum*)0; - _NrnThread* _nt = (_NrnThread*)_pnt->_vnt; + NrnThread* _nt = (NrnThread*)_pnt->_vnt; _args[1] = 0.0 ; _args[2] = 0.0 ; _args[3] = u0 ; @@ -332,7 +345,7 @@ static void _net_init(Point_process* _pnt, double* _args, double _lflag) { static int _ode_count(int _type){ return 1;} -static void _ode_spec(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_spec(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -358,7 +371,7 @@ static void _ode_matsol_instance1(_threadargsproto_) { _ode_matsol1 (_p, _ppvar, _thread, _nt); } -static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void _ode_matsol(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node* _nd; double _v; int _iml, _cntml; _cntml = _ml->_nodecount; @@ -370,7 +383,7 @@ static void _ode_matsol(_NrnThread* _nt, _Memb_list* _ml, int _type) { _ode_matsol_instance1(_threadargs_); }} -static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt) { +static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt) { int _i; double _save;{ g = g0; { @@ -380,7 +393,7 @@ static void initmodel(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC @@ -405,7 +418,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { } } -static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread* _nt, double _v){double _current=0.;v=_v;{ { +static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, NrnThread* _nt, double _v){double _current=0.;v=_v;{ { i = g * ( v - e ) ; } _current += i; @@ -413,7 +426,7 @@ static double _nrn_current(double* _p, Datum* _ppvar, Datum* _thread, _NrnThread } return _current; } -static void nrn_cur(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void nrn_cur(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; int* _ni; double _rhs, _v; int _iml, _cntml; #if CACHEVEC @@ -451,7 +464,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { } -static void nrn_jacob(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void nrn_jacob(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; int* _ni; int _iml, _cntml; #if CACHEVEC @@ -475,7 +488,7 @@ for (_iml = 0; _iml < _cntml; ++_iml) { } -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type) { +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type) { double* _p; Datum* _ppvar; Datum* _thread; Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC @@ -508,7 +521,7 @@ static void _initlists(){ double _x; double* _p = &_x; int _i; static int _first = 1; if (!_first) return; - _slist1[0] = &(g) - _p; _dlist1[0] = &(Dg) - _p; + _slist1[0] = g_columnindex; _dlist1[0] = Dg_columnindex; _first = 0; } @@ -517,7 +530,7 @@ _first = 0; #endif #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/tmgsyn.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/tmgsyn.mod"; static const char* nmodl_file_text = "COMMENT\n" "Revised 12/15/2000 in light of a personal communication \n" diff --git a/pydentate/x86_64/tmgsyn.o b/pydentate/x86_64/tmgsyn.o index 938df83..573a916 100644 Binary files a/pydentate/x86_64/tmgsyn.o and b/pydentate/x86_64/tmgsyn.o differ diff --git a/pydentate/x86_64/vecevent.c b/pydentate/x86_64/vecevent.c index 91ea3fb..9d7c45b 100644 --- a/pydentate/x86_64/vecevent.c +++ b/pydentate/x86_64/vecevent.c @@ -4,7 +4,7 @@ #include #include #include -#include "scoplib_ansi.h" +#include "mech_api.h" #undef PI #define nil 0 #include "md1redef.h" @@ -46,9 +46,13 @@ extern double hoc_Exp(double); #define t nrn_threads->_t #define dt nrn_threads->_dt #define index _p[0] +#define index_columnindex 0 #define etime _p[1] +#define etime_columnindex 1 #define space _p[2] +#define space_columnindex 2 #define _tsav _p[3] +#define _tsav_columnindex 3 #define _nd_area *_ppvar[0]._pval #if MAC @@ -66,8 +70,8 @@ extern "C" { static int hoc_nrnpointerindex = -1; /* external NEURON variables */ /* declaration of user functions */ - static double _hoc_element(); - static double _hoc_play(); + static double _hoc_element(void*); + static double _hoc_play(void*); static int _mechtype; extern void _nrn_cacheloop_reg(int, int); extern void hoc_register_prop_size(int, int, int); @@ -86,18 +90,18 @@ extern void hoc_reg_nmodl_filename(int, const char*); extern Prop* nrn_point_prop_; static int _pointtype; - static void* _hoc_create_pnt(_ho) Object* _ho; { void* create_point_process(); + static void* _hoc_create_pnt(Object* _ho) { void* create_point_process(int, Object*); return create_point_process(_pointtype, _ho); } - static void _hoc_destroy_pnt(); - static double _hoc_loc_pnt(_vptr) void* _vptr; {double loc_point_process(); + static void _hoc_destroy_pnt(void*); + static double _hoc_loc_pnt(void* _vptr) {double loc_point_process(int, void*); return loc_point_process(_pointtype, _vptr); } - static double _hoc_has_loc(_vptr) void* _vptr; {double has_loc_point(); + static double _hoc_has_loc(void* _vptr) {double has_loc_point(void*); return has_loc_point(_vptr); } - static double _hoc_get_loc_pnt(_vptr)void* _vptr; { - double get_loc_point_process(); return (get_loc_point_process(_vptr)); + static double _hoc_get_loc_pnt(void* _vptr) { + double get_loc_point_process(void*); return (get_loc_point_process(_vptr)); } extern void _nrn_setdata_reg(int, void(*)(Prop*)); static void _setdata(Prop* _prop) { @@ -137,9 +141,9 @@ extern void hoc_reg_nmodl_filename(int, const char*); }; static double _sav_indep; static void nrn_alloc(Prop*); -static void nrn_init(_NrnThread*, _Memb_list*, int); -static void nrn_state(_NrnThread*, _Memb_list*, int); - static void _hoc_destroy_pnt(_vptr) void* _vptr; { +static void nrn_init(NrnThread*, _Memb_list*, int); +static void nrn_state(NrnThread*, _Memb_list*, int); + static void _hoc_destroy_pnt(void* _vptr) { destroy_point_process(_vptr); } /* connect range variables in _p that hoc is supposed to know about */ @@ -179,7 +183,7 @@ static void nrn_alloc(Prop* _prop) { static void _net_receive(Point_process*, double*, double); extern Symbol* hoc_lookup(const char*); extern void _nrn_thread_reg(int, int, void(*)(Datum*)); -extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, _NrnThread*, int)); +extern void _nrn_thread_table_reg(int, void(*)(double*, Datum*, Datum*, NrnThread*, int)); extern void hoc_register_tolerance(int, HocStateTolerance*, Symbol***); extern void _cvode_abstol( Symbol**, double*, int); @@ -205,7 +209,7 @@ extern void _cvode_abstol( Symbol**, double*, int); pnt_receive[_mechtype] = _net_receive; pnt_receive_size[_mechtype] = 1; hoc_register_var(hoc_scdoub, hoc_vdoub, hoc_intfunc); - ivoc_help("help ?1 VecStim /home/danielmk/repos/pyDentate/mechs/vecevent.mod\n"); + ivoc_help("help ?1 VecStim /Users/temma/ghq/pydentate/mechs/vecevent.mod\n"); hoc_register_limits(_mechtype, _hoc_parm_limits); hoc_register_units(_mechtype, _hoc_parm_units); } @@ -219,7 +223,7 @@ static void _modl_cleanup(){ _match_recurse=1;} static int element(); static int play(); -static void _net_receive (_pnt, _args, _lflag) Point_process* _pnt; double* _args; double _lflag; +static void _net_receive (Point_process* _pnt, double* _args, double _lflag) { _p = _pnt->_prop->param; _ppvar = _pnt->_prop->dparam; if (_tsav > t){ extern char* hoc_object_name(); hoc_execerror(hoc_object_name(_pnt->ob), ":Event arrived out of order. Must call ParallelContext.set_maxstep AFTER assigning minimum NetCon.delay");} _tsav = t; if (_lflag == 1. ) {*(_tqitem) = 0;} @@ -303,7 +307,7 @@ static void initmodel() { } } -static void nrn_init(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_init(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -319,7 +323,7 @@ static double _nrn_current(double _v){double _current=0.;v=_v;{ } return _current; } -static void nrn_state(_NrnThread* _nt, _Memb_list* _ml, int _type){ +static void nrn_state(NrnThread* _nt, _Memb_list* _ml, int _type){ Node *_nd; double _v = 0.0; int* _ni; int _iml, _cntml; #if CACHEVEC _ni = _ml->_nodeindices; @@ -343,7 +347,7 @@ _first = 0; } #if NMODL_TEXT -static const char* nmodl_filename = "/home/danielmk/repos/pyDentate/mechs/vecevent.mod"; +static const char* nmodl_filename = "/Users/temma/ghq/pydentate/mechs/vecevent.mod"; static const char* nmodl_file_text = ": Vector stream of events\n" "\n" diff --git a/pydentate/x86_64/vecevent.o b/pydentate/x86_64/vecevent.o index 0bb1e15..c5e0070 100644 Binary files a/pydentate/x86_64/vecevent.o and b/pydentate/x86_64/vecevent.o differ