Skip to content

Commit

Permalink
Merge branch 'develop' into fix/table-selection-placement
Browse files Browse the repository at this point in the history
  • Loading branch information
fabclmnt authored Aug 12, 2024
2 parents e68af96 + c2b81e5 commit 83cad02
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ statsmodels>=0.13.2, <1
# type checking
typeguard>=3, <5
imagehash==4.3.1
wordcloud>=1.9.1
wordcloud>=1.9.3
dacite>=1.8
numba>=0.56.0, <1
4 changes: 0 additions & 4 deletions src/ydata_profiling/compare_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ def _compare_profile_report_preprocess(
config.html.style.primary_colors
)

# enforce same types
for report in reports[1:]:
report._typeset = reports[0].typeset

# Obtain description sets
descriptions = [report.get_description() for report in reports]
for label, description in zip(labels, descriptions):
Expand Down
7 changes: 4 additions & 3 deletions src/ydata_profiling/visualisation/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,13 +592,14 @@ def plot_timeseries_gap_analysis(
label=label,
color=color,
alpha=0.65,
x_compat=True,
)
_format_ts_date_axis(serie, ax)
ax.yaxis.set_major_locator(MaxNLocator(integer=True))
for gap in gaps_:
ax.fill_between(x=gap, y1=min_, y2=max_, color=color, alpha=0.25)
else:
series.plot(ax=ax)
series.plot(ax=ax, x_compat=True)
_format_ts_date_axis(series, ax)
ax.yaxis.set_major_locator(MaxNLocator(integer=True))

Expand Down Expand Up @@ -677,11 +678,11 @@ def _plot_timeseries(
colors = create_comparison_color_list(config)

for serie, color, label in zip(series, colors, labels):
ax = serie.plot(color=color, label=label, alpha=0.75)
ax = serie.plot(color=color, label=label, alpha=0.75, x_compat=True)
_format_ts_date_axis(serie, ax)

else:
ax = series.plot(color=config.html.style.primary_colors[0])
ax = series.plot(color=config.html.style.primary_colors[0], x_compat=True)
_format_ts_date_axis(series, ax)

return plot
Expand Down
27 changes: 27 additions & 0 deletions tests/issues/test_issue1631.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
Test for issue 1631:
https://github.com/ydataai/ydata-profiling/issues/1631
"""
import pandas as pd

from ydata_profiling import ProfileReport


def test_issue1631(test_output_dir):
data = {
"value": [1, 2, 3, 4],
"datetime": [
"2022-10-01 00:10:00",
"2022-10-02 00:20:00",
"2022-10-03 00:30:00",
"2022-10-04 00:40:00",
],
}
df = pd.DataFrame(data)
df["datetime"] = pd.to_datetime(df["datetime"], errors="raise")
df.set_index("datetime", inplace=True)
profile = ProfileReport(df, tsmode=True, type_schema={"value": "timeseries"})
output_file = test_output_dir / "issue1631.html"
profile.to_file(output_file)

assert output_file.exists()
File renamed without changes.

0 comments on commit 83cad02

Please sign in to comment.