def val(self, new_value): self._val = PstData._fixup_input_val( new_value, row_count=len(self._row), col_count=len(self._col), empty_creator=lambda row_count, col_count: np.empty( [row_count, col_count], dtype=np.float64)) self._assert_iid0_iid1(check_val=True)
def __init__(self, iid=None, iid0=None, iid1=None, val=None, name=None, parent_string=None, xp=None ): #!!!autodoc doesn't generate good doc for this constructor #We don't have a 'super(KernelData, self).__init__()' here because KernelData takes full responsibility for initializing both its superclasses xp = pstutil.array_module(xp) self._val = None #!!why does SnpData __init__ have a copy_inputs, but KernelData doesn't? assert (iid is None) != ( iid0 is None and iid1 is None ), "Either 'iid' or both 'iid0' 'iid1' must be provided." assert name is None or parent_string is None, "Can't set both 'name' and the deprecated 'parent_string'" if parent_string is not None: warnings.warn("'parent_string' is deprecated. Use 'name'", DeprecationWarning) if iid is not None: self._row = PstData._fixup_input( iid, empty_creator=lambda ignore: np.empty([0, 2], dtype='str'), dtype='str') self._col = self._row else: self._row = PstData._fixup_input( iid0, empty_creator=lambda ignore: np.empty([0, 2], dtype='str'), dtype='str') self._col = PstData._fixup_input( iid1, empty_creator=lambda ignore: np.empty([0, 2], dtype='str'), dtype='str') self._row_property = PstData._fixup_input( None, count=len(self._row), empty_creator=lambda count: np.empty([count, 0], dtype='str'), dtype='str') self._col_property = PstData._fixup_input( None, count=len(self._col), empty_creator=lambda count: np.empty([count, 0], dtype='str'), dtype='str') self._val = PstData._fixup_input_val( val, row_count=len(self._row), col_count=len(self._col), empty_creator=lambda row_count, col_count: xp.empty( [row_count, col_count], dtype=xp.float64), xp=xp) self._assert_iid0_iid1(check_val=True) self._name = name or parent_string or "" self._std_string_list = [] self._xp = xp
def val(self, new_value): self._val = PstData._fixup_input_val( new_value, row_count=len(self._row), col_count=len(self._col), empty_creator=lambda row_count, col_count: np.empty( [row_count, col_count, 3], dtype=np.float64) ) #!!!Replace empty with my FillNA method? self._assert_iid_sid_pos(check_val=True)
def __init__(self, iid, sid, val, pos=None, name=None, parent_string=None, copyinputs_function=None): if parent_string is not None: warnings.warn("'parent_string' is deprecated. Use 'name'", DeprecationWarning) self._row = PstData._fixup_input(iid,empty_creator=lambda ignore:np.empty([0,2],dtype=str)) self._col = PstData._fixup_input(sid,empty_creator=lambda ignore:np.empty([0],dtype=str)) self._row_property = PstData._fixup_input(None,count=len(self._row),empty_creator=lambda count:np.empty([count,0],dtype=str)) self._col_property = PstData._fixup_input(pos,count=len(self._col),empty_creator=lambda count:np.array([[np.nan, np.nan, np.nan]]*count)) self.val = PstData._fixup_input_val(val,row_count=len(self._row),col_count=len(self._col),empty_creator=lambda row_count,col_count:np.empty([row_count,col_count],dtype=np.float64)) self._assert_iid_sid_pos() self._name = name or parent_string or "" self._std_string_list = []
def __init__(self, iid, sid, val, pos=None, name=None, copyinputs_function=None): #We don't have a 'super(DistData, self).__init__()' here because DistData takes full responsibility for initializing both its superclasses self._val = None self._row = PstData._fixup_input(iid,empty_creator=lambda ignore:np.empty([0,2],dtype='str'),dtype='str') self._col = PstData._fixup_input(sid,empty_creator=lambda ignore:np.empty([0],dtype='str'),dtype='str') self._row_property = PstData._fixup_input(None,count=len(self._row),empty_creator=lambda count:np.empty([count,0],dtype='str'),dtype='str') self._col_property = PstData._fixup_input(pos,count=len(self._col),empty_creator=lambda count:np.full([count, 3], np.nan)) self._val = PstData._fixup_input_val(val,row_count=len(self._row),col_count=len(self._col),empty_creator=lambda row_count,col_count:np.empty([row_count,col_count,3],dtype=np.float64))#!!!Replace empty with my FillNA method? self._assert_iid_sid_pos(check_val=True) self._name = name or "" self._std_string_list = []
def __init__(self, iid, sid, val, pos=None, name=None, parent_string=None, copyinputs_function=None): #We don't have a 'super(SnpData, self).__init__()' here because SnpData takes full responsiblity for initializing both its superclasses self.val = None if parent_string is not None: warnings.warn("'parent_string' is deprecated. Use 'name'", DeprecationWarning) self._row = PstData._fixup_input(iid,empty_creator=lambda ignore:np.empty([0,2],dtype='S'),dtype='S') self._col = PstData._fixup_input(sid,empty_creator=lambda ignore:np.empty([0],dtype='S'),dtype='S') self._row_property = PstData._fixup_input(None,count=len(self._row),empty_creator=lambda count:np.empty([count,0],dtype='S'),dtype='S') self._col_property = PstData._fixup_input(pos,count=len(self._col),empty_creator=lambda count:np.array([[np.nan, np.nan, np.nan]]*count)) self.val = PstData._fixup_input_val(val,row_count=len(self._row),col_count=len(self._col),empty_creator=lambda row_count,col_count:np.empty([row_count,col_count],dtype=np.float64)) self._assert_iid_sid_pos() self._name = name or parent_string or "" self._std_string_list = []
def __init__(self, iid, sid, val, pos=None, name=None, parent_string=None, copyinputs_function=None): #We don't have a 'super(SnpData, self).__init__()' here because SnpData takes full responsiblity for initializing both its superclasses self.val = None if parent_string is not None: warnings.warn("'parent_string' is deprecated. Use 'name'", DeprecationWarning) self._row = PstData._fixup_input(iid,empty_creator=lambda ignore:np.empty([0,2],dtype=str)) self._col = PstData._fixup_input(sid,empty_creator=lambda ignore:np.empty([0],dtype=str)) self._row_property = PstData._fixup_input(None,count=len(self._row),empty_creator=lambda count:np.empty([count,0],dtype=str)) self._col_property = PstData._fixup_input(pos,count=len(self._col),empty_creator=lambda count:np.array([[np.nan, np.nan, np.nan]]*count)) self.val = PstData._fixup_input_val(val,row_count=len(self._row),col_count=len(self._col),empty_creator=lambda row_count,col_count:np.empty([row_count,col_count],dtype=np.float64)) self._assert_iid_sid_pos() self._name = name or parent_string or "" self._std_string_list = []
def __init__(self, iid, sid, val, pos=None, name=None, parent_string=None, copyinputs_function=None, xp=None, _require_float32_64=True): #We don't have a 'super(SnpData, self).__init__()' here because SnpData takes full responsibility for initializing both its superclasses xp = pstutil.array_module(xp) self._val = None if parent_string is not None: warnings.warn("'parent_string' is deprecated. Use 'name'", DeprecationWarning) self._row = PstData._fixup_input( iid, empty_creator=lambda ignore: np.empty([0, 2], dtype='str'), dtype='str') self._col = PstData._fixup_input( sid, empty_creator=lambda ignore: np.empty([0], dtype='str'), dtype='str') self._row_property = PstData._fixup_input( None, count=len(self._row), empty_creator=lambda count: np.empty([count, 0], dtype='str'), dtype='str') self._col_property = PstData._fixup_input( pos, count=len(self._col), empty_creator=lambda count: np.full([count, 3], np.nan)) self._val = PstData._fixup_input_val( val, row_count=len(self._row), col_count=len(self._col), empty_creator=lambda row_count, col_count: np.empty( [row_count, col_count], dtype=np.float64), _require_float32_64=_require_float32_64, xp=xp) self._assert_iid_sid_pos(check_val=True) self._name = name or parent_string or "" self._std_string_list = [] self._xp = xp
def __init__(self, iid=None, iid0=None, iid1=None, val=None, name=None, parent_string=None): #!!!autodoc doesn't generate good doc for this constructor #!!why does SnpData __init__ have a copy_inputs, but KernelData doesn't? assert (iid is None) != (iid0 is None and iid1 is None), "Either 'iid' or both 'iid0' 'iid1' must be provided." assert name is None or parent_string is None, "Can't set both 'name' and the deprecated 'parent_string'" if parent_string is not None: warnings.warn("'parent_string' is deprecated. Use 'name'", DeprecationWarning) if iid is not None: self._row = PstData._fixup_input(iid,empty_creator=lambda ignore:np.empty([0,2],dtype=str)) self._col = self._row else: self._row = PstData._fixup_input(iid0,empty_creator=lambda ignore:np.empty([0,2],dtype=str)) self._col = PstData._fixup_input(iid1,empty_creator=lambda ignore:np.empty([0,2],dtype=str)) self._row_property = PstData._fixup_input(None,count=len(self._row),empty_creator=lambda count:np.empty([count,0],dtype=str)) self._col_property = PstData._fixup_input(None,count=len(self._col),empty_creator=lambda count:np.empty([count,0],dtype=str)) self.val = PstData._fixup_input_val(val,row_count=len(self._row),col_count=len(self._col),empty_creator=lambda row_count,col_count:np.empty([row_count,col_count],dtype=np.float64)) self._assert_iid0_iid1() self._name = name or parent_string or "" self._std_string_list = []