Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions RATapi/examples/convert_rascal_project/convert_rascal.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"source": [
"### RasCAL-1 to RAT\n",
"\n",
"RasCAL-1 (R1) project structs can be converted to RAT Project classes, and vice versa. This is done via the functions `r1_to_project_class` and `project_class_to_r1`.\n",
"RasCAL-1 (R1) project structs can be converted to RAT Projects, and vice versa. This is done via the functions `r1_to_project` and `project_to_r1`.\n",
"\n",
"Converting from R1 to a `Project` is very simple. We use the example R1 project in the file `R1monolayerVolumeModel.mat`, which is a project for analysing a monolayer of DSPC with various deuterations (tail-deuterated, head-deuterated, fully deuterated, hydrogenated)"
]
Expand All @@ -15,7 +15,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Simply give the file path to the function `r1_to_project_class`, and it returns a RAT `Project` that you can use exactly like any other."
"Simply give the file path to the function `r1_to_project`, and it returns a RAT `Project` that you can use exactly like any other."
]
},
{
Expand All @@ -24,9 +24,9 @@
"metadata": {},
"outputs": [],
"source": [
"from RATapi.utils.convert import r1_to_project_class\n",
"from RATapi.utils.convert import r1_to_project\n",
"\n",
"project = r1_to_project_class(\"R1monolayerVolumeModel.mat\")\n",
"project = r1_to_project(\"R1monolayerVolumeModel.mat\")\n",
"print(project)"
]
},
Expand Down Expand Up @@ -108,7 +108,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"`project_class_to_r1` takes parameters `project` and `filename`, which are the `Project` object and filename for the produced .mat file respectively. This .mat file can then be loaded into RasCAL-1.\n",
"`project_to_r1` takes parameters `project` and `filename`, which are the `Project` object and filename for the produced .mat file respectively. This .mat file can then be loaded into RasCAL-1.\n",
"\n",
"Alternatively, if one sets `return_struct=True`, the struct is returned as a Python dictionary instead of being saved.\n",
"\n",
Expand All @@ -121,14 +121,14 @@
"metadata": {},
"outputs": [],
"source": [
"from RATapi.utils.convert import project_class_to_r1\n",
"from RATapi.utils.convert import project_to_r1\n",
"from pprint import pp # for printing the struct\n",
"\n",
"# save to a file called lipid_bilayer.mat\n",
"project_class_to_r1(lipid_bilayer_project, filename=\"lipid_bilayer.mat\")\n",
"project_to_r1(lipid_bilayer_project, filename=\"lipid_bilayer.mat\")\n",
"\n",
"# return as a Python dictionary\n",
"struct = project_class_to_r1(lipid_bilayer_project, return_struct=True)\n",
"struct = project_to_r1(lipid_bilayer_project, return_struct=True)\n",
"pp(struct)"
]
}
Expand Down