Skip to content

Commit 12b52e3

Browse files
maarten-icolivhoenen
authored andcommitted
Revert "Update backend selection logic"
This reverts commit 33e6b7e.
1 parent f4ebddc commit 12b52e3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

imas/db_entry.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This file is part of IMAS-Python.
22
# You should have received the IMAS-Python LICENSE file with this project.
3-
"""Logic for interacting with IMAS Data Entries."""
3+
"""Logic for interacting with IMAS Data Entries.
4+
"""
45

56
import logging
67
import os
@@ -188,10 +189,10 @@ def __init__(
188189
@staticmethod
189190
def _select_implementation(uri: Optional[str]) -> Type[DBEntryImpl]:
190191
"""Select which DBEntry implementation to use based on the URI."""
191-
if not uri or uri.startswith("imas:"):
192-
from imas.backends.imas_core.db_entry_al import ALDBEntryImpl as impl
193-
else: # Assume it's a netCDF file or NCZarr URI
192+
if uri and uri.endswith(".nc") and not uri.startswith("imas:"):
194193
from imas.backends.netcdf.db_entry_nc import NCDBEntryImpl as impl
194+
else:
195+
from imas.backends.imas_core.db_entry_al import ALDBEntryImpl as impl
195196
return impl
196197

197198
def __enter__(self):

0 commit comments

Comments
 (0)