business.manufacturers.catalogs package

This module gathers the available hydraulic hardware (such as pipes, pumps…)

Each kind of hydraulic hardware is store in a separate collection. The hydraulic hardware taken in consideration is that typical of rural water supply schemes.

Example

BodyPool:

store all commercially available pumps which were loaded into the software

CatalogOfEngines:

store all commercially available diesel engines which were loaded into the software

Modules

bases:

common base classes and mixinx

progressives:

store positive dispacement pumps run by a shaft through the borehole

engines:

store diesel engines

pipes:

store polyethilene and galvanised pipes

submersibles:

store electric submersible pumps

Submodules

business.manufacturers.catalogs.bases module

Provide common functionalities to the modules of ~business.manufacturers.catalogs.

class business.manufacturers.catalogs.bases.BaseCatalog(*args, **kwargs)

Bases: business.commons.loggers.InitLogger

Class holding functionalities to read json data from a rest interface.

property as_dict

business.manufacturers.catalogs.engines module

Define the diesel engine installed in an ‘electricless’ station.

class business.manufacturers.catalogs.engines.EngineCheckPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.engines.EnginePool

class business.manufacturers.catalogs.engines.EngineDesignPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.engines.EnginePool

property pick_engine_by_min_diesel_consumption

Return the engine with the best energy efficiency.

The best energy efficiency is evaluated as the lowest diesel consumption.

Parameters
  • power (Quantity("POWER"))) – the duty point (flow, energy) that the combination must be able to deliver

  • power – the power output the engine must deliver

Returns

the engine with the lowest diesel consumption

Return type

manufacturers.components.Engine

property required_power
class business.manufacturers.catalogs.engines.EnginePool(*args, **kwargs)

Bases: business.manufacturers.catalogs.bases.BaseCatalog

A class used to represent the collection of commercially available diesel engines.

_api_key_to_load

the rest api uri to get the engine data

Type

str

_rest_api_reader

the adapter in charge of reading and cleaning the engine data.

Type

adapter class

makes

the engines mapped to a unique identifier

Type

dict

property mock_pick

business.manufacturers.catalogs.pipes module

Define the pipes installed in a water supply, either ‘gravity’ or ‘station’.

Notes

In rural water supply engineering, the materials of pipes are both plastic (PVC and polyethilene) and metallic (galvanised steel). The following classes are used when environmental conditions limit the choice of materials

Example

If a Trunk crosses areas where it is impossible to dig a trench, then the computer software will be asked to adopt the class SteelPipePool.

class business.manufacturers.catalogs.pipes.BasePipePool(*args, **kwargs)

Bases: business.manufacturers.catalogs.pipes.ShortFeederSelectionMixin

A class used to represent a catalog of pipes.

The singleton catalog holding all the commercial pipes available for the hydraulic design and check problem calculations.

working_condition

the tuple (water flow, pressure rating) for which a pipe must be chosen

get_suitable_rated_working_pressure()

Return the smallest rated working pressure above a given value

get_suitable_rated_working_pressure_index()

Return the index of smallest rated working pressure above a given value

lowest_available_rated_working_pressure()

Return the lowest (and hence ‘less expensive’) rated working pressure

sorted_rated_working_pressures()

Return a doubly linked list of ascending rated working pressures

get_suitable_pipes_list()

Return pipes with correct flow speed, sorted from optimal speed

filter_those_having_suitable_speed()

Filter the commercial pipes having suitable flow speed and sort them

property as_dict
static filter_those_having_suitable_speed(pipe: Union[business.manufacturers.components.pipes.PipeCheck, business.manufacturers.components.pipes.PipeDesign]) → bool

Filter the commercial pipes having suitable flow speed and sort them.

This method reads working_conditions and filters accordingly those commercial pipes which have both a suitable flow speed. Then, it returns the pipes sorted by the closest to the optimal value of flow speed.

Raises

AllCommercialPipesAreUnsuitableSpeedwise – If no commercial pipe may carry the flow set in working_conditions with a flow speed within the engineering advisable range. Exaggerate speeds result in wear and conversely slow speeds result in sedimentation and clogging.

property get_suitable_pipes_list

Return pipes with correct flow speed, sorted from optimal speed.

Sorting by optimal speed means that the pipes are ordered first those whose water flow speed is closest, either by excess or defect, to the optimla water flow speed.

This method reads working_conditions and filters accordingly those commercial pipes which have both a suitable flow speed and a suitable rated working pressure. Then, it returns the pipes sorted by the closest to the optimal value of flow speed.

Returns

the sequence of pipes TODO

Return type

Tuple[Pipe]

Raises

AllCommercialPipesAreUnsuitableSpeedwise – If no commercial pipe may carry the flow set in working_conditions with a flow speed within the engineering advisable range. Exaggerate speeds result in wear and conversely slow speeds result in sedimentation and clogging.

get_suitable_rated_working_pressure(working_pressure: pint.quantity.build_quantity_class.<locals>.Quantity) → pint.quantity.build_quantity_class.<locals>.Quantity

Return the smallest rated working pressure above a given value.

Parameters

working_pressure (Quantity("TODO pressure")) – the pressure that a commercial pipe must be able to sustain

Returns

The smallest coommercial rated working pressure above working_pressure

Return type

manufacturers.components.Pipe

Raises

NoSuitableRatedWorkingPressureAvailableFromCatalog – If the catalog does not have any commercia pipes able to sustain the pressure request

get_suitable_rated_working_pressure_index(working_pressure: pint.quantity.build_quantity_class.<locals>.Quantity) → int

Return the index of smallest rated working pressure above a given value.

Parameters

working_pressure (Quantity("TODO pressure")) – the pressure that a commercial pipe must be able to sustain

Returns

The index of the smallest coommercial rated working pressure above working_pressure

Return type

manufacturers.components.Pipe

Raises

NoSuitableRatedWorkingPressureAvailableFromCatalog – If the catalog does not have any commercia pipes able to sustain the pressure request

property lowest_available_rated_working_pressure

Return the lowest (and hence ‘less expensive’) rated working pressure among the commercial pipes stored in the catalog.

property pick_random_pipe

Returns a random pipe.

This method is useful to mock a feeder during a software test session.

property sorted_rated_working_pressures

Return a doubly linked list of ascending rated working pressures.

property working_condition
class business.manufacturers.catalogs.pipes.PipeCheckPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.pipes.PipePool

class business.manufacturers.catalogs.pipes.PipeDesignPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.pipes.PipePool

class business.manufacturers.catalogs.pipes.PipePool(*args, **kwargs)

Bases: business.manufacturers.catalogs.pipes.BasePipePool

A class used to represent the collection of all commercial pipes.

api_keys_to_load

the urls to query the rest interface. A string in the set queries for metallic pipes. The others query for the plastic ones (polyethilene).

Type

Set(str)

api_keys_to_load = {'polyethylene_pipes', 'steel_pipes'}
class business.manufacturers.catalogs.pipes.RiserPipeCheckPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.pipes.RiserPipePool

class business.manufacturers.catalogs.pipes.RiserPipeDesignPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.pipes.RiserPipePool

property water_flow
class business.manufacturers.catalogs.pipes.RiserPipePool(*args, **kwargs)

Bases: business.manufacturers.catalogs.pipes.BasePipePool

A class used to represent the collection of commercial pipes which may be used inside the borehole casing.

api_keys_to_load

The string in the set queries for sturdy metallic pipes.

Type

Set(str)

api_keys_to_load = {'steel_pipes'}
property get_suitable_pipes_list

Return the list of pipes compliant with working_conditions ordered from closest to optimal flow speed.

class business.manufacturers.catalogs.pipes.ShortFeederSelectionMixin

Bases: object

Collection of methods only used to pick a pipe in short feeders.

Short feeders are those where pressure rating effects do not occour. Further, short feeders imply limited headloss compared to a borehole, hence no simplex solver is necessary when approaching the design problem.

Example

A ‘short’ feeder is one where the pressure limits do not represent an hydraulic design hurdle. The lowest rated pressure class may be selected. This mixin may be used for this simple pressure-agnostic design procedure.

property pick_one_pipe_by_optimal_flow_speed

Return the pipe whose flow speed is closest to an optimum value.

yield_all_pipes_by_optimal_flow_speed() → Iterator[business.manufacturers.components.pipes.PipeDesign]

Yield pipes best to worst according to suitable flow speed.

class business.manufacturers.catalogs.pipes.SteelPipePool(*args, **kwargs)

Bases: business.manufacturers.catalogs.pipes.BasePipePool

A class used to represent the collection of commercial pipes which may laid exposed without being buried in a trench.

api_keys_to_load

the urls to query the rest interface. The string in the set queries for metallic pipes.

Type

Set(str)

api_keys_to_load = {'steel_pipes'}

business.manufacturers.catalogs.progressives module

Define the progressive cavity pump installed in an ‘electricless’ station.

Refer to progressives_nomenclature

class business.manufacturers.catalogs.progressives.BaseColumnLoader(api_uri: str)

Bases: business.manufacturers.readers.BaseComponentLoader

Adapter from a json source of progressive cavity pump riser assembly.

_component_class

the dataclass use to represent progressive cavity pump riser assemblies

class business.manufacturers.catalogs.progressives.BaseCombinationLoader(api_uri: str)

Bases: business.manufacturers.readers.BaseComponentLoader

class business.manufacturers.catalogs.progressives.BodyCheckPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.progressives.BodyPool

class business.manufacturers.catalogs.progressives.BodyDesignPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.progressives.BodyPool

class business.manufacturers.catalogs.progressives.BodyPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.bases.BaseCatalog

A class used to represent the collection of commercially available pumps.

every instance in the collections is an instance of components.progressives.Body. PIERGIORGIO2: è giusto scrivere come nella riga sopra in un docstring? Basta questa dot notation per fare capire dove si trova Body?

_api_key_to_load

the rest api uri to get the pump data

Type

str

_rest_api_reader

the adapter in charge of reading and cleaning the pump data.

Type

adapter class

makes

the pump bodies mapped to a unique identifier

Type

dict

class business.manufacturers.catalogs.progressives.ColumnCheckLoader(api_uri: str)

Bases: business.manufacturers.catalogs.progressives.BaseColumnLoader

class business.manufacturers.catalogs.progressives.ColumnCheckPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.progressives.ColumnPool

class business.manufacturers.catalogs.progressives.ColumnDesignLoader(api_uri: str)

Bases: business.manufacturers.catalogs.progressives.BaseColumnLoader

class business.manufacturers.catalogs.progressives.ColumnDesignPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.progressives.ColumnPool

class business.manufacturers.catalogs.progressives.ColumnPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.bases.BaseCatalog

A class used to represent the collection of feasible combinations that make up for a ‘riser assembly’.

_api_key_to_load

the rest api uri to get the riser assembly data

Type

str

_rest_api_reader

the adapter in charge of reading and cleaning the riser assembly data.

Type

adapter class

makes

the riser assemblies mapped to a unique identifier

Type

dict

class business.manufacturers.catalogs.progressives.CombinationCheckLoader(api_uri: str)

Bases: business.manufacturers.catalogs.progressives.BaseCombinationLoader

class business.manufacturers.catalogs.progressives.CombinationCheckPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.progressives.CombinationPool

class business.manufacturers.catalogs.progressives.CombinationDesignLoader(api_uri: str)

Bases: business.manufacturers.catalogs.progressives.BaseCombinationLoader

class business.manufacturers.catalogs.progressives.CombinationDesignPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.progressives.CombinationPool

property duty_before_column_friction
property pick_least_power_combination

Return the pump combination with the best energy efficiency.

Important

Why we have ‘duty_excluding_column_friction’: The consumer of this method knows the energy required by resistive system (aquifer, feeder) but, so far, does not know which pump model will be selected by the algorithm. When this method is invoked, the algorith selects a pump and its shaft, therefore perturbing the original ‘targeted duty’. The new duty, following to the pump selction is identified by <targeted_duty_including_riser_friction>.

Parameters
  • duty_excluding_column_friction (business_definitions.FlowVsEnergyPoint,) – the duty point (flow, energy) that the combination must be able to deliver

  • pump_depth (Quantity("length"))) – the depth at which the pump must be installed (it affects the efficiency through the shaft losses)

Returns

the pump combination with the best energy efficiency

Return type

manufacturers.components.Combination

property pump_depth
class business.manufacturers.catalogs.progressives.CombinationPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.progressives.PlotCombinationsMixin, business.manufacturers.catalogs.bases.BaseCatalog

A class used to represent the collection of feasible combinations that make up for a ‘pump’.

_api_key_to_load

the rest api uri to get the riser assembly data

Type

str

_rest_api_reader

the adapter in charge of reading and cleaning the riser assembly data.

Type

adapter class

pick_least_power_combination(

duty_excluding_column_friction : business_definitions.FlowVsEnergyPoint, pump_depth : Quantity(“length”)) return the pump combination with the best energy efficiency

property mock_pick
class business.manufacturers.catalogs.progressives.DriveheadPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.bases.BaseCatalog

A class used to represent the collection of commercially available driveheads.

_api_key_to_load

the rest api uri to get the drivehead data

Type

str

_rest_api_reader

the adapter in charge of reading and cleaning the drivehead data.

Type

adapter class

makes

the driveheads mapped to a unique identifier

Type

dict

class business.manufacturers.catalogs.progressives.PlotCombinationsMixin

Bases: object

A mixin class gathering methods used to send data to matplotlib package.

The methods here defined allow to iterate in the catalog.

Example

>>> catalog_of_combinations = CombinationCheckPool()
>>> for combination in catalog_of_combinations:
>>>     # do something with <combination>
class business.manufacturers.catalogs.progressives.ShaftCheckPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.progressives.ShaftPool

class business.manufacturers.catalogs.progressives.ShaftDesignPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.progressives.ShaftPool

class business.manufacturers.catalogs.progressives.ShaftPool(*args, **kwargs)

Bases: business.manufacturers.catalogs.bases.BaseCatalog

Represent the collection of commercially available shafts.

_api_key_to_load

the rest api uri to get the shaft data

Type

str

_rest_api_reader

the adapter in charge of reading and cleaning the shaft data.

Type

adapter class

makes

the shafts mapped to a unique identifier

Type

dict

business.manufacturers.catalogs.submersibles module

Define the electric submersible pump installed in an ‘electric’ station.

class business.manufacturers.catalogs.submersibles.SubmersiblePool(*args, **kwargs)

Bases: business.manufacturers.catalogs.bases.BaseCatalog

A class used to represent the collection of commercially available submersible pumps.

_api_key_to_load

the rest api uri to get the pump data

Type

str

list_suitable_pumps

Return the list of pumps compliant with working_conditions

working_condition

Get or set the current working conditions that pumps must sustain

property mock_pick
property working_condition
class business.manufacturers.catalogs.submersibles.SubmersiblePoolCheck(*args, **kwargs)

Bases: business.manufacturers.catalogs.submersibles.SubmersiblePool

class business.manufacturers.catalogs.submersibles.SubmersiblePoolDesign(*args, **kwargs)

Bases: business.manufacturers.catalogs.submersibles.SubmersiblePool

property get_suitable_pump_list

Return the list of pumps compliant with working_conditions.

property water_flow