-
Notifications
You must be signed in to change notification settings - Fork 23
Add FTIR analysis #308
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
base: development
Are you sure you want to change the base?
Add FTIR analysis #308
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #308 +/- ##
================================================
- Coverage 71.66% 19.87% -51.79%
================================================
Files 40 42 +2
Lines 4524 18084 +13560
================================================
+ Hits 3242 3594 +352
- Misses 1282 14490 +13208 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@martin-springer not urgent but do you have any idea why your commit 25fa88a shows up in this PR, and why codecov thinks the branch is out of sync with |
@RDaxini - I'm not sure why this commit shows up. Doesn't look like there's anything in the files changed. |
@martin-springer it looks like Run: So I think we need to do a back-merge and update development with main. I have tried with #309 by creating a branch based on |
|
@Trenton-Wells check #310, is there anything else we should add to the checklist? |
RDaxini
left a comment
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.
Question/suggestion:
Is it practical to have a single file of 20,000+ lines? This could be difficult to maintain. Perhaps we should create an pvdeg\ftir folder, inside of which we can break up this file into multiple files.
I'm not super familiar with all of this code but maybe restructuring in the following way would be a start:
pvdeg/
├── ftir/
│ ├── __init__.py # required
│ ├── core.py # Core utilities/helpers
│ ├── io.py # File I/O operations (rename_files, extract_file_info, etc.)
│ ├── baseline.py # Baseline correction functionality
│ ├── normalization.py # Normalization operations
│ ├── peak_analysis.py # Peak finding and deconvolution
│ ├── fitting.py # Material fitting operations
│ ├── visualization.py # Plotting functions
│ ├── ui.py # UI widgets and helpers (quality controls, etc.)
│ └── materials.py # materials.json handling
Agreed, 20,000 lines in a single file is too much. A submodule structure seems like an appropriate strategy. A good rule of thumb is to keep files under 1000 lines. Nowadays, some people argue even less with AI agents: https://medium.com/@eamonn.faherty_58176/right-sizing-your-python-files-the-150-500-line-sweet-spot-for-ai-code-editors-340d550dcea4 It seems like there are also some individual functions that have more than 1000 lines of code by themselves. Those should be broken up as well. This will be hard to maintain. This is what Gemini suggests: Common Developer Averages | 5–15 lines I'm not saying we need to bring it down to 15 lines as small functions have downsides as well (https://copyconstruct.medium.com/small-functions-considered-harmful-91035d316c29) but more than a 1000 lines is simply too long. |
Describe your changes
Added FTIR Analysis python file and notebook tutorial file.
Issue ticket number and link
Fixes # (issue)Type of change
Please delete options that are not relevant.
Checklist before requesting a review