How to capture code
This guide will show you how to manage automatic code capture in Vectice.
Vectice captures your git
commit information, including the repository name, branch name, commit hash, and the commit URL when there is a .git
folder or repository available. Only locally changed files not registered in Vectice are captured with each new git commit.
Vectice is not a substitute for a code version system and is best used in coordination with a git-based system.
Prerequisites
To capture code in Vectice, you will need the following prerequisites:
Ensure you have installed vectice with the correct version.
Configure your API to connect to the Vectice API
Locally configure your Git username and user email
Check out a git branch
Add a valid remote (origin)
Make at least one commit
Git Configuration
Vectice supports all git
integrations, including GitHub, GitLab, and Bitbucket.
You can obtain the prerequisites by first configuring your environment with your Git
user name and email via the Git CLI
.
Then either clone your existing remote repository or create a new one, followed by adding a valid remote origin.
Lastly, make your first commit to begin code capture.
Commits may not include the latest code changes in the UI. Ensure to commit all new code changes.
Code Capture Overview
Automatic code capture is enabled by default, and it happens when:
You push a new commit with code changes that are not already registered
You register a model within an iteration
You register a dataset (origin, cleaned, or modeling datasets) within a step
More than one capture can happen within a single iteration.
With automatic code capture enabled, you will see the following log output indicating successful code capture:
In the UI, you can view the git
branch and the commit hash. You can click the git
hash or View to see your code changes in your repository.
![](https://docs.vectice.com/~gitbook/image?url=https%3A%2F%2F587205491-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FVFmvCekPAPubrybIeS8J%252Fuploads%252Fe6P6oguo4GWwqeTXWeWc%252FScreen%2520Shot%25202023-02-07%2520at%252010.24.28%2520AM.png%3Falt%3Dmedia%26token%3D83c6ef22-6dc0-47b2-a0fe-51170ad9c6a5&width=768&dpr=4&quality=100&sign=71759c2b&sv=1)
Disable Code Capture
To disable the automatic capture of your local code, you can set code_capture
to False
, as shown below. Ensure to set this method at the global level.
Code Capture Best Practices
Don't forget to commit your code before running your iteration so that you log a clean commit into Vectice.
Work in a separate branch for each experiment to make it easy to reproduce the work and track changes.
Ensure to commit your final code changes before completing an iteration to ensure all the latest commits are registered in the UI.
Last updated