DiamondLightSource / httomo

High-throughput tomography pipeline
https://diamondlightsource.github.io/httomo/
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

Replace unnecessary list of dicts in methods database entries #357

Open yousefmoazzam opened 1 month ago

yousefmoazzam commented 1 month ago

An example of the current structure of a methods database entry is the following: https://github.com/DiamondLightSource/httomo/blob/4429711ab89ed1efe86d9c3be260df25fc7f1999/httomo/methods_database/packages/external/httomolibgpu/httomolibgpu.yaml#L3-L11

Focusing on the memory_gpu field: https://github.com/DiamondLightSource/httomo/blob/4429711ab89ed1efe86d9c3be260df25fc7f1999/httomo/methods_database/packages/external/httomolibgpu/httomolibgpu.yaml#L8-L11

its values will get parsed into the following data structure in python:

[
  {"datasets": ["tomo"]},
  {"multipliers": [2.1]},
  {"methods": ["direct"]},
]

A naive guess would be that it's likely not needed to have a list of dicts, and one single dict like so would suffice:

{
  "datasets": ["tomo"],
  "multipliers": [2.1],
  "methods": ["direct"]
}

If so, the YAML structure could be modified to be the following (note the missing leading - for each subfield within memory_gpu):

memory_gpu: 
  datasets: ["tomo"]
  multipliers: [2.1]
  methods: ["direct"]