This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[pytest] | |
addopts = --cov-report xml:cov.xml --cov-report term-missing --cov=mypackagename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
response_yes = ['yes', 'y'] | |
response_no = ['no', 'n'] | |
response_cancel = ['quit', 'q', 'exit', 'cancel'] | |
known_responses = response_yes + response_no + response_cancel | |
user_response = '' | |
while user_response.lower() not in known_responses: | |
user_response = input("Please input a value, or enter 'quit': ") | |
print(user_response) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install code directly from github with: | |
pip install git+https://github.com/path/to/repo | |
pip install git+https://github.com/path/to/repo.git | |
# Note: the repository must include setup.py file to be pip installable. | |
# You can specify a specific repository branch with: | |
pip install git+https://github.com/path/to/repo@branchname | |
pip install git+https://github.com/path/to/repo.git@branchname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
from autoscript_sdb_microscope_client import SdbMicroscopeClient | |
from autoscript_sdb_microscope_client.enumerations import * | |
from autoscript_sdb_microscope_client.structures import * | |
microscope = SdbMicroscopeClient() | |
microscope.connect() | |
object_to_pickle = microscope.imaging.get_image() |
Either copy the aliases from the .gitconfig
or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from remotes:
git pr 4
- creates local branchpr/4
from the githubupstream
(if it exists) ororigin
remote and checks it outgit pr 4 someremote
- creates local branchpr/4
fromsomeremote
remote and checks it out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bokeh.io import push_notebook, output_notebook, show, save | |
from bokeh.layouts import row, column, layout | |
from bokeh.plotting import figure | |
output_notebook() |
https://docs.pytest.org/en/latest/usage.html
pytest
pytest path/to/tests/
pytest path/to/tests/test_file.py
pytest path/to/tests/test_file.py::test_func
pytest path/to/tests/test_file.py::TestClass
ID = the pull request ID number (eg: 3544) BRANCHNAME = the name of the pull request branch (eg: 'image-registration')
git fetch upstream pull/ID/head:BRANCHNAME
git checkout BRANCHNAME
See: https://help.github.com/articles/checking-out-pull-requests-locally/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: python | |
python: | |
- "3.5" | |
- "3.6" | |
install: | |
- sudo apt-get update | |
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; | |
- bash miniconda.sh -b -p $HOME/miniconda | |
- export PATH="$HOME/miniconda/bin:$PATH" | |
- hash -r |