Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 24, 2023
1 parent 4ab7641 commit a256ad7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/save_batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from torch.utils.data import DataLoader
from torch.utils.data.datapipes.iter import IterableWrapper
from tqdm import tqdm
import xarray as xr

from pvnet.data.datamodule import batch_to_tensor
from pvnet.utils import print_config
Expand Down Expand Up @@ -77,7 +76,9 @@ def _get_datapipe(config_path, start_time, end_time, batch_size, renewable: str
return data_pipeline


def _save_batches_with_dataloader(batch_pipe, batch_dir, num_batches, dataloader_kwargs, output_format: str = "torch"):
def _save_batches_with_dataloader(
batch_pipe, batch_dir, num_batches, dataloader_kwargs, output_format: str = "torch"
):
save_func = _save_batch_func_factory(batch_dir, output_format=output_format)
filenumber_pipe = IterableWrapper(range(num_batches)).sharding_filter()
save_pipe = filenumber_pipe.zip(batch_pipe).map(save_func)
Expand Down

0 comments on commit a256ad7

Please sign in to comment.