Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config: do not sort positional arguments #594

Merged
merged 4 commits into from
Feb 21, 2022

Conversation

danieldk
Copy link
Contributor

In a configuration such as the following:

[model]

[model.chain]
@layers = "chain.v1"

[model.chain.*.hashembed]
@layers = "HashEmbed.v1"
nO = 8
nV = 8

[model.chain.*.expand_window]
@layers = "expand_window.v1"
window_size = 1

The positional arguments in the chain were sorted, changing the chain order. This change masks the names of positional arguments. Since sorted is a stable sort, the order of positional arguments is retained.

In a configuration such as the following:

[model]

[model.chain]
@layers = "chain.v1"

[model.chain.*.hashembed]
@layers = "HashEmbed.v1"
nO = 8
nV = 8

[model.chain.*.expand_window]
@layers = "expand_window.v1"
window_size = 1

The positional arguments in the chain were sorted, changing the chain
order. This change masks the names of positional arguments. Since
`sorted` is a stable sort, the order of positional arguments is
retained.
@danieldk danieldk added bug Bugs and behaviour differing from documentation feat / config Configuration system and config files labels Feb 18, 2022
thinc/config.py Outdated Show resolved Hide resolved
thinc/config.py Outdated Show resolved Hide resolved
danieldk and others added 2 commits February 21, 2022 12:17
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
@danieldk danieldk requested a review from svlandeg February 21, 2022 11:49
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks again for the bug fix!

@svlandeg svlandeg merged commit 1765ff0 into explosion:master Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and behaviour differing from documentation feat / config Configuration system and config files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants