Skip to content

Commit

Permalink
Merge branch 'master' into numpy-scaler
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienJaquier authored Jan 26, 2024
2 parents 656580b + f56a38f commit f8d555f
Show file tree
Hide file tree
Showing 14 changed files with 179 additions and 2,412 deletions.
37 changes: 0 additions & 37 deletions .install_neuron.sh

This file was deleted.

39 changes: 0 additions & 39 deletions .jenkins.sh

This file was deleted.

48 changes: 48 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"title" : "BluePyOpt",
"license": "LGPL-3.0",
"upload_type": "software",
"description": "The Blue Brain Python Optimisation Library (BluePyOpt) is an extensible framework for data-driven model parameter optimisation that wraps and standardises several existing open-source tools. It simplifies the task of creating and sharing these optimisations, and the associated techniques and knowledge. This is achieved by abstracting the optimisation and evaluation tasks into various reusable and flexible discrete elements according to established best-practices. Further, BluePyOpt provides methods for setting up both small- and large-scale optimisations on a variety of platforms, ranging from laptops to Linux clusters and cloud-based compute infrastructures.",
"creators": [
{
"affiliation": "Blue Brain Project, EPFL",
"name": "Van Geit, Werner",
"orcid": "0000-0002-2915-720X"
},
{
"affiliation": "Blue Brain Project, EPFL",
"name": "Gevaert, Michael",
"orcid": "0000-0002-7547-3297"
},
{
"affiliation": "Blue Brain Project, EPFL",
"name": "Damart, Tanguy",
"orcid": "0000-0003-2175-7304"
},
{
"affiliation": "Blue Brain Project, EPFL",
"name": "Rössert, Christian",
"orcid": "0000-0002-4839-2424"
},
{
"affiliation": "Blue Brain Project, EPFL",
"name": "Courcol, Jean-Denis",
"orcid": "0000-0002-9351-1461"
},
{
"affiliation": "Blue Brain Project, EPFL",
"name": "Chindemi, Guiseppe",
"orcid": "0000-0001-6872-2366"
},
{
"affiliation": "Blue Brain Project, EPFL",
"name": "Jaquier, Aurélien",
"orcid": "0000-0001-6202-6175"
},
{
"affiliation": "Blue Brain Project, EPFL",
"name": "Muller, Eilif",
"orcid": "0000-0003-4309-8266"
}
]
}
94 changes: 42 additions & 52 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,22 @@
BluePyOpt
=========

.. raw:: html

<table>
<tr>
<td>Latest Release</td>
<td>
<a href="https://pypi.org/project/bluepyopt/">
<img src="https://img.shields.io/pypi/v/bluepyopt.svg" alt="latest release" />
</a>
</td>
</tr>
<tr>
<td>Documentation</td>
<td>
<a href="https://bluepyopt.readthedocs.io/">
<img src="https://readthedocs.org/projects/bluepyopt/badge/?version=latest" alt="latest documentation" />
</a>
</td>
</tr>
<tr>
<td>License</td>
<td>
<a href="https://github.com/BlueBrain/bluepyopt/blob/master/LICENSE.txt">
<img src="https://img.shields.io/pypi/l/bluepyopt.svg" alt="license" />
</a>
</td>
</tr>
<tr>
<td>Build Status</td>
<td>
<a href="https://github.com/BlueBrain/BluePyOpt/actions">
<img src="https://github.com/BlueBrain/BluePyOpt/workflows/Build/badge.svg?branch=master" alt="Actions build status" />
</a>
</td>
</tr>
<tr>
<td>Coverage</td>
<td>
<a href="https://codecov.io/gh/BlueBrain/bluepyopt">
<img src="https://codecov.io/github/BlueBrain/BluePyOpt/coverage.svg?branch=master" alt="coverage" />
</a>
</td>
</tr>
<tr>
<td>Gitter</td>
<td>
<a href="https://gitter.im/bluebrain/bluepyopt">
<img src="https://badges.gitter.im/Join%20Chat.svg"
</a>
</td>
</tr>
</table>

+----------------+------------+
| Latest Release | |pypi| |
+----------------+------------+
| Documentation | |docs| |
+----------------+------------+
| License | |license| |
+----------------+------------+
| Build Status | |build| |
+----------------+------------+
| Coverage | |coverage| |
+----------------+------------+
| Gitter | |gitter| |
+----------------+------------+
| Zenodo | |zenodo| |
+----------------+------------+


Introduction
Expand Down Expand Up @@ -229,6 +192,33 @@ Copyright (c) 2016-2022 Blue Brain Project/EPFL
The index.rst location is used for the docs README; index.rst also defined an end-marker,
to skip content after the marker 'substitutions'.
.. |pypi| image:: https://img.shields.io/pypi/v/bluepyopt.svg
:target: https://pypi.org/project/bluepyopt/
:alt: latest release

.. |docs| image:: https://readthedocs.org/projects/bluepyopt/badge/?version=latest
:target: https://bluepyopt.readthedocs.io/
:alt: latest documentation

.. |license| image:: https://img.shields.io/pypi/l/bluepyopt.svg
:target: https://github.com/BlueBrain/bluepyopt/blob/master/LICENSE.txt
:alt: license

.. |build| image:: https://github.com/BlueBrain/BluePyOpt/workflows/Build/badge.svg?branch=master
:target: https://github.com/BlueBrain/BluePyOpt/actions
:alt: actions build status

.. |coverage| image:: https://codecov.io/github/BlueBrain/BluePyOpt/coverage.svg?branch=master
:target: https://codecov.io/gh/BlueBrain/bluepyopt
:alt: coverage

.. |gitter| image:: https://badges.gitter.im/Join%20Chat.svg
:target: https://gitter.im/BlueBrain/blueptopt
:alt: Join the chat at https://gitter.im/BlueBrain/BluePyOpt

.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.8135890.svg
:target: https://doi.org/10.5281/zenodo.8135890

.. substitutions
.. |banner| image:: docs/source/logo/BluePyOptBanner.png
.. |landscape_example| image:: examples/simplecell/figures/landscape_example.png
10 changes: 3 additions & 7 deletions bluepyopt/deapext/tools/selIBEA.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
"""IBEA selector"""

from __future__ import division

from past.builtins import xrange # pylint: disable=W0622

"""
Copyright (c) 2016-2022, EPFL/Blue Brain Project
Expand Down Expand Up @@ -77,7 +73,7 @@ def _calc_fitness_components(population, kappa):
box_ranges[box_ranges == 0] = 1.0

components_matrix = numpy.zeros((pop_len, pop_len))
for i in xrange(0, pop_len):
for i in range(0, pop_len):
diff = population_matrix - population_matrix[i, :]
components_matrix[i, :] = numpy.max(
numpy.divide(diff, box_ranges),
Expand Down Expand Up @@ -115,9 +111,9 @@ def _mating_selection(population, mu, tournament_n):
"""Returns the n_of_parents individuals with the best fitness"""

parents = []
for _ in xrange(mu):
for _ in range(mu):
winner = _choice(population)
for _ in xrange(tournament_n - 1):
for _ in range(tournament_n - 1):
individual = _choice(population)
# Save winner is element with smallest fitness
if individual.ibea_fitness < winner.ibea_fitness:
Expand Down
10 changes: 9 additions & 1 deletion bluepyopt/ephys/efeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@ def calculate_feature(
peak_times = self._get_peak_times(
responses, raise_warnings=raise_warnings
)
if peak_times is None:
if return_waveforms:
return None, None
else:
return None

if len(peak_times) > 1 and self.skip_first_spike:
peak_times = peak_times[1:]
Expand All @@ -439,7 +444,10 @@ def calculate_feature(
if responses[self.recording_names[""]] is not None:
response = responses[self.recording_names[""]]
else:
return None
if return_waveforms:
return None, None
else:
return None

if np.std(np.diff(response["time"])) > 0.001 * np.mean(
np.diff(response["time"])
Expand Down
4 changes: 0 additions & 4 deletions bluepyopt/ephys/serializer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
'''Mixin class to make dictionaries'''
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import

# Disabling lines below, generate error when loading ephys.examples
# from future import standard_library
Expand Down
2 changes: 0 additions & 2 deletions bluepyopt/ipyp/bpopt_tasksdb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Get stats out of ipyparallel's tasks.db"""

from __future__ import print_function

"""
Copyright (c) 2016-2020, EPFL/Blue Brain Project
Expand Down
2 changes: 0 additions & 2 deletions examples/graupnerbrunelstdp/run_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# pylint: disable=R0914

from __future__ import print_function

import pickle
import bluepyopt as bpop
import matplotlib.pyplot as plt
Expand Down
Loading

0 comments on commit f8d555f

Please sign in to comment.