Aquifer

class Aquifers(**kwargs)[source]

Aquifers component class.

apply(func, attr, *args, inplace=False, **kwargs)

Apply function to attributes.

Parameters
  • func (callable) – A function to apply. Must accept data as its first argument.

  • attr (str, array-like) – Attributes to get data from.

  • args (misc) – Any additional positional arguments to func.

  • kwargs (misc) – Any additional named arguments to func.

Returns

output – Transformed component.

Return type

BaseComponent

property attributes

Array of attributes.

property class_name

Name of the component.

copy()[source]

Returns a deepcopy of attributes. Cached properties are not copied.

crop_minimal_cube(slices)[source]

Modify aquifers’ cell inndices with respect to slices representing grid crop.

Parameters

slices (Iterable(slices)) – slices

Returns

Aquifers with changed well indices.

Return type

Aquifers

del_state(*args)

State remover.

drop(attr)

Drop an attribute.

dump(path, **kwargs)

Dump attributes into file.

Parameters
  • path (str) – Path to output file.

  • kwargs (dict, optional) – Any kwargs for dump method.

Returns

comp – BaseComponent unchanged.

Return type

BaseComponent

static dump_array_ascii(buffer, array, header=None, fmt='%f', compressed=True)

Writes array-like data into an ASCII buffer.

Parameters
  • buffer (buffer-like) –

  • array (1d, array-like) – Array to be saved

  • header (str, optional) – String to be written line before the array

  • fmt (str or sequence of strs, optional) – Format to be passed into numpy.savetxt function. Default to ‘%f’.

  • compressed (bool) – If True, uses compressed typing style

empty_like()

Get an empty component with the same state and the structure of embedded BaseComponents (if any).

init_state(**kwargs)

Init state attributes.

items()[source]

Returns pairs of aquifer’s names and data.

keys()

Array of attributes.

load(path_or_buffer, **kwargs)

Load data from a file or buffer.

Parameters
  • path_or_buffer (str of string buffer) – Source to read data from.

  • **kwargs (dict, optional) – Any kwargs to be passed to load method.

Returns

comp – BaseComponent with loaded attributes.

Return type

BaseComponent

property names

Returns names of the aquifers.

randomize(randomizers, inplace=False)[source]

Randomize properties of the aquifers

Parameters
  • randomizers (dict) – Dict of the structure {parameter_name: Callable returning value, being added to the original value}.

  • inplace (bool, optional) – Perform operations inplace or return copy, by default False

Returns

Randomized aquifers.

Return type

Aquifers

ravel(attr=None, order='F', inplace=True)

Ravel attributes where applicable assuming by default Fortran order.

Parameters
  • attr (str, array of str) – Attribute to ravel.

  • order (str) – Numpy reshape order. Default to ‘F’.

  • inplace (bool) – If True, ravel is made inplace, return BaseComponent. Else, return raveled attribute.

Returns

out

Return type

BaseComponent if inplace else raveled attribute itself.

reshape(attr, newshape, order='C', inplace=True)

Reshape numpy.ndarray attributes.

Parameters
  • attr (str, array of str) – Attribute to be reshaped.

  • newshape (tuple) – New shape.

  • order (str) – Numpy reshape order. Default to ‘C’.

  • inplace (bool) – If True, reshape is made inplace, return BaseComponent. Else, return reshaped attribute.

Returns

output

Return type

BaseComponent if inplace else reshaped attribute itself.

set_state(**kwargs)

State setter.

property state

Get state.

values()

Returns a generator of attribute’s data.