-
Notifications
You must be signed in to change notification settings - Fork 887
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
Fix new ruff
error in linting pipeline
#4327
base: master
Are you sure you want to change the base?
Fix new ruff
error in linting pipeline
#4327
Conversation
…ts are not working correctly
@@ -35,10 +34,6 @@ def main() -> int: | |||
print("Chemical Environment package (ChemEnv)") | |||
print(chemenv_config.package_options_description()) | |||
|
|||
logging.basicConfig( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe pymatgen as a library should not config the root logger?
@@ -2138,11 +2138,11 @@ def test_incar(self): | |||
|
|||
def test_kpoints(self): | |||
kpoints1 = self.lobsterset1.kpoints | |||
assert kpoints1.comment.split()[6], 6138 | |||
assert kpoints1.comment.split()[5] == "6138" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JaGeo perhaps you could help me check this? (not sure if the comment structure change is expected or not)
Looks like this test was not correctly working from the beginning 573642d, with pattern like:
self.assertTrue(kpoints1.comment.split(" ")[6], 6138)
assertTrue(expr, msg=None)
doesn't compare the first arg with the second, it checks whether the first expression is truthy and the second arg is the exception message if not
@@ -220,6 +220,7 @@ ignore = [ | |||
"S603", # Check source for use of "subprocess" call | |||
"S607", # Start process with relative path | |||
"SIM105", # Use contextlib.suppress() instead of try-except-pass | |||
"SIM905", # Split static strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would ignore SIM905 for now as in our case it could avoid unnecessary super long multiline lists
Would go back to this if performance overhead has been a concern at some point
assert slabs[0].energy, 2.0 | ||
assert slabs[1].energy, 6.0 | ||
assert slabs[0].energy == approx(8.0) | ||
assert slabs[1].energy == approx(24.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fyalcin it has been a while and I'm not sure if you could still remember this...But this test might not be working from the start (#2105) for the same reason as in #4327 (comment)
I have to change the value here for now
…x-ruff-2025-March
Summary
ruff
error in linting pipeline