Renaming variables and dimensions#102
Conversation
Agreed. |
|
Regarding renaming vars and dims, did you consider defining that in It feels like a natural match. The command line options are mostly switches, or involved with the processing of specific files whereas the One implementation option is to add a global:
Tiddly: "winks"
Publisher: "A long impressive sounding name"
unlikelytobeoverwritten:
notactualattribute:
rename:
variables:
time_bounds: "time_bnds"
dimensions:
nv: "bnds"
variables:
temp:
Tiddly: "winks"
units: "Kelvin"
_FillValue: Obviously it would be possible to just have the rename:
dimensions:
nv: "bnds"
variables:
time_bounds: "time_bnds" |
Great idea! Putting these in the .yamls will be easier to find and maintain I think. Perhaps we should allow renaming to not crash if old name doesn't exist? That would allow us to have a single rename:
variables:
time_bounds: time_bnds
variables:
time:
axis: "T"
bounds: "time_bnds"
calendar: "proleptic_gregorian"
calendar_type:
long_name: "time"
standard_name: "time"
time_bnds:
axis:
calendar:
long_name:
standard_name:
units:
missing_value:
_FillValue:
|
Good idea right back at ya! Agreed, sounds good, and is consistent with how the rest of the tool works. I think it is good for addmeta to be as fault tolerant as possible, as we would rather have slightly incorrect metadata than crash a climate run. Ensuring correctness should be a separate step, with a considered decision about how to remedy any problems. |
Add the option to rename variables and dimensions.
Vars/dims should probably be renamed before or after metadata is added. This way one can unify the names of a var in different files (i.e.
time_boundstotime_bnds) and then apply attrs reusing the same yaml (i.e.time_bnds). It seems less likely that one would want to apply common attrs to a var in several files and then rename it.Closes #101