Skip to content

Commit

Permalink
v0.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewReid854 committed Feb 21, 2023
1 parent 433a5ac commit a4db1d0
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 39 deletions.
11 changes: 11 additions & 0 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
Changelog
---------

**Version: 0.8.8 --- Released: 21 Feb 2023**
''''''''''''''''''''''''''''''''''''''''''''

**Summary of changes**

This is a bugfix release.

**Bug Fixes**

- API changes in matplotlib which deprecated some keywords and axes classes resulted in two serious bugs being introduced into reliability. This has been fixed and the requirements for matplotlib have been updated to >=3.7.0.

**Version: 0.8.7 --- Released: 28 Jan 2023**
''''''''''''''''''''''''''''''''''''''''''''

Expand Down
1 change: 1 addition & 0 deletions reliability/ALT_fitters.py
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,7 @@ def life_func(S1):
right_censored_groups = (
self._Fit_Everything_ALT__Normal_Exponential_params._Fit_Normal_Exponential__right_censored_groups
)

ALT_prob_plot(
dist="Normal",
model="Exponential",
Expand Down
36 changes: 18 additions & 18 deletions reliability/Probability_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ def Weibull_probability_plot(
functions=(axes_transforms.weibull_forward, axes_transforms.weibull_inverse),
)
plt.xscale("log")
plt.grid(b=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(b=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.grid(visible=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(visible=True, which="minor", color="k", alpha=0.08, linestyle="-")
# adjust the figsize. This is done outside of figure creation so that layering of multiple plots is possible
plt.gcf().set_size_inches(9, 9)
if show_fitted_distribution is True:
Expand Down Expand Up @@ -599,8 +599,8 @@ def Loglogistic_probability_plot(
),
)
plt.xscale("log")
plt.grid(b=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(b=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.grid(visible=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(visible=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.gcf().set_size_inches(
9, 9
) # adjust the figsize. This is done outside of figure creation so that layering of multiple plots is possible
Expand Down Expand Up @@ -812,8 +812,8 @@ def Exponential_probability_plot_Weibull_Scale(
functions=(axes_transforms.weibull_forward, axes_transforms.weibull_inverse),
)
plt.xscale("log")
plt.grid(b=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(b=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.grid(visible=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(visible=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.gcf().set_size_inches(
9, 9
) # adjust the figsize. This is done outside of figure creation so that layering of multiple plots is possible
Expand Down Expand Up @@ -978,8 +978,8 @@ def Gumbel_probability_plot(
"function",
functions=(axes_transforms.gumbel_forward, axes_transforms.gumbel_inverse),
)
plt.grid(b=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(b=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.grid(visible=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(visible=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.gcf().set_size_inches(
9, 9
) # adjust the figsize. This is done outside of figure creation so that layering of multiple plots is possible
Expand Down Expand Up @@ -1142,8 +1142,8 @@ def Normal_probability_plot(
"function",
functions=(axes_transforms.normal_forward, axes_transforms.normal_inverse),
)
plt.grid(b=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(b=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.grid(visible=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(visible=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.gcf().set_size_inches(
9, 9
) # adjust the figsize. This is done outside of figure creation so that layering of multiple plots is possible
Expand Down Expand Up @@ -1364,8 +1364,8 @@ def Lognormal_probability_plot(
functions=(axes_transforms.normal_forward, axes_transforms.normal_inverse),
)
plt.xscale("log")
plt.grid(b=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(b=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.grid(visible=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(visible=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.gcf().set_size_inches(
9, 9
) # adjust the figsize. This is done outside of figure creation so that layering of multiple plots is possible
Expand Down Expand Up @@ -1508,8 +1508,8 @@ def Beta_probability_plot(
)

x, y = plotting_positions(failures=failures, right_censored=right_censored, a=a)
plt.grid(b=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(b=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.grid(visible=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(visible=True, which="minor", color="k", alpha=0.08, linestyle="-")
if show_scatter_points is True:
x_scatter, y_scatter = xy_downsample(
x, y, downsample_factor=downsample_scatterplot
Expand Down Expand Up @@ -1757,8 +1757,8 @@ def Gamma_probability_plot(
f_gamma = lambda x: axes_transforms.gamma_forward(x, beta)
fi_gamma = lambda x: axes_transforms.gamma_inverse(x, beta)
plt.gca().set_yscale("function", functions=(f_gamma, fi_gamma))
plt.grid(b=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(b=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.grid(visible=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(visible=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.gcf().set_size_inches(
9, 9
) # adjust the figsize. This is done outside of figure creation so that layering of multiple plots is possible
Expand Down Expand Up @@ -1961,8 +1961,8 @@ def Exponential_probability_plot(
axes_transforms.exponential_inverse,
),
)
plt.grid(b=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(b=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.grid(visible=True, which="major", color="k", alpha=0.3, linestyle="-")
plt.grid(visible=True, which="minor", color="k", alpha=0.08, linestyle="-")
plt.gcf().set_size_inches(
9, 9
) # adjust the figsize. This is done outside of figure creation so that layering of multiple plots is possible
Expand Down
17 changes: 9 additions & 8 deletions reliability/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import numpy as np
import scipy.stats as ss
import matplotlib.pyplot as plt
from matplotlib.axes import SubplotBase
from matplotlib.axes import _axes
from matplotlib.figure import Figure
from matplotlib.collections import PolyCollection, LineCollection
from matplotlib import ticker, colors
Expand Down Expand Up @@ -6482,8 +6482,8 @@ def ALT_prob_plot(
will be the same handle.
"""

if ax is True or issubclass(type(ax), SubplotBase) is True:
if issubclass(type(ax), SubplotBase) is True:
if ax is True or type(ax) == _axes.Axes:
if type(ax) == _axes.Axes:
plt.sca(ax=ax) # use the axes passed
else:
plt.figure() # if no axes is passed, make a new figure
Expand Down Expand Up @@ -6723,7 +6723,7 @@ def life_stress_plot(
else:
swap_xy = False

if ax is True or issubclass(type(ax), SubplotBase) is True:
if ax is True or type(ax) == _axes.Axes:
if model in ["Dual_Exponential", "Power_Exponential", "Dual_Power"]:
dual_stress = True
elif model in ["Exponential", "Eyring", "Power"]:
Expand All @@ -6733,7 +6733,7 @@ def life_stress_plot(
"model must be one of Exponential, Eyring, Power, Dual_Exponential, Power_Exponential, Dual_Power"
)

if issubclass(type(ax), SubplotBase) is True:
if type(ax) == _axes.Axes:
if dual_stress is False:
if hasattr(ax, "get_zlim") is False:
plt.sca(ax=ax) # use the axes passed if 2d
Expand Down Expand Up @@ -7498,17 +7498,18 @@ def reshow_figure(handle):
Parameters
----------
handle : object
The axes handle (type(SubplotBase)) or figure handle (type(Figure))
The axes handle (type(_axes.Axes)) or figure handle (type(Figure))
Returns
-------
None
The figure is automatically shown using plt.show().
"""
if type(handle) is not Figure and issubclass(type(handle), SubplotBase) is False:
type(ax) == _axes.Axes
if type(handle) is not Figure and type(handle) != _axes.Axes:
# check that the handle is either an axes or a figure
raise ValueError("handle must be an axes handle or a figure handle")
elif issubclass(type(handle), SubplotBase) is True:
elif type(handle) == _axes.Axes:
# if the handle is an axes then extract the Figure
handle = handle.figure

Expand Down
2 changes: 1 addition & 1 deletion reliability/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from datetime import date

__title__ = 'reliability'
__version__ = "0.8.7"
__version__ = "0.8.8"
__description__ = 'A Python library for reliability engineering'
__url__ = 'https://reliability.readthedocs.io/en/latest/index.html'
__author__ = 'Matthew Reid'
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
autograd>=1.3
scipy>=1.7.0
numpy>=1.19.2
matplotlib>=3.5.0
pandas>=1.1.2
autograd>=1.4
scipy>=1.10.0
numpy>=1.24.2
matplotlib>=3.7.0
pandas>=1.4.2
autograd-gamma>=0.5.0
mplcursors>=0.3
docutils<0.18
docutils<0.18
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="reliability",
version="0.8.7",
version="0.8.8",
description="Reliability Engineering toolkit for Python",
author="Matthew Reid",
author_email="alpha.reliability@gmail.com",
Expand Down Expand Up @@ -73,11 +73,11 @@
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
],
install_requires=[
"autograd>=1.3",
"scipy>=1.7.0",
"numpy>=1.19.2",
"matplotlib>=3.5.0",
"pandas>=1.1.2",
"autograd>=1.4",
"scipy>=1.10.0",
"numpy>=1.24.2",
"matplotlib>=3.7.0",
"pandas>=1.4.2",
"autograd-gamma>=0.5.0",
"mplcursors>=0.3",
"docutils<0.18"
Expand Down

0 comments on commit a4db1d0

Please sign in to comment.