developers_guide.rst 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .. _developers_guide:
  2. =================
  3. Developers' Guide
  4. =================
  5. .. note::
  6. 1. The documentation guide (how to write a good documentation, naming
  7. conventions, docstring examples) is in the :ref:`documentation_guide`.
  8. 2. We highly recommend to get in touch with us (see :ref:`get_in_touch`) *before* starting
  9. to implement a new feature in Elephant. This way, we can point out synergies with
  10. complementary efforts and help in designing your implementation such that its integration
  11. into Elephant will be an easy process.
  12. 3. If you experience any problems during one of the steps below, please
  13. contact us and we'll help you.
  14. 1. Follow the instructions in :ref:`prerequisites` to setup a clean conda
  15. environment. To be safe, run::
  16. $ pip uninstall elephant
  17. to uninstall ``elephant`` in case you've installed it previously as a pip
  18. package.
  19. 2. Fork `Elephant <https://github.com/NeuralEnsemble/elephant>`_ as described
  20. in `Fork a repo <https://help.github.com/en/github/getting-started-with-github/fork-a-repo>`_.
  21. Download Elephant source code from your forked repo::
  22. $ git clone git://github.com/<your-github-profile>/elephant.git
  23. $ cd elephant
  24. 3. Install the requirements (either via pip or conda):
  25. .. tabs::
  26. .. tab:: pip
  27. .. code-block:: sh
  28. pip install -r requirements/requirements.txt
  29. pip install -r requirements/requirements-extras.txt # optional
  30. pip install -r requirements/requirements-tests.txt
  31. .. tab:: conda
  32. .. code-block:: sh
  33. conda env create -f requirements/environment.yml
  34. conda activate elephant
  35. pip install -r requirements/requirements-tests.txt
  36. 4. Before you make any changes, run the test suite to make sure all the tests
  37. pass on your system::
  38. $ nosetests .
  39. You can specify a particular module to test, for example
  40. ``test_statistics.py``::
  41. $ nosetests elephant/test/test_statistics.py
  42. At the end, if you see "OK", then all the tests passed (or were skipped
  43. because certain dependencies are not installed), otherwise it will report
  44. on tests that failed or produced errors.
  45. 5. **Implement the functional you want to add in Elephant**. This includes
  46. (either of them):
  47. * fixing a bug;
  48. * improving the documentation;
  49. * adding a new functionality.
  50. 6. If it is a new functionality, please write:
  51. - documentation (refer to :ref:`documentation_guide`);
  52. - tests to cover your new functions as much as possible.
  53. 7. Run the tests again as described in step 4.
  54. 8. Commit your changes::
  55. $ git add .
  56. $ git commit -m "informative commit message"
  57. $ git push
  58. If this is your first commit to the project, please add your name and
  59. affiliation/employer to :file:`doc/authors.rst`
  60. 9. Open a `pull request <https://github.com/NeuralEnsemble/elephant/pulls>`_.
  61. Then we'll merge your code in Elephant.