Skip to content

Commit de3ddfa

Browse files
committed
Update bucket routine
1 parent 3e6682e commit de3ddfa

File tree

7 files changed

+556
-26
lines changed

7 files changed

+556
-26
lines changed

gpm/bucket/io.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434

3535
def read_bucket_info(bucket_dir):
36-
os.makedirs(bucket_dir, exist_ok=True)
3736
bucket_info_filepath = os.path.join(bucket_dir, "bucket_info.yaml")
3837
bucket_info = read_yaml(filepath=bucket_info_filepath)
3938
return bucket_info
@@ -47,14 +46,19 @@ def get_bucket_partitioning(bucket_dir):
4746
return partitioning
4847

4948

49+
def get_bucket_temporal_partitioning(bucket_dir):
50+
bucket_info = read_bucket_info(bucket_dir)
51+
return bucket_info.get("temporal_partitioning")
52+
53+
5054
def write_bucket_info(bucket_dir, partitioning):
5155
os.makedirs(bucket_dir, exist_ok=True)
5256
bucket_info = partitioning.to_dict()
5357
bucket_info_filepath = os.path.join(bucket_dir, "bucket_info.yaml")
5458
write_yaml(bucket_info, filepath=bucket_info_filepath, sort_keys=False)
5559

5660

57-
####------------------------------------------------------------------------------------------------------------------.
61+
####---------------------------------------------------------------------------.
5862
#### Bucket partitions utilities
5963

6064

@@ -105,3 +109,6 @@ def get_filepaths_by_partition(bucket_dir, parallel=True, file_extension=None, g
105109
sep = os.path.sep
106110
dict_partition_files = {sep.join(k.strip(sep).split(sep)[-n_levels:]): v for k, v in dict_filepaths.items()}
107111
return dict_partition_files
112+
113+
114+
####---------------------------------------------------------------------------.

0 commit comments

Comments
 (0)