relap-py


Namerelap-py JSON
Version 2.0.15 PyPI version JSON
download
home_pageNone
SummaryModule for RELAP post-processing
upload_time2025-07-29 09:35:26
maintainerNone
docs_urlNone
authorJordi Freixa
requires_pythonNone
licenseMIT
keywords relap trace
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # General Information

* Title: RELAP utilities
* created: May 2020
* last modified: 2025-03-05
* Created by: Jordi Freixa
* Description: This Module provides function tools for postprocessing RELAP data

# INSTALLATION:

* install with pip install relap_py
* make a new system environmental variable called `RELAP_EXE_PATH` that contains
the path to your relap executable file (the full path including the file name).
    * `Windows` open the environmental variables interphase and set the new variable
    * `Linux` add this to your .bashrc: `export RELAP_EXE_PATH=/your/path/to/relap_executable.x`


# CONFIGURATION AND DEFAULTS

Use the following functions to set up the configuration of the module for the particular python project:

* set_figures_type('pdf') the figures will be saved with this format
* set_figures_loc('./figures/') location where the figures will be saved
* set_show_plot(False) Boolean, show interactive python plot window?
* set_unc_bands(False) is there a uncertainty file containing bands? set the name of the file here and bands will be added to the variables plot
* set_relap_scdap(False) Are you using the package for Relap/scdap cases?


# TODO:

- [ ] Adapt to TRACE plotting
- [ ] Sample inputs according to uncertainty data
- [ ] Read and plot uncertainty bands

# 📺 Video Tutorial

Watch a video tutorial on [YouTube](https://youtu.be/94UeiuQT9YU).

# TUTORIAL

* Title: relap.py tutorial
* Version: 5.0
* Date: 2025-03-20
* Created by: Jordi Freixa
* Description: A quick tutorial for relap.py package

Firstly import the package, for instance

```
import relap_py as rp
```

You may use the help function of Python to get info on the possible functions

```
help(rp) # to get info on the whole package
help(rp.plot_var) # to get info on one specific function
```

## Changing defaults

List of defaults. If you want to change them, you can do so by using the 
following commands

```
rp.set_figures_type('pdf')
rp.set_figures_loc('./my_best_figures/')
rp.set_show_plot(True)
rp.set_unc_bands('unc.dat')
rp.set_relap_scdap(True)
```

## Variables file

It is good to write a file to specify a list of variables that you want to extract.
The structure is as follows. It is important to keep the same column names but the order is arbitrary:

```
alphanum   numeric      var_tag          figure_tag                    unit   timei   timee   ymin   ymax   general
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
mflowj     933020000    SGTR_MF          SGTR_Break_Mass_Flow          kg/s   -100    3500    0      0      no
mflowj     545000000    REL_VLV_MF       Reliev_Valve_Flow_A           kg/s   -100    3500    0      0      mid_left
```

*  Lines starting with `%` are not read
* `var_tag` This is the tag of the variable used to plot it. If you you use experimental data, you should use the same tags for the variables in the experimental data file.
* `figure_tag` will be used in the plots for the title, labels or legends. (the underscores will be removed automatically)
* `unit` will be used as the unit in some labels

Optional columns:

* `temei` will be used as initial time for plots
* `timee` will be used as the end time
* `ymin` and `ymax` will be the limits in the plot, 0 means automatic
* `general` indicates if you want to plot this in the general figure and in which position:
    * `no` it will not be added
    * `top_left` added to the top plot with the left y-axis
    * `top_right` added to the top plot with the right y-axis
    * `mid_left`
    * `mid_right`
    * `bottom_left`
    * `bottom_right`

The minimal structure is therefore:

```
alphanum   numeric      var_tag          figure_tag                    unit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
mflowj     933020000    SGTR_MF          SGTR_Break_Mass_Flow          kg/s
mflowj     545000000    REL_VLV_MF       Reliev_Valve_Flow_A           kg/s
```

## File structure

If you are performing several calculations of the same case/scenario (sensitivities),
the package works best with the following organiztion:

* Place each calculation in a different folder
* In each folder, always use the same restart name

```
├── Test4
│   ├── base
│   │   ├── test4.i 
│   │   ├── test4.o 
│   │   ├── test4.r 
│   ├── no_hpis
│   │   ├── test4.i 
│   │   ├── test4.o 
│   │   ├── test4.r 
│   ├── rcp_earlier 
│   │   ├── test4.i 
│   │   ├── test4.o 
│   │   ├── test4.r 
│   ├── figures
│   ├── variables_test4.txt
```

I find this approach very convenient as it is very easy to generate new 
sensitivities and it is clearly structured. It is also very easy to automatize a
loop to run several cases at once as the commands will be the same for all folders.

## Reading experimental data

If you have experimental data to compare to your data you need to follow these instructions:

* Make sure to use the same var_tag as column header for the experimental 
column that corresponds to your RELAP data. Or you can write your variables file 
considering the column headers of your experimental data.
* You can have columns that are not present in the calculation or have var_tags
in your variables file that are not present in the experimental data file
(these will be skipped when plotting)
* Load your experimental data file as a DataFrame. Check the file structure first to adapt the following command:

```
dataExp = pd.read_csv('Experimental_Test4.txt', delimiter='\t')
```

## Examples

### Plot one single variable from a restart file (simple)

```
rp.set_show_plot(True) # Most probably you want to play with the plot
rp.plot('voidfj', '993020000', 'your_restart')
```

> [!NOTE]
>
> remember that for more info, `help(rp.plot)`

### Plot one single variable from a restart file (advanced)

In this case you plot more than one variable and you want to store the data in 
a variable. In this example the data of two cases is extracted and stored in `voidfj` as a DataFrame
the figure will be stored but you can still play with the interactive plot

```
rp.set_show_plot(True) # Most probably you want to play with the plot
voidfj = rp.plot('voidfj', '993020000', 'test4', ['base', 'no_hpis'])
# ['base', 'no_hpis'] are restart cases you have calculated
rp.set_show_plot(False) # I want to hide other plots created later
```

### Run a case

You can execute a relap case from within python with

```
rp.run_case('./path/to/input')
```
This will just go to that folder and run the case with name 'input.i'.

The package uses typical extensions '.i' '.o' and '.r'.

> [!NOTE]
>
> check `help(rp.run_case)` for further options

### Extract data for a restart case

> [!NOTE]
>
>  You will need to first create the variables file, in this example `variables_test4.txt`

With the following command the time trends specified in `variables_test4` will 
be extracted from restart file `test4.r` which should be in the folder
you are running the command

```
data, variables = rp.extract_data('variables_test4.txt', 'test4')
```
> [!NOTE]
>
>  this will save a .dat file in your file system
>  As well as storing the data in a DataFrame named `data` and the variables in `variables` 

Once you have loaded the variable files you can change its contents if you need. 
For instance to change the final time for all

```
variables['timee'] = 4000.0 # 
```

Once you have loaded the variable files you can use it to extract other data:

```
data, _ = rp.extract_data(variables, 'test4')
```


### Extract data for several restart cases


> [!NOTE]
>
>  first declare the list of cases, it can be a single case or even empty and
then it will read the restart in the folder


```
cases_sgtr = ['base', 'no_hpis', 'rcp_earlier']
cases_df_sgtr, variables = rp.extract_data('variables_test4.txt', 'test4', cases_sgtr )
```

> [!TIP]
> If you don't need to repeat the calculations, and you already extracted the data, you might want to load the data directly from the created .dat files. In this case you can load them with rp.read_case

To load all cases in cases_df_sgtr
```
cases_df_sgtr = rp.read_case('test4', cases_df_sgtr)
```
To load a single case in the current folder:
```
case = rp.read_case('test4')
```

### Plot one single variable from the extracted data for all cases or a selected list of cases

in this example only 'base' and 'rcp_earlier' will be plotted

```
rp.plot_var('SGTR_MF', variables, cases_df_sgtr, ['base', 'rcp_earlier'] )
```

> [!TIP]
> use the function variables y_limits and x_limits if you want to specify the axes limits


### Plot all variables listed in variables file for the defined cases

```
rp.plot_all(variables, cases_df_sgtr, cases_sgtr)
```

### Plot different variables from one case

```
vars_to_plot = ['core_level', 'SG_A_level']
rp.plot_variables(vars_to_plot, variables, cases_df_sgtr['base'])
```

### Make an interactive plot with all the available data

After loading one or several cases (for example):
```
cases_sgtr = ['base', 'no_hpis', 'rcp_earlier']
cases_df_sgtr, variables = rp.extract_data('variables_test4.txt', 'test4', cases_sgtr )
```

You can generate an interactive plot where you can play with all the data. This requires Json and connection to the internet.

```
rp.interactive_plot(cases_df_sgtr)
```

a file with name interactive_plot.html will be available

### Make a general plot for a single case

A general figure is a figure with three subfigures (top, mid and bottom) each figure
may contain more than one time trend and you may use right or left Y-axes

This figure is useful to generate a figure to explain the whole transient.

```
rp.general_fig(variables, cases_df_sgtr['base'])
```

Labels to each time trend are placed automatically, sometimes they are not placed
in the best location and you may want to adjust them. When you run the command above 
you will see that a list of numbers is shown, this list is the locations of each label
ordered from top to bottom. You can copy the list, modify it and provide it as an input 
for the command so you can manually set the locations of the labels 

> [!TIP]
> see `help(rp.general_fig)`for further details

### Generate the general figure for several cases

The general figure does not compare cases. If you want to generate one general figure
for each of your cases, use general_fig_all_cases

```
rp.general_fig_all_cases(variables, cases_df_sgtr, label_case='UPC is great')
```

> [!TIP]
>
> If I want to remove a variable from the general figure I can select it like this

```
variables.loc[23, 'general'] = 'no' # to change a single option
```

### Just read old dat files generated with the package

If you have already generated .dat files and you just want to load them, 
you can do so as follows:

```
new_case = rp.read_case('data')
```

The problem now is that you will need to load the variables file if you want
to run some of the functions of the package. You can do so by:

```
variables = rp.read_variables('path/to/variables.i')
```

### Plot a profile for a variable at a particular time

This function can be used to extract and plot the same variable for several nodes
at a specified time (or a list of times). You can also do it for a list of cases and get the comparison

In this example the liquid temperatures along the 11 nodes of pipe 173 are being 
extracted and plotted. The returned variable will be an array with the temperatures
at 80 seconds into the calculation.

```
nodes = ['173010000',
         '173020000',
         '173020000',
         '173030000',
         '173040000',
         '173050000',
         '173060000',
         '173070000',
         '173080000',
         '173090000',
         '173100000',
         '173110000']
tempfs = rp.plot_profile('tempf', nodes, 80.0, 'test4')
```
### Make a table with steady state values comparing all case

This function looks for the end of the steady state and averages the given time length to provide averaged steady state values for all parameters. You get both, the DataFrame with the values and a formatted table on the screen.

```
cc = rp.print_ss(cases_df_sgtr, end_ss=0, length=50)
```
(and with experimental data)
```
steady_state = rp.print_ss(cases_df_sgtr, dataExp= exp, end_ss=0, length=50)
```

> [!TIP]
>
> If you use LaTeX, use the function tabulate to create the table with latex formatting

### Some additional fucntions not used in this example are:

* make_strip --> makes a strip
* read_stripf --> reads a stripf file
* run_strip --> performs a strip
* mypie --> makes a fancy pie chart



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "relap-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "relap, trace",
    "author": "Jordi Freixa",
    "author_email": "<jordi.freixa-terradas@upc.edu>",
    "download_url": null,
    "platform": null,
    "description": "# General Information\r\n\r\n* Title: RELAP utilities\r\n* created: May 2020\r\n* last modified: 2025-03-05\r\n* Created by: Jordi Freixa\r\n* Description: This Module provides function tools for postprocessing RELAP data\r\n\r\n# INSTALLATION:\r\n\r\n* install with pip install relap_py\r\n* make a new system environmental variable called `RELAP_EXE_PATH` that contains\r\nthe path to your relap executable file (the full path including the file name).\r\n    * `Windows` open the environmental variables interphase and set the new variable\r\n    * `Linux` add this to your .bashrc: `export RELAP_EXE_PATH=/your/path/to/relap_executable.x`\r\n\r\n\r\n# CONFIGURATION AND DEFAULTS\r\n\r\nUse the following functions to set up the configuration of the module for the particular python project:\r\n\r\n* set_figures_type('pdf') the figures will be saved with this format\r\n* set_figures_loc('./figures/') location where the figures will be saved\r\n* set_show_plot(False) Boolean, show interactive python plot window?\r\n* set_unc_bands(False) is there a uncertainty file containing bands? set the name of the file here and bands will be added to the variables plot\r\n* set_relap_scdap(False) Are you using the package for Relap/scdap cases?\r\n\r\n\r\n# TODO:\r\n\r\n- [ ] Adapt to TRACE plotting\r\n- [ ] Sample inputs according to uncertainty data\r\n- [ ] Read and plot uncertainty bands\r\n\r\n# \ud83d\udcfa Video Tutorial\r\n\r\nWatch a video tutorial on [YouTube](https://youtu.be/94UeiuQT9YU).\r\n\r\n# TUTORIAL\r\n\r\n* Title: relap.py tutorial\r\n* Version: 5.0\r\n* Date: 2025-03-20\r\n* Created by: Jordi Freixa\r\n* Description: A quick tutorial for relap.py package\r\n\r\nFirstly import the package, for instance\r\n\r\n```\r\nimport relap_py as rp\r\n```\r\n\r\nYou may use the help function of Python to get info on the possible functions\r\n\r\n```\r\nhelp(rp) # to get info on the whole package\r\nhelp(rp.plot_var) # to get info on one specific function\r\n```\r\n\r\n## Changing defaults\r\n\r\nList of defaults. If you want to change them, you can do so by using the \r\nfollowing commands\r\n\r\n```\r\nrp.set_figures_type('pdf')\r\nrp.set_figures_loc('./my_best_figures/')\r\nrp.set_show_plot(True)\r\nrp.set_unc_bands('unc.dat')\r\nrp.set_relap_scdap(True)\r\n```\r\n\r\n## Variables file\r\n\r\nIt is good to write a file to specify a list of variables that you want to extract.\r\nThe structure is as follows. It is important to keep the same column names but the order is arbitrary:\r\n\r\n```\r\nalphanum   numeric      var_tag          figure_tag                    unit   timei   timee   ymin   ymax   general\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nmflowj     933020000    SGTR_MF          SGTR_Break_Mass_Flow          kg/s   -100    3500    0      0      no\r\nmflowj     545000000    REL_VLV_MF       Reliev_Valve_Flow_A           kg/s   -100    3500    0      0      mid_left\r\n```\r\n\r\n*  Lines starting with `%` are not read\r\n* `var_tag` This is the tag of the variable used to plot it. If you you use experimental data, you should use the same tags for the variables in the experimental data file.\r\n* `figure_tag` will be used in the plots for the title, labels or legends. (the underscores will be removed automatically)\r\n* `unit` will be used as the unit in some labels\r\n\r\nOptional columns:\r\n\r\n* `temei` will be used as initial time for plots\r\n* `timee` will be used as the end time\r\n* `ymin` and `ymax` will be the limits in the plot, 0 means automatic\r\n* `general` indicates if you want to plot this in the general figure and in which position:\r\n    * `no` it will not be added\r\n    * `top_left` added to the top plot with the left y-axis\r\n    * `top_right` added to the top plot with the right y-axis\r\n    * `mid_left`\r\n    * `mid_right`\r\n    * `bottom_left`\r\n    * `bottom_right`\r\n\r\nThe minimal structure is therefore:\r\n\r\n```\r\nalphanum   numeric      var_tag          figure_tag                    unit\r\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\r\nmflowj     933020000    SGTR_MF          SGTR_Break_Mass_Flow          kg/s\r\nmflowj     545000000    REL_VLV_MF       Reliev_Valve_Flow_A           kg/s\r\n```\r\n\r\n## File structure\r\n\r\nIf you are performing several calculations of the same case/scenario (sensitivities),\r\nthe package works best with the following organiztion:\r\n\r\n* Place each calculation in a different folder\r\n* In each folder, always use the same restart name\r\n\r\n```\r\n\u251c\u2500\u2500 Test4\r\n\u2502   \u251c\u2500\u2500 base\r\n\u2502   \u2502   \u251c\u2500\u2500 test4.i \r\n\u2502   \u2502   \u251c\u2500\u2500 test4.o \r\n\u2502   \u2502   \u251c\u2500\u2500 test4.r \r\n\u2502   \u251c\u2500\u2500 no_hpis\r\n\u2502   \u2502   \u251c\u2500\u2500 test4.i \r\n\u2502   \u2502   \u251c\u2500\u2500 test4.o \r\n\u2502   \u2502   \u251c\u2500\u2500 test4.r \r\n\u2502   \u251c\u2500\u2500 rcp_earlier \r\n\u2502   \u2502   \u251c\u2500\u2500 test4.i \r\n\u2502   \u2502   \u251c\u2500\u2500 test4.o \r\n\u2502   \u2502   \u251c\u2500\u2500 test4.r \r\n\u2502   \u251c\u2500\u2500 figures\r\n\u2502   \u251c\u2500\u2500 variables_test4.txt\r\n```\r\n\r\nI find this approach very convenient as it is very easy to generate new \r\nsensitivities and it is clearly structured. It is also very easy to automatize a\r\nloop to run several cases at once as the commands will be the same for all folders.\r\n\r\n## Reading experimental data\r\n\r\nIf you have experimental data to compare to your data you need to follow these instructions:\r\n\r\n* Make sure to use the same var_tag as column header for the experimental \r\ncolumn that corresponds to your RELAP data. Or you can write your variables file \r\nconsidering the column headers of your experimental data.\r\n* You can have columns that are not present in the calculation or have var_tags\r\nin your variables file that are not present in the experimental data file\r\n(these will be skipped when plotting)\r\n* Load your experimental data file as a DataFrame. Check the file structure first to adapt the following command:\r\n\r\n```\r\ndataExp = pd.read_csv('Experimental_Test4.txt', delimiter='\\t')\r\n```\r\n\r\n## Examples\r\n\r\n### Plot one single variable from a restart file (simple)\r\n\r\n```\r\nrp.set_show_plot(True) # Most probably you want to play with the plot\r\nrp.plot('voidfj', '993020000', 'your_restart')\r\n```\r\n\r\n> [!NOTE]\r\n>\r\n> remember that for more info, `help(rp.plot)`\r\n\r\n### Plot one single variable from a restart file (advanced)\r\n\r\nIn this case you plot more than one variable and you want to store the data in \r\na variable. In this example the data of two cases is extracted and stored in `voidfj` as a DataFrame\r\nthe figure will be stored but you can still play with the interactive plot\r\n\r\n```\r\nrp.set_show_plot(True) # Most probably you want to play with the plot\r\nvoidfj = rp.plot('voidfj', '993020000', 'test4', ['base', 'no_hpis'])\r\n# ['base', 'no_hpis'] are restart cases you have calculated\r\nrp.set_show_plot(False) # I want to hide other plots created later\r\n```\r\n\r\n### Run a case\r\n\r\nYou can execute a relap case from within python with\r\n\r\n```\r\nrp.run_case('./path/to/input')\r\n```\r\nThis will just go to that folder and run the case with name 'input.i'.\r\n\r\nThe package uses typical extensions '.i' '.o' and '.r'.\r\n\r\n> [!NOTE]\r\n>\r\n> check `help(rp.run_case)` for further options\r\n\r\n### Extract data for a restart case\r\n\r\n> [!NOTE]\r\n>\r\n>  You will need to first create the variables file, in this example `variables_test4.txt`\r\n\r\nWith the following command the time trends specified in `variables_test4` will \r\nbe extracted from restart file `test4.r` which should be in the folder\r\nyou are running the command\r\n\r\n```\r\ndata, variables = rp.extract_data('variables_test4.txt', 'test4')\r\n```\r\n> [!NOTE]\r\n>\r\n>  this will save a .dat file in your file system\r\n>  As well as storing the data in a DataFrame named `data` and the variables in `variables` \r\n\r\nOnce you have loaded the variable files you can change its contents if you need. \r\nFor instance to change the final time for all\r\n\r\n```\r\nvariables['timee'] = 4000.0 # \r\n```\r\n\r\nOnce you have loaded the variable files you can use it to extract other data:\r\n\r\n```\r\ndata, _ = rp.extract_data(variables, 'test4')\r\n```\r\n\r\n\r\n### Extract data for several restart cases\r\n\r\n\r\n> [!NOTE]\r\n>\r\n>  first declare the list of cases, it can be a single case or even empty and\r\nthen it will read the restart in the folder\r\n\r\n\r\n```\r\ncases_sgtr = ['base', 'no_hpis', 'rcp_earlier']\r\ncases_df_sgtr, variables = rp.extract_data('variables_test4.txt', 'test4', cases_sgtr )\r\n```\r\n\r\n> [!TIP]\r\n> If you don't need to repeat the calculations, and you already extracted the data, you might want to load the data directly from the created .dat files. In this case you can load them with rp.read_case\r\n\r\nTo load all cases in cases_df_sgtr\r\n```\r\ncases_df_sgtr = rp.read_case('test4', cases_df_sgtr)\r\n```\r\nTo load a single case in the current folder:\r\n```\r\ncase = rp.read_case('test4')\r\n```\r\n\r\n### Plot one single variable from the extracted data for all cases or a selected list of cases\r\n\r\nin this example only 'base' and 'rcp_earlier' will be plotted\r\n\r\n```\r\nrp.plot_var('SGTR_MF', variables, cases_df_sgtr, ['base', 'rcp_earlier'] )\r\n```\r\n\r\n> [!TIP]\r\n> use the function variables y_limits and x_limits if you want to specify the axes limits\r\n\r\n\r\n### Plot all variables listed in variables file for the defined cases\r\n\r\n```\r\nrp.plot_all(variables, cases_df_sgtr, cases_sgtr)\r\n```\r\n\r\n### Plot different variables from one case\r\n\r\n```\r\nvars_to_plot = ['core_level', 'SG_A_level']\r\nrp.plot_variables(vars_to_plot, variables, cases_df_sgtr['base'])\r\n```\r\n\r\n### Make an interactive plot with all the available data\r\n\r\nAfter loading one or several cases (for example):\r\n```\r\ncases_sgtr = ['base', 'no_hpis', 'rcp_earlier']\r\ncases_df_sgtr, variables = rp.extract_data('variables_test4.txt', 'test4', cases_sgtr )\r\n```\r\n\r\nYou can generate an interactive plot where you can play with all the data. This requires Json and connection to the internet.\r\n\r\n```\r\nrp.interactive_plot(cases_df_sgtr)\r\n```\r\n\r\na file with name interactive_plot.html will be available\r\n\r\n### Make a general plot for a single case\r\n\r\nA general figure is a figure with three subfigures (top, mid and bottom) each figure\r\nmay contain more than one time trend and you may use right or left Y-axes\r\n\r\nThis figure is useful to generate a figure to explain the whole transient.\r\n\r\n```\r\nrp.general_fig(variables, cases_df_sgtr['base'])\r\n```\r\n\r\nLabels to each time trend are placed automatically, sometimes they are not placed\r\nin the best location and you may want to adjust them. When you run the command above \r\nyou will see that a list of numbers is shown, this list is the locations of each label\r\nordered from top to bottom. You can copy the list, modify it and provide it as an input \r\nfor the command so you can manually set the locations of the labels \r\n\r\n> [!TIP]\r\n> see `help(rp.general_fig)`for further details\r\n\r\n### Generate the general figure for several cases\r\n\r\nThe general figure does not compare cases. If you want to generate one general figure\r\nfor each of your cases, use general_fig_all_cases\r\n\r\n```\r\nrp.general_fig_all_cases(variables, cases_df_sgtr, label_case='UPC is great')\r\n```\r\n\r\n> [!TIP]\r\n>\r\n> If I want to remove a variable from the general figure I can select it like this\r\n\r\n```\r\nvariables.loc[23, 'general'] = 'no' # to change a single option\r\n```\r\n\r\n### Just read old dat files generated with the package\r\n\r\nIf you have already generated .dat files and you just want to load them, \r\nyou can do so as follows:\r\n\r\n```\r\nnew_case = rp.read_case('data')\r\n```\r\n\r\nThe problem now is that you will need to load the variables file if you want\r\nto run some of the functions of the package. You can do so by:\r\n\r\n```\r\nvariables = rp.read_variables('path/to/variables.i')\r\n```\r\n\r\n### Plot a profile for a variable at a particular time\r\n\r\nThis function can be used to extract and plot the same variable for several nodes\r\nat a specified time (or a list of times). You can also do it for a list of cases and get the comparison\r\n\r\nIn this example the liquid temperatures along the 11 nodes of pipe 173 are being \r\nextracted and plotted. The returned variable will be an array with the temperatures\r\nat 80 seconds into the calculation.\r\n\r\n```\r\nnodes = ['173010000',\r\n         '173020000',\r\n         '173020000',\r\n         '173030000',\r\n         '173040000',\r\n         '173050000',\r\n         '173060000',\r\n         '173070000',\r\n         '173080000',\r\n         '173090000',\r\n         '173100000',\r\n         '173110000']\r\ntempfs = rp.plot_profile('tempf', nodes, 80.0, 'test4')\r\n```\r\n### Make a table with steady state values comparing all case\r\n\r\nThis function looks for the end of the steady state and averages the given time length to provide averaged steady state values for all parameters. You get both, the DataFrame with the values and a formatted table on the screen.\r\n\r\n```\r\ncc = rp.print_ss(cases_df_sgtr, end_ss=0, length=50)\r\n```\r\n(and with experimental data)\r\n```\r\nsteady_state = rp.print_ss(cases_df_sgtr, dataExp= exp, end_ss=0, length=50)\r\n```\r\n\r\n> [!TIP]\r\n>\r\n> If you use LaTeX, use the function tabulate to create the table with latex formatting\r\n\r\n### Some additional fucntions not used in this example are:\r\n\r\n* make_strip --> makes a strip\r\n* read_stripf --> reads a stripf file\r\n* run_strip --> performs a strip\r\n* mypie --> makes a fancy pie chart\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Module for RELAP post-processing",
    "version": "2.0.15",
    "project_urls": null,
    "split_keywords": [
        "relap",
        " trace"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "81e2b0789d9bccb8679092b68bf51079bb29dbebe80197aa1c40f905aa246072",
                "md5": "27acaea3813d22ecce161cd76171cef5",
                "sha256": "db0621708ae343f10b7ba38b0d08258c75774b34d05ed5bead71388dd4d45f99"
            },
            "downloads": -1,
            "filename": "relap_py-2.0.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "27acaea3813d22ecce161cd76171cef5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 40944,
            "upload_time": "2025-07-29T09:35:26",
            "upload_time_iso_8601": "2025-07-29T09:35:26.501236Z",
            "url": "https://files.pythonhosted.org/packages/81/e2/b0789d9bccb8679092b68bf51079bb29dbebe80197aa1c40f905aa246072/relap_py-2.0.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-29 09:35:26",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "relap-py"
}
        
Elapsed time: 1.02604s