def add_position(self, irradiation, level, pos, add=True):
    p = self.get_level_path(irradiation, level)
    jd = dvc_load(p)
    if isinstance(jd, list):
        positions = jd
        z = 0
    else:
        positions = jd.get('positions', [])
        z = jd.get('z', 0)
    pd = next((p for p in positions if (p['position'] == pos)), None)
    if (pd is None):
        positions.append({'position': pos, 'decay_constants': {}})
    dvc_dump({'z': z, 'positions': positions}, p)
    if add:
        self.add(p, commit=False)
def add_position(self, irradiation, level, pos, add=True):
    p = self.get_level_path(irradiation, level)
    jd = dvc_load(p)
    if isinstance(jd, list):
        positions = jd
        z = 0
    else:
        positions = jd.get('positions', [])
        z = jd.get('z', 0)
    pd = next((p for p in positions if (p['position'] == pos)), None)
    if (pd is None):
        positions.append({'position': pos, 'decay_constants': {}})
    dvc_dump({'z': z, 'positions': positions}, p)
    if add:
        self.add(p, commit=False)