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

Make it possible to deserialize missions containing RecoveryTanker tasks #363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

magwo
Copy link
Contributor

@magwo magwo commented Jan 29, 2024

Appears to have been a mistake when the RecoveryTanker task was added but not added to the tasks map.
Also missing default parameters which I think is preventing deserialization.

@magwo
Copy link
Contributor Author

magwo commented Jan 30, 2024

Not sure if we need None handling of the lastWaypoint thing.

@SnappyComebacks
Copy link
Contributor

Thanks for catching the missing entry.

@@ -739,7 +739,7 @@ def __init__(self):
class RecoveryTanker(Task):
Id = "RecoveryTanker"

def __init__(self, groupId: int, speed: float, altitude: float, lastWaypoint: Optional[int]):
def __init__(self, groupId=None, speed=600, altitude=4000, lastWaypoint: Optional[int] = None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't delete the type annotations. You've changed this signature from float to int here.

@DanAlbert
Copy link
Collaborator

Also missing default parameters which I think is preventing deserialization.

Isn't that because it's missing a create_from_dict override? That seems the better fix, unless there's a good reason why one of these tasks should be creatable with no group ID.

(making the optional last waypoint argument optional makes sense, of course)

@magwo
Copy link
Contributor Author

magwo commented Feb 9, 2024

Good points, will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants