Skip to content

Commit 5d05010

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 53e5172 + afe297c commit 5d05010

141 files changed

Lines changed: 40792 additions & 31523 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
2020
echo "TAGGED_MILESTONE=${{ github.event.pull_request.milestone.title }}" >> $GITHUB_ENV
21-
- uses: actions/checkout@v6
21+
- uses: actions/checkout@v7
2222
with:
2323
fetch-depth: '0'
2424
- name: Check the changelog entry

.github/workflows/check_stub_files_diff.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v6
18-
- uses: prefix-dev/setup-pixi@v0.9.6
17+
- uses: actions/checkout@v7
18+
- uses: prefix-dev/setup-pixi@v0.10.0
1919
with:
20-
pixi-version: v0.59.0
20+
pixi-version: v0.68.0
2121
frozen: true
2222

2323
- name: Check stub file for `_data_ops.py` is up-to-date

.github/workflows/run-code-format-checks.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v6
18-
- uses: prefix-dev/setup-pixi@v0.9.6
17+
- uses: actions/checkout@v7
18+
- uses: prefix-dev/setup-pixi@v0.10.0
1919
with:
20-
pixi-version: v0.59.0
20+
pixi-version: v0.68.0
2121
frozen: true
2222

2323
- name: Run tests

.github/workflows/test-javascript.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
test:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v6
16-
- uses: prefix-dev/setup-pixi@v0.9.6
15+
- uses: actions/checkout@v7
16+
- uses: prefix-dev/setup-pixi@v0.10.0
1717
with:
18-
pixi-version: v0.59.0
18+
pixi-version: v0.68.0
1919
environments: ci-py314-latest-optional-deps
2020
# we can freeze the environment and manually bump the dependencies to the
2121
# latest version time to time.

.github/workflows/testing.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
- ci-py314-polars-without-pyarrow
2525
runs-on: ${{ matrix.os }}
2626
steps:
27-
- uses: actions/checkout@v6
28-
- uses: prefix-dev/setup-pixi@v0.9.6
27+
- uses: actions/checkout@v7
28+
- uses: prefix-dev/setup-pixi@v0.10.0
2929
with:
30-
pixi-version: v0.59.0
30+
pixi-version: v0.68.0
3131
environments: ${{ matrix.environment }}
3232
# we can freeze the environment and manually bump the dependencies to the
3333
# latest version time to time.
@@ -37,7 +37,7 @@ jobs:
3737
- name: Run user guide doctests
3838
run: pixi run -e ${{ matrix.environment }} test-user-guide
3939
- name: Upload coverage reports to Codecov
40-
uses: codecov/codecov-action@v6.0.1
40+
uses: codecov/codecov-action@v7.0.0
4141
with:
4242
token: ${{ secrets.CODECOV_TOKEN }}
4343
slug: skrub-data/skrub
@@ -47,7 +47,7 @@ jobs:
4747
outputs:
4848
run: ${{ github.event_name == 'schedule' || contains(steps.get_head_commit_message.outputs.COMMIT_MSG, '[deps nightly]') }}
4949
steps:
50-
- uses: actions/checkout@v6
50+
- uses: actions/checkout@v7
5151
with:
5252
ref: ${{ github.event.pull_request.head.sha }}
5353
- id: get_head_commit_message
@@ -60,10 +60,10 @@ jobs:
6060
runs-on: ubuntu-latest
6161
name: Test against nightly dependencies
6262
steps:
63-
- uses: actions/checkout@v6
64-
- uses: prefix-dev/setup-pixi@v0.9.6
63+
- uses: actions/checkout@v7
64+
- uses: prefix-dev/setup-pixi@v0.10.0
6565
with:
66-
pixi-version: v0.59.0
66+
pixi-version: v0.68.0
6767
environments: ci-nightly-deps
6868
# we can freeze the environment and manually bump the dependencies to the
6969
# latest version time to time.

.github/workflows/update_pixi_lock_files.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
fail-fast: false
2222

2323
steps:
24-
- uses: actions/checkout@v6
25-
- uses: prefix-dev/setup-pixi@v0.9.6
24+
- uses: actions/checkout@v7
25+
- uses: prefix-dev/setup-pixi@v0.10.0
2626
with:
27-
pixi-version: v0.59.0
27+
pixi-version: v0.68.0
2828
run-install: false
2929

3030
- name: Remove the current lock file

CHANGES.rst

Lines changed: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ Ongoing development
1111

1212
New Features
1313
------------
14+
- :func:`set_config` and :func:`config_context` now accept a
15+
``table_report_n_rows`` parameter to globally control the default number of
16+
rows displayed in :class:`TableReport`.
17+
:pr:`2193` by :user:`Mann <m4nn2609-dot>`.
18+
- :meth:`TableReport.dict` now allows exporting the report data as a Python
19+
dictionary. :pr:`2188` by :user:`m4nn2609-dot <m4nn2609-dot>`.
20+
- New methods :meth:`SkrubLearner.get_named_params` and
21+
:meth:`SkrubLearner.set_named_params` allow getting and setting the outcomes for
22+
choices contained in the DataOp, keyed by choice name. It provides a more
23+
robust way of transferring selected hyperparameters from one DataOp to a
24+
different one than :meth:`SkrubLearner.get_params` and
25+
:meth:`SkrubLearner.set_params`.
26+
:pr:`2090` by :user:`Jérôme Dockès <jeromedockes>`.
1427
- A parameter ``becomes_default`` has been added to :func:`var`. It allows
1528
indicating that the provided preview ``value`` should also be treated as a
1629
default value for this variable in all contexts (for example in a
@@ -24,25 +37,92 @@ New Features
2437
:meth:`DataOp.skb.eval`, :meth:`SkrubLearner.predict`, etc., or in
2538
:meth:`DataOp.skb.find` or :meth:`SkrubLearner.truncated_after`. :pr:`2062` by
2639
:user:`Jérôme Dockès <jeromedockes>`.
40+
- The :class:`SessionEncoder` is now available. This encoder adds a `session_id`
41+
column, which groups together events that occur within the given session gap.
42+
Additionally, it is possible to provide a ``split_by`` column or list of columns
43+
(e.g., user ID or (user ID, user device)) to compute sessions for each grouping
44+
value.
45+
:pr:`1930` by :user:`Riccardo Cappuzzo <rcap107>`.
46+
- A new synthetic dataset generator for timestamped data and session-based
47+
operations has been added: :meth:`~skrub.datasets.make_retail_events`.
48+
:pr:`1930` by :user:`Riccardo Cappuzzo <rcap107>`.
49+
- The :class:`DropSimilar` transformer has been added, for removing columns in a
50+
dataframe that present high correlation with other columns. :pr:`2023` by
51+
:user:`Eloi Massoulié <emassoulie>`.
52+
- :class:`ToFloat32` now allows users to specify ``decimal`` and ``thousand``
53+
separators to parse numerical columns that use formatting different from the default
54+
formatting used in Python, such as ``1'234,5``.
55+
Additionally, negative numbers indicated with parentheses can be converted to the
56+
regular numeric format (``(432)`` becomes ``-432``). :pr:`1772` by :user:`Gabriela
57+
Gómez Jiménez <gabrielapgomezji>`.
58+
- :meth:`TableReport.json` now includes histogram data for numeric and datetime
59+
columns (the bin count and edges, and numbers of low and high outliers). Now
60+
``json()`` contains all the information shown in the report html rendering,
61+
including the plots. :pr:`2164` by :user:`Jérôme Dockès <jeromedockes>`.
62+
- Added :func:`skrub.selectors.object` to select columns with the ``object``
63+
(pandas) or ``pl.Object`` (polars) dtype. :pr:`2171` by :user:`Omkar Kabde
64+
<omkar-334>`.
65+
- :meth:`ParamSearch.plot_results` and :meth:`OptunaParamSearch.plot_results`
66+
accept new parameters ``show_scores``, ``show_choices``, and ``show_times`` to
67+
control respectively which scores, choices (params), and times (fit or score
68+
durations) should be included in the figure. :pr:`2202` by :user:`Jérôme
69+
Dockès <jeromedockes>`.
2770

2871
Changes
2972
-------
73+
- Grouped Examples into subject-specific sections. :pr:`2102` by
74+
:user:`Maureen Githaiga <maureen-githaiga>`.
75+
- :meth:`choose_from` now transparently converts `outcomes` to a list when it is
76+
another type of sequence. :pr:`2100` by :user:`aidbar <aidbar>`.
3077
- An unnecessary warning that was raised when passing a numpy array to the
3178
TableVectorizer has been removed. :pr:`1908` by
3279
:user:`Sandrine Henry <sandrineh>`.
3380
- Improving the association tab error message when only one column is present
3481
:pr:`2094` by :user:`Alicja Kosak <AlicjaKo>`.
3582
- Added support for numpy arrays in :meth:`DataOp.skb.concat`.
3683
:pr:`2096` by :user:`Ayesha Siddiqua <siddiqua-tamk>`.
84+
- The :class:`TableReport` can now be exported in markdown format with ``.markdown``.
85+
:pr:`2048` by :user:`Riccardo Cappuzzo <rcap107>`.
86+
- The minimum required version of matplotlib has been increased from 3.4.3 to 3.6.1.
87+
:pr:`2159` by :user:`Riccardo Cappuzzo <rcap107>`.
88+
- :meth:`SkrubLearner.score` has been enhanced when the DataOp used
89+
:meth:`DataOp.skb.with_scoring`. During scoring, predict(), predict_proba()
90+
etc. are cached to avoid recomputation when multiple scorers are used (or one
91+
scorer calls them several times). Moreover it is possible to pass
92+
``return_predictions=True`` to also retrieve any predictions that have been
93+
computed during scoring, in addition to the scores. Finally, in cases where we
94+
already have the predictions but want the result of score() without
95+
recomputing them, it is possible to provide them in the environment passed to
96+
``score({..., "_skrub_predictions": {"predict_proba": ...}})``.
97+
:pr:`2195` by :user:`Jérôme Dockès <jeromedockes>`.
98+
- :meth:`SkrubLearner.find_fitted_estimator` now supports searching for the
99+
apply node by ID or callable predicate as alternatives to the node name.
100+
:pr:`2194` by :user:`Jérôme Dockès <jeromedockes>`.
101+
37102
Bugfixes
38103
--------
104+
- :class:`MinHashEncoder` with the default ``hashing="fast"`` now uses every
105+
n-gram size in ``ngram_range`` (the upper bound is inclusive, as documented
106+
and as already done by ``hashing="murmur"``). Previously the largest size was
107+
dropped, so the default ``ngram_range=(2, 4)`` ignored 4-grams and a
108+
single-size range such as ``(3, 3)`` produced the same constant encoding for
109+
every string. :pr:`2168` by :user:`José Maia <glitch-ux>`.
39110
- A bug in how the :class:`TableVectorizer` and :class:`Cleaner` treated columns
40111
duration columns in pandas and polars has been fixed. Now, both classes convert
41112
durations to the total number of seconds (with fractional part). This is done
42113
by the new transformer :class:`DurationToFloat`. :pr:`2069` by
43114
:user:`Riccardo Cappuzzo <rcap107>`.
44-
45-
115+
- An error that could arise when running ``TableReport`` on dataframes containing
116+
double dollar (``$$``) signs has been fixed.
117+
:pr:`2154` by :user:`Katerina Michenina <Michenina-Lab>`,
118+
:user:`CecilyTS <CecilyTS>`, :user:`Eve Rabin <eve2705>`.
119+
- An error that happened when running ``TableReport`` or ``column_associations``
120+
on some dataframes with non-string column names has been fixed in :pr:`2179`
121+
by :user:`Jérôme Dockès <jeromedockes>`.
122+
- An error that could arise in histograms when running :class:`TableReport` on
123+
data with a very small range (less than 10 representable floating-point
124+
numbers between min and max) has been fixed.
125+
:pr:`2189` by :user:`Jérôme Dockès <jeromedockes>`.
46126

47127
Deprecations
48128
------------
@@ -78,6 +158,9 @@ New Features
78158
- A new dataframe generator, :func:`datasets.toy_cities`, has been added for
79159
use cases on dataframes with variable sizes and variable correlation between
80160
columns. :pr:`2042` by :user:`Eloi Massoulié <emassoulie>`.
161+
- A new selector function, :func:`selectors.drop`, has been added to drop columns
162+
from a dataframe using a selector. It mirrors the behavior of :func:`selectors.select`.
163+
:pr:`2108` by :user:`Mary Njoroge <Maryahcee>`.
81164

82165
Changes
83166
-------
@@ -114,6 +197,9 @@ Changes
114197
<jeromedockes>`.
115198
- The ``exclude_cols`` of :meth:`DataOp.skb.apply` can now be a DataOp.
116199
:pr:`2050` by :user:`Jérôme Dockès <jeromedockes>`.
200+
- Skrub estimators now correctly show links to the documentation in the HTML
201+
representation that is generated for notebooks. :pr:`2036` by :user:`Riccardo
202+
Cappuzzo <rcap107>`.
117203

118204
Bugfixes
119205
--------
@@ -161,6 +247,9 @@ New Features
161247
- :func:`selectors.has_nulls` now takes a ``proportion`` parameter, which allows
162248
selecting columns that have a fraction of null values above the given threshold.
163249
:pr:`1881` by :user:`Gabriela Gómez Jiménez <gabrielapgomezji>`.
250+
- Added a new dataset, :func:`fetch_electricity_usage`, which contains electricity usage data
251+
for several French cities and corresponding weather data.
252+
:pr:`2013` by :user:`Lisa McBride<lisaleemcb>`.
164253

165254

166255
Changes

doc/Makefile

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,47 @@ html:
2828
# the embedding of images more robust
2929
rm -rf $(BUILDDIR)/html/_images
3030
#rm -rf _build/doctrees/
31-
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
31+
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -D markdown_uri_doc_suffix="html.md" -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
32+
# Build markdown sources so llms.txt links point to .md files
33+
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -D markdown_uri_doc_suffix="html.md" -b markdown $(ALLSPHINXOPTS) $(BUILDDIR)/markdown
34+
cp -r $(BUILDDIR)/markdown/. $(BUILDDIR)/html/_sources/
3235
@echo
3336
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
3437

3538
html-noplot:
36-
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
39+
SKB_TABLE_REPORT_VERBOSITY=0 SKIP_JUPYTERLITE=1 $(SPHINXBUILD) -D markdown_uri_doc_suffix="html.md" -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
40+
# Build markdown sources so llms.txt links point to .md files
41+
SKB_TABLE_REPORT_VERBOSITY=0 SKIP_JUPYTERLITE=1 $(SPHINXBUILD) -D markdown_uri_doc_suffix="html.md" -D plot_gallery=0 -b markdown $(ALLSPHINXOPTS) $(BUILDDIR)/markdown
42+
cp -r $(BUILDDIR)/markdown/. $(BUILDDIR)/html/_sources/
43+
@echo
44+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
45+
46+
html-quick:
47+
# Only build the HTML pages, skipping the markdown build and copying of sources
48+
SKB_TABLE_REPORT_VERBOSITY=0 SKIP_JUPYTERLITE=1 $(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
3749
@echo
3850
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
3951

4052
linkcheck:
41-
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
53+
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
4254
@echo
4355
@echo "Linkcheck finished. Results are in $(BUILDDIR)/linkcheck."
4456

4557
linkcheck-noplot:
46-
$(SPHINXBUILD) -D plot_gallery=0 -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck-noplot
58+
SKB_TABLE_REPORT_VERBOSITY=0 SKIP_JUPYTERLITE=1 $(SPHINXBUILD) -D plot_gallery=0 -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck-noplot
4759
@echo
4860
@echo "Linkcheck (no plot) finished. Results are in $(BUILDDIR)/linkcheck-noplot."
4961

62+
markdown:
63+
SKB_TABLE_REPORT_VERBOSITY=0 $(SPHINXBUILD) -b markdown $(ALLSPHINXOPTS) $(BUILDDIR)/markdown
64+
@echo
65+
@echo "Markdown build finished. The markdown files are in $(BUILDDIR)/markdown."
66+
67+
markdown-noplot:
68+
SKB_TABLE_REPORT_VERBOSITY=0 SKIP_JUPYTERLITE=1 $(SPHINXBUILD) -D plot_gallery=0 -b markdown $(ALLSPHINXOPTS) $(BUILDDIR)/markdown
69+
@echo
70+
@echo "Markdown build (no plot) finished. The markdown files are in $(BUILDDIR)/markdown."
71+
5072
# Catch-all target: route all unknown targets to Sphinx using the new
5173
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
5274
%: Makefile

doc/_templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ <h5 class="feature-title">Inspect it, apply it to new data</h5>
152152
</div>
153153
<p class="feature-text-see-also">
154154
<!-- name of the userguide file on DataOps -->
155-
<a href="{{ pathto('auto_tutorials/1110_data_ops_intro') }}">Discover the skrub DataOps →</a>
155+
<a href="{{ pathto('data_ops') }}">Discover the skrub DataOps →</a>
156156
</p>
157157
</div>
158158
<div class="col-md-7">

0 commit comments

Comments
 (0)