Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Suggestion: Consider more granular arguments than ZenoOptions #730

Open
neubig opened this issue Apr 22, 2023 · 2 comments
Open

Suggestion: Consider more granular arguments than ZenoOptions #730

neubig opened this issue Apr 22, 2023 · 2 comments

Comments

@neubig
Copy link
Contributor

neubig commented Apr 22, 2023

Currently many functions in Zeno pass in a ZenoOptions, such as distill functions and metrics. This has the advantage of conciseness in the function definition.

However, there are also disadvantages in that it can be unclear which parts of the ZenoOptions object are necessary and sufficient for the processing in any individual function. For instance, in distill functions, it is most likely that only data_column, label_column, and output_column are necessary, but in order to call the function it is still necessary to create a ZenoOptions object and set its various parameters (such as model_path, which is irrelevant). It might be a good idea to consider modifying the API a bit to explicitly pass in only the necessary arguments.

@cabreraalex
Copy link
Member

Would it be sufficient to give them all None defaults so you can instantiate the ZenoOptions object with just the fields that you need?

@neubig
Copy link
Contributor Author

neubig commented Apr 22, 2023

That's OK, but it doesn't entirely solve the problem, as it doesn't make clear which arguments are actually required when using any of the functions. For instance, when calling a metric you could set data_column, label_column, and output_column as None, despite the fact that they are necessary. Sure, these things could be caught at runtime, but runtime errors take more developer time than those that can be caught by static analysis, so in general making the requirements explicit in the programming interface can be better.

Anyway, this is just a suggestion to consider!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants