Skip to content

Clarify generation number in dorogovtsev_goltsev_mendes_graph() - #7473

Merged
rossbar merged 9 commits into
networkx:mainfrom
Peiffap:main
Jul 2, 2024
Merged

rossbar merged 9 commits into
networkx:mainfrom
Peiffap:main

Conversation

@Peiffap

@Peiffap Peiffap commented May 31, 2024 •

Copy link
Copy Markdown
Member

Clarifies the meaning of the generation number in DGM graphs, as discussed in #7472.

Also contains additional tests based on average clustering and average shortest path length in the original paper, as well as minor changes to wording.

Fixes #7472.

@Peiffap

Peiffap commented May 31, 2024

Copy link
Copy Markdown
Member Author

The documentation for DGM graphs still looks like it could use a revamp. Let me know if this is something we want to add to this PR.

@rossbar rossbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @Peiffap - IMO this is actually a semantics issue rather than an implementation issue - see my comment and LMK what you think!

@Peiffap

Peiffap commented Jun 1, 2024

Copy link
Copy Markdown
Member Author

@dschult @rossbar As discussed in #7472, I've updated the PR. Let me know if this looks good to you.

@Peiffap

Peiffap commented Jun 1, 2024

Copy link
Copy Markdown
Member Author

As a side note, is it supposed to be quite messy to get documentation built locally, or to run doctests? I find myself having to manually purge several files every time I run pytest --doctest-modules networkx or make html (even after using make clean for the latter).

@dschult dschult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is Very Nice ---- thank you.
The new reference link is helpful.
The new test for nonnegative n.
The new Raises doc section.
The nicely rewritten for loop structure.

I'm not sure about using draw_planar instead of draw, and would prefer latex not be used since those expressions are easily written in ascii. Other comments are below.

Thanks very much!

Comment thread networkx/generators/classic.py Resolved
Comment thread networkx/generators/classic.py Resolved
Comment thread networkx/generators/classic.py Resolved
@Peiffap

Peiffap commented Jun 25, 2024

Copy link
Copy Markdown
Member Author

I merged with the latest commits on main to get rid of the test failures.

@dschult @rossbar, could I kindly request you take a quick look at this and let me know whether there are any additional changes to be made?

@dschult dschult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've only got one very minor comment here.
Thanks for this!

Comment thread networkx/generators/classic.py Resolved
@Peiffap Peiffap changed the title Correct generation number in dorogovtsev_goltsev_mendes_graph Clarify generation number in dorogovtsev_goltsev_mendes_graph() Jun 26, 2024
Peiffap added 8 commits June 27, 2024 19:26
    - Correct vertex and edge counts in docstring
    - Explicitly mention the meaning of the generation parameter
    - Miscellaneous other improvements to docstring
    - Reformat the function code more clearly
    - Add several tests based on properties of DGM algorithm
    - Add planarity checks for small graphs
    - Use pytest context manager for exception tests
    - Revert draw_planar -> draw in docs
    - Clean up docstring
    - Simplify loop indices in generation algorithm
    - Use NetworkX terminology
    - Clean up error messages

@rossbar rossbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, a couple minor things I'd normally push up before merging but can't in this instance since the PR originates from main - I'll do so in a follow-up PR instead. Thanks @Peiffap !

@rossbar
rossbar merged commit 530392e into networkx:main Jul 2, 2024
@jarrodmillman jarrodmillman added this to the 3.4 milestone Jul 2, 2024
@Peiffap

Peiffap commented Jul 2, 2024

Copy link
Copy Markdown
Member Author

Thanks @rossbar! Sorry about the branch... I'm glad to have it be freed up now. If you want me to take a look at some of the other changes you have in mind, just let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Parameter off by one in dorogovtsev_goltsev_mendes_graph

4 participants