ethos_penalps.stream

Contents

ethos_penalps.stream#

Module Contents#

Classes#

BaseStreamState

DataClassJsonMixin is an ABC that functions as a Mixin.

StreamStaticData

DataClassJsonMixin is an ABC that functions as a Mixin.

StreamEnergyData

DataClassJsonMixin is an ABC that functions as a Mixin.

BatchStreamStaticData

DataClassJsonMixin is an ABC that functions as a Mixin.

BatchStreamState

DataClassJsonMixin is an ABC that functions as a Mixin.

BatchStreamProductionPlanEntry

DataClassJsonMixin is an ABC that functions as a Mixin.

BatchStream

Batch streams represent streams which are instantaneously loaded and unloaded.

ContinuousStreamState

DataClassJsonMixin is an ABC that functions as a Mixin.

ContinuousStreamStaticData

DataClassJsonMixin is an ABC that functions as a Mixin.

ContinuousStreamProductionPlanEntry

DataClassJsonMixin is an ABC that functions as a Mixin.

ContinuousStream

Continuous streams provide mass in continuously while they are active.

ProcessStepProductionPlanEntryWithInputStreamState

StreamDataFrameMetaInformation

DataClassJsonMixin is an ABC that functions as a Mixin.

class ethos_penalps.stream.BaseStreamState#

Bases: dataclasses_json.DataClassJsonMixin

DataClassJsonMixin is an ABC that functions as a Mixin.

As with other ABCs, it should not be instantiated directly.

name: str#
start_time: datetime.datetime#
end_time: datetime.datetime#
date_time_range: datetimerange.DateTimeRange#
class ethos_penalps.stream.StreamStaticData#

Bases: dataclasses_json.DataClassJsonMixin

DataClassJsonMixin is an ABC that functions as a Mixin.

As with other ABCs, it should not be instantiated directly.

start_process_step_name: str#
end_process_step_name: str#
commodity: ethos_penalps.data_classes.Commodity#
mass_unit: str#
name_to_display: str | None#
class ethos_penalps.stream.StreamEnergyData#

Bases: dataclasses_json.DataClassJsonMixin

DataClassJsonMixin is an ABC that functions as a Mixin.

As with other ABCs, it should not be instantiated directly.

stream_name: str#
load_dict: dict[str, ethos_penalps.data_classes.LoadType]#
dict_stream_load_energy_data: dict[str, ethos_penalps.data_classes.StreamLoadEnergyData]#
add_stream_load_energy_data(stream_load_energy_data: ethos_penalps.data_classes.StreamLoadEnergyData)#
class ethos_penalps.stream.BatchStreamStaticData#

Bases: StreamStaticData

DataClassJsonMixin is an ABC that functions as a Mixin.

As with other ABCs, it should not be instantiated directly.

delay: datetime.timedelta#
minimum_batch_mass_value: numbers.Number#
maximum_batch_mass_value: numbers.Number#
stream_type: str = 'BatchStream'#
class ethos_penalps.stream.BatchStreamState#

Bases: BaseStreamState

DataClassJsonMixin is an ABC that functions as a Mixin.

As with other ABCs, it should not be instantiated directly.

batch_mass_value: numbers.Number#
class ethos_penalps.stream.BatchStreamProductionPlanEntry#

Bases: dataclasses_json.DataClassJsonMixin

DataClassJsonMixin is an ABC that functions as a Mixin.

As with other ABCs, it should not be instantiated directly.

name: str#
commodity: str#
start_time: datetime.datetime#
end_time: datetime.datetime#
duration: datetime.timedelta#
delay: datetime.timedelta#
batch_mass_value: numbers.Number#
batch_mass_unit: str#
minimum_batch_mass_value: numbers.Number#
maximum_batch_mass_value: numbers.Number#
stream_type: str#
name_to_display: str | None#
class ethos_penalps.stream.BatchStream#

Bases: dataclasses_json.DataClassJsonMixin

Batch streams represent streams which are instantaneously loaded and unloaded. The mass reaches the destination in a discrete event opposed to continuous delivery in a continuous stream

static_data: BatchStreamStaticData#
stream_type = 'BatchStream'#
__post_init__()#
create_stream_energy_data(specific_energy_demand: numbers.Number, load_type: ethos_penalps.data_classes.LoadType, mass_unit: str = Units.mass_unit.__str__(), energy_unit: str = Units.energy_unit.__str__())#
create_production_plan_entry(state: BatchStreamState) BatchStreamProductionPlanEntry#
get_produced_amount(state: BatchStreamState) numbers.Number#
get_time_frame_overlap_share(stream_state: BatchStreamState, is_input_stream: bool, target_date_range: datetimerange.DateTimeRange) datetimerange.DateTimeRange#
get_mass_share_in_time_period(stream_state: BatchStreamState, is_input_stream: bool, target_date_range: datetimerange.DateTimeRange) numbers.Number#
create_batch_state(end_time: datetime.datetime, batch_mass_value: numbers.Number) BatchStreamState#
consider_maximum_batch_mass(target_batch_mass: numbers.Number) numbers.Number#

Check if the desired maximum batch mass can be returned. Returns desired mass if its within boundaries. If desired mass is bigger than maximum, the maximum value is returned.

Parameters:

target_batch_mass (float) – _description_

Raises:

Exception – _description_

Returns:

_description_

Return type:

float

get_upstream_node_name() str#
get_downstream_node_name() str#
get_produced_mass_between_end_and_start_date(target_start_date: datetime.datetime, target_end_date: datetime.datetime, state: BatchStreamState) numbers.Number#
json_dumps_state(stream_state: BatchStreamState, path_to_save_folder: str = '')#
json_load_state(path_to_file: str = '')#
class ethos_penalps.stream.ContinuousStreamState#

Bases: BaseStreamState

DataClassJsonMixin is an ABC that functions as a Mixin.

As with other ABCs, it should not be instantiated directly.

total_mass: numbers.Number#
current_operation_rate: numbers.Number#
class ethos_penalps.stream.ContinuousStreamStaticData#

Bases: StreamStaticData

DataClassJsonMixin is an ABC that functions as a Mixin.

As with other ABCs, it should not be instantiated directly.

minimum_operation_rate: numbers.Number#
maximum_operation_rate: numbers.Number#
time_unit: datetime.timedelta#
stream_type: str = 'ContinuousStream'#
class ethos_penalps.stream.ContinuousStreamProductionPlanEntry#

Bases: dataclasses_json.DataClassJsonMixin

DataClassJsonMixin is an ABC that functions as a Mixin.

As with other ABCs, it should not be instantiated directly.

name: str#
start_time: datetime.datetime#
end_time: datetime.datetime#
duration: datetime.timedelta#
commodity: str#
current_operation_rate_value: numbers.Number#
current_operation_rate_unit: str#
mass_unit: str#
minimum_operation_rate: numbers.Number#
maximum_operation_rate: numbers.Number#
total_mass: numbers.Number#
stream_type: str#
name_to_display: str#
class ethos_penalps.stream.ContinuousStream#

Bases: dataclasses_json.DataClassJsonMixin

Continuous streams provide mass in continuously while they are active.

static_data: ContinuousStreamStaticData#
stream_type = 'ContinuousStream'#
__post_init__()#
create_stream_energy_data(specific_energy_demand: numbers.Number, load_type: ethos_penalps.data_classes.LoadType, mass_unit: str = Units.mass_unit.__str__(), energy_unit: str = Units.energy_unit.__str__())#
create_stream_state_for_commodity_amount(commodity_amount: numbers.Number, end_time: datetime.datetime, operation_rate: numbers.Number = float('inf')) ContinuousStreamState#
get_time_frame_overlap_share(numerator_date_range: datetimerange.DateTimeRange, denominator_date_range: datetimerange.DateTimeRange) numbers.Number#
get_mass_share_in_time_period(numerator_date_range: datetimerange.DateTimeRange, stream_state: ContinuousStreamState) numbers.Number#
create_production_plan_entry(state: ContinuousStreamState) ContinuousStreamProductionPlanEntry#
get_produced_amount(state: ContinuousStreamState) numbers.Number#
check_if_operation_rate_is_within_boundaries(operation_rate_to_check: numbers.Number) bool#
determine_start_time(end_time: datetime.datetime, operation_rate: numbers.Number, total_transported_mass: numbers.Number) datetime.datetime#
determine_stream_state_mass(end_time: datetime.datetime, start_time: datetime.datetime, current_operation_rate: numbers.Number | None) numbers.Number#
create_continuous_stream_state(end_time: datetime.datetime, start_time: datetime.datetime, current_operation_rate: numbers.Number | None) ContinuousStreamState#
get_upstream_node_name() str#
get_downstream_node_name() str#
get_produced_mass_between_end_and_start_date(target_start_date: datetime.datetime, target_end_date: datetime.datetime, state: ContinuousStreamState) numbers.Number#
json_dumps_state(stream_state: ContinuousStreamState, path_to_save_folder: str = '')#
json_load_state(path_to_file: str = '')#
class ethos_penalps.stream.ProcessStepProductionPlanEntryWithInputStreamState#

Bases: ethos_penalps.data_classes.ProcessStepProductionPlanEntry

stream_start_time: datetime.datetime#
stream_end_time: datetime.datetime#
total_stream_mass: numbers.Number#
class ethos_penalps.stream.StreamDataFrameMetaInformation#

Bases: dataclasses_json.DataClassJsonMixin

DataClassJsonMixin is an ABC that functions as a Mixin.

As with other ABCs, it should not be instantiated directly.

data_frame: pandas.DataFrame#
stream_name: str#
first_start_time: datetime.datetime#
last_end_time: datetime.datetime#
stream_type: str#
mass_unit: str#
commodity: ethos_penalps.data_classes.Commodity#
name_to_display: str#