Skip to content

Commit

Permalink
copy samplesfile to merlin_info (#259)
Browse files Browse the repository at this point in the history
* copy samplesfile to merlin_info

* added to CHANGELOG
  • Loading branch information
ben-bay committed Jul 28, 2020
1 parent e6d500f commit 5af5354
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to Merlin will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- When using the `--samplesfile` flag, the samples file is now copied to `merlin_info` for
provenance.

## [1.7.0]

### Added
Expand Down
7 changes: 7 additions & 0 deletions merlin/study/study.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,13 @@ def expanded_spec(self):
env = result.get_study_environment()
result.globals = self.load_pgen(self.pgen_file, self.pargs, env)

# copy the --samplesfile (if any) into merlin_info
if self.samples_file:
shutil.copyfile(
self.samples_file,
os.path.join(self.info, os.path.basename(self.samples_file)),
)

# write expanded spec for provenance
with open(expanded_filepath, "w") as f:
f.write(result.dump())
Expand Down

0 comments on commit 5af5354

Please sign in to comment.