diff --git a/rc/models/model_target_noRP_rcg_refine.yml b/rc/models/target_noRP_rcg_refine.yml similarity index 100% rename from rc/models/model_target_noRP_rcg_refine.yml rename to rc/models/target_noRP_rcg_refine.yml diff --git a/rc/models/model_target_rcg_refine.yml b/rc/models/target_rcg_refine.yml similarity index 100% rename from rc/models/model_target_rcg_refine.yml rename to rc/models/target_rcg_refine.yml diff --git a/rc/models/parameters_target_rcg_gcrcg_rcgcr_refine.yml b/rc/parameters/target_noRP_rcg_refine.yml similarity index 100% rename from rc/models/parameters_target_rcg_gcrcg_rcgcr_refine.yml rename to rc/parameters/target_noRP_rcg_refine.yml diff --git a/rc/models/parameters_target_rcg_refine.yml b/rc/parameters/target_rcg_refine.yml similarity index 100% rename from rc/models/parameters_target_rcg_refine.yml rename to rc/parameters/target_rcg_refine.yml diff --git a/rc/target_rcg_compare_part2.ipynb b/rc/target_rcg_compare_part2.ipynb index 7885c93..0b37edb 100644 --- a/rc/target_rcg_compare_part2.ipynb +++ b/rc/target_rcg_compare_part2.ipynb @@ -44,6 +44,35 @@ "# Inspect experimental data\n" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from glotaran.project import Project\n", + "\n", + "project = Project.open(\"\")\n", + "project.import_data(\n", + " \"measured_data/Krg_grga.ascii\", dataset_name=\"tas_rcg_dcm\", ignore_existing=True\n", + ")\n", + "project.import_data(\n", + " \"measured_data/Krg_grgc.ascii\", dataset_name=\"guide_rcg_r1\", ignore_existing=True\n", + ")\n", + "project.import_data(\n", + " \"measured_data/Krg_grgd.ascii\", dataset_name=\"guide_rcg_r2\", ignore_existing=True\n", + ")\n", + "project.import_data(\n", + " \"measured_data/Krg_grge.ascii\", dataset_name=\"guide_rcg_r3\", ignore_existing=True\n", + ")\n", + "project.import_data(\n", + " \"measured_data/Krg_grgf.ascii\", dataset_name=\"guide_rcg_r4\", ignore_existing=True\n", + ")\n", + "project.import_data(\n", + " \"measured_data/Krg_grgg.ascii\", dataset_name=\"guide_rcg_g\", ignore_existing=True\n", + ")" + ] + }, { "attachments": {}, "cell_type": "markdown", @@ -87,7 +116,7 @@ " # \"guide_rcgcr_r4\": \"data/Krg_grgf.ascii\",\n", "}\n", "\n", - "plot_data_overview(experiment_data[\"tas_rcg_dcm\"], linlog=True, linthresh=1)" + "plot_data_overview(project.data[\"tas_rcg_dcm\"], linlog=True, linthresh=1);" ] }, { @@ -110,10 +139,7 @@ }, "outputs": [], "source": [ - "# from glotaran.utils.ipython import display_file\n", - "\n", - "model_path = \"models/model_target_rcg_refine.yml\"\n", - "# display_file(model_path, syntax=\"yaml\")" + "# project.show_model_definition(\"target_rcg_refine\")" ] }, { @@ -138,8 +164,7 @@ }, "outputs": [], "source": [ - "parameters_file_path = \"models/parameters_target_rcg_refine.yml\"\n", - "# display_file(parameters_file_path, syntax=\"yaml\")" + "# project.show_parameters_definition(\"target_rcg_refine\")" ] }, { @@ -175,17 +200,12 @@ }, "outputs": [], "source": [ - "from glotaran.optimization.optimize import optimize\n", - "from glotaran.project.scheme import Scheme\n", - "\n", - "scheme = Scheme(\n", - " model_path,\n", - " parameters_file_path,\n", - " experiment_data,\n", + "result = project.optimize(\n", + " model_name=\"target_rcg_refine\",\n", + " parameters_name=\"target_rcg_refine\",\n", " clp_link_tolerance=1.9,\n", " maximum_number_function_evaluations=1,\n", - ")\n", - "result = optimize(scheme)" + ")" ] }, { @@ -337,7 +357,6 @@ }, "outputs": [], "source": [ - "\n", "from pyglotaran_extras.plotting.style import PlotStyle\n", "\n", "# fig, ax = plt.subplots(1, 1, figsize=(15, 7))\n", @@ -494,21 +513,12 @@ }, "outputs": [], "source": [ - "from glotaran.optimization.optimize import optimize\n", - "from glotaran.project.scheme import Scheme\n", - "\n", - "model_noRP_path = \"models/model_target_noRP_rcg_refine.yml\"\n", - "parameters_noRP_file_path = \"models/parameters_target_noRP_rcg_refine.yml\"\n", - "\n", - "\n", - "scheme_noRP = Scheme(\n", - " model_noRP_path,\n", - " parameters_noRP_file_path,\n", - " experiment_data,\n", + "result_noRP = project.optimize(\n", + " model_name=\"target_noRP_rcg_refine\",\n", + " parameters_name=\"target_noRP_rcg_refine\",\n", " clp_link_tolerance=1.9,\n", - " maximum_number_function_evaluations=1,\n", - ")\n", - "result_noRP = optimize(scheme_noRP)" + " maximum_number_function_evaluations=7,\n", + ")" ] }, { @@ -593,7 +603,8 @@ "axes[1][0].annotate(\"C\", xy=(0.01, 0.92), xycoords=\"axes fraction\", fontsize=16)\n", "axes[1][1].annotate(\"D\", xy=(0.01, 0.92), xycoords=\"axes fraction\", fontsize=16)\n", "for ax in axes[0:3, 0:3].flatten():\n", - " ax.axhline(0, color=\"k\", linewidth=1)" + " ax.axhline(0, color=\"k\", linewidth=1)\n", + "fig.tight_layout()" ] } ],