-
Notifications
You must be signed in to change notification settings - Fork 13
Home
This is the wiki for FabSim3.
This wiki is a project in progress, and more examples + troubleshooting tips should be added here over time.
We use the Github Work Flow. Here is a summary:
- Clone the repository (if you don't have write access to the FabSIm3 repository fork it first and clone your fork instead):
git clone https://github.com/djgroen/FabSim3.git
- Create a branch for your changes, name it descriptively:
git checkout -b my_branch
- Commit changes to your branch.
git commit -am "A descriptive message describing all the changes what I've done"
- Push changes (either to your fork or to the main repository if you have access):
git push -u origin my_branch
- Create a pull request and explain what you've done and why. Look under the "Pull Requests" tab in the main GitHub page.
In order for your pull request to be accepted, all the tests have to pass. You will see a little checkmark next to your commit which indicates whether that is the case.
pip install autopep8
autopep8 --in-place <filename>
autopep8 --in-place --recursive .
or
find . -name '*.py' -exec autopep8 --in-place '{}' \;
autopep8 --in-place --aggressive --max-line-length=79 <file_input>
Tests go under test/ subdirectory. See examples in there. We use the py.test framework which is very straightforward and does not require any boiler plate. Here is a simple way to write a test:
- The files containing the test should be named test_modulename.py. If no such file exists for your module, create one.
- Inside the tests file the functions that correspond to one test should be named test_functioname.
- Test with the assert statement, e.g. assert(my_function(arguments) = results).
The tests are automatically run by the travis continuous integration service.
Type
python -m pytest tests/
When testing installation scripts, both remote and local, make sure you test:
- Yourself.
- Yourself, twice in a row (to make sure cleanup is done consistently).
- A colleague.
- A colleague, twice in a row.
- A colleague using a different platform (Apple if you're using Linux or vice versa).