Create or Import Notebook
Users can create new notebooks, import existing notebooks, and push updates to Git repositories. This section covers how to add, import, and work with notebooks, as well as how to push files to Git.
In Data Science Lab (DSLab), users can create and manage notebooks for data science experiments. Notebooks are essential for writing code, visualizing data, and tracking model performance. This guide explains how to create, add, and manage notebooks in a project workspace.
Pre-requisite
The Create option is only enabled when the Project status is Active.
Pre-requisite: Ensure the project is Active before attempting to create a new notebook, as the Create option will remain disabled for inactive projects.
Creating a New Notebook
Navigation path: Data Science Lab > Workspace > Create > Create Notebook
Navigate to the Workspace tab in Data Science Lab.
Ensure the Project is in the Active status.
Click the Create option to open the Create Notebook page.
Provide the following details:
Notebook Name: Enter the desired name for the new notebook.
Description: (Optional) Provide a description for the notebook.
Click Save.
A notification message will appear to confirm that the notebook has been saved and started successfully.
The Notebook header will display status updates (e.g., "Notebook saved" and "Kernel started").
The newly created notebook will be listed in the Notebook list on the left side of the screen.
By default, a code cell will be added, allowing the user to begin data science experiments.
Importing a Notebook
Navigation path: Data Science Lab > Workspace > Import
Navigate to the Workspace tab in Data Science Lab.
Select the Import option.
The Import Notebook page opens.
Provide the following information:
Notebook Name: Enter the name of the notebook being imported.
Description: (Optional) Add a description for the notebook.
Click Choose File to select a .ipynb file from your local system.
Once the file is selected, click Save.
A confirmation message will appear, and the notebook will be opened in the workspace.
Pulling a File from Git
The Pull from Git option allows users to retrieve the latest version of a notebook from the Git repository. This functionality ensures that users are always working with the most up-to-date version of the notebook, including any modifications made by collaborators or across environments.
Pre-requisite:
The user needs to configure the admin-level settings with an authentication token.
The user needs to do Project-level configuration of Git Project and Git branch.
The user needs to Pull a version of the file from Git before using the Pull and Push functionality for the projects where the source files are available in Git Repo.
Navigation path: Data Science Lab > Workspace > Import > Import Notebook > Pull from Git
Navigate to the Workspace tab for an activated project.
Select the Import option.
Select the Pull from Git option.
All the available versions appear.
Choose the file version to pull by checking the corresponding checkbox.
Click Save to pull the file from Git.
A confirmation message will indicate that the selected file has been pulled.
Pushing a File to Git
This section outlines the process for configuring a Git User Token within the Admin module and updating it in the Security module. The Git User Token is necessary for authenticating and syncing with Git repositories in the Data Science Lab (DSLab).
Before pushing a file to Git, ensure that you have completed the following prerequisites:
Git User Token is set in your profile using Custom Fields (configured at the Admin level).
The user must have access to the Git branch and the appropriate permissions to push changes.
Please follow the following steps before Pushing a file to Git:
Step 1: Configure the Custom Field in Admin Module
Navigation path: Admin module > Configurations > Custom Field Settings
Navigate to the Admin module.
Under the Configurations section, open Custom Field Settings.
The Custom Field Information window appears.
Provide the following details for the custom field:
Key:
bdbvcstoken
Input Type: Manual
Description:
Git User Token
Mandatory: No
Click Save to save the modified Custom Field Settings.
A confirmation notification will appear, confirming that the custom field settings have been updated.
Step 2: Update Git User Token in the Security Module
Navigation path: Security module > Users list > Edit User
Navigate to the Security module.
Go to the Users list.
Select the user from the list whose Git User Token needs to be updated.
Click the Edit icon to open the Update User page.
In the Custom Fields section, validate whether the Git User Token is valid.
If invalid, provide the valid Git User Token in the corresponding field.
Click Save to update the user profile.
A notification message will confirm the user update.
Step 3: Update Git User Token in My Account
Navigation path: My Account > Configuration
Open the User Profile page.
Select My Account.
The My Account details will be displayed.
Open the Configuration section.
The Git User Token will be updated in the Git Token section under Configuration.
Steps to Push a File to Git
Navigate to the Workspace tab for an activated project.
Open the desired Notebook in the Repo folder.
Modify the notebook content to create a new version of the script.
Click the Save icon to save the updated notebook.
From the Notebook options menu, click Push into VCS.
The Push into Git drawer opens.
Select the Version Control option.
Provide a commit message describing the changes made to the notebook.
Click Push to upload the changes to the Git repository.
A notification message will confirm that the latest version of the notebook has been pushed to Git.