Giter Club home page Giter Club logo

intro-git-py-workshop's People

Contributors

fboxwala avatar malachiw avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

intro-git-py-workshop's Issues

add unit tests for our core functions

Our core module is completely un-unit-tested! This is appalling and very non-pythonic.

Use the unittest library to create some useful unit tests for Caduceus to make the lives of future developers easier.

add support for parsing data about birds

Currently Caduceus only reads and organizes data about snakes, from csv files of a specific format. It would be cool if we could also use Caduceus to organize data about birds.

However, bird data does not generally specify a bird's length. Much more important is a bird's wingspan.

Add a feature to caduceus to read data from two csv files with the following data:

File1: common name, scientific name
File2: scientific name, weight, wingspan

And a function to print birds by their speed. There is test data available in data/

always be using single quotes

Our core module has a mix of single and double quotes for strings. This is inconsistent! Let's use single quotes all around.

add error handling to core.build_snakes

Our build_snakes function reads two .csv files and expects to see the following columns:

File1: common name, scientific name
File2: scientific name, weight, length

If any of these columns are missing we get messy python errors:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "caduceus/core.py", line 30, in build_snakes
    snake.weight = int(row["weight"])
TypeError: int() argument must be a string or a number, not 'NoneType'

We should add error handling to build_snakes so that if a column is missing we exit with a nice error message such as:

"Caduceus expects specific columns in csv files to work. See help(build_snakes) for the specifications"

add docstrings everywhere

Docstrings are strings at the beginning of python functions and classes giving a small description of what the function does. You can call help(name_of_function) to see a function's docstring.

We currently have docstrings for both the functions in core.py, but are missing docstrings in the rest of our classes and class methods.

PEP257 lays out some conventions for docstrings.

Some easy to parse examples can be found here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.