WIP: Discovering: flake8 --max-line-length=80 --ignore=E402,E266, src/*.py (Merci Arthur !)
This commit is contained in:
parent
ea93bd0aad
commit
c796b06451
Binary file not shown.
|
@ -54,16 +54,16 @@ for i in lll:
|
|||
if (i.id == j.parent):
|
||||
i.add_child(j)
|
||||
|
||||
print('\n', "Liste des conditions (node_id, parent_id, nb d'enfants, +/- liste des enfants)", '\n')
|
||||
print('\n', "conditions (node_id, parent_id, nb enfants, liste enfants)", '\n')
|
||||
|
||||
affichage = ''
|
||||
dsp = ''
|
||||
|
||||
for i in lll:
|
||||
affichage = str(i.id) + ' ' + str(i.parent) + ' n=' + str(len(i.ch)) + ' '
|
||||
dsp = str(i.id) + ' ' + str(i.parent) + ' n=' + str(len(i.ch)) + ' '
|
||||
if len(i.ch) > 0:
|
||||
for c in range(0, len(i.ch)):
|
||||
affichage += str(i.ch[c].id) + ', '
|
||||
print(affichage)
|
||||
dsp += str(i.ch[c].id) + ', '
|
||||
print(dsp)
|
||||
|
||||
|
||||
##
|
||||
|
@ -109,11 +109,11 @@ print()
|
|||
|
||||
sp = model.testmodel.get_states().get_space(0)
|
||||
size = model.testmodel.get_parameters().spaceparam.get_dimension().get_x()
|
||||
nb_sites = int(model.testmodel.get_parameters().spaceparam.get_site_multiplicity())
|
||||
sites = int(model.testmodel.get_parameters().spaceparam.get_site_multiplicity())
|
||||
nb_arrows = int(model.testmodel.get_states().get_space(0).get_nb_arrows())
|
||||
|
||||
|
||||
print("space size = ", size, " nb de sites par cellule = ", nb_sites,
|
||||
print("space size = ", size, " nb de sites par cellule = ", sites,
|
||||
" nb total de flèches dans l'espace = ", nb_arrows)
|
||||
|
||||
print(' | ', end=' ')
|
||||
|
@ -129,7 +129,7 @@ print(' | ', end=' ')
|
|||
|
||||
|
||||
for n in range(0, size + 1):
|
||||
for s in range(0, nb_sites):
|
||||
for s in range(0, sites):
|
||||
arr = 0
|
||||
for a in range(0, nb_arrows):
|
||||
if (sp.get_arrow(a).get_coord("x") == n
|
||||
|
@ -142,9 +142,11 @@ for n in range(0, size + 1):
|
|||
|
||||
print(' | ', end=' ')
|
||||
|
||||
print('\n ' + ' ' * nb_sites * 2, end = '')
|
||||
print('\n ' + ' ' * sites * 2, end='')
|
||||
|
||||
|
||||
for k in range(0, size + 1):
|
||||
if k < 9: print(k + 1, end=' '+ ' ' * nb_sites * 2)
|
||||
else: print(k + 1, end=' '+ ' ' * nb_sites * 2)
|
||||
if k < 9:
|
||||
print(k + 1, end=' ' + ' ' * sites * 2)
|
||||
else:
|
||||
print(k + 1, end=' ' + ' ' * sites * 2)
|
||||
|
|
10
src/model.py
10
src/model.py
|
@ -163,6 +163,7 @@ class Axis:
|
|||
def set_size(self, value):
|
||||
pass # TODO (The user can create a complete model from scratch.)
|
||||
|
||||
|
||||
class Dimension:
|
||||
__axis = []
|
||||
|
||||
|
@ -183,6 +184,7 @@ class Dimension:
|
|||
|
||||
# TODO z, u, v, w,...
|
||||
|
||||
|
||||
class Parameters:
|
||||
|
||||
def __init__(self, node):
|
||||
|
@ -293,7 +295,8 @@ class TreeNode(object):
|
|||
self.site = site
|
||||
self.weight = weight
|
||||
|
||||
def id(self): return id
|
||||
def id(self):
|
||||
return id
|
||||
|
||||
def add_child(self, ch_id):
|
||||
self.ch.append(ch_id)
|
||||
|
@ -301,6 +304,7 @@ class TreeNode(object):
|
|||
|
||||
## Conditions
|
||||
|
||||
|
||||
class Condition:
|
||||
def __init__(self, node):
|
||||
self.node = node
|
||||
|
@ -352,6 +356,7 @@ class Conditions:
|
|||
def get_conditions_array(self):
|
||||
return self.__conditions
|
||||
|
||||
|
||||
class Transition:
|
||||
__arrows = []
|
||||
|
||||
|
@ -406,6 +411,7 @@ class Arrow:
|
|||
def set_weight(self, weight):
|
||||
self.node.attrib["weight"] = str(weight)
|
||||
|
||||
|
||||
class Model:
|
||||
|
||||
def __init__(self, modelpath, schemapath):
|
||||
|
@ -468,6 +474,4 @@ testmodel = Model(modelPath, schemaPath)
|
|||
|
||||
# print(testmodel.get_conditions().get_condition(0).get_weight())
|
||||
|
||||
|
||||
|
||||
# TODO weight_max
|
||||
|
|
Loading…
Reference in New Issue