Skip to content

Conversation

@dfulu
Copy link
Member

@dfulu dfulu commented Jan 16, 2026

Pull Request

Description

This adds the option to use the t0-embedding features which were added to data-sampler in openclimatefix/ocf-data-sampler#385 in PVNet

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

embedding_dim=None,
include_sun=False,
include_time=True,
t0_embedding_dim=3,
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be my lack of understanding, but is it obvious how know the t0_embedding_dim from the t0_embedding embedding (below)?

Copy link
Member Author

@dfulu dfulu Jan 16, 2026

Choose a reason for hiding this comment

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

Well in the function docstring it explains that the embedding_dim parameter is for the location ID. We could rename embedding_dim->loc_embedding_dim or something similar to be more explicit. But for that we'd need to migrate all our production models

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh sorry, I think I misunderstood your question. You mean how can you know what the t0_embedding_dim needs to be given t0_embedding config? That info is in data-sampler.

Basically:

t0_embedding_dim = sum([1 if e=="linear" else 2 for e in t0_embedding.embeddings])

Copy link
Contributor

Choose a reason for hiding this comment

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

ah i see, could you put this comment in the docstrings? (Or if there somewhere else more suitable)

Copy link
Member Author

Choose a reason for hiding this comment

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

This feels like bloat here since it is explained in full in data-sampler

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe a compromise is to put the explanation in the example config

@peterdudfield
Copy link
Contributor

Other than my questions, this looks good and clear

@dfulu dfulu requested a review from peterdudfield January 19, 2026 17:59
@dfulu dfulu merged commit a455125 into main Jan 19, 2026
6 checks passed
@dfulu dfulu deleted the use_t0_embedding branch January 19, 2026 18:23
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.

3 participants