Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Habelitz committed May 22, 2019
1 parent ad123a7 commit d5a2006
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 8 additions & 4 deletions phs/compute_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def __init__(self,
if 1 in row[1:]:
break
self.number_of_parameter_sets_until_first_bayesian_task = count_row
else:
self.number_of_parameter_sets_until_first_bayesian_task = None



Expand Down Expand Up @@ -269,8 +271,9 @@ def start_execution(self):
with PoolExecutor(max_workers=self.local_processes_num_workers) as executor:
self.pp.pprint(executor.__dict__)

if self.number_of_parameter_sets_until_first_bayesian_task < self.local_processes_num_workers:
phs.utils.idle_workers_warning(self.number_of_parameter_sets_until_first_bayesian_task, self.local_processes_num_workers)
if self.number_of_parameter_sets_until_first_bayesian_task is not None:
if self.number_of_parameter_sets_until_first_bayesian_task < self.local_processes_num_workers:
phs.utils.idle_workers_warning(self.number_of_parameter_sets_until_first_bayesian_task, self.local_processes_num_workers)

self.start_execution_kernel(executor, wait, as_completed)
self.as_completed_functions(as_completed)
Expand All @@ -293,8 +296,9 @@ def start_execution(self):
self.pp.pprint(client.scheduler_info())

number_dask_workers = len(client.scheduler_info()['workers'])
if self.number_of_parameter_sets_until_first_bayesian_task < number_dask_workers:
phs.utils.idle_workers_warning(self.number_of_parameter_sets_until_first_bayesian_task, number_dask_workers)
if self.number_of_parameter_sets_until_first_bayesian_task is not None:
if self.number_of_parameter_sets_until_first_bayesian_task < number_dask_workers :
phs.utils.idle_workers_warning(self.number_of_parameter_sets_until_first_bayesian_task, number_dask_workers)

client.upload_file(os.path.abspath(phs.bayes.__file__)) # probably not necessary
client.upload_file(os.path.abspath(phs.proxy.__file__)) # probably not necessary
Expand Down
8 changes: 8 additions & 0 deletions tests/test_integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,11 @@ def test_parameter_definition():
def test_post_pro_demo():
template_test_wrapper(func=def_post_pro_demo.def_post_pro_demo,
relative_fixture_path='/fixtures/fix_post_pro_demo')


# manual tests have to be performed from directory phs: python tests/test_integrations.py
if __name__ == '__main__':
test_quick_start()
test_data_types_and_order()
test_parameter_definition()
test_post_pro_demo()

0 comments on commit d5a2006

Please sign in to comment.