Quickstart
This quickstart guide will walk you through setting up Cubyc and running your first experiment.
Remote Only
Items displayed in a light blue box are optional and only necessary to save your experiments in the cloud.
Step 1: Prerequisites
Before diving in, make sure you have:
- Python 3.8 or higher
- Git
Remote Only
You'll also need a GitHub, GitLab, or Bitbucket account.
Step 2: Set Up Cubyc
Installing Cubyc is a breeze. Simply run:
Or, if you want the latest, clone our GitHub repo and run:
Remote Only
To authenticate queries with your cloud repository provider, you need to save an access token in your machine.
Create a new repository (step 1) for each project you want to save remotely. However, you only need to create an access token (step 2 and 3) once for all your projects.
Step 3 Initialize a Project
Create a directory for your project, navigate to it, and initialize a new Cubyc project:
Be sure to add any files you don't want to track to the auto-generated .gitignore
file!
Remote Only
To automatically save your experiment runs to the cloud, you can add remote repositories with Git. If you clone an existing Git repository, the remote is already set up. Otherwise, add a remote repository to your project:
Step 4: Run Your Experiment
You're all done setting up Cubyc! Now, let's run a simple experiment to test it out. Inside your project, create and run a Python script with the following code:
run_script.py | |
---|---|
Cubyc automatically commits the inputs, code, and outputs of your latest experiment run to the .cubyc
directory.
Your run history is preserved in the .git
directory, and if configured, in a remote repository as well.
Remote Only
As an alternative to linking your project to a remote repository using Git (step 3),
you can also save your experiment runs directly to the cloud by passing the remote repository URL
to the Run
constructor:
Step 5: Query Your Results
To analyze your experiment results, you can use SQL queries with Cubyc. Create and run a new Python script in the same project directory with the following code:
query_script.py | |
---|---|
Output:
>>> n_size runtime
... 0 10 0.012209
... 1 20 1.455673
... 2 40 2.768197
... 3 80 4.073367
... 4 160 5.336599
... 5 320 6.663631
... 6 640 8.028414
This query returns the matrix n_size
and duration
of each run, ordered by duration.
Notice how the runtime doesn't increase linearly with the matrix size?
Remote Only
You can also pass results from the cloud by passing the remote repository URL to the query
function:
Congratulations, you just ran and analyzed your first experiment with Cubyc! For a more in-depth look at Cubyc's features, check out the concepts page.