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

Interface tests #230

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open

Interface tests #230

wants to merge 32 commits into from

Conversation

lorenzoh
Copy link
Member

@lorenzoh lorenzoh commented May 31, 2022

This adds interface tests to various interfaces in FastAI.jl. This allows

  • giving user-friendly error messages by performing checks in high-level functions
  • giving help when implementing an interface, and providing tests for implementations

Examples

Blocks

is_block(block, obs) checks that a piece of data is a valid observation for a Block:

image

When data is not valid, you get detailed information on the reason why:

image

This is extensible for custom Block types. Since tuples of blocks are also valid blocks, we can check them, too:

image

Data containers

is_data(data) checks that data implements MLUtils.jl's data container interface.

image

When that is not the case, precise errors are given indicating which parts are not implemented:

image

is_data(data, block) additionally checks that the observations in the data container are valid for a Block:

image

Status

This depends on Invariants.jl which still needs to be released.

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

Successfully merging this pull request may close these issues.

1 participant