Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor config #214

Merged
merged 30 commits into from
Jul 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e759397
refactor: replace eval with callable
sbrugman Jun 2, 2022
10f2abd
refactor: remove worst traffic light
sbrugman Jun 2, 2022
38d7b08
refactor: removed outdated plots for TL/alerts
sbrugman Jun 2, 2022
0a47eaf
refactor: various minor cleanups
sbrugman Jun 2, 2022
38f58d0
fix(plot): plot_heatmap_b64 `top` argument is now supported
sbrugman Jun 2, 2022
2247e94
refactor: use defaultdict in utils
sbrugman Jun 14, 2022
18ad2dd
perf: reduce file size of reports
sbrugman Jun 14, 2022
11b70ec
refactor: prevent warnings dtype
sbrugman Jun 15, 2022
7caa68c
ci: ensure that api docs are up-to-date
sbrugman Jun 27, 2022
9ea128b
feat(config): structured config using pydantic
sbrugman Jun 2, 2022
2611440
feat(registry): add ks, pearson, chi2 to registry
sbrugman Jun 27, 2022
aa26e91
refactor(config): update configuration in pipelines
sbrugman Jun 27, 2022
81dd7b8
feat(registry): generalize registry
sbrugman Jun 27, 2022
c0e8d0f
test(registry): profiles and comparisons
sbrugman Jun 2, 2022
5cb5fad
test(config): update configuration in tests
sbrugman Jun 27, 2022
bc7402c
chore: update notebooks
sbrugman Jun 27, 2022
d46e805
chore: update example syntax
sbrugman Jun 21, 2022
cda0315
chore: remove outdated and redundant tree
sbrugman Jun 15, 2022
5a6cb2f
docs(config): update configuration examples
sbrugman Jun 15, 2022
2b01a7f
docs(registry): instructions on comparison parameter setting
sbrugman Jun 2, 2022
ea7bd9f
docs(config): configuration parameter docstrings
sbrugman Jun 27, 2022
8ed0c60
docs: update api documentation
sbrugman Jun 27, 2022
e6acf28
feat(config): settings required parameter
sbrugman Jun 28, 2022
3c6ce5e
fix: guaranteed ordering of traffic light metrics
sbrugman Jun 28, 2022
9dc4e6e
feat: keep section when changing features
sbrugman Jun 28, 2022
5e369ff
feat: string representation for base classes
sbrugman Jun 28, 2022
1532239
test: string representation base classes
sbrugman Jun 28, 2022
6f94c9f
fix: set time_width in synthetic data example
sbrugman Jun 28, 2022
3ad3534
refactor: make test robust against floating point
sbrugman Jun 28, 2022
22fc0c6
ci: enable qa on jupyter notebooks
sbrugman Jun 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,17 @@ repos:
rev: v1.12.1
hooks:
- id: blacken-docs
- repo: local
hooks:
- id: docautogenerate
name: docsautogenerate
entry: bash -c 'cd ./docs/ && bash autogenerate.sh'
language: system
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.3.1
hooks:
- id: nbqa-black
- id: nbqa-pyupgrade
args: ['--py36-plus']
- id: nbqa-isort
args: ['--profile=black']
16 changes: 16 additions & 0 deletions docs/source/comparisons.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,19 @@ The code below demonstrates how this could be achieved:
return np.sum(np.abs(p - q))

If you developed a custom comparison that could be generically used, then please considering contributing it to the package.

Comparison settings
-------------------

Whenever a comparison has parameters, it is possible to alter them globally:

.. code-block:: python

from functools import partial

from popmon.analysis.comparison.comparison_registry import Comparisons

# Set the max_res_bound to 5 (default 7) for the chi2 comparison function
Comparisons.update_func(
"chi2", partial(Comparisons.get_func("chi2"), max_res_bound=5.0)
)
21 changes: 17 additions & 4 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,22 @@ in four different ways:

.. code-block:: python

settings = Settings()
settings.comparison.window = 10
settings.comparison.shift = 1

# generate stability report with specific monitoring rules
report = df.pm_stability_report(reference_type="rolling", window=10, shift=1)
report = df.pm_stability_report(reference_type="rolling", settings=settings)

4. Using an expanding window on all preceding time slots within the same DataFrame. This is also a dynamic method, with variable window size. All the available previous time slots are used. For example, if we have 2 time slots available and shift=1, window size will be 1 (so the previous slot is the reference), while if we have 10 time slots and shift=1, window size will be 9 (and all previous time slots are reference).

.. code-block:: python

settings = Settings()
settings.comparison.shift = 1

# generate stability report with specific monitoring rules
report = df.pm_stability_report(reference_type="expanding", shift=1)
report = df.pm_stability_report(reference_type="expanding", settings=settings)

Note that, by default, popmon also performs a rolling comparison of the histograms in each time period with those in the
previous time period. The results of these comparisons contain the term "prev1", and are found in the comparisons section
Expand Down Expand Up @@ -111,8 +118,11 @@ When generating a report, they can be provided as a dictionary:

.. code-block:: python

settings = Settings()
settings.monitoring.monitoring_rules = your_monitoring_rules

# generate stability report with specific monitoring rules
report = df.pm_stability_report(monitoring_rules=your_monitoring_rules)
report = df.pm_stability_report(settings=settings)

When not provided, the default setting is:

Expand Down Expand Up @@ -168,8 +178,11 @@ When generating a report, the ``pull_rules`` can be provided as a dictionary:

.. code-block:: python

settings = Settings()
settings.monitoring.pull_rules = your_pull_rules

# generate stability report with specific monitoring rules
report = df.pm_stability_report(pull_rules=your_pull_rules)
report = df.pm_stability_report(settings=settings)

The default for `pull_rules` is:

Expand Down
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Contents
comparisons
tutorials
configuration
tree
developing
changelog

Expand Down
1 change: 0 additions & 1 deletion docs/source/popmon.alerting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ popmon.alerting.compute\_tl\_bounds module
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
9 changes: 8 additions & 1 deletion docs/source/popmon.analysis.comparison.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ popmon.analysis.comparison package
Submodules
----------

popmon.analysis.comparison.comparisons module
---------------------------------------------

.. automodule:: popmon.analysis.comparison.comparisons
:members:
:undoc-members:
:show-inheritance:

popmon.analysis.comparison.hist\_comparer module
------------------------------------------------

Expand All @@ -12,7 +20,6 @@ popmon.analysis.comparison.hist\_comparer module
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
9 changes: 8 additions & 1 deletion docs/source/popmon.analysis.profiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ popmon.analysis.profiling.hist\_profiler module
:undoc-members:
:show-inheritance:

popmon.analysis.profiling.profiles module
-----------------------------------------

.. automodule:: popmon.analysis.profiling.profiles
:members:
:undoc-members:
:show-inheritance:

popmon.analysis.profiling.pull\_calculator module
-------------------------------------------------

Expand All @@ -20,7 +28,6 @@ popmon.analysis.profiling.pull\_calculator module
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
2 changes: 1 addition & 1 deletion docs/source/popmon.analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Subpackages
-----------

.. toctree::
:maxdepth: 4

popmon.analysis.comparison
popmon.analysis.profiling
Expand Down Expand Up @@ -44,7 +45,6 @@ popmon.analysis.merge\_statistics module
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
7 changes: 7 additions & 0 deletions docs/source/popmon.base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ popmon.base.pipeline module
:undoc-members:
:show-inheritance:

popmon.base.registry module
---------------------------

.. automodule:: popmon.base.registry
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------
Expand Down
29 changes: 29 additions & 0 deletions docs/source/popmon.decorators.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
popmon.decorators package
=========================

Submodules
----------

popmon.decorators.pandas module
-------------------------------

.. automodule:: popmon.decorators.pandas
:members:
:undoc-members:
:show-inheritance:

popmon.decorators.spark module
------------------------------

.. automodule:: popmon.decorators.spark
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: popmon.decorators
:members:
:undoc-members:
:show-inheritance:
53 changes: 0 additions & 53 deletions docs/source/popmon.hist.filling.rst
Original file line number Diff line number Diff line change
@@ -1,59 +1,6 @@
popmon.hist.filling package
===========================

Submodules
----------

popmon.hist.filling.histogram\_filler\_base module
--------------------------------------------------

.. automodule:: popmon.hist.filling.histogram_filler_base
:members:
:undoc-members:
:show-inheritance:

popmon.hist.filling.make\_histograms module
-------------------------------------------

.. automodule:: popmon.hist.filling.make_histograms
:members:
:undoc-members:
:show-inheritance:
:noindex:

popmon.hist.filling.numpy\_histogrammar module
----------------------------------------------

.. automodule:: popmon.hist.filling.numpy_histogrammar
:members:
:undoc-members:
:show-inheritance:

popmon.hist.filling.pandas\_histogrammar module
-----------------------------------------------

.. automodule:: popmon.hist.filling.pandas_histogrammar
:members:
:undoc-members:
:show-inheritance:

popmon.hist.filling.spark\_histogrammar module
----------------------------------------------

.. automodule:: popmon.hist.filling.spark_histogrammar
:members:
:undoc-members:
:show-inheritance:

popmon.hist.filling.utils module
--------------------------------

.. automodule:: popmon.hist.filling.utils
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
16 changes: 4 additions & 12 deletions docs/source/popmon.hist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Subpackages
-----------

.. toctree::
:maxdepth: 4

popmon.hist.filling

Expand All @@ -19,23 +20,14 @@ popmon.hist.hist\_splitter module
:undoc-members:
:show-inheritance:

popmon.hist.histogram module
----------------------------
popmon.hist.hist\_utils module
------------------------------

.. automodule:: popmon.hist.histogram
.. automodule:: popmon.hist.hist_utils
:members:
:undoc-members:
:show-inheritance:

popmon.hist.patched\_histogrammer module
----------------------------------------

.. automodule:: popmon.hist.patched_histogrammer
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
1 change: 0 additions & 1 deletion docs/source/popmon.io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ popmon.io.json\_reader module
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
1 change: 0 additions & 1 deletion docs/source/popmon.pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ popmon.pipeline.report\_pipelines module
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
11 changes: 10 additions & 1 deletion docs/source/popmon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ Subpackages
-----------

.. toctree::
:maxdepth: 4

popmon.alerting
popmon.analysis
popmon.base
popmon.decorators
popmon.hist
popmon.io
popmon.pipeline
Expand All @@ -35,6 +37,14 @@ popmon.resources module
:undoc-members:
:show-inheritance:

popmon.utils module
-------------------

.. automodule:: popmon.utils
:members:
:undoc-members:
:show-inheritance:

popmon.version module
---------------------

Expand All @@ -43,7 +53,6 @@ popmon.version module
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
1 change: 0 additions & 1 deletion docs/source/popmon.stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ popmon.stats.numpy module
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
1 change: 0 additions & 1 deletion docs/source/popmon.stitching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ popmon.stitching.hist\_stitcher module
:undoc-members:
:show-inheritance:


Module contents
---------------

Expand Down
Loading