Skip to content

Commit

Permalink
bugfixes for 0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewReid854 committed Oct 26, 2021
1 parent 6f5844a commit 14aab2e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 15 deletions.
18 changes: 16 additions & 2 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,25 @@ Changelog

**Bug Fixes**

- Crosshairs returned the labels as a float which resulted in numbers like 10.0 rather than 10 when decimals=0. The labels are now converted to int when decimals=0 so they will indeed return zero decimals when told to.

**Other**

- Added a documentation section (Reliability Theory) which explains how some important algorithms work

**Version: 0.7.1 --- Released 26 Oct 2021**
'''''''''''''''''''''''''''''''''''''''''''

**Summary of changes**

This is primarily a bugfix release to deal with some minor bugs.

**Bug Fixes**

- Other_functions.crosshairs returned the labels as a float which resulted in numbers like 10.0 rather than 10 when decimals=0. The labels are now converted to int when decimals=0 so they will indeed return zero decimals when told to.
- PP_plot_parametric, PP_plot_semiparametric, QQ_plot_parametric, and QQ_plot_semiparametric all had a bug that would cause complete failure. This bug was caused by incorporating an argument that didn't exist. Further details in `this issue <https://github.com/MatthewReid854/reliability/issues/23>`_.

**Other**

- Added a documentation section (Reliability Theory) which explains how some important algorithms work.
- Made Fit_Everything more tolerant of different names to exclude distributions. For example to exclude the Weibull_CR model, users may type "Weibull_CR", "CR", "Weibull_Competing_Risks", "Competing Risks" and many more variations.

**Version: 0.7.0 --- Released: 8 Oct 2021**
Expand Down
8 changes: 6 additions & 2 deletions docs/Development roadmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ Development roadmap
The following development roadmap is the current task list and implementation plan for the Python reliability library.
I welcome the addition of new suggestions, both large and small, as well as help with writing the code if you feel that you have the ability.
This roadmap is regularly changing and you may see some things remain on here for a while without progressing, while others may be prioritized at short notice.
If you have a suggested feature or you find a bug, please raise an `Issue <https://github.com/MatthewReid854/reliability/issues>`_ on Github or email me (alpha.reliability@gmail.com) and I will endeavour to either add it rapidly (for simple tasks and bug fixes) or add it to the roadmap.
The current release schedule is approximately every 6 to 8 weeks.
If you have something to add:

- new features - please send me an email (alpha.reliability@gmail.com) or fill out the `feedback form <https://form.jotform.com/203156856636058>`_.
- bugs - please send me an email (alpha.reliability@gmail.com) or raise an `Issue <https://github.com/MatthewReid854/reliability/issues>`_ on Github.

The current release schedule is approximately every 6 to 8 weeks for minor releases, and rapidly (within the day) for bug fixes.

**Planned for version 0.8.0 (around Dec 2021)**

Expand Down
26 changes: 17 additions & 9 deletions reliability/Probability_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -2085,11 +2085,13 @@ def PP_plot_parametric(
dist_X_CDF = X_dist.CDF(xvals=xvals, show_plot=False)
dist_Y_CDF = Y_dist.CDF(xvals=xvals, show_plot=False)

if show_scatter_points is True:
if downsample_scatterplot is not False:
x_scatter, y_scatter = xy_downsample(
dist_X_CDF, dist_Y_CDF, downsample_factor=downsample_scatterplot
)
plt.scatter(x_scatter, y_scatter, marker=marker, color=color)
else:
x_scatter, y_scatter = dist_X_CDF, dist_Y_CDF
plt.scatter(x_scatter, y_scatter, marker=marker, color=color)

# this creates the labels for the axes using the parameters of the distributions
X_label_str = str(X_dist.name + " CDF (" + X_dist.param_title + ")")
Expand Down Expand Up @@ -2245,11 +2247,13 @@ def QQ_plot_parametric(
dist_X_ISF = np.array(dist_X_ISF)
dist_Y_ISF = np.array(dist_Y_ISF)

if show_scatter_points is True:
if downsample_scatterplot is not False:
x_scatter, y_scatter = xy_downsample(
dist_X_ISF, dist_Y_ISF, downsample_factor=downsample_scatterplot
)
plt.scatter(x_scatter, y_scatter, marker=marker, color=color)
else:
x_scatter, y_scatter = dist_X_ISF, dist_Y_ISF
plt.scatter(x_scatter, y_scatter, marker=marker, color=color)

# fit lines and generate text for equations to go in legend
max_value = max(max(dist_X_ISF), max(dist_Y_ISF))
Expand Down Expand Up @@ -2461,11 +2465,13 @@ def PP_plot_semiparametric(

CDF = Y_dist.CDF(X_data_failures, show_plot=False)

if show_scatter_points is True:
if downsample_scatterplot is not False:
x_scatter, y_scatter = xy_downsample(
ecdf, CDF, downsample_factor=downsample_scatterplot
)
plt.scatter(x_scatter, y_scatter, marker=marker, color=color)
else:
x_scatter, y_scatter = ecdf, CDF
plt.scatter(x_scatter, y_scatter, marker=marker, color=color)

Y_label_str = str(Y_dist.name + " CDF (" + Y_dist.param_title + ")")
plt.ylabel(Y_label_str)
Expand Down Expand Up @@ -2599,6 +2605,7 @@ def QQ_plot_semiparametric(
marker = kwargs.pop("marker")
else:
marker = "."

if method == "KM":
KM = KaplanMeier(
failures=X_data_failures,
Expand Down Expand Up @@ -2643,14 +2650,15 @@ def QQ_plot_semiparametric(
for q in ecdf:
dist_Y_ISF.append(Y_dist.inverse_SF(float(q)))
dist_Y_ISF = np.array(dist_Y_ISF[::-1])

dist_Y_ISF[dist_Y_ISF == -np.inf] = 0

if show_scatter_points is True:
if downsample_scatterplot is not False:
x_scatter, y_scatter = xy_downsample(
X_data_failures, dist_Y_ISF, downsample_factor=downsample_scatterplot
)
plt.scatter(x_scatter, y_scatter, marker=marker, color=color)
else:
x_scatter, y_scatter = X_data_failures, dist_Y_ISF
plt.scatter(x_scatter, y_scatter, marker=marker, color=color)

plt.ylabel(
str(
Expand Down
2 changes: 1 addition & 1 deletion reliability/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from reliability import Convert_data

__title__ = 'reliability'
__version__ = "0.8.0"
__version__ = "0.7.1"
__description__ = 'A Python library for reliability engineering'
__url__ = 'https://reliability.readthedocs.io/en/latest/index.html'
__author__ = 'Matthew Reid'
Expand Down
2 changes: 1 addition & 1 deletion 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.0",
version="0.7.1",
description="Reliability Engineering toolkit for Python",
author="Matthew Reid",
author_email="alpha.reliability@gmail.com",
Expand Down

0 comments on commit 14aab2e

Please sign in to comment.