Warnings when plotting legend

I was working on a legend on one of my scripts when I got a warning message like this:

psxy [WARNING]: gmt_set_dataset_verify: Data set has 5 data records but header says it only has 0
pstext [WARNING]: gmt_set_dataset_verify: Data set has 1 segments but header says it only has 0

Suspecting user error and trying to debug, I went to the legend docs and, to my surprise, the same type of warning is given when plotting the example legend:

plot [WARNING]: gmt_set_dataset_verify: Data set has 6 data records but header says it only has 0
text [WARNING]: gmt_set_dataset_verify: Data set has 1 segments but header says it only has 0
text [WARNING]: gmt_set_dataset_verify: Data set has 1 segments but header says it only has 0

I’m confused what this warning message means, and how to get rid of it.

Any tips?

It is harmless but I will hide it tomorrow

1 Like

Thanks for replying Paul.

But, what does it mean…? And in which case does it matter?

When we create a data set (e.g., read one in as in pslegend) and create new ones that we then pass as virtual files to other modules (plot and text) it turns out we are a bit sloppy in setting all the meta data, such as counters. So I decided to add a dataset validator that would do some checking and report discrepancies. That is what you are seeing. It is then fixing the missing things. I let it print warnings so I would see these but the plan is to

  1. Find the places where this happens and improve the code so the warnings go away
  2. When all is fixed, move the verbose level to information or debug
1 Like

Thanks Paul!

Issue https://github.com/GenericMappingTools/gmt/issues/6336