Skip to content

Commit

Permalink
add provider.id in front of provider names
Browse files Browse the repository at this point in the history
  • Loading branch information
eimrek committed Jun 28, 2024
1 parent 347db8f commit beac6d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/ipyoptimade/subwidgets/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def _update(self):
self.button_next.disabled = False
self.button_last.disabled = False

# if no data_returned available, disable next button
# if no data_returned available, don't disable next button
if self.data_returned is None:
self.button_next.disabled = False

Expand All @@ -391,10 +391,9 @@ def set_pagination_data(
reset_cache: bool = False,
):
"""Set data needed to 'activate' this pagination widget"""
if self.data_returned is None:
self.data_returned = data_returned
if data_returned is not None:
self.data_returned = data_returned

self.data_returned = data_returned

if data_available is not None:
self.data_available = data_available
if links_to_page is not None:
Expand Down
2 changes: 1 addition & 1 deletion src/ipyoptimade/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def get_list_of_providers( # pylint: disable=too-many-branches
# res.append((attributes.name, attributes))
res.append(
{
"text": attributes.name,
"text": f"{provider.id}: {attributes.name}",
"value": attributes,
"disabled": False,
}
Expand Down
6 changes: 3 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def test_exmpl_not_in_list():
"""Make sure the 'exmpl' database provider is not in the final list"""
from ipyoptimade.utils import get_list_of_providers

exmpl = "Example provider"
mcloud = "Materials Cloud"
odbx = "open database of xtals"
exmpl = "example: Example provider"
mcloud = "mcloud: Materials Cloud"
odbx = "odbx: open database of xtals"

providers_list = get_list_of_providers()

Expand Down

0 comments on commit beac6d3

Please sign in to comment.