Skip to content

Commit

Permalink
Merge tag '0.4.0' into develop
Browse files Browse the repository at this point in the history
v0.4.0
  • Loading branch information
milcent committed Apr 25, 2021
2 parents fcba3dc + 5db8764 commit 0c59af2
Show file tree
Hide file tree
Showing 25 changed files with 1,119 additions and 1,348 deletions.
704 changes: 28 additions & 676 deletions LICENSE.txt

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
include README.md
include README.md
include README-pypi.md
include LICENSE.txt
2 changes: 1 addition & 1 deletion README-pypi.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you find *Benford_py* useful in your research, please consider adding the fol

--------------------------------------------------------------------------------

`current version = 0.3.3`
`current version = 0.4.0`

### See [release notes](https://github.com/milcent/benford_py/releases/) for features in this and in older versions

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you find *Benford_py* useful in your research, please consider adding the fol

--------------------------------------------------------------------------------

`current version = 0.3.3`
`current version = 0.4.0`

### See [release notes](https://github.com/milcent/benford_py/releases/) for features in this and in older versions

Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
'''Benfords law module'''
__version__ = "0.3.3"
__version__ = "0.4.0"
2 changes: 1 addition & 1 deletion benford/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@

from .benford import *

__version__ = '0.3.3'
__version__ = '0.4.0'
Binary file modified docs/build/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/modules.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 9ddb3104eab9aa94f5516d4542bf4c48
config: 1ab0e725c448968d4851f0b695542647
tags: 645f666f9bcd5a90fca523b33c5a78b7
432 changes: 282 additions & 150 deletions docs/build/html/_modules/benford/benford.html

Large diffs are not rendered by default.

126 changes: 84 additions & 42 deletions docs/build/html/_modules/benford/expected.html

Large diffs are not rendered by default.

100 changes: 79 additions & 21 deletions docs/build/html/_modules/benford/stats.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@


<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8">
<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>benford.stats &mdash; benford_py 0.3.0 documentation</title>
<title>benford.stats &mdash; benford_py 0.3.3 documentation</title>



<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />








<script type="text/javascript" src="../../_static/js/modernizr.min.js"></script>


<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->


<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/language_data.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>

<script type="text/javascript" src="../../_static/js/theme.js"></script>




<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
</head>
Expand Down Expand Up @@ -71,6 +74,7 @@

</div>


<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">


Expand All @@ -86,6 +90,7 @@


</div>

</div>
</nav>

Expand Down Expand Up @@ -120,11 +125,13 @@





<div role="navigation" aria-label="breadcrumbs navigation">

<ul class="wy-breadcrumbs">

<li><a href="../../index.html">Docs</a> &raquo;</li>
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>

<li><a href="../index.html">Module code</a> &raquo;</li>

Expand All @@ -144,7 +151,7 @@
<div itemprop="articleBody">

<h1>Source code for benford.stats</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">numpy</span> <span class="kn">import</span> <span class="n">sqrt</span>
<span></span><span class="kn">from</span> <span class="nn">numpy</span> <span class="kn">import</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">log</span><span class="p">,</span> <span class="n">where</span>
<span class="kn">from</span> <span class="nn">.constants</span> <span class="kn">import</span> <span class="n">crit_chi2</span><span class="p">,</span> <span class="n">KS_crit</span><span class="p">,</span> <span class="n">mad_dict</span><span class="p">,</span> <span class="n">digs_dict</span>


Expand Down Expand Up @@ -305,26 +312,78 @@ <h1>Source code for benford.stats</h1><div class="highlight"><pre>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">Mean Square Error = </span><span class="si">{</span><span class="n">mse</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>

<span class="k">return</span> <span class="n">mse</span></div>

<span class="k">def</span> <span class="nf">_bhattacharyya_coefficient</span><span class="p">(</span><span class="n">dist_1</span><span class="p">,</span> <span class="n">dist_2</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Computes the Bhattacharyya Coeficient between two probability</span>
<span class="sd"> distributions, to be letar used to compute the Bhattacharyya Distance</span>

<span class="sd"> Args:</span>
<span class="sd"> dist_1 (np.array): The newly gathered distribution, to be compared</span>
<span class="sd"> with an older / established distribution.</span>
<span class="sd"> dist_2 (np.array): The older/ establhished distribution with which</span>
<span class="sd"> the new one will be compared. </span>
<span class="sd"> </span>
<span class="sd"> Returns:</span>
<span class="sd"> bhat_coef (float)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">sqrt</span><span class="p">(</span><span class="n">dist_1</span> <span class="o">*</span> <span class="n">dist_2</span><span class="p">)</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span>


<span class="k">def</span> <span class="nf">_bhattacharyya_distance_</span><span class="p">(</span><span class="n">dist_1</span><span class="p">,</span> <span class="n">dist_2</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Computes the Bhattacharyya Dsitance between two probability</span>
<span class="sd"> distributions</span>

<span class="sd"> Args:</span>
<span class="sd"> dist_1 (np.array): The newly gathered distribution, to be compared</span>
<span class="sd"> with an older / established distribution.</span>
<span class="sd"> dist_2 (np.array): The older/ establhished distribution with which</span>
<span class="sd"> the new one will be compared. </span>
<span class="sd"> </span>
<span class="sd"> Returns:</span>
<span class="sd"> bhat_dist (float)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="o">-</span><span class="n">log</span><span class="p">(</span><span class="n">_bhattacharyya_coefficient</span><span class="p">(</span><span class="n">dist_1</span><span class="p">,</span> <span class="n">dist_2</span><span class="p">))</span>


<span class="k">def</span> <span class="nf">_kullback_leibler_divergence_</span><span class="p">(</span><span class="n">dist_1</span><span class="p">,</span> <span class="n">dist_2</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Computes the Kullback-Leibler Divergence between two probability</span>
<span class="sd"> distributions.</span>

<span class="sd"> Args:</span>
<span class="sd"> dist_1 (np.array): The newly gathered distribution, to be compared</span>
<span class="sd"> with an older / established distribution.</span>
<span class="sd"> dist_2 (np.array): The older/ establhished distribution with which</span>
<span class="sd"> the new one will be compared. </span>

<span class="sd"> Returns:</span>
<span class="sd"> kulb_leib_diverg (float) </span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">(</span><span class="n">log</span><span class="p">((</span><span class="n">dist_1</span> <span class="o">/</span> <span class="n">dist_2</span><span class="p">),</span> <span class="n">where</span><span class="o">=</span><span class="p">(</span><span class="n">dist_1</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">))</span> <span class="o">*</span> <span class="n">dist_1</span><span class="p">)</span><span class="o">.</span><span class="n">sum</span><span class="p">()</span>
</pre></div>

</div>

</div>
<footer>


<hr/>

<div role="contentinfo">
<p>
&copy; Copyright 2020, Marcel Milcent
&#169; Copyright 2020, Marcel Milcent.

</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.



Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a

<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>

provided by <a href="https://readthedocs.org">Read the Docs</a>.

</footer>

</div>
</div>

Expand All @@ -333,7 +392,6 @@ <h1>Source code for benford.stats</h1><div class="highlight"><pre>
</div>



<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
Expand Down
51 changes: 31 additions & 20 deletions docs/build/html/_modules/benford/viz.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@


<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8">
<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>benford.viz &mdash; benford_py 0.3.0 documentation</title>
<title>benford.viz &mdash; benford_py 0.3.3 documentation</title>



<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />










<script type="text/javascript" src="../../_static/js/modernizr.min.js"></script>
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->


<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../_static/jquery.js"></script>
<script type="text/javascript" src="../../_static/underscore.js"></script>
<script type="text/javascript" src="../../_static/doctools.js"></script>
<script type="text/javascript" src="../../_static/language_data.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>

<script type="text/javascript" src="../../_static/js/theme.js"></script>




<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
</head>
Expand Down Expand Up @@ -71,6 +74,7 @@

</div>


<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">


Expand All @@ -86,6 +90,7 @@


</div>

</div>
</nav>

Expand Down Expand Up @@ -120,11 +125,13 @@





<div role="navigation" aria-label="breadcrumbs navigation">

<ul class="wy-breadcrumbs">

<li><a href="../../index.html">Docs</a> &raquo;</li>
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>

<li><a href="../index.html">Module code</a> &raquo;</li>

Expand Down Expand Up @@ -465,20 +472,25 @@ <h1>Source code for benford.viz</h1><div class="highlight"><pre>

</div>
<footer>


<hr/>

<div role="contentinfo">
<p>
&copy; Copyright 2020, Marcel Milcent
&#169; Copyright 2020, Marcel Milcent.

</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.



Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a

<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>

provided by <a href="https://readthedocs.org">Read the Docs</a>.

</footer>

</div>
</div>

Expand All @@ -487,7 +499,6 @@ <h1>Source code for benford.viz</h1><div class="highlight"><pre>
</div>



<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
Expand Down

0 comments on commit 0c59af2

Please sign in to comment.