Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
18 changes: 18 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Formatting

on:
pull_request:
branches: [main]

jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: prefix-dev/setup-pixi@v0
with:
cache: true

- name: formatting
run: pixi run check-nbs
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
exercises/*
templates/*.html
templates/*_files
# pixi environments
.pixi/*
!.pixi/config.toml
22 changes: 11 additions & 11 deletions lessons/lesson_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(\"Hello World!\") # Code before the hash sign will be executed"
"print(\"Hello World!\") # Code before the hash sign will be executed"
]
},
{
Expand Down Expand Up @@ -210,7 +210,7 @@
"source": [
"a = 3\n",
"b = 5\n",
"a + b**2 # this means to the power of 2"
"a + b**2 # this means to the power of 2"
]
},
{
Expand Down Expand Up @@ -322,7 +322,7 @@
"outputs": [],
"source": [
"a = 2 # int\n",
"b = 3.14 # float\n",
"b = 3.14 # float\n",
"\n",
"print(\"a is of type\", type(a))\n",
"print(\"b is of type\", type(b))\n",
Expand Down Expand Up @@ -419,8 +419,8 @@
"outputs": [],
"source": [
"# Note how we are using a list defined above in a prior Jupyter cell!\n",
"print(list_num[2]) # indexing\n",
"print(list_num[1:3]) # slicing\n",
"print(list_num[2]) # indexing\n",
"print(list_num[1:3]) # slicing\n",
"# Note how we are using a list defined above in a prior Jupyter cell!\\n"
]
},
Expand Down Expand Up @@ -557,7 +557,7 @@
"import numpy as np\n",
"\n",
"# series of numbers defined by start, stop, step\n",
"x = np.arange(0, 4*np.pi, 0.1)\n",
"x = np.arange(0, 4 * np.pi, 0.1)\n",
"y = np.sin(x)\n",
"plt.plot(x, y)\n",
"plt.show()"
Expand Down Expand Up @@ -630,7 +630,7 @@
"# what is wrong here? Fix it.\n",
"\n",
"a = 12\n",
"b = '23'\n",
"b = \"23\"\n",
"print(a + b)"
]
},
Expand All @@ -655,7 +655,7 @@
"outputs": [],
"source": [
"# Solution\n",
"a = 30\n"
"a = 30"
]
},
{
Expand All @@ -671,7 +671,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Solution\n"
"# Solution"
]
},
{
Expand All @@ -688,7 +688,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Solution\n"
"# Solution"
]
},
{
Expand All @@ -706,7 +706,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Solution\n"
"# Solution"
]
}
],
Expand Down
25 changes: 12 additions & 13 deletions lessons/lesson_02.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,12 @@
"metadata": {},
"outputs": [],
"source": [
"seq = 'GTACCTTGATTTCGTAA'\n",
"seq = \"GTACCTTGATTTCGTAA\"\n",
"\n",
"print(seq.find('GTA'))\n",
"print(seq.find('CCT'))\n",
"print(seq.find('GTA', 1))\n",
"print(seq.find('GTA', 1, 10))"
"print(seq.find(\"GTA\"))\n",
"print(seq.find(\"CCT\"))\n",
"print(seq.find(\"GTA\", 1))\n",
"print(seq.find(\"GTA\", 1, 10))"
]
},
{
Expand All @@ -608,7 +608,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(seq.rfind('TTT'))"
"print(seq.rfind(\"TTT\"))"
]
},
{
Expand All @@ -624,7 +624,7 @@
"metadata": {},
"outputs": [],
"source": [
"seq.count('TA')"
"seq.count(\"TA\")"
]
},
{
Expand Down Expand Up @@ -667,8 +667,8 @@
"print(seq.strip(\"T\")) # removes nothing\n",
"print(seq.lstrip(\"TAGC\")) # removes all leading letters matching the query\n",
"print(seq.rstrip(\"tagc\")) # removes all trailing letters matching the query\n",
"print(seq.removeprefix(\"GtAc\")) # removes exact prefix\n",
"print(seq.removesuffix(\"GTaa\")) # removes exact suffix"
"print(seq.removeprefix(\"GtAc\")) # removes exact prefix\n",
"print(seq.removesuffix(\"GTaa\")) # removes exact suffix"
]
},
{
Expand Down Expand Up @@ -786,8 +786,7 @@
"# whole divider\n",
"\n",
"\n",
"# Remainder\n",
"\n"
"# Remainder"
]
},
{
Expand Down Expand Up @@ -818,7 +817,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Solution\n"
"# Solution"
]
},
{
Expand Down Expand Up @@ -848,7 +847,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Solution\n"
"# Solution"
]
}
],
Expand Down
14 changes: 7 additions & 7 deletions lessons/lesson_03.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
"source": [
"# Solution\n",
"dna1 = \"ATTATTAGGACCACA\"\n",
"dna2 = \"ATTATTAGGAACACA\"\n"
"dna2 = \"ATTATTAGGAACACA\""
]
},
{
Expand All @@ -461,7 +461,7 @@
"source": [
"# Solution\n",
"seq1 = \"ACGTAGCTAGCTAGCTAGCTA\"\n",
"seq2 = \"GTGCATGCTAGCTAGCTAGCA\"\n"
"seq2 = \"GTGCATGCTAGCTAGCTAGCA\""
]
},
{
Expand All @@ -479,7 +479,7 @@
"outputs": [],
"source": [
"# Solution\n",
"seq = \"ATGGACGTAGTCGGCCCGTGAAAGCGATCGATCG\"\n"
"seq = \"ATGGACGTAGTCGGCCCGTGAAAGCGATCGATCG\""
]
},
{
Expand All @@ -505,7 +505,7 @@
"source": [
"# Solution\n",
"seq1 = \"GGCTATGCCGCCGTTATACTCGAGACTAAGTAGTC\"\n",
"seq2 = \"GGCTATGCCGCCGTTATATCGAGACTAAAGTAGTC\"\n"
"seq2 = \"GGCTATGCCGCCGTTATATCGAGACTAAAGTAGTC\""
]
},
{
Expand All @@ -522,7 +522,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Solution\n"
"# Solution"
]
},
{
Expand All @@ -539,11 +539,11 @@
"metadata": {},
"outputs": [],
"source": [
"# Solution\n"
"# Solution"
]
}
],
"metadata": {
"metadata": {
"celltoolbar": "Slideshow",
"kernelspec": {
"display_name": "python-course",
Expand Down
Loading