Skip to content

Commit

Permalink
Fix bugs in ML notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
robbibt committed Dec 7, 2023
1 parent 502cf39 commit 62aea18
Show file tree
Hide file tree
Showing 5 changed files with 623 additions and 431 deletions.
104 changes: 7 additions & 97 deletions How_to_guides/Machine_learning_with_ODC.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"source": [
"%matplotlib inline\n",
"\n",
"import os\n",
"import subprocess as sp\n",
"import shapely\n",
"import xarray as xr\n",
Expand Down Expand Up @@ -160,8 +161,11 @@
}
],
"source": [
"ncpus=round(get_cpu_quota())\n",
"print(ncpus)"
"if get_cpu_quota() is not None:\n",
" ncpus = round(get_cpu_quota())\n",
"else:\n",
" ncpus = os.cpu_count()\n",
"print(f\"ncpus = {ncpus}\")"
]
},
{
Expand Down Expand Up @@ -880,101 +884,7 @@
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {
"1619aa7c0a0d41f892bc55d700874aba": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_ef7c7b47129f4bb7be210a31c9c6748c",
"style": "IPY_MODEL_6c45957fae8a4c9c90d0efa71fb7acd3",
"value": "100%"
}
},
"1b9dd35d726a487c9e03b50cadec204e": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"27c2edfba16545549cbc2446f65308f9": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"description_width": ""
}
},
"43e325ac2f4b42659d9ae321464c5dd1": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"bar_style": "success",
"layout": "IPY_MODEL_9b47cb4d6d96465b8a2446bc022c085d",
"max": 217,
"style": "IPY_MODEL_27c2edfba16545549cbc2446f65308f9",
"value": 217
}
},
"5ce2388f84c64f1eb830509fab75e200": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"children": [
"IPY_MODEL_1619aa7c0a0d41f892bc55d700874aba",
"IPY_MODEL_43e325ac2f4b42659d9ae321464c5dd1",
"IPY_MODEL_e6391b33874b4787837251849ceb2b1c"
],
"layout": "IPY_MODEL_cc67c362ea5f4f80bfa29df7189ad3e6"
}
},
"6c45957fae8a4c9c90d0efa71fb7acd3": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"91df15d5486440d6a2125e74e9befe48": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"description_width": ""
}
},
"9b47cb4d6d96465b8a2446bc022c085d": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"cc67c362ea5f4f80bfa29df7189ad3e6": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
},
"e6391b33874b4787837251849ceb2b1c": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"layout": "IPY_MODEL_1b9dd35d726a487c9e03b50cadec204e",
"style": "IPY_MODEL_91df15d5486440d6a2125e74e9befe48",
"value": " 217/217 [01:53<00:00, 2.18it/s]"
}
},
"ef7c7b47129f4bb7be210a31c9c6748c": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {}
}
},
"state": {},
"version_major": 2,
"version_minor": 0
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@
}
],
"source": [
"ncpus = round(get_cpu_quota())\n",
"print('ncpus = ' + str(ncpus))"
"if get_cpu_quota() is not None:\n",
" ncpus = round(get_cpu_quota())\n",
"else:\n",
" ncpus = os.cpu_count()\n",
"print(f\"ncpus = {ncpus}\")"
]
},
{
Expand Down Expand Up @@ -552,7 +555,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.10.13"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down
Binary file not shown.
Loading

0 comments on commit 62aea18

Please sign in to comment.