Review#3
Conversation
|
I fixed the easily fixable issues with ruff (ruff check --fix). These are the non-fixable. Do make sure of fix these on this branch, then you can just copy the files recursively to the main one (these two branches have an initial empty commit and are thus unrelated to your main branch). We can also cherry pick these last commit (f7b52c8) if that is easier. |
There was a problem hiding this comment.
This file is way too big. I have a few suggestions:
- Isolate the plotting functions into their own file
- Separate the testing section (starting at the second round of inputs) into tan independent file
- I understand that you pulled and modified classes from captum. Please make it clear which classes/functions come from there by adding a permalink to their source
- Add docstrings indicating what is the purpose of a given function for the ones you wrote. If they are too many, focus on the ones used on your tests
There was a problem hiding this comment.
I think a much better solution to import the code is to subclass and override the methods that you are modifying.
| fig.savefig(fig_directory / fig_name, dpi=300, bbox_inches='tight') | ||
| plt.close() | ||
| """ | ||
| ------- Test of above code ---------- |
There was a problem hiding this comment.
This should definitely be its own script! It will also allow you to reduce the dependency footprint at the top of the file
|
|
||
| # # 1) Loading images and create a pytorch dataset | ||
|
|
||
| # ## a) Load Images using Jump_portrait |
There was a problem hiding this comment.
Move this to its own script? Or add it on the readme. This is data acquisition, so it is important.
There was a problem hiding this comment.
Remove all the commented lines or, if they actually are instructions on how to download files, make them documentation or their own file.
There was a problem hiding this comment.
I cannot code review notebooks in this interface. Please use jupytext 'jupytext --to py:percent X.ipynb' and push that version for review
There was a problem hiding this comment.
I cannot code review notebooks in this interface. Please use jupytext 'jupytext --to py:percent X.ipynb' and push that version for review
| @@ -0,0 +1,2 @@ | |||
| #+title: Readme | |||
There was a problem hiding this comment.
Add links to main resources, this will allow you (or anyone re-using this data) to quickly access the documentation/scripts/notes/references.
| @@ -0,0 +1,38 @@ | |||
| """ | |||
There was a problem hiding this comment.
I'd suggest doing something like this to your python scripts. It gives the reader a quick overview of what the script is about.
| @@ -0,0 +1,179 @@ | |||
| # 1. Visualise image | |||
There was a problem hiding this comment.
This is my bad: I usually write the step-by-step of a script before implementing it. Then I would replace it with text showing what the script does. I forgot to do the latter here.
There was a problem hiding this comment.
I cannot code review notebooks in this interface. Please use jupytext 'jupytext --to py:percent X.ipynb' and push that version for review
There was a problem hiding this comment.
This one may have been replaced by data_v2. I'd suggest removing the scripts that are not producing useful data to reduce the signal to noise ratio.
|
According to my duplication analysis tool, these files are practically the same: "filter_image.py": {
"gans_profiles_script.py": 83.46,
"image_classifier_script.py": 92.64
},Consider refactoring them into one |
Ignore this Pull Request for now. I will use it to document my code review.
From slack: