HumanBrainProject / hbp-validation-client

A Python package for working with the Human Brain Project Model Validation Framework
http://hbp-validation-client.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

Update method `get_attribute_options()` #3

Closed appukuttan-shailesh closed 5 years ago

appukuttan-shailesh commented 6 years ago

The method get_attribute_options() would need to be updated once the following is completed: https://github.com/joffreygonin/hbp-validation-framework_dev/issues/140

Format of data retrieved would be changed from:

{u'cell_type': [u'Granule Cell', u'Interneuron', u'Other', u'Pyramidal Cell'], u'species': [u'Human (Homo sapiens)', u'Marmoset (callithrix jacchus)', u'Mouse (Mus musculus)', u'Opossum (Monodelphis domestica)', u'Other', u'Paxinos Rhesus Monkey (Macaca mulatta)', u'Rat (Rattus rattus)'], u'test_type': [u'behaviour', u'network activity', u'network structure', u'single cell activity', u'subcellular'], u'score_type': [u'Other', u'Rsquare', u'Zscore', u'number', u'p-value', u'purcentage'], u'brain_region': [u'Basal Ganglia', u'Cerebellum', u'Cortex', u'Hippocampus', u'Other'], u'model_type': [u'Mean Field', u'Network', u'Other', u'Single Cell'], u'organization': [u'<<empty>>', u'Blue Brain Project', u'HBP-SP1', u'HBP-SP10', u'HBP-SP11', u'HBP-SP12', u'HBP-SP2', u'HBP-SP3', u'HBP-SP4', u'HBP-SP5', u'HBP-SP6', u'HBP-SP7', u'HBP-SP8', u'HBP-SP9', u'KOKI-UNIC', u'KTH-UNIC', u'Other'], u'data_modalities': [u'2-photon imaging', u'electron microscopy', u'electrophysiology', u'fMRI', u'histology']}

to

{u'cell_type': [{u'id': u'ba4afd08-ec2e-478d-bd93-ca236cc40636', u'authorized_value': u'Granule Cell'}, {u'id': u'3050e0df-d680-495a-a5fd-5f34bf955108', u'authorized_value': u'Interneuron'}, {u'id': u'6735539d-bcbc-4bc0-92a0-859aad77d055', u'authorized_value': u'Pyramidal Cell'}, {u'id': u'6111b903-ce0e-471a-978b-1e816f8c80b5', u'authorized_value': u'Other'}], u'species': [{u'id': u'66a8eea5-902f-49d5-9d98-f84787b3dd48', u'authorized_value': u'Mouse (Mus musculus)'}, {u'id': u'd9763e73-916a-4137-bbdc-efebe76378d4', u'authorized_value': ......

Currently, we set the URL as:

url = self.url + "/authorizedcollabparameterrest/?python_client=true&parameters="+param+"&format=json"

In future, there won't be any python_client differentiation and this parameter would be absent.

appukuttan-shailesh commented 5 years ago

With move to KnowledgeGraph, this is redundant now.