Skip to content

Enable linting with ruff#60

Merged
Wrzlprmft merged 10 commits intoneurophysik:masterfrom
alexfikl:ruff
Jan 30, 2025
Merged

Enable linting with ruff#60
Wrzlprmft merged 10 commits intoneurophysik:masterfrom
alexfikl:ruff

Conversation

@alexfikl
Copy link
Copy Markdown
Contributor

Adds linting with ruff and fixes all the issues.

xref: neurophysik/CHSPy#8

@alexfikl
Copy link
Copy Markdown
Contributor Author

Hm, haven't managed to reproduce the failures locally neither with Python 3.12 or 3.13 with gcc or clang yet, so not quite sure what it doesn't like.

The only "functional" changes in here should be moving from np.random.random to np.random.Generator, so maybe it's just a random number issue.. Will have to look into it a bit more later.

@Wrzlprmft
Copy link
Copy Markdown
Contributor

I re-ran the tests and it worked. This is a problem with tests using random numbers but no seeds, which is a bad idea for CI. For PyTest there is a module which does this very nicely, but I think for the current test structure, we need to set seeds manually. This definitely needs fixing, but it’s not related to this pull request.

@Wrzlprmft Wrzlprmft marked this pull request as ready for review January 30, 2025 07:16
@Wrzlprmft Wrzlprmft merged commit e38ab3a into neurophysik:master Jan 30, 2025
@alexfikl alexfikl deleted the ruff branch January 30, 2025 08:00
@alexfikl
Copy link
Copy Markdown
Contributor Author

I re-ran the tests and it worked. This is a problem with tests using random numbers but no seeds, which is a bad idea for CI. For PyTest there is a module which does this very nicely, but I think for the current test structure, we need to set seeds manually. This definitely needs fixing, but it’s not related to this pull request.

Yeah, agreed. I'll go ahead and make a little PR setting the seeds later today. Thanks for checking!

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.

2 participants