PVNet 0.0.17__tar.gz → 0.0.19__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PVNet
3
- Version: 0.0.17
3
+ Version: 0.0.19
4
4
  Summary: PVNet
5
5
  Author: Peter Dudfield
6
6
  Author-email: info@openclimatefix.org
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PVNet
3
- Version: 0.0.17
3
+ Version: 0.0.19
4
4
  Summary: PVNet
5
5
  Author: Peter Dudfield
6
6
  Author-email: info@openclimatefix.org
@@ -0,0 +1,2 @@
1
+ """PVNet"""
2
+ __version__ = "0.0.19"
@@ -33,7 +33,6 @@ from ocf_datapipes.utils.utils import stack_np_examples_into_batch
33
33
  from sqlalchemy.orm import Session
34
34
  from torchdata.dataloader2 import DataLoader2, MultiProcessingReadingService
35
35
  from torchdata.datapipes.iter import IterableWrapper
36
- from tqdm import tqdm
37
36
 
38
37
  import pvnet
39
38
  from pvnet.data.datamodule import batch_to_tensor
@@ -66,6 +65,8 @@ batch_size = 10
66
65
  model_name = "openclimatefix/pvnet_v2"
67
66
  model_version = "7cc7e9f8e5fc472a753418c45b2af9f123547b6c"
68
67
 
68
+ model_name_ocf_db = "pvnet_v2"
69
+
69
70
  # ---------------------------------------------------------------------------
70
71
  # LOGGER
71
72
 
@@ -258,7 +259,8 @@ def app(t0=None, apply_adjuster=False, gsp_ids=gsp_ids):
258
259
  normed_preds = []
259
260
 
260
261
  with torch.no_grad():
261
- for batch in tqdm(dataloader, total=int(np.ceil(len(gsp_ids) / batch_size))):
262
+ for i, batch in enumerate(dataloader):
263
+ logger.info(f"Predicting for batch: {i}")
262
264
  # Run batch through model
263
265
  device_batch = copy_batch_to_device(batch_to_tensor(batch), device)
264
266
  preds = model(device_batch).detach().cpu().numpy()
@@ -273,6 +275,7 @@ def app(t0=None, apply_adjuster=False, gsp_ids=gsp_ids):
273
275
  preds[sun_down_mask] = 0
274
276
 
275
277
  normed_preds += [preds]
278
+ logger.info(f"Completed batch: {i}")
276
279
 
277
280
  normed_preds = np.concatenate(normed_preds)
278
281
 
@@ -312,7 +315,7 @@ def app(t0=None, apply_adjuster=False, gsp_ids=gsp_ids):
312
315
  connection = DatabaseConnection(url=os.environ["DB_URL"])
313
316
  with connection.get_session() as session:
314
317
  sql_forecasts = convert_df_to_forecasts(
315
- df, session, model_name=model_name, version=model_version
318
+ df, session, model_name=model_name_ocf_db, version=model_version
316
319
  )
317
320
 
318
321
  save_sql_forecasts(
@@ -1,2 +0,0 @@
1
- """PVNet"""
2
- __version__ = "0.0.17"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes