- Download and install git for Windows
- Choose "64-bit Git for Windows Setup" (assuming you're on modern hardware)
- On the Select Components screen, accept the defaults
- After selecting install location, choose "Use Git from the Windows Command Prompt"
- Checkout using Windows-style
- Choose MinTTy
see macOS instructions for macOS and
- Download Anaconda for Windows (Python 3.5)
There are a number of ways to install python 3.5 on macOS. Here are a few different ways:
- If you already have homebrew, (a package manager for macOS), you can simply run
brew install python3
- You can also install with the excellent Anaconda distribution
- You can also follow the Hitchhiker's Guide to Python instructions if you prefer a more hands-on approach.
- Use your package manager (apt-get, yum, etc), for example
sudo apt-get install python3
- Open the terminal (i.e., git bash, if using Windows)
- run
conda install pyodbc
Install directly from our repo
- run
pip install https://github.com/HealthCatalystSLC/healthcareai-py/zipball/master
- Fork this repo (look for the link in the top right corner of the current page)
- At the top of the repo homepage click the green 'Clone or download' button and copy the https link
- In your terminal run
git clone <PASTE THE LINK HERE>
cd
healthcareai-py directory
If you like using virtual environments (not required):
- In terminal, run
conda env create
to create the hcconda virtual environment - To activate your virtual environment, in terminal run
activate hcconda
(orsource activate hcconda
if using bash) - You might have to update packages, especially sklearn. The best way to do this is through Settings->Project->Project Interpreter and update scikit-learn
- Install PyCharm Community Edition
- Set path to git.exe via File -> settings -> Version Control -> Git
- Clone repo (if you haven't) via PyCharm -> VCS (at top) -> Checkout from version control -> Github
- Grab .git url from healthcareai-py repo in Github
- File -> Open and look for the healthcareai project (if it didn’t come up already)
If on Windows, install both Server Express and SSMS Express
- Navigate to the downloads page
- Look for and download ENU\x64\SQLEXPRWT_x64_ENU.exe
- When installing, be sure to check the box to install SSMS
- Create tables (on localhost) within a SAM database to receive predictive output using the code below (use SSMS if on Windows):
Note that these will go in the SAM database, if using the Health Catalyst analytics environment
```sql
CREATE TABLE [SAM].[dbo].[HCPyDeployClassificationBASE] (
[BindingID] [int] ,
[BindingNM] [varchar] (255),
[LastLoadDTS] [datetime2] (7),
[PatientEncounterID] [decimal] (38, 0),
[PredictedProbNBR] [decimal] (38, 2),
[Factor1TXT] [varchar] (255),
[Factor2TXT] [varchar] (255),
[Factor3TXT] [varchar] (255))
CREATE TABLE [SAM].[dbo].[HCPyDeployRegressionBASE] (
[BindingID] [int],
[BindingNM] [varchar] (255),
[LastLoadDTS] [datetime2] (7),
[PatientEncounterID] [decimal] (38, 0),
[PredictedValueNBR] [decimal] (38, 2),
[Factor1TXT] [varchar] (255),
[Factor2TXT] [varchar] (255),
[Factor3TXT] [varchar] (255))
```
- Right click on tests folder under healthcareai-py/healthcareai
- Click on Run Nosetest in test
- Note the text ‘Git: master’ in bottom-right of PyCharm
- Create new test branch via VCS -> Git -> Branches -> New Branch
- Push branch to github (ie, create origin) via VCS -> Git -> Push (CTRL-SHIFT-K)
- Install the following packages via the command line:
python -m pip install packagename
- pylint
- pyflakes
- Set these up via http://www.mantidproject.org/How_to_run_Pylint#PyCharm_-_JetBrains
- If your python is installed in
C:\Pythonxx
, then your parameters will be: - Program:
C:\Python34\Scripts\pylint.exe
- Parameters:
$FilePath$
- Working dir:
C:\Python34\Scripts
- If you are using a different Python distribution, you may need to find where Pylint is installed. For example, the same three parameters from above might be:
C:\Users\user.name\AppData\Local\Continuum\Anaconda3\Scripts\pylint
- Parameters:
$FilePath$
C:\Users\user.name\AppData\Local\Continuum\Anaconda3\Scripts
- Instead of using default parameter, use
$FilePath$
- For Anaconda, you may have to use
C:\Users\user.name\AppData\Local\Continuum\Anaconda3\Scripts\pylint
- Check all boxes
- Make sure pylint and pyflakes work
- Right-click on relevant directory in PyCharm (this will be where you’ve done work)
- Navigate to external tools
- Run both pylint and pyflakes
- Verify that there aren’t any issues with your code; please do this before sending pull requests
- Set maximum line width to 79 via Settings -> Editor -> Code Style -> Right margin
- Set tabs as spaces via Edit -> Convert Indents -> To Spaces
- Click Code -> Inspect code -> Whole project -> Look for section on Package requirements
- Under the lines related to sklearn, click ‘Ignore Requirement’
Set up your email and username for git (otherwise no attribution in github)
- Open a terminal (ie, git bash, if on Windows)
- Set up your email and user name for proper attribution
git config user.name "Billy Everyteen"
git config --global user.email "[email protected]"
- Configure line endings for windows:
git config core.autocrlf true
- Make git case sensitive for file names:
git config core.ignorecase false
- Improve merge conflict resolution via
git config --global merge.conflictstyle diff3
- If you use a personal email for github, and would rather have notifications go to your Health Cataylst email
- See GitHub Notification Settings -> Notification email -> Custom routing
- Set up SSH (if desired) so you can push to topic branch without password
- Open the terminal (whether in Git Bash, in Spyder, etc)
- Type
git checkout -b nameofbranch
- This creates the your local branch for work
- Note this branch should have your name in it
- Type
git push origin nameofbranch
- This pushes the branch to github (and now it's backed-up)
When your dev environment is set up, see the contribution workflow.