Skip to content

Fix analysis_period_length in pre treatments#3280

Merged
scholtzan merged 2 commits into
mainfrom
fix-pre-treatments-analysis-period
Jun 24, 2026
Merged

Fix analysis_period_length in pre treatments#3280
scholtzan merged 2 commits into
mainfrom
fix-pre-treatments-analysis-period

Conversation

@scholtzan

Copy link
Copy Markdown
Collaborator

Fixes #3279

The analysis_period_length was incorrectly passed into the PreTreatment class instance. The parameter was passed before the class got instantiated, effectively overriding the parameter value.

Another bug is that the AnalysisPeriod enum was compared against a string value when setting the analysis_period_length

@scholtzan scholtzan requested a review from mikewilli June 24, 2026 22:00
@scholtzan scholtzan merged commit 5b9eac2 into main Jun 24, 2026
4 checks passed
@scholtzan scholtzan deleted the fix-pre-treatments-analysis-period branch June 24, 2026 22:01
Comment thread jetstream/analysis.py
segment_labels = ["all"] + [s.name for s in self.config.experiment.segments]
analysis_length_dates = 1
if period.value == AnalysisPeriod.OVERALL:
if period == AnalysisPeriod.OVERALL:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh enums can be so annoying in python.

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.

Bug: normalize_over_analysis_period never divides, so per-day normalization is a silent no-op

2 participants