oasislmf.pytools.data_layer.footprint_layer

Attributes

Classes

OperationEnum

Defines the different types of operations supported via bytes. To be passed through TCP port first to tell the

FootprintLayer

Class to accessing the footprint data via TCP ports.

FootprintLayerClient

Connects to the footprint server via TCP.

Functions

main(→ None)

Module Contents

oasislmf.pytools.data_layer.footprint_layer.POINTER_PATH = '/pointer_flag.txt'[source]
oasislmf.pytools.data_layer.footprint_layer.TCP_IP = '127.0.0.1'[source]
oasislmf.pytools.data_layer.footprint_layer.TCP_PORT = 8080[source]
oasislmf.pytools.data_layer.footprint_layer.PROCESSES_SUPPORTED = 100[source]
oasislmf.pytools.data_layer.footprint_layer.MODEL_LOG_PATH = '/0_model_log.txt'[source]
class oasislmf.pytools.data_layer.footprint_layer.OperationEnum[source]

Bases: enum.Enum

Defines the different types of operations supported via bytes. To be passed through TCP port first to tell the server what type of operation is required.

GET_DATA[source]
GET_NUM_INTENSITY_BINS[source]
REGISTER[source]
UNREGISTER[source]
POLL_DATA[source]
class oasislmf.pytools.data_layer.footprint_layer.FootprintLayer(storage: oasis_data_manager.filestore.backends.base.BaseStorage, total_expected: int, ignore_file_type: Set[str] = set(), df_engine='oasis_data_manager.df_reader.reader.OasisPandasReader')[source]

Class to accessing the footprint data via TCP ports.

static_path

path to the static file to load the data

Type:

str

ignore_file_type[source]

collection of file types to ignore when loading

Type:

Set[str]

file_data[source]

footprint object to load

Type:

Optional[Footprint]

socket[source]

the TCP socket in which data is sent

Type:

Optional[socket.socket]

count[source]

the number of processes currently relying on the server

Type:

int

total_expected[source]

the total number of reliant processes expected

Type:

int

total_served[source]

the total number of processes that have ever registered through the server’s lifetime

Type:

int

storage[source]
ignore_file_type: Set[str][source]
file_data: oasislmf.pytools.getmodel.footprint.Footprint | None = None[source]
socket: socket.socket | None = None[source]
count: int = 0[source]
total_expected: int[source]
total_served: int = 0[source]
df_engine = 'oasis_data_manager.df_reader.reader.OasisPandasReader'[source]
listen() None[source]

Fires off the process with an event loop serving footprint data.

Returns: None

class oasislmf.pytools.data_layer.footprint_layer.FootprintLayerClient[source]

Connects to the footprint server via TCP.

classmethod poll() bool[source]

Checks to see if data server is running.

Returns: (bool)

classmethod register() None[source]

Registers the client with the server.

Returns: None

classmethod unregister() None[source]

Unregisters the client with the data server.

Returns: None

classmethod get_number_of_intensity_bins() int[source]

Gets the number of intensity bins from the footprint data.

Returns: (int) the number of intensity bins

classmethod get_event(event_id: int) numpy.array[source]

Gets the footprint data from the footprint based off the event_id.

Parameters:

event_id – (int) the event ID of the data required

Returns: (np.array) footprint data based off the event_id

oasislmf.pytools.data_layer.footprint_layer.main() None[source]