Skip to content

Output learned attributes file from learn-weights and support filepath in score-weighted config#62

Merged
iankchristie merged 1 commit into
mainfrom
ichristi/learn-weights-file
Jun 16, 2026
Merged

Output learned attributes file from learn-weights and support filepath in score-weighted config#62
iankchristie merged 1 commit into
mainfrom
ichristi/learn-weights-file

Conversation

@iankchristie

@iankchristie iankchristie commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

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

Copilot AI review requested due to automatic review settings June 15, 2026 22:31
@iankchristie iankchristie requested a review from ppinchuk as a code owner June 15, 2026 22:31
Comment thread reVeal/feature_analysis.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-weights pipeline/CLI now returns and writes learned attribute weights (not a full score-weighted config).
  • ScoreWeightedConfig now supports attributes as a JSON filepath string (loaded during validation).
  • Adds/updates tests for LearnWeightsConfig validation and ScoreWeightedConfig attributes-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.

Comment thread reVeal/config/score_weighted.py Outdated
Comment thread reVeal/cli/learn_weights.py
Comment thread tests/config/test_score_weighted.py
Comment thread reVeal/config/score_weighted.py Outdated
@iankchristie iankchristie force-pushed the ichristi/learn-weights-file branch from 4ffa9f9 to ea9bf3a Compare June 15, 2026 22:41
@codecov-commenter

codecov-commenter commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.09%. Comparing base (017cfaa) to head (b340a3b).

Files with missing lines Patch % Lines
reVeal/cli/learn_weights.py 0.00% 4 Missing ⚠️

❌ 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     
Flag Coverage Δ
unittests 82.09% <77.77%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@iankchristie iankchristie force-pushed the ichristi/learn-weights-file branch from ea9bf3a to 3789dd8 Compare June 15, 2026 22:58
…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.
@iankchristie iankchristie force-pushed the ichristi/learn-weights-file branch from 3789dd8 to b340a3b Compare June 15, 2026 23:06
@iankchristie iankchristie merged commit 9559d26 into main Jun 16, 2026
10 checks passed
@iankchristie iankchristie deleted the ichristi/learn-weights-file branch June 16, 2026 17:31
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.

4 participants