Output learned attributes file from learn-weights and support filepath in score-weighted config#62
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes the learn-weights output artifact to a lightweight learned_attributes.json (attribute/weight pairs) and updates ScoreWeightedConfig to accept its attributes input either inline or as a JSON filepath, aligning config consumption with the new CLI output.
Changes:
learn-weightspipeline/CLI now returns and writes learned attribute weights (not a full score-weighted config).ScoreWeightedConfignow supportsattributesas a JSON filepath string (loaded during validation).- Adds/updates tests for
LearnWeightsConfigvalidation andScoreWeightedConfigattributes-from-file behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/config/test_score_weighted.py | Adds coverage for ScoreWeightedConfig(attributes=filepath) behavior. |
| tests/config/test_learn_weights.py | New unit tests for LearnWeightsConfig valid/invalid inputs. |
| reVeal/learn_weights.py | Changes run_learn_weights() return payload to include attributes list instead of a generated config. |
| reVeal/feature_analysis.py | Docstring formatting clarification for suggest_exclusions() return structure. |
| reVeal/config/score_weighted.py | Allows attributes to be a filepath and loads JSON before attribute validation. |
| reVeal/cli/learn_weights.py | Writes learned_attributes.json instead of config_score_weighted.json. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4ffa9f9 to
ea9bf3a
Compare
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (77.77%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #62 +/- ##
==========================================
+ Coverage 81.84% 82.09% +0.25%
==========================================
Files 23 23
Lines 1746 1754 +8
Branches 219 221 +2
==========================================
+ Hits 1429 1440 +11
+ Misses 269 267 -2
+ Partials 48 47 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ea9bf3a to
3789dd8
Compare
…h in score-weighted config learn-weights CLI now outputs learned_attributes.json (list of attribute/weight dicts) instead of a full config_score_weighted.json. ScoreWeightedConfig accepts attributes as either a list or a string filepath.
3789dd8 to
b340a3b
Compare
learn-weights CLI now outputs learned_attributes.json (list of attribute/weight dicts) instead of a full. config_score_weighted.json. ScoreWeightedConfig accepts attributes as either a list or a string filepath.
This was tested through pytest as well as individual runs of learn_weights and score_weighted. I ran the full pipeline: characterize -> normalize -> learn -> score -> downscale. The results are currently in /home/ichristi/reVeal but will move it to /projects/largeload/geospatial/runs/test_scenarios when this goes in