New Contributor FAQ#

A collection of frequently-asked questions by newcomers to open-source development and first-time contributors to NetworkX.

Q: I’m new to open source and would like to contribute to NetworkX. How do I get started?#

To contribute to NetworkX, you will need three things:

  1. The source code

  2. A development environment

  3. An idea of what you’d like to contribute

Steps 1 & 2 are covered extensively in Development Workflow. There is no generic answer for step 3. There are many ways that NetworkX can be improved, from adding new algorithms, improving existing algorithms, improving the test suite (e.g. increasing test coverage), and improving the documentation. The “best” way to find a place to start is to follow your own personal interests! That said, a few places to check for ideas on where to get started:

  • The issue tracker lists known bugs and feature requests. Of particular interest for first-time contributors are issues that have been tagged with the Good First Issue or Sprint labels.

  • The Algorithms discussion includes a listing of algorithms that users would like to have but that are not yet included in NetworkX.

Q: I’ve found an issue I’m interested in, can I have it assigned to me?#

NetworkX doesn’t typically assign issues to contributors. If you find an issue or feature request on the issue tracker that you’d like to work on, you should first check the issue thread to see if there are any linked pull requests. If not, then feel free to open a new PR to address the issue - no need to ask for permission - and don’t forget to reference the issue number in the PR comments so that others know you are now working on it!

Q: I want to work on a specific function. How do I find it in the source code?#

Assuming you have followed the instructions for setting up the development workflow, there are several ways of determining where the in the source code a particular function or class is defined.

For example, let’s say you are interested in making a change to the kamada_kawai_layout function, so you need to know where it is defined. In an IPython terminal, you can use ? — the source file is listed in the File: field:

In [1]: import networkx as nx
In [2]: nx.kamada_kawai_layout?
Signature: <clipped for brevity>
Docstring: <clipped for brevity>
File: ~/networkx/networkx/drawing/layout.py
Type: function

Command line utilities like grep or git grep are also very useful. For example, from the NetworkX source directory:

$ grep -r "def kamada_kawai_layout" .
./networkx/drawing/layout.py:def kamada_kawai_layout(

Q: What is the policy for deciding whether to include a new algorithm?#

There is no official policy setting explicit inclusion criteria for new algorithms in NetworkX. New algorithms are more likely to be included if they have been published and are cited by others. More important than number of citations is how well proposed additions fit the project Mission and Values.

Testing is also an important factor in determining whether algorithms should be included. Proposals that include thorough tests which illustrate expected behavior are much easier to review, and therefore likely to progress more rapidly.

Note

Thorough does not mean exhaustive. The quality of unit tests is much more important than quantity. Thorough tests should address questions like:

  • Does the algorithm support different graph types (undirected, directed, multigraphs)?

  • How does the algorithm behave with disconnected inputs and graphs which contain self-loops?

  • Are there explicit test cases outlined in the literature which can be incorporated in the test suite?