Skip to content

Commit

Permalink
remove functools cache
Browse files Browse the repository at this point in the history
  • Loading branch information
js51 committed Mar 10, 2022
1 parent b5acad3 commit 05d20e0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion cgt/distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import networkx as nx
from sage.all import ComplexDoubleField, UniversalCyclotomicField, matrix, Matrix, real, exp, round, CC
from scipy.optimize import minimize_scalar
from functools import cache

def mles(framework, model, genome_instances):
"""Return maximum likelihood estimates for a set of genome instances under the given model and framework"""
Expand Down
3 changes: 0 additions & 3 deletions cgt/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from sage.all_cmdline import QQ
from .enums import *
from . import rearrangements
from functools import cache

class Model:
"""Defines a model. A model consists of some collection of permutations and a map from these permutations to probabilities [0,1]"""
Expand Down Expand Up @@ -54,12 +53,10 @@ def named_model_with_relative_probs(cls, framework, named_model_dictionary):
model.names += list(named_model_dictionary.keys())
return model

@cache
def reg_rep_of_zs(self):
"""Return the regular representation of zs as comptued by PositionParadigmFramework.reg_rep_zs, but store the sparse result"""
return self.framework.reg_rep_of_zs(self, sparse=True)

@cache
def s_element(self, in_algebra=ALGEBRA.genome):
if in_algebra not in {ALGEBRA.group, ALGEBRA.genome}:
raise NotImplementedError(f"Model element for {str(in_algebra)} algebra not yet implemented")
Expand Down
5 changes: 0 additions & 5 deletions cgt/position_paradigm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from .structures import HyperoctahedralGroup
from scipy.sparse import dok_matrix as dok
from random import choice
from functools import cache

class PositionParadigmFramework:
"""Everything you need for working with genomes under the position paradigm"""
Expand Down Expand Up @@ -86,7 +85,6 @@ def one_row(self, element, as_list=False):
row = Permutations(self.n)(row)
return row

@cache
def genome_group(self):
"""Return the permutation group containing genome instances."""
if self.oriented:
Expand Down Expand Up @@ -125,7 +123,6 @@ def random_genome(self, format=FORMAT.formal_sum):
"""Return a random genome"""
return self.genome(self.random_instance(), format=format)

@cache
def symmetry_group(self):
"""Return the symmetry group of the genomes."""
if self.symmetry == SYMMETRY.circular:
Expand All @@ -136,7 +133,6 @@ def symmetry_group(self):
gens = [self.genome_group().one()]
return self.genome_group().subgroup(gens)

@cache
def group_algebra(self):
"""Return the group alegbra, where the group is the group containing genome instances."""
return self.genome_group().algebra(QQ)
Expand Down Expand Up @@ -342,7 +338,6 @@ def irreps(self, element=None):
else:
return representations

@cache
def _cached_irreps(self):
representations = []
def irrep_function_factory(irrep, signed):
Expand Down

0 comments on commit 05d20e0

Please sign in to comment.