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

remove overwrite from options #467

Merged
merged 3 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 1 addition & 6 deletions strax/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def wrapped(plugin_class):
# Already have some options set, e.g. because of subclassing
# where both child and parent have a takes_config decorator
for opt in result.values():
if opt.name in plugin_class.takes_config and not opt.overwrite:
if opt.name in plugin_class.takes_config:
raise RuntimeError(
f"Attempt to specify option {opt.name} twice")
plugin_class.takes_config = immutabledict({
Expand All @@ -62,7 +62,6 @@ def __init__(self,
default_by_run=OMITTED,
child_option: bool = False,
parent_option_name: str = None,
overwrite: bool = False,
track: bool = True,
help: str = ''):
"""
Expand All @@ -82,9 +81,6 @@ def __init__(self,
:param parent_option_name: Name of the parent option of child option.
Required to find the key of the parent option so it can be overwritten
by the value of the child option.
:param overwrite: allow this option to overwrite if there is
another option already registered with the same name with a
different value. Only use for subclassing plugins.
:param track: If True (default), option value becomes part of plugin
lineage (just like the plugin version).
:param help: Human-readable description of the option.
Expand All @@ -94,7 +90,6 @@ def __init__(self,
self.default = default
self.default_by_run = default_by_run
self.default_factory = default_factory
self.overwrite = overwrite
self.track = track
self.help = help

Expand Down
66 changes: 0 additions & 66 deletions tests/test_options.py

This file was deleted.