{ "cells": [ { "cell_type": "markdown", "id": "073dbc36-c3c9-41b5-8957-b7368b74de72", "metadata": {}, "source": [ "# Capacity Test from pvcaptest Configuration YAML file\n", "\n", "This notebook shows how a capacity test can be re-produced for review, further exploration, and validation using a yaml configuation file created by the `CapTest.to_yaml` method. The yaml configuation file read into this notebook (`bifi_config.yaml`) was produced from the example test notebook `captest_class_bifi.ipynb`, see last section of the notebook. \n", "\n", "The results of this test produced using the configuation yaml file (`bifi_config.yaml`) are identical to the example test notebook `captest_class_bifi.ipynb` that was used to produce the `bifi_config.yaml`." ] }, { "cell_type": "code", "execution_count": null, "id": "9f21ed49-f4ae-4971-acd3-5b9fadde87f9", "metadata": {}, "outputs": [], "source": [ "import captest as ct" ] }, { "cell_type": "markdown", "id": "8bcfece7-2adc-49a9-b035-69c71db552e0", "metadata": {}, "source": [ "## Create `CapTest` from Config file\n", "\n", "The `from_yaml` option to create a `CapTest` instance will load, calculate regressors, and apply the filters defined in the config file to the measured and simulated data." ] }, { "cell_type": "code", "execution_count": null, "id": "9e4619ba-452a-42e8-a08d-f21f5a6c8cde", "metadata": {}, "outputs": [], "source": [ "tst = ct.CapTest.from_yaml('./bifi_config.yaml')" ] }, { "cell_type": "markdown", "id": "d0ed6b01-d860-4df5-8bd9-c8e843220c2b", "metadata": {}, "source": [ "## Measured Data" ] }, { "cell_type": "markdown", "id": "f539a858-5ae7-4e99-ba26-683305bfefef", "metadata": {}, "source": [ "### Data Plot" ] }, { "cell_type": "code", "execution_count": null, "id": "b4290c0d-c6e8-47fc-a22a-26307dc5c732", "metadata": {}, "outputs": [], "source": [ "tst.meas.plot()" ] }, { "cell_type": "markdown", "id": "ed25e49f-09f0-4c3e-a470-518e6a5993ff", "metadata": {}, "source": [ "### Filtering Summary" ] }, { "cell_type": "code", "execution_count": null, "id": "db7ccf7d-4c2c-4214-b3aa-7630049ebc09", "metadata": {}, "outputs": [], "source": [ "tst.meas.get_summary()" ] }, { "cell_type": "code", "execution_count": null, "id": "04471319-1744-486d-bc06-eb99a39fe78a", "metadata": {}, "outputs": [], "source": [ "print(tst.meas.describe_filters())" ] }, { "cell_type": "markdown", "id": "631d744c-d0dd-402a-9f99-291ede49446a", "metadata": {}, "source": [ "### Filtering Vizualizations" ] }, { "cell_type": "code", "execution_count": null, "id": "9abe5bc6-0abd-4531-9bde-b5de445fc96f", "metadata": {}, "outputs": [], "source": [ "tst.meas.scatter_filters() + tst.meas.timeseries_filters().opts(width=1_000)" ] }, { "cell_type": "markdown", "id": "bc7d439d-1777-4106-bb62-952f2a27e821", "metadata": {}, "source": [ "### Linked Scatter Plot and Timeseries\n", "\n", "The regression data set after filtering plotted as a scatter plot of POA irradiance against temperature corrected power. The temperature correction is applied by the plot, so this visualization can be used with in a test notebook that does not use temperature corrected power in the regression like this one." ] }, { "cell_type": "code", "execution_count": null, "id": "f1a674c5-14e6-47b9-ba06-eacb0d1bfaa0", "metadata": {}, "outputs": [], "source": [ "tst.scatter_plots(timeseries=True, tc_power=True, tc_mode='replace')" ] }, { "cell_type": "markdown", "id": "29fb49ca-0b05-42d3-8211-1100293db1e2", "metadata": {}, "source": [ "### Regression" ] }, { "cell_type": "code", "execution_count": null, "id": "65a6483d-74ca-491e-855a-e37926fcfd33", "metadata": {}, "outputs": [], "source": [ "tst.meas.fit_regression()" ] }, { "cell_type": "markdown", "id": "fcb99a9b-5b0e-4888-bf19-e7895f2d5c84", "metadata": {}, "source": [ "## Simulated Data" ] }, { "cell_type": "markdown", "id": "86a54c0d-255b-4b8d-a6f3-9fcf0bae3bd9", "metadata": {}, "source": [ "### Data Plot" ] }, { "cell_type": "code", "execution_count": null, "id": "94003dd8-ac80-4ff5-82c7-a0fcd383ac43", "metadata": {}, "outputs": [], "source": [ "tst.sim.plot(default_groups=['real_pwr__', 'irr_poa', 'temp_amb_', 'wind__'], width=1200)" ] }, { "cell_type": "markdown", "id": "660854e0-a7b7-4650-9ce1-4eeac6cc6a16", "metadata": {}, "source": [ "### Filtering Summary" ] }, { "cell_type": "code", "execution_count": null, "id": "1781469b-967e-4b48-a567-85702ce89ebf", "metadata": {}, "outputs": [], "source": [ "tst.sim.get_summary()" ] }, { "cell_type": "code", "execution_count": null, "id": "0242b385-3d06-408e-a466-52a96b082a59", "metadata": {}, "outputs": [], "source": [ "print(tst.sim.describe_filters())" ] }, { "cell_type": "markdown", "id": "22af0898-64b1-46f2-896c-7fce5decc46c", "metadata": {}, "source": [ "### Filtering Vizualizations" ] }, { "cell_type": "code", "execution_count": null, "id": "a02fc13a-72c6-48ad-bbe7-5eb6ac76bad5", "metadata": {}, "outputs": [], "source": [ "tst.sim.scatter_filters() + tst.sim.timeseries_filters().opts(width=1_000)" ] }, { "cell_type": "markdown", "id": "4e91ba28-d5ab-4a8a-848c-feb41855e58b", "metadata": {}, "source": [ "### Regression" ] }, { "cell_type": "code", "execution_count": null, "id": "0d3ee968-a378-4d42-9016-38e7c20d750d", "metadata": {}, "outputs": [], "source": [ "tst.sim.fit_regression()" ] }, { "cell_type": "markdown", "id": "9ec0fcbe-026a-4538-b20e-0f94c9d6b941", "metadata": {}, "source": [ "## Results\n", "\n", "The results of this test produced using the configuation yaml file (`bifi_config.yaml`) are identical to the example test notebook `captest_class_bifi.ipynb` that was used to produce the `bifi_config.yaml`." ] }, { "cell_type": "markdown", "id": "eaddc6e2-fc75-48ee-b59e-68f426e57c6c", "metadata": {}, "source": [ "### Filtering Summary" ] }, { "cell_type": "code", "execution_count": null, "id": "8d088aa8-89b1-45fb-a958-957a7db675f2", "metadata": {}, "outputs": [], "source": [ "tst.get_summary()" ] }, { "cell_type": "markdown", "id": "70e94ad0-e7df-4546-8a36-e5223590d7ef", "metadata": {}, "source": [ "### Reporting Conditions" ] }, { "cell_type": "code", "execution_count": null, "id": "36540aac-5643-436d-9708-ed1856b05d1c", "metadata": {}, "outputs": [], "source": [ "tst.meas.rc" ] }, { "cell_type": "markdown", "id": "1f9c8da3-8e15-48ad-8c94-b0ff543e9c9e", "metadata": {}, "source": [ "### Capacity Ratio and Regression Coefficients Summary" ] }, { "cell_type": "code", "execution_count": null, "id": "41975d54-5fbc-4848-a340-659a3bf76d24", "metadata": {}, "outputs": [], "source": [ "tst.captest_results_check_pvalues(print_res=True)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "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.12.3" } }, "nbformat": 4, "nbformat_minor": 5 }