<commit_before>#Dresses a cobra.Model with arrays and vectors so that linear algebra operations
#can be carried out on 
from numpy import array, empty, sign, repeat, vstack, hstack
from numpy import ones, nonzero, zeros
from scipy import sparse
from scipy.sparse import lil_matrix, dok_matrix
from copy import deepcopy
from .Model import Model
from warnings import warn


class ArrayBasedModel(Model):
    """ArrayBasedModel is a class that adds arrays and vectors to
    a cobra.Model to make it easier to perform linear algebra operations.
    
    S : :class:`scipy.sparse.lil_matrix` (in CPython)
        Stoichiometric matrix of the model

    lower_bounds

    upper_bounds

    objective_coefficients

    b

    constraint_sense

    """
    def __setstate__(self, state):
        """Make sure all cobra.Objects in the model point to the model
        
        TODO: Make sure that the genes and metabolites referenced by
        the reactions.(genes|metabolites) point to the model's genes
        and metabolites.
        
        """
        self.__dict__.update(state)
        [[setattr(x, '_model', self)
          for x in self.__dict__[y]]
         for y in ['reactions', 'genes', 'metabolites']]

    def __init__(self, description=None, deepcopy_model=False, matrix_type='scipy.dok_matrix'):
        """
        description: None | String | cobra.Model

        deepcopy_model: Boolean.  If True and description is
        a cobra.Model then make a deepcopy of the Model before
        creating the ArrayBasedModel.

        matrix_type: String. Specifies which type of backend matrix to use for self.S.
        Currently, 'scipy.lil_matrix' or 'scipy.dok_matrix'
        
        """
        if deepcopy_model and isinstance(description, Model):
            description = description.copy()
        Model.__init__(self, description)
        self.S = None<commit_msg>revert arraybasedmodel default to lil<commit_after>#Dresses a cobra.Model with arrays and vectors so that linear algebra operations
#can be carried out on 
from numpy import array, empty, sign, repeat, vstack, hstack
from numpy import ones, nonzero, zeros
from scipy import sparse
from scipy.sparse import lil_matrix, dok_matrix
from copy import deepcopy
from .Model import Model
from warnings import warn


class ArrayBasedModel(Model):
    """ArrayBasedModel is a class that adds arrays and vectors to
    a cobra.Model to make it easier to perform linear algebra operations.
    
    S : :class:`scipy.sparse.lil_matrix` (in CPython)
        Stoichiometric matrix of the model

    lower_bounds

    upper_bounds

    objective_coefficients

    b

    constraint_sense

    """
    def __setstate__(self, state):
        """Make sure all cobra.Objects in the model point to the model
        
        TODO: Make sure that the genes and metabolites referenced by
        the reactions.(genes|metabolites) point to the model's genes
        and metabolites.
        
        """
        self.__dict__.update(state)
        [[setattr(x, '_model', self)
          for x in self.__dict__[y]]
         for y in ['reactions', 'genes', 'metabolites']]

    def __init__(self, description=None, deepcopy_model=False, matrix_type='scipy.lil_matrix'):
        """
        description: None | String | cobra.Model

        deepcopy_model: Boolean.  If True and description is
        a cobra.Model then make a deepcopy of the Model before
        creating the ArrayBasedModel.

        matrix_type: String. Specifies which type of backend matrix to use for self.S.
        Currently, 'scipy.lil_matrix' or 'scipy.dok_matrix'
        
        """
        if deepcopy_model and isinstance(description, Model):
            description = description.copy()
        Model.__init__(self, description)
        self.S = None
{'fraction_non_alphanumeric': 0.06962025316455696, 'fraction_numerical': 0.0, 'mean_word_length': 2.781655034895314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5911262', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1024, 'n_words': 389}