pytoughreact.results package

Submodules

pytoughreact.results.multi_result_tough_3 module

MIT License

Copyright (c) [2022] [Temitope Ajayi]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class pytoughreact.results.multi_result_tough_3.MultiResultTough3(simulator_type, file_location, file_title, prop)[source]

Bases: object

Class for retrieving results from multiple files for Tough3 and TMVOC

__init__(simulator_type, file_location, file_title, prop)[source]

Initialization of Parameters

Parameters:
  • simulator_type (list[string]) – List of type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be tough3 for this class

  • file_location (list[string]) – List of location of results file on system

  • file_title (list[string]) – List of title or name of the file. Example is ‘kddconc.tec’

  • prop (string) – Property to be plotted. Example could be ‘portlandite’

get_multi_element_data(grid_block_number, format_of_date)[source]

DataFrame to retrieve multi element time and results from file

Parameters:
  • grid_block_number (int) – The grid block number for which to retrieve the results

  • format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

get_multi_element_data_per_panel(grid_block_number, panels, format_of_date)[source]

DataFrame to retrieve multi element time and results from file per panel

Parameters:
  • grid_block_number (int) – The grid block number for which to retrieve the results

  • panels (list[string]) – Data to be retrieved for each of the panel in the canvas

  • format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

retrieve_data_multi_file_fixed_time(direction, time)[source]

DataFrame to retrieve time and coordinate results from file

Parameters:
  • direction (string) – Direction of retrieval. Can be ‘X’, ‘Y’ or ‘Z’

  • time (float) – Time in which the data should be retrieved.

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

retrieve_data_multi_file_fixed_time_layer(direction, time, layer_num)[source]

DataFrame to retrieve distance and results from file

Parameters:
  • direction (string) – Direction of retrieval. Can be ‘X’, ‘Y’ or ‘Z’

  • time (float) – Time in which the data should be retrieved.

  • layer_num (int) – Layer number in which to retrieve data

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

retrieve_data_multi_timeseries(grid_block_number, format_of_date='year')[source]

Function that retrieves time and timeseries results from file

Parameters:
  • grid_block_number (int) – The grid block number for which to retrieve the results

  • format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

pytoughreact.results.multi_result_tough_react module

MIT License

Copyright (c) [2022] [Temitope Ajayi]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class pytoughreact.results.multi_result_tough_react.MultiResultReact(simulator_type, file_location, file_title, prop, **kwargs)[source]

Bases: object

Class for retrieving results from multiple files for TOUGHREACT

__init__(simulator_type, file_location, file_title, prop, **kwargs)[source]

Initialization of Parameters

Parameters:
  • simulator_type (list[string]) – List of type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be toughreact for this class

  • file_location (list[string]) – List of location of results file on system

  • file_title (list[string]) – List of title or name of the file. Example is ‘kddconc.tec’

  • prop (string) – Prperty to be plotted. Example could be ‘portlandite’

  • kwargs (dict) – Extra property for processing. Takes in x_slice_value as a float to know at what point to slice the data on the x axis.

get_multi_element_data(grid_block_number, format_of_date='year')[source]

DataFrame to retrieve multi element time and results from file

Parameters:
  • grid_block_number (int) – The grid block number for which to retrieve the results

  • format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

get_multi_file_distance(direction_x, direction_y, time, layer_num)[source]

DataFrame to retrieve multi element time and results from multiple files

Parameters:
  • direction_x (string) – Direction to be plotted on the X axis. Can be ‘X’, ‘Y’, ‘Z’

  • direction_y (string) – Direction to be plotted on the Y axis. Can be ‘X’, ‘Y’, ‘Z’

  • time (float) – Time in which the data should be retrieved.

  • layer_num (int) – Layer number in which to retrieve data

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

get_multi_prop_distance(direction_x, direction_y, time, layer_num)[source]

DataFrame to retrieve multi element time and results from file for properties

Parameters:
  • direction_x (string) – Direction to be plotted on the X axis. Can be ‘X’, ‘Y’, ‘Z’

  • direction_y (string) – Direction to be plotted on the Y axis. Can be ‘X’, ‘Y’, ‘Z’

  • time (float) – Time in which the data should be retrieved.

  • layer_num (int) – Layer number in which to retrieve data

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

retrieve_data_multi_file_fixed_time(direction, time)[source]

DataFrame to retrieve time and coordinate results from file

Parameters:
  • direction (string) – Direction of retrieval. Can be ‘X’, ‘Y’ or ‘Z’

  • time (float) – Time in which the data should be retrieved.

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

retrieve_data_multi_file_fixed_time_layer(direction, time, layer_num)[source]

DataFrame to retrieve distance and results from file

Parameters:
  • direction (string) – Direction of retrieval. Can be ‘X’, ‘Y’ or ‘Z’

  • time (float) – Time in which the data should be retrieved.

  • layer_num (int) – Layer number in which to retrieve data

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

retrieve_data_multi_timeseries(grid_block_number, format_of_date='year')[source]

Function that retrieves time and timeseries results from file

Parameters:
  • grid_block_number (int) – The grid block number for which to retrieve the results

  • format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

pytoughreact.results.result_multiple module

MIT License

Copyright (c) [2022] [Temitope Ajayi]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class pytoughreact.results.result_multiple.FileReadMultiple(simulator_type, file_locations, file_titles, props, **kwargs)[source]

Bases: object

Class for processing multiple file results

__init__(simulator_type, file_locations, file_titles, props, **kwargs)[source]

Initialization of Parameters

Parameters:
  • simulator_type (string) – List of type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be tough3 for this class

  • file_location (list[string]) – List of location of results file on system

  • file_title (list[string]) – List of title or name of the file. Example is ‘kddconc.tec’ or ‘OUTPUT.csv’

  • prop (list[string]) – Properties to be plotted. Example could be ‘portlandite’

  • kwargs (dict) –

    1. x_slice_value (integer) - if the plot should be sliced on the x axis

    2. per_file (boolean) - if the plot should be made per file and not per property

    3. title (list of strings) - title of each of the plots

plot_param_with_layer(direction_x, direction_y, layer_num, time, legend)[source]

Plot of Parameter with Layer

Parameters:
  • direction_x (string) – Direction to be plotted on the X axis. Can be ‘X’, ‘Y’, ‘Z’

  • direction_y (string) – Direction to be plotted on the Y axis. Can be ‘X’, ‘Y’, ‘Z’

  • layer_num (int) – Layer number in which to retrieve data

  • time (float) – Time in which the data should be retrieved.

  • legend (list[string]) – List of titles for the legend of the plot

plot_time(grid_block_number, legend, plot_kind='property', format_of_date='day')[source]

Plot selected parameter on y axis and time on x axis

Parameters:
  • grid_block_number (int) – The grid block number in mesh for which to retrieve the results

  • legend (list[string]) – List of titles for the legend of the plot

  • plot_kind (string) – If the plot should be made based on property or based on files

  • format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds

plot_time_per_panel(grid_block_number, panels, format_of_date='day')[source]

Plot Multiple plots in a panel

Parameters:
  • grid_block_number (int) – The grid block number in mesh for which to retrieve the results

  • panels (list[string]) – Data to be retrieved for each of the panel in the canvas

  • format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds

pytoughreact.results.result_single module

MIT License

Copyright (c) [2022] [Temitope Ajayi]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class pytoughreact.results.result_single.FileReadSingle(simulatortype, filelocation, filetitle, **kwargs)[source]

Bases: object

Class for processing single file results

__init__(simulatortype, filelocation, filetitle, **kwargs)[source]

Initialization of Parameters

Parameters:
  • simulator_type (string) – Type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be tough3 for this class

  • file_location (string) – Location of results file on system

  • file_title (string) – Title or name of the file. Example is ‘kddconc.tec’ or ‘OUTPUT.csv’

  • kwargs (dict) –

    1. generation (string) - if generation data exists in the results.

    2. restart_files (list[string]) - if restart files exist in the results

    3. experiment (list[strings]) - location of experiment results if available

    4. x_slice_value (integer) - if the plot should be sliced on the x axis

get_simulator_type()[source]

Get Simulator Type

plot_2d(direction1, direction2, param, timer, grid_type='plain')[source]

Make 2D plot either gridded or not gridded

Parameters:
  • direction1 (string) – Direction to be plotted on the X axis. Can be ‘X’, ‘Y’, ‘Z’

  • direction2 (string) – Direction to be plotted on the Y axis. Can be ‘X’, ‘Y’, ‘Z’

  • param (string) – Parameter to be plotted

  • grid_type (string) – Shows if plot should contain grids or not. Options are ‘grid’ and ‘plain’

  • timer (float) – Time in which the data should be retrieved.

plot_param_with_layer(direction_x_axis, direction_y_axis, param, layer_num, time)[source]

Make Plot of parameter with layer

Parameters:
  • direction_x_axis (string) – Direction to be plotted on the X axis. Can be ‘X’, ‘Y’, ‘Z’

  • direction_y_axis (string) – Direction to be plotted on the Y axis. Can be ‘X’, ‘Y’, ‘Z’

  • param (string) – Parameter to be plotted

  • layer_num (int) – Layer number in which to retrieve data

  • time (float) – Time in which the data should be retrieved.

plot_param_with_param(param1, param2, gridblocknumber)[source]

Make Plot of parameter with parameter

Parameters:
  • grid_block_number (int) – The grid block number in mesh for which to retrieve the results

  • param1 (string) – First Parameter to be plotted on x axis

  • param2 (string) – Second Parameter to be plotted on x axis

plot_time(param, gridblocknumber, format_of_date='year', labels=None, single_plot=False, style='horizontal', width=12, height=8)[source]

Make Plot of parameter with time

Parameters:
  • gridblocknumber (int) – The grid block number in mesh for which to retrieve the results

  • param (string) – Parameter to be plotted

  • format_of_date (string) – Provides information to the method on format of the date. For example. year, hour, min or seconds

  • labels (string) – Labels for the plot (Title)

  • singlePlot (boolean) – If single plot should be made or multiple plots

  • style (string) – Orientation of plot (should be ‘vertical’ or ‘horizontal)

  • width (int) – width of plot

  • height (int) – height of plot

validate_file()[source]

Validate File

pytoughreact.results.result_tough_3 module

MIT License

Copyright (c) [2022] [Temitope Ajayi]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class pytoughreact.results.result_tough_3.ResultTough3(simulatortype, filelocation, filetitle=None, **kwargs)[source]

Bases: object

Class for processing results from Tough3

__init__(simulatortype, filelocation, filetitle=None, **kwargs)[source]

Initialization of Parameters

Parameters:
  • simulator_type (string) – Type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be tough3 for this class

  • file_location (string) – Location of results file on system

  • file_title (string) – Title or name of the file. Example is ‘kddconc.tec’ or ‘OUTPUT.csv’

  • kwargs (dict) –

    1. generation (string) - if generation data exists in the results.

check_strictly_increasing(sequence)[source]

Check for only strictly increasing data

Parameters:

sequence (list) – list containing data

Returns:

output – Retuns strictly increasing data

Return type:

list

convert_times(format_of_date)[source]

Convert time to desirable format e.g day, month, year

Parameters:

format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds

Returns:

processed_time_data – List of converted time

Return type:

list

del_index(input_list, indexes)[source]

Delete index in data

Parameters:
  • input_list (list) – Input list to remove indexes

  • indexes (list) – indexes for which to remove data

Returns:

input_list – List after indexes have been removed

Return type:

list

duplicate_index(sequence)[source]

Duplicate index in sequence

Parameters:

sequence (list) – list containing data

Returns:

output – Output after indexes have been duplicated

Return type:

list

get_coord_data(direction, timer)[source]

Get Coordinate Data

Parameters:
  • timer (float) – Time in which the data should be retrieved.

  • direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’

Returns:

direction_value_output – Data for the specified direction.

Return type:

list

get_element_data(time, param)[source]

Get Data for elements

Parameters:
  • time (float) – Time in which the data should be retrieved.

  • param (string) – Parameter to be derive data

Returns:

final_element_data – Data for each of the elements.

Return type:

list

get_elements()[source]

Get elements from the simulation

Returns:

elements – Elements present in the result file.

Return type:

list

get_generation_data(param)[source]

Get data from generation.

Parameters:

param (string) – Parameter to be derive data

Returns:

result_array – Results from the generation.

Return type:

list

get_layer_data(direction, layer_number, timer, param)[source]

Get Layer Data

Parameters:
  • direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’

  • timer (float) – Time in which the data should be retrieved.

  • layer_num (int) – Layer number in which to retrieve data

  • param (string) – Parameter to be derive data

Returns:

layer_data_array – Data for the specified direction.

Return type:

list

get_number_of_layers(direction)[source]

Get Number of Layers

Parameters:

direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’

Returns:

number_of_layers – Total number of layers.

Return type:

int

get_parameters()[source]

Remove space from parameters

Returns:

parameter_list – Parameters with blanks removed.

Return type:

list

get_result_dictionary()[source]

Results in dictionary form

Returns:

result_dict – Results dictionary

Return type:

dict

get_time_index()[source]

Get Index of Time

Returns:

processed_time_data – Index the time

Return type:

list

get_times()[source]

Get times stored for duration of the simulation

Parameters:
  • grid_block_number (int) – The grid block number for which to retrieve the results

  • format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds

Returns:

unprocessed_time_data – Time data directly from file without processing.

Return type:

list

get_timeseries_data(param, gridblocknumber)[source]

Get Time series data

Parameters:
  • grid_block_number (int) – The grid block number for which to retrieve the results

  • param (string) – Parameter to be derive data

Returns:

final_timeseries_data – Time series data for particular parameter.

Return type:

list

get_unique_coord_data(direction, timer)[source]

Get Unique Coordinate Data

Parameters:
  • direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’

  • timer (float) – Time in which the data should be retrieved.

Returns:

unique_coordinate_data – Data for the unique coordinate.

Return type:

list

get_unique_x_data(timer)[source]

Get Unique X Axis Data

Parameters:

timer (float) – Time in which the data should be retrieved.

Returns:

unique_x_output_data – Unique data for the x axis.

Return type:

list

get_unique_y_data(timer)[source]

Get Unique Y Axis Data

Parameters:

timer (float) – Time in which the data should be retrieved.

Returns:

unique_y_output_data – Unique data for the y axis.

Return type:

list

get_unique_z_data(timer)[source]

Get Unique Z Axis Data

Parameters:

timer (float) – Time in which the data should be retrieved.

Returns:

unique_z_output_data – Unique data for the z axis.

Return type:

list

get_x_data(time)[source]

Get X Axis Data

Parameters:

time (float) – Time in which the data should be retrieved.

Returns:

output – Data for the x axis.

Return type:

list

get_x_depth_data(line_number, param, timer)[source]

Get X Axis And Depth Data

Parameters:
  • timer (float) – Time in which the data should be retrieved.

  • line_number (int) – Line number to retrieve x depth data for

  • param (string) – Parameter to be derive data

Returns:

x_depth_data_array – Data for the x depth.

Return type:

list

get_x_start_points(timer)[source]

Get X Axis Start Point Data

Parameters:

timer (float) – Time in which the data should be retrieved.

Returns:

indices_array – X Axis Start Point Data.

Return type:

list

get_y_data(time)[source]

Get Y Axis Data

Parameters:

time (float) – Time in which the data should be retrieved.

Returns:

output – Data for the y axis.

Return type:

list

get_z_data(time)[source]

Get Z Axis Data

Parameters:

time (float) – Time in which the data should be retrieved.

Returns:

output – Data for the z axis.

Return type:

list

get_z_layer_data(layer_number, param, timer)[source]

Get Z Layer Data

Parameters:
  • timer (float) – Time in which the data should be retrieved.

  • layer_num (int) – Layer number in which to retrieve data

  • param (string) – Parameter to be derive data

Returns:

z_layer_data_output – Data for the z direction.

Return type:

list

read_file()[source]

Read file specified in file_location and file_title

Returns:

file_as_list – Results from file as list

Return type:

list

remove_non_increasing(sequence_a, sequence_b)[source]

Remove Non Increasing Data

Parameters:
  • sequence_a (list) – list containing first sequence

  • sequence_b (list) – list containing second sequence

Returns:

sequenceA, sequenceB – Data for the unique coordinate.

Return type:

list, list

pytoughreact.results.result_tough_react module

MIT License

Copyright (c) [2022] [Temitope Ajayi]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class pytoughreact.results.result_tough_react.ResultReact(simulator_type, file_location, file_title)[source]

Bases: object

Class for processing results from TOUGHREACT

__init__(simulator_type, file_location, file_title)[source]

Initialization of Parameters

Parameters:
  • simulator_type (string) – Type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be tough3 for this class

  • file_location (string) – Location of results file on system

  • file_title (string) – Title or name of the file. Example is ‘kddconc.tec’ or ‘OUTPUT.csv’

convert_times(format_of_date)[source]

Convert time to desirable format e.g day, month, year

Parameters:

format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds

Returns:

processed_time_data – List of converted time

Return type:

list

get_coord_data(direction, timer)[source]

Get Coordinate Data

Parameters:
  • direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’

  • timer (float) – Time in which the data should be retrieved.

Returns:

coordinate_data – Data for the unique coordinate.

Return type:

list

get_element_data(time, param)[source]

Get Data for elements

Parameters:
  • time (float) – Time in which the data should be retrieved.

  • param (string) – Parameter to be derive data

Returns:

final_element_data – Data for each of the elements.

Return type:

list

get_elements()[source]

Get elements from the simulation

Returns:

grid_blocks – Elements present in the result file.

Return type:

list

get_layer_data(direction, layer_number, timer, param)[source]

Get Layer Data

Parameters:
  • direction (string) – Direction to get data. Can be ‘X’, ‘Z’

  • timer (float) – Time in which the data should be retrieved.

  • layer_num (int) – Layer number in which to retrieve data

  • param (string) – Parameter to be derive data

Returns:

layer_data_array – Data for the specified direction.

Return type:

list

get_number_of_layers(direction)[source]

Get Number of Layers

Parameters:

direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’

Returns:

number_of_layers – Total number of layers.

Return type:

int

get_parameters()[source]

Get Parameters from file

Returns:

output – Parameters returned as list

Return type:

list

get_times()[source]

Get times stored for duration of the simulation

Returns:

unprocessed_time_data – Time data directly from file without processing.

Return type:

list

get_timeseries_data(param, grid_block_number)[source]

Get Time series data

Parameters:
  • grid_block_number (int) – The grid block number for which to retrieve the results

  • param (string) – Parameter to be derived from data

Returns:

final_timeseries_data – Time series data for particular parameter.

Return type:

list

get_unique_coord_data(direction, timer)[source]

Get Unique Coordinate Data

Parameters:
  • direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’

  • timer (float) – Time in which the data should be retrieved.

Returns:

unique_coordinate_data – Data for the unique coordinate.

Return type:

list

get_unique_x_data(timer)[source]

Get Unique X Axis Data

Parameters:

timer (float) – Time in which the data should be retrieved.

Returns:

unique_x_output_data – Unique data for the x axis.

Return type:

list

get_unique_y_data(timer)[source]

Get Unique Y Axis Data

Parameters:

timer (float) – Time in which the data should be retrieved.

Returns:

unique_x_output_data – Unique data for the y axis.

Return type:

list

get_unique_z_data(timer)[source]

Get Unique Z Axis Data

Parameters:

timer (float) – Time in which the data should be retrieved.

Returns:

unique_x_output_data – Unique data for the z axis.

Return type:

list

get_x_data(time)[source]

Get X Axis Data

Parameters:

time (float) – Time in which the data should be retrieved.

Returns:

output – Data for the x axis.

Return type:

list

get_x_depth_data(line_number, param, timer)[source]

Get X Axis And Depth Data

Parameters:
  • timer (float) – Time in which the data should be retrieved.

  • line_number (int) – Line number to retrieve x depth data for

  • param (string) – Parameter to be derive data

Returns:

x_depth_data_array – Data for the x depth.

Return type:

list

get_x_start_points(timer)[source]

Get X Axis Start Point Data

Parameters:

timer (float) – Time in which the data should be retrieved.

Returns:

indices_array – X Axis Start Point Data.

Return type:

list

get_y_data(time)[source]

Get Y Axis Data

Parameters:

time (float) – Time in which the data should be retrieved.

Returns:

output – Data for the y axis.

Return type:

list

get_z_data(time)[source]

Get Z Axis Data

Parameters:

time (float) – Time in which the data should be retrieved.

Returns:

output – Data for the z axis.

Return type:

list

get_z_layer_data(layer_number, param, timer)[source]

Get Z Layer Data

Parameters:
  • timer (float) – Time in which the data should be retrieved.

  • layer_num (int) – Layer number in which to retrieve data

  • param (string) – Parameter to be derive data

Returns:

z_layer_data_output – Data for the z direction.

Return type:

list

pytoughreact.results.simple_experiment_data module

MIT License

Copyright (c) [2022] [Temitope Ajayi]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class pytoughreact.results.simple_experiment_data.Experiment(filelocation, filetitle)[source]

Bases: object

__init__(filelocation, filetitle)[source]

Initialization of Parameters

Parameters:
  • file_location (string) – Location of results file on system

  • file_title (string) – Title or name of the file. Example is ‘kddconc.tec’ or ‘OUTPUT.csv’

get_column_names()[source]

Get column names from data table

Returns:

column_names – column names in file

Return type:

list

get_times()[source]

Get times stored for duration of the simulation

Returns:

unprocessed_time_data – Time data directly from file without processing.

Return type:

list

get_timeseries_data(param)[source]

Get Time series data

Parameters:

param (string) – Parameter to be derived from data

Returns:

final_timeseries_data – Time series data for particular parameter.

Return type:

list

read_file()[source]

Read file specified in file_location and file_title

Returns:

data_table – Dataframe with requested output

Return type:

pd.Dataframe

Module contents