forked from lozuwa/impy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssertDataTypes.py
More file actions
executable file
·40 lines (37 loc) · 831 Bytes
/
Copy pathAssertDataTypes.py
File metadata and controls
executable file
·40 lines (37 loc) · 831 Bytes
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
"""
Author: Rodrigo Loza
Email: lozuwaucb@gmail.com
Description: A class that contains specific assertion methods.
"""
import os
import sys
import numpy as np
class AssertDataTypes(object):
def __init__(self):
super(AssertDataTypes, self).__init__()
def assertNumpyType(self, data):
"""
Asserts a data type as a numpy type.
Args:
data: A variable.
Returns:
A boolean. If True, then data is of numpy type.
If false, then data is not of numpy type.
"""
if (type(data) == np.ndarray):
return True
else:
return False
def assertNumpyType(data = None):
"""
Asserts a data type as a numpy type.
Args:
data: A variable.
Returns:
A boolean. If True, then data is of numpy type.
If false, then data is not of numpy type.
"""
if (type(data) == np.ndarray):
return True
else:
return False