Skip to content

Commit

Permalink
Merge pull request #130 from point-cloud-radar/skip_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
lyashevska authored Jul 11, 2023
2 parents 0ad3dfc + c730929 commit a143905
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ venv3

data
.pylintrc
runs
6 changes: 6 additions & 0 deletions bird_cloud_gnn/radar_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def __init__(
points_of_interest=None,
use_missing_indicator_columns=False,
add_edges_to_poi=False,
skip_cache=False,
):
"""Constructor
Expand All @@ -69,6 +70,8 @@ def __init__(
points_of_interest (array of int, optional): If `data` is a pandas.Dataframe only generate graphs for these points
use_missing_indicator_columns (bool, optional): Whether to add columns of 0s and 1s indicating values that are missing.
add_edges_to_poi (bool, optional): Whether to add extra edges to the point of interest regardless of the edge distance.
skip_cache (logical): If true not cache is saved to disk
Raises:
ValueError: If `data` is not a valid folder, file or pandas.DataFrame
Expand Down Expand Up @@ -111,6 +114,7 @@ def __init__(
self.graphs = []
self.labels = []
self.origin = pd.Categorical([])
self.skip_cache = skip_cache
super().__init__(
name=name,
hash_key=(
Expand Down Expand Up @@ -314,6 +318,8 @@ def process(self):
def save(self):
if len(self.graphs) == 0:
return
if self.skip_cache:
return
graph_path = os.path.join(
self.cache_dir(), f"dataset_storage_{self.name}_{self.hash}.bin"
)
Expand Down

0 comments on commit a143905

Please sign in to comment.