Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] #226 Using reference comparison with literal values #230

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions solcore/absorption_calculator/absorption_QW.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def alpha_exciton_ehh_TE(exciton_index, E, z, E_e, E_hh, psi_e, psi_hh, well_wid
Et = (E_e - E_hh)
# import pdb; pdb.set_trace()
# NOTE TO MARKUS: Added the possiblity of using a Gauss lineshape
if line_shape is "Gauss":
if line_shape == "Gauss":
shape = Gauss(E, Et + En, hwhm)
else:
shape = L(E, Et + En, hwhm)
Expand Down Expand Up @@ -197,7 +197,7 @@ def alpha_exciton_elh_TE(exciton_index, E, z, E_e, E_lh, psi_e, psi_lh, well_wid
En = -Ry_eff / ((exciton_index - dimensionality) ** 2) # Exciton binding energy
Et = (E_e - E_lh)
# NOTE TO MARKUS: Added the possiblity of using a Gauss lineshape
if line_shape is "Gauss":
if line_shape == "Gauss":
shape = Gauss(E, Et + En, hwhm)
else:
shape = L(E, Et + En, hwhm)
Expand Down
8 changes: 4 additions & 4 deletions solcore/analytic_solar_cells/QE.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def calculate_junction_sr(junc, energies, bs, bs_initial, V, printParameters=Fal
idx = 0
pn_or_np = 'pn'
for layer in junc:
if layer.role is not 'emitter':
if layer.role != 'emitter':
idx += 1
else:
Na = 0
Expand All @@ -149,10 +149,10 @@ def calculate_junction_sr(junc, energies, bs, bs_initial, V, printParameters=Fal
break

# Now we check for an intrinsic region and, if there is, for the base.
if junc[idx + 1].role is 'intrinsic':
if junc[idx + 1].role == 'intrinsic':
iRegion = junc[idx + 1]

if junc[idx + 2].role is 'base':
if junc[idx + 2].role == 'base':
if pn_or_np == "pn":
nRegion = junc[idx + 2]
else:
Expand All @@ -162,7 +162,7 @@ def calculate_junction_sr(junc, energies, bs, bs_initial, V, printParameters=Fal
'"base".')

# If there is no intrinsic region, we check directly the base
elif junc[idx + 1].role is 'base':
elif junc[idx + 1].role == 'base':
if pn_or_np == "pn":
nRegion = junc[idx + 1]
else:
Expand Down
4 changes: 2 additions & 2 deletions solcore/poisson_drift_diffusion/QWunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def CalculateAbsorption(self, use_Adachi, SR):
3] # 0 = Energy, 1 = n, 2 = k, 3 = Absorption

# self[index].material.absorption[ edge_index: ] = 0
if self.labels[index] is "well":
if self.labels[index] == "well":

self[index].material.absorption = self[index].material.absorption - self[index].material.absorption[
edge_index]
Expand All @@ -302,7 +302,7 @@ def CalculateAbsorption(self, use_Adachi, SR):
self[index].material.absorption = self[index].material.absorption + SR["alpha"][1] * self[
index].width / self.QW_width

elif self.labels[index] is "interlayer":
elif self.labels[index] == "interlayer":
self[index].material.absorption[edge_index:] = 0

else:
Expand Down
4 changes: 2 additions & 2 deletions solcore/quantum_mechanics/high_level_kp_QW.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ def schrodinger(structure, plot_bands=False, kpoints=40, krange=1e9, num_eigenva
"E": {key: np.array(bands[key]) for key in bands.keys() if key[0] in "E"},
}

if "potentials" is graphtype:
if graphtype == "potentials":
schrodinger_plt = graphics.split_schrodinger_graph_potentials(result_band_edge, **kwargs)
# schrodinger_plt.draw()

if "potentialsLDOS" is graphtype:
if graphtype == "potentialsLDOS":
Ee, LDOSe, Eh, LDOSh = graphics.split_schrodinger_graph_LDOS(result_band_edge, **kwargs)
result_band_edge["LDOS"] = {"x": bands['x'], 'Ee': Ee, 'LDOSe': LDOSe, 'Eh': Eh, 'LDOSh': LDOSh}

Expand Down
2 changes: 1 addition & 1 deletion solcore/quantum_mechanics/kp_QW.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def fill_hamiltonian_holes_4x4(A1, A2, B1, B2, C, D, delta, block):
uu = np.zeros(2 * N)
uuu = np.zeros(2 * N)

if block is "U":
if block == "U":
# We write the equations for the UPPER 2x2 block of the Hamiltonian, for g1 and g2

# We fill the first two equations separatelly
Expand Down
2 changes: 1 addition & 1 deletion solcore/units_system/units_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def guess_dimension(self, unit):
def list_dimensions(self):
for dim in self.dimensions.keys():
print(
"%s: %s" % (dim, ", ".join([k for k in self.dimensions[dim].keys() if k is not None and k is not ""])))
"%s: %s" % (dim, ", ".join([k for k in self.dimensions[dim].keys() if k is not None and k != ""])))


def compare_floats(a, b, absoulte_precision=1e-12, relative_precision=None):
Expand Down