- Download and install Git for Windows: https://git-scm.com/download/win
- Choose Use Git from Git Bash only
- Checkout using Windows-style
- Chose Mintty
Install healthcareai via these instuctions: https://github.com/HealthCatalystSLC/healthcareai-py/blob/master/README.rst
- 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 HCRTools repo in Github
- Set parent directory to C:/Source
- Name directory healthcareai-py
- File -> Open and look for the healthcareai project (if it didn’t come up already)
- Create a destination table for the test predictions by executing this in SSMS:
- 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))
- Verify that unit tests pass
- Right click on tests folder under healthcareai-py/healthcareai
- Click on Run Nosetest in test
- Create test branch and push it to github
- 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:Python34Scriptspylint.exe
- Parameters:
$FilePath$ - Working dir: C:Python34Scripts
- 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:Usersuser.name AppDataLocalContinuumAnaconda3Scriptspylint
- Parameters:
$FilePath$ - C:Usersdavid.healeyAppDataLocalContinuumAnaconda3Scripts
- Instead of using default parameter, use
$FilePath$ - For Anaconda, you may have to use C:Usersuser.name AppDataLocalContinuumAnaconda3Scriptspylint
- 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)
- Set git user name and work email
- git config user.name "Billy Everyteen"
- git config --global user.email "your_email@example.com"
- Configure line endings for windows:
git config core.autocrlf true - Make git case sensitive for file names:
git config core.ignorecase false
- Set up SSH (if desired) so you can push to topic branch without password