Skip to content

Commit 79828fc

Browse files
author
Chahan Kropf
committed
Remove explicit write example
1 parent 0cb35ca commit 79828fc

File tree

1 file changed

+4
-61
lines changed

1 file changed

+4
-61
lines changed

doc/user-guide/climada_entity_MeasureSet.ipynb

Lines changed: 4 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,9 @@
553553
"cell_type": "markdown",
554554
"metadata": {},
555555
"source": [
556-
"## Read measures of an Excel file\n",
556+
"## Read/write measure sets to/from Excel files\n",
557557
"\n",
558-
"Measures defined in an excel file following the template provided in sheet `measures` of `climada_python/data/system/entity_template.xlsx` can be ingested directly using the method `from_excel()`."
558+
"Measures defined in an excel file following the template provided in sheet `measures` of `climada_python/data/system/entity_template.xlsx` can be ingested directly using the method `from_excel()`. Measure sets can be written to file with the method `write_excel()`."
559559
]
560560
},
561561
{
@@ -585,71 +585,14 @@
585585
"\n",
586586
"# Fill DataFrame from Excel file\n",
587587
"file_name = ENT_TEMPLATE_XLS # provide absolute path of the excel file\n",
588-
"meas_set = MeasureSet.from_excel(file_name)\n",
589-
"meas_set"
590-
]
591-
},
592-
{
593-
"cell_type": "markdown",
594-
"metadata": {},
595-
"source": [
596-
"## Write measures\n",
597-
"\n",
598-
"Measures can be writen in Excel format using `write_excel()` method."
599-
]
600-
},
601-
{
602-
"cell_type": "code",
603-
"execution_count": 8,
604-
"metadata": {
605-
"ExecuteTime": {
606-
"end_time": "2021-03-05T11:44:20.460278Z",
607-
"start_time": "2021-03-05T11:44:16.581Z"
608-
}
609-
},
610-
"outputs": [],
611-
"source": [
612-
"from climada.entity.measures import MeasureSet\n",
613-
"from climada.util import ENT_TEMPLATE_XLS\n",
614-
"\n",
615-
"# Fill DataFrame from Excel file\n",
616-
"file_name = ENT_TEMPLATE_XLS # provide absolute path of the excel file\n",
617-
"meas_set = MeasureSet.from_excel(file_name)\n",
618-
"\n",
619-
"# write file\n",
620-
"meas_set.write_excel(\"results/tutorial_meas_set.xlsx\")"
621-
]
622-
},
623-
{
624-
"cell_type": "markdown",
625-
"id": "adb8d606",
626-
"metadata": {},
627-
"source": [
628-
"Pickle can be used as well, but note that pickle has a [transient format](saving-with-pickle) and should be avoided when possible:"
629-
]
630-
},
631-
{
632-
"cell_type": "code",
633-
"execution_count": 9,
634-
"metadata": {
635-
"ExecuteTime": {
636-
"end_time": "2021-03-05T11:44:20.462069Z",
637-
"start_time": "2021-03-05T11:44:16.599Z"
638-
}
639-
},
640-
"outputs": [],
641-
"source": [
642-
"from climada.util.save import save\n",
643-
"\n",
644-
"# this generates a results folder in the current path and stores the output there\n",
645-
"save(\"tutorial_meas_set.p\", meas_set)"
588+
"meas_set = MeasureSet.from_excel(file_name)"
646589
]
647590
}
648591
],
649592
"metadata": {
650593
"hide_input": false,
651594
"kernelspec": {
652-
"display_name": "Python 3.8.12 ('climada_core')",
595+
"display_name": "Python 3 (ipykernel)",
653596
"language": "python",
654597
"name": "python3"
655598
},

0 commit comments

Comments
 (0)