argiopetech / base

Bayesian Analysis for Stellar Evolution
http://webfac.db.erau.edu/~vonhippt/base9/
11 stars 4 forks source link

Print YAML parent(s) or equivalent `getOpt` flag when value missing #69

Closed maxvonhippel closed 5 years ago

maxvonhippel commented 7 years ago

When a value is missing, we get messages along the lines of

Value for 'photFile' not found in the YAML file.

But there are multiple photFiles in the YAML, so this isn't totally helpful as you don't always know which one you're missing.

There seem to be two possible solutions.

  1. Figure out a way to print the full YAML parent path. This would involve building some sort of structs to contain the nodes/leaves/whatever of the YAML stuff. The output might look something like:

Value for generalNode.filesNode.photFile not found in the YAML file.

  1. Make some sort of dictionary or something containing the getOpt flags, the codes that correspond to them, and the actual YAML node values, and use it for both the cli and YAML handling code, so we could just print the getOpt flag.

I'm also not sure where the other photFile resides in the settings.cpp code and am having trouble finding it, so I apologize that I don't really have example parity here, but hopefully I'll find it later and update this issue accordingly.