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

Metrics for the designed network #100

Conversation

barneydobson
Copy link
Collaborator

@barneydobson barneydobson commented Mar 16, 2024

Description

Add a set of new metrics and tests, all reasonably simple ones.

Fixes #91

This does highlight a possible issue that I am likely re-evaluate dominant_outlet and best_outlet_match many many times during iterate_metrics. I don't think this would be constraining, but it does feel wasteful - I have created an issue to address it #101.

@barneydobson barneydobson self-assigned this Mar 16, 2024
@barneydobson barneydobson added the sa_paper Sensitivity analysis paper label Mar 16, 2024
Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

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

LGTM.

Yeah, it seems a bit wasteful. If the inputs were hashable, you could cache the result, but I don't think that's the case, so we would need to come up with a more creative way of avoiding calculating the same thing again and again.

/ sg_real.number_of_nodes()

@metrics.register
def outlet_pbias_npipes(real_G: nx.Graph,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since bias has a sign, for the three pbias functions please make a note in the docstring that this is sim - real or even better, provide the formula using a math block it shows up nicely in RTD.

@cheginit
Copy link
Collaborator

My only concern with the metrics is handling NaNs. Do you any checks in the pre-processing steps for removing NaNs? If not, you need to either drop them explicitly or use numpy's (or numbagg) NaN specific functions, such as np.nanmean, throughout the code base where NaNs might occur.

include pbias equations
@barneydobson
Copy link
Collaborator Author

handling NaNs. Do you any checks in the pre-processing steps for removing NaNs? If not, you need to either drop them explicitly

I do in the NSE/KGE calcs (in the relevant branch). And I've not encountered them anywhere else (neither SWMM simulations or data files). I will make an issue to do a more thorough check though

@barneydobson barneydobson merged commit d249974 into main Mar 25, 2024
7 of 10 checks passed
@barneydobson barneydobson deleted the 91-design-output-metrics-as-in-metrics-for-the-networks-design-parameters branch March 25, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sa_paper Sensitivity analysis paper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Design output metrics (as in metrics for the network's design parameters)
3 participants