Code Monkey home page Code Monkey logo

neurotune's Introduction

Neurotune

GH Build Documentation Status PyPI PyPI - Python Version GitHub GitHub pull requests GitHub issues GitHub Org's stars

This package provides Neurotune, a package for optimizing electical models of excitable cells.

This package was originally developed by Mike Vella. This has been updated by Padraig Gleeson and others (and moved to NeuralEnsemble) to continue development of pyelectro and Neurotune for use in OpenWorm, Open Source Brain and other projects

Full documentation can be found here.

Installation

Install Neurotune with the following command:

sudo pip install .

The developer dependencies can be installed using the dev extra:

sudo pip install .[dev]

The CI script shows the full set of commands for installation & execution of a number of examples.

neurotune's People

Contributors

lucasklmn avatar lungd avatar pgleeson avatar sanjayankur31 avatar vellamike avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

neurotune's Issues

installation command

I guess in the installation document, this:
python setup.py --install
should be replaced with this:
python setup.py install

Also, pyelectro is another dependency, which is missing from the documentation.

Implementing cost function in neurotune

It seems like the cost function should be implemented in neurotune (perhaps in the evaluator class), but in the example given in the docs, the cost function is returned from somewhere in PyElectro.

@vellamike Is there a particular reason for implementing the cost function in pyElectro versus in neurotune itself? I am a bit unclear on where to put that function at the moment.

Matplotlib `set_window_title` deprecation

/home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-software/pyNeuroML/.venv39/lib64/python3.9/site-packages/neurotune/utils.py:97: MatplotlibDeprecationWarning: 
The set_window_title function was deprecated in Matplotlib 3.4 and will be removed two minor releases later. Use manager.set_window_title or GUI-specific methods instead.
  fig.canvas.set_window_title(title_prefix+" Evolution over %i generations of %s"%(generations_total, sim_var_names))
/home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-software/pyNeuroML/.venv39/lib64/python3.9/site-packages/neurotune/utils.py:115: MatplotlibDeprecationWarning: 
The set_window_title function was deprecated in Matplotlib 3.4 and will be removed two minor releases later. Use manager.set_window_title or GUI-specific methods instead.
  fig.canvas.set_window_title(title_prefix+" Fitness over %i generations from %s"%(generations_total, individuals_file_name))
/home/asinha/Documents/02_Code/00_mine/2020-OSB/NeuroML-software/pyNeuroML/.venv39/lib64/python3.9/site-packages/neurotune/utils.py:128: MatplotlibDeprecationWarning: 
The set_window_title function was deprecated in Matplotlib 3.4 and will be removed two minor releases later. Use manager.set_window_title or GUI-specific methods instead.

De-duplicate mod files in examples

We seem to have duplicates of mod files in some of the examples which waste some resources (bandwidth + diskspace on mirrors etc.), so it'll be good to de-duplicate them if possible. Came up in the Fedora Linux review:

python-neurotune-doc.noarch: E: files-duplicated-waste 416067
python-neurotune-doc.noarch: W: files-duplicate /usr/share/doc/python-neurotune-doc/examples/example_2/100pA_1.csv /usr/share/doc/python-neurotune-doc/examples/example_1/100pA_1.csv
python-neurotune-doc.noarch: W: files-duplicate /usr/share/doc/python-neurotune-doc/examples/example_2/Kv_3_erisir_99.mod /usr/share/doc/python-neurotune-doc/examples/example_1/Kv_3_erisir_99.mod
python-neurotune-doc.noarch: W: files-duplicate /usr/share/doc/python-neurotune-doc/examples/example_2/kv_1.mod /usr/share/doc/python-neurotune-doc/examples/example_1/kv_1.mod
python-neurotune-doc.noarch: W: files-duplicate /usr/share/doc/python-neurotune-doc/examples/example_2/na.mod /usr/share/doc/python-neurotune-doc/examples/example_1/na.mod

https://bugzilla.redhat.com/show_bug.cgi?id=2026389

Requesting access

Hi @apdavison : would you be able to add me to this repo when you have a minute please? We're updating the code here so it'll make it easier if I could push minor changes directly instead of waiting for Padraig to merge all my PRs.

Also, looks like @pgleeson has write access here, but not the required access to add/remove folks to the repo. Would it be OK to please
bump up their access too so we don't have to trouble you for this again :)?

Thanks very much,

included example_1 and example_2 won't run

Hi there,

It seems that at least the first two examples under the neurotune/examples directory don't run. I think that these are also the same examples described in the documentation here.

When I run example_2 it throws an error saying that pyelectro.analysis.IClampAnalysis is missing a function:

In [2]: %run optimization.py
NEURON -- VERSION 7.5 (1448:4af9ae02ad58) 2016-06-29
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from nrnmech.dll
Additional mechanisms from files
 Kv_3_erisir_99.mod kv_1.mod na.mod
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
C:\Users\lkoelman\workspace\neurotune\examples\example_2\optimization.py in <mod
ule>()
    325
    326 #Sanity check - expected is 0
--> 327 fitness_value = surrogate_analysis.evaluate_fitness(surrogate_targets,
    328                                     weights,
    329                                     cost_function = analysis.normalised_
cost_function)

AttributeError: 'IClampAnalysis' object has no attribute 'evaluate_fitness'

Could this be due to a mismatch in the version of pyelectro required?

For the second example I get a ZeroDivisionError:

In [3]: %run optimization.py
NEURON -- VERSION 7.5 (1448:4af9ae02ad58) 2016-06-29
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2016
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from nrnmech.dll
Additional mechanisms from files
 Kv_3_erisir_99.mod kv_1.mod na.mod
target data path in evaluator:100pA_1.csv
---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
C:\Users\lkoelman\workspace\neurotune\examples\example_1\optimization.py in <mod
ule>()
    259     my_optimizer.optimize()
    260
--> 261 main()

C:\Users\lkoelman\workspace\neurotune\examples\example_1\optimization.py in main
()
    245                                             weights=weights,
    246                                             targets=None, # because we'r
e using automatic
--> 247                                             automatic=True)
    248
    249     #make an optimizer

C:\Users\lkoelman\Anaconda2\lib\site-packages\neurotune\evaluators.pyc in __init
__(self, analysis_start_time, controller, analysis_end_time, target_data_path, p
arameters, analysis_var, weights, targets, automatic)
    323                                                     end_analysis=analysi
s_end_time)
    324
--> 325             ic_analysis.analyse()
    326
    327             self.targets = ic_analysis.analysis_results

C:\Users\lkoelman\Anaconda2\lib\site-packages\pyelectro-0.1.6-py2.7.egg\pyelectr
o\analysis.pyc in analyse(self)
   1217             analysis_results['first_spike_time'] = max_min_dictionary['m
axima_times'][0]
   1218
-> 1219             trough_phases=minima_phases(max_min_dictionary)
   1220
   1221             try:

C:\Users\lkoelman\Anaconda2\lib\site-packages\pyelectro-0.1.6-py2.7.egg\pyelectr
o\analysis.pyc in minima_phases(max_min_dictionary)
   1020         maximum_1_t=maxima_times[i+1]
   1021         minimum_time=minima_times[i]
-> 1022         phase=(minimum_time-maximum_0_t)/(maximum_1_t-maximum_0_t)
   1023         minima_phases.append(phase)
   1024

ZeroDivisionError: float division by zero

I followed the installation instructions and have all dependencies installed, so I don't think it is due to my specific installation.

Cheers,
Lucas.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.