-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement step status #137
Conversation
13668b7
to
e99a754
Compare
step: List[str] = list( | ||
filter(lambda step: current_task_id in step, self.mission_task_ids) | ||
)[0] | ||
task_index: int = self.mission_task_ids.index(step) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this just be simplified to the suggestion below?
step: List[str] = list( | |
filter(lambda step: current_task_id in step, self.mission_task_ids) | |
)[0] | |
task_index: int = self.mission_task_ids.index(step) | |
task_index: int = self.mission_task_ids.index(current_task_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case self.mission_task_ids is a 2D array, where the first dimension is the task and the inner dimension is the steps within that task. This is maybe not a good name for the object; it has the name since it started off as an array of task IDs. Since we are trying to find the index which contains a task which in turn contains current_task_id as a step, we need to first do this filtering to find the right task based on its steps, before we can use it to find the right task index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
e99a754
to
20cd27d
Compare
No description provided.