Unverified Commit 840c0f96 authored by Lia Domide's avatar Lia Domide Committed by GitHub

Merge branch 'master' into tvb-rest

parents c778c5eb 3a77e83f
......@@ -30,7 +30,7 @@
from tvb.datatypes.cortex import Cortex
from tvb.simulator.coupling import Coupling
from tvb.simulator.integrators import *
from tvb.simulator.models import Model
from tvb.simulator.models import ModelsEnum
from tvb.simulator.monitors import Monitor, SubSample, GlobalAverage, TemporalAverage
from tvb.simulator.noise import Additive, Multiplicative, Noise
......@@ -45,7 +45,7 @@ def config_h5_factory(config_class):
return integrator_h5_factory(config_class)
if issubclass(config_class, Coupling):
return coupling_h5_factory(config_class)
if issubclass(config_class, Model):
if issubclass(config_class, ModelsEnum.BASE_MODEL.get_class()):
return model_h5_factory(config_class)
if issubclass(config_class, Monitor):
return monitor_h5_factory(config_class)
......@@ -107,36 +107,33 @@ def coupling_h5_factory(coupling_class):
def model_h5_factory(model_class):
from tvb.simulator.models import Epileptor, Epileptor2D, EpileptorCodim3, EpileptorCodim3SlowMod, Hopfield, \
JansenRit, ZetterbergJansen, EpileptorRestingState, LarterBreakspear, Generic2dOscillator, \
ReducedSetFitzHughNagumo, ReducedSetHindmarshRose, WilsonCowan, ReducedWongWang, ReducedWongWangExcInh, \
ZerlautFirstOrder, ZerlautSecondOrder, SupHopf, Linear, Kuramoto
from tvb.core.entities.file.simulator.model_h5 import EpileptorH5, Epileptor2DH5, EpileptorCodim3H5, \
EpileptorCodim3SlowModH5, HopfieldH5, JansenRitH5, ZetterbergJansenH5, EpileptorRestingStateH5, \
LarterBreakspearH5, LinearH5, Generic2dOscillatorH5, KuramotoH5, ReducedSetFitzHughNagumoH5, \
ReducedSetHindmarshRoseH5, WilsonCowanH5, ReducedWongWangH5, ReducedWongWangExcInhH5, ZerlautFirstOrderH5, \
ZerlautSecondOrderH5, SupHopfH5
ReducedSetHindmarshRoseH5, WilsonCowanH5, ReducedWongWangH5, ReducedWongWangExcInhH5, \
ZerlautAdaptationFirstOrderH5, \
ZerlautAdaptationSecondOrderH5, SupHopfH5
model_class_to_h5 = {
Epileptor: EpileptorH5,
Epileptor2D: Epileptor2DH5,
EpileptorCodim3: EpileptorCodim3H5,
EpileptorCodim3SlowMod: EpileptorCodim3SlowModH5,
Hopfield: HopfieldH5,
JansenRit: JansenRitH5,
ZetterbergJansen: ZetterbergJansenH5,
EpileptorRestingState: EpileptorRestingStateH5,
LarterBreakspear: LarterBreakspearH5,
Linear: LinearH5,
Generic2dOscillator: Generic2dOscillatorH5,
Kuramoto: KuramotoH5,
ReducedSetFitzHughNagumo: ReducedSetFitzHughNagumoH5,
ReducedSetHindmarshRose: ReducedSetHindmarshRoseH5,
WilsonCowan: WilsonCowanH5,
ReducedWongWang: ReducedWongWangH5,
ReducedWongWangExcInh: ReducedWongWangExcInhH5,
ZerlautFirstOrder: ZerlautFirstOrderH5,
ZerlautSecondOrder: ZerlautSecondOrderH5,
SupHopf: SupHopfH5
ModelsEnum.EPILEPTOR.get_class(): EpileptorH5,
ModelsEnum.EPILEPTOR_2D.get_class(): Epileptor2DH5,
ModelsEnum.EPILEPTOR_CODIM_3.get_class(): EpileptorCodim3H5,
ModelsEnum.EPILEPTOR_CODIM_3_SLOW.get_class(): EpileptorCodim3SlowModH5,
ModelsEnum.HOPFIELD.get_class(): HopfieldH5,
ModelsEnum.JANSEN_RIT.get_class(): JansenRitH5,
ModelsEnum.ZETTERBERG_JANSEN.get_class(): ZetterbergJansenH5,
ModelsEnum.EPILEPTOR_RS.get_class(): EpileptorRestingStateH5,
ModelsEnum.LARTER_BREAKSPEAR.get_class(): LarterBreakspearH5,
ModelsEnum.LINEAR.get_class(): LinearH5,
ModelsEnum.GENERIC_2D_OSCILLATOR.get_class(): Generic2dOscillatorH5,
ModelsEnum.KURAMOTO.get_class(): KuramotoH5,
ModelsEnum.REDUCED_SET_FITZ_HUGH_NAGUMO.get_class(): ReducedSetFitzHughNagumoH5,
ModelsEnum.REDUCED_SET_HINDMARSH_ROSE.get_class(): ReducedSetHindmarshRoseH5,
ModelsEnum.WILSON_COWAN.get_class(): WilsonCowanH5,
ModelsEnum.REDUCED_WONG_WANG.get_class(): ReducedWongWangH5,
ModelsEnum.REDUCED_WONG_WANG_EXCH_INH.get_class(): ReducedWongWangExcInhH5,
ModelsEnum.ZERLAUT_FIRST_ORDER.get_class(): ZerlautAdaptationFirstOrderH5,
ModelsEnum.ZERLAUT_SECOND_ORDER.get_class(): ZerlautAdaptationSecondOrderH5,
ModelsEnum.SUP_HOPF.get_class(): SupHopfH5
}
return model_class_to_h5.get(model_class)
......
......@@ -38,9 +38,9 @@ from datetime import datetime
from os import path
from tvb.simulator.coupling import HyperbolicTangent
from tvb.simulator.integrators import HeunDeterministic
from tvb.simulator.models import *
from tvb.adapters.datatypes.db.connectivity import ConnectivityIndex
from tvb.interfaces.command.lab import *
from tvb.simulator.models import ModelsEnum
def _fire_simulation(project_id, **kwargs):
......@@ -144,8 +144,8 @@ def main():
g2d_epi = Bench(
model_kws=[
{"model": Generic2dOscillator()},
{"model": Epileptor()},
{"model": ModelsEnum.GENERIC_2D_OSCILLATOR.get_class()()},
{"model": ModelsEnum.EPILEPTOR.get_class()()},
],
connectivities=connectivities,
conductions=[30.0, 3.0],
......@@ -155,7 +155,7 @@ def main():
larter = Bench(
model_kws=[
{"model": LarterBreakspear(), "coupling": HyperbolicTangent()},
{"model": ModelsEnum.LARTER_BREAKSPEAR.get_class()(), "coupling": HyperbolicTangent()},
],
connectivities=connectivities,
conductions=[10.0],
......
......@@ -38,6 +38,7 @@ from tvb.adapters.simulator.integrator_forms import get_ui_name_to_integrator_di
from tvb.adapters.simulator.model_forms import get_ui_name_to_model, get_form_for_model
from tvb.adapters.simulator.simulator_fragments import SimulatorModelFragment, SimulatorIntegratorFragment
from tvb.adapters.visualizers.phase_plane_interactive import phase_space_d3
from tvb.basic.logger.builder import get_logger
from tvb.core import utils
from tvb.core.adapters.abcadapter import ABCAdapterForm
from tvb.core.entities.storage import dao
......@@ -102,7 +103,7 @@ class _InputTreeFragment(ABCAdapterForm):
class DynamicModelController(BurstBaseController):
KEY_CACHED_DYNAMIC_MODEL = 'cache.DynamicModelController'
LOGGER = get_logger(__name__)
def __init__(self):
BurstBaseController.__init__(self)
self.available_models = get_ui_name_to_model()
......@@ -256,6 +257,9 @@ class DynamicModelController(BurstBaseController):
for name in model_form_class.get_params_configurable_in_phase_plane():
attr = getattr(type(model), name)
ranger = attr.domain
if ranger is None:
DynamicModelController.LOGGER.warn("Param %s doesn't have a domain specified" % (name))
continue
default = float(attr.default)
ret.append({
......
......@@ -413,7 +413,7 @@ class UserController(BaseController):
try:
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
content = urlopen(TvbProfile.current.web.URL_TVB_VERSION, timeout=7, context=context).read()
self.version_info = json.loads(str(content))
self.version_info = json.loads(content.decode('utf-8'))
pos = TvbProfile.current.web.URL_TVB_VERSION.find('/tvb')
self.version_info['url'] = TvbProfile.current.web.URL_TVB_VERSION[:pos]
self.logger.debug("Read version: " + json.dumps(self.version_info))
......
......@@ -36,7 +36,7 @@ from tvb.adapters.datatypes.db.connectivity import ConnectivityIndex
from tvb.tests.framework.core.base_testcase import TransactionalTestCase
from tvb.core.services.burst_config_serialization import INTEGRATOR_PARAMETERS, MODEL_PARAMETERS, SerializationManager
from tvb.simulator.integrators import HeunStochastic
from tvb.simulator.models import Hopfield, Generic2dOscillator
from tvb.simulator.models import ModelsEnum
from tvb.tests.framework.core.factory import TestFactory
from os import path
import tvb_data
......@@ -51,7 +51,7 @@ class TestSerializationManager(TransactionalTestCase):
TestFactory.import_zip_connectivity(self.test_user, self.test_project, zip_path, "John")
self.connectivity = TestFactory.get_entity(self.test_project, ConnectivityIndex)
sim_conf = Simulator(model=Hopfield(), integrator=HeunStochastic())
sim_conf = Simulator(model=ModelsEnum.HOPFIELD.get_class()(), integrator=HeunStochastic())
self.s_manager = SerializationManager(sim_conf)
self.empty_manager = SerializationManager(None)
......@@ -75,7 +75,7 @@ class TestSerializationManager(TransactionalTestCase):
def test_write_model_parameters_one_dynamic(self, connectivity_factory):
connectivity = connectivity_factory()
m_name = Generic2dOscillator.__name__
m_name = ModelsEnum.GENERIC_2D_OSCILLATOR.get_class().__name__
m_parms = {'I': 0.0, 'a': 1.75, 'alpha': 1.0, 'b': -10.0, 'beta': 1.0, 'c': 0.0,
'd': 0.02, 'e': 3.0, 'f': 1.0, 'g': 0.0, 'gamma': 1.0, 'tau': 1.47}
......@@ -83,7 +83,7 @@ class TestSerializationManager(TransactionalTestCase):
sc = self.s_manager.conf
# Default model in these tests is Hopfield. Test if the model was changed to Generic2dOscillator
assert isinstance(sc.model, Generic2dOscillator)
assert isinstance(sc.model, ModelsEnum.GENERIC_2D_OSCILLATOR.get_class())
# a modified parameter
expected = [1.75] # we expect same value arrays to contract to 1 element
......@@ -96,7 +96,7 @@ class TestSerializationManager(TransactionalTestCase):
def test_write_model_parameters_two_dynamics(self, connectivity_factory):
connectivity = connectivity_factory()
m_name = Generic2dOscillator.__name__
m_name = ModelsEnum.GENERIC_2D_OSCILLATOR.get_class().__name__
m_parms_1 = {'I': 0.0, 'a': 1.75, 'alpha': 1.0, 'b': -10.0, 'beta': 1.0, 'c': 0.0,
'd': 0.02, 'e': 3.0, 'f': 1.0, 'g': 0.0, 'gamma': 1.0, 'tau': 1.47}
m_parms_2 = {'I': 0.0, 'a': 1.75, 'alpha': 1.0, 'b': -5.0, 'beta': 1.0, 'c': 0.0,
......@@ -109,7 +109,7 @@ class TestSerializationManager(TransactionalTestCase):
sc = self.s_manager.conf
# Default model in these tests is Hopfield. Test if the model was changed to Generic2dOscillator
assert isinstance(sc.model, Generic2dOscillator)
assert isinstance(sc.model, ModelsEnum.GENERIC_2D_OSCILLATOR.get_class())
expected = [1.75] # array contracted to one value
actual = sc.model.a
......
......@@ -42,7 +42,7 @@ from tvb.interfaces.web.controllers import common
from tvb.interfaces.web.controllers.burst.noise_configuration_controller import NoiseConfigurationController
from tvb.interfaces.web.controllers.spatial.base_spatio_temporal_controller import INTEGRATOR_PARAMETERS
from tvb.simulator.integrators import EulerStochastic
from tvb.simulator.models import Generic2dOscillator
from tvb.simulator.models import ModelsEnum
from tvb.simulator.noise import Additive
......@@ -92,7 +92,7 @@ class TestNoiseConfigurationController(BaseTransactionalControllerTest):
# Simulate selection of a specific integration from the ui
new_params[PARAM_INTEGRATOR] = {'value': EulerStochastic.__name__}
new_params[PARAM_MODEL] = {'value': Generic2dOscillator.__name__}
new_params[PARAM_MODEL] = {'value': ModelsEnum.GENERIC_2D_OSCILLATOR.get_class().__name__}
new_params[INTEGRATOR_PARAMETERS + '_option_EulerStochastic_noise'] = {'value': Additive.__name__}
stored_burst.simulator_configuration = new_params
"""
......
......@@ -41,7 +41,7 @@ from tvb.core.entities.model.model_burst import Dynamic
from tvb.core.entities.storage import dao
from tvb.interfaces.web.controllers.burst.region_model_parameters_controller import RegionsModelParametersController
from tvb.simulator.integrators import HeunDeterministic
from tvb.simulator.models import Generic2dOscillator, Kuramoto
from tvb.simulator.models import ModelsEnum
from tvb.tests.framework.adapters.simulator.simulator_adapter_test import SIMULATOR_PARAMETERS
import tvb.interfaces.web.controllers.common as common
......@@ -73,12 +73,12 @@ class TestRegionsModelParametersController(BaseTransactionalControllerTest):
def _setup_dynamic(self):
dynamic_g = Dynamic("test_dyn", self.test_user.id, Generic2dOscillator.__name__,
dynamic_g = Dynamic("test_dyn", self.test_user.id, ModelsEnum.GENERIC_2D_OSCILLATOR.get_class().__name__,
'[["tau", 1.0], ["a", 5.0], ["b", -10.0], ["c", 10.0], ["I", 0.0], ["d", 0.02], '
'["e", 3.0], ["f", 1.0], ["g", 0.0], ["alpha", 1.0], ["beta", 5.0], ["gamma", 1.0]]',
HeunDeterministic.__name__, None)
dynamic_k = Dynamic("test_dyn_kura", self.test_user.id, Kuramoto.__name__,
dynamic_k = Dynamic("test_dyn_kura", self.test_user.id, ModelsEnum.KURAMOTO.get_class().__name__,
'[["omega", 1.0]]', HeunDeterministic.__name__, None)
self.dynamic_g = dao.store_entity(dynamic_g)
......
......@@ -61,7 +61,7 @@ from tvb.interfaces.web.controllers.common import *
from tvb.interfaces.web.controllers.simulator_controller import SimulatorController, common
from tvb.simulator.coupling import Sigmoidal
from tvb.simulator.integrators import HeunDeterministic, IntegratorStochastic, Dopri5Stochastic, EulerStochastic
from tvb.simulator.models import Generic2dOscillator
from tvb.simulator.models import ModelsEnum
from tvb.simulator.monitors import TemporalAverage, MEG, Bold, SubSample, EEG, iEEG
from tvb.simulator.noise import Multiplicative
from tvb.tests.framework.core.factory import TestFactory
......@@ -202,7 +202,7 @@ class TestSimulationController(BaseTransactionalControllerTest, helper.CPWebCase
common.add2session(common.KEY_SIMULATOR_CONFIG, self.session_stored_simulator)
self.simulator_controller.set_model(**self.sess_mock._data)
assert isinstance(self.session_stored_simulator.model, Generic2dOscillator), "Model class is incorrect."
assert isinstance(self.session_stored_simulator.model, ModelsEnum.GENERIC_2D_OSCILLATOR.get_class()), "Model class is incorrect."
def test_set_model_params(self):
self.sess_mock['_tau'] = '[1.0]'
......
......@@ -40,7 +40,7 @@ from tvb.core.adapters.abcadapter import ABCAdapter, ABCAdapterForm
from tvb.core.neotraits.forms import ArrayField
from tvb.interfaces.web.controllers.decorators import using_template
from tvb.interfaces.web.controllers.simulator_controller import SimulatorController
from tvb.simulator.models import Epileptor
from tvb.simulator.models import ModelsEnum
from tvb.simulator.simulator import Simulator
from tvb.tests.framework.core.base_testcase import BaseTestCase
......@@ -140,7 +140,7 @@ class TestJinja2Simulator(Jinja2Test):
all_models_for_ui = get_ui_name_to_model()
models_form = SimulatorModelFragment()
simulator = Simulator()
simulator.model = Epileptor()
simulator.model = ModelsEnum.EPILEPTOR.get_class()()
models_form.fill_from_trait(simulator)
html = str(models_form)
......
......@@ -38,17 +38,106 @@ Specific models inherit from the abstract class Model.
"""
from .base import Model
from .epileptor import Epileptor, Epileptor2D
from .epileptor_rs import EpileptorRestingState
from .epileptorcodim3 import EpileptorCodim3, EpileptorCodim3SlowMod
from .hopfield import Hopfield
from .jansen_rit import JansenRit, ZetterbergJansen
from .larter_breakspear import LarterBreakspear
from .linear import Linear
from .oscillator import Generic2dOscillator, Kuramoto, SupHopf
from .stefanescu_jirsa import ReducedSetFitzHughNagumo, ReducedSetHindmarshRose
from .wilson_cowan import WilsonCowan
from .wong_wang import ReducedWongWang
from .wong_wang_exc_inh import ReducedWongWangExcInh
from .zerlaut import ZerlautFirstOrder, ZerlautSecondOrder
# we don't import all models by default here, since they are time consuming
# to setup (e.g. numba gufunc compilation), but provide them as module-level
# properties for compatibility with previous version of TVB. For example
#
# import tvb.simulator.models.Epileptor
#
# works, but only lazily loads the tvb.simulator.models.epileptor module
# and returns the Epileptor class.
from enum import Enum
class ModelsEnum(Enum):
BASE_MODEL = "Model"
EPILEPTOR = "Epileptor"
EPILEPTOR_2D = "Epileptor2D"
EPILEPTOR_RS = "EpileptorRestingState"
EPILEPTOR_CODIM_3 = "EpileptorCodim3"
EPILEPTOR_CODIM_3_SLOW = "EpileptorCodim3SlowMod"
HOPFIELD = "Hopfield"
JANSEN_RIT = "JansenRit"
ZETTERBERG_JANSEN = "ZetterbergJansen"
LARTER_BREAKSPEAR = "LarterBreakspear"
LINEAR = "Linear"
GENERIC_2D_OSCILLATOR = "Generic2dOscillator"
KURAMOTO = "Kuramoto"
SUP_HOPF = "SupHopf"
REDUCED_SET_FITZ_HUGH_NAGUMO = "ReducedSetFitzHughNagumo"
REDUCED_SET_HINDMARSH_ROSE = "ReducedSetHindmarshRose"
WILSON_COWAN = "WilsonCowan"
REDUCED_WONG_WANG = "ReducedWongWang"
REDUCED_WONG_WANG_EXCH_INH = "ReducedWongWangExcInh"
ZERLAUT_FIRST_ORDER = "ZerlautAdaptationFirstOrder"
ZERLAUT_SECOND_ORDER = "ZerlautAdaptationSecondOrder"
def get_class(self):
return _get_imported_model(self.value)
@staticmethod
def get_base_model_subclasses():
return [model.get_class() for model in list(ModelsEnum) if model != ModelsEnum.BASE_MODEL]
def _get_imported_model(model):
import sys
# Imported modules
imported_modules = sys.modules['tvb.simulator.models']
try:
return getattr(imported_modules, model)
except AttributeError:
return None
_module_models = {
'base': [ModelsEnum.BASE_MODEL],
'epileptor': [ModelsEnum.EPILEPTOR, ModelsEnum.EPILEPTOR_2D],
'epileptor_rs': [ModelsEnum.EPILEPTOR_RS],
'epileptorcodim3': [ModelsEnum.EPILEPTOR_CODIM_3, ModelsEnum.EPILEPTOR_CODIM_3_SLOW],
'hopfield': [ModelsEnum.HOPFIELD],
'jansen_rit': [ModelsEnum.JANSEN_RIT, ModelsEnum.ZETTERBERG_JANSEN],
'larter_breakspear': [ModelsEnum.LARTER_BREAKSPEAR],
'linear': [ModelsEnum.LINEAR],
'oscillator': [ModelsEnum.GENERIC_2D_OSCILLATOR, ModelsEnum.KURAMOTO, ModelsEnum.SUP_HOPF],
'stefanescu_jirsa': [ModelsEnum.REDUCED_SET_HINDMARSH_ROSE, ModelsEnum.REDUCED_SET_FITZ_HUGH_NAGUMO],
'wilson_cowan': [ModelsEnum.WILSON_COWAN],
'wong_wang': [ModelsEnum.REDUCED_WONG_WANG],
'wong_wang_exc_inh': [ModelsEnum.REDUCED_WONG_WANG_EXCH_INH],
'zerlaut': [ModelsEnum.ZERLAUT_FIRST_ORDER, ModelsEnum.ZERLAUT_SECOND_ORDER],
}
def _delay_import_one(mod, model):
"""Create getter thunk for module and model name.
"""
import importlib
def do_import(_):
module_name = f'tvb.simulator.models.{mod}'
model_module = importlib.import_module(module_name)
return getattr(model_module, model)
return property(do_import)
def _delay_model_imports():
"""Set up this module with all properties for all models.
"""
# create substitute module class & object
class _Module:
pass
module = _Module()
module.__dict__ = globals()
# create properties for each model
for mod, models in _module_models.items():
for model in models:
setattr(_Module, model.value, _delay_import_one(mod, model.value))
# register module object
import sys
module._module = sys.modules[module.__name__]
module._pmodule = module
sys.modules[module.__name__] = module
_delay_model_imports()
......@@ -378,7 +378,7 @@ class PhasePlaneInteractive(HasTraits):
offset = 0.0
self.param_sliders = dict()
# import pdb; pdb.set_trace()
for param_name in type(self.model).own_declarative_attrs:
for param_name in type(self.model).declarative_attrs:
if self.exclude_sliders is not None and param_name in self.exclude_sliders:
continue
param_def = getattr(type(self.model), param_name)
......
......@@ -78,7 +78,7 @@ class TestModels():
self.n_nodes = 100
def test_RWW_opencl(self):
from tvb.simulator.models import ReducedWongWang
from tvb.simulator.models.wong_wang import ReducedWongWang
from tvb.simulator._opencl.models import CLRWW
self.validate(ReducedWongWang(),CLRWW(),1)
......
......@@ -41,7 +41,7 @@ from tvb.basic.neotraits.api import List
from tvb.datatypes.connectivity import Connectivity
from tvb.simulator.coupling import Coupling
from tvb.simulator.integrators import Identity
from tvb.simulator.models import Model
from tvb.simulator.models.base import Model
from tvb.simulator.monitors import Raw
from tvb.simulator.simulator import Simulator
......
......@@ -121,6 +121,8 @@ class TestIntegrators(BaseTestCase):
cls = getattr(integrators, name_)
obj = cls()
assert dt == obj.dt
if hasattr(obj, 'noise'):
obj.noise.configure_white(dt=dt)
self._test_scheme(obj)
def test_scipy_vode(self):
......
......@@ -42,6 +42,7 @@ import pytest
import numpy
import itertools
from tvb.datatypes.surfaces import CorticalSurface
from tvb.simulator.models import ModelsEnum
from tvb.tests.library.base_testcase import BaseTestCase
from tvb.simulator import simulator, models, coupling, integrators, monitors, noise
from tvb.datatypes.connectivity import Connectivity
......@@ -50,7 +51,7 @@ from tvb.datatypes.local_connectivity import LocalConnectivity
from tvb.datatypes.region_mapping import RegionMapping
from tvb.simulator.integrators import HeunDeterministic, IntegratorStochastic
MODEL_CLASSES = models.Model.get_known_subclasses().values()
MODEL_CLASSES = ModelsEnum.get_base_model_subclasses()
METHOD_CLASSES = integrators.Integrator.get_known_subclasses().values()
......@@ -98,7 +99,7 @@ class Simulator(object):
return results
def configure(self, dt=2 ** -3, model=models.Generic2dOscillator, speed=4.0,
def configure(self, dt=2 ** -3, model=ModelsEnum.GENERIC_2D_OSCILLATOR.get_class(), speed=4.0,
coupling_strength=0.00042, method=HeunDeterministic,
surface_sim=False,
default_connectivity=True):
......
......@@ -10,7 +10,8 @@ pipeline {
stage ('Build docker image') {
steps {
script {
def dockerImage = docker.build("${FULL_DOCKER_IMAGE_NAME}:${env.BUILD_ID}", 'tvb_build/docker')
LAST_SHA = sh (script: "curl -s 'https://api.github.com/repos/the-virtual-brain/tvb-root/commits' | grep sha | head -1 | tr '\"' '_'", returnStdout: true).trim()
def dockerImage = docker.build("${FULL_DOCKER_IMAGE_NAME}:${env.BUILD_ID}", "--build-arg LAST_SHA='${LAST_SHA}' tvb_build/docker")
dockerImage.push()
dockerImage.push('${LATEST_TAG}')
}
......
......@@ -2,7 +2,7 @@ FROM continuumio/miniconda3
RUN apt-get -y update && apt-get -y install build-essential gcc
RUN apt-get -y install texlive-base texlive-formats-extra
RUN apt-get -y install octave postgresql
RUN apt-get -y update && apt-get -y install octave postgresql
USER postgres
RUN service postgresql start && createdb -O postgres tvb-test && psql --command "ALTER USER postgres WITH PASSWORD 'postgres';"
......@@ -41,8 +41,12 @@ RUN wget https://zenodo.org/record/3497545/files/tvb_data_2_0_1.zip?download=1 -
/opt/conda/envs/tvb-docs/bin/python setup.py develop
# make sure a copy of tvb-root exists inside, for users without Github clone
RUN git clone --depth 1 https://github.com/the-virtual-brain/tvb-root.git; \
cd tvb-root/tvb_build; \
RUN git clone --depth 1 https://github.com/the-virtual-brain/tvb-root.git
ARG LAST_SHA=LATEST
RUN cd tvb-root; \
git pull; \
cd tvb_build; \
/bin/bash -c "source activate tvb-run && /bin/bash install_full_tvb.sh"; \
/bin/bash -c "source activate tvb-docs && /bin/bash install_full_tvb.sh"
......
......@@ -99,9 +99,9 @@
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.wong_wang_exc_inh.ReducedWongWangExcInh.state_variable_boundaries = Final(field_type=<class 'dict'>, default={'S_e': array([0., 1.]), 'S_i': array([0., 1.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.zerlaut.ZerlautFirstOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'W': array([ 0., 100.])}, required=True)\n",
" attribute tvb.simulator.models.zerlaut.ZerlautAdaptationFirstOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'W': array([ 0., 100.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.zerlaut.ZerlautSecondOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'C_ee': array([0., 0.]), 'C_ei': array([0., 0.]), 'C_ii': array([0., 0.]), 'W': array([ 0., 100.])}, required=True)\n",
" attribute tvb.simulator.models.zerlaut.ZerlautAdaptationSecondOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'C_ee': array([0., 0.]), 'C_ei': array([0., 0.]), 'C_ii': array([0., 0.]), 'W': array([ 0., 100.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class 'dict'>, default={}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
......
......@@ -125,9 +125,9 @@
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.wong_wang_exc_inh.ReducedWongWangExcInh.state_variable_boundaries = Final(field_type=<class 'dict'>, default={'S_e': array([0., 1.]), 'S_i': array([0., 1.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.zerlaut.ZerlautFirstOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'W': array([ 0., 100.])}, required=True)\n",
" attribute tvb.simulator.models.zerlaut.ZerlautAdaptationFirstOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'W': array([ 0., 100.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.zerlaut.ZerlautSecondOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'C_ee': array([0., 0.]), 'C_ei': array([0., 0.]), 'C_ii': array([0., 0.]), 'W': array([ 0., 100.])}, required=True)\n",
" attribute tvb.simulator.models.zerlaut.ZerlautAdaptationSecondOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'C_ee': array([0., 0.]), 'C_ei': array([0., 0.]), 'C_ii': array([0., 0.]), 'W': array([ 0., 100.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class 'dict'>, default={}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
......
......@@ -109,9 +109,9 @@
"2019-10-15 21:57:08,570 - WARNING - tvb.traits - Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.wong_wang_exc_inh.ReducedWongWangExcInh.state_variable_boundaries = Final(field_type=<class 'dict'>, default={'S_e': array([0., 1.]), 'S_i': array([0., 1.])}, required=True)\n",
"2019-10-15 21:57:08,577 - WARNING - tvb.traits - Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.zerlaut.ZerlautFirstOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'W': array([ 0., 100.])}, required=True)\n",
" attribute tvb.simulator.models.zerlaut.ZerlautAdaptationFirstOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'W': array([ 0., 100.])}, required=True)\n",
"2019-10-15 21:57:08,582 - WARNING - tvb.traits - Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.zerlaut.ZerlautSecondOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'C_ee': array([0., 0.]), 'C_ei': array([0., 0.]), 'C_ii': array([0., 0.]), 'W': array([ 0., 100.])}, required=True)\n",
" attribute tvb.simulator.models.zerlaut.ZerlautAdaptationSecondOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'C_ee': array([0., 0.]), 'C_ei': array([0., 0.]), 'C_ii': array([0., 0.]), 'W': array([ 0., 100.])}, required=True)\n",
"2019-10-15 21:57:08,594 - WARNING - tvb.traits - default contains values out of the declared domain. Ex 1.0 \n",
" attribute tvb.simulator.coupling.HyperbolicTangent.b = NArray(label=':math:`b`', dtype=float64, default=array([1.]), dim_names=(), ndim=None, required=True)\n",
"2019-10-15 21:57:08,598 - WARNING - tvb.traits - default contains values out of the declared domain. Ex 1.0 \n",
......
......@@ -113,9 +113,9 @@
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.wong_wang_exc_inh.ReducedWongWangExcInh.state_variable_boundaries = Final(field_type=<class 'dict'>, default={'S_e': array([0., 1.]), 'S_i': array([0., 1.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.zerlaut.ZerlautFirstOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'W': array([ 0., 100.])}, required=True)\n",
" attribute tvb.simulator.models.zerlaut.ZerlautAdaptationFirstOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'W': array([ 0., 100.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.zerlaut.ZerlautSecondOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'C_ee': array([0., 0.]), 'C_ei': array([0., 0.]), 'C_ii': array([0., 0.]), 'W': array([ 0., 100.])}, required=True)\n",
" attribute tvb.simulator.models.zerlaut.ZerlautAdaptationSecondOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'C_ee': array([0., 0.]), 'C_ei': array([0., 0.]), 'C_ii': array([0., 0.]), 'W': array([ 0., 100.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class 'dict'>, default={}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
......@@ -98,9 +98,9 @@
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.wong_wang_exc_inh.ReducedWongWangExcInh.state_variable_boundaries = Final(field_type=<class 'dict'>, default={'S_e': array([0., 1.]), 'S_i': array([0., 1.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.zerlaut.ZerlautFirstOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'W': array([ 0., 100.])}, required=True)\n",
" attribute tvb.simulator.models.zerlaut.ZerlautAdaptationFirstOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'W': array([ 0., 100.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.simulator.models.zerlaut.ZerlautSecondOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'C_ee': array([0., 0.]), 'C_ei': array([0., 0.]), 'C_ii': array([0., 0.]), 'W': array([ 0., 100.])}, required=True)\n",
" attribute tvb.simulator.models.zerlaut.ZerlautAdaptationSecondOrder.state_variable_range = Final(field_type=<class 'dict'>, default={'E': array([0. , 0.1]), 'I': array([0. , 0.1]), 'C_ee': array([0., 0.]), 'C_ei': array([0., 0.]), 'C_ii': array([0., 0.]), 'W': array([ 0., 100.])}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
" attribute tvb.datatypes.time_series.TimeSeries.labels_dimensions = Attr(field_type=<class 'dict'>, default={}, required=True)\n",
"WARNING Field seems mutable and has a default value. Consider using a lambda as a value factory \n",
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment