Skip to content

Commit

Permalink
comparison to False / True
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Jan 3, 2025
1 parent b790707 commit 9f9e037
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions darmonpoints/cohomology_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ def get_overconvergent_class_matrices(
):
# If the moments are pre-calculated, will load them. Otherwise, calculate and
# save them to disk.
if use_ps_dists == False:
if use_ps_dists is False:
raise NotImplementedError(
"Must use distributions from Pollack-Stevens code in the split case"
)

sgninfty = "plus" if sign_at_infinity == 1 else "minus"
dist_type = "ps" if use_ps_dists == True else "fm"
dist_type = "ps" if use_ps_dists is True else "fm"
fname = "moments_%s_%s_%s_%s_%s.sobj" % (
p,
E.cremona_label(),
Expand Down Expand Up @@ -148,7 +148,7 @@ def get_overconvergent_class_quaternionic(
base_ring = Zp(p, prec)

sgninfty = "plus" if sign_at_infinity == 1 else "minus"
dist_type = "ps" if use_ps_dists == True else "fm"
dist_type = "ps" if use_ps_dists is True else "fm"
fname = "moments_%s_%s_%s_%s_%s.sobj" % (p, Ename, sgninfty, prec, dist_type)
if use_sage_db:
try:
Expand Down
2 changes: 1 addition & 1 deletion darmonpoints/homology.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def is_cycle(self, return_residue=False):
ans = True
else:
ans = False
return ans if return_residue == False else (ans, res)
return ans if return_residue is False else (ans, res)

def hecke_smoothen(self, r, prec=None):
if prec is None:
Expand Down
4 changes: 2 additions & 2 deletions darmonpoints/integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def sample_point(G, e, prec=20):
rev, h = e
hemb = G.embed(set_immutable(h**-1), prec)
wploc = G.embed(G.wp(), prec)
if rev == True:
if rev is True:
hemb = hemb * wploc
a, b, c, d = hemb.list()
if d == 0:
Expand Down Expand Up @@ -401,7 +401,7 @@ def __call__(self, h, check=False):
ans = self.cocycle.evaluate_and_identity(a)
else:
ans = self.cocycle.evaluate(a)
if rev == False:
if rev is False:
return ans
else:
return -ans
Expand Down
4 changes: 2 additions & 2 deletions darmonpoints/limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def compute_tau0(v0, gamma, wD, return_exact=False):
if c * tau0 + d != v0(wD):
tau0 = v0(tau0_vec[1][0])
idx = 1
return tau0_vec[idx][0] if return_exact == True else tau0
return tau0_vec[idx][0] if return_exact is True else tau0


def order_and_unit(F, conductor):
Expand Down Expand Up @@ -383,7 +383,7 @@ def find_optimal_embeddings(F, use_magma=False, extra_conductor=1, magma=None):
w = F.maximal_order().ring_generators()[0]
D = F.discriminant()
## this matrix gives an optimal embedding of conductor 1
if use_magma == True or extra_conductor != 1:
if use_magma is True or extra_conductor != 1:
if magma is None:
from sage.interfaces.magma import magma
tmp = magma.ReducedForms(str(D * extra_conductor**2), nvals=1)
Expand Down
2 changes: 1 addition & 1 deletion darmonpoints/sarithgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, reverse, gamma):
set_immutable(self.gamma)

def _repr_(self):
return "(%s)^%s" % (self.gamma, "+" if self.reverse == False else "-")
return "(%s)^%s" % (self.gamma, "+" if self.reverse is False else "-")

def __iter__(self):
return iter([self.reverse, self.gamma])
Expand Down
8 changes: 4 additions & 4 deletions darmonpoints/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def is_in_Gamma0loc(A, det_condition=True, p=None):
r"""
Whether the matrix A has all entries Zp-integral, and is upper-triangular mod p.
"""
if det_condition == True and A.determinant() != 1:
if det_condition is True and A.determinant() != 1:
return False
if p is not None:
return all(o.valuation(p) >= 0 for o in A.list()) and A[1, 0].valuation(p) > 0
Expand Down Expand Up @@ -1068,7 +1068,7 @@ def our_sqrt(xx, K=None, return_all=False):
if (y0**2 - x).valuation() >= minval:
found = True
break
if found == False:
if found is False:
if return_all:
return []
else:
Expand All @@ -1086,7 +1086,7 @@ def our_sqrt(xx, K=None, return_all=False):
if (y0**2 - y0 + (1 - x) / 4).valuation() >= minval:
found = True
break
if found == False:
if found is False:
if return_all:
return []
else:
Expand Down Expand Up @@ -1144,7 +1144,7 @@ def our_cuberoot(xx, K=None, return_all=False):
if (y0**3 - x).valuation() >= minval:
found = True
break
if found == False:
if found is False:
raise ValueError("Not a cube")
y1 = y0
y = K(0)
Expand Down

0 comments on commit 9f9e037

Please sign in to comment.