6a98de289a02db6bd0c715affac9242a52c633e3,flow/visualize/time_space_diagram.py,,get_time_space_data,#Any#Any#,76

Before Change


    dt = params["sim"].sim_step

    // number of simulation steps
    max_time = max(max(data[veh_id]["time"]) for veh_id in data.keys())
    min_time = min(min(data[veh_id]["time"]) for veh_id in data.keys())
    num_steps = int((max_time - min_time)/dt)

    // Get the function from switcher dictionary
    func = switcher[params["scenario"]]

After Change


    }

    // Collect a list of all the unique times.
    all_time = []
    for veh_id in data.keys():
        all_time.extend(data[veh_id]["time"])
    all_time = np.sort(np.unique(all_time))

    // Get the function from switcher dictionary
    func = switcher[params["scenario"]]

    // Execute the function
    pos, speed = func(data, params, all_time)

    return pos, speed, all_time

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: flow-project/flow
Commit Name: 6a98de289a02db6bd0c715affac9242a52c633e3
Time: 2019-06-10
Author: akreidieh@gmail.com
File Name: flow/visualize/time_space_diagram.py
Class Name:
Method Name: get_time_space_data


Project Name: neurodsp-tools/neurodsp
Commit Name: 96e0a7454eebcc95e3c9dfdff6b3682bd23442af
Time: 2019-04-30
Author: tdonoghue@ucsd.edu
File Name: neurodsp/sim/combined.py
Class Name:
Method Name: sim_combined


Project Name: rtqichen/torchdiffeq
Commit Name: 2b189592e0a169fc991bec98f39bbe8405e3440b
Time: 2020-07-27
Author: 33688385+patrick-kidger@users.noreply.github.com
File Name: torchdiffeq/_impl/fixed_grid.py
Class Name: Midpoint
Method Name: _step_func