Publishes the data from the given `from_data_dir` to `to_data_dir`. Arguments: from_data_dir: the folder whose data needs to be published. to_data_dir: folder where the data should be published. Should include config and version. overwrite: whether to overwrite existing data in
(
from_data_dir: epath.Path,
to_data_dir: epath.Path,
overwrite: bool = False,
)
| 569 | |
| 570 | |
| 571 | def publish_data( |
| 572 | from_data_dir: epath.Path, |
| 573 | to_data_dir: epath.Path, |
| 574 | overwrite: bool = False, |
| 575 | ) -> None: |
| 576 | """Publishes the data from the given `from_data_dir` to `to_data_dir`. |
| 577 | |
| 578 | Arguments: |
| 579 | from_data_dir: the folder whose data needs to be published. |
| 580 | to_data_dir: folder where the data should be published. Should include |
| 581 | config and version. |
| 582 | overwrite: whether to overwrite existing data in the `publish_root_dir` if |
| 583 | it exists. |
| 584 | """ # fmt: skip |
| 585 | to_data_dir.mkdir(parents=True, exist_ok=True) |
| 586 | for filepath in from_data_dir.iterdir(): |
| 587 | filepath.copy(dst=to_data_dir / filepath.name, overwrite=overwrite) |
| 588 | |
| 589 | |
| 590 | def bulk_rename( |