(self)
| 12 | |
| 13 | class CmdExperimentsSave(CmdBase): |
| 14 | def run(self): |
| 15 | try: |
| 16 | ref = self.repo.experiments.save( |
| 17 | targets=self.args.targets, |
| 18 | name=self.args.name, |
| 19 | recursive=self.args.recursive, |
| 20 | force=self.args.force, |
| 21 | include_untracked=self.args.include_untracked, |
| 22 | message=self.args.message, |
| 23 | ) |
| 24 | except DvcException: |
| 25 | logger.exception("failed to save experiment") |
| 26 | return 1 |
| 27 | |
| 28 | if self.args.json: |
| 29 | ui.write_json({"ref": ref}) |
| 30 | else: |
| 31 | name = self.repo.experiments.get_exact_name([ref])[ref] |
| 32 | ui.write(f"Experiment has been saved as: {name}") |
| 33 | |
| 34 | return 0 |
| 35 | |
| 36 | |
| 37 | def add_parser(experiments_subparsers, parent_parser): |
nothing calls this directly
no test coverage detected