Skip to content

[Repo Assist] fix(refuters): correct num_simulations in DataSubsetRefuter log message - #1750

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/fix-data-subset-refuter-log-and-n-jobs-20260813-e2a0321184058f38
Draft

[Repo Assist] fix(refuters): correct num_simulations in DataSubsetRefuter log message#1750
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/fix-data-subset-refuter-log-and-n-jobs-20260813-e2a0321184058f38

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This is an automated PR from Repo Assist, an AI assistant for this repository.

Problem

refute_data_subset() in data_subset_refuter.py logged a misleading message:

logger.info(
    "Refutation over {} simulated datasets of size {} each".format(
        subset_fraction, subset_fraction * len(data.index)   # ← bug: subset_fraction ≠ count
    )
)

The first {} was filled with subset_fraction (e.g. 0.8), producing nonsensical output like:

Refutation over 0.8 simulated datasets of size 800.0 each

Compare the identical message in bootstrap_refuter.py:218 which correctly uses num_simulations as the first argument.

Fix

Swap the first positional argument from subset_fraction to num_simulations:

logger.info(
    "Refutation over {} simulated datasets of size {} each".format(
        num_simulations, subset_fraction * len(data.index)   # ← fixed
    )
)

This now produces the intended message, e.g.:

Refutation over 100 simulated datasets of size 800.0 each

Root Cause

Copy-paste from bootstrap_refuter.py, where both size-related variables are positional. In data_subset_refuter.py the two variables have different semantic roles and subset_fraction was accidentally kept in the first slot.

Changes

  • dowhy/causal_refuters/data_subset_refuter.py: one-line fix (line 122)

Test Status

⚠️ Infrastructure limitation: dev dependencies are not installed in this CI environment, so tests could not be run. The change is a single-argument swap in a logger.info() call with no logic impact. The existing tests/test_causal_refuters.py exercises DataSubsetRefuter and will confirm no regressions in CI.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@11c9a2c442e519ff2b427bf58679f5a525353f76

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@11c9a2c442e519ff2b427bf58679f5a525353f76

The log line in refute_data_subset() read:

    'Refutation over {subset_fraction} simulated datasets of size {N} each'

where subset_fraction (e.g. 0.8) was inadvertently passed as the first
format argument instead of num_simulations (e.g. 100). Compare the
corresponding message in bootstrap_refuter.py which correctly formats
num_simulations first.

Fix: swap the first positional argument from subset_fraction to
num_simulations so the message reads correctly, e.g.:
    'Refutation over 100 simulated datasets of size 800.0 each'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation bug Something isn't working repo-assist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants