-
Notifications
You must be signed in to change notification settings - Fork 27
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
Applying linting to notebooks #445
Applying linting to notebooks #445
Conversation
Hi @CompRhys, thanks for your PR. I am unsure about the It seems that you are much more experienced with Ruff than me, what do you think of using Ruff also for formatting and get rid of black? https://docs.astral.sh/ruff/formatter/ Would you mind to implement this? Best, Johannes |
Hi all, I am in favor of using a new Ruff-version and also of using About the notebooks, I agree with Johannes that it is good to show the output. |
Okay! sure can update the linting actions to make use of the pre-commit settings such that there's only one place where the ruff version is controlled. I have removed all the obvious |
45a49db
to
83e9662
Compare
@jduerholt @bertiqwerty I have done the above updates and rebased so that we kept the outputs that were there before (I have kept the nbstripout action as is cleans up some user specific metadata but configured it to keep the outputs). Testing on my local branch there are now some tests that are failing, I am looking at these now and will let you know when I have fixed them such that they can be re run here and maybe this can be merged |
- name: Run pre-commit | ||
run: pre-commit run --all-files --show-diff-on-failure | ||
|
||
- name: Pyright |
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.
ideally we could move this inside the pre-commit action but there appear to be issues with getting pyright to work with pre-commit
64cacf0
to
6140bdb
Compare
6d8e313
to
12dc638
Compare
I think the tests that were failing are flaky, here they passed but the same code being tested on my fork failed. |
Yeah, there are some flaky tests, espececially in the DoE module, but @Osburg is currently working on a a refactoring of the whole module which will hopefully also cure the flaky tests ;) Thanks for the PR. @bertiqwerty, I think it makes sense that you also have a look on it as most of the pipelines and checks were implemented by you. |
One think that catched my attention: What do you think of adding a pyright section to |
I think we should keep the type ignores because incompatible override is not very nice and at least we should mark it as such. |
Hmm, but we do it a lot in the data models (to guarantee proper serialization and deserialization using the |
This just means that we have a lot of type violations because a |
Hmm, ok. Then we keep it as it is currently and perhaps fix this in a later PR. |
So when looking at pyright I removed them all and then added all the ones that created issues back and then added a bunch of extra ones where it was now complaining. I wasn't really sure as to why the changes I made created new typinging issues as I only manually changed one bit of logic to cast an dataframe to numpy before calling ravel due to an incoming pandas deprecation. If you guys are happy with this PR as it is I think it would be good to merge and then this pyright stuff and then also changing the tutorials to follow the LogEI best practice can be done in another PR(s) |
I think, that there is a new pyright version, which is flagging more than the old one, that we have used so far .... |
I pinned the version in the action to the version that was in the |
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.
Thanks for this effort @CompRhys . Looks good to me! After @bertiqwerty had a look we can merge it ;) Best, Johannes
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.
Thanks a lot @CompRhys. Looks good to me!
Updates to use a more recent version of ruff from astral rather than the initial action written for early version before astral was formed around ruff. Applies ruff to notebooks inside the repo.
Added nbstripout action to remove unnecessary information from the tutorial notebooks to reduce the diffs that are expected when run by different users