{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# Today's Agenda\n", "\n", "Today we'll discuss how to:\n", "- Install [Anaconda](https://www.continuum.io/downloads)\n", "- Create your [Github Student Account](https://education.github.com/)\n", "- Git Tutorial" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Slack - Important info!\n", "The Slack group is now working and ready to go!
\n", "\n", "The Slack website is: [https://https://vandyastroseminar.slack.com](https://https://vandyastroseminar.slack.com)\n", "\n", "Fill out the following Google Form with your info: [https://goo.gl/y2ammQ](https://goo.gl/y2ammQ)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Python Anaconda\n", "\n", "Anaconda is a great way to handle your modules and their dependencies.\n", "\n", "You have the option to use install __Python 2.7__ or __Python 3.5__. In astronomy, the version _Python 2.7_ is mostly used, although new modules are adoption version 3.5\n", "\n", "- [Download Anaconda](https://www.continuum.io/downloads)\n", "\n", "After the installation is complete, you should see that your \"_PATH_\" was modified in your \"__~/.bashrc__\" (Linux) or \"__~/bash_profile__\" file." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```bash\n", "# added by Anaconda 1.6.1 installer\n", "export PATH=\"~/anaconda2/bin:$PATH\"\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once the _Anaconda_ path is appended to your \"_PATH_\", you should be able to see something like this:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```python\n", "IPython 5.0.0 -- An enhanced Interactive Python.\n", "? -> Introduction and overview of IPython's features.\n", "%quickref -> Quick reference.\n", "help -> Python's own help system.\n", "object? -> Details about 'object', use 'object??' for extra details.\n", "In [1]: \n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Updated Anaconda modules\n", "\n", "Whenever you want to update your Python modules to the latest versions, you can just run these commands from the terminal:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```bash\n", "conda update condaconda update conda\n", "conda update condaconda update anaconda\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Installing new Modules" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you want to install a new module that is hosted by Anaconda, you can type:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```bash\n", "conda install \n", "```\n", "\n", "And the package should be installed with _all_ the necessary dependencies." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Git and Github" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Nowadays it is really important to keep track of every change that make to a code, especially if you're \n", "part of a large organizations.\n", "\n", "Git is a tool for _version control_ of your code, i.e. you can keep track of\n", "- any changes made to your code\n", "- any issues with your code\n", "- you can consult other team members about implementing a new feature\n", "- you can restore a code to a previous version\n", "- etc.\n", "\n", "In a nutshell, __you should be using Git__." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "_Git_ comes already pre-installed with _Anaconda_. You can test whether it is installed on your machine by typing:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```bash\n", "which git\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And you shoud see the path to the _git_ executable.\n", "\n", "If it's not installed, you can install it from [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating your Github Account" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\"Github\" is a website for you to manage your repositories and collaborate with other people.\n", "\n", "_Github_ offers a __Student Pack__ for free ([https://education.github.com/](https://education.github.com/)).\n", "You have to use your __@vanderbilt__ email address to get it. Or you can sign up for you regular Github account.\n", "\n", "This lets you create __public__ and __private__ repositories." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Github Concepts\n", "\n", "#### Git Commands\n", "Before you begin, make sure _git_ is working correctly ([here](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup)):" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "$ git config --global user.name \"John Doe\"\n", "$ git config --global user.email \"johndoe@example.com\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To clone the local repository" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "$ git clone https://github.com/VandyAstroML/Vanderbilt_Computational_Bootcamp.git" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Important Git commands\n", "\n", "- __git clone__: Clone an existing repository\n", "- __git init__: Initialize a git repository. This will create a new repository in your computer\n", "- __git pull__: This will pull any changes that have been made, and merged them to you current version of the repository\n", "- __git push__: It will push all your changes to the repository\n", "- __git commit -m \"\"__: Commit any new changes made to the files" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setting up SSH Keys" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "SSH are a great way to not type your passworkd every time that you want to make any changes to your repositories.\n", "\n", "The instructions to do so are listed in [here](https://help.github.com/articles/connecting-to-github-with-ssh/)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.11" } }, "nbformat": 4, "nbformat_minor": 0 }