Skip to content

Commit

Permalink
update stats
Browse files Browse the repository at this point in the history
  • Loading branch information
phfaist committed Nov 10, 2022
1 parent 00cb130 commit cded193
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
21 changes: 16 additions & 5 deletions ecczoogen/zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,22 @@ def domain_ids_and_codetypes(self, *list_domain_ids_and_codetypes):

def code_familyhead_ids_and_codetypes(self, *list_code_familyhead_ids_and_codetypes):
thestats = []
for code_id, codetype in list_code_familyhead_ids_and_codetypes:
code = self.zoo.get_code_or_None(code_id)
if code is None:
continue
for code_id_list, codetype in list_code_familyhead_ids_and_codetypes:
family_head_codes = []
for code_id in code_id_list:
code = self.zoo.get_code_or_None(code_id)
if code is None:
continue
family_head_codes.append(code)

collected_code_ids = set()
for family_head_code in family_head_codes:
child_code_list = self.zoo.get_code_family_tree(family_head_code.code_id)
for child_code in child_code_list:
collected_code_ids.add(child_code.code_id)

thestats.append(
( len( self.zoo.get_code_family_tree(code_id) ) - 1, codetype )
(len(collected_code_ids) - len(family_head_codes) , codetype)
)

return thestats
15 changes: 6 additions & 9 deletions templates/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,13 @@
['total_num_codes', ['code entries']],
['total_num_kingdoms', ['kingdoms']],
['total_num_domains', ['domains']],
['domain_ids_and_codetypes', [
['classical_domain', 'classical codes'],
['quantum_domain', 'quantum codes'],
[ None, 'abstract property codes'],
]],
['code_familyhead_ids_and_codetypes', [
['topological', 'topological codes'],
['css', 'CSS codes'],
['qldpc','quantum LDPC codes'],
['oscillators', 'bosonic codes'],
[['ecc', 'classical_into_quantum'], 'classical codes'],
[['quantum_into_quantum'], 'quantum codes'],
[['topological'], 'topological codes'],
[['css'], 'CSS codes'],
[['qldpc'],'quantum LDPC codes'],
[['oscillators'], 'bosonic codes'],
]],
] ) %}

Expand Down

0 comments on commit cded193

Please sign in to comment.