openclimatefix / PVNet

PVnet main repo
MIT License
21 stars 5 forks source link

save validation batch results to wandb #252

Closed peterdudfield closed 2 months ago

peterdudfield commented 2 months ago

Pull Request

Description

Save csv of validation results to weights and biases

This is done by

How Has This Been Tested?

CI tests

import wandb
import pandas as pd

run = wandb.init(
    project="test",
    notes="My first experiment",
)

# make random dataframe
df = pd.DataFrame({
    "a": [1, 2, 3],
    "b": [4, 5, 6]
})

i=2
validation_artifact = wandb.Artifact(f"validation_results_{i}", type="dataset")
df.to_csv(f"validation_results_{i}.csv", index=False)
validation_artifact.add_file(f"validation_results_{i}.csv")
wandb.log_artifact(validation_artifact)

Screenshot 2024-09-05 at 16 15 28

Checklist:

dfulu commented 2 months ago

I think there are a couple of things to sort out, but otherwise looks alright :)

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 94.28571% with 2 lines in your changes missing coverage. Please review.

Project coverage is 59.62%. Comparing base (bdbe00a) to head (156fdfa). Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
pvnet/models/base_model.py 94.28% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #252 +/- ## ========================================== + Coverage 59.00% 59.62% +0.61% ========================================== Files 29 29 Lines 1893 1927 +34 ========================================== + Hits 1117 1149 +32 - Misses 776 778 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.