Skip to content

Commit

Permalink
add refresh_samples function
Browse files Browse the repository at this point in the history
  • Loading branch information
sfalkena committed Sep 18, 2024
1 parent 28e61e4 commit 60539ad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions torchgeo/samplers/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ def __init__(

self.chips = self.get_chips()

def refresh_samples(self) -> None:
"""Refresh the samples in the sampler.
This method is useful when you want to refresh the random samples in the sampler
without creating a new sampler instance.
"""
self.chips = self.get_chips()

def get_chips(self) -> GeoDataFrame:
"""Generate chips from the dataset.
Expand Down

0 comments on commit 60539ad

Please sign in to comment.