我收到以下错误:
“DataJointError:关系必须具有自动填充工作的主要依赖项”,我认为这是一个非常基本的开始,首先定义一个手动表,然后是一个导入的表。
在这种情况下,我们有一个文件夹中的 matlab 文件名手动表。然后,我们希望使用这些文件中的数据自动填充导入的表。所以这些表之间的依赖关系应该是一对一的匹配。但是,在尝试填充时,我们会收到以下错误,如下所示: DataJointError:关系必须具有主要依赖项,自动填充才能在尝试实现 make 函数时起作用。
上游会话表具有主键“文件名”,我们希望导入的表定义为:
@schema
class Trials(dj.Imported):
definition = """
trial : int
-> Session
---
type = null : int
outcome = null : int
"""
def make(self, key): # key is the primary key of one of the entries in the table `Scan`
name = ((Session & key).fetch1()['filename'])
print(name)
Trials.populate()
我已经尝试关闭 jupyter notebook 并重新打开、重新启动内核等。在此先感谢您的帮助!