Skip to content

Commit e3c468a

Browse files
committed
fix: include nbstripout, update ruff legacy pre-commit command
1 parent 9798f9d commit e3c468a

2 files changed

Lines changed: 10 additions & 41 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
- repo: https://github.com/astral-sh/ruff-pre-commit
2525
rev: v0.12.0
2626
hooks:
27-
- id: ruff
27+
- id: ruff-check
2828
args: [--fix, --show-fixes]
2929
stages: [pre-commit]
3030
files: \.py$
@@ -95,3 +95,9 @@ repos:
9595
- '4'
9696
stages: [pre-commit]
9797
files: \.ya?ml$
98+
99+
# clean output from jupyter notebooks
100+
- repo: https://github.com/kynan/nbstripout
101+
rev: 0.8.1
102+
hooks:
103+
- id: nbstripout

notebooks/template_notebooks.ipynb

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,7 @@
284284
"cell_type": "code",
285285
"execution_count": null,
286286
"metadata": {},
287-
"outputs": [
288-
{
289-
"name": "stdout",
290-
"output_type": "stream",
291-
"text": [
292-
"Added to sys.path: /home/edwin/SSC-Projects/b_REPOSITORIES/ontograph\n"
293-
]
294-
}
295-
],
287+
"outputs": [],
296288
"source": [
297289
"import sys\n",
298290
"import os\n",
@@ -308,38 +300,9 @@
308300
},
309301
{
310302
"cell_type": "code",
311-
"execution_count": 3,
303+
"execution_count": null,
312304
"metadata": {},
313-
"outputs": [
314-
{
315-
"name": "stderr",
316-
"output_type": "stream",
317-
"text": [
318-
"Downloading data from 'http://purl.obolibrary.org/obo/go.obo' to file '/home/edwin/.ontograph_cache/go.obo'.\n",
319-
"SHA256 hash of downloaded file: 0908af70601dd41f2c55f664ca5d5959e939162362e9a5573c6794b5d850e601\n",
320-
"Use this value as the 'known_hash' argument of 'pooch.retrieve' to ensure that the file hasn't changed if it is downloaded again in the future.\n"
321-
]
322-
},
323-
{
324-
"name": "stdout",
325-
"output_type": "stream",
326-
"text": [
327-
"{'name': 'go', 'version': 'releases/2025-06-01', 'format': '1.2'}\n"
328-
]
329-
},
330-
{
331-
"ename": "AttributeError",
332-
"evalue": "'Ontology' object has no attribute 'roots'",
333-
"output_type": "error",
334-
"traceback": [
335-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
336-
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
337-
"Cell \u001b[0;32mIn[3], line 7\u001b[0m\n\u001b[1;32m 4\u001b[0m gene_ontology \u001b[38;5;241m=\u001b[39m client\u001b[38;5;241m.\u001b[39mload(name_id\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mgo\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28mformat\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mobo\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28mprint\u001b[39m(gene_ontology\u001b[38;5;241m.\u001b[39mmetadata())\n\u001b[0;32m----> 7\u001b[0m \u001b[38;5;28mprint\u001b[39m([root\u001b[38;5;241m.\u001b[39mid \u001b[38;5;28;01mfor\u001b[39;00m root \u001b[38;5;129;01min\u001b[39;00m \u001b[43mgene_ontology\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mroots\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m])\n",
338-
"File \u001b[0;32m~/SSC-Projects/b_REPOSITORIES/ontograph/ontograph/api/client.py:51\u001b[0m, in \u001b[0;36mOntologyWrapper.roots\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21mroots\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[0;32m---> 51\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mlist\u001b[39m(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43montology\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mroots\u001b[49m())\n",
339-
"\u001b[0;31mAttributeError\u001b[0m: 'Ontology' object has no attribute 'roots'"
340-
]
341-
}
342-
],
305+
"outputs": [],
343306
"source": [
344307
"from ontograph.api.client import OntologyClient\n",
345308
"\n",

0 commit comments

Comments
 (0)