Skip to content

Update outdated search syntax in demo Notebooks #32

@sadielbartholomew

Description

@sadielbartholomew

Whilst exploring the capabilities of Datapoint through the demo Jupyter Notebooks I found that a code cell would fail with an IndexError because the collect_cloud_assets() would return zero products when at least three were expected, for example for the demo/basic_usage.ipynb Notebook I got 0 products with the search as-is:

>>> search_basic = client.search(
    collections=['cmip6'],
    query=[
        'experiment_id=ssp585',
        'activity_id=ScenarioMIP',
        'institution_id=KIOST',
    ],
    max_items = 10
)
>>> cluster = search_basic.collect_cloud_assets()
>>> cluster
<DataPointCluster: CEDA-333146-139631-409864 (Datasets: 0)>
 - url: https://api.stac.ceda.ac.uk/
 - organisation: CEDA
 - search_terms: {'query': ['experiment_id=ssp585', 'activity_id=ScenarioMIP', 'institution_id=KIOST'], 'max_items': 10}
 - collections: ['cmip6']
 - products: 0
Products:

@dwest77a clarified that this isn't expected and is a result of the search query using syntax which is deprecated so does now return the expected results.

The Notebooks should be updated so that the cells run through successfully. I will put in a PR since I am using these for guidance so it is handy for me to get these in updated working form ASAP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions