Skip to content

Comments

fix(calculator): require explicit data argument and remove fallback s…#167

Open
sanskar0627 wants to merge 1 commit intom-lab:mainfrom
sanskar0627:fix/calculator-require-data-v2
Open

fix(calculator): require explicit data argument and remove fallback s…#167
sanskar0627 wants to merge 1 commit intom-lab:mainfrom
sanskar0627:fix/calculator-require-data-v2

Conversation

@sanskar0627
Copy link

@sanskar0627 sanskar0627 commented Feb 20, 2026

Fix #166
This PR updates the calculator API to require explicit input data when computing IQB scores and removes the implicit fallback sample behavior.


Problem

calculate_iqb_score previously accepted missing data and silently used an internal sample payload.

This could:

  • Hide caller mistakes
  • Produce scores from placeholder values
  • Conflict with the intent to remove default sample-based scoring

What Changed

calculator.py

  • calculate_iqb_score now requires the data argument
  • Removed the internal fallback sample data block
  • Kept print_details behavior unchanged (out of scope for this PR)

calculator_test.py

  • Tests now pass explicit sample input instead of relying on implicit defaults
  • Updated related test wording for accuracy

Why This Is Important

  • Makes the API contract explicit and safer
  • Prevents accidental scoring with non-production placeholder data
  • Improves correctness
  • Surfaces integration failures earlier

All Test Passed

@bassosimone
Copy link
Collaborator

After listing our project for GSoC, we received a large amount of pull requests across several repositories. We are dealing with the backlog, but this would take time. We will get back to this pull request eventually. In the meanwhile, if you are a GSoC applicant, please read our updated GSoC policy: https://github.com/m-lab/gsoc/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require explicit data input in IQBCalculator and remove implicit fallback sample

2 participants