From e933f16f2e4bb3d2e91a2e8a2ceea87c5320d0c2 Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 7 Jul 2020 17:36:05 +0100 Subject: [PATCH 1/3] Update matplotlib style to ING theme --- popmon/visualization/utils.py | 4 +++- requirements-test.txt | 2 +- requirements.txt | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/popmon/visualization/utils.py b/popmon/visualization/utils.py index 4fe36247..3a6411d7 100644 --- a/popmon/visualization/utils.py +++ b/popmon/visualization/utils.py @@ -26,10 +26,12 @@ import numpy as np import pandas as pd import pybase64 +from ing_theme_matplotlib import mpl_style NUM_NS_DAY = 24 * 3600 * int(1e9) logger = logging.getLogger() +mpl_style(dark=False) def plt_to_base64(): @@ -76,7 +78,7 @@ def plot_bars_b64(data, labels=None, bounds=None, ylim=False, skip_empty=True): index = np.arange(n) width = (index[1] - index[0]) * 0.9 if n >= 2 else 1.0 - ax.bar(index, data, width=width, align="center", alpha=0.5) + ax.bar(index, data, width=width, align="center") if labels: ax.set_xticks(index) diff --git a/requirements-test.txt b/requirements-test.txt index 27aa7832..ac78bb5d 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -5,4 +5,4 @@ nbconvert>=5.3.1 jupyter_client>=5.2.3 ipykernel>=5.1.3 black>=19.10b0 -isort>=4.3.21 +isort==4.3.21 diff --git a/requirements.txt b/requirements.txt index be57962b..a1b6812b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ matplotlib>=2.2.3 joblib>=0.14.0 pybase64>=1.0.1 htmlmin +ing_theme_matplotlib From 464a8d8cd2a17f53980cc2fa4e6def175cc87f6e Mon Sep 17 00:00:00 2001 From: Tomas Date: Tue, 7 Jul 2020 23:41:51 +0100 Subject: [PATCH 2/3] Add pip install popmon command at the beginning of nbs --- .../notebooks/popmon_tutorial_advanced.ipynb | 36 ++++++++++----- popmon/notebooks/popmon_tutorial_basic.ipynb | 46 +++++++++++-------- .../popmon_tutorial_incremental_data.ipynb | 25 ++++++---- 3 files changed, 70 insertions(+), 37 deletions(-) diff --git a/popmon/notebooks/popmon_tutorial_advanced.ipynb b/popmon/notebooks/popmon_tutorial_advanced.ipynb index b970be97..29a8fc8c 100644 --- a/popmon/notebooks/popmon_tutorial_advanced.ipynb +++ b/popmon/notebooks/popmon_tutorial_advanced.ipynb @@ -14,18 +14,32 @@ { "cell_type": "code", "execution_count": null, - "outputs": [], - "source": [ - "from IPython.core.display import display, HTML\n", - "display(HTML(\"\"))\n", - "display(HTML(\"\"))" - ], "metadata": { "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, "pycharm": { "name": "#%%\n" } - } + }, + "outputs": [], + "source": [ + "from IPython.core.display import display, HTML\n", + "display(HTML(\"\"))\n", + "display(HTML(\"\"))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# install popmon (if not installed yet)\n", + "import sys\n", + "!{sys.executable} -m pip install popmon" + ] }, { "cell_type": "code", @@ -400,7 +414,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.7.7" }, "nteract": { "version": "0.15.0" @@ -408,13 +422,13 @@ "pycharm": { "stem_cell": { "cell_type": "raw", - "source": [], "metadata": { "collapsed": false - } + }, + "source": [] } } }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/popmon/notebooks/popmon_tutorial_basic.ipynb b/popmon/notebooks/popmon_tutorial_basic.ipynb index 49ef3631..d4a0a8ff 100644 --- a/popmon/notebooks/popmon_tutorial_basic.ipynb +++ b/popmon/notebooks/popmon_tutorial_basic.ipynb @@ -14,6 +14,15 @@ { "cell_type": "code", "execution_count": null, + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "pycharm": { + "name": "#%%\n" + } + }, "outputs": [], "source": [ "# (optional) Adjust the jupyter notebook style for easier navigation of the reports\n", @@ -22,13 +31,7 @@ "display(HTML(\"\"))\n", "# Cells are higher by default\n", "display(HTML(\"\"))" - ], - "metadata": { - "collapsed": false, - "pycharm": { - "name": "#%%\n" - } - } + ] }, { "cell_type": "markdown", @@ -40,9 +43,18 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "scrolled": false - }, + "metadata": {}, + "outputs": [], + "source": [ + "# install popmon (if not installed yet)\n", + "import sys\n", + "!{sys.executable} -m pip install popmon" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", @@ -93,9 +105,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "scrolled": false - }, + "metadata": {}, "outputs": [], "source": [ "# generate report based on histograms\n", @@ -177,18 +187,18 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.7.7" }, "pycharm": { "stem_cell": { "cell_type": "raw", - "source": [], "metadata": { "collapsed": false - } + }, + "source": [] } } }, "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file + "nbformat_minor": 4 +} diff --git a/popmon/notebooks/popmon_tutorial_incremental_data.ipynb b/popmon/notebooks/popmon_tutorial_incremental_data.ipynb index e8b588b6..344d8281 100644 --- a/popmon/notebooks/popmon_tutorial_incremental_data.ipynb +++ b/popmon/notebooks/popmon_tutorial_incremental_data.ipynb @@ -36,9 +36,18 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "scrolled": false - }, + "metadata": {}, + "outputs": [], + "source": [ + "# install popmon (if not installed yet)\n", + "import sys\n", + "!{sys.executable} -m pip install popmon" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", @@ -432,18 +441,18 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.7.7" }, "pycharm": { "stem_cell": { "cell_type": "raw", - "source": [], "metadata": { "collapsed": false - } + }, + "source": [] } } }, "nbformat": 4, - "nbformat_minor": 2 -} \ No newline at end of file + "nbformat_minor": 4 +} From ab266ce32693c9f7ea05fdebbcb5ade85c4a5124 Mon Sep 17 00:00:00 2001 From: Tomas Date: Wed, 8 Jul 2020 10:15:10 +0100 Subject: [PATCH 3/3] Version bump and changelog --- CHANGES.rst | 5 +++++ docs/source/readme.rst | 2 +- popmon/version.py | 4 ++-- setup.py | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 9e4cd4f6..16779e19 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,11 @@ Release notes ============= +Version 0.3.7, July 2020 +------------------------ +* Using ``ING``'s matplotlib style for the report plots (orange plots). +* Add ``popmon`` installation command at the beginning of example notebooks (seamless running). + Version 0.3.6, July 2020 ------------------------ * Extending make.bat and Makefile to support ``make install`` (on all platforms). diff --git a/docs/source/readme.rst b/docs/source/readme.rst index 3d9feb92..5ce42691 100644 --- a/docs/source/readme.rst +++ b/docs/source/readme.rst @@ -4,7 +4,7 @@ Population Shift Monitoring |build| |docs| -* Version: 0.3.6. Released: July 2020 +* Version: 0.3.7. Released: July 2020 * Documentation: https://popmon.readthedocs.io * Repository: https://github.com/ing-bank/popmon * Authors: ING Wholesale Banking Advanced Analytics diff --git a/popmon/version.py b/popmon/version.py index 26d2f7b7..ef7b7ce3 100644 --- a/popmon/version.py +++ b/popmon/version.py @@ -1,6 +1,6 @@ """THIS FILE IS AUTO-GENERATED BY SETUP.PY.""" name = "popmon" -version = "0.3.6" -full_version = "0.3.6" +version = "0.3.7" +full_version = "0.3.7" release = True diff --git a/setup.py b/setup.py index 210ce85e..7c627576 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ MAJOR = 0 REVISION = 3 -PATCH = 6 +PATCH = 7 DEV = False # NOTE: also update version at: README.rst