diff --git a/src/ptbench/data/indian/datamodule.py b/src/ptbench/data/indian/datamodule.py index 7042a0c485f048f6d7dbd586abccd06478d0558f..34fb4b5a90fc506cc2096a86526da4bacc7dcaba 100644 --- a/src/ptbench/data/indian/datamodule.py +++ b/src/ptbench/data/indian/datamodule.py @@ -7,6 +7,15 @@ import importlib.resources from ..datamodule import CachingDataModule from ..shenzhen.datamodule import RawDataLoader from ..split import JSONDatabaseSplit +from ..typing import DatabaseSplit + + +def make_split(basename: str) -> DatabaseSplit: + """Returns a database split for the Indian database.""" + + return JSONDatabaseSplit( + importlib.resources.files(__name__.rsplit(".", 1)[0]).joinpath(basename) + ) class DataModule(CachingDataModule): @@ -42,10 +51,6 @@ class DataModule(CachingDataModule): def __init__(self, split_filename: str): super().__init__( - database_split=JSONDatabaseSplit( - importlib.resources.files(__name__.rsplit(".", 1)[0]).joinpath( - split_filename - ) - ), + database_split=make_split(split_filename), raw_data_loader=RawDataLoader(), ) diff --git a/src/ptbench/data/indian/default.py b/src/ptbench/data/indian/default.py index 7fe993a981c86c0161327d1ddb4498e08a90313c..2b8a8fb25e09b85f372e854a2f2ce29bcdf56ddc 100644 --- a/src/ptbench/data/indian/default.py +++ b/src/ptbench/data/indian/default.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("default.json.bz2") +datamodule = DataModule("default.json") diff --git a/src/ptbench/data/indian/fold_0.py b/src/ptbench/data/indian/fold_0.py index c810e85cea48c13293f0c0d28587e7df4e28be67..3d114d07d1c53f869ba710074b254944865cc4bc 100644 --- a/src/ptbench/data/indian/fold_0.py +++ b/src/ptbench/data/indian/fold_0.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("fold_0.json.bz2") +datamodule = DataModule("fold_0.json") diff --git a/src/ptbench/data/indian/fold_1.py b/src/ptbench/data/indian/fold_1.py index 736a778dab6b708bceba8a282eadfe45e45a86fe..cd3a8cb6d0be1c01e5dbb96d5cc02f724e15e7c4 100644 --- a/src/ptbench/data/indian/fold_1.py +++ b/src/ptbench/data/indian/fold_1.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("fold_1.json.bz2") +datamodule = DataModule("fold_1.json") diff --git a/src/ptbench/data/indian/fold_2.py b/src/ptbench/data/indian/fold_2.py index 48df1bfe7c4a562e98a5d87aa66b7b7c6f9f1ec3..44eeda801884db9fcaa58be04de3068ff82325eb 100644 --- a/src/ptbench/data/indian/fold_2.py +++ b/src/ptbench/data/indian/fold_2.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("fold_2.json.bz2") +datamodule = DataModule("fold_2.json") diff --git a/src/ptbench/data/indian/fold_3.py b/src/ptbench/data/indian/fold_3.py index 9967e4ea9297fadf97192586d66e185bec997e7e..f24fb314e30df9ab111ac69fd74a7f9a16cdad68 100644 --- a/src/ptbench/data/indian/fold_3.py +++ b/src/ptbench/data/indian/fold_3.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("fold_3.json.bz2") +datamodule = DataModule("fold_3.json") diff --git a/src/ptbench/data/indian/fold_4.py b/src/ptbench/data/indian/fold_4.py index 8630ee093f484d19f3e493f8ab059ddb29314a9a..58456d38e4804c2b68e8759f78e3bf9ea8d547f8 100644 --- a/src/ptbench/data/indian/fold_4.py +++ b/src/ptbench/data/indian/fold_4.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("fold_4.json.bz2") +datamodule = DataModule("fold_4.json") diff --git a/src/ptbench/data/indian/fold_5.py b/src/ptbench/data/indian/fold_5.py index 0c7504c512426a635eae3cdb63b545651fb43f5f..927967469ff479647670fe0d0978e4b72b965c33 100644 --- a/src/ptbench/data/indian/fold_5.py +++ b/src/ptbench/data/indian/fold_5.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("fold_5.json.bz2") +datamodule = DataModule("fold_5.json") diff --git a/src/ptbench/data/indian/fold_6.py b/src/ptbench/data/indian/fold_6.py index 2f8e8e320a4cae35036bdeacc964c996d979e9fb..9566b7cfe5723c1da18d081a2442fb5d13a11d3e 100644 --- a/src/ptbench/data/indian/fold_6.py +++ b/src/ptbench/data/indian/fold_6.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("fold_6.json.bz2") +datamodule = DataModule("fold_6.json") diff --git a/src/ptbench/data/indian/fold_7.py b/src/ptbench/data/indian/fold_7.py index 389e7f4e58a621ff777547760a7c834aeb518efc..25cbfe1b2eb0290098e6b54c3ca5a26076482e0c 100644 --- a/src/ptbench/data/indian/fold_7.py +++ b/src/ptbench/data/indian/fold_7.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("fold_7.json.bz2") +datamodule = DataModule("fold_7.json") diff --git a/src/ptbench/data/indian/fold_8.py b/src/ptbench/data/indian/fold_8.py index a948035965aacef3c249b44cc07eff9e124aa51c..fb5332ce050631a6fdf4b590fb4dd5a191fd90bc 100644 --- a/src/ptbench/data/indian/fold_8.py +++ b/src/ptbench/data/indian/fold_8.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("fold_8.json.bz2") +datamodule = DataModule("fold_8.json") diff --git a/src/ptbench/data/indian/fold_9.py b/src/ptbench/data/indian/fold_9.py index daa85e030720898578ef65a0318f90701b808abf..d1626586ff8b263c097ee9b929eea40c42b4ae1e 100644 --- a/src/ptbench/data/indian/fold_9.py +++ b/src/ptbench/data/indian/fold_9.py @@ -4,4 +4,4 @@ from .datamodule import DataModule -datamodule = DataModule("fold_9.json.bz2") +datamodule = DataModule("fold_9.json")