From b4d10f5031be97218445ab910f49b8625a3631ad Mon Sep 17 00:00:00 2001 From: Sietse Snel Date: Thu, 5 Oct 2023 12:12:45 +0200 Subject: [PATCH] Intake module: update comments - Update function descriptions that no longer match current behaviour - Remove unused commented-out code --- intake.py | 5 +++-- intake_dataset.py | 6 +++--- intake_scan.py | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/intake.py b/intake.py index d7ae471be..693843632 100644 --- a/intake.py +++ b/intake.py @@ -389,10 +389,11 @@ def get_dataset_toplevel_objects(ctx, root, dataset_id): If not a collection- all objects are returned with full object path. :param ctx: Combined type of a callback and rei struct - :param root: Path to a dataset + :param root: Path within which to search for datasets (e.g. an intake group collection) :param dataset_id: Identifier of the dataset - :returns: Dict holding objects for the dataset + :returns: Dict holding top-level object paths for the dataset (in the 'objects' key) and a boolean value which + says whether it is a collection-based dataset (in the 'is_collection' key) """ c_main_collection_iterator = genquery.row_iterator( "COLL_NAME", diff --git a/intake_dataset.py b/intake_dataset.py index c1417187e..d8417fc71 100644 --- a/intake_dataset.py +++ b/intake_dataset.py @@ -76,13 +76,15 @@ def intake_youth_get_datasets_in_study(ctx, study_id): """Get the of datasets (with relevant metadata) in a study. Retrieved metadata: + - 'dataset_id' - 'dataset_date_created' - 'wave' - 'version' - 'experiment_type' + - 'pseudocode' :param ctx: Combined type of a callback and rei struct - :param study_id: Unique identifier op study + :param study_id: Unique identifier of study :returns: Dict with datasets and relevant metadata. """ @@ -107,10 +109,8 @@ def intake_youth_get_datasets_in_study(ctx, study_id): if attribute_name in ['dataset_date_created', 'wave', 'version', 'experiment_type', 'pseudocode']: if attribute_name in ['version', 'experiment_type']: val = attribute_value.lower() - # datasets[dataset][attribute_name] = attribute_value.lower() else: val = attribute_value - # datasets[dataset][attribute_name] = attribute_value try: datasets[dataset][attribute_name] = val except KeyError: diff --git a/intake_scan.py b/intake_scan.py index 1ef3888d6..ba024c4cc 100644 --- a/intake_scan.py +++ b/intake_scan.py @@ -326,7 +326,8 @@ def intake_check_datasets(ctx, root): def intake_check_dataset(ctx, root, dataset_id): """Run checks on the dataset specified by the given dataset id. - This function adds warnings and errors to objects within the dataset. + This function adds object counts and error counts to top-level objects within the dataset. + For historical reasons, it also adds a warning count, which is always 0. :param ctx: Combined type of a callback and rei struct :param root: Collection name