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 and activate pep E305 #54

Merged
merged 1 commit into from
Dec 21, 2023
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 .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- name: Run pycodestyle
shell: bash -l {0}
# We currently only check for some warnings. We should enable & fix more of them.
run: pycodestyle --select=E111,E221,E222,E225,E227,E228,E302,E306,E401,E701,E702,E703,E704,W391,W605,E711,E713,E721 spherogram_src/
run: pycodestyle --select=E111,E221,E222,E225,E227,E228,E306,E401,E701,E702,E703,E704,W391,W605,E711,E713,E721 dev/
run: pycodestyle --select=E111,E221,E222,E225,E227,E228,E302,E305,E306,E401,E701,E702,E703,E704,W391,W605,E711,E713,E721 spherogram_src/
run: pycodestyle --select=E111,E221,E222,E225,E227,E228,E305,E306,E401,E701,E702,E703,E704,W391,W605,E711,E713,E721 dev/
- name: Run cython-lint
shell: bash -l {0}
run: cython-lint .
Expand Down
4 changes: 4 additions & 0 deletions dev/DTcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ def partition_list(L, parts):
# equivalent to interchanging the other pair. So in practice we
# only interchange the North-South pair.


South, East, North, West = 0, 1, 2, 3


class FlippingError(Exception):
pass


class EmbeddingError(Exception):
pass


class DTvertex(tuple):
"""
A vertex of the 4-valent graph which is described by a DT code.
Expand Down
8 changes: 6 additions & 2 deletions dev/dev_malik/fast_jones_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,23 @@ def all_labels(strand_vars):
return strand_labels


def combine_strands(v1,v2, common_label):
def combine_strands(v1, v2, common_label):
labels1 = var_to_strand_labels(v1)
labels2 = var_to_strand_labels(v2)
l1 = labels1[1 - labels1.index(common_label)]
l2 = labels2[1 - labels2.index(common_label)]
l1, l2 = sorted([l1,l2])
return sympy.Symbol('P'+str(l1)+'c'+str(l2))


def remove_squares(monomial):
A, B = sympy.symbols('A,B')
strand_vars = monomial.free_symbols - set([A,B])
for v in strand_vars:
monomial = monomial.subs(v*v,-A**2-(1/A)**2)
return monomial


def remove_loops(monomial):
A, B = sympy.symbols('A,B')
strand_vars = monomial.free_symbols - set([A,B])
Expand All @@ -144,11 +146,13 @@ def remove_loops(monomial):


def var_to_strand_labels(v):
return map(int,str(v)[1:].split('c'))
return map(int, str(v)[1:].split('c'))


def join_strands(v1, v2):
pass


"""
def jones_ring(n):
names_dict = {(i,j):'P'+str(i)+'c'+str(j) for i in range(2*n) for j in range(i,2*n)}
Expand Down
Loading