[Repo Assist] fix(refuters): correct num_simulations in DataSubsetRefuter log message - #1750
Draft
github-actions[bot] wants to merge 1 commit into
Conversation
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>
85 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated PR from Repo Assist, an AI assistant for this repository.
Problem
refute_data_subset()indata_subset_refuter.pylogged a misleading message:The first
{}was filled withsubset_fraction(e.g.0.8), producing nonsensical output like:Compare the identical message in
bootstrap_refuter.py:218which correctly usesnum_simulationsas the first argument.Fix
Swap the first positional argument from
subset_fractiontonum_simulations:This now produces the intended message, e.g.:
Root Cause
Copy-paste from
bootstrap_refuter.py, where both size-related variables are positional. Indata_subset_refuter.pythe two variables have different semantic roles andsubset_fractionwas accidentally kept in the first slot.Changes
dowhy/causal_refuters/data_subset_refuter.py: one-line fix (line 122)Test Status
logger.info()call with no logic impact. The existingtests/test_causal_refuters.pyexercisesDataSubsetRefuterand will confirm no regressions in CI.