Skip to content

Commit

Permalink
var_keyword removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
nissu99 authored and tpike3 committed Dec 9, 2024
1 parent 52e6d17 commit c6ed22b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions mesa/visualization/solara_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,10 @@ def _check_model_params(init_func, model_params):
param.kind == inspect.Parameter.VAR_POSITIONAL
for param in model_parameters.values()
)
has_var_keyword = any(
param.kind == inspect.Parameter.VAR_KEYWORD
for param in model_parameters.values()
)

if has_var_positional and has_var_keyword:
raise ValueError("Models with both *args and **kwargs are not supported")


if has_var_positional:
raise ValueError("Mesa's visualization requires the use of keyword arguments to ensure the parameters are passed to Solara correctly. Please ensure all model parameters are of form param=value" )

for name in model_parameters:
if (
model_parameters[name].default == inspect.Parameter.empty
Expand Down

0 comments on commit c6ed22b

Please sign in to comment.