cf4b1078573d69bbb5c511a22300f42ff2b0da76,hyperspy/samfire.py,Samfire,_swap_dict_and_model,#Samfire#Any#Any#Any#,489
Before Change
def _swap_dict_and_model(self, m_ind, dic, d_ind=None):
if d_ind is None:
d_ind = tuple([0 for _ in dic["chisq.data"].shape])
self.model.chisq.data[m_ind], dic["chisq.data"] = dic[
"chisq.data"].copy(), self.model.chisq.data[m_ind].copy()
self.model.dof.data[m_ind], dic["dof.data"] = dic[
"dof.data"].copy(), self.model.dof.data[m_ind].copy()
After Change
if d_ind is None:
d_ind = tuple([0 for _ in dict_["dof.data"].shape])
m = self.model
for k in dict_.keys():
if k.endswith(".data"):
item = k[:-5]
getattr(m, item).data[m_ind], dict_[k] = \
dict_[k].copy(), getattr(m, item).data[m_ind].copy()
// self.model.dof.data[m_ind], dict_["dof.data"] = dict_[
// "dof.data"].copy(), self.model.dof.data[m_ind].copy()
// if "chisq.data" in dict_:
// self.model.chisq.data[m_ind], dict_["chisq.data"] = dict_[
// "chisq.data"].copy(), self.model.chisq.data[m_ind].copy()
// if "corr.data" in dict_:
// self.model.corr.data[m_ind], dict_["corr.data"] = dict_[
// "corr.data"].copy(), self.model.corr.data[m_ind].copy()
for comp_name, comp in dict_["components"].items():
// only active components are sent
if self.model[comp_name].active_is_multidimensional:
self.model[comp_name]._active_array[m_ind] = True
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: hyperspy/hyperspy
Commit Name: cf4b1078573d69bbb5c511a22300f42ff2b0da76
Time: 2016-11-29
Author: t.ostasevicius@gmail.com
File Name: hyperspy/samfire.py
Class Name: Samfire
Method Name: _swap_dict_and_model
Project Name: senarvi/theanolm
Commit Name: bcf723a2f67a372e6b03a453149a82ecf2766fff
Time: 2015-12-24
Author: seppo.git@marjaniemi.com
File Name: theanolm/network.py
Class Name: Architecture
Method Name: from_state
Project Name: hyperspy/hyperspy
Commit Name: cf4b1078573d69bbb5c511a22300f42ff2b0da76
Time: 2016-11-29
Author: t.ostasevicius@gmail.com
File Name: hyperspy/samfire.py
Class Name: Samfire
Method Name: _swap_dict_and_model
Project Name: stratosphereips/StratosphereLinuxIPS
Commit Name: 729a98a1be870f6432dc39cd5a1d38fdf7425e04
Time: 2019-04-04
Author: eldraco@gmail.com
File Name: modules/portscanDetector-1/portscanDetector-1.py
Class Name: PortScanProcess
Method Name: run