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

Fix: Remove dict merge operator, python 3.8 compat #1793

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Changes from all commits
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
4 changes: 2 additions & 2 deletions mesa/experimental/jupyter_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def JupyterViz(
# 1. Set up model parameters
user_params, fixed_params = split_model_params(model_params)
model_parameters, set_model_parameters = solara.use_state(
fixed_params | {k: v["value"] for k, v in user_params.items()}
{**fixed_params, **{k: v["value"] for k, v in user_params.items()}}
)

# 2. Set up Model
Expand All @@ -54,7 +54,7 @@ def make_model():
model = solara.use_memo(make_model, dependencies=list(model_parameters.values()))

def handle_change_model_params(name: str, value: any):
set_model_parameters(model_parameters | {name: value})
set_model_parameters({**model_parameters, name: value})

# 3. Set up UI
solara.Markdown(name)
Expand Down