forked from cadCAD-org/cadCAD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
141 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
wheel | ||
pandas | ||
wheel | ||
pathos | ||
fn | ||
tabulate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ | |
author_email='[email protected]', | ||
# license='LICENSE', | ||
packages=find_packages() | ||
) | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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 config1, config2 | ||
from cadCAD import configs | ||
|
||
exec_mode = ExecutionMode() | ||
|
||
print("Simulation Execution: Concurrent Execution") | ||
multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc) | ||
run2 = Executor(exec_context=multi_proc_ctx, configs=configs) | ||
|
||
i = 0 | ||
config_names = ['config1', 'config2'] | ||
for raw_result, tensor_field in run2.main(): | ||
result = pd.DataFrame(raw_result) | ||
print() | ||
print("Tensor Field: " + config_names[i]) | ||
print(tabulate(tensor_field, headers='keys', tablefmt='psql')) | ||
print("Output:") | ||
print(tabulate(result, headers='keys', tablefmt='psql')) | ||
print() | ||
i += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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 | ||
from cadCAD import configs | ||
|
||
exec_mode = ExecutionMode() | ||
|
||
print("Simulation Execution: Concurrent Execution") | ||
multi_proc_ctx = ExecutionContext(context=exec_mode.multi_proc) | ||
run2 = Executor(exec_context=multi_proc_ctx, configs=configs) | ||
|
||
i = 0 | ||
config_names = ['sweep_config_A', 'sweep_config_B'] | ||
for raw_result, tensor_field in run2.main(): | ||
result = pd.DataFrame(raw_result) | ||
print() | ||
print("Tensor Field: " + config_names[i]) | ||
print(tabulate(tensor_field, headers='keys', tablefmt='psql')) | ||
print("Output:") | ||
print(tabulate(result, headers='keys', tablefmt='psql')) | ||
print() | ||
i += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
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 config1 | ||
from cadCAD import configs | ||
|
||
exec_mode = ExecutionMode() | ||
|
||
print("Simulation Execution: Single Configuration") | ||
print() | ||
first_config = configs # only contains 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: config1") | ||
print(tabulate(tensor_field, headers='keys', tablefmt='psql')) | ||
print("Output:") | ||
print(tabulate(result, headers='keys', tablefmt='psql')) | ||
print() |