cadCAD-org/cadCAD

Missing required positional argument: 'configured_N'

BenSchZA opened this issue · 10 comments

After having updated the predator/prey model from the demos folder for cadCAD 0.4.18, I'm getting the following error. Does this error look familiar? I'm sure there's some more context I could give, I'll update this issue if I find it.

Execution Mode: local_proc
Configuration Count: 1
Dimensions of the first simulation: (Timesteps, Params, Runs, Vars) = (1000, 6, 1, 2)
Execution Method: local_simulations

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-1fa93129baf3> in <module>
      2 # Tweak the prey_predator_abm/sim_params.py file if you want it to take longer (or not).
      3 start_time = time()
----> 4 experiments = run.run()
      5 end_time = time()
      6 print("Execution in {:.1f}s".format(end_time - start_time))

~/workspace/cadCAD/demos/prey-predator/run.py in run(drop_midsteps)
     22     results = pd.DataFrame()
     23     i = 0
---> 24     for raw_result, _tensor_field, _sessions in run.execute():
     25         params = configs[i].sim_config['M']
     26         result_record = pd.DataFrame.from_records([tuple([i for i in params.values()])], columns=list(params.keys()))

~/Library/Caches/pypoetry/virtualenvs/demos-KUP5ZvRJ-py3.8/lib/python3.8/site-packages/cadCAD/engine/__init__.py in execute(self)
    149 
    150             print("Execution Method: " + self.exec_method.__name__)
--> 151             simulations_results = self.exec_method(
    152                 sim_executors, var_dict_list, states_lists, configs_structs, env_processes_list, Ts, SimIDs, RunIDs,
    153                 ExpIDs, SubsetIDs, SubsetWindows, original_N

~/Library/Caches/pypoetry/virtualenvs/demos-KUP5ZvRJ-py3.8/lib/python3.8/site-packages/cadCAD/engine/execution.py in local_simulations(simulation_execs, var_dict_list, states_lists, configs_structs, env_processes_list, Ts, SimIDs, Ns, ExpIDs, SubsetIDs, SubsetWindows, exec_method)
    138     try:
    139         if len(configs_structs) == 1:
--> 140             return single_proc_exec(
    141                 simulation_execs, var_dict_list, states_lists, configs_structs, env_processes_list, Ts, SimIDs, Ns,
    142                 ExpIDs, SubsetIDs, SubsetWindows, exec_method

~/Library/Caches/pypoetry/virtualenvs/demos-KUP5ZvRJ-py3.8/lib/python3.8/site-packages/cadCAD/engine/execution.py in single_proc_exec(simulation_execs, var_dict_list, states_lists, configs_structs, env_processes_list, Ts, SimIDs, Ns, ExpIDs, SubsetIDs, SubsetWindows, exec_method)
     34         map(lambda x: x.pop(), params)
     35     )
---> 36     result = simulation_exec(var_dict_list, states_list, config, env_processes, T, sim_id, N, subset_id, subset_window)
     37     return flatten(result)
     38 

TypeError: simulation() missing 1 required positional argument: 'configured_N'

Looking at this line result = simulation_exec(var_dict_list, states_list, config, env_processes, T, sim_id, N, subset_id, subset_window), it does seem to be missing the 'configured_N' parameter, but in the code it's there:

result = simulation_exec(

Perhaps the package version deployed to PyPi is broken.

Specific cadCAD version I'm using: {file = "cadCAD-0.4.18-py3-none-any.whl", hash = "sha256:992414573ec7223da01cbfb4a569da07cbb52d9f2386d4a09e0b49a4f5421a29"},

For reference: https://github.com/BenSchZA/cadcad-predator-prey-model

@BenSchZA
Good catch
fixed this in during development the beginning of this week
will merge a fix for this today

@BenSchZA
in the meantime use staging & build from source

@BenSchZA
merged #173
Let me know if the error persists.
If not ill close this issue

@JEJodesty Tested and happy to close. Thanks!

Hello guys, I'm still having this issue in my model. I arranged the code in the following segments to make it easier to read:

uniswap/config.py: Genesis states, sys_params simulations steps, monte Carlo runs and any other data that is used to build the configs;
run.py: Function to run the model;
lab_notebook.ipynb: Jupyter notebook to reproduce the error.

Link to the repo: https://github.com/neo-empresarial/uniswap

Hey @pkretzschmar. I don't think version 0.4.19 has been released to PyPi yet, so you'd have to install as follows pip install https://github.com/cadCAD-org/cadCAD/archive/master.zip for now.

hot fix: #180

Hello @pkretzschmar
Use 0.4.20 :)

Hot fix #183