business.manufacturers package

Submodules

business.manufacturers.constants module

Collection of constants used in both the hydraulic design and check problems.

business.manufacturers.constants.DIESEL_SPECIFIC_WEIGHT = <Quantity(0.835, 'dimensionless')>

Prescribes the specific weigth of fuel, used to run consumption calculations.

business.manufacturers.constants.ENGINE_MAX_ADVISABLE_LOAD = 1

Prescribes the maximum engine load before wear occours.

business.manufacturers.constants.ENGINE_MIN_ADVISABLE_LOAD = 0.1

Prescribes the minimal engine load before carbonation and wear occour.

business.manufacturers.constants.MAX_ADVISABLE_FLOW_SPEED = <Quantity(12.0, 'meter / second')>

Prescribes the maximal speed of water inside the pipes to prevent wear.

business.manufacturers.constants.MAX_ADVISABLE_VEE_BELT_TRANSMISSION_RATIO = 1.67

Prescribes the maximum vee-belt ratio before slipping occours.

business.manufacturers.constants.MIN_ADVISABLE_FLOW_SPEED = <Quantity(0.0005, 'meter / second')>

Prescribes the minimal speed of water inside the pipes to prevent sedimentation.

business.manufacturers.constants.MIN_CLUTCH_ENGAGEMENT_RPM_MAGNITUDE = 1600

Prescribes the minimal crankshaft speed to allow a centrifugal clutch to engage.

business.manufacturers.constants.PREFERRED_FLOW_SPEED = <Quantity(5, 'foot / second')>

Prescribes the optimal speed of water inside the pipes.

business.manufacturers.constants.VEE_BELTS_TRANSMISSION_EFFICIENCY = 0.96

Prescribes a default mechanical power loss between belts and pulleys.

business.manufacturers.readers module

Define readers of json data, able to populate hydraulic hardware dataclasses.

class business.manufacturers.readers.BaseComponentLoader(api_uri: str)

Bases: business.commons.loggers.InitLogger

Mixin gathering common method to read the data and assign the business_units.

api_uri

the uri of the json source providing the data

get_instances

Return a sequence of namedtuples storing the hydraulic hardware data

_get_dimensional_records_as_tuple

Return a tuple of dictionaries storing dimensional data

property get_instances

Return a sequence of namedtuples storing the hydraulic hardware data.

Returns

the sequence of namedtuples with the data. Each inheritor has a specific namedtuple.

Return type

Tuple[Namedtuple]

Example

DriveheadLoader will return a tuple of manufacturers.components.Drivehead ShaftLoader will return a tuple of manufacturers.components.Shaft

class business.manufacturers.readers.DriveheadLoader(api_uri: str)

Bases: business.manufacturers.readers.BaseComponentLoader

Adapter from a json source of progressive cavity pump driveheads.

_component_class

the dataclass use to represent progressive cavity pump drivehead

class business.manufacturers.readers.EngineCheckLoader(api_uri: str)

Bases: business.manufacturers.readers.EngineLoader

class business.manufacturers.readers.EngineDesignLoader(api_uri: str)

Bases: business.manufacturers.readers.EngineLoader

class business.manufacturers.readers.EngineLoader(api_uri: str)

Bases: business.manufacturers.readers.BaseComponentLoader

Adapter from a json source of diesel engines.

_component_class

the dataclass use to represent diesel engine

class business.manufacturers.readers.PipeCheckLoader(api_uri: str)

Bases: business.manufacturers.readers.PipeLoader

class business.manufacturers.readers.PipeDesignLoader(api_uri: str)

Bases: business.manufacturers.readers.PipeLoader

class business.manufacturers.readers.PipeLoader(api_uri: str)

Bases: business.manufacturers.readers.BaseComponentLoader

class business.manufacturers.readers.ProgressiveBodyCheckLoader(api_uri: str)

Bases: business.manufacturers.readers.ProgressiveBodyLoader

class business.manufacturers.readers.ProgressiveBodyDesignLoader(api_uri: str)

Bases: business.manufacturers.readers.ProgressiveBodyLoader

class business.manufacturers.readers.ProgressiveBodyLoader(api_uri: str)

Bases: business.manufacturers.readers.BaseComponentLoader

Adapter from a json source of progressive cavity pump bodies.

_component_class

the dataclass use to represent progressive cavity pump body

class business.manufacturers.readers.RiserPipeCheckLoader(api_uri: str)

Bases: business.manufacturers.readers.PipeLoader

class business.manufacturers.readers.RiserPipeDesignLoader(api_uri: str)

Bases: business.manufacturers.readers.PipeLoader

class business.manufacturers.readers.ShaftCheckLoader(api_uri: str)

Bases: business.manufacturers.readers.ShaftLoader

class business.manufacturers.readers.ShaftDesignLoader(api_uri: str)

Bases: business.manufacturers.readers.ShaftLoader

class business.manufacturers.readers.ShaftLoader(api_uri: str)

Bases: business.manufacturers.readers.BaseComponentLoader

Adapter from a json source of progressive cavity pump shafts.

_component_class

the dataclass use to represent progressive cavity pump shaft

class business.manufacturers.readers.SubmersibleCheckLoader(api_uri: str)

Bases: business.manufacturers.readers.BaseComponentLoader

class business.manufacturers.readers.SubmersibleDesignLoader(api_uri: str)

Bases: business.manufacturers.readers.BaseComponentLoader

business.manufacturers.readers.hydraulic_hardware_patch_attempt(api_uri)

business.manufacturers.services module

Collection of uri’s used to access the hydraulic hardware json data.

business.manufacturers.services.PERSISTENCE_HOST = '127.0.0.1:8000'

Prescribes the root url of the persistent data.

business.manufacturers.services.get_persistence_host()

Fake and temporary.

business.manufacturers.services.get_server_settings()
business.manufacturers.services.hydraulic_hardware_apis = {'bodies': 'http://127.0.0.1:8000/api/bodies/', 'bores': 'http://127.0.0.1:8000/api/bores/', 'carbon_pipes': 'http://127.0.0.1:8000/api/carbon_pipes/', 'combinations': 'http://127.0.0.1:8000/api/combinations/', 'driveheads': 'http://127.0.0.1:8000/api/driveheads/', 'engines': 'http://127.0.0.1:8000/api/engines/', 'materials': 'http://127.0.0.1:8000/api/materials/', 'pipes': 'http://127.0.0.1:8000/api/pipes/', 'plants': 'http://127.0.0.1:8000/api/plants/', 'polyethylene_pipes': 'http://127.0.0.1:8000/api/polyethylene_pipes/', 'riser_assemblies': 'http://127.0.0.1:8000/api/riser_assemblies/', 'shafts': 'http://127.0.0.1:8000/api/shafts/', 'steel_pipes': 'http://127.0.0.1:8000/api/steel_pipes/', 'submersibles': 'http://127.0.0.1:8000/api/submersibles/'}

Prescribes the url of hydraulic hardware catalogs.

business.manufacturers.services.mocked_persistence_host(*args, **kwargs)

business.manufacturers.utils module

Define an ancestor class common to hydraulic hardware dataclasses.

class business.manufacturers.utils.MonostateMixin

Bases: object

Add the monostate pattern to instances of dataclass.

property adopt

Return a copy of the dataclass instance.

After this method is called, the newly created instace will trigger its __post_init__ method to recreate the Rating instances.

Example

The following code: `new_engine = engine.adopt()` entails that <new_engine> will receive a copy of <rating_data> with which will create its own instance of EngineRating.