Skip to content

Commit

Permalink
Fix missing utils package for model_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Eve-ning committed Oct 20, 2023
1 parent 126417f commit 549da2b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 78 deletions.
2 changes: 1 addition & 1 deletion pipeline/model_tests/chestnut_dec_may/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from frdc.train import FRDCDataModule
from frdc.train import FRDCModule
from pipeline.model_tests.chestnut_dec_may.preprocess import preprocess
from pipeline.model_tests.chestnut_dec_may.utils import get_dataset
from pipeline.model_tests.utils import get_dataset

# Get our Test
# TODO: Ideally, we should have a separate dataset for testing.
Expand Down
2 changes: 1 addition & 1 deletion pipeline/model_tests/chestnut_dec_may/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from frdc.train import FRDCDataModule, FRDCModule
from pipeline.model_tests.chestnut_dec_may.augmentation import augmentation
from pipeline.model_tests.chestnut_dec_may.preprocess import preprocess
from pipeline.model_tests.chestnut_dec_may.utils import get_dataset
from pipeline.model_tests.utils import get_dataset


def train_val_test_split(x: TensorDataset) -> list[Dataset, Dataset, Dataset]:
Expand Down
76 changes: 0 additions & 76 deletions pipeline/model_tests/chestnut_dec_may/utils.py

This file was deleted.

12 changes: 12 additions & 0 deletions pipeline/model_tests/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from frdc.load import FRDCDataset
from frdc.preprocess.extract_segments import extract_segments_from_bounds

BANDS = ["NB", "NG", "NR", "RE", "NIR"]


def get_dataset(site, date, version):
ds = FRDCDataset(site=site, date=date, version=version)
ar, order = ds.get_ar_bands(BANDS)
bounds, labels = ds.get_bounds_and_labels()
segments = extract_segments_from_bounds(ar, bounds, cropped=True)
return segments, labels

0 comments on commit 549da2b

Please sign in to comment.