Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Latest commit

 

History

History
51 lines (36 loc) · 1.28 KB

File metadata and controls

51 lines (36 loc) · 1.28 KB

⚠️ This repository is archived and no longer maintained. Abandoned addons package. For current DataJoint development, see datajoint-python.

datajoint-addons

A collection of addons and nice-to-haves for datajoint-python

gitlog

A decorator for datajoint tables. Here is an example how to use it

  import datajoint as dj
  from djaddon import gitlog

  schema = dj.schema('mydb',locals())

  @schema
  @gitlog
  class MyRelation(dj.Computed):
      definition = """
      # example table
      ->SomeForeignKey
      idx     : int # some index
      ---
      value   : double # some value
      """

      def _make_tuples(self, key):
        ...

The @gitlog decorator will add a member class called GitKey with tier dj.Part to MyRelation that stores the sha1, the branch, and whether currently modified files exist for the directory MyRelation lives in for each entry computed with _make_tuples.

hdf5

Adds the functions to_hdf5 and read_hdf5 to a relation. These functions can save and load the table to and from hdf5 files.

 import datajoint as dj
 from djaddon import hdf5

 schema = dj.schema('mydb',locals())

 @schema
 @hdf5
 class MyRelation(dj.Computed):
     definition = ...