Skip to content
Merged
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/weathergen/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,16 @@ def create(self) -> "Model":
"Empty forecast engine (fe_num_blocks = 0), but forecast_steps[i] > 0 for some i"
)

self.forecast_engine = ForecastingEngine(cf, self.num_healpix_cells)
if cf.fe_diffusion_model:
# check if diffusion mode is enabled
fe_diffusion_model = cf.get("fe_diffusion_model", False)
if fe_diffusion_model:
self.forecast_engine = DiffusionForecastEngine(
forecast_engine=ForecastingEngine(
cf, self.num_healpix_cells, forecast_engine=self.forecast_engine
)
)
else:
self.forecast_engine = ForecastingEngine(
cf, self.num_healpix_cells, forecast_engine=self.forecast_engine
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for taking long to inspect this. Can we please change the above code to

        self.forecast_engine = ForecastingEngine(cf, self.num_healpix_cells)
        if cf.get("fe_diffusion_model", False):
            self.forecast_engine = DiffusionForecastEngine(
                forecast_engine=ForecastingEngine(
                     cf, self.num_healpix_cells, forecast_engine=self.forecast_engine
                )
            )

Then we will first create the deterministic forecast engine (which we will need in any case) and optionally wrap it by the diffusion engine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :)


Expand Down