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

no warning in strength() example #1293

Closed
maelle opened this issue Mar 11, 2024 · 5 comments · Fixed by #1294
Closed

no warning in strength() example #1293

maelle opened this issue Mar 11, 2024 · 5 comments · Fixed by #1294

Comments

@maelle
Copy link
Contributor

maelle commented Mar 11, 2024

The comment below is from the example text.

@maelle
Copy link
Contributor Author

maelle commented Mar 11, 2024

library("igraph")
#> 
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:stats':
#> 
#>     decompose, spectrum
#> The following object is masked from 'package:base':
#> 
#>     union
# No weights, a warning is given
g <- make_ring(10)
strength(g)
#>  [1] 2 2 2 2 2 2 2 2 2 2

Created on 2024-03-11 with reprex v2.1.0

@szhorvat
Copy link
Member

Would you have time to help with this and test if 1.6.0 (based on 0.9) and 1.2.6 (based on 0.8) give a warning? My hypothesis is that there was a warning in the past but it was removed in the C core, but I didn't find when this might have happened.

Alternatively, just remove the comment and close this. It's not worth the time and I wouldn't support strength() giving a warning when there are no weights (even if this naively makes sense)

@maelle
Copy link
Contributor Author

maelle commented Mar 11, 2024

ok, let me do this!

@szhorvat
Copy link
Member

Just remove the comment, don't spend time.

Strength only differs from degree when there are weights, which supports giving a warning, so someone may have done this. But it is much more useful not to issue warnings, just take all weights to be 1.

@maelle
Copy link
Contributor Author

maelle commented Mar 11, 2024

Ok!

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 a pull request may close this issue.

2 participants