Skip to content

Console messaging optimization and addition of SNMFOptimizer.objective_log#195

Open
Andrea-gm wants to merge 13 commits intodiffpy:mainfrom
Andrea-gm:optimize-messages
Open

Console messaging optimization and addition of SNMFOptimizer.objective_log#195
Andrea-gm wants to merge 13 commits intodiffpy:mainfrom
Andrea-gm:optimize-messages

Conversation

@Andrea-gm
Copy link
Contributor

This PR introduces a structured logging system and adds user control over console output during optimization. The legacy objective history list has been entirely replaced by the new objective log attribute, which stores a detailed history of the optimization process by recording the step, iteration, objective value, and timestamp at each update. Convergence checks and step-size calculations have been refactored to pull directly from this new log, eliminating redundant data tracking. Additionally, a verbose parameter was added to the optimizer initialization to toggle terminal output. All internal print messages have been rewritten for clarity and are now conditionally executed based on this verbose flag.

Andrea-gm and others added 12 commits March 5, 2026 18:10
Was giving me errors due to use  of python 3.11
Optimized print messages
Added verbose option
Added objective_log attribute to track objective function updates, with associated time stamps and specifying what matrix has been updated
Fixed wrong setting of objective_log
remove commented print messages
Added "iteration" key to objective_log
Removed redundant _objective_history attribute
@Andrea-gm
Copy link
Contributor Author

I applied my changes to the previous version of the main branch. I am now resolving the conflicts keeping the new modifications implemented in main.

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.50%. Comparing base (d7586bc) to head (ab71e11).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #195       +/-   ##
===========================================
- Coverage   77.50%   57.50%   -20.00%     
===========================================
  Files           3        3               
  Lines          40       40               
===========================================
- Hits           31       23        -8     
- Misses          9       17        +8     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Andrea-gm
Copy link
Contributor Author

I updated the attribute nomenclature to match the new version of main, and removed all conflicts arising from versioning. There are now no conflicts with the base branch, but I'm unsure of why the codecov is failing

@john-halloran
Copy link
Contributor

Thanks Andrea, this looks great. The codecov, I believe, is failing for reasons totally unrelated to your PR. Will let Simon confirm.

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.

2 participants