Closed zjgemi closed 3 months ago
dpgen2/exploration/selector/distance_conf_filter.py
126-127: Use a single `if` statement instead of nested `if` statements Combine `if` statements using `and` (SIM102)
dpgen2/exploration/selector/distance_conf_filter.py (5)
`20-118`: **Consider externalizing `safe_dist_dict`.** The `safe_dist_dict` contains hardcoded values. Consider externalizing this data to a configuration file or database to enhance flexibility and maintainability. --- `126-127`: **Combine nested `if` statements.** The nested `if` statements can be combined for better readability. ```diff - if i != j: - if values[i] > multiple * values[j]: + if i != j and values[i] > multiple * values[j]: ```--- `135-218`: **Enhance `DistanceConfFilter` with logging and configuration.** The `DistanceConfFilter` class uses print statements for output. Replace these with logging for better control and integration with logging systems. Additionally, consider externalizing configuration values like `safe_dist_dict`. --- `220-273`: **Replace print statements with logging in `BoxSkewnessConfFilter`.** Replace the print statement with logging to provide better control over the output. ```diff - print("Inclined box") + logger.warning("Inclined box") ``` --- `276-329`: **Replace print statements with logging in `BoxLengthFilter`.** Replace the print statement with logging to provide better control over the output. ```diff - print("One side is %s larger than another" % self.length_ratio) + logger.warning("One side is %s larger than another", self.length_ratio) ```Tools
Ruff
126-127: Use a single `if` statement instead of nested `if` statements Combine `if` statements using `and` (SIM102)
Attention: Patch coverage is 89.74359%
with 12 lines
in your changes missing coverage. Please review.
Project coverage is 83.87%. Comparing base (
c0f83c7
) to head (d386dac
). Report is 19 commits behind head on master.
Files with missing lines | Patch % | Lines |
---|---|---|
dpgen2/entrypoint/submit.py | 50.00% | 6 Missing :warning: |
dpgen2/exploration/render/traj_render_lammps.py | 14.28% | 6 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
Summary by CodeRabbit
New Features
filters
argument for configuration customization in existing functions.Tests