Skip to content

Commit 26e6e5d

Browse files
CBroz1kabilar
andauthored
Apply suggestions from code review
Co-authored-by: Kabilar Gunalan <[email protected]>
1 parent 0ed1f98 commit 26e6e5d

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
44

55
## [0.2.0] - 2022-12-12
6-
+ Add - "project" schema for project/study/experiment related tables
6+
+ Add - `project` schema for project/study/experiment related tables
77

88
## [0.1.2] - 2022-10-17
99
+ Update - CICD for triggering PyPI release

element_lab/lab.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class Organization(dj.Manual):
2929
3030
Attributes:
3131
organization ( varchar(24) ): Abbreviated organization name.
32-
organization_name ( varchar(255) ): Full organization name.
33-
organization_address ( varchar(512) ): Address of the organization.
34-
organization_comment ( varchar(1024) ): Additional notes on the organization.
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.
3535
"""
3636

3737
definition = """# Top-level list of all organizations involved in any of the projects
@@ -59,7 +59,7 @@ class Lab(dj.Lookup):
5959
lab : varchar(24) # Abbreviated lab name
6060
---
6161
lab_name : varchar(255) # Full lab name
62-
address : varchar(255)
62+
address : varchar(255) # Physical lab address
6363
time_zone : varchar(64) # 'UTC±X' format or timezone, e.g., America/New_York
6464
"""
6565

@@ -107,17 +107,17 @@ class User(dj.Lookup):
107107
108108
Attributes:
109109
user ( varchar(32) ): User name.
110-
user_email ( varchar(128) ): User email address.
111-
user_cellphone ( varchar(32) ): User cellphone number.
112-
user_fullname ( varchar(64) ): User full name
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
113113
"""
114114

115115
definition = """# Table for storing user information.
116116
user : varchar(32) # username, short identifier
117117
---
118118
user_email='' : varchar(128)
119119
user_cellphone='' : varchar(32)
120-
user_fullname='' : varchar(64) # full name used to uniquely ID an individual
120+
user_fullname='' : varchar(64) # Full name used to uniquely identify an individual
121121
"""
122122

123123

@@ -154,15 +154,15 @@ class ProtocolType(dj.Lookup):
154154

155155
@schema
156156
class Protocol(dj.Lookup):
157-
"""Protocol approved by some institutions like IACUC, IRB, or experimental protocol.
157+
"""Protocol approved by institutions (e.g. IACUC, IRB), or experimental protocol.
158158
159159
Attributes:
160160
protocol ( varchar(36) ): Protocol identifier.
161161
ProtocolType (foreign key): ProtocolType key.
162-
protocol_description( varchar(255) ): Optional. Description of the protocol.
162+
protocol_description( varchar(255), optional ): Description of the protocol.
163163
"""
164164

165-
definition = """# Protocol approved by some institutions like IACUC, IRB, or experimental protocol
165+
definition = """# Protocol approved by institutions (e.g. IACUC, IRB), or experimental protocol.
166166
protocol : varchar(36) # Protocol identifier.
167167
---
168168
-> ProtocolType

element_lab/project.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ def activate(
1818
"""
1919
activate(schema_name, create_schema=True, create_tables=True, linking_module=None)
2020
:param schema_name: schema name on the database server to activate the
21-
`lab` element
21+
`project` module
2222
:param create_schema: when True (default), create schema in the
2323
database if it does not yet exist.
2424
:param create_tables: when True (default), create tables in the
2525
database if they do not yet exist.
2626
:param linking_module: a module (or name) containing the required
27-
dependencies to activate the `event` element:
27+
dependencies to activate the `project` module.
2828
Upstream tables:
2929
+ Lab: table defining general lab information
3030
+ User: table defining user/personnel/experimenter associated with Project.
@@ -33,7 +33,8 @@ def activate(
3333
if isinstance(linking_module, str):
3434
linking_module = importlib.import_module(linking_module)
3535
assert inspect.ismodule(linking_module), (
36-
"The argument 'linking_module' must" + " be a module or module name"
36+
"The argument 'linking_module' must be a module or module name"
37+
3738
)
3839

3940
global _linking_module
@@ -55,13 +56,13 @@ class Project(dj.Manual):
5556
project ( varchar(24) ): Abbreviated project name
5657
project_title ( varchar(1024) ): Full project title and/or description
5758
project_start_date (date): The start of the project
58-
project_end_date (date, nullable): The end date of the project
59+
project_end_date (date, optional): The end date of the project
5960
project_comment ( varchar(1024), optional): additional notes on the project
6061
"""
6162

6263
definition = """# Top-level grouping of studies and experiments
63-
---
6464
project : varchar(24) # abbreviated project name
65+
---
6566
project_title : varchar(1024) # full project title and/or description
6667
project_start_date : date # the start of the project
6768
project_end_date=NULL : date # the end date of the project
@@ -86,15 +87,15 @@ class ProjectPersonnel(dj.Manual):
8687

8788
@schema
8889
class ProjectKeywords(dj.Manual):
89-
"""Project keywords, exported dataset meta info
90+
"""Project keywords. If the dataset is exported, this metadata is saved within the NWB file.
9091
9192
Attributes:
9293
Project (foreign key): Project key
9394
keyword ( varchar(32) ): Keywords describing the project
9495
"""
9596

9697
definition = """
97-
# Project keywords, exported dataset meta info
98+
# Project keywords. If the dataset is exported, this metadata is saved within the NWB file.
9899
-> Project
99100
keyword: varchar(32) # Keywords describing the project
100101
"""
@@ -113,21 +114,20 @@ class ProjectPublication(dj.Manual):
113114
# Project's resulting publications
114115
-> Project
115116
publication: varchar(255) # Publication name or citation
116-
117117
"""
118118

119119

120120
@schema
121121
class ProjectSourceCode(dj.Manual):
122-
"""URL to source code for replication
122+
"""Web address of source code
123123
124124
Attributes:
125125
Project (foreign key): Project key
126126
repository_url ( varchar(255) ): Link to code repository
127127
repository_name ( varchar(32), optional): Name of code repository
128128
"""
129129

130-
definition = """# URL to source code for replication
130+
definition = """# Web address of source code
131131
-> Project
132132
repository_url : varchar(255) # Link to code repository
133133
@@ -143,8 +143,7 @@ class Study(dj.Manual):
143143
Attributes:
144144
Project (foreign key): Project key
145145
study ( varchar(24) ): Abbreviated study name, e.g., 'Aim 1'
146-
study_name ( varchar(128) ): Full study name, e.g., 'perceptual response tasks',
147-
or 'Aim 1'
146+
study_name ( varchar(128) ): Full study name, e.g., 'perceptual response tasks'
148147
study_description ( varchar(1024), optional): Description of study goals,
149148
objectives, and/or methods
150149
"""
@@ -173,7 +172,7 @@ class Protocol(dj.Part):
173172

174173
@schema
175174
class Experiment(dj.Manual):
176-
"""Experimental tasks/protocols and their associated lab and study
175+
"""Experimental tasks and their associated lab, study, and protocol
177176
178177
Attributes:
179178
experiment ( varchar(24) ): Abbreviated experiment name
@@ -185,7 +184,7 @@ class Experiment(dj.Manual):
185184
Protocol (foreign key, optional): Protocol key
186185
"""
187186

188-
definition = """# Experimental tasks/protocols and their associated lab and study
187+
definition = """# Experimental tasks and their associated lab, study, and protocol
189188
experiment : varchar(24) # Abbreviated experiment name
190189
---
191190
experiment_name='' : varchar(128) # Experiment full name or identifier

0 commit comments

Comments
 (0)