Skip to content

Commit 23d8ecc

Browse files
viktoriiasThe Meridian Authors
authored andcommitted
Always proccess specs including full time range in MMM UI proto generator.
PiperOrigin-RevId: 871894699
1 parent e23bcf2 commit 23d8ecc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

scenarioplanner/mmm_ui_proto_generator.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def __call__(self) -> mmm_pb.Mmm:
125125

126126
copy_specs = []
127127
for spec in self._input_specs:
128-
if not any(isinstance(spec, t) for t in _ALLOWED_SPEC_TYPES_FOR_UI):
128+
if not isinstance(spec, tuple(_ALLOWED_SPEC_TYPES_FOR_UI)):
129129
raise ValueError(f"Unsupported spec type: {spec.__class__.__name__}")
130130

131131
if isinstance(spec, bop.BudgetOptimizationSpec):
@@ -153,11 +153,7 @@ def __call__(self) -> mmm_pb.Mmm:
153153

154154
sub_specs = []
155155
for spec in copy_specs:
156-
to_create_subspecs = self._time_breakdown_generators and any(
157-
isinstance(spec, t) for t in _SPEC_TYPES_CREATE_SUBSPECS
158-
)
159-
160-
if to_create_subspecs:
156+
if isinstance(spec, tuple(_SPEC_TYPES_CREATE_SUBSPECS)):
161157
dates = self._enumerate_dates_open_end(spec)
162158
sub_specs.extend(
163159
_create_subspecs(spec, dates, self._time_breakdown_generators)

0 commit comments

Comments
 (0)