Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace unnecessary list of dicts in methods database entries #357

Open
Tracked by #358
yousefmoazzam opened this issue May 31, 2024 · 0 comments
Open
Tracked by #358

Replace unnecessary list of dicts in methods database entries #357

yousefmoazzam opened this issue May 31, 2024 · 0 comments
Labels
minor Nice to do but not vital

Comments

@yousefmoazzam
Copy link
Collaborator

An example of the current structure of a methods database entry is the following:

median_filter:
pattern: all
output_dims_change: False
implementation: gpu_cupy
save_result_default: False
memory_gpu:
- datasets: [tomo]
- multipliers: [2.1]
- methods: [direct]

Focusing on the memory_gpu field:

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

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"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Nice to do but not vital
Projects
None yet
Development

No branches or pull requests

1 participant