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

Self-directed edges for nodes in habitat #34

Closed
rdnfn opened this issue Mar 1, 2021 · 3 comments
Closed

Self-directed edges for nodes in habitat #34

rdnfn opened this issue Mar 1, 2021 · 3 comments
Assignees
Labels
concerns: GeoGraph kind: bug Something isn't working

Comments

@rdnfn
Copy link
Member

rdnfn commented Mar 1, 2021

Description: it appears that the GeoGraph.add_habitat() method adds edges between nodes and themselves, but we probably don't want this as these edges don't have any meaning.

Example:
In the example here we have 2 nodes and 3 edges:

Screenshot 2021-03-01 at 19 16 12

@rdnfn rdnfn added kind: bug Something isn't working concerns: GeoGraph labels Mar 1, 2021
@rdnfn rdnfn changed the title Self-directed for nodes in habitat Self-directed edges for nodes in habitat Mar 1, 2021
@herbiebradley herbiebradley self-assigned this Mar 1, 2021
@herbiebradley
Copy link
Member

herbiebradley commented Mar 1, 2021

Ah my bad, I think I prevented this in one version of the function but then it got removed somewhere along the way.

Since the fix is just to change if nbr in invalid_idx: to if nbr != node or nbr in invalid_idx: in the add edges loop, should I bother with a PR for this or just add a quick commit to the graph-analysis branch? Or maybe @Croydon-Brixton can batch it into his identification PR?

@rdnfn
Copy link
Member Author

rdnfn commented Mar 1, 2021

Ah right, thanks for getting back so quickly! There is no rush on my side, since it doesn't break any of my functions (they just draw zero length edges). So I am happy either way, quick commit or within the bigger PR. I wouldn't bother with a PR just for this commit.

Croydon-Brixton added a commit that referenced this issue Mar 1, 2021
@Croydon-Brixton
Copy link
Collaborator

if nbr != node or nbr in invalid_idx:

@herbiebradley @rdnfn
Added the fix in acc7874

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concerns: GeoGraph kind: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants