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

Fix missing metadata in messages #15

Merged
merged 8 commits into from
Oct 8, 2020

Conversation

adybbroe
Copy link
Contributor

@adybbroe adybbroe commented Oct 7, 2020

We were missing variant in output messages. This is now fixed.
Also all metadata (except description) in the hook is now being added as a dict, like this example (pps_hooks.yaml):

pps_hook:
    post_hook: !!python/object:nwcsafpps_runner.pps_posttroll_hook.PPSMessage
      description: "This is a pps post hook for PostTroll messaging"
      metadata:
        posttroll_topic: "PPSv2018"
        station: "norrkoping"
        output_format: "CF"
        level: "2"
        variant: DR

This means it is easier to add new metadata to the message if needed.

Also fixing a couple of bugs from previous PR #13

@adybbroe adybbroe self-assigned this Oct 7, 2020
Adam.Dybbroe added 2 commits October 7, 2020 14:28
Signed-off-by: Adam.Dybbroe <a000680@c21856.ad.smhi.se>
Signed-off-by: Adam.Dybbroe <a000680@c21856.ad.smhi.se>
@adybbroe adybbroe marked this pull request as ready for review October 7, 2020 14:25
@adybbroe adybbroe requested a review from mraspaud October 7, 2020 14:25
station = self.station
# level, output_format and station are all required fields
for attr in ['level', 'output_format', 'station']:
if not attr in self.metadata:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would have writte if attr not in self.metadata: but I guess both do the same

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yeah, right @TAlonglong , looks a bit awkward now that you say it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was too late seeing this - merged already. Sorry! I will fix next time if I remember!

Copy link
Collaborator

@TAlonglong TAlonglong left a comment

Choose a reason for hiding this comment

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

LGTM

@adybbroe adybbroe merged commit 3611ee2 into pytroll:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants