class PhasePlaneMessage(Message): objective_upper_bound = repeated( Float32(description='Upper bound for theoretical yield objective')) objective_lower_bound = repeated( Float32(description='Lower bound for theoretical yield objective')) objective = repeated(Float32(description='Theoretical objective values')) objective_id = String(description='Objective reaction ID')
class QueryResponse(Message): class Meta: description = 'Information about pets' ids = repeated(Field(Pet, description='Bunch of pets')) pet = Field(Pet, description='The other pet') repeat = repeated(String(description='Bunch of strings'))
class ModelRequestMessage(Message): sample_ids = repeated(Int(description='Sample IDs')) model_id = String(description='Model ID (f.e. iJO1366)') phase_id = Int(description='Phase ID') map = String(description='Name of map to show') method = String(description='Simulation method to run') with_fluxes = Bool(description='Add flux information to the response') objective = String(description='Reaction ID to be set as objective')
def test_message_type_hints(self): class Pet(Message): sounds: List[str] size: float speed: int age: int self.assertIsInstance(Pet.__fields__, OrderedDict) self.assertEqual(('sounds', 'size', 'speed', 'age'), tuple(Pet.__fields__.keys())) self.assertEqual( { 'sounds': repeated(String(), name='sounds'), 'size': Field(float, name='size'), 'speed': Field(int, name='speed'), 'age': Field(int, name='age') }, Pet.__fields__)
class MeasurementMessage(Message): type = String( description= 'The subject of the measurement, e.g. "compound", "protein" or "reaction"' ) id = Int( description= 'identifier associated with the measured subject, e.g. metabolite identifier' ) name = String(description='In case of metabolite, human-readable name') db_name = String( description= 'In case of xref data, the miriam name of the database, e.g. uniprot') mode = String( description='Quantification mode, e.g. "relative" or "quantitative"') measurements = repeated( Float32(description='Measurements taken during the experiment')) units = MapField(str, description='Units in which measurements are taken') rate = String(description='Rate')
class PhasesMessage(Message): response = repeated(PhaseMessage)
class Pet(Message): sounds = repeated(String())
class IntegerList(Message): values = repeated(Integer())
class M(dict): items = repeated(Field(str))
class SampleMessage(Message): id = repeated(Int(description='Sample IDs')) name = String(description='Sample name') organism = String(description='Organism short code')
class SampleInfoMessage(Message): genotype_changes = repeated( String(description='Gnomic strings for genotype changes')) measurements = repeated(MeasurementMessage) medium = repeated(MetaboliteMediumMessage)
class SampleModelsMessage(Message): response = repeated(String(description='Possible models for the sample'))
class StringList(Message): values = repeated(String())
class SamplesMessage(Message): response = repeated(SampleMessage)
class ExperimentsMessage(Message): response = repeated(ExperimentMessage)
class MaximumYieldMessage(Message): growth_rate = repeated( Float32(description='Growth rates collected from the experiment')) metabolites = MapField( MetabolitePhasePlaneMessage, description='Data for the metabolites collected from the experiment')
class MetabolitePhasePlaneMessage(Message): flux = repeated( Float32(description= 'Measurement for the metabolite collected from experiment')) phase_planes: PhasePlanesMessage