GSTT-CSC / hazen-web-app

Interactive web-based implementation of hazen
Other
0 stars 0 forks source link

Can't view slice_position results #74

Closed laurencejackson closed 2 years ago

laurencejackson commented 2 years ago

slice position can't render results due to attempting to treat list as a dict:

jinja2.exceptions.UndefinedError: 'list object' has no attribute 'items'****

Example output of the dictionary written to the results db:

results: dict = {'result_name' : [measured_slice_positions]}

{"SlicePosition_Slice_Position_TRA_30_13": ["0.747", "0.498", "0.622", "0.581", "0.414", "0.615", "0.498", "0.326", "0.248", "0.359", "0.387", "0.249", "0.449", "0.332", "0.249", "0.413", "0.332", "0.0821", "0", "0.208", "0.000229", "0.0834", "0.000457", "0.0279", "0.139", "0.223", "0.100", "0.0159", "0.166", "0.000644", "0.0319", "0.0983", "0.137", "0.0265", "0.0263", "0.0816", "0.0482", "0.165", "0.248", "0.226"]}

sophie22 commented 2 years ago

I would raise this as a Hazenlib issue to standardise output structure. Always output a nested dictionary of {filename/Series_desc:{measurement1:value1, measurement2:value2}}. The output of slice_position could look like: {"SlicePosition_Slice_Position_TRA_30_13": {"position 1":"0.747", "position 2": "0.498", "position 3": "0.622", etc}} essentially turn the list into key:value pairs.

heyhaleema commented 2 years ago

Closed by #78.