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

Adds support for required/ mandatory parameter values #724

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix flake errors
MarcSkovMadsen committed Mar 26, 2023
commit 2c8608e4155f47cf42cf29a572bf27aa4fce5f40
6 changes: 3 additions & 3 deletions param/parameterized.py
Original file line number Diff line number Diff line change
@@ -1608,12 +1608,12 @@ def _generate_name(self_):
def _validate_params(self_, **params):
self = self_.param.self
params_to_instantiate = self.__class__.param._parameters

for p,v in params_to_instantiate.items():
if v.required and not v.name in params:
if v.required and v.name not in params:
message = f"__init__() missing 1 required positional argument: '{v.name}'"
raise TypeError(message)


@as_uninitialized
def _setup_params(self_,**params):