Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Issue/217 data source configs #255

Merged
merged 12 commits into from
Oct 22, 2021
Merged

Conversation

peterdudfield
Copy link
Contributor

@peterdudfield peterdudfield commented Oct 20, 2021

Pull Request

Description

  • Change configuration to be more module on each input data source
  • add default forecast minutes and historic minutes

Warning this is a break change for the confiiguration model

Fixes #217

How Has This Been Tested?

  • Unittest

  • ran prepare_ml_data.py script dummy run, ot check it works

  • No

  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

@peterdudfield peterdudfield marked this pull request as ready for review October 22, 2021 07:24
Copy link
Member

@JackKelly JackKelly left a comment

Choose a reason for hiding this comment

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

This is looking really good! Thank you!

And a really nice and elegant implementation of the default_history_minutes thing, too!

One way in which this change could make our code considerably simpler is if the names of the config fields precisely align with the argument names in the DataSource constructor.

So, for example, in the config model, we could change nwp_channels and satellite_channels to just channels. Or, alternatively, we could change the DataSource subclasses... specifically, we could change SatDataSource and NWPDataSource to take the arguments satellite_channels and nwp_channels. (I'd probably slightly lean towards the second option, because I like the verbose and explicit field names that you've chosen for the config fields! Although I'm very happy to be persuaded otherwise! Changing the DataSource sub-class constructor arguments could be a subsequent PR, though 🙂 )

Thanks again!

history_minutes=config.input_data.default_history_minutes, #: Number of minutes of history, not including t0.
forecast_minutes=config.input_data.default_forecast_minutes, #: Number of minutes of forecast.
satellite_image_size_pixels=config.input_data.satellite.satellite_image_size_pixels,
nwp_image_size_pixels=config.input_data.nwp.nwp_image_size_pixels,
nwp_channels=NWP_VARIABLE_NAMES,
Copy link
Member

Choose a reason for hiding this comment

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

The value of these consts also needs changing near the top of this file, I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, they do - thank you

@peterdudfield
Copy link
Contributor Author

This is looking really good! Thank you!

And a really nice and elegant implementation of the default_history_minutes thing, too!

One way in which this change could make our code considerably simpler is if the names of the config fields precisely align with the argument names in the DataSource constructor.

So, for example, in the config model, we could change nwp_channels and satellite_channels to just channels. Or, alternatively, we could change the DataSource subclasses... specifically, we could change SatDataSource and NWPDataSource to take the arguments satellite_channels and nwp_channels. (I'd probably slightly lean towards the second option, because I like the verbose and explicit field names that you've chosen for the config fields! Although I'm very happy to be persuaded otherwise! Changing the DataSource sub-class constructor arguments could be a subsequent PR, though 🙂 )

Thanks again!

Yea I would vote to keep the variables verbose, and change the DataSource in a subsequence PR. What do you think?

Thanks for your comments

PR comments from Jack - thanks

Co-authored-by: Jack Kelly <[email protected]>
@JackKelly
Copy link
Member

Yea I would vote to keep the variables verbose, and change the DataSource in a subsequence PR. What do you think?

Sounds good to me! Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Tweak the way DataSources are represented in the Configuration model
2 participants