flownet.realization._schedule module

class flownet.realization._schedule.Schedule(network: flownet.network_model._network_model.NetworkModel = None, df_production_data: typing.Optional[pandas.core.frame.DataFrame] = None, config: <property object at 0x7f15b0f78830> = None)

Bases: object

Python class to to store all schedule items for the Flownet run.

Parameters
  • network – FlowNet network instance

  • df_production_data – Dataframe with all production data

  • config – Information from the FlowNet config yaml

_calculate_compdat()

Helper Function that generates the COMPDAT keywords based on geometrical information from the NetworkModel.

Returns

Nothing

_calculate_wconhist()

Helper function that generates the WCONHIST keywords based on loaded production data. Currently the data is loaded from hard-coded filepath.

A WCONHIST keyword will be written out for each line in the provided production data. Therefore, potential up-sampling needs to be done before the schedule is created.

Returns

Nothing

_calculate_wconinjh()

Helper function that generates the WCONINJ keywords based on loaded production data. Currently the data is loaded from hard-coded filepath.

A WCONINJH keyword will be written out for each line in the provided production data. Therefore, potential up-sampling needs to be done before the schedule is created.

Returns

Nothing

_calculate_welspecs()

Helper function that generates the WELSPECS keywords based which wells there are in the production data.

Returns

Nothing

_calculate_wsalt()

Helper Function that generates the WSALT keywords based on salt measurements.

Returns

Nothing

_calculate_wtemp()

Helper Function that generates the WTEMP keywords based on temperature measurements.

Returns

Nothing

_create_schedule()

Helper function that calls all functions involved in creating the schedule for the FlowNet run.

_get_start_dates()

Function to retrieve the start date of all wells.

Args:

Returns

Nothing

static _retrieve_date_first_non_zero_prodinj(df_production_data: pandas.core.frame.DataFrame, well_name: str) Optional[datetime.date]

Helper function to retrieve the date of first non-zero production or injection.

Parameters
  • df_production_data – DataFrame with all production data

  • well_name – Name of the well to retrieve date for

Returns

The first date of non-zero production or None if no such date exist

append(_keyword)

Helper function to append Keyword’s to the Schedule instance

Parameters

_keyword – Keyword instance to append

Returns

Nothing

get_compdat(well_name: Optional[str] = None) List[flownet.realization._simulation_keywords.COMPDAT]

Function to retrieve all COMPDAT entries defined for a particular well.

Parameters

well_name – Name of the well to get COMPDAT’s for

Returns

COMPDAT keywords defined for a particular well

get_dates() List[datetime.date]

Function to retrieve a sorted list of all unique dates in the schedule object.

Returns

Listing of PyDate’s in the Schedule

get_first_date() datetime.date

Helper function to look-up the first date in the schedule.

Returns

The Schedule’s first date.

get_keywords(dates: Optional[Union[List[datetime.date], datetime.date]] = None, kw_class: Optional[Union[flownet.realization._simulation_keywords.Keyword, str]] = None, well_name: Optional[str] = None, ignore_nan: Optional[str] = None) List[flownet.realization._simulation_keywords.Keyword]

Returns a list of all keywords at given dates and/or of a particular keyword class.

Parameters
  • dates – Date or list of dates at which to lookup keywords

  • kw_class – keyword class or class name string

  • well_name – well name

  • ignore_nan – keyword attribute to ignore nan values

Returns

keywords at specified dates and/or with a specific well name and/or of a specific keyword class

get_nr_observations(training_set_fraction: float) int

Helper function to retrieve the number of unique observations in the training process.

Parameters

training_set_fraction – Fraction of dates to use in the training process.

Returns

The number of unique observations used in the training process

get_vfp() Dict

Helper function to retrieve the VFP tables associated with all wells.

Returns

A dictionary of VFP table numbers or None if no such date exist

get_well_start_date(well_name: Optional[str] = None) Optional[datetime.date]

Function to retrieve the start date of a well.

Parameters

well_name – Name of the well to get the start-date for

Returns

Returns the date if found, otherwise None

get_wells(kw_class: Optional[Union[flownet.realization._simulation_keywords.Keyword, str]] = None) List[str]

Function to retrieve all wells that are associated to any keyword in the Schedule or associated to a particular kw_class.

Parameters

kw_class – keyword class or class name string

Returns

List of strings of unique well names

max_connections() int

Function to retrieve the maximum number of well connections to the grid in any defined well in the Schedule.

Returns

Maximum number of connections with the grid in a single well in the schedule

num_connections(well_name: str) int

Function to retrieve the number of well connections to the grid in a specific well.

Parameters

well_name – Well name to retrieve the connections for

Returns

Number of connections with the grid in the well

num_wells() int

Function to retrieve the number of unique wells in the Schedule associated to any keyword in the Schedule.

Returns

Number of unique wells in the schedule

sort()

Function to return a list if schedule items (keywords) sorted on by date

Returns

Date-sorted schedule items