Add experiment class (Sourcery refactored)#62
Add experiment class (Sourcery refactored)#62sourcery-ai[bot] wants to merge 1 commit intoadd-experiment-classfrom
Conversation
| if y is None: | ||
| pass | ||
| else: | ||
| if y is not None: |
There was a problem hiding this comment.
Function Labeller._annotation_iterator refactored with the following changes:
- Swap if/else to remove empty if body (
remove-pass-body)
| message = ( | ||
| "<h1>{}".format(message) | ||
| + '<i class="fa fa-spinner fa-spin"' | ||
| + ' aria-hidden="true"></i>' | ||
| ) | ||
| processing_display = widgets.HTML(value=message) | ||
| with self.feature_output: | ||
| message = ( | ||
| "<h1>{}".format(message) | ||
| + '<i class="fa fa-spinner fa-spin"' | ||
| + ' aria-hidden="true"></i>' | ||
| ) | ||
| processing_display = widgets.HTML(value=message) |
There was a problem hiding this comment.
Function Labeller._render_processing refactored with the following changes:
- Move assignments closer to their usage (
move-assign)
| margin = ( | ||
| return ( | ||
| np.sort(probabilities, axis=1)[:, -1] | ||
| - np.sort(probabilities, axis=1)[:, -2] | ||
| ) | ||
| return margin |
There was a problem hiding this comment.
Function margin refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| certainty = probabilities.max(axis=-1) | ||
| return certainty | ||
| return probabilities.max(axis=-1) |
There was a problem hiding this comment.
Function certainty refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
Sourcery Code Quality ReportThis PR has an average code quality of 84.42%
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Let us know what you think of it by mentioning @sourcery-ai in a comment. |
Pull Request #61 refactored by Sourcery.
If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
add-experiment-classbranch, then run: