Skip to content
Open
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
40 changes: 8 additions & 32 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,28 @@ name: Build and run python tests
on: [push]

jobs:

build-mac:
runs-on: macos-latest
build:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 5
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install .

- name: Test pyglmnet
run: |
pip install pytest
pytest tests/test*py

build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.10
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install .

- name: Test pyglmnet
run: |
pip install pytest
pip install pytest
pytest tests/test*py


72 changes: 72 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This builds and deploys glmnet docs

name: Build docs

# Controls when the workflow will run
on:
workflow_dispatch:
inputs: null

# A workflow run is made up of one or more jobs that can run
# sequentially or in parallel

jobs: # This workflow contains a single
# job called "build"

build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'

# Install
- name: Install dependencies
run: |
sudo apt-get install r-base
pip install -r docs/requirements.txt
pip install .

- name: Make docs
run: |
cd docs
jupyter-book build .

# Store the output
- name: Upload docs
uses: actions/upload-artifact@v4
with:
name: ISLP_docs
path: docs/_build/html
retention-days: 5

deploy:
runs-on: ubuntu-latest
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}

steps:
- uses: actions/download-artifact@v4
with:
name: ISLP_docs
path: .
- uses: actions/configure-pages@v3
- uses: actions/upload-pages-artifact@v3
with:
path: .
- id: deployment
uses: actions/deploy-pages@v4
55 changes: 1 addition & 54 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,68 +23,15 @@ jobs:
submodules: recursive

- name: Build wheels
uses: pypa/cibuildwheel@v3.0.0 # Use the latest version
uses: pypa/cibuildwheel@v3.3.1 # Use the latest version

- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl # cibuildwheel puts wheels in this directory

# build-wheels:
# name: Build wheels on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
# python-version: ['3.9', '3.10', '3.11', '3.12']

# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# submodules: recursive

# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}

# - name: Install build dependencies
# run: |
# python -m pip install --upgrade pip
# pip install build wheel setuptools pybind11 numpy

# - name: Install system dependencies (Linux)
# if: runner.os == 'Linux'
# run: |
# sudo apt-get update
# sudo apt-get install -y build-essential

# - name: Install system dependencies (macOS)
# if: runner.os == 'macOS'
# run: |
# # macOS dependencies are handled by the build tools

# - name: Install system dependencies (Windows)
# if: runner.os == 'Windows'
# run: |
# # Windows dependencies are handled by the build tools

# - name: Build wheel
# run: |
# python -m build --wheel

# - name: List built artifacts
# run: |
# python -c "import os; import glob; files = glob.glob('dist/*'); print('Files in dist/:'); [print(f) for f in files]"

# - name: Upload wheel artifacts
# uses: actions/upload-artifact@v4
# with:
# name: coxdev-${{ runner.os }}-py${{ matrix.python-version }}
# path: dist/*.whl

build-sdist:
name: Build source distribution
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compare_R.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
submodules: recursive

- name: Set up Python 3.12
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.12'

Expand Down
28 changes: 28 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Jupyter Book configuration
# See https://jupyterbook.org/en/stable/customize/config.html

title: GLMStar Documentation
author: GLMStar Team
logo: null
execute:
execute_notebooks: force
html:
number_sections: true
use_issues_button: true
use_repository_button: true
use_edit_page_button: true
repository:
url: https://github.com/your-org/glmstar
path_to_book: docs
branch: main

# Sphinx configuration for autodoc
sphinx:
extra_extensions:
- sphinx.ext.autodoc
- sphinx.ext.napoleon
config:
autodoc_default_options:
members: true
undoc-members: true
show-inheritance: true
12 changes: 12 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Table of contents for GLMStar documentation
# See https://jupyterbook.org/en/stable/customize/toc.html

format: jb-book
root: index
chapters:
- file: vignettes/glmnet.md
- file: examples/Test_design.md
- file: examples/cross_validation.md
- file: examples/diabetes_logistic.md
- file: examples/elnet_compare.md
- file: api_reference.md
30 changes: 30 additions & 0 deletions docs/api_reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# API Reference

This section provides the API reference for the GLMStar Python package.

## Main Classes and Functions

```{eval-rst}
.. automodule:: glmnet
:members:
:undoc-members:
:show-inheritance:
```

## Paths Module

```{eval-rst}
.. automodule:: glmnet.paths.lognet
:members:
:undoc-members:
:show-inheritance:
```

## Inference Module

```{eval-rst}
.. automodule:: glmnet.inference
:members:
:undoc-members:
:show-inheritance:
```
Loading
Loading