Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added project_spring_2020/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": [
"In this project I would like to learn how to use python programming language to convert the tempratures.\n",
"There are about 5 major temperature scales are used in world. Among them, the Fahrenheit and Celsius scales are mostly used in our daily life,\n",
Expand Down Expand Up @@ -74,13 +72,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"jupyter": {
"source_hidden": true
"execution_count": 3,
"metadata": {},
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (<ipython-input-3-1b502231282f>, line 1)",
"output_type": "error",
"traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-3-1b502231282f>\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m Data type\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
}
},
"outputs": [],
],
"source": [
"Data type\n",
"int\n",
Expand All @@ -94,11 +97,7 @@
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"metadata": {},
"outputs": [],
"source": [
"#set the variables\n",
Expand All @@ -117,22 +116,19 @@
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"122.0"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
"ename": "NameError",
"evalue": "name 'temp_c' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-2-c3fd82e255a9>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# assume temp_c = 50, calculate temp_f\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mtemp_f\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mtemp_c\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0;36m1.8\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m32\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mtemp_f\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'temp_c' is not defined"
]
}
],
"source": [
Expand Down Expand Up @@ -830,7 +826,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down
24 changes: 24 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="temperature conversion",
version="0.0.1",
author="insert name here",
author_email="insert email here",
description="insert the description here",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/niezu/project_spring_2020",
scripts = ['project_spring_2020/my_final_project.ipynb'],
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',

)
15 changes: 8 additions & 7 deletions tests/sample_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
def test_nothing_in_particular():
from pathlib import Path
current_dir = Path.cwd()
print('hello world!')
# below I am adding an example unit test

from project_spring_2020.my_final_project.ipynb import convert_c_to_f

def test_convert_c_to_f():
temp_c = 50
temp_f = convert_c_to_f(temp_c)
assert temp_f == 122

assert 2 + 2 != 5

def test_that_broken_means_broken():
assert 4 == 2