Skip to main content

Create, evaluate, and visualize zero-acceptance sampling plans.

Project description

# lotsampling

A Python library for creating, evaluating, and visualizing zero-acceptance acceptance sampling plans.

## Features

- Binomial sampling plans

- Hypergeometric sampling plans

- AOQL calculations

- Operating Characteristic (OC) curves

- Continuous sampling simulation

- Simulate escaped defects

- Visualize the Markov chain

- Streamlit demo application

## Installation

pip install lotsampling

## Example

from lotsampling import evaluate\_binomial\_plan



result = evaluate\_binomial\_plan(

    sample\_size=30,

    lot\_size=500,

)



print(result.aoql)

## Continuous sampling simulation

from lotsampling import simulate\_continuous\_sampling



result = simulate\_continuous\_sampling(

    selection\_probability=1 / 3,

    failure\_probability=0.05,

    runs=1000,

    random\_state=0,

)



print(result.state\_summary())



\## Simulate escaped defects



```python

from lotsampling import simulate\_sampling\_escapes



result = simulate\_sampling\_escapes(

    selection\_probability=1 / 3,

    failure\_probability=0.05,

    runs=1000,

    batch\_size=100,

    random\_state=0,

)



print(result.mean\_escapes)

print(result.escape\_rate)



\## Visualize the Markov chain



```python
import matplotlib.pyplot as plt



from lotsampling import plot\_continuous\_sampling\_chain



figure = plot\_continuous\_sampling\_chain(

    selection\_probability=1 / 3,

    failure\_probability=0.05,

)



plt.show()







\## License



MIT

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

lotsampling-0.2.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lotsampling-0.2.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file lotsampling-0.2.0.tar.gz.

File metadata

  • Download URL: lotsampling-0.2.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.0

File hashes

Hashes for lotsampling-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6527f3dc6cffe33beaade5349540e1467c4f52c174d84fccc14b3bb04c151bc9
MD5 a0fb1d6638f2fcddaffbcc95cbe567c3
BLAKE2b-256 8234f8a13c44863fa7d694be285f96e5763c7780e842a1158e45ccca9a103285

See more details on using hashes here.

File details

Details for the file lotsampling-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lotsampling-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.0

File hashes

Hashes for lotsampling-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b77d463c4723e233df0bcd37e02426d0885951313c434651e8cff4dd50c6011a
MD5 c14dcfefcb20a1fe69071c3f4e7931e1
BLAKE2b-256 2b5cbed48c98dc6ce3ff0e2182ed60a6ef560a52efc01343c16f2f7229921e69

See more details on using hashes here.

Supported by

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