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.

Creating a New Notebook

Navigation path: Data Science Lab > Workspace > Create > Create Notebook

  1. Navigate to the Workspace tab in Data Science Lab.

  2. Ensure the Project is in the Active status.

  3. Click the Create option to open the Create Notebook page.

  4. Provide the following details:

    • Notebook Name: Enter the desired name for the new notebook.

    • Description: (Optional) Provide a description for the notebook.

  5. Click Save.

  6. A notification message will appear to confirm that the notebook has been saved and started successfully.

  7. The Notebook header will display status updates (e.g., "Notebook saved" and "Kernel started").

  8. The newly created notebook will be listed in the Notebook list on the left side of the screen.

  9. By default, a code cell will be added, allowing the user to begin data science experiments.

Note:

  • The new notebook will be created with the specified name, and the notebook page will open. It may take a few seconds for the notebook to save and initialize the kernel.

  • You can also access the Create Notebook dialog by clicking the ellipsis icon next to a Repo folder and selecting the Create option.

    • Navigation path: Data Science Lab > Workspace > Repo Folder > Ellipsis > Create > Create Notebook

Importing a Notebook

Navigation path: Data Science Lab > Workspace > Import

  1. Navigate to the Workspace tab in Data Science Lab.

  2. Select the Import option.

  3. The Import Notebook page opens.

  4. Provide the following information:

    • Notebook Name: Enter the name of the notebook being imported.

    • Description: (Optional) Add a description for the notebook.

  5. Click Choose File to select a .ipynb file from your local system.

  6. Once the file is selected, click Save.

  7. A confirmation message will appear, and the notebook will be opened in the workspace.

Note:

  • The imported notebook will automatically be listed under the Repo folder and will be available for further edits or execution.

  • You can also access the Import Notebook dialog by clicking the ellipsis icon next to a Repo folder and selecting the Import option.

    • Navigation path: Data Science Lab > Workspace > Repo Folder > Ellipsis > Import > Import Notebook

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.

Navigation path: Data Science Lab > Workspace > Import > Import Notebook > Pull from Git

  1. Navigate to the Workspace tab for an activated project.

  2. Select the Import option.

  3. Select the Pull from Git option.

  4. All the available versions appear.

  5. Choose the file version to pull by checking the corresponding checkbox.

  6. Click Save to pull the file from Git.

  7. A confirmation message will indicate that the selected file has been pulled.

Note:

  • The Pull from Git functionality ensures that the latest version of the notebook is pulled before making changes. If a user attempts to push a file without pulling the latest version first, they will receive an error prompting them to pull the most recent file.

  • You can also access the Import Notebook dialog by clicking the ellipsis icon next to a Repo folder and selecting the Import option.

    • Navigation path: Data Science Lab > Workspace > Repo Folder > Ellipsis > Import > Import Notebook > Pull from Git

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

  1. Navigate to the Admin module.

  2. Under the Configurations section, open Custom Field Settings.

  3. The Custom Field Information window appears.

  4. Provide the following details for the custom field:

    • Key: bdbvcstoken

    • Input Type: Manual

    • Description: Git User Token

    • Mandatory: No

  5. Click Save to save the modified Custom Field Settings.

  6. 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

  1. Navigate to the Security module.

  2. Go to the Users list.

  3. Select the user from the list whose Git User Token needs to be updated.

  4. Click the Edit icon to open the Update User page.

  5. 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.

  6. Click Save to update the user profile.

  7. A notification message will confirm the user update.

Step 3: Update Git User Token in My Account

Navigation path: My Account > Configuration

  1. Open the User Profile page.

  2. Select My Account.

  3. The My Account details will be displayed.

  4. Open the Configuration section.

  5. The Git User Token will be updated in the Git Token section under Configuration.

Notes:

  • User Token Key: The key name has to be bdbvcstoken for the Git User Token.

  • Git User Token is necessary for Git repository access within DSLab.

  • The user branch should have Developers' + maintainers' permission to push the latest code into the Main branch.

  • If Git User Token is updated in the Security module, the same token should be used in the User Profile > Configuration > Git Token section.

Steps to Push a File to Git

  1. Navigate to the Workspace tab for an activated project.

  2. Open the desired Notebook in the Repo folder.

  3. Modify the notebook content to create a new version of the script.

  4. Click the Save icon to save the updated notebook.

  5. From the Notebook options menu, click Push into VCS.

  6. The Push into Git drawer opens.

  7. Select the Version Control option.

  8. Provide a commit message describing the changes made to the notebook.

  9. Click Push to upload the changes to the Git repository.

  10. A notification message will confirm that the latest version of the notebook has been pushed to Git.

Note: The changes will be reflected in the Git repository. You can access and verify the updated script in the repository.