Raise an error if someone tries to run code from metatomic_torch.documentation#182
Open
Luthaf wants to merge 1 commit intometatensor:mainfrom
Open
Raise an error if someone tries to run code from metatomic_torch.documentation#182Luthaf wants to merge 1 commit intometatensor:mainfrom
Luthaf wants to merge 1 commit intometatensor:mainfrom
Conversation
…mentation Typically this only happens in sphinx-gallery, when trying to re-execute an example that failed with the actual code, so we also point the user to that
pfebrer
reviewed
Mar 19, 2026
| THIS_CODE_SHOULD_NOT_RUN = RuntimeError( | ||
| "you are using the documentation-only version of this class, " | ||
| "this is usually sign of an earlier problem when running examples" | ||
| ) |
There was a problem hiding this comment.
I think the second sentence is not necessary, or at least we could say:
"If this error is happening when running examples..."
Contributor
There was a problem hiding this comment.
Hmm I thoght I also left a comment. Seems not. I was thinking if we should inform people they should maybe reinstall something... Otherwise it feels like more an "something went wrong" error message.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Typically this only happens in sphinx-gallery, when trying to re-execute an example that failed with the actual code, so we also point the user to that.
This is the same as metatensor/metatensor#1074, and would have helped find the issue in metatensor/metatrain#1077 a lot earlier.
Contributor (creator of pull-request) checklist
Tests updated (for new features and bugfixes)?Issue referenced (for PRs that solve an issue)?Reviewer checklist
CHANGELOG updated with public API or any other important changes?