Skip to content
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

174 pylint alerts corrections #181

Merged

Conversation

evidencebp
Copy link
Contributor

This PR takes care of issue "Pylint alerts corrections as part of intervention experiment" #174.

Each commit takes care of a single Pylint alert in a single file.
See the executed interventions.
The commit message explain the intervention and its justification (e.g., when narrowing an exception).

Most interventions are minor.
The larger ones are due to too-many-branches or too-many-statements.
In these cases I extracted methods, making the code shorter, easier to understand and modify.

When going over the PR please note:

  • I noticed some misalignments to black in the existing code. Since it was that way and I wanted to make small and focused interventions, I did not fix them.
  • I'm not familiar with the project logic. All interventions are small refactors that should keep the same logic. However, please consider my infamilarity.
  • I do not have the needed API keys. Hence, when running the code after the modification the flow did not reach the main path. I run the modified parts externally.
  • The conda installation I used did not install fastchat, used in eval\evaluation_prometheus.py . I tried to install it separately yet it did not work. Hence I could not run this file. However the intervention there was replacing Exception in ValueError, more focused. However, no other exception is expected there so this refactor should be safe.

Please tell me if there are unclear points or some other needed aspects.

Just adding a new line is not compatible with black.
https://github.com/psf/black

Instead extracted styles as a variable, similar to pages.
Using the black playground I noted the few more changes are needed.
I did not apply them to keep this modification focused.
Found unrelated black-style alerts.
I did not apply them to keep the change focused.
Noted black style alert not related to the change.
I did not apply them to keep the change focused.
Method was too long,
Extracted methods having a single responsibility, making the code easier to understand and shorter.

There a black style alerts in the file.
I din not fix them to keep the change focused.
@shaoyijia
Copy link
Collaborator

Hi @evidencebp, we recently have a very large update of our repo. Is it possible for you to rerun your algorithm to gets the edit and open a new PR?

@evidencebp
Copy link
Contributor Author

Indeed a large update.
I merged the main into this branch.
Now there are only 3 files with interventions.
At list it makes the review easier...

Can you approve and merge now?

Copy link
Collaborator

@shaoyijia shaoyijia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope this helps your research!

@shaoyijia shaoyijia merged commit 28ad542 into stanford-oval:main Sep 27, 2024
@evidencebp
Copy link
Contributor Author

Sure it will help!

In case that you would like to intervene yourself in other projects or have ideas for such, please tell me.
Of course, if you know others that might be interested, let them know too.

feldges pushed a commit to feldges/storm that referenced this pull request Dec 4, 2024
…s-corrections

174 pylint alerts corrections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants