Skip to content

Commit

Permalink
Intake module: update comments
Browse files Browse the repository at this point in the history
- Update function descriptions that no longer match current behaviour
- Remove unused commented-out code
  • Loading branch information
stsnel committed Oct 6, 2023
1 parent ce10bd0 commit c5be891
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions intake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions intake_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion intake_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c5be891

Please sign in to comment.