Skip to content

Commit

Permalink
FileChooser for config
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffwoollard committed Jun 25, 2024
1 parent 2b86ae2 commit 33db7d3
Showing 1 changed file with 41 additions and 7 deletions.
48 changes: 41 additions & 7 deletions tutorials/5_tutorial_plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -36,7 +36,9 @@
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"from natsort import natsorted\n",
"import glob"
"import glob\n",
"from ipyfilechooser import FileChooser\n",
"import os\n"
]
},
{
Expand All @@ -46,9 +48,41 @@
"# General plotting"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Navigate to the plotting config"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9242b69072f64782b69ff2b63aa23d53",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"FileChooser(path='/mnt/home/gwoollard', filename='', title='', show_hidden=False, select_desc='Select', change…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"path_to_config = FileChooser(os.path.expanduser(\"~\"))\n",
"display(path_to_config)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -59,14 +93,14 @@
" map2map_results: List[str]\n",
" dist2dist_results: Dict[str, List[str]]\n",
"\n",
"with open(\"../config_files/config_plotting.yaml\", \"r\") as file:\n",
"with open(path_to_config.value, \"r\") as file:\n",
" config = yaml.safe_load(file)\n",
"config = PlottingConfig.from_dict(config)\n"
"config = PlottingConfig.from_dict(config)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -84,7 +118,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand Down

0 comments on commit 33db7d3

Please sign in to comment.