本文整理汇总了Python中time.clock方法的典型用法代码示例。如果您正苦于以下问题:Python time.clock方法的具体用法?Python time.clock怎么用?Python time.clock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类time
的用法示例。
在下文中一共展示了time.clock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_write_conf
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def test_write_conf(self):
rdd = self.sc.parallelize([{'key':i, 'text':i, 'int':i} for i in range(10)])
save = partial(rdd.saveToCassandra, self.keyspace, self.table)
save(batch_size=100)
save(batch_buffer_size=100)
save(batch_grouping_key='replica_set')
save(batch_grouping_key='partition')
save(consistency_level='ALL')
save(consistency_level=ConsistencyLevel.LOCAL_QUORUM)
save(parallelism_level=10)
save(throughput_mibps=10)
save(ttl=5)
save(ttl=timedelta(minutes=30))
save(timestamp=time.clock() * 1000 * 1000)
save(timestamp=datetime.now())
save(metrics_enabled=True)
save(write_conf=WriteConf(ttl=3, metrics_enabled=True))
示例2: _make_shared
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def _make_shared(self):
cput0 = (time.clock(), time.time())
kconserv = self.kconserv
t1, t2, eris = self.t1, self.t2, self.eris
self.Foo = imd.Foo(self._cc, t1, t2, eris, kconserv)
self.Fvv = imd.Fvv(self._cc, t1, t2, eris, kconserv)
self.Fov = imd.Fov(self._cc, t1, t2, eris, kconserv)
# 2 virtuals
self.Wovvo = imd.Wovvo(self._cc, t1, t2, eris, kconserv)
self.Woovv = eris.oovv
self._made_shared = True
logger.timer_debug1(self, 'EOM-CCSD shared intermediates', *cput0)
return self
示例3: make_ip
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def make_ip(self):
if not self._made_shared:
self._make_shared()
cput0 = (time.clock(), time.time())
kconserv = self.kconserv
t1, t2, eris = self.t1, self.t2, self.eris
# 0 or 1 virtuals
self.Woooo = imd.Woooo(self._cc, t1, t2, eris, kconserv)
self.Wooov = imd.Wooov(self._cc, t1, t2, eris, kconserv)
self.Wovoo = imd.Wovoo(self._cc, t1, t2, eris, kconserv)
self.made_ip_imds = True
logger.timer_debug1(self, 'EOM-CCSD IP intermediates', *cput0)
return self
示例4: make_ea
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def make_ea(self):
if not self._made_shared:
self._make_shared()
cput0 = (time.clock(), time.time())
kconserv = self.kconserv
t1, t2, eris = self.t1, self.t2, self.eris
# FIXME DELETE WOOOO
# 0 or 1 virtuals
self.Woooo = imd.Woooo(self._cc, t1, t2, eris, kconserv)
# 3 or 4 virtuals
self.Wvovv = imd.Wvovv(self._cc, t1, t2, eris, kconserv)
self.Wvvvv = imd.Wvvvv(self._cc, t1, t2, eris, kconserv)
self.Wvvvo = imd.Wvvvo(self._cc, t1, t2, eris, kconserv)
self.made_ea_imds = True
logger.timer_debug1(self, 'EOM-CCSD EA intermediates', *cput0)
return self
示例5: make_t3p2_ea
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def make_t3p2_ea(self, cc):
cput0 = (time.clock(), time.time())
t1, t2, eris = cc.t1, cc.t2, self.eris
delta_E_corr, pt1, pt2, Wovoo, Wvvvo = \
imd.get_t3p2_imds_slow(cc, t1, t2, eris)
self.t1 = pt1
self.t2 = pt2
self._made_shared = False # Force update
self.make_ea() # Make after t1/t2 updated
self.Wvvvo = self.Wvvvo + Wvvvo
self.made_ea_imds = True
logger.timer_debug1(self, 'EOM-CCSD(T)a EA intermediates', *cput0)
return self
示例6: make_ee
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def make_ee(self):
if not self._made_shared:
self._make_shared()
cput0 = (time.clock(), time.time())
kconserv = self.kconserv
t1, t2, eris = self.t1, self.t2, self.eris
if not self.made_ip_imds:
# 0 or 1 virtuals
self.Woooo = imd.Woooo(self._cc, t1, t2, eris, kconserv)
self.Wooov = imd.Wooov(self._cc, t1, t2, eris, kconserv)
self.Wovoo = imd.Wovoo(self._cc, t1, t2, eris, kconserv)
if not self.made_ea_imds:
# 3 or 4 virtuals
self.Wvovv = imd.Wvovv(self._cc, t1, t2, eris, kconserv)
self.Wvvvv = imd.Wvvvv(self._cc, t1, t2, eris, kconserv)
self.Wvvvo = imd.Wvvvo(self._cc, t1, t2, eris, kconserv, self.Wvvvv)
self.made_ee_imds = True
logger.timer(self, 'EOM-CCSD EE intermediates', *cput0)
return self
示例7: _make_shared_2e
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def _make_shared_2e(self):
cput0 = (time.clock(), time.time())
log = logger.Logger(self.stdout, self.verbose)
t1, t2, eris = self.t1, self.t2, self.eris
kconserv = self.kconserv
if self._fimd is not None:
nkpts, nocc, nvir = t1.shape
ovov_dest = self._fimd.create_dataset('ovov', (nkpts, nkpts, nkpts, nocc, nvir, nocc, nvir), t1.dtype.char)
ovvo_dest = self._fimd.create_dataset('ovvo', (nkpts, nkpts, nkpts, nocc, nvir, nvir, nocc), t1.dtype.char)
else:
ovov_dest = ovvo_dest = None
# 2 virtuals
self.Wovov = imd.Wovov(t1, t2, eris, kconserv, ovov_dest)
self.Wovvo = imd.Wovvo(t1, t2, eris, kconserv, ovvo_dest)
self.Woovv = eris.oovv
log.timer('EOM-CCSD shared two-electron intermediates', *cput0)
示例8: make_t3p2_ip
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def make_t3p2_ip(self, cc):
cput0 = (time.clock(), time.time())
t1, t2, eris = cc.t1, cc.t2, self.eris
delta_E_tot, pt1, pt2, Wovoo, Wvvvo = \
imd.get_t3p2_imds(cc, t1, t2, eris)
self.t1 = pt1
self.t2 = pt2
self._made_shared_2e = False # Force update
self.make_ip() # Make after t1/t2 updated
self.Wovoo = self.Wovoo + Wovoo
self.made_ip_imds = True
logger.timer_debug1(self, 'EOM-CCSD(T)a IP intermediates', *cput0)
return self
示例9: make_t3p2_ea
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def make_t3p2_ea(self, cc):
cput0 = (time.clock(), time.time())
t1, t2, eris = cc.t1, cc.t2, self.eris
delta_E_tot, pt1, pt2, Wovoo, Wvvvo = \
imd.get_t3p2_imds(cc, t1, t2, eris)
self.t1 = pt1
self.t2 = pt2
self._made_shared_2e = False # Force update
self.make_ea() # Make after t1/t2 updated
self.Wvvvo = self.Wvvvo + Wvvvo
self.made_ea_imds = True
logger.timer_debug1(self, 'EOM-CCSD(T)a EA intermediates', *cput0)
return self
示例10: _make_shared_2e
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def _make_shared_2e(self):
cput0 = (time.clock(), time.time())
log = logger.Logger(self.stdout, self.verbose)
t1,t2,eris = self.t1, self.t2, self.eris
kconserv = self.kconserv
# TODO: check whether to hold Wovov Wovvo in memory
if self._fimd is None:
self._fimd = lib.H5TmpFile()
nkpts, nocc, nvir = t1.shape
self._fimd.create_dataset('ovov', (nkpts,nkpts,nkpts,nocc,nvir,nocc,nvir), t1.dtype.char)
self._fimd.create_dataset('ovvo', (nkpts,nkpts,nkpts,nocc,nvir,nvir,nocc), t1.dtype.char)
# 2 virtuals
self.Wovov = imd.Wovov(t1,t2,eris,kconserv, self._fimd['ovov'])
self.Wovvo = imd.Wovvo(t1,t2,eris,kconserv, self._fimd['ovvo'])
self.Woovv = eris.oovv
log.timer('EOM-CCSD shared two-electron intermediates', *cput0)
示例11: make_ip
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def make_ip(self, ip_partition=None):
self._make_shared_1e()
if self._made_shared_2e is False and ip_partition != 'mp':
self._make_shared_2e()
self._made_shared_2e = True
cput0 = (time.clock(), time.time())
log = logger.Logger(self.stdout, self.verbose)
t1,t2,eris = self.t1, self.t2, self.eris
kconserv = self.kconserv
nkpts, nocc, nvir = t1.shape
self._fimd.create_dataset('oooo', (nkpts,nkpts,nkpts,nocc,nocc,nocc,nocc), t1.dtype.char)
self._fimd.create_dataset('ooov', (nkpts,nkpts,nkpts,nocc,nocc,nocc,nvir), t1.dtype.char)
self._fimd.create_dataset('ovoo', (nkpts,nkpts,nkpts,nocc,nvir,nocc,nocc), t1.dtype.char)
# 0 or 1 virtuals
if ip_partition != 'mp':
self.Woooo = imd.Woooo(t1,t2,eris,kconserv, self._fimd['oooo'])
self.Wooov = imd.Wooov(t1,t2,eris,kconserv, self._fimd['ooov'])
self.Wovoo = imd.Wovoo(t1,t2,eris,kconserv, self._fimd['ovoo'])
self.made_ip_imds = True
log.timer('EOM-CCSD IP intermediates', *cput0)
示例12: _make_shared
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def _make_shared(self):
cput0 = (time.clock(), time.time())
t1, t2, eris = self.t1, self.t2, self.eris
self.Foo, self.FOO = kintermediates_uhf.Foo(self._cc, t1, t2, eris)
self.Fvv, self.FVV = kintermediates_uhf.Fvv(self._cc, t1, t2, eris)
self.Fov, self.FOV = kintermediates_uhf.Fov(self._cc, t1, t2, eris)
# 2 virtuals
self.Wovvo, self.WovVO, self.WOVvo, self.WOVVO = kintermediates_uhf.Wovvo(self._cc, t1, t2, eris)
self.Woovv, self.WooVV, self.WOOvv, self.WOOVV = kintermediates_uhf.Woovv(self._cc, t1, t2, eris)
self.Wovov = eris.ovov - np.asarray(eris.ovov).transpose(2,1,0,5,4,3,6)
self.WOVOV = eris.OVOV - np.asarray(eris.OVOV).transpose(2,1,0,5,4,3,6)
self.WovOV = eris.ovOV
self.WOVov = None
self._made_shared = True
logger.timer_debug1(self, 'EOM-KCCSD shared intermediates', *cput0)
return self
示例13: make_ip
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def make_ip(self):
if not self._made_shared:
self._make_shared()
kconserv = self.kconserv
cput0 = (time.clock(), time.time())
t1, t2, eris = self.t1, self.t2, self.eris
# 0 or 1 virtuals
self.Woooo, self.WooOO, _ , self.WOOOO = kintermediates_uhf.Woooo(self._cc, t1, t2, eris)
self.Wooov, self.WooOV, self.WOOov, self.WOOOV = kintermediates_uhf.Wooov(self._cc, t1, t2, eris, kconserv) # TODO
self.Woovo, self.WooVO, self.WOOvo, self.WOOVO = kintermediates_uhf.Woovo(self._cc, t1, t2, eris) # TODO
self.made_ip_imds = True
logger.timer_debug1(self, 'EOM-KUCCSD IP intermediates', *cput0)
return self
示例14: make_ea
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def make_ea(self):
if not self._made_shared:
self._make_shared()
cput0 = (time.clock(), time.time())
t1, t2, eris = self.t1, self.t2, self.eris
# 3 or 4 virtuals
#self.Wvovv, self.WvoVV, self.WVOvv, self.WVOVV = kintermediates_uhf.Wvovv(self._cc, t1, t2, eris)
self.Wvvov, self.WvvOV, self.WVVov, self.WVVOV = kintermediates_uhf.Wvvov(self._cc, t1, t2, eris)
if eris.vvvv is not None:
self.Wvvvv, self.WvvVV, self.WVVVV = Wvvvv = kintermediates_uhf.Wvvvv(self._cc, t1, t2, eris)
else:
self.Wvvvv = self.WvvVV = self.WVVVV = None
self.Wvvvo, self.WvvVO, self.WVVvo, self.WVVVO = kintermediates_uhf.Wvvvo(self._cc, t1, t2, eris)
self.made_ea_imds = True
logger.timer_debug1(self, 'EOM-KUCCSD EA intermediates', *cput0)
return self
示例15: kernel
# 需要导入模块: import time [as 别名]
# 或者: from time import clock [as 别名]
def kernel(self, mo_energy=None, mo_coeff=None, mo_occ=None, atmlst=None):
cput0 = (time.clock(), time.time())
if mo_energy is None: mo_energy = self.base.mo_energy
if mo_coeff is None: mo_coeff = self.base.mo_coeff
if mo_occ is None: mo_occ = self.base.mo_occ
if atmlst is None:
atmlst = self.atmlst
else:
self.atmlst = atmlst
if self.verbose >= logger.INFO:
self.dump_flags()
de = self.grad_elec(mo_energy, mo_coeff, mo_occ, atmlst)
self.de = de + self.grad_nuc(atmlst=atmlst)
logger.timer(self, 'SCF gradients', *cput0)
self._finalize()
return self.de