@@ -0,0 +1,1118 @@
+# -*- coding: utf-8 -*-%0Au%22%22%22simulation data manipulations%0A%0A:copyright: Copyright (c) 2019 RadiaSoft LLC.  All Rights Reserved.%0A:license: http://www.apache.org/licenses/LICENSE-2.0.html%0A%22%22%22%0Afrom __future__ import absolute_import, division, print_function%0Afrom pykern.pkcollections import PKDict%0Afrom pykern.pkdebug import pkdc, pkdlog, pkdp, pkdpretty%0A%0Adef fixup_all_examples():%0A    import pykern.pkio%0A    import sirepo.feature_config%0A    import sirepo.simulation_db%0A    import sirepo.util%0A%0A    p = pykern.pkio.py_path()%0A    for t in sorted(sirepo.feature_config.cfg().sim_types):%0A        x = pykern.pkio.sorted_glob(p.join(t, 'examples', '*.json'))%0A        if not x:%0A            pykern.pkcli.command_error('must be run from package_data/template')%0A        for f in x:%0A            d = sirepo.simulation_db.fixup_old_data(%0A                sirepo.simulation_db.json_load(f),%0A                force=True,%0A            )%5B0%5D%0A            d.models.simulation.pkdel('simulationSerial')%0A            d.models.simulation.pkdel('simulationId')%0A            sirepo.util.json_dump(d, path=f, pretty=True)%0A            pkdlog(f.basename)%0A

fix #2140 added pkcli.sim_data.fixup_all_examples