Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions imas/db_entry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This file is part of IMAS-Python.
# You should have received the IMAS-Python LICENSE file with this project.
"""Logic for interacting with IMAS Data Entries."""
"""Logic for interacting with IMAS Data Entries.
"""

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

def __enter__(self):
Expand Down
Loading