Commit 9cda32b2 authored by Cynthia Crowley's avatar Cynthia Crowley

Rewrite conditional syntax

parent ab5f8cdd
......@@ -136,8 +136,8 @@ def run_lsm(workspace: DefaultWorkspace, static: Static, *,
def time_integrate(workspace: DefaultWorkspace,
integrated_stats: Dict[str, List[str]],
forcing: bool,
*,
forcing: bool,
yearmon: str,
target: Optional[str]=None,
window: Optional[int]=None,
......@@ -154,18 +154,12 @@ def time_integrate(workspace: DefaultWorkspace,
window_observed = months
window_forecast = []
prev = [workspace.forcing(yearmon=x, window=1) for x in window_observed] + \
[workspace.forcing(yearmon=yearmon,
member=member,
target=x,
window=1) for x in window_forecast] if forcing else [workspace.results(yearmon=x,
window=1,
basis=basis) for x in window_observed] + \
[workspace.results(yearmon=yearmon,
member=member,
target=x,
window=1,
basis=basis) for x in window_forecast]
if forcing:
prev = [workspace.forcing(yearmon=x, window=1) for x in window_observed] + \
[workspace.forcing(yearmon=yearmon, member=member, target=x, window=1) for x in window_forecast]
else:
prev = [workspace.results(yearmon=x, window=1, basis=basis) for x in window_observed] + \
[workspace.results(yearmon=yearmon, member=member, target=x, window=1, basis=basis) for x in window_forecast]
return [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment