Open dr3y opened 4 years ago
Something like this would do it:
class ChemicalReactionNetwork(object):
@species.setter
def species(new_species: List[Species]=None, type=None):
if new_species:
self._species += new_species
elif type:
return Species._filter_by_type(self._species,type=type)
else:
pass
But the one above looks messy, now that I'm writing it out. Probably CRN.get_species would be better since we want to filter by type and etc
class ChemicalReactionNetwork(object):
def get_species(type=None) -> List[Species]:
if type:
return Species._filter_by_type(self.species,type=type)
else:
return self.species
it would be nice if species in a CRN (and reactions!?) were in a dataframe format so you could pull out certain species for example CRN.species(type="rna") = [rna_myrna1,rna_myrna2]