Jerrod and I were inspired by knowing that our carbon footprint is certainly too big, but not really knowing anything quantifiable about it. We set out to not only calculate our own carbon footprint, but see how to compares to others, and to see how future life choices would impact it.

Our calculator asks the user a series of questions and determines yearly CO2 emissions (in tons) for them, based upon values provided b the EPA. It then extrapolates this on a graph over the user's estimates lifetime (18-90). The graph also shows some other info though! At the user's current age, the graph diverges into several possible scenarios based upon some specified lifestyle choices. See the README for a more detailed breakdown of these. The graph also shows some base cases including an average American and a herd of 10 cows (far smaller than an average herd).

We build this exclusively using Python. We wrote a User class to manage all the info, then used several functions to gather info from the user and initialize a player object. We also hard-coded a few user objects based on pre-determined criteria. For the user object created by the human user, we created a list with list[0] = yearly_footprint and then each successive index equal to list[i-1] + yearly_footprint. The hard-coded users were similar, but would use the human's values for indices up until the user's age, and then us the respective object's yearly_footprint for addition instead of the human's. These lists were all plotted to a graph using matplotlib.pyplot, and then neatly labeled using Labellines. (see README).

We really struggled with where to even start! Jerrod and I are both new to this and have only completed 161 and 225. Using a class to handle everything was intimidating, but we sure are glad we did it that way. It made modifications down the road, and creating additional users, way easier than it could have been. We also ran into challenges with our math, and had to do lots of validation to make sure our program's output was even reasonable. From there, making the graph was a new concept and therefore took quite a bit of reading to figure out how to do. This was especially challenging because the graph wanted to start from zero, but we wanted it to start from age 18 (which corresponded to index 0).

Successful implementation of OOP! Also, a very aesthetically pleasing graph at the very end.

The most significant thing we learned about was working together, especially using git. We had both used it individually before, but not to collaborate We initially tried to not work on any given file at the same time in order to avoid conflicts, but that broke down pretty quickly and we were force to learn how to merge. It was actually pretty easy, especially with Pycharm's built in version control tool. Although I knew about classes before this project, I feel way more comfortable with them now.

We would like to implement a more detailed graph that also shows goals that humanity must reach in order to prevent the worst of climate change. There are a lot of differing opinions on this topic though, and finding a definitive source was challenging. Our graph also felt cluttered enough already. There is also a minor bug where the user's line can overlap with a default line, causing one of them to lay on top of the other and it appear as if one line isn't there at all.

Built With

Share this project: