Skip to content

Commit 8218fa7

Browse files
committed
Update Codec API with get_dtype(is_external) method
- Codec.get_dtype(is_external) now determines storage type based on whether @ modifier is present in the declaration - BlobCodec returns "bytes" for internal, "<hash>" for external - AttachCodec returns "bytes" for internal, "<hash>" for external - HashCodec, ObjectCodec, FilepathCodec enforce external-only usage - Consolidates <blob>/<xblob> and <attach>/<xattach> into unified codecs - Adds backward compatibility aliases for old type names - Updates __init__.py with new codec exports (Codec, list_codecs, get_codec)
1 parent 2dde3d9 commit 8218fa7

File tree

3 files changed

+410
-484
lines changed

3 files changed

+410
-484
lines changed

src/datajoint/__init__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@
4545
"kill",
4646
"MatCell",
4747
"MatStruct",
48+
# New codec API
49+
"Codec",
50+
"list_codecs",
51+
"get_codec",
52+
# Backward compatibility aliases
4853
"AttributeType",
4954
"register_type",
5055
"list_types",
@@ -61,7 +66,14 @@
6166
from . import errors
6267
from . import migrate
6368
from .admin import kill
64-
from .attribute_type import AttributeType, list_types, register_type
69+
from .attribute_type import (
70+
AttributeType,
71+
Codec,
72+
get_codec,
73+
list_codecs,
74+
list_types,
75+
register_type,
76+
)
6577
from .blob import MatCell, MatStruct
6678
from .cli import cli
6779
from .connection import Connection, conn

0 commit comments

Comments
 (0)