1+ import logging
2+
13import datajoint as dj
24
5+ logger = logging .getLogger ("datajoint" )
6+
37schema = dj .Schema ()
48
59
@@ -19,44 +23,68 @@ def activate(schema_name: str, create_schema: bool = True, create_tables: bool =
1923 )
2024
2125
26+ @schema
27+ class Organization (dj .Manual ):
28+ """Top-level list of all organizations involved in any of the projects.
29+
30+ Attributes:
31+ organization ( varchar(24) ): Abbreviated organization name.
32+ org_name ( varchar(255) ): Full organization name.
33+ org_address ( varchar(512), optional ): Address of the organization.
34+ org_comment ( varchar(1024), optional ): Additional notes on the organization.
35+ """
36+
37+ definition = """# Top-level list of all organizations involved in any of the projects
38+ organization : varchar(24) # Abbreviated organization name
39+ ---
40+ org_name : varchar(255) # Full organization name
41+ org_address='' : varchar(512) # Address of the organization
42+ org_comment='' : varchar(1024) # Additional notes on the organization
43+ """
44+
45+
2246@schema
2347class Lab (dj .Lookup ):
2448 """Table for storing general lab info.
2549
2650 Attributes:
2751 lab ( varchar(24) ): Abbreviated lab name.
2852 lab_name ( varchar(255) ): Full lab name.
29- institution ( varchar(255) ): Name of the affiliation institution.
3053 address ( varchar(255) ): Physical lab address.
31- time_zone ( varchar(64) ): If using NWB export, use 'UTC±X' format
54+ time_zone ( varchar(64) ): 'UTC±X' format or timezone, e.g., America/New_York.
55+ If using NWB export, use 'UTC±X' format.
3256 """
3357
34- definition = """
35- lab : varchar(24) # abbreviated lab name
58+ definition = """# Table for storing general lab info.
59+ lab : varchar(24) # Abbreviated lab name
3660 ---
37- lab_name : varchar(255) # full lab name
38- institution : varchar(255)
39- address : varchar(255)
40- time_zone : varchar(64) # 'UTC±X' format for NWB export
61+ lab_name : varchar(255) # Full lab name
62+ address : varchar(255) # Physical lab address
63+ time_zone : varchar(64) # 'UTC±X' format or timezone, e.g., America/New_York
4164 """
4265
66+ class Organization (dj .Part ):
67+ definition = """
68+ -> master
69+ -> Organization
70+ """
71+
4372
4473@schema
4574class Location (dj .Lookup ):
46- """Location of research (e.g., animal housing or experimental rigs)
75+ """Location of research (e.g., animal housing or experimental rigs).
4776
4877 Attributes:
4978 Lab (foreign key): Lab key.
5079 location ( varchar(32) ): Location of a space related to the lab.
5180 location_description ( varchar(255), optional ): Description of the location.
5281 """
5382
54- definition = """
55- # location of research (e.g., animal housing or experimental rigs)
83+ definition = """# location of research (e.g., animal housing or experimental rigs)
5684 -> Lab
57- location : varchar(32)
85+ location : varchar(32) # Location of a space related to the lab
5886 ---
59- location_description='' : varchar(255)
87+ location_description='' : varchar(255) # Description of the location
6088 """
6189
6290
@@ -65,11 +93,11 @@ class UserRole(dj.Lookup):
6593 """Roles assigned to a user or a job title.
6694
6795 Attributes:
68- user_role ( varchar(16 ) ): Role within the lab (e.g., PI, Postdoc, etc.).
96+ user_role ( varchar(24 ) ): Role within the lab (e.g., PI, Postdoc, etc.).
6997 """
7098
71- definition = """
72- user_role : varchar(16 ) # Role within the lab (e.g., PI, Postdoc, etc.)
99+ definition = """# Roles assigned to a user or a job title.
100+ user_role : varchar(24 ) # Role within the lab (e.g., PI, Postdoc, etc.)
73101 """
74102
75103
@@ -79,15 +107,17 @@ class User(dj.Lookup):
79107
80108 Attributes:
81109 user ( varchar(32) ): User name.
82- user_email ( varchar(128) ): User email address.
83- user_cellphone ( varchar(32) ): User cellphone number.
110+ user_email ( varchar(128), optional ): User email address.
111+ user_cellphone ( varchar(32), optional ): User cellphone number.
112+ user_fullname ( varchar(64), optional ): User full name
84113 """
85114
86- definition = """
87- user : varchar(32)
115+ definition = """# Table for storing user information.
116+ user : varchar(32) # username, short identifier
88117 ---
89118 user_email='' : varchar(128)
90119 user_cellphone='' : varchar(32)
120+ user_fullname='' : varchar(64) # Full name used to uniquely identify an individual
91121 """
92122
93123
@@ -101,7 +131,7 @@ class LabMembership(dj.Lookup):
101131 UserRole (foreign key): Optional. UserRole primary key.
102132 """
103133
104- definition = """
134+ definition = """# Store lab membership information using three lookup tables.
105135 -> Lab
106136 -> User
107137 ---
@@ -117,26 +147,26 @@ class ProtocolType(dj.Lookup):
117147 protocol_type ( varchar(32) ): Protocol types (e.g., IACUC, IRB, etc.).
118148 """
119149
120- definition = """
121- protocol_type : varchar(32)
150+ definition = """# Type of protocol or issuing agency
151+ protocol_type : varchar(32) # Protocol types (e.g., IACUC, IRB, etc.)
122152 """
123153
124154
125155@schema
126156class Protocol (dj .Lookup ):
127- """Protocol specifics (e.g., protocol number and title) .
157+ """Protocol approved by institutions (e.g. IACUC, IRB), or experimental protocol .
128158
129159 Attributes:
130- protocol ( varchar(16 ) ): Protocol identifier.
160+ protocol ( varchar(36 ) ): Protocol identifier.
131161 ProtocolType (foreign key): ProtocolType key.
132- protocol_description( varchar(255) ): Optional. Description of the protocol.
162+ protocol_description( varchar(255), optional ): Description of the protocol.
133163 """
134164
135- definition = """
136- protocol : varchar(16)
165+ definition = """# Protocol approved by institutions (e.g. IACUC, IRB), or experimental protocol.
166+ protocol : varchar(36) # Protocol identifier.
137167 ---
138168 -> ProtocolType
139- protocol_description='' : varchar(255)
169+ protocol_description='' : varchar(255) # Description of the protocol
140170 """
141171
142172
@@ -149,6 +179,11 @@ class Project(dj.Lookup):
149179 project_description ( varchar(1024) ): Description about the project.
150180 """
151181
182+ logger .warning (
183+ "lab.Project and related tables will be removed in a future version of"
184+ + " Element Lab. Please use the project schema."
185+ )
186+
152187 definition = """
153188 project : varchar(32)
154189 ---
0 commit comments