Skip to content

Reconsider over-eager warning #76

@effigies

Description

@effigies

I suspect this is due to a refactoring in which directories, and not domains, are the objects iterated over, but this warning is too-easily triggered:

grabbit/grabbit/core.py

Lines 446 to 450 in a4eb518

if name in self.domains:
msg = ("Domain with name '{}' already exists; returning existing "
"Domain configuration.".format(name))
warnings.warn(msg)
return self.domains[name]

For example:

layout = gb.BIDSLayout([(bids_dir, 'bids'), (preproc_dir, ['bids', 'derivatives'])])

Because the 'bids' domain appears twice, this is warning is displayed. However, I expect this to be very common among multi-root use cases, so we should reconsider this warning.

I see three possibilities:

  1. Re-think the potentially conflicting behavior, given the new invocation patterns, and trigger in that case.
  2. Do some work to predict whether an actual conflict may arise, and trigger only if that is the case.
  3. Remove the warning because there are not actual conflicts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions