From 26fbb5045e1f9302fa1051c56a3c350d56f9b1f2 Mon Sep 17 00:00:00 2001 From: Andy Casey Date: Fri, 14 Oct 2022 16:01:14 -0600 Subject: [PATCH] consistent naming for astra paths so SDSSPath doesnt think we need cat_id and catalogid --- python/sdss_access/path/path.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/sdss_access/path/path.py b/python/sdss_access/path/path.py index 4af543e..855a5d3 100644 --- a/python/sdss_access/path/path.py +++ b/python/sdss_access/path/path.py @@ -336,8 +336,8 @@ def extract(self, name, example): template = re.sub('@plateid6[|]', '{plateid:0>6}', template) if re.search('@component_default[|]', template): template = re.sub('@component_default[|]', '{component_default}', template) - if re.search('@catalogid_groups[|]', template): - template = re.sub('@catalogid_groups[|]', '{catalogid_groups}', template) + if re.search('@cat_id_groups[|]', template): + template = re.sub('@cat_id_groups[|]', '{cat_id_groups}', template) # check if template has any brackets haskwargs = re.search('[{}]', template) @@ -1219,7 +1219,7 @@ def healpixgrp(self, filetype, **kwargs): subdir = "{:d}".format(healpix // 1000) return subdir - def catalogid_groups(self, filetype, **kwargs): + def cat_id_groups(self, filetype, **kwargs): ''' Return a folder structure to group data together based on their catalog identifier so that we don't have too many files in any one folder. @@ -1228,7 +1228,7 @@ def catalogid_groups(self, filetype, **kwargs): ---------- filetype : str File type parameter. - catalogid : int or str + cat_id : int or str SDSS-V catalog identifier Returns @@ -1238,8 +1238,8 @@ def catalogid_groups(self, filetype, **kwargs): ''' # with k = 100 then even with 10 M sources, each folder will have ~1,000 files k = 100 - catalogid = int(kwargs['catalogid']) - return f"{(catalogid // k) % k:0>2.0f}/{catalogid % k:0>2.0f}" + cat_id = int(kwargs['cat_id']) + return f"{(cat_id // k) % k:0>2.0f}/{cat_id % k:0>2.0f}" def component_default(self, filetype, **kwargs): ''' Return the component name, if given.