Skip to content

Commit 4059368

Browse files
committed
fix details in graphs (indentation)
1 parent 617db3c commit 4059368

File tree

1 file changed

+33
-34
lines changed

1 file changed

+33
-34
lines changed

src/sage/graphs/graph_database.py

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def degseq_to_data(degree_sequence):
7373
3221
7474
"""
7575
degree_sequence.sort()
76-
return sum(degree_sequence[i]*10**i for i in range(len(degree_sequence)))
76+
return sum(di * 10**i for i, di in enumerate(degree_sequence))
7777

7878

7979
def data_to_degseq(data, graph6=None):
@@ -101,9 +101,8 @@ def data_to_degseq(data, graph6=None):
101101
if not degseq:
102102
# compute number of 0's in list from graph6 string
103103
from sage.graphs.generic_graph_pyx import length_and_string_from_graph6
104-
return length_and_string_from_graph6(str(graph6))[0]*[0]
105-
else:
106-
return degseq
104+
return length_and_string_from_graph6(str(graph6))[0] * [0]
105+
return degseq
107106

108107

109108
def graph6_to_plot(graph6):
@@ -181,43 +180,43 @@ def subgraphs_to_query(subgraphs, db):
181180
# tables columns input data type sqlite data type
182181
# -----------------------------------------------------------------------------
183182
aut_grp = ['aut_grp_size', # Integer INTEGER
184-
'num_orbits', # Integer INTEGER
185-
'num_fixed_points', # Integer INTEGER
186-
'vertex_transitive', # bool BOOLEAN
187-
'edge_transitive'] # bool BOOLEAN
183+
'num_orbits', # Integer INTEGER
184+
'num_fixed_points', # Integer INTEGER
185+
'vertex_transitive', # bool BOOLEAN
186+
'edge_transitive'] # bool BOOLEAN
188187
degrees = ['degree_sequence', # list INTEGER (see degseq_to_data module function)
189-
'min_degree', # Integer INTEGER
190-
'max_degree', # Integer INTEGER
191-
'average_degree', # Real REAL
192-
'degrees_sd', # Real REAL
193-
'regular'] # bool BOOLEAN
188+
'min_degree', # Integer INTEGER
189+
'max_degree', # Integer INTEGER
190+
'average_degree', # Real REAL
191+
'degrees_sd', # Real REAL
192+
'regular'] # bool BOOLEAN
194193
misc = ['vertex_connectivity', # Integer INTEGER
195-
'edge_connectivity', # Integer INTEGER
196-
'num_components', # Integer INTEGER
197-
'girth', # Integer INTEGER
198-
'radius', # Integer INTEGER
199-
'diameter', # Integer INTEGER
200-
'clique_number', # Integer INTEGER
201-
'independence_number', # Integer INTEGER
202-
'num_cut_vertices', # Integer INTEGER
203-
'min_vertex_cover_size', # Integer INTEGER
204-
'num_spanning_trees', # Integer INTEGER
205-
'induced_subgraphs'] # String STRING
194+
'edge_connectivity', # Integer INTEGER
195+
'num_components', # Integer INTEGER
196+
'girth', # Integer INTEGER
197+
'radius', # Integer INTEGER
198+
'diameter', # Integer INTEGER
199+
'clique_number', # Integer INTEGER
200+
'independence_number', # Integer INTEGER
201+
'num_cut_vertices', # Integer INTEGER
202+
'min_vertex_cover_size', # Integer INTEGER
203+
'num_spanning_trees', # Integer INTEGER
204+
'induced_subgraphs'] # String STRING
206205
spectrum = ['spectrum', # String STRING
207206
'min_eigenvalue', # Real REAL
208207
'max_eigenvalue', # Real REAL
209208
'eigenvalues_sd', # Real REAL
210209
'energy'] # Real REAL
211-
graph_data=['complement_graph6', # String STRING
212-
'eulerian', # bool BOOLEAN
213-
'graph6', # String STRING
214-
'lovasz_number', # Real REAL
215-
'num_cycles', # Integer INTEGER
216-
'num_edges', # Integer INTEGER
217-
'num_hamiltonian_cycles', # Integer INTEGER
218-
'num_vertices', # Integer INTEGER
219-
'perfect', # bool BOOLEAN
220-
'planar'] # bool BOOLEAN
210+
graph_data = ['complement_graph6', # String STRING
211+
'eulerian', # bool BOOLEAN
212+
'graph6', # String STRING
213+
'lovasz_number', # Real REAL
214+
'num_cycles', # Integer INTEGER
215+
'num_edges', # Integer INTEGER
216+
'num_hamiltonian_cycles', # Integer INTEGER
217+
'num_vertices', # Integer INTEGER
218+
'perfect', # bool BOOLEAN
219+
'planar'] # bool BOOLEAN
221220

222221
valid_kwds = aut_grp + degrees + misc + spectrum + graph_data
223222

0 commit comments

Comments
 (0)