Root classes for adding custom functionality to the code.
Bases: builtins.object
Root Abstract class for all TVB Adapters.
Adds additional info on the operation to be displayed in the UI. Usually a warning message.
Having a module and a class name, create an instance of ABCAdapter.
Having a subclass of ABCAdapter, prepare an instance for launching an operation with it.
To be overridden where needed (e.g. Matlab dependent adapters). :return: By default True, and False when the current Adapter can not be executed in the current env for various reasons (e.g. no Matlab or Octave installed)
To be implemented in each Adapter that requires any specific configurations before the actual launch.
Determine the class of an adapter based on module and classname strings from stored_adapter :param stored_adapter: Algorithm or AlgorithmDTO type :return: a subclass of ABCAdapter
Method used only by analyzers that write slices of data. As they never have the whole array_data in memory, the metadata related to array_data (min, max, etc.) they store on the index is not correct, so we need to update them.
The result will be used for introspecting and checking operation changed input params from the defaults, to show in web gui. :return: a list of ABCAdapterForm classes, in case the current Adapter GUI will be composed of multiple sub-forms.
Method should approximate based on input arguments, the time it will take for the operation to finish (in seconds).
Abstract method to be implemented in each adapter. Should return the required memory for launching the adapter in kilo-Bytes.
Abstract method to be implemented in each adapter. Should return the required memory for launching the adapter.
To be implemented in each Adapter. Will contain the logic of the Adapter. Takes a ViewModel with data, dependency direction is: Adapter -> Form -> ViewModel Any returned DataType will be stored in DB, by the Framework.
Parameters: | view_model – the data model corresponding to the current adapter |
---|
Bases: tvb.core.neotraits.forms.Form
Should keep filters for the required_datatype. These filters are stored in DB at introspection time. :return: FilterChain
The Form’s input name for the required_datatype. Will be stored in DB at introspection time. :return: str
Bases: enum.Enum
An enumeration.
Annotation that configures NumPy not to throw an exception in case of floating points errors are computed. It should be used on Adapter methods where computation of NaN/ Inf/etc. is allowed.
Annotation that guides NumPy behavior in case of floating point errors. The NumPy default is to just print a warning to sys.stdout, this annotation will raise our custom exception. This annotation will enforce that an exception is thrown in case a floating point error is produced.
Bases: tvb.core.adapters.abcadapter.ABCAdapter
Abstract class, for marking Adapters used for UI display only.
Helper method for building the result of the ABCDisplayer. :param template : relative path towards the HTML template to display :param parameters : dictionary with parameters for “template” :param pages : dictionary of pages to be used with <xi:include>
Dump a list of numbers into a string, each at the specified precision.
Used for obtaining a list of ‘expected_size’ number of elements from the list ‘list_of_elements’. If the list ‘list_of_elements’ doesn’t have sufficient elements then an exception will be thrown.
list_of_elements - a list of one or two dimensions expected_size - the number of elements that should have the returned list error_msg - the message that will be used for the thrown exception.
Bases: builtins.object
Bases: tvb.core.adapters.abcadapter.ABCAdapter
Base class of the uploading algorithms
As it is an upload algorithm and we do not have information about data, we can not approximate this.
Return the required memory to run this algorithm. As it is an upload algorithm and we do not have information about data, we can not approximate this.
This is a framework helper module. Some framework datatypes have functions that will be called via http by the TVB GUI. These functions will receive some arguments as strings and return json serializable structures usually dicts. This module contains functions to parse those strings and construct those responses.
Parse a slicing expression >>> parse_slice(”::1, :”) (slice(None, None, 1), slice(None, None, None)) >>> parse_slice(“2”) 2 >>> parse_slice(“[2]”) 2
Read TimeLine from TS and prepare the result for TSVolumeViewer.
Parameters: |
|
---|---|
Returns: | A complex dictionary with information about current voxel. |
Covert ajax call parameters into numbers and validate them.
Parameters: |
|
---|---|
Returns: | (x, y, z) as integers, Z reversed |
Bases: tvb.basic.exceptions.TVBException
Exception class for problems when introspection failed.
Bases: tvb.core.adapters.exceptions.LaunchException
Exception class for parameter validation issue.
Bases: tvb.basic.exceptions.TVBException
Exception class for problem with launching an operation.
Bases: tvb.basic.exceptions.TVBException
Exception class raised when an adapter requires more memory that is available on machine.
Bases: tvb.basic.exceptions.TVBException
Exception class for problem with parsing files an operation.
Bases: tvb.core.adapters.exceptions.IntrospectionException
Exception class for problems when parsing xml files.