{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "b4e6465b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Project Root: /Users/mguillermo/Desktop/MGPH/Maestria/Hydrogen_Exp/Analysis/2nd_AMIDIQ_Analysis\n",
      "Uploaded Data: 8\n"
     ]
    }
   ],
   "source": [
    "from pathlib import Path\n",
    "import sys\n",
    "\n",
    "PROJECT_ROOT    =   Path.cwd().parent\n",
    "sys.path.insert(0, str(PROJECT_ROOT))\n",
    "\n",
    "print(\"Project Root:\", PROJECT_ROOT)\n",
    "\n",
    "from    src.visualizacion   import  (plot_xy, comparar_rondas, comparar_experimentos,\n",
    "                                     plot_3D, plot_color_map, plot_dual_axis,\n",
    "                                     plot_con_ajuste)\n",
    "from    src.data_loader     import  (apply_filter, load_all)\n",
    "\n",
    "DATA_DIR    =   PROJECT_ROOT / \"data\"\n",
    "data        =   load_all(DATA_DIR)\n",
    "print(\"Uploaded Data:\", len(data))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "daed37f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 38420 characters]",
      "text/plain": [
       "<Figure size 700x500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 36812 characters]",
      "text/plain": [
       "<Figure size 700x500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 39612 characters]",
      "text/plain": [
       "<Figure size 700x500 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 45924 characters]",
      "text/plain": [
       "<Figure size 700x500 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 50468 characters]",
      "text/plain": [
       "<Figure size 700x500 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 52232 characters]",
      "text/plain": [
       "<Figure size 700x500 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 107344 characters]",
      "text/plain": [
       "<Figure size 800x600 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(<Figure size 800x600 with 1 Axes>,\n",
       " <Axes3D: title={'center': '3D: Voltaje Electrodos (V) vs Corriente Electrodos (A) vs Temperatura'}, xlabel='Voltaje Electrodos (V)', ylabel='Corriente Electrodos (A)', zlabel='Temperatura'>)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ronda       =   1\n",
    "experimento =   3\n",
    "df          =   data[(ronda, experimento)]\n",
    "df_f        =   apply_filter(df, row_start=35, row_end=66)\n",
    "df_f1       =   apply_filter(df, row_start=11, row_end=66)\n",
    "\n",
    "\n",
    "plot_con_ajuste(df, x_col=\"Voltaje Electrodos (V)\", y_col=\"Corriente Electrodos (A)\", \n",
    "                label_datos=\"Datos\")\n",
    "plot_con_ajuste(df_f, x_col=\"Voltaje Electrodos (V)\", y_col=\"Resistencia\")\n",
    "comparar_rondas(data, experimento=2, x_col=\"Voltaje Electrodos (V)\",\n",
    "                y_col= \"Corriente Electrodos (A)\",  \n",
    "                filter_fn=lambda df: apply_filter(df,row_start=11,row_end=66))\n",
    "plot_color_map(df_f, x_col=\"Voltaje Electrodos (V)\", y_col=\"Corriente Electrodos (A)\",\n",
    "               z_col=\"Temperatura\")\n",
    "plot_color_map(df_f1, x_col=\"Voltaje Electrodos (V)\", y_col=\"Corriente Electrodos (A)\",\n",
    "               z_col=\"Temperatura\")\n",
    "plot_dual_axis(df_f, x_col=\"Voltaje Electrodos (V)\", y1_col=\"Resistencia\",\n",
    "               y2_col=\"Temperatura\")\n",
    "plot_3D(df_f1, x_col=\"Voltaje Electrodos (V)\", y_col=\"Corriente Electrodos (A)\", z_col=\"Temperatura\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python_Data_Analysis",
   "language": "python",
   "name": "python_data_analysis"
  },
  "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.14.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
