Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
9550ae0
WIP 0.8.0 (#106)
ejolly Dec 9, 2022
0872194
update ci
ejolly Dec 9, 2022
48343e8
version bump
ejolly Dec 9, 2022
3898649
add install test ga
ejolly Dec 9, 2022
ae938ec
update GA
ejolly Dec 9, 2022
60823b0
Merge pull request #1 from ejolly/master
dramanica Dec 21, 2022
691513f
Add seed to .confint
dramanica Dec 21, 2022
1dcd163
Allow setting seed when boostrapping (#116)
dramanica Dec 22, 2022
7144d1d
Revert "Allow setting seed when boostrapping (#116)" (#117)
ejolly Dec 22, 2022
0084286
Fix typo in test
dramanica Dec 22, 2022
33400d1
Add cooks distances
dramanica Dec 22, 2022
f6af2d7
compute cooks distance with influence
dramanica Jan 11, 2023
a704a32
Revert "compute cooks distance with influence"
ejolly Jan 13, 2023
de877a4
Revert "Add cooks distances"
ejolly Jan 13, 2023
ccbc1e0
Merge branch 'pr/dramanica/118'
ejolly Jan 13, 2023
b68d03d
fix bug when using lm2 with correlations
ejolly Feb 16, 2023
c8610b1
fix bug where bootstrapped CI from Lm were not respecting rank transf…
ejolly Mar 17, 2023
8975d64
try ga build again
ejolly Sep 7, 2023
395364a
make all builds experimental fix 3.10
ejolly Sep 7, 2023
fe7df20
fix formatting and python versions
ejolly Sep 7, 2023
6d9de2d
drop deepdish support and move model persistence to joblib
ejolly Sep 7, 2023
095765e
clean up GAs. version bump
ejolly Sep 7, 2023
12bcb2e
3.10
ejolly Sep 7, 2023
efaac0f
fix formatting
ejolly Sep 7, 2023
b37a497
add black check to tests
ejolly Sep 7, 2023
8073875
fix ga
ejolly Sep 8, 2023
0530116
install anaconda-client
ejolly Sep 8, 2023
4a8227f
install anaconda-client
ejolly Sep 8, 2023
7cec827
add commit hash to conda name
ejolly Sep 8, 2023
eeff81a
Updates to prep for new release
ejolly Sep 8, 2023
dbdeed0
fix ga
ejolly Sep 8, 2023
4f08c2a
see why conda convert cant find tarball
ejolly Sep 8, 2023
1b11ab4
stop triggering auto-deploys on release
ejolly Sep 8, 2023
4605b46
stop triggering auto-deploys on release
ejolly Sep 8, 2023
7e8e290
fix logistic regression param rename
ejolly Apr 7, 2024
bea6eb1
version bump. ci skip
ejolly Apr 7, 2024
5bc1e8a
gets the dataframe output from ranef and VarCorr
AndrewRidden-Harper Jun 21, 2024
dfd3960
simplified code and improved comments
AndrewRidden-Harper Jun 23, 2024
3cdf080
fixed comments
AndrewRidden-Harper Jun 24, 2024
5b732ad
fixed the issue of the df index being integers as strings
AndrewRidden-Harper Jul 3, 2024
c831e5e
deleted varcorr_df as it was the same as existing ranef_var
AndrewRidden-Harper Jul 3, 2024
e907e17
added test function and test data
AndrewRidden-Harper Jul 3, 2024
e5a194f
Added an example for the new feature in example_01_basic_usage
AndrewRidden-Harper Jul 3, 2024
110a404
added comment for why grp col. is loaded as dtype object
AndrewRidden-Harper Jul 3, 2024
851af7a
Update examples/example_01_basic_usage.py
AndrewRidden-Harper Jul 4, 2024
d085931
Reverted imports to original pymer4
AndrewRidden-Harper Jul 4, 2024
a543eb3
reverted blank lines match original Pymer4
AndrewRidden-Harper Jul 5, 2024
7b3a7c4
Merge remote-tracking branch 'refs/remotes/origin/master' into get_ra…
AndrewRidden-Harper Jul 14, 2024
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
86 changes: 47 additions & 39 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
name: Build (& Test)
name: Build and Deploy
on:
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run workflow with ssh debugging'
upload_anaconda:
description: 'Upload build to anaconda'
required: false
default: 'skip'
type: choice
options:
- 'pre-release'
- 'main'
- 'skip'
upload_pypi:
description: 'Upload build to pypi'
required: false
default: false
release:
types: [published]

schedule:
- cron: '0 0 * * 0'
type: boolean
deploy_docs:
description: 'Deploy docs to github pages'
required: false
default: false
type: boolean

env:
PACKAGE_NAME: pymer4
DEPLOY_PY_VER: 3.8 # only this job deploys docs, anaconda.org, pypi
DEPLOY_PY_VER: 3.8 # only this job runner deploys docs and pypi package
DEPLOY_OS: ubuntu-latest
CONDA_BLD_PATH: /tmp/ci_conda_bld

Expand All @@ -29,18 +39,11 @@ jobs:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
fail-fast: true
matrix:
py_ver: [3.8, 3.9]
py_ver: [3.8, 3.9, '3.10', 3.11]
os: [ubuntu-latest, macos-latest]
experimental: [false]
include:
- py_ver: 3.7
os: macos-latest
experimental: true
- py_ver: 3.7
os: ubuntu-latest
experimental: false
experimental: [true]

outputs:
# tarballs are py3X job-specific
Expand Down Expand Up @@ -89,12 +92,11 @@ jobs:
conda config --show | grep bld_path
conda info
conda-build ./conda/ --python=$PY_VER -c https://conda.anaconda.org/conda-forge/ --verify
tarball=$(conda build --python=$PY_VER conda --output | tail -1)
tarball=$(conda-build --python=$PY_VER conda --output | tail -1)
echo "conda build tarball" $tarball
if [[ $OS == "Linux" ]]; then \
conda convert -p win-64 -o $CONDA_BLD_PATH $tarball; \
fi
echo "conda build tarball" $tarball
echo "::set-output name=conda-tarball::$tarball"
echo "{conda-tarball}={$tarball}" >> $GITHUB_OUTPUT

# ------------------------------------------------------------
Expand All @@ -107,6 +109,7 @@ jobs:
run: |
conda create -n env_$PY_VER python=$PY_VER $PACKAGE_NAME -c $CONDA_BLD_PATH -c conda-forge -c defaults
conda activate env_$PY_VER
conda info | grep active
pip install -r requirements-dev.txt
python -c "from pymer4.test_install import test_install; test_install()"

Expand All @@ -116,6 +119,8 @@ jobs:
PY_VER: ${{ matrix.py_ver }}
run: |
conda activate env_$PY_VER
conda info | grep active
black --version
black --check --verbose .
pytest pymer4/tests

Expand All @@ -127,60 +132,63 @@ jobs:
if: ${{ matrix.py_ver == env.DEPLOY_PY_VER && matrix.os == env.DEPLOY_OS }}
run: |
conda activate env_$PY_VER
conda info | grep active
conda install sphinx sphinx_bootstrap_theme sphinx-gallery -c conda-forge
cd docs && make clean && make html
touch _build/html/.nojekyll

# 5b. Deploy docs (only for 3.8 which handles deployment)
# Only runs when a PR is merged into master or there's a direct push to master
# 5b. Deploy docs
# Only runs on the 3.8 runner when there's a release
- name: Deploy docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ (matrix.py_ver == env.DEPLOY_PY_VER && matrix.os == env.DEPLOY_OS) && ((github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event.pull_request.merged && github.base_ref == 'master' && github.head_ref == 'dev')) }}
if: ${{ (matrix.py_ver == env.DEPLOY_PY_VER && matrix.os == env.DEPLOY_OS) && (github.event_name == 'release' || inputs.deploy_docs)}}
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: docs/_build/html

# 6. Build package for PyPi (only for 3.8 linux which handles deployment)
# 6. Build package for PyPi
# Only runs on the 3.8 runner
- name: Build for Pypi
env:
PY_VER: ${{ matrix.py_ver }}
if: ${{ matrix.py_ver == env.DEPLOY_PY_VER && matrix.os == env.DEPLOY_OS }}
run: |
conda activate env_$PY_VER
conda info | grep active
pip install build
python -m build --sdist --wheel --outdir dist/

# 7. Deploy package to Pypi
# Only runs when a manual github release is created
# Only runs on the 3.8 runner when there's a release
- name: PyPi deploy
if: ${{ matrix.py_ver == env.DEPLOY_PY_VER && matrix.os == env.DEPLOY_OS && github.event_name == 'release'}}
if: ${{ (matrix.py_ver == env.DEPLOY_PY_VER && matrix.os == env.DEPLOY_OS) && (github.event_name == 'release' || inputs.upload_pypi)}}
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}

# 8a. Deploy package to main conda channel but each OS uploads their own and linux uploads for linux and windows
# Only runs when a manual github release is created
# 8a. Deploy package to main conda main channel
# Runs when a github release is created, but can also be triggered manually
- name: Conda main deploy
if: ${{ github.event_name == 'release' }}
if: ${{ (github.event_name == 'release') || (inputs.upload_anaconda == 'main') }}
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
echo 'Conda release on main channel'
conda install anaconda-client
anaconda -t "$ANACONDA_TOKEN" upload $CONDA_BLD_PATH/**/${PACKAGE_NAME}*.tar.bz2 -l "main"

# OR -----

# 8b. Deploy package to pre-release conda channel (only for 3.8 which handles deployment) but each OS uploads their own and linux uploads for linux and windows
# Only runs when a PR is merged into master or there's a direct push to master
# 8b. Deploy package to pre-release conda channel
# Only runs when triggered manually
- name: Conda pre-release deploy
if: ${{ ((github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event.pull_request.merged && github.base_ref == 'master' && github.head_ref == 'dev')) }}
if: ${{ inputs.upload_anaconda == 'pre-release' }}
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
echo 'Conda release on pre-release channel'
conda install anaconda-client
anaconda -t "$ANACONDA_TOKEN" upload $CONDA_BLD_PATH/**/${PACKAGE_NAME}*.tar.bz2 -l "pre-release"

# N. Optionall debug via ssh if workflow is run manually with debug_enabled = true
- name: Setup SSH session
if: ${{ github.event_name == 'workflow_dispatch' && github.events.inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3

137 changes: 137 additions & 0 deletions .github/workflows/Build_noarch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Build and Deploy noarch
on:
workflow_dispatch:
inputs:
upload_anaconda:
description: 'Upload build to anaconda'
required: false
default: 'skip'
type: choice
options:
- 'pre-release'
- 'main'
- 'skip'

env:
PACKAGE_NAME: pymer4
DEPLOY_PY_VER: 3.8 # only this job runner deploys docs and pypi package
DEPLOY_OS: ubuntu-latest
CONDA_BLD_PATH: /tmp/ci_conda_bld

defaults:
run:
# login shell to source the conda hook in .bash_profile
shell:
bash -l {0}

jobs:
ci:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
py_ver: [3.9]
os: [ubuntu-latest]
experimental: [true]

outputs:
# tarballs are py3X job-specific
conda-tarball: ${{ steps.conda-bld.outputs.conda-tarball }}

steps:

# ------------------------------------------------------------
# 0. Print some basic github action info
- name: diagnostic info
run: |
echo "OS: ${{ matrix.os }}"
echo "Python: ${{ matrix.py_ver }}"
echo "Conda build path: $CONDA_BLD_PATH"
echo "Deploy OS: $DEPLOY_OS"
echo "Deploy Python: $DEPLOY_PY_VER"
echo "GA event name: ${{ github.event_name }}"
echo "GA ref: ${{ github.ref }}"

# ------------------------------------------------------------
# Step up miniconda
- name: Download Miniconda
uses: conda-incubator/setup-miniconda@059455a698430d8b68fa317268fa2e3da3492a98
with:
miniconda-version: "latest"
python-version: ${{ matrix.py_ver }}

# ------------------------------------------------------------
# Get code
- name: Checkout code
uses: actions/checkout@v2

# ------------------------------------------------------------
# Setup conda build environment and build package
# env defined here are just for convenience when writing bash commands
- name: Setup and build package
env:
OS: ${{ runner.os }}
PY_VER: ${{ matrix.py_ver }}
run: |
conda config --set always_yes yes --set changeps1 no
conda config --set bld_path $CONDA_BLD_PATH
conda install -n base -q conda-build
conda deactivate
echo "# ----------------BUILDING---------------------------------"
conda config --show | grep bld_path
conda info
conda-build ./conda_noarch -c https://conda.anaconda.org/conda-forge --verify
tarball=$(conda-build ./conda_noarch --output | tail -1)
echo "conda build tarball" $tarball
echo "{conda-tarball}={$tarball}" >> $GITHUB_OUTPUT

# ------------------------------------------------------------
# Create new conda env and install package locally
# Test installation worked
# Get black and pytest from pip because black version on conda lags behind
- name: Test installation
env:
PY_VER: ${{ matrix.py_ver }}
run: |
conda create -n env_$PY_VER python=$PY_VER $PACKAGE_NAME -c $CONDA_BLD_PATH -c conda-forge -c defaults
conda activate env_$PY_VER
conda info | grep active
pip install -r requirements-dev.txt
python -c "from pymer4.test_install import test_install; test_install()"

# 4. Run code tests
- name: Run Test Suite
env:
PY_VER: ${{ matrix.py_ver }}
run: |
conda activate env_$PY_VER
conda info | grep active
black --version
black --check --verbose .
pytest pymer4/tests

# 8a. Deploy package to main conda main channel
# Runs when a github release is created, but can also be triggered manually
- name: Conda main deploy
if: ${{ (github.event_name == 'release') || (inputs.upload_anaconda == 'main') }}
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
echo 'Conda release on main channel'
conda install anaconda-client
anaconda -t "$ANACONDA_TOKEN" upload $CONDA_BLD_PATH/**/${PACKAGE_NAME}*.tar.bz2 -l "main"

# OR -----

# 8b. Deploy package to pre-release conda channel
# Only runs when triggered manually
- name: Conda pre-release deploy
if: ${{ inputs.upload_anaconda == 'pre-release' }}
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
echo 'Conda release on pre-release channel'
conda install anaconda-client
anaconda -t "$ANACONDA_TOKEN" upload $CONDA_BLD_PATH/**/${PACKAGE_NAME}*.tar.bz2 -l "pre-release"

71 changes: 71 additions & 0 deletions .github/workflows/Docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Manual Deploy Docs
on:
workflow_dispatch:

env:
PACKAGE_NAME: pymer4
DEPLOY_PY_VER: 3.8 # only this job deploys docs, anaconda.org, pypi
DEPLOY_OS: ubuntu-latest
CONDA_BLD_PATH: /tmp/ci_conda_bld

defaults:
run:
# login shell to source the conda hook in .bash_profile
shell:
bash -l {0}

jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
py_ver: [3.8]
os: [ubuntu-latest]

steps:

# ------------------------------------------------------------
# Step up miniconda
- name: Download Miniconda
uses: conda-incubator/setup-miniconda@059455a698430d8b68fa317268fa2e3da3492a98
with:
miniconda-version: "latest"

# ------------------------------------------------------------
# Get code
- name: Checkout code
uses: actions/checkout@v2


# ------------------------------------------------------------
# Setup conda build environment and build package
# env defined here are just for convenience when writing bash commands
- name: Install package
env:
PY_VER: ${{ matrix.py_ver }}
run: |
conda config --set always_yes yes --set changeps1 no
conda create -n pkg_test -c conda-forge python=$PY_VER 'r-lmerTest' 'r-emmeans' 'rpy2'

conda activate pkg_test
pip install -r requirements-dev.txt
pip install .

# ------------------------------------------------------------
# Build docs
- name: Build Docs
run: |
conda activate pkg_test
python -c "from pymer4.test_install import test_install; test_install()"
cd docs && make clean && make html
touch _build/html/.nojekyll

# Deploy docs
- name: Deploy docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: docs/_build/html
Loading