[FEA] `raft-ann-bench` should validate configurations
Nobody has claimed this yet.
- Dominant language
- Cuda
- Stars
- 1k
- Forks
- 251
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 31
Description
Is your feature request related to a problem? Please describe.
Currently, the data models for the configuration yaml files are not validated. Directly referencing dict by key isn't safe. For example, in the following code snippet, a typo like constraint instead of constraints in the yaml file could lead to the constraints being ignored silently.
def add_algo_group(group_list):
if algo["name"] not in algos_conf:
algos_conf[algo["name"]] = {"groups": {}}
for group in algo["groups"].keys():
if group in group_list:
algos_conf[algo["name"]]["groups"][group] = algo[
"groups"
][group]
if "constraints" in algo:
algos_conf[algo["name"]]["constraints"] = algo[
"constraints"
]
Describe the solution you'd like
Use Pydantic to define and validate the data model for the configuration files.
Describe alternatives you've considered
dataclasses.dataclass would work as well.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in python/raft-ann-bench/src/raft-ann-bench/run/main.py at the configuration handling around lines 485-496, then trace the YAML data consumed there. Define validation models using Pydantic for the configuration structures and replace unsafe dictionary access; done means configuration typos such as constraint are reported instead of silently ignored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100