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

how-to: avoid putting artifacts in your repo for testing purposes (and why) #28

Open
gregcaporaso opened this issue Mar 6, 2024 · 1 comment
Labels
content addition Planned new content. how-to Related to a *How-to guide*. plugins Related to the *Plugins* part.

Comments

@gregcaporaso
Copy link
Member

gregcaporaso commented Mar 6, 2024

  • use transform_format (q2-sapienns has a good example)
  • to know the to and from values to provide as input
    • export the artifact that you would have used in your test using qiime tools export. the format that is reported on the command line should be used as to (alternatively you can find this using qiime tools peek- it's the Data format that is reported)
    • the view type that your function takes as input (or which you would have passed as view_type to Artifact.load("...").view(view_type)) should be provided as from
  • generally this is a good way to go as:
    • it makes for easier test developing and debugging since you can see the test data more easily, and
    • generally speaking (though not in all cases - e.g., if the underlying format is binary) building your tests on data files (or objects) makes for more informative diffs if/when the test data changes across commits.
@gregcaporaso
Copy link
Member Author

gregcaporaso commented Mar 6, 2024

Pending qiime2/qiime2#757, these instructions would have to use qiime2.plugin.util.transform instead of TestPluginBase.transform_format. (The q2-sapienns example works b/c the transformer being used is defined in q2-sapienns.)

@gregcaporaso gregcaporaso added content addition Planned new content. plugins Related to the *Plugins* part. how-to Related to a *How-to guide*. labels Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content addition Planned new content. how-to Related to a *How-to guide*. plugins Related to the *Plugins* part.
Projects
None yet
Development

No branches or pull requests

1 participant