cleo.utilities module#

Assorted utilities for developers.

cleo.utilities.add_to_neo_segment(segment: neo.core.segment.Segment, *objects: neo.core.dataobject.DataObject)[source]#

Conveniently adds multiple objects to a segment.

Taken from neo.core.group.Group.

cleo.utilities.analog_signal(t_ms, values_no_unit, units) neo.core.basesignal.BaseSignal[source]#
cleo.utilities.get_orth_vectors_for_V(V)[source]#

For nx3 block of row vectors V, return nx3 W1, W2 orthogonal vector blocks

cleo.utilities.modify_model_with_eqs(neuron_group, eqs_to_add)[source]#

Adapted from _create_variables() from neurongroup.py from Brian2 source code v2.3.0.2

cleo.utilities.normalize_coords(coords: brian2.units.fundamentalunits.Quantity) brian2.units.fundamentalunits.Quantity[source]#

Normalize coordinates to unit vectors.

cleo.utilities.rng = Generator(PCG64) at 0x7F13C9552820#

supposed to be the central random number generator, but not yet used everywhere

cleo.utilities.style_plots_for_docs(dark=True)[source]#
cleo.utilities.times_are_regular(times)[source]#
cleo.utilities.uniform_cylinder_rθz(n, rmax, zmax)[source]#

uniformly fills a cylinder with radius rmax and height zmax with n points.

Does so by generating a Fibonacci spiral cylinder by rotating around axis and up and down cylinder simultaneously, using different angle steps.

cleo.utilities.wavelength_to_rgb(wavelength_nm, gamma=0.8)[source]#

taken from http://www.noah.org/wiki/Wavelength_to_RGB_in_Python This converts a given wavelength of light to an approximate RGB color value. The wavelength must be given in nanometers in the range from 380 nm through 750 nm (789 THz through 400 THz).

Based on code by Dan Bruton http://www.physics.sfasu.edu/astro/color/spectra.html

cleo.utilities.xyz_from_rθz(rs, thetas, zs, xyz_start, xyz_end)[source]#

Convert from cylindrical to Cartesian coordinates.