Skip to content

Commit

Permalink
fix: warning implementation (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislemke authored Feb 8, 2023
1 parent 93f6f8a commit f0f11d5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 80 deletions.
69 changes: 6 additions & 63 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ Contributing = "https://github.com/invia-flights/blitzly/blob/main/docs/CONTRIBU
[tool.poetry.dependencies]
python = ">=3.8,<3.12"

plotly = "5.11.0"
plotly = "5.13.0"
pandas = "1.5.2"
numpy = "1.23.5"
nbformat = "5.7.2"
scikit-learn = "1.2.0"
rich = "^13.3.1"

[tool.poetry.group.test.dependencies]
pytest = "^7.2.0"
Expand Down
15 changes: 3 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,12 @@ lazy-object-proxy==1.9.0 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:f12ad7126ae0c98d601a7ee504c1122bcef553d1d5e0c3bfa77b16b3968d2734 \
--hash=sha256:f2457189d8257dd41ae9b434ba33298aec198e30adf2dcdaaa3a28b9994f6adb \
--hash=sha256:f699ac1c768270c9e384e4cbd268d6e67aebcfae6cd623b4d7c3bfde5a35db59
markdown-it-py==2.1.0 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:93de681e5c021a432c63147656fe21790bc01231e0cd2da73626f1aa3ac0fe27 \
--hash=sha256:cf7e59fed14b5ae17c0006eff14a2d9a00ed5f3a846148153899a0224e2c07da
matplotlib-inline==0.1.6 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:f1f41aab5328aa5aaea9b16d083b128102f8712542f819fe7e6a420ff581b311 \
--hash=sha256:f887e5f10ba98e8d2b150ddcf4702c1e5f8b3a20005eb0f74bfdbd360ee6f304
mccabe==0.7.0 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325 \
--hash=sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e
mdurl==0.1.2 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \
--hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba
mypy-extensions==1.0.0 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \
--hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782
Expand Down Expand Up @@ -268,9 +262,9 @@ pkgutil-resolve-name==1.3.10 ; python_version >= "3.8" and python_version < "3.9
platformdirs==3.0.0 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:8a1228abb1ef82d788f74139988b137e78692984ec7b08eaa6c65f1723af28f9 \
--hash=sha256:b1d5eb14f221506f50d6604a561f4c5786d9e80355219694a1b244bcd96f4567
plotly==5.11.0 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:4efef479c2ec1d86dcdac8405b6ca70ca65649a77408e39a7e84a1ea2db6c787 \
--hash=sha256:52fd74b08aa4fd5a55b9d3034a30dbb746e572d7ed84897422f927fdf687ea5f
plotly==5.13.0 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:4ac5db72176ce144f1fcde8d1ef7bdbccf5bb7a53e3d366b16fcd7c85319fdfd \
--hash=sha256:81a3aae4021d5ab91790fc71c3433791f41bfc71586e857f7777f429a955039a
pre-commit==3.0.4 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:9e3255edb0c9e7fe9b4f328cb3dc86069f8fdc38026f1bf521018a05eaf4d67b \
--hash=sha256:bc4687478d55578c4ac37272fe96df66f73d9b5cf81be6f28627d4e712e752d5
Expand Down Expand Up @@ -379,9 +373,6 @@ pyyaml==6.0 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f \
--hash=sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174 \
--hash=sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5
rich==13.3.1 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:125d96d20c92b946b983d0d392b84ff945461e5a06d3867e9f9e575f8697b67f \
--hash=sha256:8aa57747f3fc3e977684f0176a88e789be314a99f99b43b75d1e9cb5dc6db9e9
scikit-learn==1.2.0 ; python_version >= "3.8" and python_version < "3.12" \
--hash=sha256:0834e4cec2a2e0d8978f39cb8fe1cad3be6c27a47927e1774bf5737ea65ec228 \
--hash=sha256:184a42842a4e698ffa4d849b6019de50a77a0aa24d26afa28fa49c9190bb144b \
Expand Down
3 changes: 2 additions & 1 deletion src/blitzly/plots/matrix.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import itertools
import warnings
from typing import Dict, List, Optional, Tuple, Union

import numpy as np
Expand Down Expand Up @@ -216,7 +217,7 @@ def cramers_v_corr_matrix(
)

if all(x == np.object_ for x in list(data.dtypes)) is False:
raise Warning(
warnings.warn(
"""All columns should be from type `object` since the encoding is done internally.
But don't worry. It should work anyway."""
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cases/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ def test_matrix_with_valid_pandas_data(

@staticmethod
def test_matrix_with_numerical_data(cramers_v_corr_matrix_test_numerical_data):
with pytest.raises(Warning) as warning:
with pytest.warns(UserWarning) as warning:
_ = cramers_v_corr_matrix(
cramers_v_corr_matrix_test_numerical_data, show=False
)
assert (
str(warning.value)
str(warning[0].message)
== """All columns should be from type `object` since the encoding is done internally.
But don't worry. It should work anyway."""
)
Expand Down

0 comments on commit f0f11d5

Please sign in to comment.