{"id":4739,"library":"reliability","title":"Reliability Engineering Toolkit for Python","description":"reliability is a Python library for reliability engineering and survival analysis, significantly extending `scipy.stats` functionality. It provides specialist tools for distribution fitting (including censored data and mixture models), survival analysis (Kaplan-Meier, Nelson-Aalen), reliability testing, and physics of failure. The library is actively maintained, with regular updates and improvements.","status":"active","version":"0.9.0","language":"en","source_language":"en","source_url":"https://github.com/MatthewReid854/reliability","tags":["reliability","engineering","survival analysis","statistics","data analysis","weibull","life data"],"install":[{"cmd":"pip install reliability","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core numerical computations and data handling.","package":"numpy","optional":false},{"reason":"Extends `scipy.stats` for statistical distributions and functions.","package":"scipy","optional":false},{"reason":"Required for all plotting functionalities.","package":"matplotlib","optional":false}],"imports":[{"symbol":"Weibull_Distribution","correct":"from reliability.Distributions import Weibull_Distribution"},{"symbol":"Fit_Weibull_2P","correct":"from reliability.Fitters import Fit_Weibull_2P"},{"symbol":"plot_points","correct":"from reliability.Probability_plotting import plot_points"}],"quickstart":{"code":"import matplotlib.pyplot as plt\nfrom reliability.Distributions import Weibull_Distribution\nfrom reliability.Fitters import Fit_Weibull_2P\n\n# Create a Weibull Distribution object\ndist = Weibull_Distribution(alpha=30, beta=2)\n\n# Draw 20 random samples\ndata = dist.random_samples(20, seed=42)\n\nplt.figure(figsize=(10, 5))\nplt.subplot(121)\n# Fit a 2-parameter Weibull Distribution to the samples\nfit = Fit_Weibull_2P(failures=data, show_probability_plot=True)\nplt.title('Weibull Probability Plot')\n\nplt.subplot(122)\n# Plot the survival function from the fitted distribution\nfit.distribution.SF()\nplt.title('Survival Function')\n\nplt.tight_layout()\nplt.show()","lang":"python","description":"This quickstart demonstrates how to create a Weibull distribution, draw random samples, fit a 2-parameter Weibull distribution to the data, and then plot both the probability plot and the survival function using the library's object-oriented approach."},"warnings":[{"fix":"Always refer to the official documentation for the specific version being used. Test code thoroughly after upgrading.","message":"The API and functionality can change significantly between minor versions. For instance, version 0.8.1 is noted to be 'significantly different' from more recent versions. Users should consult the latest documentation when upgrading.","severity":"breaking","affected_versions":"Prior to 0.9.0 (e.g., 0.8.1 to 0.9.0)"},{"fix":"Ensure `import matplotlib.pyplot as plt` is present and `plt.show()` is called to render plots, especially in scripts.","message":"Plotting functions in `reliability` are built upon `matplotlib`. To display plots, you must explicitly import `matplotlib.pyplot` and often call `plt.show()` after generating plots. Expecting plots to appear automatically without this setup is a common mistake.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Embrace the object-oriented design: create a distribution object, then use its methods (e.g., `dist.random_samples()`, `fit.distribution.SF()`).","message":"The library primarily uses an object-oriented paradigm where distributions are first instantiated as objects (e.g., `Weibull_Distribution`), and then methods are called on these objects for operations like sampling, fitting, or plotting. Users accustomed to a purely functional style (like parts of `scipy.stats`) might initially miss this pattern.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}