{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "0e2fd5c7",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:19.141718Z",
"iopub.status.busy": "2026-01-06T13:54:19.141527Z",
"iopub.status.idle": "2026-01-06T13:54:19.148602Z",
"shell.execute_reply": "2026-01-06T13:54:19.146332Z"
},
"tags": [
"hide-in-docs"
]
},
"outputs": [],
"source": [
"# Check if the easydiffraction library is installed.\n",
"# If not, install it with the 'visualization' extras.\n",
"# Needed when running remotely (e.g. Colab) where the lib is absent.\n",
"import builtins\n",
"import importlib.util\n",
"\n",
"if (hasattr(builtins, '__IPYTHON__') and\n",
" importlib.util.find_spec('easydiffraction') is None):\n",
" !pip install 'easydiffraction[visualization]==0.10.1'"
]
},
{
"cell_type": "markdown",
"id": "0",
"metadata": {},
"source": [
"# Structure Refinement: HS, HRPT\n",
"\n",
"This example demonstrates a Rietveld refinement of HS crystal\n",
"structure using constant wavelength neutron powder diffraction data\n",
"from HRPT at PSI."
]
},
{
"cell_type": "markdown",
"id": "1",
"metadata": {},
"source": [
"## Import Library"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "2",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:19.150502Z",
"iopub.status.busy": "2026-01-06T13:54:19.150379Z",
"iopub.status.idle": "2026-01-06T13:54:21.987492Z",
"shell.execute_reply": "2026-01-06T13:54:21.986356Z"
}
},
"outputs": [],
"source": [
"from easydiffraction import ExperimentFactory\n",
"from easydiffraction import Project\n",
"from easydiffraction import SampleModelFactory\n",
"from easydiffraction import download_data"
]
},
{
"cell_type": "markdown",
"id": "3",
"metadata": {},
"source": [
"## Define Sample Model\n",
"\n",
"This section shows how to add sample models and modify their\n",
"parameters.\n",
"\n",
"#### Create Sample Model"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "4",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:21.991076Z",
"iopub.status.busy": "2026-01-06T13:54:21.990707Z",
"iopub.status.idle": "2026-01-06T13:54:22.000617Z",
"shell.execute_reply": "2026-01-06T13:54:21.999772Z"
}
},
"outputs": [],
"source": [
"model = SampleModelFactory.create(name='hs')"
]
},
{
"cell_type": "markdown",
"id": "5",
"metadata": {},
"source": [
"#### Set Space Group"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "6",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.003563Z",
"iopub.status.busy": "2026-01-06T13:54:22.003416Z",
"iopub.status.idle": "2026-01-06T13:54:22.005652Z",
"shell.execute_reply": "2026-01-06T13:54:22.005163Z"
}
},
"outputs": [],
"source": [
"model.space_group.name_h_m = 'R -3 m'\n",
"model.space_group.it_coordinate_system_code = 'h'"
]
},
{
"cell_type": "markdown",
"id": "7",
"metadata": {
"lines_to_next_cell": 2
},
"source": [
"#### Set Unit Cell"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "8",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.007734Z",
"iopub.status.busy": "2026-01-06T13:54:22.007278Z",
"iopub.status.idle": "2026-01-06T13:54:22.010172Z",
"shell.execute_reply": "2026-01-06T13:54:22.009677Z"
}
},
"outputs": [],
"source": [
"model.cell.length_a = 6.9\n",
"model.cell.length_c = 14.1"
]
},
{
"cell_type": "markdown",
"id": "9",
"metadata": {},
"source": [
"#### Set Atom Sites"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "10",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.011834Z",
"iopub.status.busy": "2026-01-06T13:54:22.011714Z",
"iopub.status.idle": "2026-01-06T13:54:22.020953Z",
"shell.execute_reply": "2026-01-06T13:54:22.020438Z"
}
},
"outputs": [],
"source": [
"model.atom_sites.add(\n",
" label='Zn',\n",
" type_symbol='Zn',\n",
" fract_x=0,\n",
" fract_y=0,\n",
" fract_z=0.5,\n",
" wyckoff_letter='b',\n",
" b_iso=0.5,\n",
")\n",
"model.atom_sites.add(\n",
" label='Cu',\n",
" type_symbol='Cu',\n",
" fract_x=0.5,\n",
" fract_y=0,\n",
" fract_z=0,\n",
" wyckoff_letter='e',\n",
" b_iso=0.5,\n",
")\n",
"model.atom_sites.add(\n",
" label='O',\n",
" type_symbol='O',\n",
" fract_x=0.21,\n",
" fract_y=-0.21,\n",
" fract_z=0.06,\n",
" wyckoff_letter='h',\n",
" b_iso=0.5,\n",
")\n",
"model.atom_sites.add(\n",
" label='Cl',\n",
" type_symbol='Cl',\n",
" fract_x=0,\n",
" fract_y=0,\n",
" fract_z=0.197,\n",
" wyckoff_letter='c',\n",
" b_iso=0.5,\n",
")\n",
"model.atom_sites.add(\n",
" label='H',\n",
" type_symbol='2H',\n",
" fract_x=0.13,\n",
" fract_y=-0.13,\n",
" fract_z=0.08,\n",
" wyckoff_letter='h',\n",
" b_iso=0.5,\n",
")"
]
},
{
"cell_type": "markdown",
"id": "11",
"metadata": {},
"source": [
"## Define Experiment\n",
"\n",
"This section shows how to add experiments, configure their parameters,\n",
"and link the sample models defined in the previous step.\n",
"\n",
"#### Download Measured Data"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "12",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.022958Z",
"iopub.status.busy": "2026-01-06T13:54:22.022856Z",
"iopub.status.idle": "2026-01-06T13:54:22.124404Z",
"shell.execute_reply": "2026-01-06T13:54:22.124044Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mGetting data\u001b[0m\u001b[1;34m...\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Data #\u001b[1;36m11\u001b[0m: HS, HRPT \u001b[1m(\u001b[0mPSI\u001b[1m)\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Data #\u001b[1;36m11\u001b[0m downloaded to \u001b[32m'data/ed-11.xye'\u001b[0m\n"
]
}
],
"source": [
"data_path = download_data(id=11, destination='data')"
]
},
{
"cell_type": "markdown",
"id": "13",
"metadata": {},
"source": [
"#### Create Experiment"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "14",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.126323Z",
"iopub.status.busy": "2026-01-06T13:54:22.126190Z",
"iopub.status.idle": "2026-01-06T13:54:22.699459Z",
"shell.execute_reply": "2026-01-06T13:54:22.698406Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mData loaded successfully\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Experiment 🔬 \u001b[32m'hrpt'\u001b[0m. Number of data points: \u001b[1;36m3220\u001b[0m\n"
]
}
],
"source": [
"expt = ExperimentFactory.create(name='hrpt', data_path=data_path)"
]
},
{
"cell_type": "markdown",
"id": "15",
"metadata": {},
"source": [
"#### Set Instrument"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "16",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.703729Z",
"iopub.status.busy": "2026-01-06T13:54:22.703545Z",
"iopub.status.idle": "2026-01-06T13:54:22.707329Z",
"shell.execute_reply": "2026-01-06T13:54:22.706200Z"
}
},
"outputs": [],
"source": [
"expt.instrument.setup_wavelength = 1.89\n",
"expt.instrument.calib_twotheta_offset = 0.0"
]
},
{
"cell_type": "markdown",
"id": "17",
"metadata": {},
"source": [
"#### Set Peak Profile"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "18",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.711036Z",
"iopub.status.busy": "2026-01-06T13:54:22.710837Z",
"iopub.status.idle": "2026-01-06T13:54:22.718192Z",
"shell.execute_reply": "2026-01-06T13:54:22.717514Z"
}
},
"outputs": [],
"source": [
"expt.peak.broad_gauss_u = 0.1\n",
"expt.peak.broad_gauss_v = -0.2\n",
"expt.peak.broad_gauss_w = 0.2\n",
"expt.peak.broad_lorentz_x = 0.0\n",
"expt.peak.broad_lorentz_y = 0"
]
},
{
"cell_type": "markdown",
"id": "19",
"metadata": {},
"source": [
"#### Set Background"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "20",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.722348Z",
"iopub.status.busy": "2026-01-06T13:54:22.721855Z",
"iopub.status.idle": "2026-01-06T13:54:22.728760Z",
"shell.execute_reply": "2026-01-06T13:54:22.728179Z"
}
},
"outputs": [],
"source": [
"expt.background.add(id='1', x=4.4196, y=500)\n",
"expt.background.add(id='2', x=6.6207, y=500)\n",
"expt.background.add(id='3', x=10.4918, y=500)\n",
"expt.background.add(id='4', x=15.4634, y=500)\n",
"expt.background.add(id='5', x=45.6041, y=500)\n",
"expt.background.add(id='6', x=74.6844, y=500)\n",
"expt.background.add(id='7', x=103.4187, y=500)\n",
"expt.background.add(id='8', x=121.6311, y=500)\n",
"expt.background.add(id='9', x=159.4116, y=500)"
]
},
{
"cell_type": "markdown",
"id": "21",
"metadata": {},
"source": [
"#### Set Linked Phases"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "22",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.730804Z",
"iopub.status.busy": "2026-01-06T13:54:22.730614Z",
"iopub.status.idle": "2026-01-06T13:54:22.733332Z",
"shell.execute_reply": "2026-01-06T13:54:22.732836Z"
}
},
"outputs": [],
"source": [
"expt.linked_phases.add(id='hs', scale=0.5)"
]
},
{
"cell_type": "markdown",
"id": "23",
"metadata": {},
"source": [
"## Define Project\n",
"\n",
"The project object is used to manage the sample model, experiment, and\n",
"analysis.\n",
"\n",
"#### Create Project"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "24",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.735577Z",
"iopub.status.busy": "2026-01-06T13:54:22.735439Z",
"iopub.status.idle": "2026-01-06T13:54:22.879688Z",
"shell.execute_reply": "2026-01-06T13:54:22.879138Z"
}
},
"outputs": [],
"source": [
"project = Project()"
]
},
{
"cell_type": "markdown",
"id": "25",
"metadata": {},
"source": [
"#### Set Plotting Engine"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "26",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.889083Z",
"iopub.status.busy": "2026-01-06T13:54:22.888579Z",
"iopub.status.idle": "2026-01-06T13:54:22.895455Z",
"shell.execute_reply": "2026-01-06T13:54:22.894626Z"
}
},
"outputs": [],
"source": [
"# Keep the auto-selected engine. Alternatively, you can uncomment the\n",
"# line below to explicitly set the engine to the required one.\n",
"# project.plotter.engine = 'plotly'"
]
},
{
"cell_type": "markdown",
"id": "27",
"metadata": {},
"source": [
"#### Add Sample Model"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "28",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.897807Z",
"iopub.status.busy": "2026-01-06T13:54:22.897654Z",
"iopub.status.idle": "2026-01-06T13:54:22.900840Z",
"shell.execute_reply": "2026-01-06T13:54:22.899751Z"
}
},
"outputs": [],
"source": [
"project.sample_models.add(sample_model=model)"
]
},
{
"cell_type": "markdown",
"id": "29",
"metadata": {},
"source": [
"#### Add Experiment"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "30",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.904010Z",
"iopub.status.busy": "2026-01-06T13:54:22.903828Z",
"iopub.status.idle": "2026-01-06T13:54:22.906527Z",
"shell.execute_reply": "2026-01-06T13:54:22.905744Z"
}
},
"outputs": [],
"source": [
"project.experiments.add(experiment=expt)"
]
},
{
"cell_type": "markdown",
"id": "31",
"metadata": {},
"source": [
"## Perform Analysis\n",
"\n",
"This section shows the analysis process, including how to set up\n",
"calculation and fitting engines.\n",
"\n",
"#### Set Calculator"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "32",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.908949Z",
"iopub.status.busy": "2026-01-06T13:54:22.908518Z",
"iopub.status.idle": "2026-01-06T13:54:22.914697Z",
"shell.execute_reply": "2026-01-06T13:54:22.913646Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mCurrent calculator changed to\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"cryspy\n"
]
}
],
"source": [
"project.analysis.current_calculator = 'cryspy'"
]
},
{
"cell_type": "markdown",
"id": "33",
"metadata": {},
"source": [
"#### Set Minimizer"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "34",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.917797Z",
"iopub.status.busy": "2026-01-06T13:54:22.917614Z",
"iopub.status.idle": "2026-01-06T13:54:22.922679Z",
"shell.execute_reply": "2026-01-06T13:54:22.922208Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mCurrent minimizer changed to\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"lmfit \u001b[1m(\u001b[0mleastsq\u001b[1m)\u001b[0m\n"
]
}
],
"source": [
"project.analysis.current_minimizer = 'lmfit (leastsq)'"
]
},
{
"cell_type": "markdown",
"id": "35",
"metadata": {},
"source": [
"#### Plot Measured vs Calculated"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "36",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:22.925015Z",
"iopub.status.busy": "2026-01-06T13:54:22.924854Z",
"iopub.status.idle": "2026-01-06T13:54:23.391913Z",
"shell.execute_reply": "2026-01-06T13:54:23.391325Z"
}
},
"outputs": [
{
"data": {
"text/html": [
"
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "37",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:23.393869Z",
"iopub.status.busy": "2026-01-06T13:54:23.393764Z",
"iopub.status.idle": "2026-01-06T13:54:24.086368Z",
"shell.execute_reply": "2026-01-06T13:54:24.082990Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', x_min=48, x_max=51, show_residual=True)"
]
},
{
"cell_type": "markdown",
"id": "38",
"metadata": {},
"source": [
"### Perform Fit 1/5\n",
"\n",
"Set parameters to be refined."
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "39",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:24.089363Z",
"iopub.status.busy": "2026-01-06T13:54:24.088014Z",
"iopub.status.idle": "2026-01-06T13:54:24.095280Z",
"shell.execute_reply": "2026-01-06T13:54:24.094507Z"
}
},
"outputs": [],
"source": [
"model.cell.length_a.free = True\n",
"model.cell.length_c.free = True\n",
"\n",
"expt.linked_phases['hs'].scale.free = True\n",
"expt.instrument.calib_twotheta_offset.free = True"
]
},
{
"cell_type": "markdown",
"id": "40",
"metadata": {},
"source": [
"Show free parameters after selection."
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "41",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:24.111703Z",
"iopub.status.busy": "2026-01-06T13:54:24.109954Z",
"iopub.status.idle": "2026-01-06T13:54:24.602887Z",
"shell.execute_reply": "2026-01-06T13:54:24.601585Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mFree parameters for both sample models \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34m🧩 data blocks\u001b[0m\u001b[1;34m)\u001b[0m\u001b[1;34m and experiments \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34m🔬 data blocks\u001b[0m\u001b[1;34m)\u001b[0m\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" datablock | \n",
" category | \n",
" entry | \n",
" parameter | \n",
" value | \n",
" uncertainty | \n",
" min | \n",
" max | \n",
" units | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_a | \n",
" 6.90000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" Å | \n",
"
\n",
" \n",
" | 2 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_c | \n",
" 14.10000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" Å | \n",
"
\n",
" \n",
" | 3 | \n",
" hrpt | \n",
" linked_phases | \n",
" hs | \n",
" scale | \n",
" 0.50000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 4 | \n",
" hrpt | \n",
" instrument | \n",
" | \n",
" twotheta_offset | \n",
" 0.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" deg | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.analysis.show_free_params()"
]
},
{
"cell_type": "markdown",
"id": "42",
"metadata": {},
"source": [
"#### Run Fitting"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "43",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:24.605173Z",
"iopub.status.busy": "2026-01-06T13:54:24.604960Z",
"iopub.status.idle": "2026-01-06T13:54:52.571880Z",
"shell.execute_reply": "2026-01-06T13:54:52.564984Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mUsing experiment 🔬 \u001b[0m\u001b[32m'hrpt'\u001b[0m\u001b[1;34m for \u001b[0m\u001b[32m'single'\u001b[0m\u001b[1;34m fitting\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"🚀 Starting fit process with \u001b[32m'lmfit \u001b[0m\u001b[32m(\u001b[0m\u001b[32mleastsq\u001b[0m\u001b[32m)\u001b[0m\u001b[32m'\u001b[0m\u001b[33m...\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📈 Goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m change:\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" iteration | \n",
" χ² | \n",
" improvement [%] | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" 1 | \n",
" 576.50 | \n",
" | \n",
"
\n",
" \n",
" | 2 | \n",
" 8 | \n",
" 122.02 | \n",
" 78.8% ↓ | \n",
"
\n",
" \n",
" | 3 | \n",
" 13 | \n",
" 115.19 | \n",
" 5.6% ↓ | \n",
"
\n",
" \n",
" | 4 | \n",
" 18 | \n",
" 109.86 | \n",
" 4.6% ↓ | \n",
"
\n",
" \n",
" | 5 | \n",
" 23 | \n",
" 106.68 | \n",
" 2.9% ↓ | \n",
"
\n",
" \n",
" | 6 | \n",
" 28 | \n",
" 104.60 | \n",
" 2.0% ↓ | \n",
"
\n",
" \n",
" | 7 | \n",
" 33 | \n",
" 102.87 | \n",
" 1.7% ↓ | \n",
"
\n",
" \n",
" | 8 | \n",
" 38 | \n",
" 101.13 | \n",
" 1.7% ↓ | \n",
"
\n",
" \n",
" | 9 | \n",
" 43 | \n",
" 99.20 | \n",
" 1.9% ↓ | \n",
"
\n",
" \n",
" | 10 | \n",
" 48 | \n",
" 96.86 | \n",
" 2.4% ↓ | \n",
"
\n",
" \n",
" | 11 | \n",
" 53 | \n",
" 93.93 | \n",
" 3.0% ↓ | \n",
"
\n",
" \n",
" | 12 | \n",
" 58 | \n",
" 90.34 | \n",
" 3.8% ↓ | \n",
"
\n",
" \n",
" | 13 | \n",
" 63 | \n",
" 86.20 | \n",
" 4.6% ↓ | \n",
"
\n",
" \n",
" | 14 | \n",
" 68 | \n",
" 81.66 | \n",
" 5.3% ↓ | \n",
"
\n",
" \n",
" | 15 | \n",
" 73 | \n",
" 76.78 | \n",
" 6.0% ↓ | \n",
"
\n",
" \n",
" | 16 | \n",
" 78 | \n",
" 71.71 | \n",
" 6.6% ↓ | \n",
"
\n",
" \n",
" | 17 | \n",
" 83 | \n",
" 66.82 | \n",
" 6.8% ↓ | \n",
"
\n",
" \n",
" | 18 | \n",
" 88 | \n",
" 62.48 | \n",
" 6.5% ↓ | \n",
"
\n",
" \n",
" | 19 | \n",
" 93 | \n",
" 58.99 | \n",
" 5.6% ↓ | \n",
"
\n",
" \n",
" | 20 | \n",
" 98 | \n",
" 56.41 | \n",
" 4.4% ↓ | \n",
"
\n",
" \n",
" | 21 | \n",
" 103 | \n",
" 54.64 | \n",
" 3.1% ↓ | \n",
"
\n",
" \n",
" | 22 | \n",
" 108 | \n",
" 53.49 | \n",
" 2.1% ↓ | \n",
"
\n",
" \n",
" | 23 | \n",
" 113 | \n",
" 52.76 | \n",
" 1.4% ↓ | \n",
"
\n",
" \n",
" | 24 | \n",
" 123 | \n",
" 52.02 | \n",
" 1.4% ↓ | \n",
"
\n",
" \n",
" | 25 | \n",
" 304 | \n",
" 51.57 | \n",
" | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"🏆 Best goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m is \u001b[1;36m51.57\u001b[0m at iteration \u001b[1;36m303\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Fitting complete.\n"
]
}
],
"source": [
"project.analysis.fit()"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "44",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:52.578511Z",
"iopub.status.busy": "2026-01-06T13:54:52.577918Z",
"iopub.status.idle": "2026-01-06T13:54:53.705999Z",
"shell.execute_reply": "2026-01-06T13:54:53.703281Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mFit results\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Success: \u001b[3;92mTrue\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"⏱️ Fitting time: \u001b[1;36m27.20\u001b[0m seconds\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 Goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m: \u001b[1;36m51.57\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 R-factor \u001b[1m(\u001b[0mRf\u001b[1m)\u001b[0m: \u001b[1;36m19.70\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 R-factor squared \u001b[1m(\u001b[0mRf²\u001b[1m)\u001b[0m: \u001b[1;36m30.20\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 Weighted R-factor \u001b[1m(\u001b[0mwR\u001b[1m)\u001b[0m: \u001b[1;36m30.35\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📈 Fitted parameters:\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" datablock | \n",
" category | \n",
" entry | \n",
" parameter | \n",
" start | \n",
" fitted | \n",
" uncertainty | \n",
" units | \n",
" change | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_a | \n",
" 6.9000 | \n",
" 6.8623 | \n",
" 0.0003 | \n",
" Å | \n",
" 0.55 % ↓ | \n",
"
\n",
" \n",
" | 2 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_c | \n",
" 14.1000 | \n",
" 14.1365 | \n",
" 0.0008 | \n",
" Å | \n",
" 0.26 % ↑ | \n",
"
\n",
" \n",
" | 3 | \n",
" hrpt | \n",
" linked_phases | \n",
" hs | \n",
" scale | \n",
" 0.5000 | \n",
" 0.2548 | \n",
" 0.0030 | \n",
" | \n",
" 49.04 % ↓ | \n",
"
\n",
" \n",
" | 4 | \n",
" hrpt | \n",
" instrument | \n",
" | \n",
" twotheta_offset | \n",
" 0.0000 | \n",
" 0.1271 | \n",
" 0.0051 | \n",
" deg | \n",
" N/A | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.analysis.show_fit_results()"
]
},
{
"cell_type": "markdown",
"id": "45",
"metadata": {},
"source": [
"#### Plot Measured vs Calculated"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "46",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:53.711504Z",
"iopub.status.busy": "2026-01-06T13:54:53.709841Z",
"iopub.status.idle": "2026-01-06T13:54:54.444063Z",
"shell.execute_reply": "2026-01-06T13:54:54.443493Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)"
]
},
{
"cell_type": "code",
"execution_count": 26,
"id": "47",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:54.448308Z",
"iopub.status.busy": "2026-01-06T13:54:54.447923Z",
"iopub.status.idle": "2026-01-06T13:54:55.103586Z",
"shell.execute_reply": "2026-01-06T13:54:55.097519Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', x_min=48, x_max=51, show_residual=True)"
]
},
{
"cell_type": "markdown",
"id": "48",
"metadata": {},
"source": [
"### Perform Fit 2/5\n",
"\n",
"Set more parameters to be refined."
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "49",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:55.128165Z",
"iopub.status.busy": "2026-01-06T13:54:55.127909Z",
"iopub.status.idle": "2026-01-06T13:54:55.145928Z",
"shell.execute_reply": "2026-01-06T13:54:55.139173Z"
}
},
"outputs": [],
"source": [
"expt.peak.broad_gauss_u.free = True\n",
"expt.peak.broad_gauss_v.free = True\n",
"expt.peak.broad_gauss_w.free = True\n",
"expt.peak.broad_lorentz_x.free = True\n",
"\n",
"for point in expt.background:\n",
" point.y.free = True"
]
},
{
"cell_type": "markdown",
"id": "50",
"metadata": {},
"source": [
"Show free parameters after selection."
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "51",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:55.156334Z",
"iopub.status.busy": "2026-01-06T13:54:55.156059Z",
"iopub.status.idle": "2026-01-06T13:54:55.518179Z",
"shell.execute_reply": "2026-01-06T13:54:55.516616Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mFree parameters for both sample models \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34m🧩 data blocks\u001b[0m\u001b[1;34m)\u001b[0m\u001b[1;34m and experiments \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34m🔬 data blocks\u001b[0m\u001b[1;34m)\u001b[0m\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" datablock | \n",
" category | \n",
" entry | \n",
" parameter | \n",
" value | \n",
" uncertainty | \n",
" min | \n",
" max | \n",
" units | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_a | \n",
" 6.86229 | \n",
" 0.00029 | \n",
" -inf | \n",
" inf | \n",
" Å | \n",
"
\n",
" \n",
" | 2 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_c | \n",
" 14.13651 | \n",
" 0.00084 | \n",
" -inf | \n",
" inf | \n",
" Å | \n",
"
\n",
" \n",
" | 3 | \n",
" hrpt | \n",
" linked_phases | \n",
" hs | \n",
" scale | \n",
" 0.25480 | \n",
" 0.00305 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 4 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_u | \n",
" 0.10000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" deg² | \n",
"
\n",
" \n",
" | 5 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_v | \n",
" -0.20000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" deg² | \n",
"
\n",
" \n",
" | 6 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_w | \n",
" 0.20000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" deg² | \n",
"
\n",
" \n",
" | 7 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_lorentz_x | \n",
" 0.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" deg | \n",
"
\n",
" \n",
" | 8 | \n",
" hrpt | \n",
" instrument | \n",
" | \n",
" twotheta_offset | \n",
" 0.12712 | \n",
" 0.00515 | \n",
" -inf | \n",
" inf | \n",
" deg | \n",
"
\n",
" \n",
" | 9 | \n",
" hrpt | \n",
" background | \n",
" 1 | \n",
" y | \n",
" 500.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 10 | \n",
" hrpt | \n",
" background | \n",
" 2 | \n",
" y | \n",
" 500.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 11 | \n",
" hrpt | \n",
" background | \n",
" 3 | \n",
" y | \n",
" 500.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 12 | \n",
" hrpt | \n",
" background | \n",
" 4 | \n",
" y | \n",
" 500.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 13 | \n",
" hrpt | \n",
" background | \n",
" 5 | \n",
" y | \n",
" 500.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 14 | \n",
" hrpt | \n",
" background | \n",
" 6 | \n",
" y | \n",
" 500.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 15 | \n",
" hrpt | \n",
" background | \n",
" 7 | \n",
" y | \n",
" 500.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 16 | \n",
" hrpt | \n",
" background | \n",
" 8 | \n",
" y | \n",
" 500.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 17 | \n",
" hrpt | \n",
" background | \n",
" 9 | \n",
" y | \n",
" 500.00000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.analysis.show_free_params()"
]
},
{
"cell_type": "markdown",
"id": "52",
"metadata": {},
"source": [
"#### Run Fitting"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "53",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:54:55.521517Z",
"iopub.status.busy": "2026-01-06T13:54:55.521060Z",
"iopub.status.idle": "2026-01-06T13:55:24.923034Z",
"shell.execute_reply": "2026-01-06T13:55:24.921406Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mUsing experiment 🔬 \u001b[0m\u001b[32m'hrpt'\u001b[0m\u001b[1;34m for \u001b[0m\u001b[32m'single'\u001b[0m\u001b[1;34m fitting\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"🚀 Starting fit process with \u001b[32m'lmfit \u001b[0m\u001b[32m(\u001b[0m\u001b[32mleastsq\u001b[0m\u001b[32m)\u001b[0m\u001b[32m'\u001b[0m\u001b[33m...\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📈 Goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m change:\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" iteration | \n",
" χ² | \n",
" improvement [%] | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" 1 | \n",
" 51.78 | \n",
" | \n",
"
\n",
" \n",
" | 2 | \n",
" 21 | \n",
" 13.07 | \n",
" 74.8% ↓ | \n",
"
\n",
" \n",
" | 3 | \n",
" 40 | \n",
" 12.66 | \n",
" 3.2% ↓ | \n",
"
\n",
" \n",
" | 4 | \n",
" 58 | \n",
" 12.49 | \n",
" 1.3% ↓ | \n",
"
\n",
" \n",
" | 5 | \n",
" 340 | \n",
" 12.41 | \n",
" | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"🏆 Best goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m is \u001b[1;36m12.41\u001b[0m at iteration \u001b[1;36m339\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Fitting complete.\n"
]
}
],
"source": [
"project.analysis.fit()"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "54",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:24.928128Z",
"iopub.status.busy": "2026-01-06T13:55:24.926799Z",
"iopub.status.idle": "2026-01-06T13:55:26.030628Z",
"shell.execute_reply": "2026-01-06T13:55:26.027786Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mFit results\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Success: \u001b[3;92mTrue\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"⏱️ Fitting time: \u001b[1;36m28.52\u001b[0m seconds\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 Goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m: \u001b[1;36m12.41\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 R-factor \u001b[1m(\u001b[0mRf\u001b[1m)\u001b[0m: \u001b[1;36m9.62\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 R-factor squared \u001b[1m(\u001b[0mRf²\u001b[1m)\u001b[0m: \u001b[1;36m12.83\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 Weighted R-factor \u001b[1m(\u001b[0mwR\u001b[1m)\u001b[0m: \u001b[1;36m12.21\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📈 Fitted parameters:\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" datablock | \n",
" category | \n",
" entry | \n",
" parameter | \n",
" start | \n",
" fitted | \n",
" uncertainty | \n",
" units | \n",
" change | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_a | \n",
" 6.8623 | \n",
" 6.8628 | \n",
" 0.0003 | \n",
" Å | \n",
" 0.01 % ↑ | \n",
"
\n",
" \n",
" | 2 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_c | \n",
" 14.1365 | \n",
" 14.1389 | \n",
" 0.0009 | \n",
" Å | \n",
" 0.02 % ↑ | \n",
"
\n",
" \n",
" | 3 | \n",
" hrpt | \n",
" linked_phases | \n",
" hs | \n",
" scale | \n",
" 0.2548 | \n",
" 0.4570 | \n",
" 0.0032 | \n",
" | \n",
" 79.37 % ↑ | \n",
"
\n",
" \n",
" | 4 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_u | \n",
" 0.1000 | \n",
" 0.1042 | \n",
" 0.0451 | \n",
" deg² | \n",
" 4.18 % ↑ | \n",
"
\n",
" \n",
" | 5 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_v | \n",
" -0.2000 | \n",
" -0.4977 | \n",
" 0.0619 | \n",
" deg² | \n",
" 148.83 % ↑ | \n",
"
\n",
" \n",
" | 6 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_w | \n",
" 0.2000 | \n",
" 0.3592 | \n",
" 0.0227 | \n",
" deg² | \n",
" 79.60 % ↑ | \n",
"
\n",
" \n",
" | 7 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_lorentz_x | \n",
" 0.0000 | \n",
" 0.5042 | \n",
" 0.0075 | \n",
" deg | \n",
" N/A | \n",
"
\n",
" \n",
" | 8 | \n",
" hrpt | \n",
" instrument | \n",
" | \n",
" twotheta_offset | \n",
" 0.1271 | \n",
" 0.1289 | \n",
" 0.0038 | \n",
" deg | \n",
" 1.39 % ↑ | \n",
"
\n",
" \n",
" | 9 | \n",
" hrpt | \n",
" background | \n",
" 1 | \n",
" y | \n",
" 500.0000 | \n",
" 645.4830 | \n",
" 23.7674 | \n",
" | \n",
" 29.10 % ↑ | \n",
"
\n",
" \n",
" | 10 | \n",
" hrpt | \n",
" background | \n",
" 2 | \n",
" y | \n",
" 500.0000 | \n",
" 520.8595 | \n",
" 13.6088 | \n",
" | \n",
" 4.17 % ↑ | \n",
"
\n",
" \n",
" | 11 | \n",
" hrpt | \n",
" background | \n",
" 3 | \n",
" y | \n",
" 500.0000 | \n",
" 455.0036 | \n",
" 10.4220 | \n",
" | \n",
" 9.00 % ↓ | \n",
"
\n",
" \n",
" | 12 | \n",
" hrpt | \n",
" background | \n",
" 4 | \n",
" y | \n",
" 500.0000 | \n",
" 428.8639 | \n",
" 5.4019 | \n",
" | \n",
" 14.23 % ↓ | \n",
"
\n",
" \n",
" | 13 | \n",
" hrpt | \n",
" background | \n",
" 5 | \n",
" y | \n",
" 500.0000 | \n",
" 453.5008 | \n",
" 5.2135 | \n",
" | \n",
" 9.30 % ↓ | \n",
"
\n",
" \n",
" | 14 | \n",
" hrpt | \n",
" background | \n",
" 6 | \n",
" y | \n",
" 500.0000 | \n",
" 446.7592 | \n",
" 5.4686 | \n",
" | \n",
" 10.65 % ↓ | \n",
"
\n",
" \n",
" | 15 | \n",
" hrpt | \n",
" background | \n",
" 7 | \n",
" y | \n",
" 500.0000 | \n",
" 411.5620 | \n",
" 5.4490 | \n",
" | \n",
" 17.69 % ↓ | \n",
"
\n",
" \n",
" | 16 | \n",
" hrpt | \n",
" background | \n",
" 8 | \n",
" y | \n",
" 500.0000 | \n",
" 364.3828 | \n",
" 5.6634 | \n",
" | \n",
" 27.12 % ↓ | \n",
"
\n",
" \n",
" | 17 | \n",
" hrpt | \n",
" background | \n",
" 9 | \n",
" y | \n",
" 500.0000 | \n",
" 469.2837 | \n",
" 5.4987 | \n",
" | \n",
" 6.14 % ↓ | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.analysis.show_fit_results()"
]
},
{
"cell_type": "markdown",
"id": "55",
"metadata": {},
"source": [
"#### Plot Measured vs Calculated"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "56",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:26.033182Z",
"iopub.status.busy": "2026-01-06T13:55:26.033031Z",
"iopub.status.idle": "2026-01-06T13:55:26.630618Z",
"shell.execute_reply": "2026-01-06T13:55:26.630058Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "57",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:26.634898Z",
"iopub.status.busy": "2026-01-06T13:55:26.634716Z",
"iopub.status.idle": "2026-01-06T13:55:27.026575Z",
"shell.execute_reply": "2026-01-06T13:55:27.025746Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', x_min=48, x_max=51, show_residual=True)"
]
},
{
"cell_type": "markdown",
"id": "58",
"metadata": {},
"source": [
"### Perform Fit 3/5\n",
"\n",
"Set more parameters to be refined."
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "59",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:27.029588Z",
"iopub.status.busy": "2026-01-06T13:55:27.029426Z",
"iopub.status.idle": "2026-01-06T13:55:27.032669Z",
"shell.execute_reply": "2026-01-06T13:55:27.032110Z"
}
},
"outputs": [],
"source": [
"model.atom_sites['O'].fract_x.free = True\n",
"model.atom_sites['O'].fract_z.free = True\n",
"model.atom_sites['Cl'].fract_z.free = True\n",
"model.atom_sites['H'].fract_x.free = True\n",
"model.atom_sites['H'].fract_z.free = True"
]
},
{
"cell_type": "markdown",
"id": "60",
"metadata": {},
"source": [
"Show free parameters after selection."
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "61",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:27.034618Z",
"iopub.status.busy": "2026-01-06T13:55:27.034519Z",
"iopub.status.idle": "2026-01-06T13:55:27.394880Z",
"shell.execute_reply": "2026-01-06T13:55:27.393722Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mFree parameters for both sample models \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34m🧩 data blocks\u001b[0m\u001b[1;34m)\u001b[0m\u001b[1;34m and experiments \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34m🔬 data blocks\u001b[0m\u001b[1;34m)\u001b[0m\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" datablock | \n",
" category | \n",
" entry | \n",
" parameter | \n",
" value | \n",
" uncertainty | \n",
" min | \n",
" max | \n",
" units | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_a | \n",
" 6.86276 | \n",
" 0.00033 | \n",
" -inf | \n",
" inf | \n",
" Å | \n",
"
\n",
" \n",
" | 2 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_c | \n",
" 14.13889 | \n",
" 0.00088 | \n",
" -inf | \n",
" inf | \n",
" Å | \n",
"
\n",
" \n",
" | 3 | \n",
" hs | \n",
" atom_site | \n",
" O | \n",
" fract_x | \n",
" 0.21000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 4 | \n",
" hs | \n",
" atom_site | \n",
" O | \n",
" fract_z | \n",
" 0.06000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 5 | \n",
" hs | \n",
" atom_site | \n",
" Cl | \n",
" fract_z | \n",
" 0.19700 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 6 | \n",
" hs | \n",
" atom_site | \n",
" H | \n",
" fract_x | \n",
" 0.13000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 7 | \n",
" hs | \n",
" atom_site | \n",
" H | \n",
" fract_z | \n",
" 0.08000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 8 | \n",
" hrpt | \n",
" linked_phases | \n",
" hs | \n",
" scale | \n",
" 0.45704 | \n",
" 0.00318 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 9 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_u | \n",
" 0.10418 | \n",
" 0.04510 | \n",
" -inf | \n",
" inf | \n",
" deg² | \n",
"
\n",
" \n",
" | 10 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_v | \n",
" -0.49766 | \n",
" 0.06188 | \n",
" -inf | \n",
" inf | \n",
" deg² | \n",
"
\n",
" \n",
" | 11 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_w | \n",
" 0.35919 | \n",
" 0.02266 | \n",
" -inf | \n",
" inf | \n",
" deg² | \n",
"
\n",
" \n",
" | 12 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_lorentz_x | \n",
" 0.50419 | \n",
" 0.00753 | \n",
" -inf | \n",
" inf | \n",
" deg | \n",
"
\n",
" \n",
" | 13 | \n",
" hrpt | \n",
" instrument | \n",
" | \n",
" twotheta_offset | \n",
" 0.12889 | \n",
" 0.00379 | \n",
" -inf | \n",
" inf | \n",
" deg | \n",
"
\n",
" \n",
" | 14 | \n",
" hrpt | \n",
" background | \n",
" 1 | \n",
" y | \n",
" 645.48303 | \n",
" 23.76745 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 15 | \n",
" hrpt | \n",
" background | \n",
" 2 | \n",
" y | \n",
" 520.85952 | \n",
" 13.60879 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 16 | \n",
" hrpt | \n",
" background | \n",
" 3 | \n",
" y | \n",
" 455.00355 | \n",
" 10.42197 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 17 | \n",
" hrpt | \n",
" background | \n",
" 4 | \n",
" y | \n",
" 428.86390 | \n",
" 5.40186 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 18 | \n",
" hrpt | \n",
" background | \n",
" 5 | \n",
" y | \n",
" 453.50084 | \n",
" 5.21353 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 19 | \n",
" hrpt | \n",
" background | \n",
" 6 | \n",
" y | \n",
" 446.75916 | \n",
" 5.46856 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 20 | \n",
" hrpt | \n",
" background | \n",
" 7 | \n",
" y | \n",
" 411.56202 | \n",
" 5.44902 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 21 | \n",
" hrpt | \n",
" background | \n",
" 8 | \n",
" y | \n",
" 364.38279 | \n",
" 5.66340 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 22 | \n",
" hrpt | \n",
" background | \n",
" 9 | \n",
" y | \n",
" 469.28374 | \n",
" 5.49874 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.analysis.show_free_params()"
]
},
{
"cell_type": "markdown",
"id": "62",
"metadata": {},
"source": [
"#### Run Fitting"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "63",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:27.397856Z",
"iopub.status.busy": "2026-01-06T13:55:27.397524Z",
"iopub.status.idle": "2026-01-06T13:55:43.100394Z",
"shell.execute_reply": "2026-01-06T13:55:43.099503Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mUsing experiment 🔬 \u001b[0m\u001b[32m'hrpt'\u001b[0m\u001b[1;34m for \u001b[0m\u001b[32m'single'\u001b[0m\u001b[1;34m fitting\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"🚀 Starting fit process with \u001b[32m'lmfit \u001b[0m\u001b[32m(\u001b[0m\u001b[32mleastsq\u001b[0m\u001b[32m)\u001b[0m\u001b[32m'\u001b[0m\u001b[33m...\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📈 Goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m change:\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" iteration | \n",
" χ² | \n",
" improvement [%] | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" 1 | \n",
" 12.43 | \n",
" | \n",
"
\n",
" \n",
" | 2 | \n",
" 26 | \n",
" 5.11 | \n",
" 58.9% ↓ | \n",
"
\n",
" \n",
" | 3 | \n",
" 49 | \n",
" 4.40 | \n",
" 13.9% ↓ | \n",
"
\n",
" \n",
" | 4 | \n",
" 72 | \n",
" 4.35 | \n",
" 1.3% ↓ | \n",
"
\n",
" \n",
" | 5 | \n",
" 188 | \n",
" 4.34 | \n",
" | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"🏆 Best goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m is \u001b[1;36m4.34\u001b[0m at iteration \u001b[1;36m187\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Fitting complete.\n"
]
}
],
"source": [
"project.analysis.fit()"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "64",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:43.103608Z",
"iopub.status.busy": "2026-01-06T13:55:43.103393Z",
"iopub.status.idle": "2026-01-06T13:55:44.031577Z",
"shell.execute_reply": "2026-01-06T13:55:44.030444Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mFit results\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Success: \u001b[3;92mTrue\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"⏱️ Fitting time: \u001b[1;36m15.02\u001b[0m seconds\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 Goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m: \u001b[1;36m4.34\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 R-factor \u001b[1m(\u001b[0mRf\u001b[1m)\u001b[0m: \u001b[1;36m6.01\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 R-factor squared \u001b[1m(\u001b[0mRf²\u001b[1m)\u001b[0m: \u001b[1;36m7.75\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 Weighted R-factor \u001b[1m(\u001b[0mwR\u001b[1m)\u001b[0m: \u001b[1;36m7.54\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📈 Fitted parameters:\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" datablock | \n",
" category | \n",
" entry | \n",
" parameter | \n",
" start | \n",
" fitted | \n",
" uncertainty | \n",
" units | \n",
" change | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_a | \n",
" 6.8628 | \n",
" 6.8621 | \n",
" 0.0002 | \n",
" Å | \n",
" 0.01 % ↓ | \n",
"
\n",
" \n",
" | 2 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_c | \n",
" 14.1389 | \n",
" 14.1356 | \n",
" 0.0005 | \n",
" Å | \n",
" 0.02 % ↓ | \n",
"
\n",
" \n",
" | 3 | \n",
" hs | \n",
" atom_site | \n",
" O | \n",
" fract_x | \n",
" 0.2100 | \n",
" 0.2059 | \n",
" 0.0002 | \n",
" | \n",
" 1.96 % ↓ | \n",
"
\n",
" \n",
" | 4 | \n",
" hs | \n",
" atom_site | \n",
" O | \n",
" fract_z | \n",
" 0.0600 | \n",
" 0.0625 | \n",
" 0.0002 | \n",
" | \n",
" 4.14 % ↑ | \n",
"
\n",
" \n",
" | 5 | \n",
" hs | \n",
" atom_site | \n",
" Cl | \n",
" fract_z | \n",
" 0.1970 | \n",
" 0.1977 | \n",
" 0.0002 | \n",
" | \n",
" 0.36 % ↑ | \n",
"
\n",
" \n",
" | 6 | \n",
" hs | \n",
" atom_site | \n",
" H | \n",
" fract_x | \n",
" 0.1300 | \n",
" 0.1330 | \n",
" 0.0002 | \n",
" | \n",
" 2.33 % ↑ | \n",
"
\n",
" \n",
" | 7 | \n",
" hs | \n",
" atom_site | \n",
" H | \n",
" fract_z | \n",
" 0.0800 | \n",
" 0.0877 | \n",
" 0.0001 | \n",
" | \n",
" 9.59 % ↑ | \n",
"
\n",
" \n",
" | 8 | \n",
" hrpt | \n",
" linked_phases | \n",
" hs | \n",
" scale | \n",
" 0.4570 | \n",
" 0.4176 | \n",
" 0.0021 | \n",
" | \n",
" 8.63 % ↓ | \n",
"
\n",
" \n",
" | 9 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_u | \n",
" 0.1042 | \n",
" 0.1789 | \n",
" 0.0119 | \n",
" deg² | \n",
" 71.71 % ↑ | \n",
"
\n",
" \n",
" | 10 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_v | \n",
" -0.4977 | \n",
" -0.3964 | \n",
" 0.0222 | \n",
" deg² | \n",
" 20.35 % ↓ | \n",
"
\n",
" \n",
" | 11 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_w | \n",
" 0.3592 | \n",
" 0.3272 | \n",
" 0.0100 | \n",
" deg² | \n",
" 8.92 % ↓ | \n",
"
\n",
" \n",
" | 12 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_lorentz_x | \n",
" 0.5042 | \n",
" 0.3601 | \n",
" 0.0089 | \n",
" deg | \n",
" 28.57 % ↓ | \n",
"
\n",
" \n",
" | 13 | \n",
" hrpt | \n",
" instrument | \n",
" | \n",
" twotheta_offset | \n",
" 0.1289 | \n",
" 0.1167 | \n",
" 0.0021 | \n",
" deg | \n",
" 9.43 % ↓ | \n",
"
\n",
" \n",
" | 14 | \n",
" hrpt | \n",
" background | \n",
" 1 | \n",
" y | \n",
" 645.4830 | \n",
" 647.4024 | \n",
" 14.0610 | \n",
" | \n",
" 0.30 % ↑ | \n",
"
\n",
" \n",
" | 15 | \n",
" hrpt | \n",
" background | \n",
" 2 | \n",
" y | \n",
" 520.8595 | \n",
" 523.4725 | \n",
" 8.0510 | \n",
" | \n",
" 0.50 % ↑ | \n",
"
\n",
" \n",
" | 16 | \n",
" hrpt | \n",
" background | \n",
" 3 | \n",
" y | \n",
" 455.0036 | \n",
" 453.7545 | \n",
" 6.1678 | \n",
" | \n",
" 0.27 % ↓ | \n",
"
\n",
" \n",
" | 17 | \n",
" hrpt | \n",
" background | \n",
" 4 | \n",
" y | \n",
" 428.8639 | \n",
" 437.9479 | \n",
" 3.2221 | \n",
" | \n",
" 2.12 % ↑ | \n",
"
\n",
" \n",
" | 18 | \n",
" hrpt | \n",
" background | \n",
" 5 | \n",
" y | \n",
" 453.5008 | \n",
" 477.4863 | \n",
" 3.2261 | \n",
" | \n",
" 5.29 % ↑ | \n",
"
\n",
" \n",
" | 19 | \n",
" hrpt | \n",
" background | \n",
" 6 | \n",
" y | \n",
" 446.7592 | \n",
" 485.0177 | \n",
" 3.4007 | \n",
" | \n",
" 8.56 % ↑ | \n",
"
\n",
" \n",
" | 20 | \n",
" hrpt | \n",
" background | \n",
" 7 | \n",
" y | \n",
" 411.5620 | \n",
" 452.4338 | \n",
" 3.2894 | \n",
" | \n",
" 9.93 % ↑ | \n",
"
\n",
" \n",
" | 21 | \n",
" hrpt | \n",
" background | \n",
" 8 | \n",
" y | \n",
" 364.3828 | \n",
" 435.3732 | \n",
" 3.5007 | \n",
" | \n",
" 19.48 % ↑ | \n",
"
\n",
" \n",
" | 22 | \n",
" hrpt | \n",
" background | \n",
" 9 | \n",
" y | \n",
" 469.2837 | \n",
" 427.3883 | \n",
" 3.6274 | \n",
" | \n",
" 8.93 % ↓ | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.analysis.show_fit_results()"
]
},
{
"cell_type": "markdown",
"id": "65",
"metadata": {},
"source": [
"#### Plot Measured vs Calculated"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "66",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:44.035019Z",
"iopub.status.busy": "2026-01-06T13:55:44.034804Z",
"iopub.status.idle": "2026-01-06T13:55:44.484862Z",
"shell.execute_reply": "2026-01-06T13:55:44.484090Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)"
]
},
{
"cell_type": "code",
"execution_count": 38,
"id": "67",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:44.488739Z",
"iopub.status.busy": "2026-01-06T13:55:44.488202Z",
"iopub.status.idle": "2026-01-06T13:55:45.179146Z",
"shell.execute_reply": "2026-01-06T13:55:45.178527Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', x_min=48, x_max=51, show_residual=True)"
]
},
{
"cell_type": "markdown",
"id": "68",
"metadata": {},
"source": [
"### Perform Fit 4/5\n",
"\n",
"Set more parameters to be refined."
]
},
{
"cell_type": "code",
"execution_count": 39,
"id": "69",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:45.181113Z",
"iopub.status.busy": "2026-01-06T13:55:45.180905Z",
"iopub.status.idle": "2026-01-06T13:55:45.184135Z",
"shell.execute_reply": "2026-01-06T13:55:45.183591Z"
}
},
"outputs": [],
"source": [
"model.atom_sites['Zn'].b_iso.free = True\n",
"model.atom_sites['Cu'].b_iso.free = True\n",
"model.atom_sites['O'].b_iso.free = True\n",
"model.atom_sites['Cl'].b_iso.free = True\n",
"model.atom_sites['H'].b_iso.free = True"
]
},
{
"cell_type": "markdown",
"id": "70",
"metadata": {},
"source": [
"Show free parameters after selection."
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "71",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:45.186274Z",
"iopub.status.busy": "2026-01-06T13:55:45.186117Z",
"iopub.status.idle": "2026-01-06T13:55:45.573076Z",
"shell.execute_reply": "2026-01-06T13:55:45.571740Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mFree parameters for both sample models \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34m🧩 data blocks\u001b[0m\u001b[1;34m)\u001b[0m\u001b[1;34m and experiments \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34m🔬 data blocks\u001b[0m\u001b[1;34m)\u001b[0m\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" datablock | \n",
" category | \n",
" entry | \n",
" parameter | \n",
" value | \n",
" uncertainty | \n",
" min | \n",
" max | \n",
" units | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_a | \n",
" 6.86205 | \n",
" 0.00020 | \n",
" -inf | \n",
" inf | \n",
" Å | \n",
"
\n",
" \n",
" | 2 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_c | \n",
" 14.13560 | \n",
" 0.00049 | \n",
" -inf | \n",
" inf | \n",
" Å | \n",
"
\n",
" \n",
" | 3 | \n",
" hs | \n",
" atom_site | \n",
" Zn | \n",
" b_iso | \n",
" 0.50000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" Ų | \n",
"
\n",
" \n",
" | 4 | \n",
" hs | \n",
" atom_site | \n",
" Cu | \n",
" b_iso | \n",
" 0.50000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" Ų | \n",
"
\n",
" \n",
" | 5 | \n",
" hs | \n",
" atom_site | \n",
" O | \n",
" fract_x | \n",
" 0.20589 | \n",
" 0.00022 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 6 | \n",
" hs | \n",
" atom_site | \n",
" O | \n",
" fract_z | \n",
" 0.06248 | \n",
" 0.00016 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 7 | \n",
" hs | \n",
" atom_site | \n",
" O | \n",
" b_iso | \n",
" 0.50000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" Ų | \n",
"
\n",
" \n",
" | 8 | \n",
" hs | \n",
" atom_site | \n",
" Cl | \n",
" fract_z | \n",
" 0.19771 | \n",
" 0.00016 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 9 | \n",
" hs | \n",
" atom_site | \n",
" Cl | \n",
" b_iso | \n",
" 0.50000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" Ų | \n",
"
\n",
" \n",
" | 10 | \n",
" hs | \n",
" atom_site | \n",
" H | \n",
" fract_x | \n",
" 0.13303 | \n",
" 0.00017 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 11 | \n",
" hs | \n",
" atom_site | \n",
" H | \n",
" fract_z | \n",
" 0.08767 | \n",
" 0.00012 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 12 | \n",
" hs | \n",
" atom_site | \n",
" H | \n",
" b_iso | \n",
" 0.50000 | \n",
" | \n",
" -inf | \n",
" inf | \n",
" Ų | \n",
"
\n",
" \n",
" | 13 | \n",
" hrpt | \n",
" linked_phases | \n",
" hs | \n",
" scale | \n",
" 0.41758 | \n",
" 0.00208 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 14 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_u | \n",
" 0.17888 | \n",
" 0.01187 | \n",
" -inf | \n",
" inf | \n",
" deg² | \n",
"
\n",
" \n",
" | 15 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_v | \n",
" -0.39638 | \n",
" 0.02219 | \n",
" -inf | \n",
" inf | \n",
" deg² | \n",
"
\n",
" \n",
" | 16 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_w | \n",
" 0.32715 | \n",
" 0.00999 | \n",
" -inf | \n",
" inf | \n",
" deg² | \n",
"
\n",
" \n",
" | 17 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_lorentz_x | \n",
" 0.36012 | \n",
" 0.00888 | \n",
" -inf | \n",
" inf | \n",
" deg | \n",
"
\n",
" \n",
" | 18 | \n",
" hrpt | \n",
" instrument | \n",
" | \n",
" twotheta_offset | \n",
" 0.11674 | \n",
" 0.00215 | \n",
" -inf | \n",
" inf | \n",
" deg | \n",
"
\n",
" \n",
" | 19 | \n",
" hrpt | \n",
" background | \n",
" 1 | \n",
" y | \n",
" 647.40242 | \n",
" 14.06098 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 20 | \n",
" hrpt | \n",
" background | \n",
" 2 | \n",
" y | \n",
" 523.47254 | \n",
" 8.05103 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 21 | \n",
" hrpt | \n",
" background | \n",
" 3 | \n",
" y | \n",
" 453.75449 | \n",
" 6.16778 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 22 | \n",
" hrpt | \n",
" background | \n",
" 4 | \n",
" y | \n",
" 437.94787 | \n",
" 3.22213 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 23 | \n",
" hrpt | \n",
" background | \n",
" 5 | \n",
" y | \n",
" 477.48627 | \n",
" 3.22612 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 24 | \n",
" hrpt | \n",
" background | \n",
" 6 | \n",
" y | \n",
" 485.01766 | \n",
" 3.40075 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 25 | \n",
" hrpt | \n",
" background | \n",
" 7 | \n",
" y | \n",
" 452.43379 | \n",
" 3.28943 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 26 | \n",
" hrpt | \n",
" background | \n",
" 8 | \n",
" y | \n",
" 435.37321 | \n",
" 3.50066 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
" | 27 | \n",
" hrpt | \n",
" background | \n",
" 9 | \n",
" y | \n",
" 427.38825 | \n",
" 3.62743 | \n",
" -inf | \n",
" inf | \n",
" | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.analysis.show_free_params()"
]
},
{
"cell_type": "markdown",
"id": "72",
"metadata": {},
"source": [
"#### Run Fitting"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "73",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:45.575154Z",
"iopub.status.busy": "2026-01-06T13:55:45.575019Z",
"iopub.status.idle": "2026-01-06T13:55:57.417421Z",
"shell.execute_reply": "2026-01-06T13:55:57.416360Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mUsing experiment 🔬 \u001b[0m\u001b[32m'hrpt'\u001b[0m\u001b[1;34m for \u001b[0m\u001b[32m'single'\u001b[0m\u001b[1;34m fitting\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"🚀 Starting fit process with \u001b[32m'lmfit \u001b[0m\u001b[32m(\u001b[0m\u001b[32mleastsq\u001b[0m\u001b[32m)\u001b[0m\u001b[32m'\u001b[0m\u001b[33m...\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📈 Goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m change:\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" iteration | \n",
" χ² | \n",
" improvement [%] | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" 1 | \n",
" 4.35 | \n",
" | \n",
"
\n",
" \n",
" | 2 | \n",
" 31 | \n",
" 2.30 | \n",
" 47.1% ↓ | \n",
"
\n",
" \n",
" | 3 | \n",
" 59 | \n",
" 2.11 | \n",
" 8.3% ↓ | \n",
"
\n",
" \n",
" | 4 | \n",
" 144 | \n",
" 2.11 | \n",
" | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"🏆 Best goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m is \u001b[1;36m2.11\u001b[0m at iteration \u001b[1;36m118\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Fitting complete.\n"
]
}
],
"source": [
"project.analysis.fit()"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "74",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:57.420186Z",
"iopub.status.busy": "2026-01-06T13:55:57.419992Z",
"iopub.status.idle": "2026-01-06T13:55:58.161585Z",
"shell.execute_reply": "2026-01-06T13:55:58.161022Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mFit results\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✅ Success: \u001b[3;92mTrue\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"⏱️ Fitting time: \u001b[1;36m11.22\u001b[0m seconds\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 Goodness-of-fit \u001b[1m(\u001b[0mreduced χ²\u001b[1m)\u001b[0m: \u001b[1;36m2.11\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 R-factor \u001b[1m(\u001b[0mRf\u001b[1m)\u001b[0m: \u001b[1;36m4.17\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 R-factor squared \u001b[1m(\u001b[0mRf²\u001b[1m)\u001b[0m: \u001b[1;36m5.05\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📏 Weighted R-factor \u001b[1m(\u001b[0mwR\u001b[1m)\u001b[0m: \u001b[1;36m4.72\u001b[0m%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"📈 Fitted parameters:\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" datablock | \n",
" category | \n",
" entry | \n",
" parameter | \n",
" start | \n",
" fitted | \n",
" uncertainty | \n",
" units | \n",
" change | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_a | \n",
" 6.8621 | \n",
" 6.8615 | \n",
" 0.0001 | \n",
" Å | \n",
" 0.01 % ↓ | \n",
"
\n",
" \n",
" | 2 | \n",
" hs | \n",
" cell | \n",
" | \n",
" length_c | \n",
" 14.1356 | \n",
" 14.1360 | \n",
" 0.0004 | \n",
" Å | \n",
" 0.00 % ↑ | \n",
"
\n",
" \n",
" | 3 | \n",
" hs | \n",
" atom_site | \n",
" Zn | \n",
" b_iso | \n",
" 0.5000 | \n",
" 0.0855 | \n",
" 0.0630 | \n",
" Ų | \n",
" 82.91 % ↓ | \n",
"
\n",
" \n",
" | 4 | \n",
" hs | \n",
" atom_site | \n",
" Cu | \n",
" b_iso | \n",
" 0.5000 | \n",
" 1.1937 | \n",
" 0.0399 | \n",
" Ų | \n",
" 138.74 % ↑ | \n",
"
\n",
" \n",
" | 5 | \n",
" hs | \n",
" atom_site | \n",
" O | \n",
" fract_x | \n",
" 0.2059 | \n",
" 0.2060 | \n",
" 0.0002 | \n",
" | \n",
" 0.06 % ↑ | \n",
"
\n",
" \n",
" | 6 | \n",
" hs | \n",
" atom_site | \n",
" O | \n",
" fract_z | \n",
" 0.0625 | \n",
" 0.0609 | \n",
" 0.0001 | \n",
" | \n",
" 2.53 % ↓ | \n",
"
\n",
" \n",
" | 7 | \n",
" hs | \n",
" atom_site | \n",
" O | \n",
" b_iso | \n",
" 0.5000 | \n",
" 0.7001 | \n",
" 0.0360 | \n",
" Ų | \n",
" 40.02 % ↑ | \n",
"
\n",
" \n",
" | 8 | \n",
" hs | \n",
" atom_site | \n",
" Cl | \n",
" fract_z | \n",
" 0.1977 | \n",
" 0.1968 | \n",
" 0.0001 | \n",
" | \n",
" 0.49 % ↓ | \n",
"
\n",
" \n",
" | 9 | \n",
" hs | \n",
" atom_site | \n",
" Cl | \n",
" b_iso | \n",
" 0.5000 | \n",
" 1.1129 | \n",
" 0.0385 | \n",
" Ų | \n",
" 122.58 % ↑ | \n",
"
\n",
" \n",
" | 10 | \n",
" hs | \n",
" atom_site | \n",
" H | \n",
" fract_x | \n",
" 0.1330 | \n",
" 0.1322 | \n",
" 0.0002 | \n",
" | \n",
" 0.62 % ↓ | \n",
"
\n",
" \n",
" | 11 | \n",
" hs | \n",
" atom_site | \n",
" H | \n",
" fract_z | \n",
" 0.0877 | \n",
" 0.0900 | \n",
" 0.0001 | \n",
" | \n",
" 2.63 % ↑ | \n",
"
\n",
" \n",
" | 12 | \n",
" hs | \n",
" atom_site | \n",
" H | \n",
" b_iso | \n",
" 0.5000 | \n",
" 2.3404 | \n",
" 0.0401 | \n",
" Ų | \n",
" 368.08 % ↑ | \n",
"
\n",
" \n",
" | 13 | \n",
" hrpt | \n",
" linked_phases | \n",
" hs | \n",
" scale | \n",
" 0.4176 | \n",
" 0.4918 | \n",
" 0.0022 | \n",
" | \n",
" 17.76 % ↑ | \n",
"
\n",
" \n",
" | 14 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_u | \n",
" 0.1789 | \n",
" 0.1579 | \n",
" 0.0076 | \n",
" deg² | \n",
" 11.70 % ↓ | \n",
"
\n",
" \n",
" | 15 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_v | \n",
" -0.3964 | \n",
" -0.3571 | \n",
" 0.0147 | \n",
" deg² | \n",
" 9.91 % ↓ | \n",
"
\n",
" \n",
" | 16 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_gauss_w | \n",
" 0.3272 | \n",
" 0.3498 | \n",
" 0.0067 | \n",
" deg² | \n",
" 6.92 % ↑ | \n",
"
\n",
" \n",
" | 17 | \n",
" hrpt | \n",
" peak | \n",
" | \n",
" broad_lorentz_x | \n",
" 0.3601 | \n",
" 0.2927 | \n",
" 0.0065 | \n",
" deg | \n",
" 18.73 % ↓ | \n",
"
\n",
" \n",
" | 18 | \n",
" hrpt | \n",
" instrument | \n",
" | \n",
" twotheta_offset | \n",
" 0.1167 | \n",
" 0.1137 | \n",
" 0.0015 | \n",
" deg | \n",
" 2.62 % ↓ | \n",
"
\n",
" \n",
" | 19 | \n",
" hrpt | \n",
" background | \n",
" 1 | \n",
" y | \n",
" 647.4024 | \n",
" 648.4125 | \n",
" 9.7968 | \n",
" | \n",
" 0.16 % ↑ | \n",
"
\n",
" \n",
" | 20 | \n",
" hrpt | \n",
" background | \n",
" 2 | \n",
" y | \n",
" 523.4725 | \n",
" 523.7880 | \n",
" 5.6095 | \n",
" | \n",
" 0.06 % ↑ | \n",
"
\n",
" \n",
" | 21 | \n",
" hrpt | \n",
" background | \n",
" 3 | \n",
" y | \n",
" 453.7545 | \n",
" 454.9375 | \n",
" 4.2976 | \n",
" | \n",
" 0.26 % ↑ | \n",
"
\n",
" \n",
" | 22 | \n",
" hrpt | \n",
" background | \n",
" 4 | \n",
" y | \n",
" 437.9479 | \n",
" 435.9131 | \n",
" 2.2512 | \n",
" | \n",
" 0.46 % ↓ | \n",
"
\n",
" \n",
" | 23 | \n",
" hrpt | \n",
" background | \n",
" 5 | \n",
" y | \n",
" 477.4863 | \n",
" 472.9718 | \n",
" 2.2759 | \n",
" | \n",
" 0.95 % ↓ | \n",
"
\n",
" \n",
" | 24 | \n",
" hrpt | \n",
" background | \n",
" 6 | \n",
" y | \n",
" 485.0177 | \n",
" 486.6064 | \n",
" 2.4356 | \n",
" | \n",
" 0.33 % ↑ | \n",
"
\n",
" \n",
" | 25 | \n",
" hrpt | \n",
" background | \n",
" 7 | \n",
" y | \n",
" 452.4338 | \n",
" 472.4095 | \n",
" 2.3483 | \n",
" | \n",
" 4.42 % ↑ | \n",
"
\n",
" \n",
" | 26 | \n",
" hrpt | \n",
" background | \n",
" 8 | \n",
" y | \n",
" 435.3732 | \n",
" 496.7338 | \n",
" 2.6211 | \n",
" | \n",
" 14.09 % ↑ | \n",
"
\n",
" \n",
" | 27 | \n",
" hrpt | \n",
" background | \n",
" 9 | \n",
" y | \n",
" 427.3883 | \n",
" 473.1457 | \n",
" 2.9361 | \n",
" | \n",
" 10.71 % ↑ | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.analysis.show_fit_results()"
]
},
{
"cell_type": "markdown",
"id": "75",
"metadata": {},
"source": [
"#### Plot Measured vs Calculated"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "76",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:58.163511Z",
"iopub.status.busy": "2026-01-06T13:55:58.163367Z",
"iopub.status.idle": "2026-01-06T13:55:58.615077Z",
"shell.execute_reply": "2026-01-06T13:55:58.610019Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', show_residual=True)"
]
},
{
"cell_type": "code",
"execution_count": 44,
"id": "77",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:58.618089Z",
"iopub.status.busy": "2026-01-06T13:55:58.617861Z",
"iopub.status.idle": "2026-01-06T13:55:59.032736Z",
"shell.execute_reply": "2026-01-06T13:55:59.032241Z"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.plot_meas_vs_calc(expt_name='hrpt', x_min=48, x_max=51, show_residual=True)"
]
},
{
"cell_type": "markdown",
"id": "78",
"metadata": {},
"source": [
"## Summary\n",
"\n",
"This final section shows how to review the results of the analysis."
]
},
{
"cell_type": "markdown",
"id": "79",
"metadata": {},
"source": [
"#### Show Project Summary"
]
},
{
"cell_type": "code",
"execution_count": 45,
"id": "80",
"metadata": {
"execution": {
"iopub.execute_input": "2026-01-06T13:55:59.035468Z",
"iopub.status.busy": "2026-01-06T13:55:59.035275Z",
"iopub.status.idle": "2026-01-06T13:56:00.592408Z",
"shell.execute_reply": "2026-01-06T13:56:00.591916Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;32m————————————\u001b[0m\n",
"\u001b[1;32mPROJECT INFO\u001b[0m\n",
"\u001b[1;32m————————————\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mTitle\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Untitled Project\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;32m—————————————————————\u001b[0m\n",
"\u001b[1;32mCRYSTALLOGRAPHIC DATA\u001b[0m\n",
"\u001b[1;32m—————————————————————\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mPhase datablock\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"🧩 hs\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mSpace group\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"R \u001b[1;36m-3\u001b[0m m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mCell parameters\u001b[0m\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" Parameter | \n",
" Value | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" a | \n",
" 6.86149 | \n",
"
\n",
" \n",
" | 2 | \n",
" b | \n",
" 6.86149 | \n",
"
\n",
" \n",
" | 3 | \n",
" c | \n",
" 14.13604 | \n",
"
\n",
" \n",
" | 4 | \n",
" alpha | \n",
" 90.00000 | \n",
"
\n",
" \n",
" | 5 | \n",
" beta | \n",
" 90.00000 | \n",
"
\n",
" \n",
" | 6 | \n",
" gamma | \n",
" 120.00000 | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mAtom sites\u001b[0m\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" label | \n",
" type | \n",
" x | \n",
" y | \n",
" z | \n",
" occ | \n",
" Biso | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" Zn | \n",
" Zn | \n",
" 0.00000 | \n",
" 0.00000 | \n",
" 0.50000 | \n",
" 1.00000 | \n",
" 0.08546 | \n",
"
\n",
" \n",
" | 2 | \n",
" Cu | \n",
" Cu | \n",
" 0.50000 | \n",
" 0.00000 | \n",
" 0.00000 | \n",
" 1.00000 | \n",
" 1.19372 | \n",
"
\n",
" \n",
" | 3 | \n",
" O | \n",
" O | \n",
" 0.20601 | \n",
" -0.20601 | \n",
" 0.06090 | \n",
" 1.00000 | \n",
" 0.70009 | \n",
"
\n",
" \n",
" | 4 | \n",
" Cl | \n",
" Cl | \n",
" 0.00000 | \n",
" 0.00000 | \n",
" 0.19675 | \n",
" 1.00000 | \n",
" 1.11288 | \n",
"
\n",
" \n",
" | 5 | \n",
" H | \n",
" 2H | \n",
" 0.13220 | \n",
" -0.13220 | \n",
" 0.08998 | \n",
" 1.00000 | \n",
" 2.34039 | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;32m———————————\u001b[0m\n",
"\u001b[1;32mEXPERIMENTS\u001b[0m\n",
"\u001b[1;32m———————————\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mExperiment datablock\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"🔬 hrpt\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mExperiment type\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"powder, neutron, constant wavelength\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mWavelength\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36m1.89000\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34m2θ offset\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;36m0.11368\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mProfile type\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"PeakProfileTypeEnum.PSEUDO_VOIGT\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mPeak broadening \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34mGaussian\u001b[0m\u001b[1;34m)\u001b[0m\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" Parameter | \n",
" Value | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" U | \n",
" 0.15795 | \n",
"
\n",
" \n",
" | 2 | \n",
" V | \n",
" -0.35708 | \n",
"
\n",
" \n",
" | 3 | \n",
" W | \n",
" 0.34978 | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mPeak broadening \u001b[0m\u001b[1;34m(\u001b[0m\u001b[1;34mLorentzian\u001b[0m\u001b[1;34m)\u001b[0m\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" Parameter | \n",
" Value | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" X | \n",
" 0.29266 | \n",
"
\n",
" \n",
" | 2 | \n",
" Y | \n",
" 0.00000 | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;32m———————\u001b[0m\n",
"\u001b[1;32mFITTING\u001b[0m\n",
"\u001b[1;32m———————\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mCalculation engine\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"cryspy\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mMinimization engine\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"lmfit \u001b[1m(\u001b[0mleastsq\u001b[1m)\u001b[0m\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1;34mFit quality\u001b[0m\n"
]
},
{
"data": {
"application/javascript": [
"\n",
" (function() {\n",
" var isDark = false;\n",
"\n",
" // Check JupyterLab theme\n",
" if (document.body.classList.contains('jp-mod-dark') || \n",
" document.body.classList.contains('theme-dark') ||\n",
" document.body.classList.contains('vscode-dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check theme attribute\n",
" var themeAttr = document.body.getAttribute('data-jp-theme-name');\n",
" if (themeAttr && themeAttr.includes('dark')) {\n",
" isDark = true;\n",
" }\n",
"\n",
" // Check computed background color\n",
" var notebookEl = document.querySelector('.jp-Notebook') || \n",
" document.querySelector('.notebook_app') ||\n",
" document.body;\n",
" if (notebookEl) {\n",
" var bgColor = window.getComputedStyle(notebookEl).backgroundColor;\n",
" var rgb = bgColor.match(/\\d+/g);\n",
" if (rgb && rgb.length >= 3) {\n",
" var brightness = (parseInt(rgb[0]) + parseInt(rgb[1]) + parseInt(rgb[2])) / 3;\n",
" if (brightness < 128) {\n",
" isDark = true;\n",
" }\n",
" }\n",
" }\n",
"\n",
" // Store result\n",
" if (typeof IPython !== 'undefined' && IPython.notebook && IPython.notebook.kernel) {\n",
" IPython.notebook.kernel.execute('_jupyter_dark_detect_result = ' + isDark);\n",
" }\n",
" })();\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
" if (typeof IPython !== 'undefined' && IPython.notebook) {\n",
" IPython.notebook.kernel.execute(\"_jupyter_dark_detect_result = \" + \n",
" (document.body.classList.contains('theme-dark') || \n",
" document.body.classList.contains('jp-mod-dark') ||\n",
" (document.body.getAttribute('data-jp-theme-name') && \n",
" document.body.getAttribute('data-jp-theme-name').includes('dark'))));\n",
" }\n",
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" \n",
" \n",
" | | \n",
" metric | \n",
" value | \n",
"
\n",
" \n",
" \n",
" \n",
" | 1 | \n",
" Goodness-of-fit (reduced χ²) | \n",
" 2.11 | \n",
"
\n",
" \n",
"
\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"project.summary.show_report()"
]
}
],
"metadata": {
"jupytext": {
"cell_metadata_filter": "-all",
"main_language": "python",
"notebook_metadata_filter": "-all"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.11"
}
},
"nbformat": 4,
"nbformat_minor": 5
}