business.gravity.trunking package

Submodules

business.gravity.trunking.setters module

Provide mutators for the TrunkDesign.

class business.gravity.trunking.setters.TrunkDesignSettersMixin

Bases: object

The mixin gathering setters of TrunkDesign.

energy_at_tail_point

Get or set the hydraulic energy at the ‘tail’ end of the Trunk

energy_at_head_point

Get or set the hydraulic energy at the ‘head’ end of the Trunk

property energy_at_head_point

Get or set the hydraulic energy at the ‘head’ end of the Trunk.

Setting the hydraulic energy to a new value will update the pressure at the ‘head’ end.

Setting the hydraulic energy to a new value will not modify the hydraulic energy line or the piped_segments in the Trunk.

property energy_at_tail_point

Get or set the hydraulic energy at the ‘tail’ end of the Trunk.

Setting the hydraulic energy to a new value will update the pressure at the ‘tail’ end.

Setting the hydraulic energy to a new value will not modify the hydraulic energy line or the piped_segments in the Trunk. Usually, once the energy_at_tail_point is set, the code runs the simplex solver and then sets the piped segments to the Trunk. Then it evaluates the new water energy line, and finally checks for hydraulic pressure compliance of the energy line. This setter is then run at an initial stage of the design algorithm.

business.gravity.trunking.traversals module

Provide algorithms solving the ‘hydraulic design problem’ within a Trunk.

class business.gravity.trunking.traversals.AtmosphericTraversalTrunkMixin

Bases: object

property get_traversal_solution

it dispatches always the _delta_zero approach when solving the ‘hydraulic design problem’.

An AtmosphericTrunkDesign will always have zero hydraulic pressure at its ends and therefore its traversal algorithm is surely the _delta_zero.

Type

Override the parent class method

class business.gravity.trunking.traversals.TraversalsTrunkDesignMixin

Bases: business.commons.traversals.TraversalsTrunkOrStretchMixin

Algorithms to find the optimal piped segments in the Trunk.

get_traversal_solution()

return the optimal piped segments, with given water flow and energy constraints at ‘tail’ and ‘head’ ends

property get_traversal_solution

Return the optimal piped segments, with given water flow and energy constraints at ‘tail’ and ‘head’ ends.

This method dispatches the execution to specific methods depending on the number of rated working pressure classes that the hydraulic energy line crosses from ‘tail’ to ‘head’.

Returns

  • either – list(PipedSegment), if a solution was found

  • or – list(simplex_failure_list) otherwise TODO: questo simbolo di [] confonde! Non è chiaro se restituisci una ‘lista di liste’ o cosa! E lo hai scritto tu.

  • TODOs

  • —–

  • il fatto che questa def restituisce either…or la rende difficile.

  • Ricorda però che siamo dentro una coroutine e non si possono sollevare le eccezioni.

business.gravity.trunking.traversals.filter_accomplished_solutions(function: Callable) → Callable