Repository: AllenDowney/empiricaldist (language: python)

Issue:
Repo Maintenance
Professor, first of all, want to thank you for the numerous high quality resources you create for free. Your material has made statistics stick in a way that numerous undergraduate + graduate classes could not.

I am reviewing Think Bayes and was thinking of adding type annotations to this project, but wanted to clear out some low-hanging fruit on the repository. These were mostly mechanical changes which I hope are not too contentious.

High level:
- ran black code formatter (recently hit 1.0 and adopted by Django project)
- ran isort to sort imports
- Changed all file references to the license to be BSD as per the license file
- Removed references to "empyricaldist"


Discussion / hints:
This looks good to me. I also noticed that the current version in setup.py is 0.5.0, but there have been several PyPI releases since 0.5.0. The current version is 0.6.3

https://pypi.org/project/empiricaldist/#history
This PR already addresses some of the feedback in the review from the conda-forge PR https://github.com/conda-forge/staged-recipes/pull/18851

I think it would be easier to fix these issues in this repo and then release a new version to PyPI.

@AllenDowney could you please review this PR? Once a decision has been made on it, I can open a subsequent one to address the other issues raised
This looks good. But no type annotations, please!

I will run my tests on this version and call it 0.6.5

Fix patch:
diff --git a/empiricaldist/empiricaldist.py b/empiricaldist/empiricaldist.py
index bb16b00..db337cd 100644
--- a/empiricaldist/empiricaldist.py
+++ b/empiricaldist/empiricaldist.py
@@ -13,6 +13,7 @@
 BSD 3-clause license: https://opensource.org/licenses/BSD-3-Clause
 """
 
+import matplotlib.pyplot as plt
 import numpy as np
 import pandas as pd
 from scipy.interpolate import interp1d
diff --git a/setup.py b/setup.py
index 9dac1f7..e54a80b 100644
--- a/setup.py
+++ b/setup.py
@@ -11,11 +11,11 @@ def readme():
 
 setup(
     name="empiricaldist",
-    version="0.6.6",
+    version="0.6.7",
     author="Allen B. Downey",
     author_email="downey@allendowney.com",
     packages=["empiricaldist"],
-    requires=["numpy", "pandas", "scipy"],
+    requires=["matplotlib", "numpy", "pandas", "scipy"],
     url="https://github.com/AllenDowney/empiricaldist",
     license="BSD-3-Clause",
     description="Python library that represents empirical distributions.",


Test patch:
diff --git a/empiricaldist/test_empiricaldist.py b/empiricaldist/test_empiricaldist.py
index d7fb1d6..6dfe6f0 100644
--- a/empiricaldist/test_empiricaldist.py
+++ b/empiricaldist/test_empiricaldist.py
@@ -666,6 +666,15 @@ def testCopy(self):
         for x in cdf.qs:
             self.assertAlmostEqual(cdf[x], cdf2[x])
 
+    def testPlotting(self):
+        t = [1, 2, 2, 3, 5]
+
+        pmf = Pmf.from_seq(t)
+        pmf.bar()
+
+        haz = Hazard.from_seq(t)
+        haz.bar()
+
 
 if __name__ == "__main__":
     unittest.main()