Skip to content

yarikoptic-private/psyc161-hw1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

PSYC161 Homework #1

test push

This homework is a part of the PSYC161 Introduction to Programming for Psychologists & Neuroscientists course work.

Ultimate goal

On the example of a simple Python script/function establish practice of

  • interaction with Git and GitHub
  • automated testing using nose
  • code syntax conventions validation using flake8

Problem to solve

  1. Write recursive factorial_recursive to estimate factorial of an integer n. See wikipedia if not sure about what factorial is

"Extra credit"

  1. Write non-recursive version of a factorial function

  2. Investigate difference (well - ratio) in time of execution between the two. Use time module to track time.

HOWTO

  • "Clone" this repository on GitHub

  • In the terminal run

     git clone https://github.com/YOURLOGIN/psyc161-hw1
    

    to clone your remote clone to your local drive

  • Edit file factorial.py which provides a skeleton for your work

  • You are welcome to use any editor to edit the file, but we recommend starting to work with PyCharm

  • Function factorial_recursive definition provides a skeleton for you to fill in (docstring + implementation)

  • Test test_factorial() implements basic checks already which you need to expand to degree you feel necessary to state with assurance that your implementation. You can run all tests_ present in the file using nosetests -s -v factorial.py (run man nosetests in a terminal to check what options -s and -v are for. Do you need them both really ATM?)

  • git commit -m "Description of your changes" -a your work. Could be done multiple times

  • Make sure that your code passes tests, and also conforms to PEP8 - Style Guide for Python Code by running flake8 factorial.py and addressing noted issues.

  • Whenever you are ready to submit your homework, run git push to push your changes back to your clone on GitHub

  • Visit your GitHub page (http://github.com/YOURLOGIN/psyc161-hw1) and find your changes being present among Commits, and "Send a pull request" option present.

  • Send a "Pull request" against my original repository for review of the changes etc.

  • Review status of the pull request in a few minutes -- it should report successful pass through travis CI run which runs again nosetests and flake8 on my behalf. If not -- inspect travis's logs, commit fixes locally, push them to github again so that PR gets updated, and travis gets another run.

About

Homework assignment #1

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages