Esempio n. 1
0
def main():
	#Always start by updating with newest summary.json
	utilities.update()

	#Check fletching info
	OnyxBolts()
	DiamondBolts()
	RubyBolts()
Esempio n. 2
0
def main():
	#Always start by updating with newest summary.json
	utilities.update()

	#Check fletching info
	Dharok()
	Verac()
	Guthan()
	Torag()
	Karil()
	Ahrim()
Esempio n. 3
0
def test_update():
    data, source_probs = dummy_ini('test_init.log')
    print "Initial priorities : ",
    print source_probs
    print "Updating based on data : ",
    print data
    source_probs = utilities.update(source_probs, data, 0, 'test_update.log')
    print "Final priorities (with smoothing factor 0) : ",
    print source_probs
Esempio n. 4
0
async def appDateCheck():
	"""
	Checks app updates
	"""
	if not utilities.isonline():  # if we're not online return false
		return False
	data = utilities.checkUpdate( 'https://github.com/ENDERZOMBI102/BEE-manipulator', config.version )
	if data.url is None:
		if getattr(root, 'instance', False):
			wx.MessageBox(
				parent=root.instance,
				message='No updates found!',
				caption='BEE Manipulator'
			)
		return
	data = wx.GenericMessageDialog(
		parent=getattr(root, 'instance', None),
		message=f'An update for the app is available, do you want to update now?\n\n{data.description}',
		caption=f'Update Available - new version: {data.version}',
		style=wx.YES_NO | wx.ICON_WARNING | wx.STAY_ON_TOP | wx.NO_DEFAULT
	)
	if data.ShowModal() == wx.ID_NO:
		return  # user don't want to update
	utilities.update()
Esempio n. 5
0
def iterate(k, j, t, wall_time, hexagon_mf_operators, ts, Ma, uab_term, u_term,
            v_term, mu_term, t_term, var_terms, dig_h, Pr, Psi_s, Ns,
            Nsquare_s, EVals, EVecs, err):
    t_begin = time()
    mu = Ma.flat[j]
    # initial d_hex_min is the minimum of eigenvalue
    d_hex_min, v_hex_min, vec_hex, d_hex = 1.0e5, None, None, None
    phi_s = None

    # t_init_begin = time()
    for lp in range(0, len(Pr)):
        psi_s = np.repeat(Pr.flat[lp], 12)

        # import the 6 single-site mean-field Hamiltonians for a Honeycomb lattice
        #  with two species of Pseudospins
        h_hexa = calc_h_hexa(t, mu, psi_s, uab_term, u_term, v_term, mu_term,
                             t_term, var_terms, dig_h, ts)
        # solve the Hamilton with Eigenvectors and Eigenvalues
        # python returns array of Eigenvalues and normalized Eigenvectors
        try:
            d_hex, vec_hex = sparse.linalg.eigsh(h_hexa, which='SA', k=1)
            d_hex0, v_hex0 = d_hex[0], vec_hex[:, 0]
        except sparse.linalg.ArpackNoConvergence:
            continue

        # find phi1up(down)---the trial solution corresponding to the lowest eigenvalues of Hsite
        if d_hex0 < d_hex_min:
            d_hex_min, v_hex_min = d_hex0, v_hex0
            phi_s = psi_s

    # Values of Order parameters corresponding to the trial solution of ground state above
    # # value difference for designated order parameters with the trial solutions
    is_self_consistent, Phi_s, v_hex_min = update(h_hexa, hexagon_mf_operators,
                                                  phi_s, err)

    for lp in range(0, wall_time):
        if is_self_consistent or Phi_s is None:
            break
        else:
            psi_s = Phi_s
            h_hexa = calc_h_hexa(t, mu, psi_s, uab_term, u_term, v_term,
                                 mu_term, t_term, var_terms, dig_h, ts)
            is_self_consistent, Phi_s, v_hex_min = update(
                h_hexa, hexagon_mf_operators, psi_s, err)

    if not is_self_consistent:
        print(f"    {k}, {j} iteration fail to converge", flush=True)
        # Phi_s[2] = np.nan

    if Phi_s is not None:
        evals, evecs = sparse.linalg.eigsh(h_hexa, which='SA', k=10)
        args = np.argsort(evals)
        EVals[j, k] = evals[args]
        EVecs[j, k] = evecs[:, args].T

        # save the final optimal value of both order parameters£¬also save the
        # corresponding state eigenvector
        for i in range(0, 12):
            Psi_s[i][j, k] = Phi_s[i]

        # if not is_self_consistent:
        #     Psi_s[2][j, k] = np.nan

        Psi_s[12][j, k] = (v_hex_min.getH().dot(
            hexagon_mf_operators[0].getH().dot(
                hexagon_mf_operators[2].dot(v_hex_min)))).data[0]
        Psi_s[13][j, k] = (v_hex_min.getH().dot(
            hexagon_mf_operators[1].getH().dot(
                hexagon_mf_operators[3].dot(v_hex_min)))).data[0]
        Psi_s[14][j, k] = (v_hex_min.getH().dot(
            hexagon_mf_operators[0].getH().dot(
                hexagon_mf_operators[1].dot(v_hex_min)))).data[0]
        Psi_s[15][j, k] = (v_hex_min.getH().dot(
            hexagon_mf_operators[2].getH().dot(
                hexagon_mf_operators[3].dot(v_hex_min)))).data[0]
        Psi_s[16][j, k] = (v_hex_min.getH().dot(
            hexagon_mf_operators[0].getH().dot(
                hexagon_mf_operators[3].dot(v_hex_min)))).data[0]
        Psi_s[17][j, k] = (v_hex_min.getH().dot(
            hexagon_mf_operators[1].getH().dot(
                hexagon_mf_operators[2].dot(v_hex_min)))).data[0]
        Psi_s[18][j, k] = (v_hex_min.getH().dot(
            (hexagon_mf_operators[0] +
             hexagon_mf_operators[1]).dot(v_hex_min))).data[0]
        Psi_s[19][j, k] = (v_hex_min.getH().dot(
            (hexagon_mf_operators[2] +
             hexagon_mf_operators[3]).dot(v_hex_min))).data[0]

        for i in range(0, 12):
            Ns[i][j, k] = (v_hex_min.getH().dot(
                hexagon_mf_operators[i].getH().dot(
                    hexagon_mf_operators[i].dot(v_hex_min)))).data[0]
        for i in range(0, 12):
            tmp = hexagon_mf_operators[i].getH().dot(hexagon_mf_operators[i])
            Nsquare_s[i][j, k] = (v_hex_min.getH().dot(
                tmp.dot(tmp.dot(v_hex_min)))).data[0]
    else:
        for i in range(0, 20):
            Psi_s[i][j, k] = np.nan
        # for i in range(12, 20):
        #     Psi_s[i][j, k] = np.nan
        for i in range(0, 4):
            Ns[i][j, k] = np.nan
        for i in range(4, 8):
            Ns[i][j, k] = np.nan
    print(
        f"{k}, {j} iteration finished in {time()-t_begin:.4} seconds with Psi1up{j,k}={Psi_s[0][j, k]}",
        flush=True)
    return Psi_s, Ns, Nsquare_s, EVals, EVecs
Esempio n. 6
0
	def update_account_codes(self):
		try :			
			data = utilities.update(ACCOUNT_CODES, UPDATE, self)
			utilities.log_req_res(data, self)
		except:
			utilities.get_error_message(self)
Esempio n. 7
0
	def update_tax_codes(self):
		try :			
			data = utilities.update(TAX_CODES, UPDATE, self)
			utilities.log_req_res(data, self)
		except:
			utilities.get_error_message(self)
Esempio n. 8
0
	def update_supplier_invoices(self):
		try :			
			data = utilities.update(SUPPLIER_INVOICES, UPDATE, self)
			utilities.log_req_res(data, self)
		except:
			utilities.get_error_message(self)
Esempio n. 9
0
	def update_purchase_orders(self):
		try :			
			data = utilities.update(PURCHASE_ORDERS, UPDATE, self)
			utilities.log_req_res(data, self)
		except:
			utilities.get_error_message(self)
Esempio n. 10
0
	def update_customer_invoices(self):
		try :			
			data = utilities.update(CUSTOMER_INVOICES, UPDATE, self)
			utilities.log_req_res(data, self)
		except:
			utilities.get_error_message(self)
Esempio n. 11
0
	def update_assets(self):
		try :			
			data = utilities.update(ASSETS, UPDATE, self)
			utilities.log_req_res(data, self)
		except:
			utilities.get_error_message(self)
Esempio n. 12
0
	def update_jobs(self):
		try :			
			data = utilities.update(JOBS, UPDATE, self)
			utilities.log_req_res(data, self)
		except:
			utilities.get_error_message(self)
Esempio n. 13
0
	def update_opportunities(self):
		try :			
			data = utilities.update(OPPORTUNITIES, UPDATE, self)
			utilities.log_req_res(data, self)
		except:
			utilities.get_error_message(self)
Esempio n. 14
0
	def update_contacts(self):
		try :			
			data = utilities.update(CONTACTS, UPDATE, self)
			utilities.log_req_res(data, self)
		except:
			utilities.get_error_message(self)