SciCatProject / backend-v3

SciCat Data Catalogue Backend
https://scicatproject.github.io/documentation/
BSD 3-Clause "New" or "Revised" License
13 stars 17 forks source link

'u' of Object type should not be treated as a unit #702

Open jkotan opened 1 year ago

jkotan commented 1 year ago

Summary

Currently "u" in ingested RawDataset json is treated as a unit, even if it is a dictionary i.e. a JS object. Our users often use u to denote the chi angle position. It would be good to check if "u" is a dictionary or a string and treat it as a unit only if it is a string.

Steps to Reproduce

ingest scientificMetadata containing

{
  "u":
    {
        "value": 12.323,
        "unit": "deg"
    }
}

Current Behaviour

All 'u' are treated as units and unitSI is added with a weird content e.g.

u_object_scicat

Expected Behaviour

It would be good to check if "u" is a dictionary or a string and treat it as a unit only if it is a string.