Skip to content

Conversation

@dimitri-yatsenko
Copy link
Member

Summary

Replaces native database type int with core DataJoint type uint16 in the custom-codecs tutorial, following DataJoint 2.0 type system standards.

Changes

src/tutorials/advanced/custom-codecs.ipynb

  • Cell 4 (Connectivity table): conn_id : intconn_id : uint16
  • Cell 9 (Unit table): unit_id : intunit_id : uint16

Not changed:

  • Cell 8: SpikeTrain.unit_id: int — This is a Python dataclass type annotation, not a DataJoint type, so it correctly remains int

Rationale

Per TERMINOLOGY.md and Type System specification:

Core DataJoint Types (Layer 2) - Preferred

  • uint8, uint16, int32, float32, etc.
  • Standardized, scientist-friendly
  • Work identically across MySQL and PostgreSQL
  • Include explicit size information

Native Database Types (Layer 1) - Discouraged

  • INT, FLOAT, TINYINT UNSIGNED, etc.
  • Backend-specific
  • Generate warnings at declaration time
  • Not portable, lack size metadata

Diff

Clean 2-line change:

-    conn_id : int
+    conn_id : uint16

-    unit_id : int
+    unit_id : uint16

Related

…utorial

- Changed conn_id : int → conn_id : uint16 in Connectivity table
- Changed unit_id : int → unit_id : uint16 in Unit table
- Python dataclass SpikeTrain.unit_id: int unchanged (Python type, not DJ type)
- Aligns with core type standards from TERMINOLOGY.md
@dimitri-yatsenko
Copy link
Member Author

Combined into PR #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants