Skip to content

Commit

Permalink
Delete unnecessary files and update .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Cotswoldsmaker committed Mar 27, 2024
1 parent 0a9d44e commit e442012
Show file tree
Hide file tree
Showing 17 changed files with 650 additions and 153 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/.quarto/
users.txt
200 changes: 120 additions & 80 deletions _site/module-1/slides/3-python-basics.html

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions _site/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -964,5 +964,19 @@
"title": "Python basics",
"section": "Comments",
"text": "Comments\n\nComments are useful in explaining what code is supposed to do.\nThey are essential for when you, and others, need to read your code later to problem solve or add to your code.\nUse them sparingly, as they can clutter code.\nTry and make variable and function names self explanatory.\nYou can comment with the hastag or encapsulate with triple quotation marks:\n\n\n\ncomments.py\n\n# This is a single line comment\na_string = \"a string\"\n\n\"\"\" Double quotation mark multiline comment\n Here is some more of the comment\n\"\"\"\ndef i_am_a_function():\n return True\n\n''' Single quotation mark multiline comment\n Here is some more of the comment\n'''\ndef i_am_another_function():\n return True"
},
{
"objectID": "module-1/slides/3-python-basics.html#f-strings",
"href": "module-1/slides/3-python-basics.html#f-strings",
"title": "Python basics",
"section": "f-strings",
"text": "f-strings\n\nUserful to know\n\n\n\nf_string.py\n\nage = 25\nprint(f\"The patient's age is : { age }\")"
},
{
"objectID": "module-1/slides/3-python-basics.html#comments-1",
"href": "module-1/slides/3-python-basics.html#comments-1",
"title": "Python basics",
"section": "Comments",
"text": "Comments\n\nYou will also come across something called docstrings. These are basically comments associated with functions / methods and classes.\nYou will see them associated with modules (at the top of files).\n\n\n\ndocstrings.py\n\ndef i_am_function(args1, args2):\n \"\"\"A concise title\n\n A description of the function.\n\n Args:\n args1: I am the first argument to the function.\n args2: I am the second argument to the function.\n Returns:\n x: the addition of the 2 provided arguments.\n \"\"\"\n\n x = args1 + args2\n \n return x"
}
]
31 changes: 31 additions & 0 deletions create_user_folders.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import shutil
from pathlib import Path


def create_user_folders() -> None:
"""Creates user folders with module materials
For all the names in the 'user.txt' file, creates a new folder in the user
folder with the user's name. The modules folder is then copied across. If the
users folder already exists, then no new folder is created or files / folders
copied across.
"""
with open("users.txt", "r") as file:
for line in file:
username = line.strip()
username = username.replace(" ", "_")
folder_path = Path("users") / username
if folder_path.exists():
print(f"The folder {folder_path} already exists.")
else:
folder_path.mkdir(parents=True)
print(f"The folder {folder_path} has been created.")
shutil.copytree(
Path("modules"), folder_path, dirs_exist_ok=True
)

return


if __name__ == "__main__":
create_user_folders()
69 changes: 0 additions & 69 deletions module-1/hands-on/lesson_3.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ primaryColor="#F63366"
backgroundColor="#FFFFFF"
secondaryBackgroundColor="#F0F2F6"
textColor="#000000"
codeColor="#000000"

[runner]
magicEnabled = false
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def calculate_egfr(creatinine, age, gender, race):
"Invalid race. Please specify 'Afro-Caribbean' or 'other'."
)

eGFR = (
egfr = (
175
* ((creatinine * 0.011312) ** (-1.154))
* (age ** (-0.203))
* gender_factor
* race_factor
)
return int(eGFR)
return int(egfr)


def get_ckd_stage(egfr):
Expand Down Expand Up @@ -91,10 +91,12 @@ def main():
except Exception as e:
st.write(f"Awaiting appropriate inputs")
else:
ckd_stage = get_ckd_stage(egfr)
st.write(f"eGFR: { egfr }")
ckd_stage = get_ckd_stage(egfr)
st.write(f"CKD stage { ckd_stage }")

return


if __name__ == "__main__":
main()
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e442012

Please sign in to comment.