Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Jupyter Environment",
"image": "mcr.microsoft.com/devcontainers/python:3",
"features": {
"ghcr.io/devcontainers/features/python:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.vscode-jupyter-slideshow"
]
}
},
"onCreateCommand": ".devcontainer/startup.sh",
"forwardPorts": [8888],
"postStartCommand": "uv run jupyter lab --no-browser --ip=0.0.0.0 --port=8888 --NotebookApp.token='' --NotebookApp.password=''"
}
5 changes: 5 additions & 0 deletions .devcontainer/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python 3.12
uv pip install --no-cache-dir jupyterlab
uv pip install --no-cache-dir -r requirements.txt
11 changes: 0 additions & 11 deletions .docker/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions .dockerignore

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/docker.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Bump version and publish

on:
#push:
workflow_dispatch

permissions:
contents: write

jobs:
tagging:
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.tag_step.outputs.new_tag }}

steps:
- name: Generate Tag
id: tag_step
uses: tschm/cradle/actions/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# testing all notebooks
name: TEST

on:
- push

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.11', '3.12']
#notebook: [ Ch02-statlearn-lab.ipynb ]. # Ch02 is tricky but we have a solution for it
notebook: [ Ch03-linreg-lab.ipynb ]
# Ch04-classification-lab.ipynb,
# Ch05-resample-lab.ipynb,
# Ch06-varselect-lab.ipynb,
# Ch07-nonlin-lab.ipynb,
# Ch08-baggboost-lab.ipynb,
# Ch09-svm-lab.ipynb,
# Ch10-deeplearning-lab.ipynb,
# Ch11-surv-lab.ipynb,
# Ch12-unsup-lab.ipynb,
# Ch13-multiple-lab.ipynb]
#exclude:
# - python-version: '3.11'
# notebook: Ch10-deeplearning-lab.ipynb

fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
#with:
# version: "0.5.15"


#- name: Set up Python
# shell: bash
# run: |
# uv python install ${{ matrix.python-version }}

- name: Create venv
shell: bash
run: uv venv --python ${{ matrix.python-version }}

- name: Install requirements
shell: bash
run: |
uv pip install --upgrade pip
uv pip install -r requirements.txt
uv pip install pytest nbmake

- name: Test
shell: bash
run: |
uv run pytest --nbmake --nbmake-timeout=3600 -vv ${{ matrix.notebook }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ share/python-wheels/
# IDEs
.vscode/
.idea/

23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DEFAULT_GOAL := help

venv:
@curl -LsSf https://astral.sh/uv/install.sh | sh
@uv venv --python 3.12


.PHONY: install
install: venv ## Install all dependencies (in the virtual environment) defined in requirements.txt
@uv pip install --upgrade pip
@uv pip install -r requirements.txt


.PHONY: help
help: ## Display this help screen
@echo -e "\033[1mAvailable commands:\033[0m"
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort


.PHONY: jupyter
jupyter: install ## Install and start jupyter Lab
@uv run pip install jupyterlab
@uv run jupyter lab
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# ISLP_labs

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/intro-stat-learning/ISLP_Labs)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
Expand All @@ -10,8 +13,6 @@
- Robert Tibshirani

- Daniela Witten

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/intro-stat-learning/ISLP_labs/v2.2)

### ISLP

Expand All @@ -23,7 +24,7 @@ if necessary, which is not included as a requirement of the labs.
### Up-to-date version of labs for ISLP.

This repo will track labs for ISLP as their source code changes. The
intent is that building a conda environment with
intent is that building a virtual environment with
`requirements.txt` will reproduce the results in this repo.

To install the current version of the requirements run
Expand All @@ -32,7 +33,7 @@ To install the current version of the requirements run
pip install -r https://raw.githubusercontent.com/intro-stat-learning/ISLP_labs/v2.2/requirements.txt;
Copy link
Collaborator

Choose a reason for hiding this comment

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

One worry about make install here is for Windows users who may not use CLI. The pip install can be run within a notebook as a magic where I don't know about the calls to make. Won't users have to have downloaded Apple's CLI tools for this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't mean we can't have the Makefile of course, just perhaps the instructions for students shouldn't presume make. That's all.

```

The labs can now be run from this directory:
The labs can now be run via:

```
jupyter lab Ch02-statlearn-lab.ipynb
Expand Down