Skip to content
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

Refactor metrics.dependence module #1088

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tsalo
Copy link
Member

@tsalo tsalo commented Apr 22, 2024

Closes none.

Changes proposed in this pull request:

  • Add type hints to dependence metric functions.
  • Require function calls to use keyword arguments.

@tsalo tsalo added the refactoring issues proposing/requesting changes to the code which do not impact behavior label Apr 22, 2024
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.80%. Comparing base (af5e99a) to head (9a1d536).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1088   +/-   ##
=======================================
  Coverage   89.80%   89.80%           
=======================================
  Files          26       26           
  Lines        3540     3542    +2     
  Branches      621      621           
=======================================
+ Hits         3179     3181    +2     
  Misses        212      212           
  Partials      149      149           

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

Copy link
Collaborator

@eurunuela eurunuela left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -119,7 +119,10 @@ def generate_metrics(
metric_maps = {}
if "map weight" in required_metrics:
LGR.info("Calculating weight maps")
metric_maps["map weight"] = dependence.calculate_weights(data_optcom, mixing)
metric_maps["map weight"] = dependence.calculate_weights(
data_optcom=data_optcom,
Copy link
Member Author

Choose a reason for hiding this comment

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

Related to #1086 (comment) we use data_oc in other places. I'd like to commit to one or the other and make the variable names consistent between this PR and #1086.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I personally like data_optcom better.

Copy link
Member Author

Choose a reason for hiding this comment

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

That works for me. @handwerkerd do you have an opinion on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring issues proposing/requesting changes to the code which do not impact behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants