Development

alex arsenovic edited this page Aug 22, 2017 · 12 revisions

NOTE: if the instructions on this page are too complicated for you, but you still would like to contribute, email me (alexanderarsenovic at gmail.com ).

Contributing Code

skrf uses the Fork + Pull collaborative development model. If this new to you, see github’s articles on forking and pull requests.

Basically, you will fork the scikit-rf repo, and then send a pull request for your additions to be merged into the main scikit-rf repository.

The basic work flow is,

# create your own fork of scikit-rf, say ME/scikit-rf
# clone your new fork locally using either:
git clone ME@github.com:ME/scikit-rf.git 

# if you have ssh keys setup, or if not. then
git clone https://github.com/scikit-rf/scikit-rf.git 

# ... make your changes...

# commit changes locally
git commit -a 

# push changes to your repo
git push origin 

# create a pull request on github.com 

To keep your local version in-sync with the scikit-rf repository, add a remote branch, call it upstream. From this branch you can fetch and merge the main repo's changes into your local repo.

git remote add upstream https://github.com/scikit-rf/scikit-rf.git

# Fetch any new changes from the original repo
git fetch upstream

# Merges any changes fetched into your working files
git merge upstream/master

Tests

The structure of the testing generally follows the conventions ofnumpy/scipy. Test cases live in the module, or submodule, which they are testing, and are located in a directory called tests. So, the tests of the media module are located at skrf/media/tests/. Tests can be run most easily with nosetest.

You probably dont want to run the tests for the virtual instruments skrf.vi with the rest of the tests, so to prevent this install nose-exclude

To run all the tests (except the virtual instruments)

cd scikit-rf/skrf
nosetests --exclude-dir=vi

Or, to run test a single module or single test,

nosetests media/
# ...
nosetests tests/test_network.py
# ...

Documentation

Examples

Usage examples of skrf are welcomed, especially when adding new features. Currently, we are using ipython notebooks to write the examples, which live in scikit-rf/docs/source/examples/. The requirements to build the docs are kept in scikit-rf/readthedocs-environment.yml. At a minimium you will need to install nbstripout so that the output is not tracked in git (or the repo would grow infinitely). And to build the docs we use a sphinx extension called http://nbsphinx.readthedocs.io/, (we actually use a fork of this as listed in the readthedocs-environment.yml requirements.

Reference (API)

The reference documentation for the functions, classes, and submodules are documented in docstrings following the conventions put forth by Numpy/Scipy. The documentation as a whole is generated using sphinx, and written using reStructed Text.

The documentation source can be found in docs/sphinx/source/. These are built by

cd doc/sphinx
make html

The built docs then reside in doc/sphinx/build/html. The docs are automatically built and served by readthedocs when a Pull Request is accepted.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.