Skip to content

Add support for nested exclude/include rules in PortnameSpace.absorb#116

Merged
sphuber merged 1 commit intodevelopfrom
fix_115_namespace_exclude_include_rules_absorb
Jun 17, 2019
Merged

Add support for nested exclude/include rules in PortnameSpace.absorb#116
sphuber merged 1 commit intodevelopfrom
fix_115_namespace_exclude_include_rules_absorb

Conversation

@sphuber
Copy link
Copy Markdown
Collaborator

@sphuber sphuber commented Jun 17, 2019

Fixes #115

The PortNamespace class supports nested namespace hierarchies by
design. However, the absorb method, which allows one to absorb the
ports of one port namespace into another, only allows to absorb the
ports wholesale. There are many use cases where one would want to absorb
the ports, but exclude some nested ports. The exclude and include
rules did not account for this.

Here we make the absorb properly recursive and allow the exclude and
include rules to also target nested ports. For example if the port a
in the namespace base needs to be excluded, one can now define
exclude=('base.a').

@sphuber sphuber requested review from giovannipizzi and muhrin June 17, 2019 11:00
The `PortNamespace` class supports nested namespace hierarchies by
design. However, the `absorb` method, which allows one to absorb the
ports of one port namespace into another, only allows to absorb the
ports wholesale. There are many use cases where one would want to absorb
the ports, but exclude some nested ports. The `exclude` and `include`
rules did not account for this.

Here we make the `absorb` properly recursive and allow the `exclude` and
`include` rules to also target nested ports. For example if the port `a`
in the namespace `base` needs to be excluded, one can now define
`exclude=('base.a')`.
@sphuber sphuber force-pushed the fix_115_namespace_exclude_include_rules_absorb branch from 8b87010 to 3001594 Compare June 17, 2019 11:05
@sphuber sphuber merged commit 8e2616d into develop Jun 17, 2019
@sphuber sphuber deleted the fix_115_namespace_exclude_include_rules_absorb branch June 17, 2019 13:18
unkcpz pushed a commit to unkcpz/plumpy that referenced this pull request Dec 14, 2024
aiidateam#116)

The `PortNamespace` class supports nested namespace hierarchies by
design. However, the `absorb` method, which allows one to absorb the
ports of one port namespace into another, only allows to absorb the
ports wholesale. There are many use cases where one would want to absorb
the ports, but exclude some nested ports. The `exclude` and `include`
rules did not account for this.

Here we make the `absorb` properly recursive and allow the `exclude` and
`include` rules to also target nested ports. For example if the port `a`
in the namespace `base` needs to be excluded, one can now define
`exclude=('base.a')`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for nested ports in exclude/include or PortNamespace.absorb

2 participants