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

implement "all or each" approach in values #3

Open
rlanzafame opened this issue Dec 19, 2024 · 0 comments
Open

implement "all or each" approach in values #3

rlanzafame opened this issue Dec 19, 2024 · 0 comments

Comments

@rlanzafame
Copy link
Member

as many values can be checked using exercise type values, we should allow for flexible (and selective) testing of each value individually. Consider that the following "things" can be defined for each value to be checked:

  • type
  • tolerance
  • tolerance_type
  • custom messages, hints, etc

in the current implementation, each of these things are added to the dict as a single value, but could also be specified as a list with same length as values. For example, the following would provide a different absolute tolerance and type for each value in values:

exercise = {
    "type": "values",
    "tolerance": [0.01, 0.1],
    "tolerance_type": ["relative", "absolute"],
    "variables": ['multiplication', 'addition'],
    "values": [13.889, 7.53],
    "types":["float", ["float", "numpy"]]
}

Note the list of lists for the types key, allowing values[1] to have 2 types.

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

No branches or pull requests

1 participant