def rewrite(dataset: FileDataset) -> FileDataset: # Join the datastore root to the exported path. This should yield # absolute paths that start with $CI_IMSIM_DIR. dataset.path = os.path.join(butler.datastore.root.ospath, dataset.path) # Remove symlinks in the path; this should result in absolute paths # that start with $TESTDATA_CI_IMSIM_DIR, because ci_imsim always # symlinks these datasets from there. dataset.path = os.path.realpath(dataset.path) return dataset
def rewrite(dataset: FileDataset) -> FileDataset: # Join the datastore root to the exported path. This should yield # absolute paths that start with $CI_HSC_GEN2_DIR. dataset.path = os.path.join(butler.datastore.root.ospath, dataset.path) # Remove symlinks in the path; this should result in absolute paths # that start with $TESTDATA_CI_HSC_DIR, because ci_hsc_gen2 always # symlinks these datasets from there. dataset.path = os.path.realpath(dataset.path) # Recompute the path relative to $TESTDATA_CI_HSC_DIR, so we can deal # with that moving around after the export file is created. dataset.path = os.path.relpath(dataset.path, getPackageDir("testdata_ci_hsc")) return dataset