Skip to main content

Demonstration of an orifice calculation module

Project description

Demo Orifice Calculation

A simple python package containing a single-function module which calculates the orifice diameter required to acheive a given flowrate in a pipe. The calculation itself is straightforward and serves as an example of how Python libraries could be used to manage verified and tested calculations rather than using uncontrolled and untrusted spreadsheets.

Installation

You can install this demo orifice calculation module from PyPI:

pip install demo-orifice-calc

How to use

The module can be imported into any python 3.x environment such as Jupyter. Or, using the Python interpreter:

>>> from demo_orifice_calc import orifice_calc
>>> help(orifice_calc)

As a working example if we want to find the orifice diameter required to give a 1.0 m headloss in a 300 mm diameter pipe at 100 L/s :

>>> orifice_calc(0.1, 0.3, 1.0)
0.1892662941723228

Trust

A test suite can be created to gain confidence in the validity of the results of calculation functions like this. This demo library includes one such test which can be checked by looking for the "build | passing" icon near the top of the page on GitHub. The tests can be run manually by downloading the source repo and running:

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

demo_orifice_calc-1.0.1.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

demo_orifice_calc-1.0.1-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page