From bb305d4284b352dd89e7b10a15d86034b9fc7352 Mon Sep 17 00:00:00 2001 From: Sandra Diaz Date: Fri, 19 Oct 2018 13:15:30 +0200 Subject: [PATCH] Changes in the documentation and removal of PyPet includes --- bin/l2l-fun-ce-gaussmix.py | 7 ++----- bin/l2l-fun-ce.py | 2 +- bin/l2l-fun-es.py | 2 +- bin/l2l-fun-face.py | 6 ++---- bin/l2l-fun-ga.py | 2 +- bin/l2l-fun-gd.py | 2 +- bin/l2l-fun-gs.py | 2 +- bin/l2l-fun-pt.py | 4 ++-- bin/l2l-fun-sa.py | 2 +- bin/l2l-funall.py | 4 ++-- bin/l2l-mnist-ce.py | 2 +- bin/l2l-mnist-es.py | 4 ++-- bin/l2l-template.py | 7 ++----- l2l/optimizers/gridsearch/optimizer.py | 2 +- l2l/optimizers/optimizer.py | 2 +- 15 files changed, 21 insertions(+), 29 deletions(-) diff --git a/bin/l2l-fun-ce-gaussmix.py b/bin/l2l-fun-ce-gaussmix.py index caae2fc6..4e2acbbd 100644 --- a/bin/l2l-fun-ce-gaussmix.py +++ b/bin/l2l-fun-ce-gaussmix.py @@ -4,8 +4,7 @@ import numpy as np -from pypet import Environment -from pypet import pypetconstants +from l2l.utils.environment import Environment from l2l.optimizees.functions.optimizee import FunctionGeneratorOptimizee from l2l.optimizees.functions.benchmarked_functions import BenchmarkedFunctions @@ -39,14 +38,12 @@ def main(): traj_file = os.path.join(paths.output_dir_path, 'data.h5') # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment(trajectory=name, filename=traj_file, file_title='{} data'.format(name), comment='{} data'.format(name), add_time=True, freeze_input=True, multiproc=True, - use_scoop=True, - wrap_mode=pypetconstants.WRAP_MODE_LOCAL, automatic_storing=True, log_stdout=False, # Sends stdout to logs ) diff --git a/bin/l2l-fun-ce.py b/bin/l2l-fun-ce.py index 74160700..47d9b59b 100644 --- a/bin/l2l-fun-ce.py +++ b/bin/l2l-fun-ce.py @@ -35,7 +35,7 @@ def main(): traj_file = os.path.join(paths.output_dir_path, 'data.h5') # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment(trajectory=name, filename=traj_file, file_title='{} data'.format(name), comment='{} data'.format(name), add_time=True, diff --git a/bin/l2l-fun-es.py b/bin/l2l-fun-es.py index 207cf628..b3f78c22 100644 --- a/bin/l2l-fun-es.py +++ b/bin/l2l-fun-es.py @@ -31,7 +31,7 @@ def run_experiment(): print("All output logs can be found in directory ", paths.logs_path) # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment( trajectory=trajectory_name, filename=paths.output_dir_path, diff --git a/bin/l2l-fun-face.py b/bin/l2l-fun-face.py index e0c289c4..475a298e 100644 --- a/bin/l2l-fun-face.py +++ b/bin/l2l-fun-face.py @@ -3,8 +3,7 @@ import numpy as np -from pypet import Environment -from pypet import pypetconstants +from l2l.utils.environment import Environment from l2l.optimizees.functions import tools as function_tools from l2l.optimizees.functions.benchmarked_functions import BenchmarkedFunctions @@ -36,14 +35,13 @@ def main(): traj_file = os.path.join(paths.output_dir_path, 'data.h5') # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment(trajectory=name, filename=traj_file, file_title='{} data'.format(name), comment='{} data'.format(name), add_time=True, freeze_input=True, multiproc=True, use_scoop=True, - wrap_mode=pypetconstants.WRAP_MODE_LOCAL, automatic_storing=True, log_stdout=False, # Sends stdout to logs ) diff --git a/bin/l2l-fun-ga.py b/bin/l2l-fun-ga.py index 5b8f999d..b3c90516 100644 --- a/bin/l2l-fun-ga.py +++ b/bin/l2l-fun-ga.py @@ -42,7 +42,7 @@ def main(): traj_file = os.path.join(paths.output_dir_path, 'data.h5') # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment(trajectory=name, filename=traj_file, file_title='{} data'.format(name), comment='{} data'.format(name), add_time=True, diff --git a/bin/l2l-fun-gd.py b/bin/l2l-fun-gd.py index 38a4833e..ab367686 100644 --- a/bin/l2l-fun-gd.py +++ b/bin/l2l-fun-gd.py @@ -38,7 +38,7 @@ def main(): traj_file = os.path.join(paths.output_dir_path, 'data.h5') # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment(trajectory=name, filename=traj_file, file_title='{} data'.format(name), comment='{} data'.format(name), add_time=True, diff --git a/bin/l2l-fun-gs.py b/bin/l2l-fun-gs.py index d149488b..9968263e 100644 --- a/bin/l2l-fun-gs.py +++ b/bin/l2l-fun-gs.py @@ -35,7 +35,7 @@ def main(): traj_file = os.path.join(paths.output_dir_path, 'data.h5') # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment(trajectory=name, filename=traj_file, file_title='{} data'.format(name), comment='{} data'.format(name), add_time=True, diff --git a/bin/l2l-fun-pt.py b/bin/l2l-fun-pt.py index fe9156dd..6587bdf8 100644 --- a/bin/l2l-fun-pt.py +++ b/bin/l2l-fun-pt.py @@ -2,7 +2,7 @@ import os import numpy as np -from pypet import Environment +from l2l.utils.environment import Environment from l2l.optimizees.functions import tools as function_tools from l2l.optimizees.functions.benchmarked_functions import BenchmarkedFunctions @@ -33,7 +33,7 @@ def main(): traj_file = os.path.join(paths.output_dir_path, 'data.h5') # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment(trajectory=name, filename=traj_file, file_title='{} data'.format(name), comment='{} data'.format(name), add_time=True, diff --git a/bin/l2l-fun-sa.py b/bin/l2l-fun-sa.py index 2c05f61d..2140fde9 100644 --- a/bin/l2l-fun-sa.py +++ b/bin/l2l-fun-sa.py @@ -35,7 +35,7 @@ def main(): traj_file = os.path.join(paths.output_dir_path, 'data.h5') # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment(trajectory=name, filename=traj_file, file_title='{} data'.format(name), comment='{} data'.format(name), add_time=True, diff --git a/bin/l2l-funall.py b/bin/l2l-funall.py index 72d4f60c..ea320cf2 100644 --- a/bin/l2l-funall.py +++ b/bin/l2l-funall.py @@ -3,7 +3,7 @@ import itertools import numpy as np -from pypet import Environment +from l2l.utils.environment import Environment from l2l.optimizees.functions.benchmarked_functions import BenchmarkedFunctions from l2l.optimizees.functions.optimizee import FunctionGeneratorOptimizee @@ -73,7 +73,7 @@ def main(): optimizer_parameters = optimizer_parameters_fn() # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment(trajectory=name, filename=traj_file, file_title='{} data'.format(name), comment='{} data'.format(name), # freeze_input=True, diff --git a/bin/l2l-mnist-ce.py b/bin/l2l-mnist-ce.py index ed7cf37a..194f7722 100644 --- a/bin/l2l-mnist-ce.py +++ b/bin/l2l-mnist-ce.py @@ -31,7 +31,7 @@ def run_experiment(): print("All output logs can be found in directory ", paths.logs_path) # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment( trajectory=trajectory_name, filename=paths.output_dir_path, diff --git a/bin/l2l-mnist-es.py b/bin/l2l-mnist-es.py index c4666e7c..508bebe5 100644 --- a/bin/l2l-mnist-es.py +++ b/bin/l2l-mnist-es.py @@ -2,7 +2,7 @@ from datetime import datetime import numpy as np -from pypet import Environment +from l2l.utils.environment import Environment from l2l import dict_to_list from l2l.logging_tools import create_shared_logger_data, configure_loggers @@ -30,7 +30,7 @@ def run_experiment(): print("All output logs can be found in directory ", paths.logs_path) # Create an environment that handles running our simulation - # This initializes a PyPet environment + # This initializes an environment env = Environment( trajectory=trajectory_name, filename=paths.output_dir_path, diff --git a/bin/l2l-template.py b/bin/l2l-template.py index 87a74b4c..4c9eef91 100644 --- a/bin/l2l-template.py +++ b/bin/l2l-template.py @@ -5,8 +5,7 @@ import logging.config -from pypet import Environment -from pypet import pypetconstants +from l2l.utils.environment import Environment from l2l.logging_tools import create_shared_logger_data, configure_loggers from l2l.optimizees.optimizee import Optimizee @@ -41,7 +40,7 @@ def main(): print("All output logs can be found in directory ", paths.logs_path) # Create an environment that handles running our simulation - # This initializes a PyPet environment. See Pypet documentation for more details on environment and trajectory. + # This initializes an environment. This environment is based on the Pypet implementation. # Uncomment 'freeze_input', 'multipproc', 'use_scoop' and 'wrap_mode' lines to disable running the experiment # across cores and nodes. env = Environment(trajectory=name, filename=paths.output_dir_path, file_title='{} data'.format(name), @@ -49,8 +48,6 @@ def main(): add_time=True, freeze_input=False, multiproc=True, - use_scoop=True, - wrap_mode=pypetconstants.WRAP_MODE_LOCAL, automatic_storing=True, log_stdout=False, # Sends stdout to logs ) diff --git a/l2l/optimizers/gridsearch/optimizer.py b/l2l/optimizers/gridsearch/optimizer.py index c6647809..0a5607a6 100644 --- a/l2l/optimizers/gridsearch/optimizer.py +++ b/l2l/optimizers/gridsearch/optimizer.py @@ -2,7 +2,7 @@ from collections import namedtuple import numpy as np -from pypet.utils.explore import cartesian_product +from l2l.utils.tools import cartesian_product from l2l import DictEntryType from l2l import dict_to_list diff --git a/l2l/optimizers/optimizer.py b/l2l/optimizers/optimizer.py index b172bcba..85036d13 100644 --- a/l2l/optimizers/optimizer.py +++ b/l2l/optimizers/optimizer.py @@ -1,6 +1,6 @@ from collections import namedtuple -from pypet import cartesian_product +from l2l.utils.tools import cartesian_product from l2l import get_grouped_dict