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

BUG: shortest_path overwrite #3801

Merged
merged 1 commit into from Aug 29, 2014
Merged

Conversation

argriffing
Copy link
Contributor

Intended to close #3800.

Other csgraph functions may need similar attention?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling c0a5ea5 on argriffing:shortest-path-overwrite into 8dfef22 on scipy:master.

@perimosocordiae
Copy link
Member

Thanks! It looks like the other usages of validate_graph either handle this already or they force conversion to a sparse format, so this should be the only fix needed.

@pv pv removed the PR label Aug 13, 2014
@@ -121,7 +121,9 @@ def shortest_path(csgraph, method='auto',
"""
# validate here to catch errors early but don't store the result;
# we'll validate again later
validate_graph(csgraph, directed, DTYPE)
validate_graph(csgraph, directed, DTYPE,
Copy link
Member

Choose a reason for hiding this comment

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

Are the in-place changes made by validate_graph (for overwrite=True) idempotent?
Does something go wrong if this call modifies in-place, and the second call later on also does something?

pv added a commit that referenced this pull request Aug 29, 2014
BUG: sparse.csgraph: fix up shortest_path overwriting data
@pv pv merged commit 4c7bf4b into scipy:master Aug 29, 2014
@pv
Copy link
Member

pv commented Aug 29, 2014

Thanks, merged. (overwrite=True seems indeed idempotent)

@pv pv added this to the 0.15.0 milestone Aug 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: scipy.sparse.csgraph.shortest_path overwrites input matrix
6 participants