Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Refactor common.py: Added helper function to reduce code duplication #291

Merged
merged 9 commits into from
Mar 28, 2024

Conversation

roshnaeem
Copy link
Contributor

Pull Request

Description

Added a helper function to reduce code repetition in [open_and_return_data_pipes](https://github.com/openclimatefix/ocf_datapipes/blob/main/ocf_datapipes/training/common.py#L40).

Fixes #279

@roshnaeem roshnaeem requested a review from jacobbieker as a code owner March 26, 2024 03:05
@Sukh-P Sukh-P closed this Mar 26, 2024
@Sukh-P Sukh-P reopened this Mar 26, 2024
@Sukh-P
Copy link
Member

Sukh-P commented Mar 26, 2024

Thanks for working on this. Just an FYI there was something that needed fixing on the main branch to get the CI tests passing so you may need to merge those changes from the main branch in first to get the tests passing on here, overall the changes look good but just want to make sure all the tests are passing first

@roshnaeem roshnaeem requested a review from Sukh-P March 26, 2024 20:12
@Sukh-P Sukh-P closed this Mar 27, 2024
@Sukh-P Sukh-P reopened this Mar 27, 2024
Copy link

codecov bot commented Mar 27, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 76.55%. Comparing base (e85b5a1) to head (f6f2844).
Report is 27 commits behind head on main.

Files Patch % Lines
ocf_datapipes/training/pvnet_site.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
+ Coverage   76.52%   76.55%   +0.02%     
==========================================
  Files         124      125       +1     
  Lines        5875     5912      +37     
==========================================
+ Hits         4496     4526      +30     
- Misses       1379     1386       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -123,7 +123,6 @@ def __init__(self, filenames: List[str], keys: List[str]):

def __iter__(self):
"""Iterate through each filename, loading it, uncombining it, and then yielding it"""
import numpy as np
Copy link
Member

Choose a reason for hiding this comment

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

@jacobbieker just checking this import of numpy here didn't have some specific use and can be removed?

@Sukh-P
Copy link
Member

Sukh-P commented Mar 27, 2024

Tests are passing, nice work :) will approve after the last few small checks, thanks again @roshnaeem!

@roshnaeem
Copy link
Contributor Author

@Sukh-P, done. Happy working with you :))

@Sukh-P Sukh-P closed this Mar 28, 2024
@Sukh-P Sukh-P reopened this Mar 28, 2024
@Sukh-P Sukh-P merged commit ebd8e28 into openclimatefix:main Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce repetition in data source config validation
2 participants