Units of a field in RML not working properly

REST version : v2.2.12_dev
REST commit : fadb4d70

We have noticed that the units cannot be given in the RML as it was done previously. In particular

  • <energyDist type="flat" range="(0,1)" units="GeV" /> will not work.

  • <energyDist type="flat" range="(0,1)GeV" /> will work.

It is the first case obsolete?

Both of them should work. I just did a test and it behaves correctly. Can you show more details of this problem? Are you calling the method Get2DVectorParameterWithUnits()?

It seems that you added FieldNamesToUpper() inside Get2DVectorFieldValueWithUnits(), which makes the units field name unrecognizable. The fix could be that we make the concept “parameter” also case insensitive.

I think we could try Get2DVectorParameterWithUnits() as an upgrade of the old method Get2DVectorFieldValueWithUnits(). In V2.2 concept, “parameter” is more generic than “field value”, and coule be more user friendly.

I see. For the moment I introduced a quick fix at commit 565cbee7.

Please, try to integrate clang-format in your IDE so that we minimise the format changes on each commit allowing us to identify real changes to the code quickly.

I was thinking on it. Do you mean the parameter name to be case insensitive?

I.e.

<parameter name="energy" value="3" units="keV" />

should be the same as

<parameter name="eNErgy" value="3" units="keV" />

It is that what you mean?

It is already intergated. Sometimes I may forget to align the format. I will take notice for that.

Yes.