The Virtual Brain Project

Table Of Contents

Previous topic

neocom Package

Next topic

portlets Package

This Page

neotraits Package

_forms

class tvb.core.neotraits._forms.ArrayField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits._forms.TraitField

template = 'str_field.jinja2'
value[source]
class tvb.core.neotraits._forms.BoolField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits._forms.TraitField

template = 'bool_field.jinja2'
class tvb.core.neotraits._forms.BytesField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits._forms.StrField

StrField for byte strings.

template = 'str_field.jinja2'
class tvb.core.neotraits._forms.DataTypeSelectField(datatype_index, form, name=None, disabled=False, required=False, label='', doc='', conditions=None)[source]

Bases: tvb.core.neotraits._forms.Field

get_dt_from_db()[source]
missing_value = 'explicit-None-value'
options()[source]
template = 'datatype_select_field.jinja2'
class tvb.core.neotraits._forms.Field(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: builtins.object

fill_from_post(post_data)[source]

deserialize form a post dictionary

template = None
validate()[source]

validation besides the deserialization from post

value[source]
class tvb.core.neotraits._forms.FloatField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits._forms.TraitField

input_type = 'number'
max = None
min = None
step = 'any'
template = 'number_field.jinja2'
class tvb.core.neotraits._forms.Form(prefix='', project_id=None)[source]

Bases: builtins.object

fields[source]
fill_from_post(form_data)[source]
fill_from_trait(trait)[source]

Sets data for all traited fields from a trait instance. Note that FormFields are not TraitFields, so this does not work recursively Override to fill in sub-forms

fill_trait(datatype)[source]

Copies the value of the TraitFields to the corresponding Attr-ibutes of the given trait instance Note that FormFields are not TraitFields, so this does not work recursively Override to fill in sub-forms

trait_fields[source]
validate()[source]
class tvb.core.neotraits._forms.FormField(form_class, form, name, label='', doc='')[source]

Bases: tvb.core.neotraits._forms.Field

fill_from_post(post_data)[source]
template = 'form_field.jinja2'
validate()[source]
class tvb.core.neotraits._forms.IntField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits._forms.TraitField

max = None
min = None
template = 'number_field.jinja2'
class tvb.core.neotraits._forms.MultiSelectField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits._forms.TraitField

options()[source]

to be used from template, assumes self.data is set

template = 'checkbox_field.jinja2'
class tvb.core.neotraits._forms.Option

Bases: builtins.tuple

Option(id, value, label, checked)

checked

Alias for field number 3

id

Alias for field number 0

label

Alias for field number 2

value

Alias for field number 1

tvb.core.neotraits._forms.ScalarField(trait_attribute, form, name=None, disabled=False)[source]
class tvb.core.neotraits._forms.SelectField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits._forms.TraitField

missing_value = 'explicit-None-value'
options()[source]

to be used from template, assumes self.data is set

template = 'radio_field.jinja2'
class tvb.core.neotraits._forms.SimpleBoolField(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits._forms.Field

template = 'bool_field.jinja2'
class tvb.core.neotraits._forms.SimpleFloatField(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits._forms.Field

input_type = 'number'
max = None
min = None
step = 'any'
template = 'number_field.jinja2'
class tvb.core.neotraits._forms.SimpleIntField(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits._forms.Field

max = None
min = None
template = 'number_field.jinja2'
class tvb.core.neotraits._forms.SimpleSelectField(choices, form, name=None, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits._forms.Field

fill_from_post(post_data)[source]
missing_value = 'explicit-None-value'
options()[source]

to be used from template, assumes self.data is set

template = 'radio_field.jinja2'
class tvb.core.neotraits._forms.SimpleStrField(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits._forms.Field

template = 'str_field.jinja2'
class tvb.core.neotraits._forms.StrField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits._forms.TraitField

template = 'str_field.jinja2'
class tvb.core.neotraits._forms.TraitField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits._forms.Field

class tvb.core.neotraits._forms.UploadField(required_type, form, name, disabled=False, required=False, label='', doc='')[source]

Bases: tvb.core.neotraits._forms.Field

fill_from_post(post_data)[source]
template = 'upload_field.jinja2'

_h5accessors

class tvb.core.neotraits._h5accessors.Accessor(trait_attribute, h5file, name=None)[source]

Bases: builtins.object

load()[source]
store(val)[source]
class tvb.core.neotraits._h5accessors.DataSet(trait_attribute, h5file, name=None, expand_dimension=-1)[source]

Bases: tvb.core.neotraits._h5accessors.Accessor

A dataset in a h5 file that corresponds to a traited NArray.

append(data, close_file=True, grow_dimension=None)[source]
get_cached_metadata()[source]

Returns cached properties of this dataset, like min max mean etc. This cache is useful for large, expanding datasets, when we want to avoid loading the whole dataset just to compute a max.

load()[source]
shape[source]
store(data)[source]
class tvb.core.neotraits._h5accessors.DataSetMetaData(min, max, mean)[source]

Bases: builtins.object

simple container for dataset metadata Useful as a cache of global min max values. Viewers rely on these for colorbars.

classmethod from_array(array)[source]
classmethod from_dict(dikt)[source]
merge(other)[source]
to_dict()[source]
class tvb.core.neotraits._h5accessors.Json(trait_attribute, h5file, name=None, json_encoder=None, json_decoder=None)[source]

Bases: tvb.core.neotraits._h5accessors.Scalar

A python json like data structure accessor This works with simple Attr(list) Attr(dict) List(of=...)

load()[source]
store(val)[source]

stores a json in the h5 metadata

class tvb.core.neotraits._h5accessors.JsonFinal(trait_attribute, h5file, name=None, json_encoder=None, json_decoder=None)[source]

Bases: tvb.core.neotraits._h5accessors.Json

A python json like data structure accessor meant to be used with Final(dict)

class tvb.core.neotraits._h5accessors.Reference(trait_attribute, h5file, name=None)[source]

Bases: tvb.core.neotraits._h5accessors.Uuid

A reference to another h5 file Corresponds to a contained datatype

store(val)[source]

The reference is stored as a gid in the metadata. :param val: a datatype or a uuid.UUID gid

class tvb.core.neotraits._h5accessors.Scalar(trait_attribute, h5file, name=None)[source]

Bases: tvb.core.neotraits._h5accessors.Accessor

A scalar in a h5 file that corresponds to a traited attribute. Serialized as a global h5 attribute

load()[source]
store(val)[source]
class tvb.core.neotraits._h5accessors.SparseMatrix(trait_attribute, h5file, name=None)[source]

Bases: tvb.core.neotraits._h5accessors.Accessor

Stores and loads a scipy.sparse csc or csr matrix in h5.

constructors = {'csr': <class 'scipy.sparse.csr.csr_matrix'>, 'csc': <class 'scipy.sparse.csc.csc_matrix'>}
get_metadata()[source]
load()[source]
store(mtx)[source]
class tvb.core.neotraits._h5accessors.SparseMatrixMetaData(minimum, maximum, mean, format, dtype, shape)[source]

Bases: tvb.core.neotraits._h5accessors.DataSetMetaData

Essential metadata for interpreting a sparse matrix stored in h5

classmethod from_array(mtx)[source]
classmethod from_dict(dikt)[source]
static parse_shape(shapestr)[source]
to_dict()[source]
class tvb.core.neotraits._h5accessors.Uuid(trait_attribute, h5file, name=None)[source]

Bases: tvb.core.neotraits._h5accessors.Scalar

load()[source]
store(val)[source]

_h5core

class tvb.core.neotraits._h5core.H5File(path)[source]

Bases: builtins.object

A H5 based file format. This class implements reading and writing to a specific h5 based file format. A subclass of this defines a new file format.

close()[source]
classmethod file_name_base()[source]
static from_file(path)[source]
gather_references()[source]
is_new_file = False
iter_accessors()[source]
iter_datasets()[source]
load_generic_attributes()[source]
load_into(datatype)[source]
store(datatype, scalars_only=False, store_references=True)[source]
store_generic_attributes(generic_attributes)[source]

db

class tvb.core.neotraits.db.HasTraitsIndex[source]

Bases: sqlalchemy.ext.declarative.api.DeclarativeBase

create_date
gid
id
title
type_
tvb.core.neotraits.db.from_ndarray(array)[source]
tvb.core.neotraits.db.prepare_array_shape_meta(shape_array)[source]

forms

class tvb.core.neotraits.forms.ArrayField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits.forms.TraitField

template = 'str_field.jinja2'
value[source]
class tvb.core.neotraits.forms.BoolField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits.forms.TraitField

template = 'bool_field.jinja2'
class tvb.core.neotraits.forms.BytesField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits.forms.StrField

StrField for byte strings.

template = 'str_field.jinja2'
class tvb.core.neotraits.forms.DataTypeSelectField(datatype_index, form, name=None, disabled=False, required=False, label='', doc='', conditions=None, draw_dynamic_conditions_buttons=True, dynamic_conditions=None, has_all_option=False)[source]

Bases: tvb.core.neotraits.forms.Field

get_dt_from_db()[source]
get_dynamic_filters[source]
missing_value = 'explicit-None-value'
options()[source]
template = 'datatype_select_field.jinja2'
class tvb.core.neotraits.forms.Field(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: builtins.object

fill_from_post(post_data)[source]

deserialize form a post dictionary

template = None
validate()[source]

validation besides the deserialization from post

value[source]
class tvb.core.neotraits.forms.FloatField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits.forms.TraitField

input_type = 'number'
max = None
min = None
step = 'any'
template = 'number_field.jinja2'
class tvb.core.neotraits.forms.Form(prefix='', project_id=None, draw_ranges=True)[source]

Bases: builtins.object

RANGE_1_NAME = 'range_1'
RANGE_2_NAME = 'range_2'
fields[source]
fill_from_post(form_data)[source]
fill_from_trait(trait)[source]

Sets data for all traited fields from a trait instance. Note that FormFields are not TraitFields, so this does not work recursively Override to fill in sub-forms

fill_trait(datatype)[source]

Copies the value of the TraitFields to the corresponding Attr-ibutes of the given trait instance Note that FormFields are not TraitFields, so this does not work recursively Override to fill in sub-forms

get_errors_dict()[source]
range_1 = None
range_2 = None
trait_fields[source]
validate()[source]
class tvb.core.neotraits.forms.FormField(form_class, form, name, label='', doc='')[source]

Bases: tvb.core.neotraits.forms.Field

fill_from_post(post_data)[source]
template = 'form_field.jinja2'
validate()[source]
class tvb.core.neotraits.forms.IntField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits.forms.TraitField

max = None
min = None
template = 'number_field.jinja2'
class tvb.core.neotraits.forms.MultiSelectField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits.forms.TraitField

options()[source]

to be used from template, assumes self.data is set

template = 'checkbox_field.jinja2'
class tvb.core.neotraits.forms.MultipleSelectField(choices, form, name=None, disabled=False, required=False, label='', doc='', default=None, include_none=True)[source]

Bases: tvb.core.neotraits.forms.SimpleSelectField

fill_from_post(post_data)[source]
template = 'checkbox_field.jinja2'
class tvb.core.neotraits.forms.Option

Bases: builtins.tuple

Option(id, value, label, checked)

checked

Alias for field number 3

id

Alias for field number 0

label

Alias for field number 2

value

Alias for field number 1

tvb.core.neotraits.forms.ScalarField(trait_attribute, form, name=None, disabled=False)[source]
class tvb.core.neotraits.forms.SelectField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits.forms.TraitField

missing_value = 'explicit-None-value'
options()[source]

to be used from template, assumes self.data is set

template = 'radio_field.jinja2'
class tvb.core.neotraits.forms.SimpleArrayField(form, name, dtype, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits.forms.Field

template = 'str_field.jinja2'
value[source]
class tvb.core.neotraits.forms.SimpleBoolField(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits.forms.Field

template = 'bool_field.jinja2'
class tvb.core.neotraits.forms.SimpleFloatField(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits.forms.Field

input_type = 'number'
max = None
min = None
step = 'any'
template = 'number_field.jinja2'
class tvb.core.neotraits.forms.SimpleHiddenField(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits.forms.Field

template = 'hidden_field.jinja2'
class tvb.core.neotraits.forms.SimpleIntField(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits.forms.Field

max = None
min = None
template = 'number_field.jinja2'
class tvb.core.neotraits.forms.SimpleSelectField(choices, form, name=None, disabled=False, required=False, label='', doc='', default=None, include_none=True)[source]

Bases: tvb.core.neotraits.forms.Field

fill_from_post(post_data)[source]
missing_value = 'explicit-None-value'
options()[source]

to be used from template, assumes self.data is set

template = 'radio_field.jinja2'
class tvb.core.neotraits.forms.SimpleStrField(form, name, disabled=False, required=False, label='', doc='', default=None)[source]

Bases: tvb.core.neotraits.forms.Field

template = 'str_field.jinja2'
class tvb.core.neotraits.forms.StrField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits.forms.TraitField

template = 'str_field.jinja2'
class tvb.core.neotraits.forms.TraitField(trait_attribute, form, name=None, disabled=False)[source]

Bases: tvb.core.neotraits.forms.Field

class tvb.core.neotraits.forms.UploadField(required_type, form, name, disabled=False, required=False, label='', doc='')[source]

Bases: tvb.core.neotraits.forms.Field

fill_from_post(post_data)[source]
template = 'upload_field.jinja2'

h5