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

222 pixel inflation #241

Merged
merged 93 commits into from
Oct 17, 2024
Merged

222 pixel inflation #241

merged 93 commits into from
Oct 17, 2024

Conversation

JulietteFrancovich
Copy link
Contributor

No description provided.

@JulietteFrancovich
Copy link
Contributor Author

@psomhorst this branch now contains the feature pixel inflations and the parameter TIV since they are interdependent. I have written tests for pixel inflations. Could you review the code and give your suggestions for pixel inflations and the tests? Once we are happy with that I will write the tests for parameter TIV and request review again for the entire pull request. Thanks!

@psomhorst psomhorst marked this pull request as ready for review September 20, 2024 09:41
@psomhorst psomhorst self-requested a review September 20, 2024 09:41
Copy link
Contributor

@psomhorst psomhorst left a comment

Choose a reason for hiding this comment

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

I think this is a great PR with a lot of work and thought in it. There are some things I would improve, but overall it seems almost good to go.

The algorithm is quite slow. I would like to look into trying to speed it up. I have a suggestion on how to prevent iterating over all pixels. Maybe this will help in the performance.

Please make sure the code is formatted using "ruff < 0.6". I will update the main branch to use the last version of ruff before 0.6 (currently 0.5.7).

I have only reviewed pixel inflation and its test. I have not reviewed the TIV parameters class or the notebooks.

eitprocessing/features/pixel_inflation.py Outdated Show resolved Hide resolved
eitprocessing/features/pixel_inflation.py Outdated Show resolved Hide resolved
eitprocessing/features/pixel_inflation.py Outdated Show resolved Hide resolved
eitprocessing/features/pixel_inflation.py Outdated Show resolved Hide resolved
eitprocessing/features/pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
@JulietteFrancovich
Copy link
Contributor Author

JulietteFrancovich commented Sep 23, 2024

@psomhorst Thank you for your review. I have addressed your comments and tried to incorporate your suggestions (see comments). Please let me know if you have further comments/ concerns. I will start working on tests for parameter TIV so we can review that next.

@JulietteFrancovich
Copy link
Contributor Author

@psomhorst I have now written tests for parameter TIV. Could you review the TIV code and tests? Once those have been reviewed and the comments (also on pixel inflation) have been resolved to your liking, I think this branch is ready for merging.

Copy link
Contributor

@psomhorst psomhorst left a comment

Choose a reason for hiding this comment

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

I have some additional comments about the PixelInflation tests and notebook.

tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
eitprocessing/features/pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_parameter_tiv.py Outdated Show resolved Hide resolved
tests/test_parameter_tiv.py Outdated Show resolved Hide resolved
notebooks/test_pixel_inflation.ipynb Outdated Show resolved Hide resolved
Copy link
Contributor

@psomhorst psomhorst left a comment

Choose a reason for hiding this comment

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

This generally looks very good. I notice you're not working with multidimensional data very efficiently. I have some suggestions improving performance and readability.

eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
Copy link
Contributor

@psomhorst psomhorst left a comment

Choose a reason for hiding this comment

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

I have some more comments.

tests/test_parameter_tiv.py Outdated Show resolved Hide resolved
tests/test_parameter_tiv.py Outdated Show resolved Hide resolved
tests/test_parameter_tiv.py Outdated Show resolved Hide resolved
tests/test_parameter_tiv.py Outdated Show resolved Hide resolved
eitprocessing/features/pixel_inflation.py Outdated Show resolved Hide resolved
eitprocessing/features/pixel_inflation.py Outdated Show resolved Hide resolved
tests/test_parameter_tiv.py Outdated Show resolved Hide resolved
eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
Copy link
Contributor

@psomhorst psomhorst left a comment

Choose a reason for hiding this comment

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

I think you're almost there!

I think TIV.compute_parameter() return a SparseData object. TIVs are values occurring at unpredictable intervals. For pixels, I think values should be a list of arrays.

There are some very minor issues that result in warnings. These should be fixed before merging.

I have some left over suggestions to improve readability of the code.

Documentation is not entirely there yet, but it's good enough for now. I think we should do a review of all docstrings at some point and try to find a good mode for explaining features.

Having the results as lists of arrays is not ideal. I suggest we leave that for now and reconsider how to do this in the near future. I created #309.

eitprocessing/parameters/tidal_impedance_variation.py Outdated Show resolved Hide resolved
eitprocessing/features/pixel_breath.py Outdated Show resolved Hide resolved
eitprocessing/features/pixel_breath.py Outdated Show resolved Hide resolved
eitprocessing/features/pixel_breath.py Outdated Show resolved Hide resolved
@JulietteFrancovich
Copy link
Contributor Author

@psomhorst I have addressed your comments and changed the TIV to be stored as SparseData. I have adjusted the pixel breath accordingly (since this uses TIV) and have added new tests to check the storage of TIV. Let me know if you have any further comments :)

Copy link
Contributor

@psomhorst psomhorst left a comment

Choose a reason for hiding this comment

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

Fantastic! Great effort, thanks for the change to SparseData.

I took the liberty to rebase the branch onto develop, so you can go ahead and merge it.

@JulietteFrancovich JulietteFrancovich merged commit 9cecb13 into develop Oct 17, 2024
4 checks passed
@JulietteFrancovich JulietteFrancovich deleted the 222_pixel_inflation branch October 17, 2024 11:28
@JulietteFrancovich
Copy link
Contributor Author

@psomhorst Thank you! I have merged and deleted the branch.

psomhorst added a commit that referenced this pull request Oct 17, 2024
psomhorst added a commit that referenced this pull request Oct 17, 2024
psomhorst added a commit that referenced this pull request Oct 17, 2024
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