-
Notifications
You must be signed in to change notification settings - Fork 23
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
[ENH] add utility function to compute expected value #74
base: main
Are you sure you want to change the base?
Conversation
@bclenet however I am not sure where to put such function in the code base and on the best way to document it to make it easy to find for new contributors: any preference? same there are some default hard coded values in that function: some teams may have used different values, so it may be useful to pass those as arguments. would not mind to have the take of some of the original authors of the NARPS paper for the default values of the computation of the expected value. |
Hi @Remi-Gau, thanks for the idea ! About where to put the code, I think the @staticmethod
@mark.unit_test on top of it. About the documentation, you could write a paragraph in What do you think ? |
will do all of this. 🚀 |
Made the changes mentioned in #74 (comment) Tried to enforce PEP8 by using flake8 but I am getting a lot or errors not due to the code I changed: it may be a good thing to have some way to enforce this a bit more. |
Hi and thanks for the changes, About PEP8, what kind of errors do you get ? On which file(s) ? |
On the things in this PR: $ flake8 narps_open/utils/__init__.py narps_open/utils/utils.py tests/utils/test_utils.py
narps_open/utils/__init__.py:9:1: F401 'os.path.splitext' imported but unused
narps_open/utils/__init__.py:30:22: E231 missing whitespace after ','
narps_open/utils/__init__.py:30:26: E231 missing whitespace after ','
narps_open/utils/__init__.py:30:30: E231 missing whitespace after ','
narps_open/utils/__init__.py:30:34: E231 missing whitespace after ','
narps_open/utils/__init__.py:30:38: E231 missing whitespace after ','
narps_open/utils/__init__.py:30:42: E231 missing whitespace after ','
narps_open/utils/__init__.py:30:46: E231 missing whitespace after ','
narps_open/utils/__init__.py:31:42: E228 missing whitespace around modulo operator
narps_open/utils/__init__.py:36:1: E302 expected 2 blank lines, found 1
narps_open/utils/__init__.py:56:1: E302 expected 2 blank lines, found 1
narps_open/utils/__init__.py:70:56: E251 unexpected spaces around keyword / parameter equals
narps_open/utils/__init__.py:70:58: E251 unexpected spaces around keyword / parameter equals
narps_open/utils/__init__.py:74:1: E302 expected 2 blank lines, found 1
narps_open/utils/__init__.py:87:1: E302 expected 2 blank lines, found 1
narps_open/utils/__init__.py:129:1: E302 expected 2 blank lines, found 1
narps_open/utils/__init__.py:168:1: E302 expected 2 blank lines, found 1
narps_open/utils/__init__.py:243:18: W292 no newline at end of file But running flake8 on main on the narps_open and tests gives lot of errors:
See this CI workflow on my main branch: https://github.com/Remi-Gau/narps_open_pipelines/actions/runs/6276436375/job/17046113029#step:5:1 |
The pep8 should be a separate issue, no? We are getting side tracked. |
Yep, I'll start a new issue about the PEP8 errors you mention, and PEP8 management/guidelines/doc in general.
|
Awesome! You rock!! 👍🏾 Two quick things about that (to keep track of my thoughts until then) :
yeah I am not familiar with pylint but happy to only use pylint as long as there is a config file for it in the repo. somehow I am not surprised that they do not report exactly the same errors, I suspect that if we ran ruff, we may even find some other errors...
ha yeah good point: adding a config to ignore them until refactored could be an approach |
turning to draft and will probably close as "premature optimization" (preventing "don't repeat yourself" situations too early) @bclenet if you see anything in this PR that should be salvaged let me know |
Hi @Remi-Gau, indeed you can let that PR as a draft to keep track of it. Thanks ! |
Hi @Remi-Gau, If it still makes sense, I'll add a method for that matter in the module. |
This Pull Request is related to issue: None.
Before reviewing this Pull Request, please review Pull Request [#](add a link to the Pull Request here).
Changes proposed in this Pull Request:
Checklist:
main
branch