Skip to content

Commit

Permalink
improve the names
Browse files Browse the repository at this point in the history
  • Loading branch information
maikia committed Jan 8, 2021
1 parent 3c4acf3 commit fff3a5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ramp-engine/ramp_engine/aws/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ def _training_finished(config, instance_id, submission_name):
"""
has_screen = _has_screen(config, instance_id, submission_name)
# this can only work if the training was successful
has_score_file = _has_log_or_score_file(
has_score_file = _has_error_or_score_file(
config, instance_id, submission_name)
return not has_screen and has_score_file

Expand Down Expand Up @@ -849,7 +849,7 @@ def _has_screen(config, instance_id, screen_name):
return nb > 0


def _has_log_or_score_file(config, instance_id, screen_name):
def _has_error_or_score_file(config, instance_id, screen_name):
"""
Return True if a 'bagged_scores.csv' file exists (submission terminated
with a success) or if log file (submisssion terminated with error) exists
Expand Down
2 changes: 1 addition & 1 deletion ramp-engine/ramp_engine/tests/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class DummyInstance:
@mock.patch('ramp_engine.aws.api.is_spot_terminated')
@mock.patch('ramp_engine.aws.api.launch_train')
@mock.patch('ramp_engine.aws.api._has_screen')
@mock.patch('ramp_engine.aws.api._has_log_or_score_file')
@mock.patch('ramp_engine.aws.api._has_error_or_score_file')
def test_not_finished_until_bagged_or_log_saved(has_score_file, has_screen,
launch_train,
spot_terminated,
Expand Down

0 comments on commit fff3a5d

Please sign in to comment.