Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates legacy notebooks to modernize their structure and improve Colab compatibility. The key changes include conditionally installing packages only when running on Google Colab, updating import statements to use the new harmonic.utils module path, and modifying the cross-validation utility function to log values in log space rather than linear space.
Key Changes
- Conditional package installation that only runs on Google Colab environments
- Import path updates from
import utilstoimport harmonic.utils as utils - Model class references updated from
hm.model.*tohm.model_legacy.* - Cross-validation logging modified to output log-space values instead of linear-space values
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| notebooks/cross_validation_learnt_model.ipynb | Updated to conditionally install packages on Colab, changed imports to use harmonic.utils, and updated model references to model_legacy |
| notebooks/cross_validation_hyper_parameters.ipynb | Same updates as learnt_model notebook, plus a misplaced %%capture magic command within an if statement |
| notebooks/checkpointing.ipynb | Updated with conditional Colab installation check |
| harmonic/utils.py | Modified cross-validation logging to output log-space values using np.exp() and corrected variance calculations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #323 +/- ##
=======================================
Coverage 94.13% 94.13%
=======================================
Files 10 10
Lines 802 802
=======================================
Hits 755 755
Misses 47 47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Update legacy notebooks to use new imports.
Only install packages if on colab.
Update cross validation utils to only log log space values.