-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manifest JSON Writing Utility #486
base: dev
Are you sure you want to change the base?
Conversation
Added private helper `gempyor.utils._shutil_which` which has a `check` argument that behaves very similar in spirit to the same argument of `subprocess.run`. Corresponding docs/tests included.
Added an internal utility function to get the sha commit corresponding to the head of a given git repository. For use in creating manifest files.
Added `gempyor.manifest.write_manifest` for writing batch manifest JSON files containing metadata about the run. Also has extended functionality to store more metadata then the current required.
Move the `manifest` submodule to `batch` to consolidate future functionality. Minor edits to unit tests to account for the module name change.
Examples: | ||
>>> from pathlib import Path | ||
>>> flepi_path = Path("~/Desktop/GitHub/HopkinsIDD/flepiMoP").expanduser() | ||
>>> project_path = Path("~/Desktop/GitHub/HopkinsIDD/flepimop_sample").expanduser() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are trying to move away from flepimop_sample
, in favor of using the examples/tutorials folder in flepiMoP
. Perhaps this line could read:
project_path = Path("~/Desktop/GitHub/HopkinsIDD/flepiMoP/examples/tutorials").expanduser()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, should we all-caps FLEPI_PATH
and PROJECT_PATH
, if they are constants throughout the entirety of flepiMoP execution?
|
||
def _git_head(repository: Path) -> str: | ||
""" | ||
Get the sha commit has for the head of a git repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this suppposed to read "Get the sha commit hash for the ...."?
Describe your changes.
This pull request adds:
_shutil_which
and_git_head
, andwrite_manifest
to the newbatch
module for writing manifest JSON files containing batch metadata.Does this pull request make any user interface changes? If so please describe.
The user interface changes are none, this is all new functionality. Code level documentation (which is the main usage of this functionality) has been added to the docstrings.
What does your pull request address? Tag relevant issues.
This pull request was spun out of GH-394 to help address GH-365.