【问题标题】:Datajoint autopopulate make function error: DataJointError: A relation must have primary dependencies for auto-populate to workDatajoint autopopulate make function error: DataJointError: A relationship must have primary dependencies for auto-populate to work
【发布时间】:2021-05-18 21:08:57
【问题描述】:

我收到以下错误:

“DataJointError:关系必须具有主要依赖项才能自动填充工作” 我认为这是一个非常基本的开始,首先定义一个手动表,然后是一个导入的表。

在这种情况下,我们有一个文件夹中的 matlab 文件名手动表。然后,我们希望使用这些文件中的数据自动填充导入的表。所以这些表之间的依赖关系应该是一对一的匹配。但是,在尝试填充时,我们会收到以下错误,如下所示:DataJointError: A relationship must have primary dependencies for auto-populate to work in trying to implement make function.

上游会话表有主键“文件名”,我们希望导入的表定义为:

@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 并重新打开、重新启动内核等。在此先感谢您的帮助!

【问题讨论】:

    标签: datajoint


    【解决方案1】:

    这已在https://github.com/datajoint/datajoint-python/issues/902 中报告,并将很快得到解决。这是由于在填充之前没有将依赖项加载到内存中。中间修复是在调用populate 之前绘制架构图——这将加载依赖项并使populate 正常工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-08
      • 2016-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-12
      • 2020-05-16
      • 2022-10-21
      相关资源
      最近更新 更多