diff --git a/examples/example.ipynb b/examples/example.ipynb index 2b0f4e8..15ff233 100644 --- a/examples/example.ipynb +++ b/examples/example.ipynb @@ -13,7 +13,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -24,7 +24,7 @@ "import pandas as pd\n", "import ruamel.yaml as ry\n", "\n", - "from pCrunch import LoadsAnalysis, PowerProduction, FatigueParams, read\n", + "from pCrunch import Crunch, FatigueParams, read\n", "from pCrunch.utility import save_yaml, get_windspeeds, convert_summary_stats\n", "\n", "def valid_extension(fp):\n", @@ -40,7 +40,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -74,7 +74,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -112,7 +112,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -134,7 +134,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -173,23 +173,23 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "# The API has changed and is in more of an object oriented framework.\n", - "la = LoadsAnalysis(\n", - " outputs, # The primary input is a list of output files\n", + "cruncher = Crunch(\n", + " outputs, # The primary input is a list of output files\n", " magnitude_channels=magnitude_channels, # All of the following inputs are optional\n", " fatigue_channels=fatigue_channels, # \n", " extreme_channels=channel_extremes, #\n", " trim_data=(0,), # If 'trim_data' is passed, all input files will\n", ") # be trimmed to (tmin, tmax(optional))\n", "\n", - "la.process_outputs(cores=1, # Once LoadsAnalysis is configured, process outputs with\n", - " return_damage=True, # optional return of Palmgren-Miner damange and\n", - " goodman=True) # optional use of goodman correction for mean load values\n", - " # Note `cores` is optional but will trigger parallel processing if configured" + "cruncher.process_outputs(cores=1, # Once LoadsAnalysis is configured, process outputs with\n", + " return_damage=True, # optional return of Palmgren-Miner damange and\n", + " goodman=True) # optional use of goodman correction for mean load values\n", + " # Note `cores` is optional but will trigger parallel processing if configured" ] }, { @@ -201,7 +201,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -434,19 +434,19 @@ "[5 rows x 1113 columns]" ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# The summary stats per each file are here:\n", - "la.summary_stats" + "cruncher.summary_stats" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -550,19 +550,19 @@ "DLC2.3_3.out 8986.223847 306007.537691 " ] }, - "execution_count": 8, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# These are indexable by channel, stat:\n", - "la.summary_stats[\"RootMc1\"]" + "cruncher.summary_stats[\"RootMc1\"]" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -576,18 +576,18 @@ "Name: (RootMc1, min), dtype: float64" ] }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "la.summary_stats[(\"RootMc1\", 'min')]" + "cruncher.summary_stats[(\"RootMc1\", 'min')]" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -607,19 +607,19 @@ "Name: DLC2.3_1.out, Length: 1113, dtype: float64" ] }, - "execution_count": 10, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Or by file\n", - "la.summary_stats.loc[\"DLC2.3_1.out\"]" + "cruncher.summary_stats.loc[\"DLC2.3_1.out\"]" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -692,19 +692,19 @@ "DLC2.3_3.out 5708.372415 5607.452586 2132.788161" ] }, - "execution_count": 11, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Damage equivalent loads are found here:\n", - "la.dels" + "cruncher.dels" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -777,19 +777,19 @@ "DLC2.3_3.out 4.790238e-42 4.007654e-42 2.539284e-46" ] }, - "execution_count": 12, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Palmgren-Miner damage can be viewed with:\n", - "la.damage" + "cruncher.damage" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -963,15 +963,22 @@ " 'RootMc3': 7709.833036454162}]}" ] }, - "execution_count": 13, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Extreme events:\n", - "la.extremes" + "cruncher.extremes" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/pCrunch/__init__.py b/pCrunch/__init__.py index 6356e6d..ce147f9 100644 --- a/pCrunch/__init__.py +++ b/pCrunch/__init__.py @@ -1,3 +1,3 @@ -from .analysis import Crunch, FatigueParams +from .crunch import Crunch, FatigueParams from .openfast_readers import OpenFASTAscii, OpenFASTBinary, load_FAST_out, read from .aeroelastic_output import AeroelasticOutput