-
Notifications
You must be signed in to change notification settings - Fork 2
/
mo_types.py
58 lines (49 loc) · 1.53 KB
/
mo_types.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright 2018 Martin Haesemeyer. All rights reserved.
#
# Licensed under the MIT license
"""
Module to allow code that is independent of model organism
"""
import ce_simulators
import zf_simulators
from core import CeGpNetworkModel, ZfGpNetworkModel
class MoTypes:
"""
Class with properties aggregating model organism types
"""
def __init__(self, c_elegans=False):
"""
Creates a new MoTypes object
:param c_elegans: Determines whether served types will be C elegans or zebrafish types
"""
self.c_elegans = c_elegans
@property
def network_model(self):
if self.c_elegans:
return CeGpNetworkModel
else:
return ZfGpNetworkModel
@property
def rad_sim(self):
if self.c_elegans:
return ce_simulators.CircleGradSimulation
else:
return zf_simulators.CircleGradSimulation
@property
def lin_sim(self):
if self.c_elegans:
return ce_simulators.LinearGradientSimulation
else:
return zf_simulators.LinearGradientSimulation
@property
def wn_sim(self):
if self.c_elegans:
raise NotImplementedError("C elegans white noise simulation not implemented yet")
else:
return zf_simulators.WhiteNoiseSimulation
@property
def pt_sim(self):
if self.c_elegans:
raise NotImplementedError("C elegans phototaxis simulation not implemented")
else:
return zf_simulators.PhototaxisSimulation