Thank you very much for taking the effort to contribute Talos. Below you will find some simple and mostly obvious guidelines on how to do it in the most valuable way.
-
1.1. Code
1.2. Ideas
1.3. Testing
1.4. Something Else
1.5. Documentation
1.6. Examples
-
Important Precautions for Code Contributions
2.1. Planning
2.2. Testing
2.3. Documentation
2.4. Branch Management
There are several ways programmers, data scientists and others can contribute to Autonomio.
AUTONOMIO DEV PHILOSOPHY
- Doing is more interesting than achieving
- Having fun is more important than being productive
- Code coverage can, and needs to be 100%
- User docs are more important than new features
- Testing is more important than building
- Creating great stuff takes long time
CODING STYLE GUIDELINES
We follow pep8. Because reading docs and particulary style guides more or less suck, and one way is to use Atom and the amazing Linter plugin.
MORE STYLE GUIDELINES
We also make the best effort in moving towards following pep20:
- Beautiful is better than ugly
- Explicit is better than implicit
- Simple is better than complex
- Complex is better than complicated
- Flat is better than nested
- Sparse is better than dense
- Readability counts
- Special cases aren't special enough to break the rules
- Although practicality beats purity
- Errors should never pass silently
- Unless explicitly silenced
- In the face of ambiguity, refuse the temptation to guess
- There should be one-- and preferably only one --obvious way to do it
- Although that way may not be obvious at first unless you're Dutch
- Now is better than never
- Although never is often better than right now
- If the implementation is hard to explain, it's a bad idea
- If the implementation is easy to explain, it may be a good idea
- Namespaces are one honking great idea -- let's do more of those
It will be great if you can contribute towards open issues. To do this, the best way is to:
- check out the open issues
- join the conversation and share your willingness to contribute
- somebody will help you get started / provide more details if needed
- fork the current dev branch
- make your changes to your own fork/repo
- test, test, test
- if it's a new feature, make changes to test_script.py accordingly
- make sure that Travis build passes
- come back and make a pull request
What we really try to avoid, is being this guy...
Same as above, but start by creating a new issue to open a discussion on the idea you have for contribution.
In case you don't want to contribute code, but have a feature request or some other idea, that is a great contribution as well and will be much appreciated. You can do it by creating a new issue.
Another great way to contribute is testing, which really just means using Talos and reporting issues as they might arise.
Testing comes in two forms:
Just use Autonomio for any open challenge you are working on. Or pick one from Kaggle.
- Work with Autonomion in data science challenges
- Try a lot of different things
- Report issues as you may find them
We're using Coveralls for code coverage testing, and even the smallest contributions to this end help a great deal.
- Follow the instructions in section 1.1 and 1.3.1
- Use your own fork to see how the results improve in comparison to current Master
Best way to get started might be starting a discussion as they might arise.
At the moment there is no manual / documentation, so contributions here would be wonderful. Generally it's better to do something very simple and clear. It seems that RTD is a good option as it can read INDEX.rst in /docs and a slightly more complex but much better looking option would be slate.
One of the most useful ways to contribute is when you use Talos for an actual project / challenge, and then write a blog post about your experience with code examples.
Before even thinking about making any changes to actual code:
- Define what is happening now (what needs to be changed)
- Define what is happening differently (once the code is changed)
- Use text search to find which files / functions are affected
- Make sure that you understand what each function is doing in relation to the change
Don't commit code that is not thoroughly tested:
-
Run through the code changes and ask yourself if it makes sense
-
Create a clean environment and install from your fork:
pip install git+http://your-fork-repo-address.git
-
Perform all the commands where your changes are involved and note them down
-
Change the test_script.py in the repo root with the commands from step 3
-
Make sure that code coverage is not becoming lower*
-
Make sure that Travis build is passed
*In terms of code coverage, 100% coverage for your changes would be ideal. If you can't do that, then at least explain the possible caveats in the commit details and also in the comments section of the pull request you are making.
Once you've gone through all these steps, take a short break, come back and ask yourself the question:
"WHAT COULD GO WRONG?"
If you've been assigned as a reviewer of a given pull request, unless you've been explicitly asked to do so, DON'T MERGE just approve the review and share in the comments what you think. If you don't have any comments, just confirm with a comment that you don't have any. While this is kind of obvious, don't start reviewing before you can see all the tests have passed ;)
The documentation should:
- be easy to understand
- develop together with code (when new functions are added docs are updated)
- use code examples together with the descriptions
An example of a reasonable quality documentation here.
- Nothing ever gets pushed directly to master
- Merges to master should always be reviewed
- Features are updated to personal branch and from there to dev
- Once master is stable, it gets merged with production which updates pypi
- New release is made from each production merge
- Personal dev branches may be opened by repo members
- Non-members should have a private fork
- Contributor (user) forks
autonomo/talos
toorigin/talos
. - user clones
origin/talos
tolocal
, sets upstream branch to point toautonomio/talos
(viagit remote add upstream ...
, where...
is the address you see when you click on the git clone button onautonomio/talos
) and then checks out tomaster
. - Immediately
git checkout -b my_feature_branch
. All work on a new feature is done on this branch or its children. - When work is done on
my_feature_branch
, user can check out tolocal/master
and ensuremaster
is up to date (git pull upstream master
), and then merge on their local branch:git merge --no-ff my_feature_branch
, resolve any merge conflicts, thengit push origin master
and open a PR. This PR will beorigin/master > autonomio/master
. - Resolve any conflicts with PR if any remain, then work is done.
-
First things first, make sure you understand this 100%
-
Also make sure that you clearly understand everything that is said here
-
Working on your local machine, only have one folder (the git remote)
-
Load it as module with:
import sys return sys.path.insert(0, '/home/dev/talos')
-
Frequently fetch origin to make sure you get latest changes from other people
-
Don’t work in separate forks, but in branches
-
Keep commits as small as possible
-
Make clear commit messages (explain what you actually are changing)
For Mac users Github desktop is pretty fantastic. For Linux users the GUIs are not so fantastic. Atom looks like a good cross-platform option.