From e81801c4cb30248f9b8e648d0543b55666fd178c Mon Sep 17 00:00:00 2001 From: Markus Date: Thu, 17 Jan 2019 09:39:21 -0200 Subject: [PATCH 01/32] support list of mechsteps instead of dict Keeping support to dictionaries so it doesn't break existing configuration files. Issuing warning so that everyone is aware. --- SimCAD/utils/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SimCAD/utils/__init__.py b/SimCAD/utils/__init__.py index 720ab6a..8b620cc 100644 --- a/SimCAD/utils/__init__.py +++ b/SimCAD/utils/__init__.py @@ -10,8 +10,13 @@ def print_pipe(x): def flatten(l): return [item for sublist in l for item in sublist] - +import warnings def key_filter(l, keyname): + if (type(l)==list): + return [v[keyname] for v in l] + # Keeping support to dictionaries for backwards compatibility + # Should be removed in the future + warnings.warn("The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.", FutureWarning) return [v[keyname] for k, v in l.items()] From 2065287a5b99e05aa8e07b71a36fb7b2bfe4004a Mon Sep 17 00:00:00 2001 From: Markus Date: Thu, 17 Jan 2019 10:22:25 -0200 Subject: [PATCH 02/32] make some arguments of the constructor optional SimCAD can run without seed, exogenous_states and env_processes. Making those arguments optional in the configuration constructor reduces the overhead in the user's configuration file. --- SimCAD/configuration/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimCAD/configuration/__init__.py b/SimCAD/configuration/__init__.py index 223de64..6709b80 100644 --- a/SimCAD/configuration/__init__.py +++ b/SimCAD/configuration/__init__.py @@ -7,7 +7,7 @@ from SimCAD.configuration.utils.behaviorAggregation import dict_elemwise_sum class Configuration: - def __init__(self, sim_config, state_dict, seed, exogenous_states, env_processes, mechanisms, behavior_ops=[foldr(dict_elemwise_sum())]): + def __init__(self, sim_config, state_dict, mechanisms, seed={}, exogenous_states={}, env_processes={}, behavior_ops=[foldr(dict_elemwise_sum())]): self.sim_config = sim_config self.state_dict = state_dict self.seed = seed From 0e5daaf723a00202272e9244f6a77bc404b1fb2d Mon Sep 17 00:00:00 2001 From: Markus Date: Fri, 25 Jan 2019 13:50:22 -0200 Subject: [PATCH 03/32] Revert "make some arguments of the constructor optional" This reverts commit 2065287a5b99e05aa8e07b71a36fb7b2bfe4004a. --- SimCAD/configuration/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimCAD/configuration/__init__.py b/SimCAD/configuration/__init__.py index 6709b80..223de64 100644 --- a/SimCAD/configuration/__init__.py +++ b/SimCAD/configuration/__init__.py @@ -7,7 +7,7 @@ from SimCAD.configuration.utils.behaviorAggregation import dict_elemwise_sum class Configuration: - def __init__(self, sim_config, state_dict, mechanisms, seed={}, exogenous_states={}, env_processes={}, behavior_ops=[foldr(dict_elemwise_sum())]): + def __init__(self, sim_config, state_dict, seed, exogenous_states, env_processes, mechanisms, behavior_ops=[foldr(dict_elemwise_sum())]): self.sim_config = sim_config self.state_dict = state_dict self.seed = seed From fae948d8859e4f78418917bbfafcc68ca8364e6f Mon Sep 17 00:00:00 2001 From: Markus Date: Fri, 25 Jan 2019 14:45:03 -0200 Subject: [PATCH 04/32] make some configuration arguments optional Commit 2065287 would break configuration files that relied on the order of the arguments --- SimCAD/configuration/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimCAD/configuration/__init__.py b/SimCAD/configuration/__init__.py index 223de64..a10d7ff 100644 --- a/SimCAD/configuration/__init__.py +++ b/SimCAD/configuration/__init__.py @@ -7,7 +7,7 @@ from SimCAD.configuration.utils.behaviorAggregation import dict_elemwise_sum class Configuration: - def __init__(self, sim_config, state_dict, seed, exogenous_states, env_processes, mechanisms, behavior_ops=[foldr(dict_elemwise_sum())]): + def __init__(self, sim_config, state_dict, seed={}, exogenous_states={}, env_processes={}, mechanisms={}, behavior_ops=[foldr(dict_elemwise_sum())]): self.sim_config = sim_config self.state_dict = state_dict self.seed = seed From 25aa912c2bbcc39c925ff3eae0f9a86c0b7f8a4d Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Feb 2019 09:10:55 -0200 Subject: [PATCH 05/32] rename arguments in the Configuration constructor --- SimCAD/configuration/__init__.py | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/SimCAD/configuration/__init__.py b/SimCAD/configuration/__init__.py index a10d7ff..d9b58e4 100644 --- a/SimCAD/configuration/__init__.py +++ b/SimCAD/configuration/__init__.py @@ -7,14 +7,37 @@ from SimCAD.configuration.utils.behaviorAggregation import dict_elemwise_sum class Configuration: - def __init__(self, sim_config, state_dict, seed={}, exogenous_states={}, env_processes={}, mechanisms={}, behavior_ops=[foldr(dict_elemwise_sum())]): + def __init__(self, sim_config, + # default initial_conditions to empty dict because + # user may be using the state_dict argument + initial_conditions={}, + seeds={}, + exogenous_states={}, env_processes={}, + partial_state_update_blocks={}, + behavior_ops=[foldr(dict_elemwise_sum())], + **kwargs): self.sim_config = sim_config - self.state_dict = state_dict - self.seed = seed + self.state_dict = initial_conditions + self.seed = seeds self.exogenous_states = exogenous_states self.env_processes = env_processes self.behavior_ops = behavior_ops - self.mechanisms = mechanisms + self.mechanisms = partial_state_update_blocks + + # for backwards compatibility, we accept old arguments via **kwargs + # TODO: raise deprecation warnings + for key, value in kwargs.items(): + if (key=='state_dict'): + self.state_dict = value + elif (key=='seed'): + self.seed = value + elif (key=='mechanisms'): + self.mechanisms = value + + if (self.state_dict == {}): + raise Exception('The initial conditions of the system have not been set') + + class Identity: From b19819bd7dbbd4f664fd1c2552633b850f6a6d94 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Feb 2019 09:42:01 -0200 Subject: [PATCH 06/32] rename keys in partial state update blocks --- SimCAD/configuration/__init__.py | 19 +++++++++++++++---- SimCAD/configuration/utils/__init__.py | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/SimCAD/configuration/__init__.py b/SimCAD/configuration/__init__.py index d9b58e4..57951b6 100644 --- a/SimCAD/configuration/__init__.py +++ b/SimCAD/configuration/__init__.py @@ -73,9 +73,9 @@ class Processor: self.apply_identity_funcs = id.apply_identity_funcs def create_matrix_field(self, mechanisms, key): - if key == 'states': + if key == 'state_update_functions': identity = self.state_identity - elif key == 'behaviors': + elif key == 'policies': identity = self.behavior_identity df = pd.DataFrame(key_filter(mechanisms, key)) col_list = self.apply_identity_funcs(identity, df, list(df.columns)) @@ -109,8 +109,19 @@ class Processor: return sdf_values, bdf_values if len(mechanisms) != 0: - bdf = self.create_matrix_field(mechanisms, 'behaviors') - sdf = self.create_matrix_field(mechanisms, 'states') + # for backwards compatibility we accept the old keys + # ('behaviors' and 'states') and rename them + for k, v in mechanisms.items(): + try: + v['policies'] = v.pop('behaviors') + except KeyError: + pass + try: + v['state_update_functions'] = v.pop('states') + except KeyError: + pass + bdf = self.create_matrix_field(mechanisms, 'policies') + sdf = self.create_matrix_field(mechanisms, 'state_update_functions') sdf_values, bdf_values = no_update_handler(bdf, sdf) zipped_list = list(zip(sdf_values, bdf_values)) else: diff --git a/SimCAD/configuration/utils/__init__.py b/SimCAD/configuration/utils/__init__.py index 53dad43..27da8c9 100644 --- a/SimCAD/configuration/utils/__init__.py +++ b/SimCAD/configuration/utils/__init__.py @@ -8,7 +8,7 @@ class TensorFieldReport: def __init__(self, config_proc): self.config_proc = config_proc - def create_tensor_field(self, mechanisms, exo_proc, keys=['behaviors', 'states']): + def create_tensor_field(self, mechanisms, exo_proc, keys=['policies', 'state_update_functions']): dfs = [self.config_proc.create_matrix_field(mechanisms, k) for k in keys] df = pd.concat(dfs, axis=1) for es, i in zip(exo_proc, range(len(exo_proc))): From 53c8764563e99931f6106f062d85aeb9f469a9f8 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Feb 2019 10:01:36 -0200 Subject: [PATCH 07/32] support list of mechsteps instead of dict --- SimCAD/configuration/__init__.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/SimCAD/configuration/__init__.py b/SimCAD/configuration/__init__.py index 57951b6..c0e3146 100644 --- a/SimCAD/configuration/__init__.py +++ b/SimCAD/configuration/__init__.py @@ -108,18 +108,29 @@ class Processor: bdf_values = [[self.b_identity] * len(sdf_values)] return sdf_values, bdf_values - if len(mechanisms) != 0: + def sanitize_mechanisms(m): # for backwards compatibility we accept the old keys # ('behaviors' and 'states') and rename them - for k, v in mechanisms.items(): + def rename_keys(d): try: - v['policies'] = v.pop('behaviors') + d['policies'] = d.pop('behaviors') except KeyError: pass try: - v['state_update_functions'] = v.pop('states') + d['state_update_functions'] = d.pop('states') except KeyError: pass + + if (type(m)==list): + for v in m: + rename_keys(v) + elif (type(m)==dict): + for k, v in mechanisms.items(): + rename_keys(v) + return + + if len(mechanisms) != 0: + sanitize_mechanisms(mechanisms) bdf = self.create_matrix_field(mechanisms, 'policies') sdf = self.create_matrix_field(mechanisms, 'state_update_functions') sdf_values, bdf_values = no_update_handler(bdf, sdf) From 893f1d280a14abe6ebbc52c6376fd6743182cb7f Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Feb 2019 10:12:07 -0200 Subject: [PATCH 08/32] comment --- SimCAD/configuration/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SimCAD/configuration/__init__.py b/SimCAD/configuration/__init__.py index c0e3146..bc911e4 100644 --- a/SimCAD/configuration/__init__.py +++ b/SimCAD/configuration/__init__.py @@ -121,6 +121,8 @@ class Processor: except KeyError: pass + # Also for backwards compatibility, we accept partial state update blocks both as list or dict + # No need for a deprecation warning as it's already raised by SimCAD.utils.key_filter if (type(m)==list): for v in m: rename_keys(v) From f7955b78fde86f168069a91a7dfa9ce1e2666742 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Feb 2019 10:28:09 -0200 Subject: [PATCH 09/32] rename mech_step > sub_timestep open to other suggestions --- SimCAD/configuration/utils/__init__.py | 4 ++-- SimCAD/engine/simulation.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SimCAD/configuration/utils/__init__.py b/SimCAD/configuration/utils/__init__.py index 27da8c9..8034a14 100644 --- a/SimCAD/configuration/utils/__init__.py +++ b/SimCAD/configuration/utils/__init__.py @@ -41,7 +41,7 @@ def time_step(dt_str, dt_format='%Y-%m-%d %H:%M:%S', _timedelta = t_delta): t_delta = timedelta(days=0, minutes=0, seconds=1) def ep_time_step(s, dt_str, fromat_str='%Y-%m-%d %H:%M:%S', _timedelta = t_delta): - if s['mech_step'] == 0: + if s['sub_timestep'] == 0: return time_step(dt_str, fromat_str, _timedelta) else: return dt_str @@ -50,7 +50,7 @@ def ep_time_step(s, dt_str, fromat_str='%Y-%m-%d %H:%M:%S', _timedelta = t_delta def exo_update_per_ts(ep): @curried def ep_decorator(f, y, step, sL, s, _input): - if s['mech_step'] + 1 == 1: + if s['sub_timestep'] + 1 == 1: return f(step, sL, s, _input) else: return (y, s[y]) diff --git a/SimCAD/engine/simulation.py b/SimCAD/engine/simulation.py index 66f065f..558283f 100644 --- a/SimCAD/engine/simulation.py +++ b/SimCAD/engine/simulation.py @@ -43,7 +43,7 @@ class Executor: self.apply_env_proc(env_processes, last_in_copy, last_in_copy['timestamp']) - last_in_copy["mech_step"], last_in_copy["time_step"], last_in_copy['run'] = m_step, t_step, run + last_in_copy["sub_timestep"], last_in_copy["time_step"], last_in_copy['run'] = m_step, t_step, run sL.append(last_in_copy) del last_in_copy @@ -53,7 +53,7 @@ class Executor: m_step = 0 states_list_copy = deepcopy(states_list) genesis_states = states_list_copy[-1] - genesis_states['mech_step'], genesis_states['time_step'] = m_step, t_step + genesis_states['sub_timestep'], genesis_states['time_step'] = m_step, t_step states_list = [genesis_states] m_step += 1 @@ -83,9 +83,9 @@ class Executor: states_list_copy = deepcopy(states_list) head, *tail = self.block_pipeline(states_list_copy, configs, env_processes, time_seq, run) genesis = head.pop() - genesis['mech_step'], genesis['time_step'], genesis['run'] = 0, 0, run + genesis['sub_timestep'], genesis['time_step'], genesis['run'] = 0, 0, run first_timestep_per_run = [genesis] + tail.pop(0) pipe_run += [first_timestep_per_run] + tail del states_list_copy - return pipe_run \ No newline at end of file + return pipe_run From ccdf7ba80d4a02d7cd90c50aa6049c3d02618171 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 11 Feb 2019 17:04:18 -0200 Subject: [PATCH 10/32] Revert "rename mech_step > sub_timestep" This reverts commit f7955b78fde86f168069a91a7dfa9ce1e2666742. --- SimCAD/configuration/utils/__init__.py | 4 ++-- SimCAD/engine/simulation.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SimCAD/configuration/utils/__init__.py b/SimCAD/configuration/utils/__init__.py index 8034a14..27da8c9 100644 --- a/SimCAD/configuration/utils/__init__.py +++ b/SimCAD/configuration/utils/__init__.py @@ -41,7 +41,7 @@ def time_step(dt_str, dt_format='%Y-%m-%d %H:%M:%S', _timedelta = t_delta): t_delta = timedelta(days=0, minutes=0, seconds=1) def ep_time_step(s, dt_str, fromat_str='%Y-%m-%d %H:%M:%S', _timedelta = t_delta): - if s['sub_timestep'] == 0: + if s['mech_step'] == 0: return time_step(dt_str, fromat_str, _timedelta) else: return dt_str @@ -50,7 +50,7 @@ def ep_time_step(s, dt_str, fromat_str='%Y-%m-%d %H:%M:%S', _timedelta = t_delta def exo_update_per_ts(ep): @curried def ep_decorator(f, y, step, sL, s, _input): - if s['sub_timestep'] + 1 == 1: + if s['mech_step'] + 1 == 1: return f(step, sL, s, _input) else: return (y, s[y]) diff --git a/SimCAD/engine/simulation.py b/SimCAD/engine/simulation.py index 558283f..66f065f 100644 --- a/SimCAD/engine/simulation.py +++ b/SimCAD/engine/simulation.py @@ -43,7 +43,7 @@ class Executor: self.apply_env_proc(env_processes, last_in_copy, last_in_copy['timestamp']) - last_in_copy["sub_timestep"], last_in_copy["time_step"], last_in_copy['run'] = m_step, t_step, run + last_in_copy["mech_step"], last_in_copy["time_step"], last_in_copy['run'] = m_step, t_step, run sL.append(last_in_copy) del last_in_copy @@ -53,7 +53,7 @@ class Executor: m_step = 0 states_list_copy = deepcopy(states_list) genesis_states = states_list_copy[-1] - genesis_states['sub_timestep'], genesis_states['time_step'] = m_step, t_step + genesis_states['mech_step'], genesis_states['time_step'] = m_step, t_step states_list = [genesis_states] m_step += 1 @@ -83,9 +83,9 @@ class Executor: states_list_copy = deepcopy(states_list) head, *tail = self.block_pipeline(states_list_copy, configs, env_processes, time_seq, run) genesis = head.pop() - genesis['sub_timestep'], genesis['time_step'], genesis['run'] = 0, 0, run + genesis['mech_step'], genesis['time_step'], genesis['run'] = 0, 0, run first_timestep_per_run = [genesis] + tail.pop(0) pipe_run += [first_timestep_per_run] + tail del states_list_copy - return pipe_run + return pipe_run \ No newline at end of file From 36512142fbbd53c83acec3f30d2973abf934b64d Mon Sep 17 00:00:00 2001 From: Markus Date: Tue, 12 Feb 2019 14:17:51 -0200 Subject: [PATCH 11/32] (time_step, mech_step) -> (timestep, substep) --- SimCAD/configuration/utils/__init__.py | 4 ++-- SimCAD/engine/simulation.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SimCAD/configuration/utils/__init__.py b/SimCAD/configuration/utils/__init__.py index 27da8c9..56d04bf 100644 --- a/SimCAD/configuration/utils/__init__.py +++ b/SimCAD/configuration/utils/__init__.py @@ -41,7 +41,7 @@ def time_step(dt_str, dt_format='%Y-%m-%d %H:%M:%S', _timedelta = t_delta): t_delta = timedelta(days=0, minutes=0, seconds=1) def ep_time_step(s, dt_str, fromat_str='%Y-%m-%d %H:%M:%S', _timedelta = t_delta): - if s['mech_step'] == 0: + if s['substep'] == 0: return time_step(dt_str, fromat_str, _timedelta) else: return dt_str @@ -50,7 +50,7 @@ def ep_time_step(s, dt_str, fromat_str='%Y-%m-%d %H:%M:%S', _timedelta = t_delta def exo_update_per_ts(ep): @curried def ep_decorator(f, y, step, sL, s, _input): - if s['mech_step'] + 1 == 1: + if s['substep'] + 1 == 1: return f(step, sL, s, _input) else: return (y, s[y]) diff --git a/SimCAD/engine/simulation.py b/SimCAD/engine/simulation.py index 66f065f..7132d8f 100644 --- a/SimCAD/engine/simulation.py +++ b/SimCAD/engine/simulation.py @@ -43,7 +43,7 @@ class Executor: self.apply_env_proc(env_processes, last_in_copy, last_in_copy['timestamp']) - last_in_copy["mech_step"], last_in_copy["time_step"], last_in_copy['run'] = m_step, t_step, run + last_in_copy["substep"], last_in_copy["timestep"], last_in_copy['run'] = m_step, t_step, run sL.append(last_in_copy) del last_in_copy @@ -53,7 +53,7 @@ class Executor: m_step = 0 states_list_copy = deepcopy(states_list) genesis_states = states_list_copy[-1] - genesis_states['mech_step'], genesis_states['time_step'] = m_step, t_step + genesis_states['substep'], genesis_states['timestep'] = m_step, t_step states_list = [genesis_states] m_step += 1 @@ -83,9 +83,9 @@ class Executor: states_list_copy = deepcopy(states_list) head, *tail = self.block_pipeline(states_list_copy, configs, env_processes, time_seq, run) genesis = head.pop() - genesis['mech_step'], genesis['time_step'], genesis['run'] = 0, 0, run + genesis['substep'], genesis['timestep'], genesis['run'] = 0, 0, run first_timestep_per_run = [genesis] + tail.pop(0) pipe_run += [first_timestep_per_run] + tail del states_list_copy - return pipe_run \ No newline at end of file + return pipe_run From 011e322706e5833dc0bd92cddb88e6f38a67aca3 Mon Sep 17 00:00:00 2001 From: Markus Date: Tue, 12 Feb 2019 14:19:47 -0200 Subject: [PATCH 12/32] comment print statement it confuses the reader of the analysis notebook, as it looks like an output --- SimCAD/engine/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimCAD/engine/__init__.py b/SimCAD/engine/__init__.py index 66a0773..c468490 100644 --- a/SimCAD/engine/__init__.py +++ b/SimCAD/engine/__init__.py @@ -46,7 +46,7 @@ class Executor: config_proc = Processor() create_tensor_field = TensorFieldReport(config_proc).create_tensor_field - print(self.exec_context+": "+str(self.configs)) + #print(self.exec_context+": "+str(self.configs)) states_lists, Ts, Ns, eps, configs_structs, env_processes_list, mechanisms, simulation_execs = \ [], [], [], [], [], [], [], [] config_idx = 0 From eaf2f4d291cb2789278ca1faf4b44a159af68b1e Mon Sep 17 00:00:00 2001 From: Markus Date: Tue, 12 Feb 2019 15:59:43 -0200 Subject: [PATCH 13/32] change the env_proc trigger from `timestamp` to `timestep` This achieves the same results without requiring `timestamp` to be a mandatory state variable --- SimCAD/engine/simulation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimCAD/engine/simulation.py b/SimCAD/engine/simulation.py index 7132d8f..0b75bf4 100644 --- a/SimCAD/engine/simulation.py +++ b/SimCAD/engine/simulation.py @@ -41,7 +41,7 @@ class Executor: del last_in_obj - self.apply_env_proc(env_processes, last_in_copy, last_in_copy['timestamp']) + self.apply_env_proc(env_processes, last_in_copy, last_in_copy['timestep']) last_in_copy["substep"], last_in_copy["timestep"], last_in_copy['run'] = m_step, t_step, run sL.append(last_in_copy) From 06367f0573a098e6692c8cb07c17668fb426d132 Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Thu, 14 Feb 2019 10:34:05 -0500 Subject: [PATCH 14/32] backwards merge --- simulations/example_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulations/example_run.py b/simulations/example_run.py index 8b265aa..b179e49 100644 --- a/simulations/example_run.py +++ b/simulations/example_run.py @@ -2,7 +2,7 @@ import pandas as pd from tabulate import tabulate # The following imports NEED to be in the exact order from SimCAD.engine import ExecutionMode, ExecutionContext, Executor -from simulations.validation import config1, config2 # sweep_config +from simulations.validation import sweep_config, config1, config2 from SimCAD import configs exec_mode = ExecutionMode() From 76fb4525083c64a7ab4f39324b1f0c2072f759fd Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Thu, 14 Feb 2019 15:27:51 -0500 Subject: [PATCH 15/32] renaming --- SimCAD/configuration/__init__.py | 72 +++++++++---------- SimCAD/configuration/utils/__init__.py | 38 +++++----- ...iorAggregation.py => policyAggregation.py} | 2 +- SimCAD/engine/__init__.py | 16 ++--- SimCAD/engine/simulation.py | 59 ++++++++------- SimCAD/engine/utils.py | 4 +- SimCAD/utils/__init__.py | 9 ++- simulations/validation/config1.py | 46 ++++++------ simulations/validation/config2.py | 46 ++++++------ simulations/validation/sweep_config.py | 42 +++++------ 10 files changed, 170 insertions(+), 164 deletions(-) rename SimCAD/configuration/utils/{behaviorAggregation.py => policyAggregation.py} (97%) diff --git a/SimCAD/configuration/__init__.py b/SimCAD/configuration/__init__.py index 018a4d7..1440b54 100644 --- a/SimCAD/configuration/__init__.py +++ b/SimCAD/configuration/__init__.py @@ -4,23 +4,23 @@ import pandas as pd from SimCAD import configs from SimCAD.utils import key_filter -from SimCAD.configuration.utils.behaviorAggregation import dict_elemwise_sum +from SimCAD.configuration.utils.policyAggregation import dict_elemwise_sum from SimCAD.configuration.utils import exo_update_per_ts class Configuration(object): - def __init__(self, sim_config=None, state_dict=None, seed=None, env_processes=None, - exogenous_states=None, mechanisms=None, behavior_ops=[foldr(dict_elemwise_sum())]): + def __init__(self, sim_config=None, initial_state=None, seeds=None, env_processes=None, + exogenous_states=None, partial_state_updates=None, policy_ops=[foldr(dict_elemwise_sum())]): self.sim_config = sim_config - self.state_dict = state_dict - self.seed = seed + self.initial_state = initial_state + self.seeds = seeds self.env_processes = env_processes self.exogenous_states = exogenous_states - self.mechanisms = mechanisms - self.behavior_ops = behavior_ops + self.partial_state_updates = partial_state_updates + self.policy_ops = policy_ops -def append_configs(sim_configs, state_dict, seed, raw_exogenous_states, env_processes, mechanisms, _exo_update_per_ts=True): +def append_configs(sim_configs, initial_state, seeds, raw_exogenous_states, env_processes, partial_state_updates, _exo_update_per_ts=True): if _exo_update_per_ts is True: exogenous_states = exo_update_per_ts(raw_exogenous_states) else: @@ -31,41 +31,41 @@ def append_configs(sim_configs, state_dict, seed, raw_exogenous_states, env_proc configs.append( Configuration( sim_config=sim_config, - state_dict=state_dict, - seed=seed, + initial_state=initial_state, + seeds=seeds, exogenous_states=exogenous_states, env_processes=env_processes, - mechanisms=mechanisms + partial_state_updates=partial_state_updates ) ) elif isinstance(sim_configs, dict): configs.append( Configuration( sim_config=sim_configs, - state_dict=state_dict, - seed=seed, + initial_state=initial_state, + seeds=seeds, exogenous_states=exogenous_states, env_processes=env_processes, - mechanisms=mechanisms + partial_state_updates=partial_state_updates ) ) class Identity: - def __init__(self, behavior_id={'identity': 0}): - self.beh_id_return_val = behavior_id + def __init__(self, policy_id={'identity': 0}): + self.beh_id_return_val = policy_id - def b_identity(self, var_dict, step, sL, s): + def p_identity(self, var_dict, sub_step, sL, s): return self.beh_id_return_val - def behavior_identity(self, k): - return self.b_identity + def policy_identity(self, k): + return self.p_identity - def no_state_identity(self, var_dict, step, sL, s, _input): + def no_state_identity(self, var_dict, sub_step, sL, s, _input): return None def state_identity(self, k): - return lambda var_dict, step, sL, s, _input: (k, s[k]) + return lambda var_dict, sub_step, sL, s, _input: (k, s[k]) def apply_identity_funcs(self, identity, df, cols): def fillna_with_id_func(identity, df, col): @@ -77,34 +77,34 @@ class Identity: class Processor: def __init__(self, id=Identity()): self.id = id - self.b_identity = id.b_identity - self.behavior_identity = id.behavior_identity + self.p_identity = id.p_identity + self.policy_identity = id.policy_identity self.no_state_identity = id.no_state_identity self.state_identity = id.state_identity self.apply_identity_funcs = id.apply_identity_funcs - def create_matrix_field(self, mechanisms, key): + def create_matrix_field(self, partial_state_updates, key): if key == 'states': identity = self.state_identity - elif key == 'behaviors': - identity = self.behavior_identity - df = pd.DataFrame(key_filter(mechanisms, key)) + elif key == 'policies': + identity = self.policy_identity + df = pd.DataFrame(key_filter(partial_state_updates, key)) col_list = self.apply_identity_funcs(identity, df, list(df.columns)) if len(col_list) != 0: return reduce((lambda x, y: pd.concat([x, y], axis=1)), col_list) else: return pd.DataFrame({'empty': []}) - def generate_config(self, state_dict, mechanisms, exo_proc): + def generate_config(self, initial_state, partial_state_updates, exo_proc): def no_update_handler(bdf, sdf): if (bdf.empty == False) and (sdf.empty == True): bdf_values = bdf.values.tolist() - sdf_values = [[self.no_state_identity] * len(bdf_values) for m in range(len(mechanisms))] + sdf_values = [[self.no_state_identity] * len(bdf_values) for m in range(len(partial_state_updates))] return sdf_values, bdf_values elif (bdf.empty == True) and (sdf.empty == False): sdf_values = sdf.values.tolist() - bdf_values = [[self.b_identity] * len(sdf_values) for m in range(len(mechanisms))] + bdf_values = [[self.b_identity] * len(sdf_values) for m in range(len(partial_state_updates))] return sdf_values, bdf_values else: sdf_values = sdf.values.tolist() @@ -113,19 +113,19 @@ class Processor: def only_ep_handler(state_dict): sdf_functions = [ - lambda step, sL, s, _input: (k, v) for k, v in zip(state_dict.keys(), state_dict.values()) + lambda sub_step, sL, s, _input: (k, v) for k, v in zip(state_dict.keys(), state_dict.values()) ] sdf_values = [sdf_functions] - bdf_values = [[self.b_identity] * len(sdf_values)] + bdf_values = [[self.p_identity] * len(sdf_values)] return sdf_values, bdf_values - if len(mechanisms) != 0: - bdf = self.create_matrix_field(mechanisms, 'behaviors') - sdf = self.create_matrix_field(mechanisms, 'states') + if len(partial_state_updates) != 0: + bdf = self.create_matrix_field(partial_state_updates, 'policies') + sdf = self.create_matrix_field(partial_state_updates, 'states') sdf_values, bdf_values = no_update_handler(bdf, sdf) zipped_list = list(zip(sdf_values, bdf_values)) else: - sdf_values, bdf_values = only_ep_handler(state_dict) + sdf_values, bdf_values = only_ep_handler(initial_state) zipped_list = list(zip(sdf_values, bdf_values)) return list(map(lambda x: (x[0] + exo_proc, x[1]), zipped_list)) diff --git a/SimCAD/configuration/utils/__init__.py b/SimCAD/configuration/utils/__init__.py index f5334d5..814efcf 100644 --- a/SimCAD/configuration/utils/__init__.py +++ b/SimCAD/configuration/utils/__init__.py @@ -11,8 +11,8 @@ class TensorFieldReport: def __init__(self, config_proc): self.config_proc = config_proc - def create_tensor_field(self, mechanisms, exo_proc, keys=['behaviors', 'states']): - dfs = [self.config_proc.create_matrix_field(mechanisms, k) for k in keys] + def create_tensor_field(self, partial_state_updates, exo_proc, keys=['policies', 'states']): + dfs = [self.config_proc.create_matrix_field(partial_state_updates, k) for k in keys] df = pd.concat(dfs, axis=1) for es, i in zip(exo_proc, range(len(exo_proc))): df['es' + str(i + 1)] = es @@ -25,7 +25,7 @@ class TensorFieldReport: # # def state_update(y, x): - return lambda step, sL, s, _input: (y, x) + return lambda sub_step, sL, s, _input: (y, x) def bound_norm_random(rng, low, high): @@ -36,15 +36,15 @@ def bound_norm_random(rng, low, high): @curried -def proc_trigger(trigger_step, update_f, step): - if step == trigger_step: +def proc_trigger(trigger_time, update_f, time): + if time == trigger_time: return update_f else: return lambda x: x -step_t_delta = timedelta(days=0, minutes=0, seconds=30) -def time_step(dt_str, dt_format='%Y-%m-%d %H:%M:%S', _timedelta = step_t_delta): +tstep_delta = timedelta(days=0, minutes=0, seconds=30) +def time_step(dt_str, dt_format='%Y-%m-%d %H:%M:%S', _timedelta = tstep_delta): dt = datetime.strptime(dt_str, dt_format) t = dt + _timedelta return t.strftime(dt_format) @@ -57,11 +57,11 @@ def ep_time_step(s, dt_str, fromat_str='%Y-%m-%d %H:%M:%S', _timedelta = ep_t_de else: return dt_str - -def mech_sweep_filter(mech_field, mechanisms): - mech_dict = dict([(k, v[mech_field]) for k, v in mechanisms.items()]) +# mech_sweep_filter +def partial_state_sweep_filter(state_field, partial_state_updates): + partial_state_dict = dict([(k, v[state_field]) for k, v in partial_state_updates.items()]) return dict([ - (k, dict_filter(v, lambda v: isinstance(v, list))) for k, v in mech_dict.items() + (k, dict_filter(v, lambda v: isinstance(v, list))) for k, v in partial_state_dict.items() if contains_type(list(v.values()), list) ]) @@ -69,16 +69,18 @@ def mech_sweep_filter(mech_field, mechanisms): def state_sweep_filter(raw_exogenous_states): return dict([(k, v) for k, v in raw_exogenous_states.items() if isinstance(v, list)]) +# sweep_mech_states @curried -def sweep_mechs(_type, in_config): +def sweep_partial_states(_type, in_config): configs = [] - filtered_mech_states = mech_sweep_filter(_type, in_config.mechanisms) - if len(filtered_mech_states) > 0: - for mech, state_dict in filtered_mech_states.items(): + # filtered_mech_states + filtered_partial_states = partial_state_sweep_filter(_type, in_config.partial_state_updates) + if len(filtered_partial_states) > 0: + for partial_state, state_dict in filtered_partial_states.items(): for state, state_funcs in state_dict.items(): for f in state_funcs: config = deepcopy(in_config) - config.mechanisms[mech][_type][state] = f + config.partial_state_updates[partial_state][_type][state] = f configs.append(config) del config else: @@ -111,9 +113,9 @@ def sweep_states(state_type, states, in_config): def exo_update_per_ts(ep): @curried - def ep_decorator(f, y, var_dict, step, sL, s, _input): + def ep_decorator(f, y, var_dict, sub_step, sL, s, _input): if s['mech_step'] + 1 == 1: - return f(var_dict, step, sL, s, _input) # curry_pot + return f(var_dict, sub_step, sL, s, _input) else: return y, s[y] diff --git a/SimCAD/configuration/utils/behaviorAggregation.py b/SimCAD/configuration/utils/policyAggregation.py similarity index 97% rename from SimCAD/configuration/utils/behaviorAggregation.py rename to SimCAD/configuration/utils/policyAggregation.py index a16f5e1..eac845d 100644 --- a/SimCAD/configuration/utils/behaviorAggregation.py +++ b/SimCAD/configuration/utils/policyAggregation.py @@ -13,7 +13,7 @@ def get_base_value(x): return 0 -def behavior_to_dict(v): +def policy_to_dict(v): return dict(list(zip(map(lambda n: 'b' + str(n + 1), list(range(len(v)))), v))) diff --git a/SimCAD/engine/__init__.py b/SimCAD/engine/__init__.py index 33fb8ef..139d126 100644 --- a/SimCAD/engine/__init__.py +++ b/SimCAD/engine/__init__.py @@ -47,7 +47,7 @@ class Executor: create_tensor_field = TensorFieldReport(config_proc).create_tensor_field print(self.exec_context+": "+str(self.configs)) - var_dict_list, states_lists, Ts, Ns, eps, configs_structs, env_processes_list, mechanisms, simulation_execs = \ + var_dict_list, states_lists, Ts, Ns, eps, configs_structs, env_processes_list, partial_state_updates, simulation_execs = \ [], [], [], [], [], [], [], [], [] config_idx = 0 for x in self.configs: @@ -55,24 +55,24 @@ class Executor: Ts.append(x.sim_config['T']) Ns.append(x.sim_config['N']) var_dict_list.append(x.sim_config['M']) - states_lists.append([x.state_dict]) + states_lists.append([x.initial_state]) eps.append(list(x.exogenous_states.values())) - configs_structs.append(config_proc.generate_config(x.state_dict, x.mechanisms, eps[config_idx])) + configs_structs.append(config_proc.generate_config(x.initial_state, x.partial_state_updates, eps[config_idx])) env_processes_list.append(x.env_processes) - mechanisms.append(x.mechanisms) - simulation_execs.append(SimExecutor(x.behavior_ops).simulation) + partial_state_updates.append(x.partial_state_updates) + simulation_execs.append(SimExecutor(x.policy_ops).simulation) config_idx += 1 if self.exec_context == ExecutionMode.single_proc: - tensor_field = create_tensor_field(mechanisms.pop(), eps.pop()) + tensor_field = create_tensor_field(partial_state_updates.pop(), eps.pop()) result = self.exec_method(simulation_execs, var_dict_list, states_lists, configs_structs, env_processes_list, Ts, Ns) return result, tensor_field elif self.exec_context == ExecutionMode.multi_proc: if len(self.configs) > 1: simulations = self.exec_method(simulation_execs, var_dict_list, states_lists, configs_structs, env_processes_list, Ts, Ns) results = [] - for result, mechanism, ep in list(zip(simulations, mechanisms, eps)): - results.append((flatten(result), create_tensor_field(mechanism, ep))) + for result, partial_state_updates, ep in list(zip(simulations, partial_state_updates, eps)): + results.append((flatten(result), create_tensor_field(partial_state_updates, ep))) return results diff --git a/SimCAD/engine/simulation.py b/SimCAD/engine/simulation.py index 759e7ce..288af7e 100644 --- a/SimCAD/engine/simulation.py +++ b/SimCAD/engine/simulation.py @@ -7,41 +7,39 @@ id_exception = engine_exception(KeyError, KeyError, None) class Executor: - def __init__(self, behavior_ops, behavior_update_exception=id_exception, state_update_exception=id_exception): - self.behavior_ops = behavior_ops + def __init__(self, policy_ops, policy_update_exception=id_exception, state_update_exception=id_exception): + self.policy_ops = policy_ops # behavior_ops self.state_update_exception = state_update_exception - self.behavior_update_exception = behavior_update_exception + self.policy_update_exception = policy_update_exception # behavior_update_exception - def get_behavior_input(self, var_dict, step, sL, s, funcs): - ops = self.behavior_ops[::-1] + # get_behavior_input + def get_policy_input(self, var_dict, sub_step, sL, s, funcs): + ops = self.policy_ops[::-1] - def get_col_results(var_dict, step, sL, s, funcs): - # return list(map(lambda f: curry_pot(f, step, sL, s), funcs)) - return list(map(lambda f: f(var_dict, step, sL, s), funcs)) + def get_col_results(var_dict, sub_step, sL, s, funcs): + return list(map(lambda f: f(var_dict, sub_step, sL, s), funcs)) - # print(get_col_results(step, sL, s, funcs)) - return foldr(call, get_col_results(var_dict, step, sL, s, funcs))(ops) + return foldr(call, get_col_results(var_dict, sub_step, sL, s, funcs))(ops) - def apply_env_proc(self, env_processes, state_dict, step): + def apply_env_proc(self, env_processes, state_dict, sub_step): for state in state_dict.keys(): if state in list(env_processes.keys()): env_state = env_processes[state] if (env_state.__name__ == '_curried') or (env_state.__name__ == 'proc_trigger'): - state_dict[state] = env_state(step)(state_dict[state]) + state_dict[state] = env_state(sub_step)(state_dict[state]) else: state_dict[state] = env_state(state_dict[state]) - def mech_step(self, var_dict, m_step, sL, state_funcs, behavior_funcs, env_processes, t_step, run): + # mech_step + def partial_state_update(self, var_dict, sub_step, sL, state_funcs, policy_funcs, env_processes, time_step, run): last_in_obj = sL[-1] - _input = self.behavior_update_exception(self.get_behavior_input(var_dict, m_step, sL, last_in_obj, behavior_funcs)) - # print(_input) + _input = self.policy_update_exception(self.get_policy_input(var_dict, sub_step, sL, last_in_obj, policy_funcs)) # ToDo: add env_proc generator to `last_in_copy` iterator as wrapper function last_in_copy = dict( [ - # self.state_update_exception(curry_pot(f, m_step, sL, last_in_obj, _input)) for f in state_funcs - self.state_update_exception(f(var_dict, m_step, sL, last_in_obj, _input)) for f in state_funcs + self.state_update_exception(f(var_dict, sub_step, sL, last_in_obj, _input)) for f in state_funcs ] ) @@ -53,48 +51,47 @@ class Executor: self.apply_env_proc(env_processes, last_in_copy, last_in_copy['timestamp']) - last_in_copy["mech_step"], last_in_copy["time_step"], last_in_copy['run'] = m_step, t_step, run + last_in_copy["mech_step"], last_in_copy["time_step"], last_in_copy['run'] = sub_step, time_step, run sL.append(last_in_copy) del last_in_copy return sL - def mech_pipeline(self, var_dict, states_list, configs, env_processes, t_step, run): - m_step = 0 + # mech_pipeline + def state_update_pipeline(self, var_dict, states_list, configs, env_processes, time_step, run): + sub_step = 0 states_list_copy = deepcopy(states_list) genesis_states = states_list_copy[-1] - genesis_states['mech_step'], genesis_states['time_step'] = m_step, t_step + genesis_states['mech_step'], genesis_states['time_step'] = sub_step, time_step states_list = [genesis_states] - m_step += 1 + sub_step += 1 for config in configs: - s_conf, b_conf = config[0], config[1] - states_list = self.mech_step(var_dict, m_step, states_list, s_conf, b_conf, env_processes, t_step, run) - m_step += 1 + s_conf, p_conf = config[0], config[1] + states_list = self.partial_state_update(var_dict, sub_step, states_list, s_conf, p_conf, env_processes, time_step, run) + sub_step += 1 - t_step += 1 + time_step += 1 return states_list - # ToDo: Rename Run Pipeline - def block_pipeline(self, var_dict, states_list, configs, env_processes, time_seq, run): + def run_pipeline(self, var_dict, states_list, configs, env_processes, time_seq, run): time_seq = [x + 1 for x in time_seq] simulation_list = [states_list] for time_step in time_seq: - pipe_run = self.mech_pipeline(var_dict, simulation_list[-1], configs, env_processes, time_step, run) + pipe_run = self.state_update_pipeline(var_dict, simulation_list[-1], configs, env_processes, time_step, run) _, *pipe_run = pipe_run simulation_list.append(pipe_run) return simulation_list - # ToDo: Muiltithreaded Runs def simulation(self, var_dict, states_list, configs, env_processes, time_seq, runs): pipe_run = [] for run in range(runs): run += 1 states_list_copy = deepcopy(states_list) - head, *tail = self.block_pipeline(var_dict, states_list_copy, configs, env_processes, time_seq, run) + head, *tail = self.run_pipeline(var_dict, states_list_copy, configs, env_processes, time_seq, run) genesis = head.pop() genesis['mech_step'], genesis['time_step'], genesis['run'] = 0, 0, run first_timestep_per_run = [genesis] + tail.pop(0) diff --git a/SimCAD/engine/utils.py b/SimCAD/engine/utils.py index 2e569b8..c0f3a76 100644 --- a/SimCAD/engine/utils.py +++ b/SimCAD/engine/utils.py @@ -24,8 +24,8 @@ def retrieve_state(l, offset): return l[last_index(l) + offset + 1] -# exception_function = f(m_step, sL, sL[-2], _input) -# try_function = f(m_step, sL, last_mut_obj, _input) +# exception_function = f(sub_step, sL, sL[-2], _input) +# try_function = f(sub_step, sL, last_mut_obj, _input) @curried def engine_exception(ErrorType, error_message, exception_function, try_function): try: diff --git a/SimCAD/utils/__init__.py b/SimCAD/utils/__init__.py index 495d09e..b29ba08 100644 --- a/SimCAD/utils/__init__.py +++ b/SimCAD/utils/__init__.py @@ -1,6 +1,6 @@ from collections import defaultdict from itertools import product - +import warnings def pipe(x): return x @@ -77,6 +77,13 @@ def drop_right(l, n): def key_filter(l, keyname): + if (type(l) == list): + return [v[keyname] for v in l] + # Keeping support to dictionaries for backwards compatibility + # Should be removed in the future + warnings.warn( + "The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.", + FutureWarning) return [v[keyname] for k, v in l.items()] diff --git a/simulations/validation/config1.py b/simulations/validation/config1.py index f1bfe70..ce74604 100644 --- a/simulations/validation/config1.py +++ b/simulations/validation/config1.py @@ -7,7 +7,7 @@ from SimCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_ from SimCAD.configuration.utils.parameterSweep import config_sim -seed = { +seeds = { 'z': np.random.RandomState(1), 'a': np.random.RandomState(2), 'b': np.random.RandomState(3), @@ -15,20 +15,20 @@ seed = { } -# Behaviors per Mechanism -def b1m1(_g, step, sL, s): +# Policies per Mechanism +def p1m1(_g, step, sL, s): return {'param1': 1} -def b2m1(_g, step, sL, s): +def p2m1(_g, step, sL, s): return {'param2': 4} -def b1m2(_g, step, sL, s): +def p1m2(_g, step, sL, s): return {'param1': 'a', 'param2': 2} -def b2m2(_g, step, sL, s): +def p2m2(_g, step, sL, s): return {'param1': 'b', 'param2': 4} -def b1m3(_g, step, sL, s): +def p1m3(_g, step, sL, s): return {'param1': ['c'], 'param2': np.array([10, 100])} -def b2m3(_g, step, sL, s): +def p2m3(_g, step, sL, s): return {'param1': ['d'], 'param2': np.array([20, 200])} @@ -67,12 +67,12 @@ proc_one_coef_B = 1.3 def es3p1(_g, step, sL, s, _input): y = 's3' - x = s['s3'] * bound_norm_random(seed['a'], proc_one_coef_A, proc_one_coef_B) + x = s['s3'] * bound_norm_random(seeds['a'], proc_one_coef_A, proc_one_coef_B) return (y, x) def es4p2(_g, step, sL, s, _input): y = 's4' - x = s['s4'] * bound_norm_random(seed['b'], proc_one_coef_A, proc_one_coef_B) + x = s['s4'] * bound_norm_random(seeds['b'], proc_one_coef_A, proc_one_coef_B) return (y, x) ts_format = '%Y-%m-%d %H:%M:%S' @@ -115,11 +115,11 @@ env_processes = { } -mechanisms = { +partial_state_update_block = { "m1": { - "behaviors": { - "b1": b1m1, - "b2": b2m1 + "policies": { + "b1": p1m1, + "b2": p2m1 }, "states": { "s1": s1m1, @@ -127,9 +127,9 @@ mechanisms = { } }, "m2": { - "behaviors": { - "b1": b1m2, - "b2": b2m2 + "policies": { + "b1": p1m2, + "b2": p2m2 }, "states": { "s1": s1m2, @@ -137,9 +137,9 @@ mechanisms = { } }, "m3": { - "behaviors": { - "b1": b1m3, - "b2": b2m3 + "policies": { + "b1": p1m3, + "b2": p2m3 }, "states": { "s1": s1m3, @@ -159,9 +159,9 @@ sim_config = config_sim( append_configs( sim_configs=sim_config, - state_dict=genesis_states, - seed=seed, + initial_state=genesis_states, + seeds=seeds, raw_exogenous_states=raw_exogenous_states, env_processes=env_processes, - mechanisms=mechanisms + partial_state_updates=partial_state_update_block ) diff --git a/simulations/validation/config2.py b/simulations/validation/config2.py index 98705e6..987e8c0 100644 --- a/simulations/validation/config2.py +++ b/simulations/validation/config2.py @@ -6,7 +6,7 @@ from SimCAD.configuration import append_configs from SimCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step from SimCAD.configuration.utils.parameterSweep import config_sim -seed = { +seeds = { 'z': np.random.RandomState(1), 'a': np.random.RandomState(2), 'b': np.random.RandomState(3), @@ -14,20 +14,20 @@ seed = { } -# Behaviors per Mechanism -def b1m1(_g, step, sL, s): +# Policies per Mechanism +def p1m1(_g, step, sL, s): return {'param1': 1} -def b2m1(_g, step, sL, s): +def p2m1(_g, step, sL, s): return {'param2': 4} -def b1m2(_g, step, sL, s): +def p1m2(_g, step, sL, s): return {'param1': 'a', 'param2': 2} -def b2m2(_g, step, sL, s): +def p2m2(_g, step, sL, s): return {'param1': 'b', 'param2': 4} -def b1m3(_g, step, sL, s): +def p1m3(_g, step, sL, s): return {'param1': ['c'], 'param2': np.array([10, 100])} -def b2m3(_g, step, sL, s): +def p2m3(_g, step, sL, s): return {'param1': ['d'], 'param2': np.array([20, 200])} @@ -66,12 +66,12 @@ proc_one_coef_B = 1.3 def es3p1(_g, step, sL, s, _input): y = 's3' - x = s['s3'] * bound_norm_random(seed['a'], proc_one_coef_A, proc_one_coef_B) + x = s['s3'] * bound_norm_random(seeds['a'], proc_one_coef_A, proc_one_coef_B) return (y, x) def es4p2(_g, step, sL, s, _input): y = 's4' - x = s['s4'] * bound_norm_random(seed['b'], proc_one_coef_A, proc_one_coef_B) + x = s['s4'] * bound_norm_random(seeds['b'], proc_one_coef_A, proc_one_coef_B) return (y, x) ts_format = '%Y-%m-%d %H:%M:%S' @@ -114,11 +114,11 @@ env_processes = { } -mechanisms = { +partial_state_update_block = { "m1": { - "behaviors": { - "b1": b1m1, - # "b2": b2m1 + "policies": { + "b1": p1m1, + # "b2": p2m1 }, "states": { "s1": s1m1, @@ -126,9 +126,9 @@ mechanisms = { } }, "m2": { - "behaviors": { - "b1": b1m2, - # "b2": b2m2 + "policies": { + "b1": p1m2, + # "b2": p2m2 }, "states": { "s1": s1m2, @@ -136,9 +136,9 @@ mechanisms = { } }, "m3": { - "behaviors": { - "b1": b1m3, - "b2": b2m3 + "policies": { + "b1": p1m3, + "b2": p2m3 }, "states": { "s1": s1m3, @@ -158,9 +158,9 @@ sim_config = config_sim( append_configs( sim_configs=sim_config, - state_dict=genesis_states, - seed=seed, + initial_state=genesis_states, + seeds=seeds, raw_exogenous_states=raw_exogenous_states, env_processes=env_processes, - mechanisms=mechanisms + partial_state_updates=partial_state_update_block ) diff --git a/simulations/validation/sweep_config.py b/simulations/validation/sweep_config.py index e2d1880..c93a703 100644 --- a/simulations/validation/sweep_config.py +++ b/simulations/validation/sweep_config.py @@ -9,7 +9,7 @@ from SimCAD.configuration.utils.parameterSweep import config_sim pp = pprint.PrettyPrinter(indent=4) -seed = { +seeds = { 'z': np.random.RandomState(1), 'a': np.random.RandomState(2), 'b': np.random.RandomState(3), @@ -24,23 +24,23 @@ g = { 'omega': [7] } -# Behaviors per Mechanism -def b1m1(_g, step, sL, s): +# Policies per Mechanism +def p1m1(_g, step, sL, s): return {'param1': 1} -def b2m1(_g, step, sL, s): +def p2m1(_g, step, sL, s): return {'param2': 4} -def b1m2(_g, step, sL, s): +def p1m2(_g, step, sL, s): return {'param1': 'a', 'param2': _g['beta']} -def b2m2(_g, step, sL, s): +def p2m2(_g, step, sL, s): return {'param1': 'b', 'param2': 0} -def b1m3(_g, step, sL, s): +def p1m3(_g, step, sL, s): return {'param1': np.array([10, 100])} -def b2m3(_g, step, sL, s): +def p2m3(_g, step, sL, s): return {'param1': np.array([20, 200])} # Internal States per Mechanism @@ -143,11 +143,11 @@ env_processes = { # sweep exo_state func and point to exo-state in every other funtion # param sweep on genesis states -mechanisms = { +partial_state_update_block = { "m1": { - "behaviors": { - "b1": b1m1, - "b2": b2m1 + "policies": { + "b1": p1m1, + "b2": p2m1 }, "states": { "s1": s1m1, @@ -155,9 +155,9 @@ mechanisms = { } }, "m2": { - "behaviors": { - "b1": b1m2, - "b2": b2m2, + "policies": { + "b1": p1m2, + "b2": p2m2, }, "states": { "s1": s1m2, @@ -165,9 +165,9 @@ mechanisms = { } }, "m3": { - "behaviors": { - "b1": b1m3, - "b2": b2m3 + "policies": { + "b1": p1m3, + "b2": p2m3 }, "states": { "s1": s1m3, @@ -188,9 +188,9 @@ sim_config = config_sim( append_configs( sim_configs=sim_config, - state_dict=genesis_states, - seed=seed, + initial_state=genesis_states, + seeds=seeds, raw_exogenous_states=raw_exogenous_states, env_processes=env_processes, - mechanisms=mechanisms + partial_state_updates=partial_state_update_block ) \ No newline at end of file From fcda21d513286ab0efb7e1e9158568a4b0dd0281 Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Thu, 14 Feb 2019 15:38:57 -0500 Subject: [PATCH 16/32] renaming --- SimCAD/configuration/utils/__init__.py | 4 ++-- SimCAD/engine/simulation.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SimCAD/configuration/utils/__init__.py b/SimCAD/configuration/utils/__init__.py index 814efcf..ab5113d 100644 --- a/SimCAD/configuration/utils/__init__.py +++ b/SimCAD/configuration/utils/__init__.py @@ -52,7 +52,7 @@ def time_step(dt_str, dt_format='%Y-%m-%d %H:%M:%S', _timedelta = tstep_delta): ep_t_delta = timedelta(days=0, minutes=0, seconds=1) def ep_time_step(s, dt_str, fromat_str='%Y-%m-%d %H:%M:%S', _timedelta = ep_t_delta): - if s['mech_step'] == 0: + if s['sub_step'] == 0: return time_step(dt_str, fromat_str, _timedelta) else: return dt_str @@ -114,7 +114,7 @@ def sweep_states(state_type, states, in_config): def exo_update_per_ts(ep): @curried def ep_decorator(f, y, var_dict, sub_step, sL, s, _input): - if s['mech_step'] + 1 == 1: + if s['sub_step'] + 1 == 1: return f(var_dict, sub_step, sL, s, _input) else: return y, s[y] diff --git a/SimCAD/engine/simulation.py b/SimCAD/engine/simulation.py index 288af7e..4d855b1 100644 --- a/SimCAD/engine/simulation.py +++ b/SimCAD/engine/simulation.py @@ -51,7 +51,7 @@ class Executor: self.apply_env_proc(env_processes, last_in_copy, last_in_copy['timestamp']) - last_in_copy["mech_step"], last_in_copy["time_step"], last_in_copy['run'] = sub_step, time_step, run + last_in_copy["sub_step"], last_in_copy["time_step"], last_in_copy['run'] = sub_step, time_step, run sL.append(last_in_copy) del last_in_copy @@ -62,7 +62,7 @@ class Executor: sub_step = 0 states_list_copy = deepcopy(states_list) genesis_states = states_list_copy[-1] - genesis_states['mech_step'], genesis_states['time_step'] = sub_step, time_step + genesis_states['sub_step'], genesis_states['time_step'] = sub_step, time_step states_list = [genesis_states] sub_step += 1 @@ -93,7 +93,7 @@ class Executor: states_list_copy = deepcopy(states_list) head, *tail = self.run_pipeline(var_dict, states_list_copy, configs, env_processes, time_seq, run) genesis = head.pop() - genesis['mech_step'], genesis['time_step'], genesis['run'] = 0, 0, run + genesis['sub_step'], genesis['time_step'], genesis['run'] = 0, 0, run first_timestep_per_run = [genesis] + tail.pop(0) pipe_run += [first_timestep_per_run] + tail del states_list_copy From 2d4b7b612c90adc79487e51ffab07c7d0f2be588 Mon Sep 17 00:00:00 2001 From: Markus Date: Thu, 14 Feb 2019 22:35:28 -0200 Subject: [PATCH 17/32] renaming SimCAD to cadCAD --- .gitignore | 3 ++- README.md | 6 +++--- SimCAD/__init__.py | 2 -- cadCAD/__init__.py | 2 ++ {SimCAD => cadCAD}/configuration/__init__.py | 6 +++--- .../configuration/utils/__init__.py | 0 .../configuration/utils/behaviorAggregation.py | 0 {SimCAD => cadCAD}/engine/__init__.py | 8 ++++---- {SimCAD => cadCAD}/engine/simulation.py | 2 +- {SimCAD => cadCAD}/engine/utils.py | 0 {SimCAD => cadCAD}/utils/__init__.py | 0 dist/cadCAD-0.2-py3-none-any.whl | Bin 0 -> 8122 bytes dist/cadCAD-0.2.tar.gz | Bin 0 -> 6685 bytes setup.py | 8 ++++---- 14 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 SimCAD/__init__.py create mode 100644 cadCAD/__init__.py rename {SimCAD => cadCAD}/configuration/__init__.py (97%) rename {SimCAD => cadCAD}/configuration/utils/__init__.py (100%) rename {SimCAD => cadCAD}/configuration/utils/behaviorAggregation.py (100%) rename {SimCAD => cadCAD}/engine/__init__.py (94%) rename {SimCAD => cadCAD}/engine/simulation.py (98%) rename {SimCAD => cadCAD}/engine/utils.py (100%) rename {SimCAD => cadCAD}/utils/__init__.py (100%) create mode 100644 dist/cadCAD-0.2-py3-none-any.whl create mode 100644 dist/cadCAD-0.2.tar.gz diff --git a/.gitignore b/.gitignore index a9e45ba..5e2a723 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ results simulations/.ipynb_checkpoints build -SimCAD.egg-info \ No newline at end of file +cadCAD.egg-info +SimCAD.egg-info diff --git a/README.md b/README.md index 289fd4b..20056a1 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Aided Design of economic systems. An economic system is treated as a state based set of endogenous and exogenous state variables which are updated through mechanisms and environmental \ processes, respectively. Behavioral models, which may be deterministic or stochastic, provide the evolution of \ the system within the action space of the mechanisms. Mathematical formulations of these economic games \ -treat agent utility as derived from state rather than direct from action, creating a rich dynamic modeling framework. +treat agent utility as derived from state rather than direct from action, creating a rich dynamic modeling framework. Simulations may be run with a range of initial conditions and parameters for states, behaviors, mechanisms, \ and environmental processes to understand and visualize network behavior under various conditions. Support for \ @@ -21,7 +21,7 @@ SimCAD is written in Python 3. ```bash pip install -r requirements.txt python3 setup.py sdist bdist_wheel -pip install dist/SimCAD-0.1-py3-none-any.whl +pip install dist/cadCAD-0.2-py3-none-any.whl ``` **2. Configure Simulation:** @@ -76,7 +76,7 @@ for raw_result, tensor_field in run2.main(): print() ``` -The above can be run in Jupyter. +The above can be run in Jupyter. ```bash jupyter notebook ``` diff --git a/SimCAD/__init__.py b/SimCAD/__init__.py deleted file mode 100644 index 0b7fa28..0000000 --- a/SimCAD/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -name = "SimCAD" -configs = [] diff --git a/cadCAD/__init__.py b/cadCAD/__init__.py new file mode 100644 index 0000000..61e8d6d --- /dev/null +++ b/cadCAD/__init__.py @@ -0,0 +1,2 @@ +name = "cadCAD" +configs = [] diff --git a/SimCAD/configuration/__init__.py b/cadCAD/configuration/__init__.py similarity index 97% rename from SimCAD/configuration/__init__.py rename to cadCAD/configuration/__init__.py index bc911e4..27cafdc 100644 --- a/SimCAD/configuration/__init__.py +++ b/cadCAD/configuration/__init__.py @@ -2,8 +2,8 @@ from functools import reduce from fn.op import foldr import pandas as pd -from SimCAD.utils import key_filter -from SimCAD.configuration.utils.behaviorAggregation import dict_elemwise_sum +from cadCAD.utils import key_filter +from cadCAD.configuration.utils.behaviorAggregation import dict_elemwise_sum class Configuration: @@ -122,7 +122,7 @@ class Processor: pass # Also for backwards compatibility, we accept partial state update blocks both as list or dict - # No need for a deprecation warning as it's already raised by SimCAD.utils.key_filter + # No need for a deprecation warning as it's already raised by cadCAD.utils.key_filter if (type(m)==list): for v in m: rename_keys(v) diff --git a/SimCAD/configuration/utils/__init__.py b/cadCAD/configuration/utils/__init__.py similarity index 100% rename from SimCAD/configuration/utils/__init__.py rename to cadCAD/configuration/utils/__init__.py diff --git a/SimCAD/configuration/utils/behaviorAggregation.py b/cadCAD/configuration/utils/behaviorAggregation.py similarity index 100% rename from SimCAD/configuration/utils/behaviorAggregation.py rename to cadCAD/configuration/utils/behaviorAggregation.py diff --git a/SimCAD/engine/__init__.py b/cadCAD/engine/__init__.py similarity index 94% rename from SimCAD/engine/__init__.py rename to cadCAD/engine/__init__.py index c468490..68db2c3 100644 --- a/SimCAD/engine/__init__.py +++ b/cadCAD/engine/__init__.py @@ -1,9 +1,9 @@ from pathos.multiprocessing import ProcessingPool as Pool -from SimCAD.utils import flatten -from SimCAD.configuration import Processor -from SimCAD.configuration.utils import TensorFieldReport -from SimCAD.engine.simulation import Executor as SimExecutor +from cadCAD.utils import flatten +from cadCAD.configuration import Processor +from cadCAD.configuration.utils import TensorFieldReport +from cadCAD.engine.simulation import Executor as SimExecutor class ExecutionMode: diff --git a/SimCAD/engine/simulation.py b/cadCAD/engine/simulation.py similarity index 98% rename from SimCAD/engine/simulation.py rename to cadCAD/engine/simulation.py index 0b75bf4..052ed63 100644 --- a/SimCAD/engine/simulation.py +++ b/cadCAD/engine/simulation.py @@ -1,6 +1,6 @@ from copy import deepcopy from fn.op import foldr, call -from SimCAD.engine.utils import engine_exception +from cadCAD.engine.utils import engine_exception id_exception = engine_exception(KeyError, KeyError, None) diff --git a/SimCAD/engine/utils.py b/cadCAD/engine/utils.py similarity index 100% rename from SimCAD/engine/utils.py rename to cadCAD/engine/utils.py diff --git a/SimCAD/utils/__init__.py b/cadCAD/utils/__init__.py similarity index 100% rename from SimCAD/utils/__init__.py rename to cadCAD/utils/__init__.py diff --git a/dist/cadCAD-0.2-py3-none-any.whl b/dist/cadCAD-0.2-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..4351720fa6b7e9510c99a962cb966ad7153ad66a GIT binary patch literal 8122 zcmaKxbyU<_*T;vBp+o7Gl#&*Z&LKxSBn5^Va$o>y=}t*WX;4y9=?3Xe0YSP!KwiA} zd0xHVd!Lzg)~w$jzt1{z&W`WiTMdMSOauS`&;kC4swyVhu2WQZPn36y;BJ|jm`h1W za~c^z>>(~jMjQ_Ce$arj=37lQMHMASn2Y+V;?OXtUx^bHQ>NPq0igC5+WxQ%^%4pI z&_oOX(EOyCLG3Ldmaa}FE)b~wuk2)ynPHWMq?sfEP#PMl_E^W}yutF~*Y2o~&o{#;;JatS!YO0HhcM-__el`%XpV=LOo zfsxH&Wp0K7FWp5H1!og+ULG10s7ao-5$6?`X_aU`1Lyb1QCro~U6`oF@UHVsLC9E` z!?D$y6f=4wiAi59l48#$rIJvpfav?)BWOqi5jAr;CsE=gRP<43vAoz7WH^}ve2%}# zpAh2Z7X^)f1;cIG3QrB-_WbY{K*3_bbQ?i>C%*Ma@wi?!82RhdS^3xi@Y}2@HHfmX z*j!M`Z6$bZ7>H>Y2OcRjhmztCRuXm|(q>&999;XWs~wgb@odfD%+Q7=7l(er>t(=u z7s@5uXPn|2sr|-JvS_O$)Sp_Kepf77=4Lu8?^f_$DUDAKpLQaCW30bs#TgFnYX;Im zW#kmP`a-fiuP#tIC;1U#;D!)ysga~x)0?>hs4yMN8({sCym^hN9kVvQ zGn%>?k?KKEy44I~P=;VB`;=Ny4=C^Qz+aja z7qS<=WddRFB#m0eQsNgaK{nYjXkXbLh(0`2{bqbjmK9##FHrJ@UWD|z6yQSR&NIocVJwAM_J8y z%}s)v+PZI!X{n4MV+qMr{CswrhOLds zM|>s9L4~7_MxeXLcykt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5j`1?C#(S$0w#1hFeV?B%Qk%PaOi@ExLc(lMB?r$o4txxh;o_y9?-#0n5toAQ`SWSIIk9?Y~Q0 zKQ-%bt_qfsQUy!D811#s6~{we_RK_~m_)@9^3{#d#_D=yp!X^t($+HlaZEKKR!)6w zpgym{d&0;BkNx>6v82H&Rhx_`z9AWxi2GBTaI=^RMxpK1#-awa^EhEy!BLehW#?&$ zRz{#x)6kPvdCnCh=F&do+-z(QgT!H-5isSt{Fa3K;WlF*rffZx#N($qaBB4|?#Ifk zY;PO`DO-dbL<{2*zs%%#7b1AtLlZ)2=tln8i!9t$196#zE{gU)PYniJd?tcNlifNBe zP&)jn*h2opnKZ~rcCyk8RUmwj>}&bzGJj6rhM9$^Lb)4qfA|UR@ixwqAfU&DB%`&Z z!!4#B+em|4k5PA<3SR7$Z=d=h#hGCzm6FzJK}=kDN!6l~elL7b;bK9-jtk zH>zSQJoVRu6Hdh%y>ZSov5znAeF^v8xuqOmkG3pgUAURtogOnB35FfTxKcqyyQ?2P zH>XLvpgj^^P0p&Vz4oH;cfY*zD+EL$q<ApFF=GKYt$<{{H^&1HnJv1_1K> zRDQnyuj9dAY5&wg{znZ!DRbwmFY|9_%7?^NYKqW;JRzjJ<%**`hDcP+ku q^~9 literal 0 HcmV?d00001 diff --git a/dist/cadCAD-0.2.tar.gz b/dist/cadCAD-0.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..0fc0df159691565484dae440a74e4335a850f0af GIT binary patch literal 6685 zcmV+&8sg<2iwFq02xeRY|72-%bT4CJWJ5tjEif)JE_7jX0PQ_%liN0u{>)#2n^aEZ zSfi0NuPW7QYn|A+%_ebtv2$BjvWlTZNMeQ}xg<3sZ7To$y73|aQX1Krk&~QMiAN-W z2GHH;ZZx`~X%K$-;^kSl(?5UqRG%(iLC;xm$%ODKO;Ou{BUPNg!AiYl4c^xe2fNO@?%%NpLCP6_%QbfyD9F)+O6zQzI4{}PfV0s(ODVe1? z$!S4@e7b0pyC9B2RM%K-9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_gjIndTcP<3}Y>oF7SFS^d zgWYQWv(r<@;ZC|IbD=5s*?Z@J4zvKeJCOVAy`wqM4&gj|?`ZC`Cv}}cPtDG=Cw81M zrnFsWPv$mz@9gl2K84c^RzjoO>``21+IqgvQ4X*qqc&l@}#J zzf=5Kp-}!xG@rl7=`a&HL>ykbmSWLX;no~Rg%EEzx-wTp z4NVW&^c!9 zh4cV%`vdYOi1K^>JHO(sM(`>+bblgh$v%kx{#F{Az$+5Ua8rlbJKKnd37r64P*433 zLlX%#>Qyl@`u7?YtD=vlqz1jBW&_;)DXNd1iE)%i!6dyyRhCH24S4y-3Zxv(LA^^Y z^D}>gW-y(k=`CyjXWsuwb@}YT`@g<+|I-DY1;PIBx_jLJ9puA}WTbqVrd6UPd($Sc zZwY;|l>&trr^(z8t1Vh}aqyGv(0E$RrwDW4J%5Tohxg7W2zB6{eu`j+_s*vYcMxbk zT)@M7=M#lI@Qxp22Y2G|b7B|s1BWfX_*-oe9(%_l#fB|VC+ejpFNP;i8Z}m>(CsZR zPUI*XM4SCeR$b-su=PPfW(pSp3n?46YQbh!4W9*_4O>k?XR7LFBjUCTv(*M)h{J{FZ+r7ND;y%9Y4p<@pJtA=|2AlW{qc;0H6Q>uj(Lp literal 0 HcmV?d00001 diff --git a/setup.py b/setup.py index 619744d..927996c 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -long_description = "SimCAD is a differential games based simulation software package for research, validation, and \ +long_description = "cadCAD is a differential games based simulation software package for research, validation, and \ Computer Aided Design of economic systems. An economic system is treated as a state based model and defined through \ a set of endogenous and exogenous state variables which are updated through mechanisms and environmental processes, \ respectively. Behavioral models, which may be deterministic or stochastic, provide the evolution of the system \ @@ -10,9 +10,9 @@ long_description = "SimCAD is a differential games based simulation software pac processes to understand and visualize network behavior under various conditions. Support for A/B testing policies, \ monte carlo analysis and other common numerical methods is provided." -setup(name='SimCAD', - version='0.1', - description="SimCAD: a differential games based simulation software package for research, validation, and \ +setup(name='cadCAD', + version='0.2', + description="cadCAD: a differential games based simulation software package for research, validation, and \ Computer Aided Design of economic systems", long_description = long_description, url='https://github.com/BlockScience/DiffyQ-SimCAD', From 50e4a38df7e1fbbf9073559baf71a80eeadac5a3 Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Thu, 14 Feb 2019 20:05:46 -0500 Subject: [PATCH 18/32] rename hell --- .gitignore | 2 ++ README.md | 2 +- SimCAD/__init__.py | 2 -- cadCAD/__init__.py | 2 ++ {SimCAD => cadCAD}/configuration/__init__.py | 12 ++++++------ .../configuration/utils/__init__.py | 2 +- .../configuration/utils/parameterSweep.py | 2 +- .../configuration/utils/policyAggregation.py | 0 {SimCAD => cadCAD}/engine/__init__.py | 8 ++++---- {SimCAD => cadCAD}/engine/simulation.py | 4 ++-- {SimCAD => cadCAD}/engine/utils.py | 0 {SimCAD => cadCAD}/utils/__init__.py | 0 dist/SimCAD-0.1-py3-none-any.whl | Bin 7445 -> 0 bytes dist/cadCAD-0.1-py3-none-any.whl | Bin 0 -> 9794 bytes setup.py | 10 +++++----- simulations/example_run.py | 4 ++-- simulations/validation/config1.py | 14 +++++++------- simulations/validation/config2.py | 14 +++++++------- simulations/validation/sweep_config.py | 14 +++++++------- 19 files changed, 47 insertions(+), 45 deletions(-) delete mode 100644 SimCAD/__init__.py create mode 100644 cadCAD/__init__.py rename {SimCAD => cadCAD}/configuration/__init__.py (92%) rename {SimCAD => cadCAD}/configuration/utils/__init__.py (98%) rename {SimCAD => cadCAD}/configuration/utils/parameterSweep.py (84%) rename {SimCAD => cadCAD}/configuration/utils/policyAggregation.py (100%) rename {SimCAD => cadCAD}/engine/__init__.py (94%) rename {SimCAD => cadCAD}/engine/simulation.py (97%) rename {SimCAD => cadCAD}/engine/utils.py (100%) rename {SimCAD => cadCAD}/utils/__init__.py (100%) delete mode 100644 dist/SimCAD-0.1-py3-none-any.whl create mode 100644 dist/cadCAD-0.1-py3-none-any.whl diff --git a/.gitignore b/.gitignore index b70d197..27a58c5 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ results *.csv *.txt simulations/.ipynb_checkpoints +dist/*.gz +cadCAD.egg-info build SimCAD.egg-info \ No newline at end of file diff --git a/README.md b/README.md index 825c846..b591f72 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ SimCAD is written in Python 3. ```bash pip3 install -r requirements.txt python3 setup.py sdist bdist_wheel -pip3 install dist/SimCAD-0.1-py3-none-any.whl +pip3 install dist/cadCAD-0.1-py3-none-any.whl ``` **2. Configure Simulation:** diff --git a/SimCAD/__init__.py b/SimCAD/__init__.py deleted file mode 100644 index b4234cb..0000000 --- a/SimCAD/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -name = "SimCAD" -configs = [] \ No newline at end of file diff --git a/cadCAD/__init__.py b/cadCAD/__init__.py new file mode 100644 index 0000000..ce0b0f9 --- /dev/null +++ b/cadCAD/__init__.py @@ -0,0 +1,2 @@ +name = "cadCAD" +configs = [] \ No newline at end of file diff --git a/SimCAD/configuration/__init__.py b/cadCAD/configuration/__init__.py similarity index 92% rename from SimCAD/configuration/__init__.py rename to cadCAD/configuration/__init__.py index 1440b54..277ffce 100644 --- a/SimCAD/configuration/__init__.py +++ b/cadCAD/configuration/__init__.py @@ -2,15 +2,15 @@ from functools import reduce from fn.op import foldr import pandas as pd -from SimCAD import configs -from SimCAD.utils import key_filter -from SimCAD.configuration.utils.policyAggregation import dict_elemwise_sum -from SimCAD.configuration.utils import exo_update_per_ts +from cadCAD import configs +from cadCAD.utils import key_filter +from cadCAD.configuration.utils.policyAggregation import dict_elemwise_sum +from cadCAD.configuration.utils import exo_update_per_ts class Configuration(object): - def __init__(self, sim_config=None, initial_state=None, seeds=None, env_processes=None, - exogenous_states=None, partial_state_updates=None, policy_ops=[foldr(dict_elemwise_sum())]): + def __init__(self, sim_config={}, initial_state={}, seeds={}, env_processes={}, + exogenous_states={}, partial_state_updates={}, policy_ops=[foldr(dict_elemwise_sum())], **kwargs): self.sim_config = sim_config self.initial_state = initial_state self.seeds = seeds diff --git a/SimCAD/configuration/utils/__init__.py b/cadCAD/configuration/utils/__init__.py similarity index 98% rename from SimCAD/configuration/utils/__init__.py rename to cadCAD/configuration/utils/__init__.py index ab5113d..084f7ae 100644 --- a/SimCAD/configuration/utils/__init__.py +++ b/cadCAD/configuration/utils/__init__.py @@ -4,7 +4,7 @@ from copy import deepcopy from fn.func import curried import pandas as pd -from SimCAD.utils import dict_filter, contains_type +from cadCAD.utils import dict_filter, contains_type class TensorFieldReport: diff --git a/SimCAD/configuration/utils/parameterSweep.py b/cadCAD/configuration/utils/parameterSweep.py similarity index 84% rename from SimCAD/configuration/utils/parameterSweep.py rename to cadCAD/configuration/utils/parameterSweep.py index 7d5024c..9e5d6ab 100644 --- a/SimCAD/configuration/utils/parameterSweep.py +++ b/cadCAD/configuration/utils/parameterSweep.py @@ -1,4 +1,4 @@ -from SimCAD.utils import flatten_tabulated_dict, tabulate_dict +from cadCAD.utils import flatten_tabulated_dict, tabulate_dict def process_variables(d): diff --git a/SimCAD/configuration/utils/policyAggregation.py b/cadCAD/configuration/utils/policyAggregation.py similarity index 100% rename from SimCAD/configuration/utils/policyAggregation.py rename to cadCAD/configuration/utils/policyAggregation.py diff --git a/SimCAD/engine/__init__.py b/cadCAD/engine/__init__.py similarity index 94% rename from SimCAD/engine/__init__.py rename to cadCAD/engine/__init__.py index 139d126..5a1d4ad 100644 --- a/SimCAD/engine/__init__.py +++ b/cadCAD/engine/__init__.py @@ -1,9 +1,9 @@ from pathos.multiprocessing import ProcessingPool as Pool -from SimCAD.utils import flatten -from SimCAD.configuration import Processor -from SimCAD.configuration.utils import TensorFieldReport -from SimCAD.engine.simulation import Executor as SimExecutor +from cadCAD.utils import flatten +from cadCAD.configuration import Processor +from cadCAD.configuration.utils import TensorFieldReport +from cadCAD.engine.simulation import Executor as SimExecutor class ExecutionMode: diff --git a/SimCAD/engine/simulation.py b/cadCAD/engine/simulation.py similarity index 97% rename from SimCAD/engine/simulation.py rename to cadCAD/engine/simulation.py index 4d855b1..9e3a153 100644 --- a/SimCAD/engine/simulation.py +++ b/cadCAD/engine/simulation.py @@ -1,7 +1,7 @@ from copy import deepcopy from fn.op import foldr, call -from SimCAD.engine.utils import engine_exception +from cadCAD.engine.utils import engine_exception id_exception = engine_exception(KeyError, KeyError, None) @@ -49,7 +49,7 @@ class Executor: del last_in_obj - self.apply_env_proc(env_processes, last_in_copy, last_in_copy['timestamp']) + self.apply_env_proc(env_processes, last_in_copy, last_in_copy['timestep']) # not time_step last_in_copy["sub_step"], last_in_copy["time_step"], last_in_copy['run'] = sub_step, time_step, run sL.append(last_in_copy) diff --git a/SimCAD/engine/utils.py b/cadCAD/engine/utils.py similarity index 100% rename from SimCAD/engine/utils.py rename to cadCAD/engine/utils.py diff --git a/SimCAD/utils/__init__.py b/cadCAD/utils/__init__.py similarity index 100% rename from SimCAD/utils/__init__.py rename to cadCAD/utils/__init__.py diff --git a/dist/SimCAD-0.1-py3-none-any.whl b/dist/SimCAD-0.1-py3-none-any.whl deleted file mode 100644 index d6a18cf3b4ece9d96dc8275acf765fab7dcc56cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7445 zcmaKxbyU<_*T;wM1|_6hy1P3DhL)Cg=on%s>6Q-Z21P)+K@l9fQ@TVz2}ud%oqO+d zAAG#tcV?aSTl2^7v-X*N_TJyU4@eCOnHT^7paX=9*)&Aix|ONmzbN605WaN4PI5Bx zT;}FrXE4OvoYNILq&5uHtI-2tjt+ZzL9{khN5|BL)VWYG75dx}0HFWUFyORhK5*<2 z5&+PG3jomE(X3pYZNYY)?iLWRi}TOyPJLkPk}!Vf#cPm;6Z5l76N)Q*Ld4)2b_OA< zu!UqXOUD7_;}Sc$AJ^#&PnDb6?9$(6UDlLTlvk9OKNM2+dO;@dRN^SGVak;z6Ejh0 z+YaN1kv*T1r8lnd+ALrWA$+!0UM}Wx^URxC%Kss1&;1&u^EiqX@-n(?qnHS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@ -1,6 +1,6 @@ from setuptools import setup, find_packages -long_description = "SimCAD is a differential games based simulation software package for research, validation, and \ +long_description = "cadCAD is a differential games based simulation software package for research, validation, and \ Computer Aided Design of economic systems. An economic system is treated as a state based model and defined through \ a set of endogenous and exogenous state variables which are updated through mechanisms and environmental processes, \ respectively. Behavioral models, which may be deterministic or stochastic, provide the evolution of the system \ @@ -10,14 +10,14 @@ long_description = "SimCAD is a differential games based simulation software pac processes to understand and visualize network behavior under various conditions. Support for A/B testing policies, \ monte carlo analysis and other common numerical methods is provided." -setup(name='SimCAD', +setup(name='cadCAD', version='0.1', - description="SimCAD: a differential games based simulation software package for research, validation, and \ + description="cadCAD: a differential games based simulation software package for research, validation, and \ Computer Aided Design of economic systems", long_description = long_description, - url='https://github.com/BlockScience/DiffyQ-SimCAD', + url='https://github.com/BlockScience/DiffyQ-cadCAD', author='Joshua E. Jodesty', author_email='joshua@block.science', # license='LICENSE', - packages=find_packages() #['SimCAD'] + packages=find_packages() ) diff --git a/simulations/example_run.py b/simulations/example_run.py index b179e49..3c80d44 100644 --- a/simulations/example_run.py +++ b/simulations/example_run.py @@ -1,9 +1,9 @@ import pandas as pd from tabulate import tabulate # The following imports NEED to be in the exact order -from SimCAD.engine import ExecutionMode, ExecutionContext, Executor +from cadCAD.engine import ExecutionMode, ExecutionContext, Executor from simulations.validation import sweep_config, config1, config2 -from SimCAD import configs +from cadCAD import configs exec_mode = ExecutionMode() diff --git a/simulations/validation/config1.py b/simulations/validation/config1.py index ce74604..4539208 100644 --- a/simulations/validation/config1.py +++ b/simulations/validation/config1.py @@ -2,9 +2,9 @@ from decimal import Decimal import numpy as np from datetime import timedelta -from SimCAD.configuration import append_configs -from SimCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step -from SimCAD.configuration.utils.parameterSweep import config_sim +from cadCAD.configuration import append_configs +from cadCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step +from cadCAD.configuration.utils.parameterSweep import config_sim seeds = { @@ -78,8 +78,8 @@ def es4p2(_g, step, sL, s, _input): ts_format = '%Y-%m-%d %H:%M:%S' t_delta = timedelta(days=0, minutes=0, seconds=1) def es5p2(_g, step, sL, s, _input): - y = 'timestamp' - x = ep_time_step(s, dt_str=s['timestamp'], fromat_str=ts_format, _timedelta=t_delta) + y = 'timestep' + x = ep_time_step(s, dt_str=s['timestep'], fromat_str=ts_format, _timedelta=t_delta) return (y, x) @@ -98,14 +98,14 @@ genesis_states = { 's2': Decimal(0.0), 's3': Decimal(1.0), 's4': Decimal(1.0), - 'timestamp': '2018-10-01 15:16:24' + 'timestep': '2018-10-01 15:16:24' } raw_exogenous_states = { "s3": es3p1, "s4": es4p2, - "timestamp": es5p2 + "timestep": es5p2 } diff --git a/simulations/validation/config2.py b/simulations/validation/config2.py index 987e8c0..5925c6c 100644 --- a/simulations/validation/config2.py +++ b/simulations/validation/config2.py @@ -2,9 +2,9 @@ from decimal import Decimal import numpy as np from datetime import timedelta -from SimCAD.configuration import append_configs -from SimCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step -from SimCAD.configuration.utils.parameterSweep import config_sim +from cadCAD.configuration import append_configs +from cadCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step +from cadCAD.configuration.utils.parameterSweep import config_sim seeds = { 'z': np.random.RandomState(1), @@ -77,8 +77,8 @@ def es4p2(_g, step, sL, s, _input): ts_format = '%Y-%m-%d %H:%M:%S' t_delta = timedelta(days=0, minutes=0, seconds=1) def es5p2(_g, step, sL, s, _input): - y = 'timestamp' - x = ep_time_step(s, dt_str=s['timestamp'], fromat_str=ts_format, _timedelta=t_delta) + y = 'timestep' + x = ep_time_step(s, dt_str=s['timestep'], fromat_str=ts_format, _timedelta=t_delta) return (y, x) @@ -97,14 +97,14 @@ genesis_states = { 's2': Decimal(0.0), 's3': Decimal(1.0), 's4': Decimal(1.0), - 'timestamp': '2018-10-01 15:16:24' + 'timestep': '2018-10-01 15:16:24' } raw_exogenous_states = { "s3": es3p1, "s4": es4p2, - "timestamp": es5p2 + "timestep": es5p2 } diff --git a/simulations/validation/sweep_config.py b/simulations/validation/sweep_config.py index c93a703..f23e4ba 100644 --- a/simulations/validation/sweep_config.py +++ b/simulations/validation/sweep_config.py @@ -3,9 +3,9 @@ import numpy as np from datetime import timedelta import pprint -from SimCAD.configuration import append_configs -from SimCAD.configuration.utils import proc_trigger, ep_time_step -from SimCAD.configuration.utils.parameterSweep import config_sim +from cadCAD.configuration import append_configs +from cadCAD.configuration.utils import proc_trigger, ep_time_step +from cadCAD.configuration.utils.parameterSweep import config_sim pp = pprint.PrettyPrinter(indent=4) @@ -93,8 +93,8 @@ def es4p2(_g, step, sL, s, _input): ts_format = '%Y-%m-%d %H:%M:%S' t_delta = timedelta(days=0, minutes=0, seconds=1) def es5p2(_g, step, sL, s, _input): - y = 'timestamp' - x = ep_time_step(s, dt_str=s['timestamp'], fromat_str=ts_format, _timedelta=t_delta) + y = 'timestep' + x = ep_time_step(s, dt_str=s['timestep'], fromat_str=ts_format, _timedelta=t_delta) return (y, x) @@ -114,7 +114,7 @@ genesis_states = { 's2': Decimal(0.0), 's3': Decimal(1.0), 's4': Decimal(1.0), - 'timestamp': '2018-10-01 15:16:24' + 'timestep': '2018-10-01 15:16:24' } @@ -122,7 +122,7 @@ genesis_states = { raw_exogenous_states = { "s3": es3p1, "s4": es4p2, - "timestamp": es5p2 + "timestep": es5p2 } From 47cfc125604cbe6d1e38a721fa4c3120c9d4d0b9 Mon Sep 17 00:00:00 2001 From: Markus Date: Fri, 15 Feb 2019 09:11:58 -0200 Subject: [PATCH 19/32] misc bug fixes --- cadCAD/configuration/__init__.py | 8 ++++---- dist/cadCAD-0.2-py3-none-any.whl | Bin 8122 -> 10829 bytes dist/cadCAD-0.2.tar.gz | Bin 6685 -> 8987 bytes 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cadCAD/configuration/__init__.py b/cadCAD/configuration/__init__.py index 645f9df..12a2f92 100644 --- a/cadCAD/configuration/__init__.py +++ b/cadCAD/configuration/__init__.py @@ -30,7 +30,7 @@ class Configuration(object): elif (key=='mechanisms'): self.partial_state_updates = value - if (self.state_dict == {}): + if (self.initial_state == {}): raise Exception('The initial conditions of the system have not been set') @@ -118,7 +118,7 @@ class Processor: return sdf_values, bdf_values elif (bdf.empty == True) and (sdf.empty == False): sdf_values = sdf.values.tolist() - bdf_values = [[self.b_identity] * len(sdf_values) for m in range(len(partial_state_updates))] + bdf_values = [[self.p_identity] * len(sdf_values) for m in range(len(partial_state_updates))] return sdf_values, bdf_values else: sdf_values = sdf.values.tolist() @@ -155,11 +155,11 @@ class Processor: for k, v in mechanisms.items(): rename_keys(v) return - + if len(partial_state_updates) != 0: sanitize_partial_state_updates(partial_state_updates) bdf = self.create_matrix_field(partial_state_updates, 'policies') - sdf = self.create_matrix_field(partial_state_updates, 'states') + sdf = self.create_matrix_field(partial_state_updates, 'state_update_functions') sdf_values, bdf_values = no_update_handler(bdf, sdf) zipped_list = list(zip(sdf_values, bdf_values)) else: diff --git a/dist/cadCAD-0.2-py3-none-any.whl b/dist/cadCAD-0.2-py3-none-any.whl index 4351720fa6b7e9510c99a962cb966ad7153ad66a..026b27993aee6bc1ccedfa8acdd1e551c24995ec 100644 GIT binary patch delta 9095 zcmZX4byOV7xAov|!Cis`cNi?V1&847?hu?og8K~a9^56k1qd44-3cyXAVD7YzVG+l zci*djx>v2ePOs`yz0a!-TgwCC;~ohV$>^6W{}M$o7{FDV79DQy`~XfZ3~sNEg!9_9*H zTCl~h7_PL$5g~|Nf)p}i3b#j#>iw$=EI2PKVF%oFrp&wq?d@0y7y z9HnUY+|6#P@ND4bjJ7h0+VSq8zSs~ER`;CC;l0ntS)E1%0}&sjaxKLUyHqZxEI#-5 zJcAG6sIE2`igAspe(gbiU|-|98D4F|o4C-rVX#*Q|MV(@k;dea6b*^e)m%uVM^cMC zXrNBWo?_Yc1W8h%!V9mb8t`Ri!;|}8m^|G-Kl~wA!!v`=&}7bCo3 zo0EY`0=Jkr2d9QHj~Vrtq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bN~-8Q_SW%JtY~t zmt#T71#W(YW9q!}Rl&af^fX8|P*uIlX_gjIndTcP<3}Y>oF7SFS^d zgWYQWv(r<@;ZC|IbD=5s*?Z@J4zvKeJCOVAy`wqM4&gj|?`ZC`Cv}}cPtDG=Cw81M zrnFsWPv$mz@9gl2K84c^RzjoO>``21+IqgvQ4X*qqc&l@}#J zzf=5Kp-}!xG@rl7=`a&HL>ykbmSWLX;no~Rg%EEzx-wTp z4NVW&^c!9 zh4cV%`vdYOi1K^>JHO(sM(`>+bblgh$v%kx{#F{Az$+5Ua8rlbJKKnd37r64P*433 zLlX%#>Qyl@`u7?YtD=vlqz1jBW&_;)DXNd1iE)%i!6dyyRhCH24S4y-3Zxv(LA^^Y z^D}>gW-y(k=`CyjXWsuwb@}YT`@g<+|I-DY1;PIBx_jLJ9puA}WTbqVrd6UPd($Sc zZwY;|l>&trr^(z8t1Vh}aqyGv(0E$RrwDW4J%5Tohxg7W2zB6{eu`j+_s*vYcMxbk zT)@M7=M#lI@Qxp22Y2G|b7B|s1BWfX_*-oe9(%_l#fB|VC+ejpFNP;i8Z}m>(CsZR zPUI*XM4SCeR$b-su=PPfW(pSp3n?46YQbh!4W9*_4O>k?XR7LFBjUCTv(*M)h{J{FZ+r7ND;y%9Y4p<@pJtA=|2AlW{qc;0H6Q>uj(Lp From e2d68a05873b820441660340841502c970265aaa Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Fri, 15 Feb 2019 09:49:52 -0500 Subject: [PATCH 20/32] renamed b_identity to p_identitiy --- .gitignore | 3 ++- cadCAD/configuration/__init__.py | 2 +- simulations/example_run.py | 26 +++++++++++++------------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 27a58c5..5b69dc0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ .DS_Store .idea notebooks -SimCAD.egg-info +*.egg-info __pycache__ Pipfile Pipfile.lock @@ -12,6 +12,7 @@ results *.csv *.txt simulations/.ipynb_checkpoints +simulations/validation/config3.py dist/*.gz cadCAD.egg-info diff --git a/cadCAD/configuration/__init__.py b/cadCAD/configuration/__init__.py index 277ffce..ed6e6ce 100644 --- a/cadCAD/configuration/__init__.py +++ b/cadCAD/configuration/__init__.py @@ -104,7 +104,7 @@ class Processor: return sdf_values, bdf_values elif (bdf.empty == True) and (sdf.empty == False): sdf_values = sdf.values.tolist() - bdf_values = [[self.b_identity] * len(sdf_values) for m in range(len(partial_state_updates))] + bdf_values = [[self.p_identity] * len(sdf_values) for m in range(len(partial_state_updates))] return sdf_values, bdf_values else: sdf_values = sdf.values.tolist() diff --git a/simulations/example_run.py b/simulations/example_run.py index 3c80d44..58c7878 100644 --- a/simulations/example_run.py +++ b/simulations/example_run.py @@ -7,19 +7,19 @@ from cadCAD import configs exec_mode = ExecutionMode() -# print("Simulation Execution 1") -# print() -# first_config = [configs[0]] # from config1 -# single_proc_ctx = ExecutionContext(context=exec_mode.single_proc) -# run1 = Executor(exec_context=single_proc_ctx, configs=first_config) -# run1_raw_result, tensor_field = run1.main() -# result = pd.DataFrame(run1_raw_result) -# print() -# print("Tensor Field:") -# print(tabulate(tensor_field, headers='keys', tablefmt='psql')) -# print("Output:") -# print(tabulate(result, headers='keys', tablefmt='psql')) -# print() +print("Simulation Execution 1") +print() +first_config = [configs[0]] # from config1 +single_proc_ctx = ExecutionContext(context=exec_mode.single_proc) +run1 = Executor(exec_context=single_proc_ctx, configs=first_config) +run1_raw_result, tensor_field = run1.main() +result = pd.DataFrame(run1_raw_result) +print() +print("Tensor Field:") +print(tabulate(tensor_field, headers='keys', tablefmt='psql')) +print("Output:") +print(tabulate(result, headers='keys', tablefmt='psql')) +print() print("Simulation Execution 2: Concurrent Execution") multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc) From 00f5d53888f79b6431c47751d62da471bd2ebd44 Mon Sep 17 00:00:00 2001 From: Markus Date: Fri, 15 Feb 2019 14:33:55 -0200 Subject: [PATCH 21/32] renaming some user-facing terms --- cadCAD/configuration/__init__.py | 14 +++++++------- cadCAD/configuration/utils/__init__.py | 6 +++--- cadCAD/engine/simulation.py | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cadCAD/configuration/__init__.py b/cadCAD/configuration/__init__.py index ed6e6ce..1c8cd75 100644 --- a/cadCAD/configuration/__init__.py +++ b/cadCAD/configuration/__init__.py @@ -10,17 +10,17 @@ from cadCAD.configuration.utils import exo_update_per_ts class Configuration(object): def __init__(self, sim_config={}, initial_state={}, seeds={}, env_processes={}, - exogenous_states={}, partial_state_updates={}, policy_ops=[foldr(dict_elemwise_sum())], **kwargs): + exogenous_states={}, partial_state_update_blocks={}, policy_ops=[foldr(dict_elemwise_sum())], **kwargs): self.sim_config = sim_config self.initial_state = initial_state self.seeds = seeds self.env_processes = env_processes self.exogenous_states = exogenous_states - self.partial_state_updates = partial_state_updates + self.partial_state_updates = partial_state_update_blocks self.policy_ops = policy_ops -def append_configs(sim_configs, initial_state, seeds, raw_exogenous_states, env_processes, partial_state_updates, _exo_update_per_ts=True): +def append_configs(sim_configs, initial_state, seeds, raw_exogenous_states, env_processes, partial_state_update_blocks, _exo_update_per_ts=True): if _exo_update_per_ts is True: exogenous_states = exo_update_per_ts(raw_exogenous_states) else: @@ -35,7 +35,7 @@ def append_configs(sim_configs, initial_state, seeds, raw_exogenous_states, env_ seeds=seeds, exogenous_states=exogenous_states, env_processes=env_processes, - partial_state_updates=partial_state_updates + partial_state_updates=partial_state_update_blocks ) ) elif isinstance(sim_configs, dict): @@ -46,7 +46,7 @@ def append_configs(sim_configs, initial_state, seeds, raw_exogenous_states, env_ seeds=seeds, exogenous_states=exogenous_states, env_processes=env_processes, - partial_state_updates=partial_state_updates + partial_state_updates=partial_state_update_blocks ) ) @@ -84,7 +84,7 @@ class Processor: self.apply_identity_funcs = id.apply_identity_funcs def create_matrix_field(self, partial_state_updates, key): - if key == 'states': + if key == 'variables': identity = self.state_identity elif key == 'policies': identity = self.policy_identity @@ -121,7 +121,7 @@ class Processor: if len(partial_state_updates) != 0: bdf = self.create_matrix_field(partial_state_updates, 'policies') - sdf = self.create_matrix_field(partial_state_updates, 'states') + sdf = self.create_matrix_field(partial_state_updates, 'variables') sdf_values, bdf_values = no_update_handler(bdf, sdf) zipped_list = list(zip(sdf_values, bdf_values)) else: diff --git a/cadCAD/configuration/utils/__init__.py b/cadCAD/configuration/utils/__init__.py index 084f7ae..229a738 100644 --- a/cadCAD/configuration/utils/__init__.py +++ b/cadCAD/configuration/utils/__init__.py @@ -11,7 +11,7 @@ class TensorFieldReport: def __init__(self, config_proc): self.config_proc = config_proc - def create_tensor_field(self, partial_state_updates, exo_proc, keys=['policies', 'states']): + def create_tensor_field(self, partial_state_updates, exo_proc, keys=['policies', 'variables']): dfs = [self.config_proc.create_matrix_field(partial_state_updates, k) for k in keys] df = pd.concat(dfs, axis=1) for es, i in zip(exo_proc, range(len(exo_proc))): @@ -52,7 +52,7 @@ def time_step(dt_str, dt_format='%Y-%m-%d %H:%M:%S', _timedelta = tstep_delta): ep_t_delta = timedelta(days=0, minutes=0, seconds=1) def ep_time_step(s, dt_str, fromat_str='%Y-%m-%d %H:%M:%S', _timedelta = ep_t_delta): - if s['sub_step'] == 0: + if s['substep'] == 0: return time_step(dt_str, fromat_str, _timedelta) else: return dt_str @@ -114,7 +114,7 @@ def sweep_states(state_type, states, in_config): def exo_update_per_ts(ep): @curried def ep_decorator(f, y, var_dict, sub_step, sL, s, _input): - if s['sub_step'] + 1 == 1: + if s['substep'] + 1 == 1: return f(var_dict, sub_step, sL, s, _input) else: return y, s[y] diff --git a/cadCAD/engine/simulation.py b/cadCAD/engine/simulation.py index 9e3a153..96f43e9 100644 --- a/cadCAD/engine/simulation.py +++ b/cadCAD/engine/simulation.py @@ -51,7 +51,7 @@ class Executor: self.apply_env_proc(env_processes, last_in_copy, last_in_copy['timestep']) # not time_step - last_in_copy["sub_step"], last_in_copy["time_step"], last_in_copy['run'] = sub_step, time_step, run + last_in_copy['substep'], last_in_copy['timestep'], last_in_copy['run'] = sub_step, time_step, run sL.append(last_in_copy) del last_in_copy @@ -62,7 +62,7 @@ class Executor: sub_step = 0 states_list_copy = deepcopy(states_list) genesis_states = states_list_copy[-1] - genesis_states['sub_step'], genesis_states['time_step'] = sub_step, time_step + genesis_states['substep'], genesis_states['timestep'] = sub_step, time_step states_list = [genesis_states] sub_step += 1 @@ -93,7 +93,7 @@ class Executor: states_list_copy = deepcopy(states_list) head, *tail = self.run_pipeline(var_dict, states_list_copy, configs, env_processes, time_seq, run) genesis = head.pop() - genesis['sub_step'], genesis['time_step'], genesis['run'] = 0, 0, run + genesis['substep'], genesis['timestep'], genesis['run'] = 0, 0, run first_timestep_per_run = [genesis] + tail.pop(0) pipe_run += [first_timestep_per_run] + tail del states_list_copy From ffd90b9ecdeebf2a8e70239af9cbf45d6639cf76 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 18 Feb 2019 10:17:42 -0300 Subject: [PATCH 22/32] bug fix to match the renamed argument in Configuration constructor --- cadCAD/configuration/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cadCAD/configuration/__init__.py b/cadCAD/configuration/__init__.py index 1c8cd75..b5cd4d3 100644 --- a/cadCAD/configuration/__init__.py +++ b/cadCAD/configuration/__init__.py @@ -35,7 +35,7 @@ def append_configs(sim_configs, initial_state, seeds, raw_exogenous_states, env_ seeds=seeds, exogenous_states=exogenous_states, env_processes=env_processes, - partial_state_updates=partial_state_update_blocks + partial_state_update_blocks=partial_state_update_blocks ) ) elif isinstance(sim_configs, dict): @@ -46,7 +46,7 @@ def append_configs(sim_configs, initial_state, seeds, raw_exogenous_states, env_ seeds=seeds, exogenous_states=exogenous_states, env_processes=env_processes, - partial_state_updates=partial_state_update_blocks + partial_state_update_blocks=partial_state_update_blocks ) ) From 2c4b775d86ff884aa7d1924acc8000bd4f7db91b Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 18 Feb 2019 10:28:51 -0300 Subject: [PATCH 23/32] tests --- simulations/example_run.ipynb | 1856 +----------------------- simulations/validation/config1.py | 12 +- simulations/validation/config2.py | 12 +- simulations/validation/sweep_config.py | 12 +- 4 files changed, 89 insertions(+), 1803 deletions(-) diff --git a/simulations/example_run.ipynb b/simulations/example_run.ipynb index 8f8415a..41456f2 100644 --- a/simulations/example_run.ipynb +++ b/simulations/example_run.ipynb @@ -10,9 +10,9 @@ "from tabulate import tabulate\n", "\n", "# The following imports NEED to be in the exact order\n", - "from SimCAD.engine import ExecutionMode, ExecutionContext, Executor\n", - "from validation import config1, config2\n", - "from SimCAD import configs\n", + "from cadCAD.engine import ExecutionMode, ExecutionContext, Executor\n", + "from validation import config1, config2, config3\n", + "from cadCAD import configs\n", "\n", "exec_mode = ExecutionMode()" ] @@ -26,761 +26,105 @@ "name": "stdout", "output_type": "stream", "text": [ - "Simulation Execution 1\n", "\n", - "single_proc: []\n" - ] - } - ], - "source": [ - "print(\"Simulation Execution 1\")\n", - "print()\n", - "first_config = [configs[0]] # from config1\n", - "single_proc_ctx = ExecutionContext(context=exec_mode.single_proc)\n", - "run1 = Executor(exec_context=single_proc_ctx, configs=first_config)\n", - "run1_raw_result, raw_tensor_field = run1.main()\n", - "result = pd.DataFrame(run1_raw_result)\n", - "tensor_field = pd.DataFrame(raw_tensor_field)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Tensor Field:\n" + "config[0]\n", + "single_proc: []\n", + " run s1 s2 s3 s4 substep timestep\n", + "0 1 0 0 1 1 0 0\n", + "1 1 1 4 5 1.178862847343031816649272514 1 1\n", + "2 1 ab 6 5 1.178862847343031816649272514 2 1\n", + "3 1 [c, d] [30, 300] 5 1.178862847343031816649272514 3 1\n", + "4 1 1 4 5 1.230321371869816411424320371 1 2\n", + "\n", + "config[1]\n", + "single_proc: []\n", + " run s1 s2 s3 \\\n", + "0 1 0 0 1 \n", + "1 1 1 0 0.9583242152594528828757347583 \n", + "2 1 a 0 0.9583242152594528828757347583 \n", + "3 1 [c, d] [30, 300] 0.9583242152594528828757347583 \n", + "4 1 1 [30, 300] 0.9529320289547716885340867310 \n", + "\n", + " s4 substep timestep \n", + "0 1 0 0 \n", + "1 1.178862847343031816649272514 1 1 \n", + "2 1.178862847343031816649272514 2 1 \n", + "3 1.178862847343031816649272514 3 1 \n", + "4 1.230321371869816411424320371 1 2 \n", + "\n", + "config[2]\n", + "single_proc: []\n", + " run s1 s2 s3 s4 substep timestamp timestep\n", + "0 1 0 0 1 1 0 2018-10-01 15:16:24 0\n", + "1 1 [1] 0 1 1 1 2018-10-01 15:16:24 1\n", + "2 1 [1] 0 1 1 1 2018-10-01 15:16:24 2\n", + "3 1 [1] 0 1 1 1 2018-10-01 15:16:24 3\n", + "4 1 [1] 0 1 1 1 2018-10-01 15:16:24 4\n" ] }, { - "data": { - "text/html": [ - "

\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
b1b2s1s2es1es2es3m
0<function b1m1 at 0x109f25d90><function b2m1 at 0x10a2fda60><function s1m1 at 0x10a2fdd08><function s2m1 at 0x10a2fdd90><function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...1
1<function b1m2 at 0x10a2fdae8><function b2m2 at 0x10a2fdb70><function s1m2 at 0x10a2fde18><function s2m2 at 0x10a2fdea0><function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...2
2<function b1m3 at 0x10a2fdbf8><function b2m3 at 0x10a2fdc80><function s1m3 at 0x10a2fdf28><function s2m3 at 0x10a308048><function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...3
\n", - "
" - ], - "text/plain": [ - " b1 b2 \\\n", - "0 \n", - "1 \n", - "2 \n", - "\n", - " s1 s2 \\\n", - "0 \n", - "1 \n", - "2 \n", - "\n", - " es1 \\\n", - "0 ._curried at 0x10a30... \n", - "1 ._curried at 0x10a30... \n", - "2 ._curried at 0x10a30... \n", - "\n", - " es2 \\\n", - "0 ._curried at 0x10a30... \n", - "1 ._curried at 0x10a30... \n", - "2 ._curried at 0x10a30... \n", - "\n", - " es3 m \n", - "0 ._curried at 0x10a30... 1 \n", - "1 ._curried at 0x10a30... 2 \n", - "2 ._curried at 0x10a30... 3 " - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/markusbkoch/Documents/GitHub/DiffyQ-SimCAD/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", + " FutureWarning)\n" + ] } ], "source": [ - "print(\"Tensor Field:\")\n", - "tensor_field" + "for idx, c in enumerate(configs):\n", + " print()\n", + " print(f\"config[{idx}]\")\n", + " single_proc_ctx = ExecutionContext(context=exec_mode.single_proc)\n", + " run1 = Executor(exec_context=single_proc_ctx, configs=[c])\n", + " run1_raw_result, raw_tensor_field = run1.main()\n", + " result = pd.DataFrame(run1_raw_result)\n", + " print(result.head())\n", + "# tensor_field = pd.DataFrame(raw_tensor_field)" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Output:\n" + "multi_proc: [, , , , ]\n" ] }, { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
mech_stepruns1s2s3s4time_steptimestamp
001001102018-10-01 15:16:24
1111451012018-10-01 15:16:25
221ab651012018-10-01 15:16:25
331[c, d][30, 300]51012018-10-01 15:16:25
41114510.4365098505119902050353175622018-10-01 15:16:26
521ab6510.4365098505119902050353175622018-10-01 15:16:26
631[c, d][30, 300]510.4365098505119902050353175622018-10-01 15:16:26
71114510.5372195281202876186024801332018-10-01 15:16:27
821ab6510.5372195281202876186024801332018-10-01 15:16:27
931[c, d][30, 300]510.5372195281202876186024801332018-10-01 15:16:27
10111458.57361635768008949978322321242018-10-01 15:16:28
1121ab658.57361635768008949978322321242018-10-01 15:16:28
1231[c, d][30, 300]58.57361635768008949978322321242018-10-01 15:16:28
13111458.33579435462959645300709321652018-10-01 15:16:29
1421ab658.33579435462959645300709321652018-10-01 15:16:29
1531[c, d][30, 300]58.33579435462959645300709321652018-10-01 15:16:29
1602001102018-10-01 15:16:24
17121451012018-10-01 15:16:25
1822ab651012018-10-01 15:16:25
1932[c, d][30, 300]51012018-10-01 15:16:25
20121459.91725851851753992249882685422018-10-01 15:16:26
2122ab659.91725851851753992249882685422018-10-01 15:16:26
2232[c, d][30, 300]59.91725851851753992249882685422018-10-01 15:16:26
23121459.29544573818278309896721217232018-10-01 15:16:27
2422ab659.29544573818278309896721217232018-10-01 15:16:27
2532[c, d][30, 300]59.29544573818278309896721217232018-10-01 15:16:27
26121459.25471479697655613481958888342018-10-01 15:16:28
2722ab659.25471479697655613481958888342018-10-01 15:16:28
2832[c, d][30, 300]59.25471479697655613481958888342018-10-01 15:16:28
29121458.81306312028134610425625981852018-10-01 15:16:29
3022ab658.81306312028134610425625981852018-10-01 15:16:29
3132[c, d][30, 300]58.81306312028134610425625981852018-10-01 15:16:29
\n", - "
" - ], - "text/plain": [ - " mech_step run s1 s2 s3 s4 \\\n", - "0 0 1 0 0 1 1 \n", - "1 1 1 1 4 5 10 \n", - "2 2 1 ab 6 5 10 \n", - "3 3 1 [c, d] [30, 300] 5 10 \n", - "4 1 1 1 4 5 10.43650985051199020503531756 \n", - "5 2 1 ab 6 5 10.43650985051199020503531756 \n", - "6 3 1 [c, d] [30, 300] 5 10.43650985051199020503531756 \n", - "7 1 1 1 4 5 10.53721952812028761860248013 \n", - "8 2 1 ab 6 5 10.53721952812028761860248013 \n", - "9 3 1 [c, d] [30, 300] 5 10.53721952812028761860248013 \n", - "10 1 1 1 4 5 8.573616357680089499783223212 \n", - "11 2 1 ab 6 5 8.573616357680089499783223212 \n", - "12 3 1 [c, d] [30, 300] 5 8.573616357680089499783223212 \n", - "13 1 1 1 4 5 8.335794354629596453007093216 \n", - "14 2 1 ab 6 5 8.335794354629596453007093216 \n", - "15 3 1 [c, d] [30, 300] 5 8.335794354629596453007093216 \n", - "16 0 2 0 0 1 1 \n", - "17 1 2 1 4 5 10 \n", - "18 2 2 ab 6 5 10 \n", - "19 3 2 [c, d] [30, 300] 5 10 \n", - "20 1 2 1 4 5 9.917258518517539922498826854 \n", - "21 2 2 ab 6 5 9.917258518517539922498826854 \n", - "22 3 2 [c, d] [30, 300] 5 9.917258518517539922498826854 \n", - "23 1 2 1 4 5 9.295445738182783098967212172 \n", - "24 2 2 ab 6 5 9.295445738182783098967212172 \n", - "25 3 2 [c, d] [30, 300] 5 9.295445738182783098967212172 \n", - "26 1 2 1 4 5 9.254714796976556134819588883 \n", - "27 2 2 ab 6 5 9.254714796976556134819588883 \n", - "28 3 2 [c, d] [30, 300] 5 9.254714796976556134819588883 \n", - "29 1 2 1 4 5 8.813063120281346104256259818 \n", - "30 2 2 ab 6 5 8.813063120281346104256259818 \n", - "31 3 2 [c, d] [30, 300] 5 8.813063120281346104256259818 \n", - "\n", - " time_step timestamp \n", - "0 0 2018-10-01 15:16:24 \n", - "1 1 2018-10-01 15:16:25 \n", - "2 1 2018-10-01 15:16:25 \n", - "3 1 2018-10-01 15:16:25 \n", - "4 2 2018-10-01 15:16:26 \n", - "5 2 2018-10-01 15:16:26 \n", - "6 2 2018-10-01 15:16:26 \n", - "7 3 2018-10-01 15:16:27 \n", - "8 3 2018-10-01 15:16:27 \n", - "9 3 2018-10-01 15:16:27 \n", - "10 4 2018-10-01 15:16:28 \n", - "11 4 2018-10-01 15:16:28 \n", - "12 4 2018-10-01 15:16:28 \n", - "13 5 2018-10-01 15:16:29 \n", - "14 5 2018-10-01 15:16:29 \n", - "15 5 2018-10-01 15:16:29 \n", - "16 0 2018-10-01 15:16:24 \n", - "17 1 2018-10-01 15:16:25 \n", - "18 1 2018-10-01 15:16:25 \n", - "19 1 2018-10-01 15:16:25 \n", - "20 2 2018-10-01 15:16:26 \n", - "21 2 2018-10-01 15:16:26 \n", - "22 2 2018-10-01 15:16:26 \n", - "23 3 2018-10-01 15:16:27 \n", - "24 3 2018-10-01 15:16:27 \n", - "25 3 2018-10-01 15:16:27 \n", - "26 4 2018-10-01 15:16:28 \n", - "27 4 2018-10-01 15:16:28 \n", - "28 4 2018-10-01 15:16:28 \n", - "29 5 2018-10-01 15:16:29 \n", - "30 5 2018-10-01 15:16:29 \n", - "31 5 2018-10-01 15:16:29 " - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "print(\"Output:\")\n", - "result" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "name": "stdout", + "name": "stderr", "output_type": "stream", "text": [ - "Simulation Execution 2: Pairwise Execution\n", - "\n", - "multi_proc: [, ]\n" + "/Users/markusbkoch/Documents/GitHub/DiffyQ-SimCAD/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", + " FutureWarning)\n" ] } ], "source": [ - "print(\"Simulation Execution 2: Pairwise Execution\")\n", - "print()\n", + "from validation import sweep_config\n", "multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc)\n", "run2 = Executor(exec_context=multi_proc_ctx, configs=configs)\n", "results = []\n", "tensor_fields = []\n", "for raw_result, raw_tensor_field in run2.main():\n", " results.append(pd.DataFrame(raw_result))\n", - " tensor_fields.append(pd.DataFrame(raw_tensor_field))" + " tensor_fields.append(pd.DataFrame(raw_tensor_field))\n", + "\n", + "for idx, r in enumerate(results):\n", + " print()\n", + " print(f\"result[{idx}]\")\n", + " print(r.head())" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Tensor Field A:\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
b1b2s1s2es1es2es3m
0<function b1m1 at 0x109f25d90><function b2m1 at 0x10a2fda60><function s1m1 at 0x10a2fdd08><function s2m1 at 0x10a2fdd90><function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...1
1<function b1m2 at 0x10a2fdae8><function b2m2 at 0x10a2fdb70><function s1m2 at 0x10a2fde18><function s2m2 at 0x10a2fdea0><function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...2
2<function b1m3 at 0x10a2fdbf8><function b2m3 at 0x10a2fdc80><function s1m3 at 0x10a2fdf28><function s2m3 at 0x10a308048><function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...3
\n", - "
" - ], - "text/plain": [ - " b1 b2 \\\n", - "0 \n", - "1 \n", - "2 \n", - "\n", - " s1 s2 \\\n", - "0 \n", - "1 \n", - "2 \n", - "\n", - " es1 \\\n", - "0 ._curried at 0x10a30... \n", - "1 ._curried at 0x10a30... \n", - "2 ._curried at 0x10a30... \n", - "\n", - " es2 \\\n", - "0 ._curried at 0x10a30... \n", - "1 ._curried at 0x10a30... \n", - "2 ._curried at 0x10a30... \n", - "\n", - " es3 m \n", - "0 ._curried at 0x10a30... 1 \n", - "1 ._curried at 0x10a30... 2 \n", - "2 ._curried at 0x10a30... 3 " - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "\n", "print(\"Tensor Field A:\")\n", @@ -789,479 +133,9 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Output A:\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
mech_stepruns1s2s3s4time_steptimestamp
001001102018-10-01 15:16:24
1111451012018-10-01 15:16:25
221ab651012018-10-01 15:16:25
331[c, d][30, 300]51012018-10-01 15:16:25
41114510.8846223804995845263476894622018-10-01 15:16:26
521ab6510.8846223804995845263476894622018-10-01 15:16:26
631[c, d][30, 300]510.8846223804995845263476894622018-10-01 15:16:26
71114511.8439037891546010592859424032018-10-01 15:16:27
821ab6511.8439037891546010592859424032018-10-01 15:16:27
931[c, d][30, 300]511.8439037891546010592859424032018-10-01 15:16:27
101114513.8687056777981817566008678242018-10-01 15:16:28
1121ab6513.8687056777981817566008678242018-10-01 15:16:28
1231[c, d][30, 300]513.8687056777981817566008678242018-10-01 15:16:28
131114513.9380958635320972504792206852018-10-01 15:16:29
1421ab6513.9380958635320972504792206852018-10-01 15:16:29
1531[c, d][30, 300]513.9380958635320972504792206852018-10-01 15:16:29
1602001102018-10-01 15:16:24
17121451012018-10-01 15:16:25
1822ab651012018-10-01 15:16:25
1932[c, d][30, 300]51012018-10-01 15:16:25
20121459.45464005238046967249943008922018-10-01 15:16:26
2122ab659.45464005238046967249943008922018-10-01 15:16:26
2232[c, d][30, 300]59.45464005238046967249943008922018-10-01 15:16:26
23121457.99250141557961352525319763532018-10-01 15:16:27
2422ab657.99250141557961352525319763532018-10-01 15:16:27
2532[c, d][30, 300]57.99250141557961352525319763532018-10-01 15:16:27
26121458.77765872647237926847033398342018-10-01 15:16:28
2722ab658.77765872647237926847033398342018-10-01 15:16:28
2832[c, d][30, 300]58.77765872647237926847033398342018-10-01 15:16:28
29121457.81117913728395304481061202852018-10-01 15:16:29
3022ab657.81117913728395304481061202852018-10-01 15:16:29
3132[c, d][30, 300]57.81117913728395304481061202852018-10-01 15:16:29
\n", - "
" - ], - "text/plain": [ - " mech_step run s1 s2 s3 s4 \\\n", - "0 0 1 0 0 1 1 \n", - "1 1 1 1 4 5 10 \n", - "2 2 1 ab 6 5 10 \n", - "3 3 1 [c, d] [30, 300] 5 10 \n", - "4 1 1 1 4 5 10.88462238049958452634768946 \n", - "5 2 1 ab 6 5 10.88462238049958452634768946 \n", - "6 3 1 [c, d] [30, 300] 5 10.88462238049958452634768946 \n", - "7 1 1 1 4 5 11.84390378915460105928594240 \n", - "8 2 1 ab 6 5 11.84390378915460105928594240 \n", - "9 3 1 [c, d] [30, 300] 5 11.84390378915460105928594240 \n", - "10 1 1 1 4 5 13.86870567779818175660086782 \n", - "11 2 1 ab 6 5 13.86870567779818175660086782 \n", - "12 3 1 [c, d] [30, 300] 5 13.86870567779818175660086782 \n", - "13 1 1 1 4 5 13.93809586353209725047922068 \n", - "14 2 1 ab 6 5 13.93809586353209725047922068 \n", - "15 3 1 [c, d] [30, 300] 5 13.93809586353209725047922068 \n", - "16 0 2 0 0 1 1 \n", - "17 1 2 1 4 5 10 \n", - "18 2 2 ab 6 5 10 \n", - "19 3 2 [c, d] [30, 300] 5 10 \n", - "20 1 2 1 4 5 9.454640052380469672499430089 \n", - "21 2 2 ab 6 5 9.454640052380469672499430089 \n", - "22 3 2 [c, d] [30, 300] 5 9.454640052380469672499430089 \n", - "23 1 2 1 4 5 7.992501415579613525253197635 \n", - "24 2 2 ab 6 5 7.992501415579613525253197635 \n", - "25 3 2 [c, d] [30, 300] 5 7.992501415579613525253197635 \n", - "26 1 2 1 4 5 8.777658726472379268470333983 \n", - "27 2 2 ab 6 5 8.777658726472379268470333983 \n", - "28 3 2 [c, d] [30, 300] 5 8.777658726472379268470333983 \n", - "29 1 2 1 4 5 7.811179137283953044810612028 \n", - "30 2 2 ab 6 5 7.811179137283953044810612028 \n", - "31 3 2 [c, d] [30, 300] 5 7.811179137283953044810612028 \n", - "\n", - " time_step timestamp \n", - "0 0 2018-10-01 15:16:24 \n", - "1 1 2018-10-01 15:16:25 \n", - "2 1 2018-10-01 15:16:25 \n", - "3 1 2018-10-01 15:16:25 \n", - "4 2 2018-10-01 15:16:26 \n", - "5 2 2018-10-01 15:16:26 \n", - "6 2 2018-10-01 15:16:26 \n", - "7 3 2018-10-01 15:16:27 \n", - "8 3 2018-10-01 15:16:27 \n", - "9 3 2018-10-01 15:16:27 \n", - "10 4 2018-10-01 15:16:28 \n", - "11 4 2018-10-01 15:16:28 \n", - "12 4 2018-10-01 15:16:28 \n", - "13 5 2018-10-01 15:16:29 \n", - "14 5 2018-10-01 15:16:29 \n", - "15 5 2018-10-01 15:16:29 \n", - "16 0 2018-10-01 15:16:24 \n", - "17 1 2018-10-01 15:16:25 \n", - "18 1 2018-10-01 15:16:25 \n", - "19 1 2018-10-01 15:16:25 \n", - "20 2 2018-10-01 15:16:26 \n", - "21 2 2018-10-01 15:16:26 \n", - "22 2 2018-10-01 15:16:26 \n", - "23 3 2018-10-01 15:16:27 \n", - "24 3 2018-10-01 15:16:27 \n", - "25 3 2018-10-01 15:16:27 \n", - "26 4 2018-10-01 15:16:28 \n", - "27 4 2018-10-01 15:16:28 \n", - "28 4 2018-10-01 15:16:28 \n", - "29 5 2018-10-01 15:16:29 \n", - "30 5 2018-10-01 15:16:29 \n", - "31 5 2018-10-01 15:16:29 " - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "print(\"Output A:\")\n", "results[0]" @@ -1269,127 +143,9 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Tensor Field B:\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
b1b2s1s2es1es2es3m
0<function b1m1 at 0x10a308488><bound method Identity.b_identity of <SimCAD.c...<function s1m1 at 0x10a308950><function Identity.state_identity.<locals>.<la...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...1
1<function b1m2 at 0x10a308730><bound method Identity.b_identity of <SimCAD.c...<function s1m2 at 0x10a308a60><function Identity.state_identity.<locals>.<la...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...2
2<function b1m3 at 0x10a308840><function b2m3 at 0x10a3088c8><function s1m3 at 0x10a308b70><function s2m3 at 0x10a308bf8><function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...<function curried.<locals>._curried at 0x10a30...3
\n", - "
" - ], - "text/plain": [ - " b1 \\\n", - "0 \n", - "1 \n", - "2 \n", - "\n", - " b2 \\\n", - "0 \n", - "\n", - " s1 \\\n", - "0 \n", - "1 \n", - "2 \n", - "\n", - " s2 \\\n", - "0 .. \n", - "\n", - " es1 \\\n", - "0 ._curried at 0x10a30... \n", - "1 ._curried at 0x10a30... \n", - "2 ._curried at 0x10a30... \n", - "\n", - " es2 \\\n", - "0 ._curried at 0x10a30... \n", - "1 ._curried at 0x10a30... \n", - "2 ._curried at 0x10a30... \n", - "\n", - " es3 m \n", - "0 ._curried at 0x10a30... 1 \n", - "1 ._curried at 0x10a30... 2 \n", - "2 ._curried at 0x10a30... 3 " - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "print(\"Tensor Field B:\")\n", "tensor_fields[1]" @@ -1397,479 +153,9 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Output B:\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
mech_stepruns1s2s3s4time_steptimestamp
001001102018-10-01 15:16:24
11110101012018-10-01 15:16:25
221a0101012018-10-01 15:16:25
331[c, d][30, 300]101012018-10-01 15:16:25
4111[30, 300]9.94373317277366997046783581010.4365098505119902050353175622018-10-01 15:16:26
521a[30, 300]9.94373317277366997046783581010.4365098505119902050353175622018-10-01 15:16:26
631[c, d][30, 300]9.94373317277366997046783581010.4365098505119902050353175622018-10-01 15:16:26
7111[30, 300]7.81955677476886926528452637110.5372195281202876186024801332018-10-01 15:16:27
821a[30, 300]7.81955677476886926528452637110.5372195281202876186024801332018-10-01 15:16:27
931[c, d][30, 300]7.81955677476886926528452637110.5372195281202876186024801332018-10-01 15:16:27
10111[30, 300]9.1021758460007533121249253318.57361635768008949978322321242018-10-01 15:16:28
1121a[30, 300]9.1021758460007533121249253318.57361635768008949978322321242018-10-01 15:16:28
1231[c, d][30, 300]9.1021758460007533121249253318.57361635768008949978322321242018-10-01 15:16:28
13111[30, 300]7.4697592395088619727980957658.33579435462959645300709321652018-10-01 15:16:29
1421a[30, 300]7.4697592395088619727980957658.33579435462959645300709321652018-10-01 15:16:29
1531[c, d][30, 300]7.4697592395088619727980957658.33579435462959645300709321652018-10-01 15:16:29
1602001102018-10-01 15:16:24
171210101012018-10-01 15:16:25
1822a0101012018-10-01 15:16:25
1932[c, d][30, 300]101012018-10-01 15:16:25
20121[30, 300]10.502881417158043131365730019.91725851851753992249882685422018-10-01 15:16:26
2122a[30, 300]10.502881417158043131365730019.91725851851753992249882685422018-10-01 15:16:26
2232[c, d][30, 300]10.502881417158043131365730019.91725851851753992249882685422018-10-01 15:16:26
23121[30, 300]9.1949701067745045497220664269.29544573818278309896721217232018-10-01 15:16:27
2422a[30, 300]9.1949701067745045497220664269.29544573818278309896721217232018-10-01 15:16:27
2532[c, d][30, 300]9.1949701067745045497220664269.29544573818278309896721217232018-10-01 15:16:27
26121[30, 300]8.2221862040910078929039996589.25471479697655613481958888342018-10-01 15:16:28
2722a[30, 300]8.2221862040910078929039996589.25471479697655613481958888342018-10-01 15:16:28
2832[c, d][30, 300]8.2221862040910078929039996589.25471479697655613481958888342018-10-01 15:16:28
29121[30, 300]7.4747832170044870609731757978.81306312028134610425625981852018-10-01 15:16:29
3022a[30, 300]7.4747832170044870609731757978.81306312028134610425625981852018-10-01 15:16:29
3132[c, d][30, 300]7.4747832170044870609731757978.81306312028134610425625981852018-10-01 15:16:29
\n", - "
" - ], - "text/plain": [ - " mech_step run s1 s2 s3 \\\n", - "0 0 1 0 0 1 \n", - "1 1 1 1 0 10 \n", - "2 2 1 a 0 10 \n", - "3 3 1 [c, d] [30, 300] 10 \n", - "4 1 1 1 [30, 300] 9.943733172773669970467835810 \n", - "5 2 1 a [30, 300] 9.943733172773669970467835810 \n", - "6 3 1 [c, d] [30, 300] 9.943733172773669970467835810 \n", - "7 1 1 1 [30, 300] 7.819556774768869265284526371 \n", - "8 2 1 a [30, 300] 7.819556774768869265284526371 \n", - "9 3 1 [c, d] [30, 300] 7.819556774768869265284526371 \n", - "10 1 1 1 [30, 300] 9.102175846000753312124925331 \n", - "11 2 1 a [30, 300] 9.102175846000753312124925331 \n", - "12 3 1 [c, d] [30, 300] 9.102175846000753312124925331 \n", - "13 1 1 1 [30, 300] 7.469759239508861972798095765 \n", - "14 2 1 a [30, 300] 7.469759239508861972798095765 \n", - "15 3 1 [c, d] [30, 300] 7.469759239508861972798095765 \n", - "16 0 2 0 0 1 \n", - "17 1 2 1 0 10 \n", - "18 2 2 a 0 10 \n", - "19 3 2 [c, d] [30, 300] 10 \n", - "20 1 2 1 [30, 300] 10.50288141715804313136573001 \n", - "21 2 2 a [30, 300] 10.50288141715804313136573001 \n", - "22 3 2 [c, d] [30, 300] 10.50288141715804313136573001 \n", - "23 1 2 1 [30, 300] 9.194970106774504549722066426 \n", - "24 2 2 a [30, 300] 9.194970106774504549722066426 \n", - "25 3 2 [c, d] [30, 300] 9.194970106774504549722066426 \n", - "26 1 2 1 [30, 300] 8.222186204091007892903999658 \n", - "27 2 2 a [30, 300] 8.222186204091007892903999658 \n", - "28 3 2 [c, d] [30, 300] 8.222186204091007892903999658 \n", - "29 1 2 1 [30, 300] 7.474783217004487060973175797 \n", - "30 2 2 a [30, 300] 7.474783217004487060973175797 \n", - "31 3 2 [c, d] [30, 300] 7.474783217004487060973175797 \n", - "\n", - " s4 time_step timestamp \n", - "0 1 0 2018-10-01 15:16:24 \n", - "1 10 1 2018-10-01 15:16:25 \n", - "2 10 1 2018-10-01 15:16:25 \n", - "3 10 1 2018-10-01 15:16:25 \n", - "4 10.43650985051199020503531756 2 2018-10-01 15:16:26 \n", - "5 10.43650985051199020503531756 2 2018-10-01 15:16:26 \n", - "6 10.43650985051199020503531756 2 2018-10-01 15:16:26 \n", - "7 10.53721952812028761860248013 3 2018-10-01 15:16:27 \n", - "8 10.53721952812028761860248013 3 2018-10-01 15:16:27 \n", - "9 10.53721952812028761860248013 3 2018-10-01 15:16:27 \n", - "10 8.573616357680089499783223212 4 2018-10-01 15:16:28 \n", - "11 8.573616357680089499783223212 4 2018-10-01 15:16:28 \n", - "12 8.573616357680089499783223212 4 2018-10-01 15:16:28 \n", - "13 8.335794354629596453007093216 5 2018-10-01 15:16:29 \n", - "14 8.335794354629596453007093216 5 2018-10-01 15:16:29 \n", - "15 8.335794354629596453007093216 5 2018-10-01 15:16:29 \n", - "16 1 0 2018-10-01 15:16:24 \n", - "17 10 1 2018-10-01 15:16:25 \n", - "18 10 1 2018-10-01 15:16:25 \n", - "19 10 1 2018-10-01 15:16:25 \n", - "20 9.917258518517539922498826854 2 2018-10-01 15:16:26 \n", - "21 9.917258518517539922498826854 2 2018-10-01 15:16:26 \n", - "22 9.917258518517539922498826854 2 2018-10-01 15:16:26 \n", - "23 9.295445738182783098967212172 3 2018-10-01 15:16:27 \n", - "24 9.295445738182783098967212172 3 2018-10-01 15:16:27 \n", - "25 9.295445738182783098967212172 3 2018-10-01 15:16:27 \n", - "26 9.254714796976556134819588883 4 2018-10-01 15:16:28 \n", - "27 9.254714796976556134819588883 4 2018-10-01 15:16:28 \n", - "28 9.254714796976556134819588883 4 2018-10-01 15:16:28 \n", - "29 8.813063120281346104256259818 5 2018-10-01 15:16:29 \n", - "30 8.813063120281346104256259818 5 2018-10-01 15:16:29 \n", - "31 8.813063120281346104256259818 5 2018-10-01 15:16:29 " - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "print(\"Output B:\")\n", "results[1]" diff --git a/simulations/validation/config1.py b/simulations/validation/config1.py index 4539208..a2d09d3 100644 --- a/simulations/validation/config1.py +++ b/simulations/validation/config1.py @@ -98,14 +98,14 @@ genesis_states = { 's2': Decimal(0.0), 's3': Decimal(1.0), 's4': Decimal(1.0), - 'timestep': '2018-10-01 15:16:24' +# 'timestep': '2018-10-01 15:16:24' } raw_exogenous_states = { "s3": es3p1, "s4": es4p2, - "timestep": es5p2 +# "timestep": es5p2 } @@ -121,7 +121,7 @@ partial_state_update_block = { "b1": p1m1, "b2": p2m1 }, - "states": { + "variables": { "s1": s1m1, "s2": s2m1 } @@ -131,7 +131,7 @@ partial_state_update_block = { "b1": p1m2, "b2": p2m2 }, - "states": { + "variables": { "s1": s1m2, "s2": s2m2 } @@ -141,7 +141,7 @@ partial_state_update_block = { "b1": p1m3, "b2": p2m3 }, - "states": { + "variables": { "s1": s1m3, "s2": s2m3 } @@ -163,5 +163,5 @@ append_configs( seeds=seeds, raw_exogenous_states=raw_exogenous_states, env_processes=env_processes, - partial_state_updates=partial_state_update_block + partial_state_update_blocks=partial_state_update_block ) diff --git a/simulations/validation/config2.py b/simulations/validation/config2.py index 5925c6c..6a22d01 100644 --- a/simulations/validation/config2.py +++ b/simulations/validation/config2.py @@ -97,14 +97,14 @@ genesis_states = { 's2': Decimal(0.0), 's3': Decimal(1.0), 's4': Decimal(1.0), - 'timestep': '2018-10-01 15:16:24' +# 'timestep': '2018-10-01 15:16:24' } raw_exogenous_states = { "s3": es3p1, "s4": es4p2, - "timestep": es5p2 +# "timestep": es5p2 } @@ -120,7 +120,7 @@ partial_state_update_block = { "b1": p1m1, # "b2": p2m1 }, - "states": { + "variables": { "s1": s1m1, # "s2": s2m1 } @@ -130,7 +130,7 @@ partial_state_update_block = { "b1": p1m2, # "b2": p2m2 }, - "states": { + "variables": { "s1": s1m2, # "s2": s2m2 } @@ -140,7 +140,7 @@ partial_state_update_block = { "b1": p1m3, "b2": p2m3 }, - "states": { + "variables": { "s1": s1m3, "s2": s2m3 } @@ -162,5 +162,5 @@ append_configs( seeds=seeds, raw_exogenous_states=raw_exogenous_states, env_processes=env_processes, - partial_state_updates=partial_state_update_block + partial_state_update_blocks=partial_state_update_block ) diff --git a/simulations/validation/sweep_config.py b/simulations/validation/sweep_config.py index f23e4ba..eb54b72 100644 --- a/simulations/validation/sweep_config.py +++ b/simulations/validation/sweep_config.py @@ -114,7 +114,7 @@ genesis_states = { 's2': Decimal(0.0), 's3': Decimal(1.0), 's4': Decimal(1.0), - 'timestep': '2018-10-01 15:16:24' +# 'timestep': '2018-10-01 15:16:24' } @@ -122,7 +122,7 @@ genesis_states = { raw_exogenous_states = { "s3": es3p1, "s4": es4p2, - "timestep": es5p2 +# "timestep": es5p2 } @@ -149,7 +149,7 @@ partial_state_update_block = { "b1": p1m1, "b2": p2m1 }, - "states": { + "variables": { "s1": s1m1, "s2": s2m1 } @@ -159,7 +159,7 @@ partial_state_update_block = { "b1": p1m2, "b2": p2m2, }, - "states": { + "variables": { "s1": s1m2, "s2": s2m2 } @@ -169,7 +169,7 @@ partial_state_update_block = { "b1": p1m3, "b2": p2m3 }, - "states": { + "variables": { "s1": s1m3, "s2": s2m3 } @@ -192,5 +192,5 @@ append_configs( seeds=seeds, raw_exogenous_states=raw_exogenous_states, env_processes=env_processes, - partial_state_updates=partial_state_update_block + partial_state_update_blocks=partial_state_update_block ) \ No newline at end of file From 129b11fa4c7220022a1e8b28d718cacf0d83e065 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 18 Feb 2019 10:30:47 -0300 Subject: [PATCH 24/32] bug when partial_state_update_blocks dict is empty --- simulations/example_run.ipynb | 90 ++++++------------- simulations/validation/config4.py | 142 ++++++++++++++++++++++++++++++ 2 files changed, 169 insertions(+), 63 deletions(-) create mode 100644 simulations/validation/config4.py diff --git a/simulations/example_run.ipynb b/simulations/example_run.ipynb index 41456f2..2f0bb83 100644 --- a/simulations/example_run.ipynb +++ b/simulations/example_run.ipynb @@ -11,7 +11,7 @@ "\n", "# The following imports NEED to be in the exact order\n", "from cadCAD.engine import ExecutionMode, ExecutionContext, Executor\n", - "from validation import config1, config2, config3\n", + "from validation import config1, config2, config3, config4\n", "from cadCAD import configs\n", "\n", "exec_mode = ExecutionMode()" @@ -28,7 +28,7 @@ "text": [ "\n", "config[0]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 s4 substep timestep\n", "0 1 0 0 1 1 0 0\n", "1 1 1 4 5 1.178862847343031816649272514 1 1\n", @@ -37,7 +37,7 @@ "4 1 1 4 5 1.230321371869816411424320371 1 2\n", "\n", "config[1]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 \\\n", "0 1 0 0 1 \n", "1 1 1 0 0.9583242152594528828757347583 \n", @@ -53,13 +53,16 @@ "4 1.230321371869816411424320371 1 2 \n", "\n", "config[2]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 s4 substep timestamp timestep\n", "0 1 0 0 1 1 0 2018-10-01 15:16:24 0\n", "1 1 [1] 0 1 1 1 2018-10-01 15:16:24 1\n", "2 1 [1] 0 1 1 1 2018-10-01 15:16:24 2\n", "3 1 [1] 0 1 1 1 2018-10-01 15:16:24 3\n", - "4 1 [1] 0 1 1 1 2018-10-01 15:16:24 4\n" + "4 1 [1] 0 1 1 1 2018-10-01 15:16:24 4\n", + "\n", + "config[3]\n", + "single_proc: []\n" ] }, { @@ -69,6 +72,24 @@ "/Users/markusbkoch/Documents/GitHub/DiffyQ-SimCAD/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", " FutureWarning)\n" ] + }, + { + "ename": "TypeError", + "evalue": "() takes 4 positional arguments but 5 were given", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0msingle_proc_ctx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mExecutionContext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcontext\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mexec_mode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msingle_proc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mrun1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mExecutor\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexec_context\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msingle_proc_ctx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfigs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mc\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mrun1_raw_result\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mraw_tensor_field\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 7\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mDataFrame\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrun1_raw_result\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhead\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/__init__.py\u001b[0m in \u001b[0;36mexecute\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexec_context\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mExecutionMode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msingle_proc\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 68\u001b[0m \u001b[0mtensor_field\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcreate_tensor_field\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpartial_state_updates\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meps\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 69\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexec_method\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msimulation_execs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvar_dict_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_lists\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfigs_structs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 70\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtensor_field\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 71\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexec_context\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mExecutionMode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmulti_proc\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/__init__.py\u001b[0m in \u001b[0;36msingle_proc_exec\u001b[0;34m(simulation_execs, var_dict, states_lists, configs_structs, env_processes_list, Ts, Ns)\u001b[0m\n\u001b[1;32m 20\u001b[0m \u001b[0ml\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0msimulation_execs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_lists\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfigs_structs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 21\u001b[0m \u001b[0msimulation\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mN\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmap\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mlambda\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ml\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 22\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msimulation\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mN\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 23\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mflatten\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/simulation.py\u001b[0m in \u001b[0;36msimulation\u001b[0;34m(self, var_dict, states_list, configs, env_processes, time_seq, runs)\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[0mrun\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 93\u001b[0m \u001b[0mstates_list_copy\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdeepcopy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstates_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 94\u001b[0;31m \u001b[0mhead\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0mtail\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_pipeline\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_list_copy\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfigs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtime_seq\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 95\u001b[0m \u001b[0mgenesis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhead\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 96\u001b[0m \u001b[0mgenesis\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'substep'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgenesis\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'timestep'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgenesis\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'run'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/simulation.py\u001b[0m in \u001b[0;36mrun_pipeline\u001b[0;34m(self, var_dict, states_list, configs, env_processes, time_seq, run)\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0msimulation_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mstates_list\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mtime_step\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mtime_seq\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 82\u001b[0;31m \u001b[0mpipe_run\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstate_update_pipeline\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msimulation_list\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfigs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtime_step\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 83\u001b[0m \u001b[0m_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0mpipe_run\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpipe_run\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 84\u001b[0m \u001b[0msimulation_list\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpipe_run\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/simulation.py\u001b[0m in \u001b[0;36mstate_update_pipeline\u001b[0;34m(self, var_dict, states_list, configs, env_processes, time_step, run)\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mconfig\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mconfigs\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0ms_conf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mp_conf\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 71\u001b[0;31m \u001b[0mstates_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpartial_state_update\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msub_step\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ms_conf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mp_conf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtime_step\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 72\u001b[0m \u001b[0msub_step\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 73\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/simulation.py\u001b[0m in \u001b[0;36mpartial_state_update\u001b[0;34m(self, var_dict, sub_step, sL, state_funcs, policy_funcs, env_processes, time_step, run)\u001b[0m\n\u001b[1;32m 40\u001b[0m last_in_copy = dict(\n\u001b[1;32m 41\u001b[0m [\n\u001b[0;32m---> 42\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstate_update_exception\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msub_step\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msL\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlast_in_obj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_input\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mf\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mstate_funcs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 43\u001b[0m ]\n\u001b[1;32m 44\u001b[0m )\n", + "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/simulation.py\u001b[0m in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 40\u001b[0m last_in_copy = dict(\n\u001b[1;32m 41\u001b[0m [\n\u001b[0;32m---> 42\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstate_update_exception\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msub_step\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msL\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlast_in_obj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_input\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mf\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mstate_funcs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 43\u001b[0m ]\n\u001b[1;32m 44\u001b[0m )\n", + "\u001b[0;31mTypeError\u001b[0m: () takes 4 positional arguments but 5 were given" + ] } ], "source": [ @@ -87,23 +108,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "multi_proc: [, , , , ]\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/markusbkoch/Documents/GitHub/DiffyQ-SimCAD/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", - " FutureWarning)\n" - ] - } - ], + "outputs": [], "source": [ "from validation import sweep_config\n", "multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc)\n", @@ -119,47 +124,6 @@ " print(f\"result[{idx}]\")\n", " print(r.head())" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "print(\"Tensor Field A:\")\n", - "tensor_fields[0]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(\"Output A:\")\n", - "results[0]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(\"Tensor Field B:\")\n", - "tensor_fields[1]" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "print(\"Output B:\")\n", - "results[1]" - ] } ], "metadata": { diff --git a/simulations/validation/config4.py b/simulations/validation/config4.py new file mode 100644 index 0000000..88d31f6 --- /dev/null +++ b/simulations/validation/config4.py @@ -0,0 +1,142 @@ +from decimal import Decimal +import numpy as np +from datetime import timedelta + +from cadCAD.configuration import append_configs +from cadCAD.configuration.utils import proc_trigger, bound_norm_random, ep_time_step +from cadCAD.configuration.utils.parameterSweep import config_sim + + +seeds = { + 'z': np.random.RandomState(1), + 'a': np.random.RandomState(2), + 'b': np.random.RandomState(3), + 'c': np.random.RandomState(3) +} + + +# Policies per Mechanism +def p1m1(_g, step, sL, s): + return {'param1': 1} +def p2m1(_g, step, sL, s): + return {'param2': 4} + +def p1m2(_g, step, sL, s): + return {'param1': 'a', 'param2': 2} +def p2m2(_g, step, sL, s): + return {'param1': 'b', 'param2': 4} + +def p1m3(_g, step, sL, s): + return {'param1': ['c'], 'param2': np.array([10, 100])} +def p2m3(_g, step, sL, s): + return {'param1': ['d'], 'param2': np.array([20, 200])} + + +# Internal States per Mechanism +def s1m1(_g, step, sL, s, _input): + y = 's1' + x = _input['param1'] + return (y, x) +def s2m1(_g, step, sL, s, _input): + y = 's2' + x = _input['param2'] + return (y, x) + +def s1m2(_g, step, sL, s, _input): + y = 's1' + x = _input['param1'] + return (y, x) +def s2m2(_g, step, sL, s, _input): + y = 's2' + x = _input['param2'] + return (y, x) + +def s1m3(_g, step, sL, s, _input): + y = 's1' + x = _input['param1'] + return (y, x) +def s2m3(_g, step, sL, s, _input): + y = 's2' + x = _input['param2'] + return (y, x) + +def s1m4(_g, step, sL, s, _input): + y = 's1' + x = [1] + return (y, x) + + +# Exogenous States +proc_one_coef_A = 0.7 +proc_one_coef_B = 1.3 + +def es3p1(_g, step, sL, s, _input): + y = 's3' + x = s['s3'] * bound_norm_random(seeds['a'], proc_one_coef_A, proc_one_coef_B) + return (y, x) + +def es4p2(_g, step, sL, s, _input): + y = 's4' + x = s['s4'] * bound_norm_random(seeds['b'], proc_one_coef_A, proc_one_coef_B) + return (y, x) + +ts_format = '%Y-%m-%d %H:%M:%S' +t_delta = timedelta(days=0, minutes=0, seconds=1) +def es5p2(_g, step, sL, s, _input): + y = 'timestamp' + x = ep_time_step(s, dt_str=s['timestamp'], fromat_str=ts_format, _timedelta=t_delta) + return (y, x) + + +# Environment States +def env_a(x): + return 5 +def env_b(x): + return 10 +# def what_ever(x): +# return x + 1 + + +# Genesis States +genesis_states = { + 's1': Decimal(0.0), + 's2': Decimal(0.0), + 's3': Decimal(1.0), + 's4': Decimal(1.0), + 'timestamp': '2018-10-01 15:16:24' +} + + +raw_exogenous_states = { + "s3": es3p1, + "s4": es4p2, + "timestamp": es5p2 +} + + +env_processes = { + "s3": env_a, + "s4": proc_trigger('2018-10-01 15:16:25', env_b) +} + + +partial_state_update_block = [ +] + + +sim_config = config_sim( + { + "N": 2, + "T": range(5), + } +) + + +append_configs( + sim_configs=sim_config, + initial_state=genesis_states, + seeds={}, + raw_exogenous_states={}, + env_processes={}, + partial_state_update_blocks=partial_state_update_block +) From 08950199911846b1b7ee74be384da791b8dcc286 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 18 Feb 2019 10:32:20 -0300 Subject: [PATCH 25/32] fix bug demoed at commit 129b11f --- cadCAD/configuration/__init__.py | 2 +- simulations/example_run.ipynb | 120 ++++++++++++++++++++++++------- 2 files changed, 97 insertions(+), 25 deletions(-) diff --git a/cadCAD/configuration/__init__.py b/cadCAD/configuration/__init__.py index b5cd4d3..f4c419d 100644 --- a/cadCAD/configuration/__init__.py +++ b/cadCAD/configuration/__init__.py @@ -113,7 +113,7 @@ class Processor: def only_ep_handler(state_dict): sdf_functions = [ - lambda sub_step, sL, s, _input: (k, v) for k, v in zip(state_dict.keys(), state_dict.values()) + lambda var_dict, sub_step, sL, s, _input: (k, v) for k, v in zip(state_dict.keys(), state_dict.values()) ] sdf_values = [sdf_functions] bdf_values = [[self.p_identity] * len(sdf_values)] diff --git a/simulations/example_run.ipynb b/simulations/example_run.ipynb index 2f0bb83..56490a8 100644 --- a/simulations/example_run.ipynb +++ b/simulations/example_run.ipynb @@ -28,7 +28,7 @@ "text": [ "\n", "config[0]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 s4 substep timestep\n", "0 1 0 0 1 1 0 0\n", "1 1 1 4 5 1.178862847343031816649272514 1 1\n", @@ -37,7 +37,7 @@ "4 1 1 4 5 1.230321371869816411424320371 1 2\n", "\n", "config[1]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 \\\n", "0 1 0 0 1 \n", "1 1 1 0 0.9583242152594528828757347583 \n", @@ -53,7 +53,7 @@ "4 1.230321371869816411424320371 1 2 \n", "\n", "config[2]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 s4 substep timestamp timestep\n", "0 1 0 0 1 1 0 2018-10-01 15:16:24 0\n", "1 1 [1] 0 1 1 1 2018-10-01 15:16:24 1\n", @@ -62,7 +62,13 @@ "4 1 [1] 0 1 1 1 2018-10-01 15:16:24 4\n", "\n", "config[3]\n", - "single_proc: []\n" + "single_proc: []\n", + " run s1 s2 s3 s4 substep timestamp timestep\n", + "0 1 0 0 1 1 0 2018-10-01 15:16:24 0\n", + "1 1 0 0 1 1 1 2018-10-01 15:16:24 1\n", + "2 1 0 0 1 1 1 2018-10-01 15:16:24 2\n", + "3 1 0 0 1 1 1 2018-10-01 15:16:24 3\n", + "4 1 0 0 1 1 1 2018-10-01 15:16:24 4\n" ] }, { @@ -72,24 +78,6 @@ "/Users/markusbkoch/Documents/GitHub/DiffyQ-SimCAD/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", " FutureWarning)\n" ] - }, - { - "ename": "TypeError", - "evalue": "() takes 4 positional arguments but 5 were given", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0msingle_proc_ctx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mExecutionContext\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcontext\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mexec_mode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msingle_proc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mrun1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mExecutor\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexec_context\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msingle_proc_ctx\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfigs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mc\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mrun1_raw_result\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mraw_tensor_field\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun1\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 7\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mDataFrame\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrun1_raw_result\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhead\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/__init__.py\u001b[0m in \u001b[0;36mexecute\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexec_context\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mExecutionMode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msingle_proc\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 68\u001b[0m \u001b[0mtensor_field\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcreate_tensor_field\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpartial_state_updates\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0meps\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 69\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexec_method\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msimulation_execs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvar_dict_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_lists\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfigs_structs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 70\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtensor_field\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 71\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexec_context\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0mExecutionMode\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmulti_proc\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/__init__.py\u001b[0m in \u001b[0;36msingle_proc_exec\u001b[0;34m(simulation_execs, var_dict, states_lists, configs_structs, env_processes_list, Ts, Ns)\u001b[0m\n\u001b[1;32m 20\u001b[0m \u001b[0ml\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0msimulation_execs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_lists\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfigs_structs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNs\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 21\u001b[0m \u001b[0msimulation\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mN\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmap\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mlambda\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ml\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 22\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msimulation\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mT\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mN\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 23\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mflatten\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/simulation.py\u001b[0m in \u001b[0;36msimulation\u001b[0;34m(self, var_dict, states_list, configs, env_processes, time_seq, runs)\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[0mrun\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 93\u001b[0m \u001b[0mstates_list_copy\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdeepcopy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mstates_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 94\u001b[0;31m \u001b[0mhead\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0mtail\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_pipeline\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_list_copy\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfigs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtime_seq\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 95\u001b[0m \u001b[0mgenesis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhead\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 96\u001b[0m \u001b[0mgenesis\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'substep'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgenesis\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'timestep'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgenesis\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'run'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/simulation.py\u001b[0m in \u001b[0;36mrun_pipeline\u001b[0;34m(self, var_dict, states_list, configs, env_processes, time_seq, run)\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0msimulation_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mstates_list\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mtime_step\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mtime_seq\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 82\u001b[0;31m \u001b[0mpipe_run\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstate_update_pipeline\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msimulation_list\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfigs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtime_step\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 83\u001b[0m \u001b[0m_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0mpipe_run\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpipe_run\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 84\u001b[0m \u001b[0msimulation_list\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpipe_run\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/simulation.py\u001b[0m in \u001b[0;36mstate_update_pipeline\u001b[0;34m(self, var_dict, states_list, configs, env_processes, time_step, run)\u001b[0m\n\u001b[1;32m 69\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mconfig\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mconfigs\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0ms_conf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mp_conf\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconfig\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 71\u001b[0;31m \u001b[0mstates_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpartial_state_update\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msub_step\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstates_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0ms_conf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mp_conf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0menv_processes\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtime_step\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrun\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 72\u001b[0m \u001b[0msub_step\u001b[0m \u001b[0;34m+=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 73\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/simulation.py\u001b[0m in \u001b[0;36mpartial_state_update\u001b[0;34m(self, var_dict, sub_step, sL, state_funcs, policy_funcs, env_processes, time_step, run)\u001b[0m\n\u001b[1;32m 40\u001b[0m last_in_copy = dict(\n\u001b[1;32m 41\u001b[0m [\n\u001b[0;32m---> 42\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstate_update_exception\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msub_step\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msL\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlast_in_obj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_input\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mf\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mstate_funcs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 43\u001b[0m ]\n\u001b[1;32m 44\u001b[0m )\n", - "\u001b[0;32m~/Documents/GitHub/DiffyQ-SimCAD/cadCAD/engine/simulation.py\u001b[0m in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 40\u001b[0m last_in_copy = dict(\n\u001b[1;32m 41\u001b[0m [\n\u001b[0;32m---> 42\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstate_update_exception\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvar_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msub_step\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msL\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlast_in_obj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_input\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mf\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mstate_funcs\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 43\u001b[0m ]\n\u001b[1;32m 44\u001b[0m )\n", - "\u001b[0;31mTypeError\u001b[0m: () takes 4 positional arguments but 5 were given" - ] } ], "source": [ @@ -106,9 +94,93 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "multi_proc: [, , , , , ]\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/markusbkoch/Documents/GitHub/DiffyQ-SimCAD/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", + " FutureWarning)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "result[0]\n", + " run s1 s2 s3 s4 substep \\\n", + "0 1 0 0 1 1 0 \n", + "1 1 1 4 5 0.8686135246637317619544660374 1 \n", + "2 1 ab 6 5 0.8686135246637317619544660374 2 \n", + "3 1 [c, d] [30, 300] 5 0.8686135246637317619544660374 3 \n", + "4 1 1 4 5 0.9454530210559482586784741082 1 \n", + "\n", + " timestep \n", + "0 0 \n", + "1 1 \n", + "2 1 \n", + "3 1 \n", + "4 2 \n", + "\n", + "result[1]\n", + " run s1 s2 s3 \\\n", + "0 1 0 0 1 \n", + "1 1 1 0 1.055145404454642443781153816 \n", + "2 1 a 0 1.055145404454642443781153816 \n", + "3 1 [c, d] [30, 300] 1.055145404454642443781153816 \n", + "4 1 1 [30, 300] 1.297006679532223553389019665 \n", + "\n", + " s4 substep timestep \n", + "0 1 0 0 \n", + "1 0.8686135246637317619544660374 1 1 \n", + "2 0.8686135246637317619544660374 2 1 \n", + "3 0.8686135246637317619544660374 3 1 \n", + "4 0.9454530210559482586784741082 1 2 \n", + "\n", + "result[2]\n", + " run s1 s2 s3 s4 substep timestamp timestep\n", + "0 1 0 0 1 1 0 2018-10-01 15:16:24 0\n", + "1 1 [1] 0 1 1 1 2018-10-01 15:16:24 1\n", + "2 1 [1] 0 1 1 1 2018-10-01 15:16:24 2\n", + "3 1 [1] 0 1 1 1 2018-10-01 15:16:24 3\n", + "4 1 [1] 0 1 1 1 2018-10-01 15:16:24 4\n", + "\n", + "result[3]\n", + " run s1 s2 s3 s4 substep timestamp timestep\n", + "0 1 0 0 1 1 0 2018-10-01 15:16:24 0\n", + "1 1 0 0 1 1 1 2018-10-01 15:16:24 1\n", + "2 1 0 0 1 1 1 2018-10-01 15:16:24 2\n", + "3 1 0 0 1 1 1 2018-10-01 15:16:24 3\n", + "4 1 0 0 1 1 1 2018-10-01 15:16:24 4\n", + "\n", + "result[4]\n", + " run s1 s2 s3 s4 substep timestep\n", + "0 1 0 0 1 1 0 0\n", + "1 1 0 2 3 3 1 1\n", + "2 1 2 2 3 3 2 1\n", + "3 1 0 0 3 3 3 1\n", + "4 1 0 2 3 3 1 2\n", + "\n", + "result[5]\n", + " run s1 s2 s3 s4 substep timestep\n", + "0 1 0 0 1 1 0 0\n", + "1 1 0 5 4 4 1 1\n", + "2 1 5 5 4 4 2 1\n", + "3 1 0 0 4 4 3 1\n", + "4 1 0 5 4 4 1 2\n" + ] + } + ], "source": [ "from validation import sweep_config\n", "multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc)\n", From 69dfaf391aa7360f3fa86d2ac76cdbd4dd103e55 Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 18 Feb 2019 13:39:26 -0300 Subject: [PATCH 26/32] update trigger --- dist/cadCAD-0.1-py3-none-any.whl | Bin 9794 -> 10402 bytes simulations/example_run.ipynb | 198 ++++++++++++++++++------- simulations/validation/config1.py | 2 +- simulations/validation/config2.py | 4 +- simulations/validation/sweep_config.py | 2 +- 5 files changed, 150 insertions(+), 56 deletions(-) diff --git a/dist/cadCAD-0.1-py3-none-any.whl b/dist/cadCAD-0.1-py3-none-any.whl index dce3979794db9e76c41e9d8fa44aa337dfe83aa9..ce1461508a6798844626fb2e8f984496a4f9168f 100644 GIT binary patch delta 5300 zcmZvg1yGb<_s5qOmTp*L7nVjE1SO@zrMsk-?gnA$kdzf^B_$L=7C~wSLAnK`8zdy8 zn?L?$-ub=G`+sJhx%WBud+$9n&)m;B_k7hT)F#wY$HJxr008#@Z5A&G)yaN3>%iEn zjukGj0f3yl0Wh)vNc$p;2=OFkMvS!O(y+QTy)LG@fqoyNLYgnDeKee7MOv#O@t#W! zTw?A{bGh&c%7%RDFqK1DmI|hpI231gk15itDAykEt8u0;Agh{D@>LO>&T!G6dSWcH z^I2OoqGEi1lw37lX}`3Dhr^8gV(svUcB6~!x0Hvo+!x80-mqU(h6pns4MibXm0|Hp zk`KM&%smTqs5BGRqv>O^$b*`8jp~bN=NMnhg$R18sfM-?b=5A9KFZxAr%&8CBlIEo z={4*74|tlMp&svR89)*nRvA09;Dsiv1J1var_e1`FQ!%$p3Y&^n2#iCyCMY76HUio zYB<9UdErN4`pWD%7KlfH(jVk&g33iCgVJSp*rnSI`^MG)*@D%^G=ag&~Vx^K37fjxwslf43U=&$m1fk+6`b7E#zm+Xj zY5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ee%SAEr5 z@7(rPQoNztRbR5zb~m{mp_3~r5VRt?@zJ**onDnw&WKPT(p@0%3qtIOXN(bj%w}3x zGYgP7+Y0yQ)rI`pNMURHk>pg(;8|ujh+@L*g#Ff;)a4#Ti|%gR)&Xk*L9}@PSays# zx5D41`JaOgOcD28_CIa(KVF^!0N}Yk2Knd84@VMUUK8+PM4)7#0|HDIlob?m<2nMt z%t9gT*F9NVKx*!N7!Uv`#Jm3S|H-=^^TVS_{{l0?w3uWl+21-BHUVro*T4ZV0KoJw zus#^0Nx_0iOgWpxg+=Slz%Ucg#7SInCOcgr=<`P1TDY-`fp>^|hxaa0| znDv&]\n", + "single_proc: []\n", " run s1 s2 s3 s4 substep timestep\n", "0 1 0 0 1 1 0 0\n", - "1 1 1 4 5 1.178862847343031816649272514 1 1\n", - "2 1 ab 6 5 1.178862847343031816649272514 2 1\n", - "3 1 [c, d] [30, 300] 5 1.178862847343031816649272514 3 1\n", - "4 1 1 4 5 1.230321371869816411424320371 1 2\n", + "1 1 1 4 5 10 1 1\n", + "2 1 ab 6 5 10 2 1\n", + "3 1 [c, d] [30, 300] 5 10 3 1\n", + "4 1 1 4 5 10.43650985051199020503531756 1 2\n", "\n", "config[1]\n", - "single_proc: []\n", - " run s1 s2 s3 \\\n", - "0 1 0 0 1 \n", - "1 1 1 0 0.9583242152594528828757347583 \n", - "2 1 a 0 0.9583242152594528828757347583 \n", - "3 1 [c, d] [30, 300] 0.9583242152594528828757347583 \n", - "4 1 1 [30, 300] 0.9529320289547716885340867310 \n", + "single_proc: []\n", + " run s1 s2 s3 \\\n", + "0 1 0 0 1 \n", + "1 1 1 0 10 \n", + "2 1 a 0 10 \n", + "3 1 [c, d] [30, 300] 10 \n", + "4 1 1 [30, 300] 9.943733172773669970467835810 \n", "\n", " s4 substep timestep \n", "0 1 0 0 \n", - "1 1.178862847343031816649272514 1 1 \n", - "2 1.178862847343031816649272514 2 1 \n", - "3 1.178862847343031816649272514 3 1 \n", - "4 1.230321371869816411424320371 1 2 \n", - "\n", + "1 10 1 1 \n", + "2 10 2 1 \n", + "3 10 3 1 \n", + "4 10.43650985051199020503531756 1 2 \n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", + " FutureWarning)\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ "config[2]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 s4 substep timestamp timestep\n", "0 1 0 0 1 1 0 2018-10-01 15:16:24 0\n", "1 1 [1] 0 1 1 1 2018-10-01 15:16:24 1\n", @@ -62,7 +76,7 @@ "4 1 [1] 0 1 1 1 2018-10-01 15:16:24 4\n", "\n", "config[3]\n", - "single_proc: []\n", + "single_proc: []\n", " run s1 s2 s3 s4 substep timestamp timestep\n", "0 1 0 0 1 1 0 2018-10-01 15:16:24 0\n", "1 1 0 0 1 1 1 2018-10-01 15:16:24 1\n", @@ -70,14 +84,6 @@ "3 1 0 0 1 1 1 2018-10-01 15:16:24 3\n", "4 1 0 0 1 1 1 2018-10-01 15:16:24 4\n" ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/markusbkoch/Documents/GitHub/DiffyQ-SimCAD/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", - " FutureWarning)\n" - ] } ], "source": [ @@ -101,14 +107,14 @@ "name": "stdout", "output_type": "stream", "text": [ - "multi_proc: [, , , , , ]\n" + "multi_proc: [, , , , , ]\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "/Users/markusbkoch/Documents/GitHub/DiffyQ-SimCAD/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", + "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cadCAD/utils/__init__.py:86: FutureWarning: The use of a dictionary to describe Partial State Update Blocks will be deprecated. Use a list instead.\n", " FutureWarning)\n" ] }, @@ -116,36 +122,116 @@ "name": "stdout", "output_type": "stream", "text": [ + "[([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 1}, {'s1': 1, 's2': 4, 's3': 5, 's4': 10, 'substep': 1, 'timestep': 1, 'run': 1}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': 10, 'substep': 2, 'timestep': 1, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': 10, 'substep': 3, 'timestep': 1, 'run': 1}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('10.88462238049958452634768946'), 'substep': 1, 'timestep': 2, 'run': 1}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('10.88462238049958452634768946'), 'substep': 2, 'timestep': 2, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('10.88462238049958452634768946'), 'substep': 3, 'timestep': 2, 'run': 1}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('11.84390378915460105928594240'), 'substep': 1, 'timestep': 3, 'run': 1}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('11.84390378915460105928594240'), 'substep': 2, 'timestep': 3, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('11.84390378915460105928594240'), 'substep': 3, 'timestep': 3, 'run': 1}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('13.86870567779818175660086782'), 'substep': 1, 'timestep': 4, 'run': 1}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('13.86870567779818175660086782'), 'substep': 2, 'timestep': 4, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('13.86870567779818175660086782'), 'substep': 3, 'timestep': 4, 'run': 1}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('13.93809586353209725047922068'), 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('13.93809586353209725047922068'), 'substep': 2, 'timestep': 5, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('13.93809586353209725047922068'), 'substep': 3, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 2}, {'s1': 1, 's2': 4, 's3': 5, 's4': 10, 'substep': 1, 'timestep': 1, 'run': 2}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': 10, 'substep': 2, 'timestep': 1, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': 10, 'substep': 3, 'timestep': 1, 'run': 2}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('9.454640052380469672499430089'), 'substep': 1, 'timestep': 2, 'run': 2}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('9.454640052380469672499430089'), 'substep': 2, 'timestep': 2, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('9.454640052380469672499430089'), 'substep': 3, 'timestep': 2, 'run': 2}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('7.992501415579613525253197635'), 'substep': 1, 'timestep': 3, 'run': 2}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('7.992501415579613525253197635'), 'substep': 2, 'timestep': 3, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('7.992501415579613525253197635'), 'substep': 3, 'timestep': 3, 'run': 2}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('8.777658726472379268470333983'), 'substep': 1, 'timestep': 4, 'run': 2}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('8.777658726472379268470333983'), 'substep': 2, 'timestep': 4, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('8.777658726472379268470333983'), 'substep': 3, 'timestep': 4, 'run': 2}, {'s1': 1, 's2': 4, 's3': 5, 's4': Decimal('7.811179137283953044810612028'), 'substep': 1, 'timestep': 5, 'run': 2}, {'s1': 'ab', 's2': 6, 's3': 5, 's4': Decimal('7.811179137283953044810612028'), 'substep': 2, 'timestep': 5, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 5, 's4': Decimal('7.811179137283953044810612028'), 'substep': 3, 'timestep': 5, 'run': 2}], b1 b2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " s1 s2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " es1 \\\n", + "0 ._curried at 0x11204... \n", + "1 ._curried at 0x11204... \n", + "2 ._curried at 0x11204... \n", + "\n", + " es2 m \n", + "0 ._curried at 0x11204... 1 \n", + "1 ._curried at 0x11204... 2 \n", + "2 ._curried at 0x11204... 3 ), ([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 1}, {'s1': 1, 's2': Decimal('0'), 's3': 10, 's4': 10, 'substep': 1, 'timestep': 1, 'run': 1}, {'s1': 'a', 's2': Decimal('0'), 's3': 10, 's4': 10, 'substep': 2, 'timestep': 1, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 10, 's4': 10, 'substep': 3, 'timestep': 1, 'run': 1}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('12.29220801281495800694187892'), 's4': Decimal('10.88462238049958452634768946'), 'substep': 1, 'timestep': 2, 'run': 1}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('12.29220801281495800694187892'), 's4': Decimal('10.88462238049958452634768946'), 'substep': 2, 'timestep': 2, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('12.29220801281495800694187892'), 's4': Decimal('10.88462238049958452634768946'), 'substep': 3, 'timestep': 2, 'run': 1}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('12.34326909876120344349913442'), 's4': Decimal('11.84390378915460105928594240'), 'substep': 1, 'timestep': 3, 'run': 1}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('12.34326909876120344349913442'), 's4': Decimal('11.84390378915460105928594240'), 'substep': 2, 'timestep': 3, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('12.34326909876120344349913442'), 's4': Decimal('11.84390378915460105928594240'), 'substep': 3, 'timestep': 3, 'run': 1}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('10.96338363862234990976085712'), 's4': Decimal('13.86870567779818175660086782'), 'substep': 1, 'timestep': 4, 'run': 1}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('10.96338363862234990976085712'), 's4': Decimal('13.86870567779818175660086782'), 'substep': 2, 'timestep': 4, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('10.96338363862234990976085712'), 's4': Decimal('13.86870567779818175660086782'), 'substep': 3, 'timestep': 4, 'run': 1}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('11.55437395583421707706326497'), 's4': Decimal('13.93809586353209725047922068'), 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('11.55437395583421707706326497'), 's4': Decimal('13.93809586353209725047922068'), 'substep': 2, 'timestep': 5, 'run': 1}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('11.55437395583421707706326497'), 's4': Decimal('13.93809586353209725047922068'), 'substep': 3, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 2}, {'s1': 1, 's2': Decimal('0'), 's3': 10, 's4': 10, 'substep': 1, 'timestep': 1, 'run': 2}, {'s1': 'a', 's2': Decimal('0'), 's3': 10, 's4': 10, 'substep': 2, 'timestep': 1, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': 10, 's4': 10, 'substep': 3, 'timestep': 1, 'run': 2}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('9.980869503478848603350570556'), 's4': Decimal('9.454640052380469672499430089'), 'substep': 1, 'timestep': 2, 'run': 2}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('9.980869503478848603350570556'), 's4': Decimal('9.454640052380469672499430089'), 'substep': 2, 'timestep': 2, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('9.980869503478848603350570556'), 's4': Decimal('9.454640052380469672499430089'), 'substep': 3, 'timestep': 2, 'run': 2}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('11.15362288730493994485387979'), 's4': Decimal('7.992501415579613525253197635'), 'substep': 1, 'timestep': 3, 'run': 2}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('11.15362288730493994485387979'), 's4': Decimal('7.992501415579613525253197635'), 'substep': 2, 'timestep': 3, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('11.15362288730493994485387979'), 's4': Decimal('7.992501415579613525253197635'), 'substep': 3, 'timestep': 3, 'run': 2}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('10.31947583362548981535476519'), 's4': Decimal('8.777658726472379268470333983'), 'substep': 1, 'timestep': 4, 'run': 2}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('10.31947583362548981535476519'), 's4': Decimal('8.777658726472379268470333983'), 'substep': 2, 'timestep': 4, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('10.31947583362548981535476519'), 's4': Decimal('8.777658726472379268470333983'), 'substep': 3, 'timestep': 4, 'run': 2}, {'s1': 1, 's2': array([ 30, 300]), 's3': Decimal('10.32878941955665265801415268'), 's4': Decimal('7.811179137283953044810612028'), 'substep': 1, 'timestep': 5, 'run': 2}, {'s1': 'a', 's2': array([ 30, 300]), 's3': Decimal('10.32878941955665265801415268'), 's4': Decimal('7.811179137283953044810612028'), 'substep': 2, 'timestep': 5, 'run': 2}, {'s1': ['c', 'd'], 's2': array([ 30, 300]), 's3': Decimal('10.32878941955665265801415268'), 's4': Decimal('7.811179137283953044810612028'), 'substep': 3, 'timestep': 5, 'run': 2}], b1 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " b2 \\\n", + "0 \n", + "\n", + " s1 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " s2 \\\n", + "0 .. \n", + "\n", + " es1 \\\n", + "0 ._curried at 0x11205... \n", + "1 ._curried at 0x11205... \n", + "2 ._curried at 0x11205... \n", + "\n", + " es2 m \n", + "0 ._curried at 0x11205... 1 \n", + "1 ._curried at 0x11205... 2 \n", + "2 ._curried at 0x11205... 3 ), ([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 0, 'timestep': 0, 'run': 1}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 1, 'run': 1}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 2, 'run': 1}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 3, 'run': 1}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 4, 'run': 1}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 0, 'timestep': 0, 'run': 2}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 1, 'run': 2}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 2, 'run': 2}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 3, 'run': 2}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 4, 'run': 2}, {'s1': [1], 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 1, 'timestep': 5, 'run': 2}], empty s1 m\n", + "0 NaN 1), ([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 0, 'timestep': 0, 'run': 1}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 1, 'run': 1}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 2, 'run': 1}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 3, 'run': 1}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 4, 'run': 1}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'timestamp': '2018-10-01 15:16:24', 'substep': 0, 'timestep': 0, 'run': 2}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 1, 'run': 2}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 2, 'run': 2}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 3, 'run': 2}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 4, 'run': 2}, {'timestamp': '2018-10-01 15:16:24', 's1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 1, 'timestep': 5, 'run': 2}], Empty DataFrame\n", + "Columns: [empty, empty, m]\n", + "Index: []), ([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 1}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 1, 'run': 1}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 1, 'run': 1}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 1, 'run': 1}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 2, 'run': 1}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 2, 'run': 1}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 2, 'run': 1}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 3, 'run': 1}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 3, 'run': 1}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 3, 'run': 1}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 4, 'run': 1}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 4, 'run': 1}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 4, 'run': 1}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 5, 'run': 1}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 2}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 1, 'run': 2}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 1, 'run': 2}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 1, 'run': 2}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 2, 'run': 2}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 2, 'run': 2}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 2, 'run': 2}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 3, 'run': 2}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 3, 'run': 2}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 3, 'run': 2}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 4, 'run': 2}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 4, 'run': 2}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 4, 'run': 2}, {'s1': 0, 's2': 2, 's3': 3, 's4': 3, 'substep': 1, 'timestep': 5, 'run': 2}, {'s1': 2, 's2': 2, 's3': 3, 's4': 3, 'substep': 2, 'timestep': 5, 'run': 2}, {'s1': 0, 's2': 0, 's3': 3, 's4': 3, 'substep': 3, 'timestep': 5, 'run': 2}], b1 b2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " s1 s2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " es1 \\\n", + "0 ._curried at 0x1120a... \n", + "1 ._curried at 0x1120a... \n", + "2 ._curried at 0x1120a... \n", + "\n", + " es2 m \n", + "0 ._curried at 0x1120a... 1 \n", + "1 ._curried at 0x1120a... 2 \n", + "2 ._curried at 0x1120a... 3 ), ([{'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 1}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 1, 'run': 1}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 1, 'run': 1}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 1, 'run': 1}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 2, 'run': 1}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 2, 'run': 1}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 2, 'run': 1}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 3, 'run': 1}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 3, 'run': 1}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 3, 'run': 1}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 4, 'run': 1}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 4, 'run': 1}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 4, 'run': 1}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 5, 'run': 1}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 5, 'run': 1}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 5, 'run': 1}, {'s1': Decimal('0'), 's2': Decimal('0'), 's3': Decimal('1'), 's4': Decimal('1'), 'substep': 0, 'timestep': 0, 'run': 2}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 1, 'run': 2}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 1, 'run': 2}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 1, 'run': 2}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 2, 'run': 2}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 2, 'run': 2}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 2, 'run': 2}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 3, 'run': 2}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 3, 'run': 2}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 3, 'run': 2}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 4, 'run': 2}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 4, 'run': 2}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 4, 'run': 2}, {'s1': 0, 's2': 5, 's3': 4, 's4': 4, 'substep': 1, 'timestep': 5, 'run': 2}, {'s1': 5, 's2': 5, 's3': 4, 's4': 4, 'substep': 2, 'timestep': 5, 'run': 2}, {'s1': 0, 's2': 0, 's3': 4, 's4': 4, 'substep': 3, 'timestep': 5, 'run': 2}], b1 b2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " s1 s2 \\\n", + "0 \n", + "1 \n", + "2 \n", + "\n", + " es1 \\\n", + "0 ._curried at 0x1120a... \n", + "1 ._curried at 0x1120a... \n", + "2 ._curried at 0x1120a... \n", + "\n", + " es2 m \n", + "0 ._curried at 0x1120a... 1 \n", + "1 ._curried at 0x1120a... 2 \n", + "2 ._curried at 0x1120a... 3 )]\n", + "multi_proc: [, , , , , ]\n", "\n", "result[0]\n", - " run s1 s2 s3 s4 substep \\\n", - "0 1 0 0 1 1 0 \n", - "1 1 1 4 5 0.8686135246637317619544660374 1 \n", - "2 1 ab 6 5 0.8686135246637317619544660374 2 \n", - "3 1 [c, d] [30, 300] 5 0.8686135246637317619544660374 3 \n", - "4 1 1 4 5 0.9454530210559482586784741082 1 \n", - "\n", - " timestep \n", - "0 0 \n", - "1 1 \n", - "2 1 \n", - "3 1 \n", - "4 2 \n", + " run s1 s2 s3 s4 substep timestep\n", + "0 1 0 0 1 1 0 0\n", + "1 1 1 4 5 10 1 1\n", + "2 1 ab 6 5 10 2 1\n", + "3 1 [c, d] [30, 300] 5 10 3 1\n", + "4 1 1 4 5 10.88462238049958452634768946 1 2\n", "\n", "result[1]\n", " run s1 s2 s3 \\\n", "0 1 0 0 1 \n", - "1 1 1 0 1.055145404454642443781153816 \n", - "2 1 a 0 1.055145404454642443781153816 \n", - "3 1 [c, d] [30, 300] 1.055145404454642443781153816 \n", - "4 1 1 [30, 300] 1.297006679532223553389019665 \n", + "1 1 1 0 10 \n", + "2 1 a 0 10 \n", + "3 1 [c, d] [30, 300] 10 \n", + "4 1 1 [30, 300] 12.29220801281495800694187892 \n", "\n", - " s4 substep timestep \n", - "0 1 0 0 \n", - "1 0.8686135246637317619544660374 1 1 \n", - "2 0.8686135246637317619544660374 2 1 \n", - "3 0.8686135246637317619544660374 3 1 \n", - "4 0.9454530210559482586784741082 1 2 \n", + " s4 substep timestep \n", + "0 1 0 0 \n", + "1 10 1 1 \n", + "2 10 2 1 \n", + "3 10 3 1 \n", + "4 10.88462238049958452634768946 1 2 \n", "\n", "result[2]\n", " run s1 s2 s3 s4 substep timestamp timestep\n", @@ -185,6 +271,7 @@ "from validation import sweep_config\n", "multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc)\n", "run2 = Executor(exec_context=multi_proc_ctx, configs=configs)\n", + "print(run2.main())\n", "results = []\n", "tensor_fields = []\n", "for raw_result, raw_tensor_field in run2.main():\n", @@ -196,6 +283,13 @@ " print(f\"result[{idx}]\")\n", " print(r.head())" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/simulations/validation/config1.py b/simulations/validation/config1.py index a2d09d3..1ad90e5 100644 --- a/simulations/validation/config1.py +++ b/simulations/validation/config1.py @@ -111,7 +111,7 @@ raw_exogenous_states = { env_processes = { "s3": env_a, - "s4": proc_trigger('2018-10-01 15:16:25', env_b) + "s4": proc_trigger(1, env_b) } diff --git a/simulations/validation/config2.py b/simulations/validation/config2.py index 6a22d01..31734e2 100644 --- a/simulations/validation/config2.py +++ b/simulations/validation/config2.py @@ -109,8 +109,8 @@ raw_exogenous_states = { env_processes = { - "s3": proc_trigger('2018-10-01 15:16:25', env_a), - "s4": proc_trigger('2018-10-01 15:16:25', env_b) + "s3": proc_trigger(1, env_a), + "s4": proc_trigger(1, env_b) } diff --git a/simulations/validation/sweep_config.py b/simulations/validation/sweep_config.py index eb54b72..09ccd6b 100644 --- a/simulations/validation/sweep_config.py +++ b/simulations/validation/sweep_config.py @@ -128,7 +128,7 @@ raw_exogenous_states = { # ToDo: make env proc trigger field agnostic # ToDo: input json into function renaming __name__ -triggered_env_b = proc_trigger('2018-10-01 15:16:25', env_b) +triggered_env_b = proc_trigger(1, env_b) env_processes = { "s3": env_a, #sweep(beta, env_a), "s4": triggered_env_b #rename('parameterized', triggered_env_b) #sweep(beta, triggered_env_b) From 59ba3d9f21d6f3b645f6025a45a287985b5c909a Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Mon, 18 Feb 2019 12:22:22 -0500 Subject: [PATCH 27/32] update state update --- cadCAD/configuration/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cadCAD/configuration/utils/__init__.py b/cadCAD/configuration/utils/__init__.py index 084f7ae..788d91c 100644 --- a/cadCAD/configuration/utils/__init__.py +++ b/cadCAD/configuration/utils/__init__.py @@ -25,7 +25,7 @@ class TensorFieldReport: # # def state_update(y, x): - return lambda sub_step, sL, s, _input: (y, x) + return lambda var_dict, sub_step, sL, s, _input: (y, x) def bound_norm_random(rng, low, high): From fe730c3e6c4da61e974276c176154fca0c773381 Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Mon, 18 Feb 2019 12:30:36 -0500 Subject: [PATCH 28/32] changed jupyter file --- simulations/example_run.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/simulations/example_run.py b/simulations/example_run.py index 58c7878..c37bee9 100644 --- a/simulations/example_run.py +++ b/simulations/example_run.py @@ -2,7 +2,7 @@ import pandas as pd from tabulate import tabulate # The following imports NEED to be in the exact order from cadCAD.engine import ExecutionMode, ExecutionContext, Executor -from simulations.validation import sweep_config, config1, config2 +from simulations.validation import config4 #sweep_config, config1, config2 from cadCAD import configs exec_mode = ExecutionMode() @@ -21,14 +21,14 @@ print("Output:") print(tabulate(result, headers='keys', tablefmt='psql')) print() -print("Simulation Execution 2: Concurrent Execution") -multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc) -run2 = Executor(exec_context=multi_proc_ctx, configs=configs) -for raw_result, tensor_field in run2.main(): - result = pd.DataFrame(raw_result) - print() - print("Tensor Field:") - print(tabulate(tensor_field, headers='keys', tablefmt='psql')) - print("Output:") - print(tabulate(result, headers='keys', tablefmt='psql')) - print() +# print("Simulation Execution 2: Concurrent Execution") +# multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc) +# run2 = Executor(exec_context=multi_proc_ctx, configs=configs) +# for raw_result, tensor_field in run2.main(): +# result = pd.DataFrame(raw_result) +# print() +# print("Tensor Field:") +# print(tabulate(tensor_field, headers='keys', tablefmt='psql')) +# print("Output:") +# print(tabulate(result, headers='keys', tablefmt='psql')) +# print() From d04e2bb7e461206b389f7729cb3d2e4409db308e Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Mon, 18 Feb 2019 12:32:47 -0500 Subject: [PATCH 29/32] changed jupyter file --- simulations/example_run.py | 50 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/simulations/example_run.py b/simulations/example_run.py index c37bee9..3c80d44 100644 --- a/simulations/example_run.py +++ b/simulations/example_run.py @@ -2,33 +2,33 @@ import pandas as pd from tabulate import tabulate # The following imports NEED to be in the exact order from cadCAD.engine import ExecutionMode, ExecutionContext, Executor -from simulations.validation import config4 #sweep_config, config1, config2 +from simulations.validation import sweep_config, config1, config2 from cadCAD import configs exec_mode = ExecutionMode() -print("Simulation Execution 1") -print() -first_config = [configs[0]] # from config1 -single_proc_ctx = ExecutionContext(context=exec_mode.single_proc) -run1 = Executor(exec_context=single_proc_ctx, configs=first_config) -run1_raw_result, tensor_field = run1.main() -result = pd.DataFrame(run1_raw_result) -print() -print("Tensor Field:") -print(tabulate(tensor_field, headers='keys', tablefmt='psql')) -print("Output:") -print(tabulate(result, headers='keys', tablefmt='psql')) -print() +# print("Simulation Execution 1") +# print() +# first_config = [configs[0]] # from config1 +# single_proc_ctx = ExecutionContext(context=exec_mode.single_proc) +# run1 = Executor(exec_context=single_proc_ctx, configs=first_config) +# run1_raw_result, tensor_field = run1.main() +# result = pd.DataFrame(run1_raw_result) +# print() +# print("Tensor Field:") +# print(tabulate(tensor_field, headers='keys', tablefmt='psql')) +# print("Output:") +# print(tabulate(result, headers='keys', tablefmt='psql')) +# print() -# print("Simulation Execution 2: Concurrent Execution") -# multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc) -# run2 = Executor(exec_context=multi_proc_ctx, configs=configs) -# for raw_result, tensor_field in run2.main(): -# result = pd.DataFrame(raw_result) -# print() -# print("Tensor Field:") -# print(tabulate(tensor_field, headers='keys', tablefmt='psql')) -# print("Output:") -# print(tabulate(result, headers='keys', tablefmt='psql')) -# print() +print("Simulation Execution 2: Concurrent Execution") +multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc) +run2 = Executor(exec_context=multi_proc_ctx, configs=configs) +for raw_result, tensor_field in run2.main(): + result = pd.DataFrame(raw_result) + print() + print("Tensor Field:") + print(tabulate(tensor_field, headers='keys', tablefmt='psql')) + print("Output:") + print(tabulate(result, headers='keys', tablefmt='psql')) + print() From ef9d73a32c4201bbbb8bce6582b398d5e8706c16 Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Mon, 18 Feb 2019 14:00:39 -0500 Subject: [PATCH 30/32] e-courage 2 --- cadCAD/configuration/__init__.py | 78 +++++-------------- cadCAD/configuration/utils/__init__.py | 5 +- .../utils/depreciationHandler.py | 46 +++++++++++ cadCAD/utils/__init__.py | 1 + simulations/example_run.py | 50 ++++++------ 5 files changed, 94 insertions(+), 86 deletions(-) create mode 100644 cadCAD/configuration/utils/depreciationHandler.py diff --git a/cadCAD/configuration/__init__.py b/cadCAD/configuration/__init__.py index c4d7a88..82d13d0 100644 --- a/cadCAD/configuration/__init__.py +++ b/cadCAD/configuration/__init__.py @@ -1,12 +1,13 @@ from functools import reduce from fn.op import foldr import pandas as pd -from copy import deepcopy from cadCAD import configs + from cadCAD.utils import key_filter -from cadCAD.configuration.utils.policyAggregation import dict_elemwise_sum from cadCAD.configuration.utils import exo_update_per_ts +from cadCAD.configuration.utils.policyAggregation import dict_elemwise_sum +from cadCAD.configuration.utils.depreciationHandler import sanitize_partial_state_updates, sanitize_config class Configuration(object): @@ -19,22 +20,10 @@ class Configuration(object): self.exogenous_states = exogenous_states self.partial_state_updates = partial_state_update_blocks self.policy_ops = policy_ops - - # for backwards compatibility, we accept old arguments via **kwargs - # TODO: raise specific deprecation warnings for key == 'state_dict', key == 'seed', key == 'mechanisms' - for key, value in kwargs.items(): - if key == 'state_dict': - self.initial_state = value - elif key == 'seed': - self.seeds = value - elif key == 'mechanisms': - self.partial_state_updates = value - - if self.initial_state == {}: - raise Exception('The initial conditions of the system have not been set') + self.kwargs = kwargs -def append_configs(sim_configs, initial_state, seeds, raw_exogenous_states, env_processes, partial_state_update_blocks, _exo_update_per_ts=True): +def append_configs(sim_configs={}, initial_state={}, seeds={}, raw_exogenous_states={}, env_processes={}, partial_state_update_blocks={}, _exo_update_per_ts=True): if _exo_update_per_ts is True: exogenous_states = exo_update_per_ts(raw_exogenous_states) else: @@ -42,27 +31,27 @@ def append_configs(sim_configs, initial_state, seeds, raw_exogenous_states, env_ if isinstance(sim_configs, list): for sim_config in sim_configs: - configs.append( - Configuration( - sim_config=sim_config, - initial_state=initial_state, - seeds=seeds, - exogenous_states=exogenous_states, - env_processes=env_processes, - partial_state_update_blocks=partial_state_update_blocks - ) - ) - elif isinstance(sim_configs, dict): - configs.append( - Configuration( - sim_config=sim_configs, + config = Configuration( + sim_config=sim_config, initial_state=initial_state, seeds=seeds, exogenous_states=exogenous_states, env_processes=env_processes, partial_state_update_blocks=partial_state_update_blocks ) + back_compatable_config = sanitize_config(config) + configs.append(back_compatable_config) + elif isinstance(sim_configs, dict): + config = Configuration( + sim_config=sim_configs, + initial_state=initial_state, + seeds=seeds, + exogenous_states=exogenous_states, + env_processes=env_processes, + partial_state_update_blocks=partial_state_update_blocks ) + back_compatable_config = sanitize_config(config) + configs.append(back_compatable_config) class Identity: @@ -134,35 +123,10 @@ class Processor: bdf_values = [[self.p_identity] * len(sdf_values)] return sdf_values, bdf_values - # backwards compatibility - def sanitize_partial_state_updates(partial_state_updates): - new_partial_state_updates = deepcopy(partial_state_updates) - # for backwards compatibility we accept the old keys - # ('behaviors' and 'states') and rename them - def rename_keys(d): - try: - d['policies'] = d.pop('behaviors') - except KeyError: - pass - try: - d['variables'] = d.pop('states') - except KeyError: - pass - - # Also for backwards compatibility, we accept partial state update blocks both as list or dict - # No need for a deprecation warning as it's already raised by cadCAD.utils.key_filter - if (type(new_partial_state_updates)==list): - for v in new_partial_state_updates: - rename_keys(v) - elif (type(new_partial_state_updates)==dict): - for k, v in new_partial_state_updates.items(): - rename_keys(v) - - del partial_state_updates - return new_partial_state_updates - if len(partial_state_updates) != 0: + # backwards compatibility partial_state_updates = sanitize_partial_state_updates(partial_state_updates) + bdf = self.create_matrix_field(partial_state_updates, 'policies') sdf = self.create_matrix_field(partial_state_updates, 'variables') sdf_values, bdf_values = no_update_handler(bdf, sdf) diff --git a/cadCAD/configuration/utils/__init__.py b/cadCAD/configuration/utils/__init__.py index ed17912..2a60d3e 100644 --- a/cadCAD/configuration/utils/__init__.py +++ b/cadCAD/configuration/utils/__init__.py @@ -12,6 +12,7 @@ class TensorFieldReport: def __init__(self, config_proc): self.config_proc = config_proc + # ToDo: backwards compatibility def create_tensor_field(self, partial_state_updates, exo_proc, keys=['policies', 'variables']): dfs = [self.config_proc.create_matrix_field(partial_state_updates, k) for k in keys] df = pd.concat(dfs, axis=1) @@ -21,10 +22,6 @@ class TensorFieldReport: return df -# def s_update(y, x): -# return lambda step, sL, s, _input: (y, x) -# -# def state_update(y, x): return lambda var_dict, sub_step, sL, s, _input: (y, x) diff --git a/cadCAD/configuration/utils/depreciationHandler.py b/cadCAD/configuration/utils/depreciationHandler.py new file mode 100644 index 0000000..148163d --- /dev/null +++ b/cadCAD/configuration/utils/depreciationHandler.py @@ -0,0 +1,46 @@ +from copy import deepcopy + + +def sanitize_config(config): + new_config = deepcopy(config) + # for backwards compatibility, we accept old arguments via **kwargs + # TODO: raise specific deprecation warnings for key == 'state_dict', key == 'seed', key == 'mechanisms' + for key, value in new_config.kwargs.items(): + if key == 'state_dict': + new_config.initial_state = value + elif key == 'seed': + new_config.seeds = value + elif key == 'mechanisms': + new_config.partial_state_updates = value + + if new_config.initial_state == {}: + raise Exception('The initial conditions of the system have not been set') + + del config + return new_config + + +def sanitize_partial_state_updates(partial_state_updates): + new_partial_state_updates = deepcopy(partial_state_updates) + # for backwards compatibility we accept the old keys + # ('behaviors' and 'states') and rename them + def rename_keys(d): + + if 'behaviors' in d: + d['policies'] = d.pop('behaviors') + + if 'states' in d: + d['variables'] = d.pop('states') + + + # Also for backwards compatibility, we accept partial state update blocks both as list or dict + # No need for a deprecation warning as it's already raised by cadCAD.utils.key_filter + if (type(new_partial_state_updates)==list): + for v in new_partial_state_updates: + rename_keys(v) + elif (type(new_partial_state_updates)==dict): + for k, v in new_partial_state_updates.items(): + rename_keys(v) + + del partial_state_updates + return new_partial_state_updates \ No newline at end of file diff --git a/cadCAD/utils/__init__.py b/cadCAD/utils/__init__.py index 0ac3c39..dac15c1 100644 --- a/cadCAD/utils/__init__.py +++ b/cadCAD/utils/__init__.py @@ -76,6 +76,7 @@ def drop_right(l, n): return l[:len(l) - n] # backwards compatibility +# ToDo: Encapsulate in function def key_filter(l, keyname): if (type(l) == list): return [v[keyname] for v in l] diff --git a/simulations/example_run.py b/simulations/example_run.py index 172a622..b0b385e 100644 --- a/simulations/example_run.py +++ b/simulations/example_run.py @@ -2,33 +2,33 @@ import pandas as pd from tabulate import tabulate # The following imports NEED to be in the exact order from cadCAD.engine import ExecutionMode, ExecutionContext, Executor -from simulations.validation import sweep_config, config1, config2, config4 +from simulations.validation import config2 #sweep_config, config1, config2, config4 from cadCAD import configs exec_mode = ExecutionMode() -# print("Simulation Execution 1") -# print() -# first_config = [configs[0]] # from config1 -# single_proc_ctx = ExecutionContext(context=exec_mode.single_proc) -# run1 = Executor(exec_context=single_proc_ctx, configs=first_config) -# run1_raw_result, tensor_field = run1.main() -# result = pd.DataFrame(run1_raw_result) -# print() -# print("Tensor Field:") -# print(tabulate(tensor_field, headers='keys', tablefmt='psql')) -# print("Output:") -# print(tabulate(result, headers='keys', tablefmt='psql')) -# print() +print("Simulation Execution 1") +print() +first_config = [configs[0]] # from config1 +single_proc_ctx = ExecutionContext(context=exec_mode.single_proc) +run1 = Executor(exec_context=single_proc_ctx, configs=first_config) +run1_raw_result, tensor_field = run1.main() +result = pd.DataFrame(run1_raw_result) +print() +print("Tensor Field:") +print(tabulate(tensor_field, headers='keys', tablefmt='psql')) +print("Output:") +print(tabulate(result, headers='keys', tablefmt='psql')) +print() -print("Simulation Execution 2: Concurrent Execution") -multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc) -run2 = Executor(exec_context=multi_proc_ctx, configs=configs) -for raw_result, tensor_field in run2.main(): - result = pd.DataFrame(raw_result) - print() - print("Tensor Field:") - print(tabulate(tensor_field, headers='keys', tablefmt='psql')) - print("Output:") - print(tabulate(result, headers='keys', tablefmt='psql')) - print() +# print("Simulation Execution 2: Concurrent Execution") +# multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc) +# run2 = Executor(exec_context=multi_proc_ctx, configs=configs) +# for raw_result, tensor_field in run2.main(): +# result = pd.DataFrame(raw_result) +# print() +# print("Tensor Field:") +# print(tabulate(tensor_field, headers='keys', tablefmt='psql')) +# print("Output:") +# print(tabulate(result, headers='keys', tablefmt='psql')) +# print() From 5863188617bf8fa6bf66e0cb8c1aa6e0886903a7 Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Mon, 18 Feb 2019 14:12:06 -0500 Subject: [PATCH 31/32] e-courage: modularizing backwards compatability --- cadCAD/configuration/__init__.py | 10 +++++----- cadCAD/configuration/utils/depreciationHandler.py | 14 +++++--------- cadCAD/engine/__init__.py | 1 + 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/cadCAD/configuration/__init__.py b/cadCAD/configuration/__init__.py index 82d13d0..563a80f 100644 --- a/cadCAD/configuration/__init__.py +++ b/cadCAD/configuration/__init__.py @@ -22,6 +22,8 @@ class Configuration(object): self.policy_ops = policy_ops self.kwargs = kwargs + sanitize_config(self) + def append_configs(sim_configs={}, initial_state={}, seeds={}, raw_exogenous_states={}, env_processes={}, partial_state_update_blocks={}, _exo_update_per_ts=True): if _exo_update_per_ts is True: @@ -39,8 +41,7 @@ def append_configs(sim_configs={}, initial_state={}, seeds={}, raw_exogenous_sta env_processes=env_processes, partial_state_update_blocks=partial_state_update_blocks ) - back_compatable_config = sanitize_config(config) - configs.append(back_compatable_config) + configs.append(config) elif isinstance(sim_configs, dict): config = Configuration( sim_config=sim_configs, @@ -50,8 +51,7 @@ def append_configs(sim_configs={}, initial_state={}, seeds={}, raw_exogenous_sta env_processes=env_processes, partial_state_update_blocks=partial_state_update_blocks ) - back_compatable_config = sanitize_config(config) - configs.append(back_compatable_config) + configs.append(config) class Identity: @@ -124,7 +124,7 @@ class Processor: return sdf_values, bdf_values if len(partial_state_updates) != 0: - # backwards compatibility + # backwards compatibility # ToDo: Move this partial_state_updates = sanitize_partial_state_updates(partial_state_updates) bdf = self.create_matrix_field(partial_state_updates, 'policies') diff --git a/cadCAD/configuration/utils/depreciationHandler.py b/cadCAD/configuration/utils/depreciationHandler.py index 148163d..1f2862a 100644 --- a/cadCAD/configuration/utils/depreciationHandler.py +++ b/cadCAD/configuration/utils/depreciationHandler.py @@ -2,23 +2,19 @@ from copy import deepcopy def sanitize_config(config): - new_config = deepcopy(config) # for backwards compatibility, we accept old arguments via **kwargs # TODO: raise specific deprecation warnings for key == 'state_dict', key == 'seed', key == 'mechanisms' - for key, value in new_config.kwargs.items(): + for key, value in config.kwargs.items(): if key == 'state_dict': - new_config.initial_state = value + config.initial_state = value elif key == 'seed': - new_config.seeds = value + config.seeds = value elif key == 'mechanisms': - new_config.partial_state_updates = value + config.partial_state_updates = value - if new_config.initial_state == {}: + if config.initial_state == {}: raise Exception('The initial conditions of the system have not been set') - del config - return new_config - def sanitize_partial_state_updates(partial_state_updates): new_partial_state_updates = deepcopy(partial_state_updates) diff --git a/cadCAD/engine/__init__.py b/cadCAD/engine/__init__.py index 5a1d4ad..e22b028 100644 --- a/cadCAD/engine/__init__.py +++ b/cadCAD/engine/__init__.py @@ -65,6 +65,7 @@ class Executor: config_idx += 1 if self.exec_context == ExecutionMode.single_proc: + # ToDO: Deprication Handler - "sanitize" in appropriate place tensor_field = create_tensor_field(partial_state_updates.pop(), eps.pop()) result = self.exec_method(simulation_execs, var_dict_list, states_lists, configs_structs, env_processes_list, Ts, Ns) return result, tensor_field From e30388ff6bae311431aff06e4c07347774fb5b62 Mon Sep 17 00:00:00 2001 From: "Joshua E. Jodesty" Date: Mon, 18 Feb 2019 14:20:59 -0500 Subject: [PATCH 32/32] e-courage: modularizing backwards compatability --- cadCAD/configuration/utils/__init__.py | 7 ++++++- cadCAD/configuration/utils/depreciationHandler.py | 1 - simulations/validation/config2.py | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cadCAD/configuration/utils/__init__.py b/cadCAD/configuration/utils/__init__.py index 2a60d3e..bb7f4d3 100644 --- a/cadCAD/configuration/utils/__init__.py +++ b/cadCAD/configuration/utils/__init__.py @@ -4,6 +4,8 @@ from copy import deepcopy from fn.func import curried import pandas as pd +# Temporary +from cadCAD.configuration.utils.depreciationHandler import sanitize_partial_state_updates from cadCAD.utils import dict_filter, contains_type @@ -13,7 +15,10 @@ class TensorFieldReport: self.config_proc = config_proc # ToDo: backwards compatibility - def create_tensor_field(self, partial_state_updates, exo_proc, keys=['policies', 'variables']): + def create_tensor_field(self, partial_state_updates, exo_proc, keys = ['policies', 'variables']): + + partial_state_updates = sanitize_partial_state_updates(partial_state_updates) # Temporary + dfs = [self.config_proc.create_matrix_field(partial_state_updates, k) for k in keys] df = pd.concat(dfs, axis=1) for es, i in zip(exo_proc, range(len(exo_proc))): diff --git a/cadCAD/configuration/utils/depreciationHandler.py b/cadCAD/configuration/utils/depreciationHandler.py index 1f2862a..b62b192 100644 --- a/cadCAD/configuration/utils/depreciationHandler.py +++ b/cadCAD/configuration/utils/depreciationHandler.py @@ -21,7 +21,6 @@ def sanitize_partial_state_updates(partial_state_updates): # for backwards compatibility we accept the old keys # ('behaviors' and 'states') and rename them def rename_keys(d): - if 'behaviors' in d: d['policies'] = d.pop('behaviors') diff --git a/simulations/validation/config2.py b/simulations/validation/config2.py index 31734e2..43b95e8 100644 --- a/simulations/validation/config2.py +++ b/simulations/validation/config2.py @@ -120,7 +120,7 @@ partial_state_update_block = { "b1": p1m1, # "b2": p2m1 }, - "variables": { + "states": { "s1": s1m1, # "s2": s2m1 } @@ -130,7 +130,7 @@ partial_state_update_block = { "b1": p1m2, # "b2": p2m2 }, - "variables": { + "states": { "s1": s1m2, # "s2": s2m2 } @@ -140,7 +140,7 @@ partial_state_update_block = { "b1": p1m3, "b2": p2m3 }, - "variables": { + "states": { "s1": s1m3, "s2": s2m3 }