-
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
report on repo #56
report on repo #56
Conversation
combined_report.html
Outdated
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.
This should go into the website
folder. Another PR is also creating files there.
local.env.example
Outdated
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.
What is the idea behind setting these variables? You should be able to get the repository location from the location of the file, e.g. using the __file__
variable.
repostatus.py
Outdated
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.
This should move somewhere else. Probably utilities/repository
or something.
repostatus.py
Outdated
import json | ||
|
||
# Load environment variables | ||
load_dotenv(r'C:\Users\home\tf2.4\TF2.4_IVIM-MRI_CodeCollection\local.env') |
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.
We should be able to get around hard coding paths. This won't work for me, for example.
repostatus.py
Outdated
load_dotenv(r'C:\Users\home\tf2.4\TF2.4_IVIM-MRI_CodeCollection\local.env') | ||
|
||
# Read the CSV file | ||
csv_file_path = os.getenv('CODE_CONTRIBUTIONS_FILE') |
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.
Looking through the code I realize that your table is missing a column, wrapped
. In the issue thread I mentioned parsing the files in the folders which isn't being done here, and that's what is missing. It should parse the wrapper folder to find which algorithms are wrapped.
And there I also mentioned double checking the code contributions against what is in the source folder.
So the source code folder and code contribution file should match. If not it would be nice to note that. That should be a superset of the wrapped code list. And that should be a superset of the tested code list. If anything doesn't match that logic then we should note it in the html or printing a message.
repostatus.py
Outdated
@@ -0,0 +1,37 @@ | |||
import os | |||
import pandas as pd |
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.
Pandas caused the test failure. It should be in the requirements.
I apologize I accidentally deleted the git ignore file can I create a new branch |
Sure, start over or just add it back on this branch, either one. |
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.
Sorry, I'm rethinking this a little. Some of these that you're trying to find could be useful in the csv file anyway, so perhaps just adding them could simplify the script a lot. Then it could be a simpler process to generate the html from the csv.
utilities/repostatus.py
Outdated
import json | ||
|
||
# directory of the current script | ||
script_dir = os.path.dirname(os.path.abspath(__file__)) |
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.
I think by the convention you're been following, this should be SCRIPT_DIR
.
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.
Would it be problematic to add a column called 'algorithms' to the data frame? it would be easily understandable. Is it a bad idea?
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.
What would that add? The algorithms from the json are the ones running the automated testing. That's beyond the scope of the csv file. Is there some other algorithm you want to add?
utilities/repostatus.py
Outdated
print(f"Warning: Subfolder '{subfolder}' does not exist in the source folder.") | ||
|
||
# Add column 'Tested' to the DataFrame if it starts with that of subfolder | ||
df['Tested'] = df.apply(lambda row: 'Yes' if any(algorithm.startswith(row['subfolder'].split('_')[0]) for algorithm in all_algorithms) else 'No', axis=1) |
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.
I'm just looking at this logic and it seems like it's just matching everything before the first _
. That's not specific because that's usually the author's initials and they can have several algorithms.
Looking at it a little more, this could become fancier, but maybe we actually want this column in our csv file. So another approach would be to just manually go through and find the matches and add a "Wrapped" column to the csv file that contains what you'd see in the algorithms.json.
Then that would reduce what is needed in here to just having a sanity check that the wrapped folders match the csv. And it would make checking for tested much easier because it would be a simple string match.
How does that sound?
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.
do i need to manually update the code_contribution_csv file or write a script to read algorithms from algorithms.json and write 'wrapped' in csv file and automatically update whenever there is change in algorithms. json file
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.
Add the column manually. That column is not the same as what's in algorithm.json. That column would be the wrapped name, so if an algorithm is wrapped it should have an entry there. The algorithm.json is what is being tested. In theory everything wrapped should be tested but it does need to be added and confirmed it doesn't fail. So they're not the same thing.
utilities/repostatus.py
Outdated
|
||
# Parse files in the WRAPPED_FOLDER | ||
wrapped_algorithms = [] | ||
for root, dirs, files in os.walk(WRAPPED_FOLDER): |
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.
This could just be added to the csv, see comment above.
utilities/repostatus.py
Outdated
wrapped_algorithms.append(algorithm) | ||
|
||
# Add a column 'Wrapped' to the DataFrame | ||
df['Wrapped'] = df.apply(lambda row: 'Yes' if any(algorithm.startswith(row['subfolder'].split('_')[0]) for algorithm in wrapped_algorithms) else 'No', axis=1) |
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.
This as well, see above.
utilities/repostatus.py
Outdated
html_string = df_selected.to_html(index=False) | ||
|
||
# Save the HTML to a file | ||
with open(os.path.join(REPO_DIR, 'combined_report.html'), 'w') as f: |
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.
I think os.path.join(REPO_DIR, website, 'combined_report.html')
This is looking good, I think you're almost there. After these small changes I'll send it around to the contributors for a final sanity check. |
Just checking on this, are these changes still in the works? |
i am sorry but i couldnt find these comments could you please give the link to comments that state necessary changes |
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.
Sorry! It was my fault, I didn't finalize the review.
doc/code_contributions_record.csv
Outdated
IVIM,Fitting,Segmented NLLS fitting,Specifically tailored algorithm for NLLS segmented fitting,OJ_GU,TF2.4_IVIM-MRI_CodeCollection/src/original/OJ_GU/,Oscar Jalnefjord,University of Gothenburg,seg,https://doi.org/10.1007/s10334-018-0697-5,tbd, | ||
IVIM,Fitting,Linear fit,Linear fit for D and D* and f. Intended to be extremely fast but not always accurate,ETP_SRI,TF2.4_IVIM-MRI_CodeCollection/src/original/ETP_SRI/LinearFitting.py,Eric Peterson,SRI International,,,tbd, | ||
Technique,Category,Subcategory,notes,subfolder,Link to source code,Authors,Institution,function/module,DOI,Tester,test status,wrapped | ||
IVIM,Fitting,LSQ fitting,,OGC_AmsterdamUMC,TF2.4_IVIM-MRI_CodeCollection/src/original/OGC_AmsterdamUMC/,Oliver Gurney-Champion,Amsterdam UMC,fit_least_squares/fit_least_squares_array,,tbd,,no |
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.
Rather than no
probably just blank is easier to handle later on.
website/combined_report.html
Outdated
@@ -5,142 +5,142 @@ | |||
<th>Subfolder</th> | |||
<th>Contributors</th> | |||
<th>Tested</th> | |||
<th>Wrapped</th> | |||
<th>wrapped</th> |
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.
Caps here
Apologies, I didn't finish the review so my comments didn't show for you. |
Looks like a merge conflict in |
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.
Looks good, just those changes then I'll run it locally as a final test.
…hicodes369/TF2.4_IVIM-MRI_CodeCollection into created_repostatus/statistics
Describe the changes you have made in this PR
created a report on the repository like the name of the contributor and how many are being tested
A clear and concise description of what you want to happen
a simple HTML is being generated if you execute this script
Link this PR to an issue [optional]
Fixes #47
Checklist