File tree 1 file changed +14
-12
lines changed
1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,19 @@ def getMeshGids(self):
49
49
"""
50
50
pass
51
51
52
- def getSnapshotsAsArray (self ) -> np .ndarray :
53
- snapshot_array = listOfSnapshotsToArray (self .getSnapshotsAsListOfArrays ())
54
- return snapshot_array
55
-
52
+ @abc .abstractmethod
56
53
def getVariableNames (self ) -> list :
57
54
"""
58
55
Returns the names of different state variables
59
56
"""
60
- return self .var_names
57
+ pass
58
+
59
+ def getSnapshotsAsArray (self ) -> np .ndarray :
60
+ """
61
+ Returns numpy array where the list of snapshot arrays are concatenated
62
+ (assuming each snapshot corresponds to a column vector)
63
+ """
64
+ return _listOfSnapshotsToArray (self .getSnapshotsAsListOfArrays ())
61
65
62
66
def getNumVars (self ) -> int :
63
67
"""
@@ -66,10 +70,8 @@ def getNumVars(self) -> int:
66
70
"""
67
71
return len (self .get_variable_names ())
68
72
69
-
70
-
71
- def listOfSnapshotsToArray (list_of_snapshots : Iterable [np .ndarray ]) -> np .ndarray :
72
- '''
73
- Helper function to move snapshot list into a matrix
74
- '''
75
- return np .hstack ([ar .reshape (ar .shape [0 ],- 1 ) for ar in list_of_snapshots ])
73
+ def _listOfSnapshotsToArray (list_of_snapshots : Iterable [np .ndarray ]) -> np .ndarray :
74
+ '''
75
+ Helper function to move snapshot list into a matrix
76
+ '''
77
+ return np .hstack ([ar .reshape (ar .shape [0 ],- 1 ) for ar in list_of_snapshots ])
You can’t perform that action at this time.
0 commit comments