@@ -14,7 +14,7 @@ see any problems.
14
14
15
15
The tskit-dev team strives to create a welcoming and open environment for
16
16
contributors; please see our `code of conduct
17
- <https://github.com/tskit-dev/.github/blob/master /CODE_OF_CONDUCT.md> `__ for
17
+ <https://github.com/tskit-dev/.github/blob/main /CODE_OF_CONDUCT.md> `__ for
18
18
details. We wish our code and documentation to be `inclusive
19
19
<https://chromium.googlesource.com/chromium/src/+/master/styleguide/inclusive_code.md> `__
20
20
and in particular to be gender and racially neutral.
@@ -162,7 +162,7 @@ Git workflow
162
162
is to follow this recipe::
163
163
164
164
$ git fetch upstream
165
- $ git checkout upstream/master
165
+ $ git checkout upstream/main
166
166
$ git checkout -b topic_branch_name
167
167
168
168
4. As you work on your topic branch you can add commits to it. Once you're
@@ -852,7 +852,7 @@ the C and Python APIs.
852
852
2. Write your function in Python: in ``python/tests/ `` find the test module that
853
853
pertains to the functionality you wish to add. For instance, the kc_distance
854
854
metric was added to
855
- `test_topology.py <https://github.com/tskit-dev/tskit/blob/master /python/tests/test_topology.py >`_.
855
+ `test_topology.py <https://github.com/tskit-dev/tskit/blob/main /python/tests/test_topology.py >`_.
856
856
Add a python version of your function here.
857
857
3. Create a new class in this module to write unit tests for your function: in addition
858
858
to making sure that your function is correct, make sure it fails on inappropriate inputs.
@@ -862,34 +862,34 @@ the C and Python APIs.
862
862
`TestKCMetric <https://github.com/tskit-dev/tskit/blob/4e707ea04adca256036669cd852656a08ec45590/python/tests/test_topology.py#L293 >`_ for example.
863
863
4. Write your function in C: check out the :ref: `sec_c_api ` for guidance. There
864
864
are also many examples in the
865
- `c directory <https://github.com/tskit-dev/tskit/tree/master /c/tskit >`_.
865
+ `c directory <https://github.com/tskit-dev/tskit/tree/main /c/tskit >`_.
866
866
Your function will probably go in
867
- `trees.c <https://github.com/tskit-dev/tskit/blob/master /c/tskit/trees.c >`_.
867
+ `trees.c <https://github.com/tskit-dev/tskit/blob/main /c/tskit/trees.c >`_.
868
868
5. Write a few tests for your function in C: again, write your tests in
869
- `tskit/c/tests/test_tree.c <https://github.com/tskit-dev/tskit/blob/master /c/tests/test_trees.c >`_.
869
+ `tskit/c/tests/test_tree.c <https://github.com/tskit-dev/tskit/blob/main /c/tests/test_trees.c >`_.
870
870
The key here is code coverage, you don't need to worry as much about covering every
871
871
corner case, as we will proceed to link this function to the Python tests you
872
872
wrote earlier.
873
873
6. Create a low-level definition of your function using Python's C API: this will
874
874
go in `_tskitmodule.c
875
- <https://github.com/tskit-dev/tskit/blob/master /python/_tskitmodule.c> `_.
875
+ <https://github.com/tskit-dev/tskit/blob/main /python/_tskitmodule.c> `_.
876
876
7. Test your low-level implementation in `tskit/python/tests/test_lowlevel.py
877
- <https://github.com/tskit-dev/tskit/blob/master /python/tests/test_lowlevel.py> `_:
877
+ <https://github.com/tskit-dev/tskit/blob/main /python/tests/test_lowlevel.py> `_:
878
878
again, these tests don't need to be as comprehensive as your first python tests,
879
879
instead, they should focus on the interface, e.g., does the function behave
880
880
correctly on malformed inputs?
881
881
8. Link your C function to the Python API: write a function in tskit's Python API,
882
882
for example the kc_distance function lives in
883
883
`tskit/python/tskit/trees.py
884
- <https://github.com/tskit-dev/tskit/blob/master /python/tskit/trees.py> `_.
884
+ <https://github.com/tskit-dev/tskit/blob/main /python/tskit/trees.py> `_.
885
885
9. Modify your Python tests to test the new C-linked function: if you followed
886
886
the example of other tests, you might need to only add a single line of code
887
887
here. In this case, the tests are well factored so that we can easily compare
888
888
the results from both the Python and C versions.
889
889
10. Write a docstring for your function in the Python API: for instance, the kc_distance
890
890
docstring is in
891
891
`tskit/python/tskit/trees.py
892
- <https://github.com/tskit-dev/tskit/blob/master /python/tskit/trees.py> `_.
892
+ <https://github.com/tskit-dev/tskit/blob/main /python/tskit/trees.py> `_.
893
893
Ensure that your docstring renders correctly by building the documentation
894
894
(see :ref: `sec_development_documentation `).
895
895
11. Update your Pull Request (`rebasing <https://stdpopsim.readthedocs.io/en/
0 commit comments