Skip to content

Commit

Permalink
Merge pull request #44 from MilagrosMarin/main
Browse files Browse the repository at this point in the history
Fix codespell and black formatting
  • Loading branch information
dimitri-yatsenko authored Jul 3, 2024
2 parents 008dccf + e21c53c commit 8b4b750
Show file tree
Hide file tree
Showing 53 changed files with 2,273 additions and 1,651 deletions.
7 changes: 4 additions & 3 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[codespell]
skip = .git,*.pdf,*.svg
ignore-regex = ^\s*"image/\S+": ".*
skip=.git,*.pdf,*.svg,*.ipynb
ignore-regex=^\s*"image/\S+": ".*

#
# ignore-words-list =
ignore-words-list=shepard,nevers,nin,DaSy,Fo,Alle,ND
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: Codespell

on:
Expand All @@ -18,5 +17,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Codespell
uses: codespell-project/actions-codespell@v2
106 changes: 51 additions & 55 deletions completed_tutorials/01-DataJoint Basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
}
],
"source": [
"schema = dj.schema('tutorial')"
"schema = dj.schema(\"tutorial\")"
]
},
{
Expand Down Expand Up @@ -421,7 +421,7 @@
"metadata": {},
"outputs": [],
"source": [
"Mouse.insert1((0, '2017-03-01', 'M'))"
"Mouse.insert1((0, \"2017-03-01\", \"M\"))"
]
},
{
Expand Down Expand Up @@ -533,11 +533,7 @@
"metadata": {},
"outputs": [],
"source": [
"data = {\n",
" 'mouse_id': 100,\n",
" 'dob': '2017-05-12',\n",
" 'sex': 'F'\n",
"}"
"data = {\"mouse_id\": 100, \"dob\": \"2017-05-12\", \"sex\": \"F\"}"
]
},
{
Expand Down Expand Up @@ -661,11 +657,7 @@
"metadata": {},
"outputs": [],
"source": [
"data = [\n",
" (1, '2016-11-19', 'M'),\n",
" (2, '2016-11-20', 'unknown'),\n",
" (5, '2016-12-25', 'F')\n",
"]"
"data = [(1, \"2016-11-19\", \"M\"), (2, \"2016-11-20\", \"unknown\"), (5, \"2016-12-25\", \"F\")]"
]
},
{
Expand All @@ -691,8 +683,8 @@
"outputs": [],
"source": [
"data = [\n",
" {'mouse_id': 10, 'dob': '2017-01-01', 'sex': 'F'},\n",
" {'mouse_id': 11, 'dob': '2017-01-03', 'sex': 'F'},\n",
" {\"mouse_id\": 10, \"dob\": \"2017-01-01\", \"sex\": \"F\"},\n",
" {\"mouse_id\": 11, \"dob\": \"2017-01-03\", \"sex\": \"F\"},\n",
"]\n",
"\n",
"# insert them all\n",
Expand Down Expand Up @@ -848,10 +840,12 @@
],
"source": [
"Mouse.insert1(\n",
"{'mouse_id': 0,\n",
" 'dob': '2018-01-01',\n",
" 'sex': 'M',\n",
"})"
" {\n",
" \"mouse_id\": 0,\n",
" \"dob\": \"2018-01-01\",\n",
" \"sex\": \"M\",\n",
" }\n",
")"
]
},
{
Expand All @@ -868,11 +862,11 @@
"outputs": [],
"source": [
"data = [\n",
" {'mouse_id': 12, 'dob': '2017-03-21', 'sex': 'F'},\n",
" {'mouse_id': 18, 'dob': '2017-05-01', 'sex': 'F'},\n",
" {'mouse_id': 19, 'dob': '2018-07-21', 'sex': 'M'},\n",
" {'mouse_id': 22, 'dob': '2019-12-15', 'sex': 'F'},\n",
" {'mouse_id': 34, 'dob': '2018-09-22', 'sex': 'M'}\n",
" {\"mouse_id\": 12, \"dob\": \"2017-03-21\", \"sex\": \"F\"},\n",
" {\"mouse_id\": 18, \"dob\": \"2017-05-01\", \"sex\": \"F\"},\n",
" {\"mouse_id\": 19, \"dob\": \"2018-07-21\", \"sex\": \"M\"},\n",
" {\"mouse_id\": 22, \"dob\": \"2019-12-15\", \"sex\": \"F\"},\n",
" {\"mouse_id\": 34, \"dob\": \"2018-09-22\", \"sex\": \"M\"},\n",
"]\n",
"\n",
"# insert them all\n",
Expand Down Expand Up @@ -1014,7 +1008,7 @@
"metadata": {},
"outputs": [],
"source": [
"# ENTER YOUR CODE - Insert more mice\n"
"# ENTER YOUR CODE - Insert more mice"
]
},
{
Expand Down Expand Up @@ -1135,10 +1129,10 @@
"outputs": [],
"source": [
"data = {\n",
" 'mouse_id': 0,\n",
" 'session_date': '2017-05-15',\n",
" 'experiment_setup': 0,\n",
" 'experimenter': 'Edgar Y. Walker'\n",
" \"mouse_id\": 0,\n",
" \"session_date\": \"2017-05-15\",\n",
" \"experiment_setup\": 0,\n",
" \"experimenter\": \"Edgar Y. Walker\",\n",
"}\n",
"\n",
"Session.insert1(data)"
Expand Down Expand Up @@ -1362,10 +1356,10 @@
],
"source": [
"data = {\n",
" 'mouse_id': 0,\n",
" 'session_date': '2018-01-15',\n",
" 'experiment_setup': 100,\n",
" 'experimenter': 'Jacob Reimer'\n",
" \"mouse_id\": 0,\n",
" \"session_date\": \"2018-01-15\",\n",
" \"experiment_setup\": 100,\n",
" \"experimenter\": \"Jacob Reimer\",\n",
"}\n",
"\n",
"Session.insert1(data)\n",
Expand All @@ -1387,10 +1381,10 @@
"outputs": [],
"source": [
"data = {\n",
" 'mouse_id': 18,\n",
" 'session_date': '2018-01-15',\n",
" 'experiment_setup': 101,\n",
" 'experimenter': 'Jacob Reimer'\n",
" \"mouse_id\": 18,\n",
" \"session_date\": \"2018-01-15\",\n",
" \"experiment_setup\": 101,\n",
" \"experimenter\": \"Jacob Reimer\",\n",
"}\n",
"\n",
"# insert them all\n",
Expand Down Expand Up @@ -1525,10 +1519,10 @@
"outputs": [],
"source": [
"bad_data = {\n",
" 'mouse_id': 9999, # this mouse doesn't exist!\n",
" 'session_date': '2017-05-15',\n",
" 'experiment_setup': 0,\n",
" 'experimenter': 'Edgar Y. Walker'\n",
" \"mouse_id\": 9999, # this mouse doesn't exist!\n",
" \"session_date\": \"2017-05-15\",\n",
" \"experiment_setup\": 0,\n",
" \"experimenter\": \"Edgar Y. Walker\",\n",
"}"
]
},
Expand Down Expand Up @@ -1709,7 +1703,7 @@
}
],
"source": [
"Mouse & 'mouse_id = 0'"
"Mouse & \"mouse_id = 0\""
]
},
{
Expand Down Expand Up @@ -2886,7 +2880,7 @@
}
],
"source": [
"female_mice & 'mouse_id > 10'"
"female_mice & \"mouse_id > 10\""
]
},
{
Expand Down Expand Up @@ -3006,7 +3000,7 @@
}
],
"source": [
"Mouse & Session "
"Mouse & Session"
]
},
{
Expand Down Expand Up @@ -3999,7 +3993,7 @@
}
],
"source": [
"Mouse.proj('sex')"
"Mouse.proj(\"sex\")"
]
},
{
Expand Down Expand Up @@ -4129,7 +4123,7 @@
}
],
"source": [
"Mouse.proj(date_of_birth='dob')"
"Mouse.proj(date_of_birth=\"dob\")"
]
},
{
Expand Down Expand Up @@ -4239,7 +4233,7 @@
}
],
"source": [
"(Mouse * Session).proj(age='datediff(session_date, dob)')"
"(Mouse * Session).proj(age=\"datediff(session_date, dob)\")"
]
},
{
Expand Down Expand Up @@ -4379,7 +4373,7 @@
}
],
"source": [
"(Mouse * Session).proj(..., age='datediff(session_date, dob)')"
"(Mouse * Session).proj(..., age=\"datediff(session_date, dob)\")"
]
},
{
Expand Down Expand Up @@ -4690,7 +4684,7 @@
}
],
"source": [
"(Mouse & 'sex = \"M\"').fetch(format='frame')"
"(Mouse & 'sex = \"M\"').fetch(format=\"frame\")"
]
},
{
Expand All @@ -4717,7 +4711,7 @@
}
],
"source": [
"(Mouse & 'sex = \"M\"').fetch('KEY')"
"(Mouse & 'sex = \"M\"').fetch(\"KEY\")"
]
},
{
Expand All @@ -4733,7 +4727,7 @@
"metadata": {},
"outputs": [],
"source": [
"sex, dob = Mouse.fetch('sex', 'dob')"
"sex, dob = Mouse.fetch(\"sex\", \"dob\")"
]
},
{
Expand Down Expand Up @@ -4818,7 +4812,7 @@
}
],
"source": [
"info = Mouse.fetch('sex', 'dob', as_dict=True)\n",
"info = Mouse.fetch(\"sex\", \"dob\", as_dict=True)\n",
"info"
]
},
Expand Down Expand Up @@ -4853,7 +4847,9 @@
}
],
"source": [
"mouse_0 = (Mouse & {'mouse_id': 0}).fetch1() # \"fetch1()\" because we know there's only one\n",
"mouse_0 = (\n",
" Mouse & {\"mouse_id\": 0}\n",
").fetch1() # \"fetch1()\" because we know there's only one\n",
"mouse_0"
]
},
Expand Down Expand Up @@ -4881,7 +4877,7 @@
}
],
"source": [
"(Mouse & {'mouse_id': 0}).fetch1('KEY')"
"(Mouse & {\"mouse_id\": 0}).fetch1(\"KEY\")"
]
},
{
Expand All @@ -4897,7 +4893,7 @@
"metadata": {},
"outputs": [],
"source": [
"sex, dob = (Mouse & {'mouse_id': 0}).fetch1('sex', 'dob')"
"sex, dob = (Mouse & {\"mouse_id\": 0}).fetch1(\"sex\", \"dob\")"
]
},
{
Expand Down Expand Up @@ -4978,7 +4974,7 @@
}
],
"source": [
"(Mouse & 'mouse_id = 100').delete()"
"(Mouse & \"mouse_id = 100\").delete()"
]
},
{
Expand Down
Loading

0 comments on commit 8b4b750

Please sign in to comment.