First I want to thank you A LOT for considering / taking the effort to contribute code to Signs. Below you will find some simple and mostly obvious guidelines on how to do it in the most valuable way.
In one picture, all contributions should keep in mind that great software is built like...
-
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
There are several ways programmers, data scientists and others can contribute to Signs.
SIGNS DEV PHILOSOPHY
- Doing is more interesting than achieving
- Having fun is more important than being productive
- User docs are as important as features
- Testing is more important than building
- Testing should be focused on function not coverage
- Creating great stuff (that works) takes long time
CODING STYLE GUIDELINES
We follow pep8. Because reading docs and particulary style guides more or less suck, we use Atom and the amazing Linter plugin so we don't have to.
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 some code to Signs. 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...
Committing Code
In the root of your local you will find a commit script, you can run it with:
./commit
Do this before committing as it ensures that basic sanity checks are done before commits.
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.
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.
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
Last but not least, if there is something you want to do what was not covered in the above sections, please share more by creating a new issue.
We're using Readthedocs for documentation. See the latest Autonomio documentation build for a reference of current status. The goal is to have comprehensive documentation, enough so that 100% of the actual practical capability is covered in terms of clear instructions. The documentation is automatically built from changes to docs/index.rst.
To contribute to the Manual, you have two options:
- The pro way: follow the steps in section 1.1
- A simpler way: follow the steps in section 1.4
One of the most useful ways to contribute is when you use Autononomio 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
Never ever, under any circumstances, 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 (coverage does not drop at all) should be the case always. If you can't do that, then at least explain the possible caveats you've made in your 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?"
Because Autonomio is to sombased on creating a very high level abstraction, and a lot of "magic" takes place without the user knowing about it, it's very important that we are elaborate in our documentation. This needs to take place to the extent that users like the one who made the following comment are happy:
Strong documentation and tutorials, with an emphasis on data prep. Don't abstract things at the cost of understanding what is going on behind the hood. I want to know how it all works, and what is being done to my data - I just don't want to have to code every step.
This is the kind of situation we are trying to create; a lot of mundane but hard or time consuming to do things are taken care of on behalf of the user, but if the user so desires, he or she can get a full (and clear!) picture of what's being done.
In order to pass code review (required for merging pull requests), together with your code in the same pull request you must provide the following updates to the documentation docs/index.rst.
- What does it do (a high level overview) 1.1) some use examples
- What data input is requires 2.1) some use examples
- What it outputs
- What parameters are there (a high level overview) 4.1) What options each parameter has 4.2) What is the function of each parameter option
In short summary, the goal is that the user can completely understand 100% of the functioning of the features. If something is done so that the user can’t see it when they are running the commands, we have to explain exactly and thoroughly what kind of automations are taking place.
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 ;)
-
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/autonomio/dev/core-module')
-
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)
-
Unless working on something completely new on a separate brach, never start new day without fetching origin
-
Make sure to update test script before pushing
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.