Skip to content

SimulationExecutionOptions(binary_path=...) is dropped by options_to_kwargs() #725

@elma16

Description

@elma16

SimulationExecutionOptions accepts a binary_path, but options_to_kwargs() drops it when converting legacy execution options for kspaceFirstOrder().

For example (you'll have to modify custom_binary to point at the binary)

from kwave.compat import options_to_kwargs
from kwave.options import SimulationExecutionOptions

custom_binary = "./kspaceFirstOrder-OMP"

execution_options = SimulationExecutionOptions(
    is_gpu_simulation=False,
    backend="OMP",
    binary_path=custom_binary,
    show_sim_log=False,
    num_threads=1,
)

kwargs = options_to_kwargs(None, execution_options)

assert kwargs.get("binary_path") == custom_binary

gives the output

    assert kwargs.get("binary_path") == custom_binary
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions