business.station package

Design and check projects of water supplies fed from a borehole.

Classes

  • ElectricCheck:

    models the ‘hydraulic check problem’ for an ‘electric station’ water supply.

  • ElectriclessCheck:

    models the ‘hydraulic check problem’ for an ‘electricless station’ water supply.

  • ElectricDesign:

    models the ‘hydraulic design problem’ for an ‘electric station’ water supply.

  • ElectriclessDesign:

    models the ‘hydraulic design problem’ for an ‘electricless station’ water supply.

Submodules

business.station.adapters module

class business.station.adapters.SoilStretchAdapter(_stretches: Tuple[business.station.soils.SoilStretch])

Bases: object

cleaned_data()

business.station.climb module

class business.station.climb.ClimbStretch(_climbing_sequence: List[business.station.climb.ClimbingSegment], _soil_stretch: business.station.soils.SoilStretch, _pressure_limit: pint.quantity.build_quantity_class.<locals>.Quantity, _head_point: business.commons.energy.EnergyProfilePoint)

Bases: business.commons.loggers.InitLoggerMixin, business.station.plots.PlotClimbStretchMixin

property get_valid_pressure_pathlength
property recursive_climb
roba()
class business.station.climb.ClimbingConduit(iterable=(), /)

Bases: list

append(item)

Append object to the end of the list.

property as_piped_segments

Convert a ClimbingConduit into the corresponding tuple of PipedSegment’s.

property cost
class business.station.climb.ClimbingConduitsCollector(*args, **kwargs)

Bases: list

Implemented without extending business_utils.TypedList since TypedList extends collections.MutableSequence and makes the use of core_utils.Singleton unfeasible (due to metaclass conflict between Singleton and MutableSequence).

append(item)

Append object to the end of the list.

class business.station.climb.ClimbingSegment(pathlength, commercial_pipe)

Bases: tuple

Represent a segment of the feeder, with a given pipe and a given length. Used when solving the ‘hydraulic design problem’, to optmize the feeder with a systematic search approach.

property commercial_pipe

Alias for field number 1

property pathlength

Alias for field number 0

class business.station.climb.FeederClimbMixin

Bases: object

property get_candidate_conduits_list

the data structure must be must be a ‘list of lists’.

Type

Remark

business.station.climb.check_commercial_pipes_are_available(function)

business.station.constants module

Collection of constants used by the pumpstation foldes.

business.station.constants.RANDOM_SEARCH_RANGE_PAD = <Quantity(2, 'meter')>

Prescribes the minimal hydraulic energy to be burned along a Trunk during feeder random search. This value magnitude is expected to be an integer.

business.station.constants.RANDOM_SEARCH_RANGE_STEP = <Quantity(10, 'meter')>

Prescribes the difference of hydraulic energy between two successive attempts during feeder random search. This value magnitude is expected to be an integer.

business.station.coroutines module

class business.station.coroutines.AutomatedTypedList(ok_type, iterable=[])

Bases: business.helpers.utils.TypedList

property best_from_collect_ranges
class business.station.coroutines.CoroutineLeaf(soil_stretch: business.station.soils.SoilStretch, name: str, down_elev: int)

Bases: business.commons.loggers.InitLoggerMixin

down_elev: int
merger()
name: str
send(arg)
soil_stretch: business.station.soils.SoilStretch
class business.station.coroutines.CoroutineNode(soil_stretch: business.station.soils.SoilStretch, name: str, down_flight: int, next_coro_object: business.station.soils.SoilStretch)

Bases: business.commons.loggers.InitLoggerMixin

static best_from_collect_ranges(list_of_lists)
down_flight: int
static is_failed(child_simplex)
merger()
name: str
next_coro_object: business.station.soils.SoilStretch
send(arg)
soil_stretch: business.station.soils.SoilStretch
class business.station.coroutines.CoroutineReturn

Bases: business.helpers.utils.TypedList

property is_failed
class business.station.coroutines.CoroutineRoot(riser: business.station.riser.RiserDesign, name: str, down_flight: int, next_coro_object: business.station.soils.SoilStretch)

Bases: business.commons.loggers.InitLoggerMixin

static best_from_collect_ranges(list_of_lists)

Remark: this method could be turned into a @staticmethod. However, the self is used for logging purposes.

down_flight: int
static is_failed(child_simplex)

Remark: this method could be turned into a @staticmethod. However, the self is used for logging purposes.

merger()
name: str
next_coro_object: business.station.soils.SoilStretch
riser: business.station.riser.RiserDesign
set_hydraulic_energy_at_submersible_outlet(value)

business.station.defaults module

business.station.definitions module

class business.station.definitions.FeederSegment(piped_segments=None, penalty=None)

Bases: tuple

Represent a segment of the feeder, with a given pipe and a given length. Used when solving the ‘hydraulic design problem’, to optmize the feeder with a systematic search approach.

property penalty

Alias for field number 1

property piped_segments

Alias for field number 0

class business.station.definitions.StationCheckSolution(check_is_completed: str = None, solution: str = None, economic_cost: str = None)

Bases: object

Represent a report of the hydraulic check problem in a station.

Applies to both electric and electriless stations, and these station provide their customised values of fields ‘solution’ and ‘economic_cost’.

check_is_completed: str = None
economic_cost: str = None
property engine_power_curve_as_matplotlib
solution: str = None
class business.station.definitions.StationDesignSolution(check_is_completed: str = None, solution: str = None, economic_cost: str = None)

Bases: object

Represent a report of the hydraulic check problem in a station.

Applies to both electric and electriless stations, and these station provide their customised values of fields ‘solution’ and ‘economic_cost’.

check_is_completed: str = None
economic_cost: str = None
solution: str = None

business.station.exceptions module

exception business.station.exceptions.DemandMissing

Bases: business.commons.exceptions.ImproperlyConfiguredWaterSystem

The water demand is unknown.

exception business.station.exceptions.DesignAtFixedFlowFailed(message, TODO_some_hint='TODO')

Bases: business.station.exceptions.StationDesignUnfeasible

The ‘hydraulic design problem’ could not be solved for a given value of the water flow.

exception business.station.exceptions.ForceMainDemandDataMissing

Bases: business.commons.exceptions.RuralwaterException

The feeder has no water demand data associated with it.

Raised when running the ‘hydraulic design problem’: if water demand data are absent then the ‘hydraulic design problem’ cannot be solved because it is unknown for how much water the pumpstation must be designed.

exception business.station.exceptions.ImproperlyConfiguredPumpingStation

Bases: business.commons.exceptions.ImproperlyConfiguredWaterSystem

Some data needed to solve the hydraulic design/check problem for a pumping station were not provided by the user.

exception business.station.exceptions.NonsensicalSoilSectionsData

Bases: business.commons.exceptions.RuralwaterException

A file can be read but the data make no logical sense.

exception business.station.exceptions.StationCheckUnfeasible

Bases: business.commons.exceptions.RuralwaterException

The hydraulic check problem has a ‘does not work’ solution.

The station cannot be used in this case: the prime mover will not start. This exception is common to ‘electric’ and ‘electricless’ stations, which means both to fixed speed and variable speed pumping.

exception business.station.exceptions.StationDesignUnfeasible

Bases: business.commons.exceptions.RuralwaterException

The ‘hydraulic design problem’ has a ‘does not work’ solution.

The station cannot be used in this case: the prime mover will not start. This exception is common to ‘electric’ and ‘electricless’ stations, which means both to fixed speed and variable speed pumping.

exception business.station.exceptions.UnadvisablePcdArrangement

Bases: business.station.exceptions.UnadvisablePumpStationArrangement

UnadvisableDuty operating conditions in the electricless pump station.

Raised when setters of the components of the electricless pump station raise unsadvisable conditions.

Example

  • the plant’s borehole is set a flow exceeding its maximum abstraction

license. * the plant’s treatment facility is set a flow exceeding the facility capacity.

exception business.station.exceptions.UnadvisablePumpStationArrangement

Bases: business.commons.exceptions.UnadvisableDuty

UnadvisableDuty operating conditions in the pump station.

business.station.feeder module

class business.station.feeder.FeederBaseMixin(**kwargs)

Bases: business.commons.watermains.Watermain

property get_delta_elevation_wellhead_to_tank
Returns

  • Instance of helper.business_units.Q_,

  • expressed in helper.business_units.ELEVATION_UNITS.

  • Positive if water flows from a lower elevation to a higher.

  • This is usually the case of a feeder (the borehole wellhead)

  • is located at a lower elevation than the reservoir where the

  • feeder is dischargin into.

property get_hydraulic_friction

Return the energy burned off in the pipeline by the water flowing inside it at the rate set by water_flow and as a result of the current _piping_list

Note

Precondition: self._piped_segments are set and each pipe_segment has commercial pipe and start_at field set.

property water_flow

The water flow can never be set: * in the design problem, it is set by the head site demand and the daily workshift. * in the check problem it is evaluated by the ‘check’ calculations.

class business.station.feeder.FeederCheck(**kwargs)

Bases: business.station.feeder.FeederBaseMixin, business.commons.watermains.WatermainCheck

Represent the ‘hydraulic-check’ calculations in a feeder.

get_headloss_at_sample_flow(sample_water_flow)
class business.station.feeder.FeederDesign(**initkwargs)

Bases: business.commons.traversals.PipeDesignPoolMixin, business.station.soils.FeederSoilsMixin, business.station.climb.FeederClimbMixin, business.station.feeder.FeederBaseMixin, business.station.feeder.ShortFeederDesignMixin, business.commons.watermains.WatermainDesign

property get_daily_work_hours
property get_headmost_soil_stretch
property get_my_water_demand_as_steady_flow

Return the water flow required by the ‘hydraulic design problem’.

Return the steady flow, flowing continuously along the 24 hours of the day, which satisfies the water demand associated with the Feeder.

class business.station.feeder.ShortFeederDesignMixin

Bases: object

Algorithms to run first-guess calculations.

In a first gess calculation, the feeder of the pumpstation is considered ‘short’: under this assumption, the calcualtions do not need to consider the pressure classes in the feeder. Instead, the calculatins assume that the feeder may be designed with a unique diameter and with the lowest available pressure class.

This mixin is useful also in designing those pumpstations where the water is pumped from the borehole to a nearby reservoir.

business.station.initkwargs module

business.station.plots module

class business.station.plots.CheckProblemPlots

Bases: object

plot_something()
class business.station.plots.ElectricPlotMixin

Bases: business.station.plots.PlotAdaptersMixin

plot_check_problem_solution()
property plot_design_problem_solution
class business.station.plots.ElectriclessPlotMixin

Bases: business.station.plots.PlotAdaptersMixin

property plot_check_problem_solution
property plot_design_problem_solution
class business.station.plots.PlotAdaptersMixin

Bases: object

property get_max_design_flow_range
property get_min_design_flow_range
class business.station.plots.PlotClimbStretchMixin

Bases: object

plot_recursive_climb(single_pipe_energy_line, messaggio='climb')
plots_directory = 'plots'
plots_files_extension = 'png'
yield_integer = count(1)
business.station.plots.convert_to_adimensional(function)

business.station.profile module

class business.station.profile.FeederElevationProfile(iterable: Iterable = [])

Bases: business.station.mixins.interpolation.PointFactoryMixin, business.commons.energy.ElevationProfile

get_section_from_pathlength(from_pathlength)
get_section_inbetween_pathlengths(from_pathlength, until_pathlength)
class business.station.profile.SoilStretchElevationProfile(*args, **kwargs)

Bases: business.station.profile.FeederElevationProfile

property pathlength

Return the linear length of the hydraulic energy line.

Returns

a dimensional value

Return type

Quantity(“length”)

business.station.reports module

class business.station.reports.ElectricReportMixin

Bases: object

class business.station.reports.ElectriclessReportMixin

Bases: object

business.station.riser module

class business.station.riser.RiserCheck(pump_setting_magnitudo, commercial_pipe)

Bases: object

get_headloss_at_sample_flow(sample_water_flow)
class business.station.riser.RiserDesign

Bases: object

property get_burned_off_energy
property get_guessed_cost
property pathlength
property water_flow
property yield_single_diameter_solution

business.station.soils module

class business.station.soils.FeederSoilsMixin

Bases: object

precondition: ‘FeederDesign’ object has attribute ‘_elevation_profile’

class business.station.soils.SoilStretch(_elevation_profile: business.station.profile.FeederElevationProfile, _requires_metallic_pipes: bool, _water_flow: float, _previous_soil_stretch: Any = None)

Bases: business.commons.loggers.InitLoggerMixin, business.commons.mixins.linear.SingleLinprogStretchMixin, business.station.mixins.traversals.SgrMockSimplexSoilStretchMixin, business.commons.traversals.PipeDesignPoolMixin, business.commons.mixins.cost.PipesCostMixin, business.station.mixins.traversals.SgrTraversalSoilStretchMixin, business.commons.traversals.TraversalsTrunkOrStretchMixin

get_elevation_profile_from_tail_until_downrange(until_downrange)
property get_head_point_elevation
get_pathlength_inbetween_downranges(from_downrange, until_downrange)
get_rated_working_pressure(head_energy_point)
get_valid_pressure_pathlength(pressure_violation_point)