-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestRoot.py
More file actions
49 lines (38 loc) · 1.19 KB
/
TestRoot.py
File metadata and controls
49 lines (38 loc) · 1.19 KB
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
import abc
import os
class AbstractTest:
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def solve(self,callable_test_obj):
print("This abstract function should not have been called")
raise NotImplementedError()
class AbstractSrc:
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def calculate_source(self,eqid,delta_t,delta_x,j):
print("This abstract function should not have been called")
raise NotImplementedError()
@abc.abstractmethod
def calculate_abc(self,eqid,delta_t,delta_x,j):
print("This abstract function should not have been called")
raise NotImplementedError()
class Params:
def __init__(self,id):
self.xmin = 0
self.xmax = 1
self.tmin = 0
self.tmax = 1
self.fpath = '.'
self.name = id
self.iter_count = 1
def set_spatial_limits(self,xmin,xmax):
self.xmin = xmin
self.xmax = xmax
def set_temporal_limits(self,tmin,tmax):
self.tmin = tmin
self.tmax = tmax
#Absolute path
def set_fig_path(self,fpath):
self.fpath = fpath
if not os.path.exists(fpath):
os.makedirs(fpath)