Skip to content
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

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Conversation

andchiind
Copy link
Contributor

No description provided.

@andchiind andchiind force-pushed the implement-step-status branch 8 times, most recently from 13668b7 to e99a754 Compare February 29, 2024 12:01
@andchiind andchiind marked this pull request as ready for review February 29, 2024 12:04
@andchiind andchiind self-assigned this Feb 29, 2024
@andchiind andchiind added the feature New feature or request label Feb 29, 2024
Comment on lines +271 to +274
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)
Copy link
Contributor

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?

Suggested change
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)

Copy link
Contributor Author

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.

Copy link
Contributor

@Afonso-2403 Afonso-2403 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@andchiind andchiind force-pushed the implement-step-status branch from e99a754 to 20cd27d Compare March 1, 2024 10:34
@andchiind andchiind merged commit 2e62e30 into equinor:main Mar 1, 2024
6 checks passed
@andchiind andchiind deleted the implement-step-status branch March 1, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants