Commit 901e8d41 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

ENH: New metaproc function for looking up the description of a value from a

specific data coding
parent 218efed0
......@@ -25,9 +25,19 @@ All ``metaproc`` functions must accept three arguments:
from . import custom
from . import coding
from . import hierarchy
def codingDescriptionFromValue(dtable, vid, val):
"""Generates a description for a value from a specific data coding. """
fname = coding.getCodingFilePath(dtable, vid)
descs = coding.loadCodingFile(fname)
desc = descs['meaning'][val]
return '{} - {}'.format(val, desc)
def hierarchicalDescriptionFromNumeric(val, name):
"""Generates a description for a numeric hierarchical code. """
val = hierarchy.numericToCode(val, name)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment