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

Minimise use of XML #8

Open
marack opened this issue Jun 24, 2019 · 2 comments
Open

Minimise use of XML #8

marack opened this issue Jun 24, 2019 · 2 comments

Comments

@marack
Copy link

marack commented Jun 24, 2019

There are three places where we specify the use of XML packed into strings. These are status_xml, thresholding_xml and legend_xml. Having XML packed into strings introduces an extra language that must be parsed by users and makes the format more complex that needed.

It would be nice to remove XML entirely and just rely on the built in metadata functionality already provided by NetCDF. Here's my thoughts:

status_xml:

  • Rename this variable to status
  • Remove the reference to XML from the description
  • The contents of this field is free for the user to specify, so why limit them to XML? This allows them to store BiTE messages, or JSON, YAML, or whatever is appropriate for their system.

legend_xml:

  • Replace with two attributes legend_values and legend_labels
  • The legend_values is an integer array int[] and stores the values for each entry
  • The legend_labels is a string array string[] and stores the labels for each entry

thresholding_xml:

  • One idea would be to use a similar approach to the suggestion above but with threshold_field, threshold_min and threshold_max. Each would be an array which give the name of the field used to threshold this field along with the min/max limits.
  • Unfortunately this doesn't cater for complex conditions like the one mentioned in the note field of the XML example ("NCP only checked if DBZ > 40"). On the other hand, since this note is stored as a comment it's also not well represented in the XML (and is using an illegal '>' character).
  • Another idea would be to specify the thresholding attribute as a simple string. The example would encourage using basic mathematical syntax to combine values from the fields. So the value from the example would be "SNR > -3.0 and (DBZ < 40 or NCP > 0.15)".
@marack marack changed the title Minimise use of XML within standard Minimise use of XML Jun 24, 2019
@mike-dixon
Copy link
Collaborator

We could change status_xml to status_str. I think 'status' is a bit too short and not descriptive enough.
I prefer status_xml, but its not a big deal for me, so making it more flexible is fine with me.
For legends, having values and labels is OK, but Ken may have some ideas about how to do this with CF conventions in mind.
The advantage of XML for thresholding is that it allows for complex structures. But once again, we could specify a string instead of XML. This is new for CfRadial2.

@kenkehoe
Copy link

I am not a big fan of XML but I don't see a reason to exclude any format or choose a specific format. I would prefer to find a way to encode the information in netCDF native format as Mark noted. If we take _xml off I'm concerned that the user will not know what format to use to extract the information. Putting "XML" in the string may be difficult to then parse. I would suggest keeping the format of the sting values if the users need to use another parser (XML, JSON, YAML, ...) so the paring can be known right away. If there is no indication of the format it will be difficult to guess correctly. I don't know much about the data required in these variables and would need to spend some time digging in to it before making a suggestion.

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

No branches or pull requests

3 participants