🗑️ [TEST-PR] Wip/projects against d2b297 (Sourcery refactored)#830
🗑️ [TEST-PR] Wip/projects against d2b297 (Sourcery refactored)#830sourcery-ai[bot] wants to merge 2 commits intowip/projects_against_d2b297from
Conversation
glotaran/model/model.py
Outdated
| model_dict = {} | ||
| model_dict["default-megacomplex"] = self.default_megacomplex | ||
|
|
||
| model_dict = {'default-megacomplex': self.default_megacomplex} |
There was a problem hiding this comment.
Function Model.as_dict refactored with the following changes:
- Merge dictionary assignment with declaration (
merge-dict-assign)
| self.folder = self.file.parent | ||
| if isinstance(self.folder, str): | ||
| self.folder = Path(self.folder) | ||
| pass |
There was a problem hiding this comment.
Function Project.__post_init__ refactored with the following changes:
- Remove redundant pass statement (
remove-redundant-pass)
| name = name if name else project_folder.name | ||
| name = name or project_folder.name |
There was a problem hiding this comment.
Function Project.create refactored with the following changes:
- Simplify if expression by using or (
or-if-exp-identity)
| if isinstance(parameters, dict) and len(parameters) != 0: | ||
| raise ModelError( | ||
| "The root parameter group cannot contain both groups and parameters." | ||
| ) | ||
| elif isinstance(parameters, dict): | ||
| parameters = [] | ||
| if isinstance(parameters, dict): | ||
| if len(parameters) != 0: | ||
| raise ModelError( | ||
| "The root parameter group cannot contain both groups and parameters." | ||
| ) | ||
| else: | ||
| parameters = [] |
There was a problem hiding this comment.
Function Project.generate_parameters refactored with the following changes:
- Lift repeated conditional into its own if statement (
lift-duplicated-conditional)
|
|
||
| new_scheme = replace(self.scheme, parameters=self.optimized_parameters) | ||
| return new_scheme | ||
| return replace(self.scheme, parameters=self.optimized_parameters) |
There was a problem hiding this comment.
Function Result.get_scheme refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
for more information, see https://pre-commit.ci
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.02%.
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! Help us improve this quality report! |
|
Sourcery stop targeting draft PRs! |
|
SonarCloud Quality Gate failed.
|
|
This pull request fixes 1 alert when merging 2b73bc4 into 477e550 - view on LGTM.com fixed alerts:
|
|
Benchmark is done. Checkout the benchmark result page. Benchmark diffParametrized benchmark signatures: BenchmarkOptimize.time_optimize(index_dependent, grouped, weight) |









Pull Request #829 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
wip/projects_against_d2b297branch, then run:Help us improve this pull request!