Skip to content
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

Use filepath in github to ensure notebook runs in colab runs #253

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
" IN_COLAB = False\n",
"\n",
"if IN_COLAB:\n",
" !pip install git+git://github.com/WMD-group/SMACT.git --quiet\n",
"!pip install pandarallel --quiet"
" !pip install git+https://github.com/WMD-group/SMACT.git --quiet\n",
"!pip install pandarallel --quiet # Required for parallel processing"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Ensure pandarallel is installed only when necessary to optimize resource usage.

  • The notebook examples/smact_validity/Checking_smact_validity_of_GNoME.ipynb installs pandarallel unconditionally. Consider adding logic to install it only if it's not already installed or based on specific conditions.
Analysis chain

Ensure pandarallel is installed only when necessary to optimize resource usage.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check if pandarallel is conditionally installed based on environment.

# Test: Search for conditional installation logic for pandarallel.
rg --type python 'pandarallel' Checking_smact_validity_of_GNoME.ipynb

Length of output: 100



Script:

#!/bin/bash
# Description: Check if pandarallel is conditionally installed based on environment.

# Test: Search for conditional installation logic for pandarallel.
rg 'pandarallel' Checking_smact_validity_of_GNoME.ipynb

Length of output: 134



Script:

#!/bin/bash
# Description: Locate the notebook file and check if pandarallel is conditionally installed based on environment.

# Step 1: Locate the notebook file.
notebook_file=$(fd Checking_smact_validity_of_GNoME.ipynb)

# Step 2: Search for conditional installation logic for pandarallel in the located notebook file.
if [ -n "$notebook_file" ]; then
  rg 'pandarallel' "$notebook_file"
else
  echo "Notebook file not found."
fi

Length of output: 677

],
"metadata": {
"collapsed": false,
Expand Down Expand Up @@ -118,7 +118,7 @@
"# Load the data\n",
"# Load the data into a dataframe\n",
"\n",
"data_path = \"stable_materials_hull.csv\"\n",
"data_path = \"https://raw.githubusercontent.com/WMD-group/SMACT/master/examples/smact_validity/stable_materials_hull.csv\"\n",
"df = pd.read_csv(data_path)\n",
"\n",
"# Get quick info about the data\n",
Expand Down
Loading