{"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":"python","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,"search_vec":"'aalen':41 'activ':51 'analysi':16,35,61,64 'censor':29 'data':30,63,67 'distribut':26 'engin':2,13,59 'extend':18 'failur':47 'fit':27 'function':20 'improv':57 'includ':28 'kaplan':37 'kaplan-mei':36 'librari':10,49 'life':66 'maintain':52 'meier':38 'mixtur':32 'model':33 'nelson':40 'nelson-aalen':39 'physic':45 'provid':22 'python':5,9 'regular':54 'reliabl':1,6,12,42,58 'scipy.stats':19 'signific':17 'specialist':23 'statist':62 'surviv':15,34,60 'test':43 'tool':24 'toolkit':3 'updat':55 'weibul':65","created_at":"2026-04-12T14:05:32.540229+00:00","updated_at":"2026-04-17T14:33:05.934158+00:00","problems":[{"fix":"pip install reliability","cause":"The 'reliability' library is not installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'reliability'"},{"fix":"Ensure all input arrays for fitting functions are non-empty, 1D arrays containing only numeric (float or integer) values.","cause":"A distribution fitting function (e.g., Fit_Weibull_2P) received empty arrays or arrays with non-numeric data for its required inputs like 'failures' or 'right_censored'.","error":"ValueError: Failures and suspensions arrays must be 1D arrays of floats or integers. Cannot be empty."},{"fix":"Access only 'alpha' and 'beta' for a 2-parameter Weibull fit. If a 3-parameter fit including 'gamma' is needed, use `reliability.Fit_Weibull_3P`.","cause":"You attempted to access the 'gamma' (location) parameter from a 2-parameter Weibull distribution fit object, which only provides 'alpha' (scale) and 'beta' (shape).","error":"AttributeError: 'Fitted_Weibull_Distribution_2P' object has no attribute 'gamma'"},{"fix":"Ensure that the 'alpha' (scale) and 'beta' (shape) parameters for distribution objects are positive numbers.","cause":"When initializing a distribution object directly (e.g., Weibull_Distribution), the provided 'alpha' (scale) parameter was zero or negative.","error":"ValueError: The alpha (scale) parameter must be greater than zero."},{"fix":"from reliability.Fitters import Fit_Weibull_2P","cause":"You attempted to import a class or function as if it were a module, rather than importing it from its correct submodule (e.g., `reliability.Fitters`).","error":"ModuleNotFoundError: No module named 'reliability.Fit_Weibull_2P'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.9.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://reliability.readthedocs.io/en/latest/","github":"https://github.com/MatthewReid854/reliability","docs":"https://reliability.readthedocs.io/en/latest/","changelog":null,"pypi":"https://pypi.org/project/reliability/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}