Skip to content

Commit c22cb5c

Browse files
authored
Massive updates to python 3.12, pymc 5.20, numpy 1.26, and assorted lower-importance version updates (#138)
* + update makefile MAMBADL (miniforge) from 23.3.1-1 to 24.11.3-0 + make uninstall mamba and reinstall mamba + make uninstall-env and install-env + make uninstall-env and dev * + update makefile and envrc to use mamba not conda + update versions in pyproject + make test-dev-env + let's try for a release * + update 3.11 to 3.12 throughout * + perhaps foolishly updated seaborn to 0.13.2, lets see what breaks * + updated boxplots to use showfliers not sym * + remove target_accept from Metropolis builder + small updates to plots as reqd by seaborn 13 * + update violinplots * + update re.sub("", ..) to re.sub(r"", ...) * + minor improvements to plots
1 parent a6a7248 commit c22cb5c

18 files changed

+278
-287
lines changed

.envrc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
# new protocol reqd per https://github.com/direnv/direnv/issues/326#issuecomment-574779485
2-
eval "$(conda shell.zsh hook)"
3-
conda activate oreum_core
1+
eval "$(mamba shell hook --shell zsh)"
2+
mamba activate oreum_core

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
platform: ["ubuntu-latest"]
9-
python-version: ["3.11"]
9+
python-version: ["3.12"]
1010
steps:
1111
- uses: actions/checkout@v4
1212
- name: Setup Python ${{ matrix.python-version }}

.github/workflows/publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
platform: ["ubuntu-latest"]
15-
python-version: ["3.11"]
15+
python-version: ["3.12"]
1616
steps:
1717
- name: Checkout repo
1818
uses: actions/checkout@v4
@@ -31,10 +31,10 @@ jobs:
3131
steps:
3232
- name: Checkout repo
3333
uses: actions/checkout@v4
34-
- name: Setup Python 3.11
34+
- name: Setup Python 3.12
3535
uses: actions/setup-python@v5
3636
with:
37-
python-version: "3.11"
37+
python-version: "3.12"
3838
- name: Build and Publish package to TestPyPI
3939
env:
4040
FLIT_USERNAME: __token__
@@ -55,10 +55,10 @@ jobs:
5555
steps:
5656
- name: Checkout repo
5757
uses: actions/checkout@v4
58-
- name: Setup Python 3.11
58+
- name: Setup Python 3.12
5959
uses: actions/setup-python@v5
6060
with:
61-
python-version: "3.11"
61+
python-version: "3.12"
6262
- name: Build and Publish package to PyPI
6363
env:
6464
FLIT_USERNAME: __token__

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# .pre-commit-config.yaml
22
default_language_version:
3-
python: python3.11
3+
python: python3.12
44
default_stages: [pre-commit, pre-push]
55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks # general checks
@@ -31,13 +31,13 @@ repos:
3131
- id: no-print-statements
3232
files: ^oreum_core/
3333
- repo: https://github.com/astral-sh/ruff-pre-commit
34-
rev: v0.9.0
34+
rev: v0.9.3
3535
hooks:
3636
- id: ruff # lint
3737
args: [ --fix]
3838
- id: ruff-format # formatter
3939
- repo: https://github.com/pycqa/bandit # basic security checks for python code
40-
rev: 1.8.0
40+
rev: 1.8.2
4141
hooks:
4242
- id: bandit
4343
files: ^oreum_core/

LICENSES_THIRD_PARTY.md

Lines changed: 147 additions & 169 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
test-dev-env test-dl-ins uninstall-env uninstall-mamba
88
.SILENT: build dev help install-env install-mamba lint pre-build pub test-pub\
99
test-dev-env test-dl-ins uninstall-env uninstall-mamba
10-
MAMBADL := https://github.com/conda-forge/miniforge/releases/download/23.3.1-1
10+
MAMBADL := https://github.com/conda-forge/miniforge/releases/download/24.11.3-0
1111
MAMBAV := Miniforge3-MacOSX-arm64.sh
1212
MAMBARCMSG := Please create file $(MAMBARC), importantly set `platform: osx-arm64`
1313
MAMBARC := $(HOME)/.mambarc
@@ -28,9 +28,8 @@ build: ## build package oreum_core (actually more of an "assemble" than a compi
2828
dev: ## create env for local dev
2929
make install-env
3030
export PATH=$(MAMBADIR)/envs/oreum_core/bin:$$PATH; \
31-
export CONDA_ENV_PATH=$(MAMBADIR)/envs/oreum_core/bin; \
32-
export CONDA_DEFAULT_ENV=oreum_core; \
33-
export CONDA_SUBDIR=osx-arm64; \
31+
export MAMBA_EXE='$(MAMBADIR)/bin/mamba'; \
32+
export MAMBA_ROOT_PREFIX='$(MAMBADIR)'; \
3433
$(PYTHON_ENV) -m pip install -e ".[all]"; \
3534
$(PYTHON_ENV) -c "import numpy as np; np.__config__.show()" > dev/install_log/blas_info.txt; \
3635
pipdeptree -a > dev/install_log/pipdeptree.txt; \
@@ -43,7 +42,8 @@ install-env: ## create mamba (conda) environment
4342
export PATH=$(MAMBADIR)/bin:$$PATH; \
4443
if which mamba; then echo "mamba ready"; else make install-mamba; fi
4544
export PATH=$(MAMBADIR)/bin:$$PATH; \
46-
export CONDA_SUBDIR=osx-arm64; \
45+
export MAMBA_EXE='$(MAMBADIR)/bin/mamba'; \
46+
export MAMBA_ROOT_PREFIX='$(MAMBADIR)'; \
4747
mamba update -n base mamba; \
4848
mamba env create --file condaenv_oreum_core.yml -y;
4949

@@ -53,7 +53,7 @@ install-mamba: ## get mamba via miniforge, explicitly use bash
5353
chmod 755 $(HOME)/miniforge.sh
5454
bash $(HOME)/miniforge.sh -b -p $(MAMBADIR)
5555
export PATH=$(MAMBADIR)/bin:$$PATH; \
56-
conda init zsh;
56+
mamba shell init;
5757
rm $(HOME)/miniforge.sh
5858

5959
lint: ## run code linters and static security (checks only)
@@ -74,7 +74,6 @@ help:
7474
@echo " test-dl-ins test dl & install from testpypi"
7575
@echo " uninstall-env remove env (use from parent dir \make -C oreum_core ...)"
7676

77-
7877
pre-build: ## setup env for flit build or flit publish
7978
rm -rf dist
8079
$(PYTHON) -m pip install flit keyring
@@ -90,16 +89,13 @@ test-pub: ## all-in-one build and publish to testpypi
9089
export FLIT_INDEX_URL=https://test.pypi.org/legacy/; \
9190
$(PYTHON) -m flit publish
9291

93-
test-dev-env: ## test the dev machine install of critial numeric packages
92+
test-dev-env: ## test the dev machine install of critical numeric packages
9493
export PATH=$(MAMBADIR)/bin:$$PATH; \
95-
export PATH=$(MAMBADIR)/envs/oreum_core/bin:$$PATH; \
96-
export CONDA_ENV_PATH=$(MAMBADIR)/envs/oreum_core/bin; \
97-
export CONDA_DEFAULT_ENV=oreum_core; \
94+
export MAMBA_EXE='$(MAMBADIR)/bin/mamba'; \
95+
export MAMBA_ROOT_PREFIX='$(MAMBADIR)'; \
9896
$(PYTHON_ENV) -c "import numpy as np; np.test()" > dev/install_log/tests_numpy.txt; \
9997
$(PYTHON_ENV) -c "import scipy as sp; sp.test()" > dev/install_log/tests_scipy.txt;
10098

101-
# $(PYTHON_ENV) -c "import pymc as pm; pm.test()" > dev/install_log/pymc.txt; \
102-
10399
test-dl-ins: ## test dl & install from testpypi, set env var or pass in VERSION
104100
$(PYTHON) -m pip uninstall -y oreum_core
105101
$(PYTHON) -m pip index versions --pre -i https://test.pypi.org/simple/ oreum_core
@@ -108,13 +104,13 @@ test-dl-ins: ## test dl & install from testpypi, set env var or pass in VERSION
108104

109105
uninstall-env: ## remove mamba env
110106
export PATH=$(MAMBADIR)/bin:$$PATH; \
111-
export CONDA_SUBDIR=osx-arm64; \
107+
export MAMBA_ROOT_PREFIX='$(MAMBADIR)'; \
112108
mamba env remove --name oreum_core -y; \
113-
conda clean --all -afy;
114-
# mamba clean -afy # 2023-12-10 see: https://github.com/mamba-org/mamba/issues/3044
109+
mamba clean -ay
115110

116-
uninstall-mamba: ## last ditch per https://github.com/conda-forge/miniforge#uninstallation
117-
conda init zsh --reverse
111+
uninstall-mamba: ## nuclear option https://github.com/conda-forge/miniforge?tab=readme-ov-file#uninstall
112+
mamba shell deinit
118113
rm -rf $(MAMBADIR)
119-
rm -rf $(HOME)/.conda
120-
rm -f $(HOME)/.condarc
114+
rm -rf $(HOME)/.mamba
115+
rm -f $(HOME)/.mambarc
116+
rm -f $(HOME)/.mambarc_x86

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Oreum Core Tools `oreum_core`
22

3-
[![Python](https://img.shields.io/badge/python-3.11-blue)](https://www.python.org)
3+
[![Python](https://img.shields.io/badge/python-3.12-blue)](https://www.python.org)
44
[![License](https://img.shields.io/badge/license-Apache2.0-blue.svg)](https://choosealicense.com/licenses/apache-2.0/)
55
[![GitHub Release](https://img.shields.io/github/v/release/oreum-industries/oreum_core?display_name=tag&sort=semver)](https://github.com/oreum-industries/oreum_core/releases)
66
[![PyPI](https://img.shields.io/pypi/v/oreum_core)](https://pypi.org/project/oreum_core)
@@ -56,8 +56,16 @@ This package **is not**:
5656
+ Source code repo on [GitHub](https://github.com/oreum-industries/oreum_core)
5757
+ Source code release on [GitHub](https://github.com/oreum-industries/oreum_core/releases)
5858
+ Package release on [PyPi](https://pypi.org/project/oreum_core)
59-
60-
59+
+ Implementation:
60+
+ This project is enabled by a modern, open-source, advanced software stack
61+
for data curation, statistical analysis and predictive modelling
62+
+ Specifically we use an open-source Python-based suite of software packages,
63+
the core of which is often known as the Scientific Python stack, supported
64+
by [NumFOCUS](https://numfocus.org)
65+
+ Once installed (see section 2), see `LICENSES_THIRD_PARTY.md` for full
66+
details of all package licences
67+
+ Environments: this project was originally developed on a Macbook Air M2
68+
(Apple Silicon ARM64) running MacOS 15.2 (Sequoia) using `osx-arm64` Accelerate
6169

6270
## 2. Instructions to Create Dev Environment
6371

condaenv_oreum_core.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Manually created as-at 2021-12-01
2-
# Last updated as-at 2023-12-10
2+
# Last updated as-at 2025-01-24
33
# NOTES:
44
# + Creates a virtual env for project development
55
# + Require running on Apple Silicon ARM64 (NOT Intel x86 AMD64 CPU via Rosetta2)
@@ -10,19 +10,14 @@
1010
# also see https://numpy.org/install/ and https://github.com/numpy/numpy/pull/24053
1111
# + libblas, libcblas, liblapack, not strictly needed here but we want to be
1212
# explicit about forcing BLAS to use Accelerate
13-
# + pooch and scipy-tests required because conda-forge scipy (brought in by pymc)
14-
# doesnt contain tests
1513
name: oreum_core
1614
channels:
1715
- conda-forge
1816
# - defaults
1917
dependencies:
20-
- conda-forge::ipykernel>=6.23.1
21-
- conda-forge::numpy>=1.25.2 #>=1.26.2 # see NOTES
18+
- conda-forge::ipykernel>=6.29.0
19+
- conda-forge::numpy>=1.26.0 # see NOTES
2220
- conda-forge::libblas=*[build=*accelerate] # see NOTES
2321
- conda-forge::libcblas=*[build=*accelerate] # see NOTES
2422
- conda-forge::liblapack=*[build=*accelerate] # see NOTES
25-
- conda-forge::python==3.11.*
26-
- conda-forge::pymc==5.9.* # >=5.10.1
27-
- conda-forge::scipy-tests # see NOTES
28-
- conda-forge::pooch # see NOTES
23+
- conda-forge::python==3.12.*

dev/Makefile_osx-64

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# + Intended for dev install on MacOS x64 (Intel via Rosetta 2)
44
# + On MacOS, the miniforge.sh installer is too clever and complains
55
# that "$(uname -m)" != "x86_64", but we ignore that: Rosetta2 will run x86_64
6+
# NOTE as-at 2025-01-24 this is largely untested since 2023, so if/when needed,
7+
# expect to need to do some updating / troubleshooting
68
.PHONY: build create-env dev lint help mamba pre-build pub test-pub test-dev-env test-dl-ins uninstall uninstall-mamba
79
.SILENT: build create-env dev lint help mamba pre-build pub test-pub test-dev-env test-dl-ins uninstall uninstall-mamba
810
MAMBADL := https://github.com/conda-forge/miniforge/releases/download/23.3.1-1

dev/condaenv_oreum_core_x86.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Manually created as-at 2021-12-01
2-
# Last updated as-at 2023-10-04
2+
# Last updated as-at 2025-01-24
33
# NOTE:
44
# + Creates a virtual env for project usage
55
# + Require running on Intel x86 AMD64 CPU (or Rosetta2 on MacOS)
@@ -15,12 +15,11 @@ channels:
1515
- conda-forge
1616
# - defaults
1717
dependencies:
18-
- pkgs/main::numpy==1.24.3 # force numpy MKL see NOTE
19-
- conda-forge::ipykernel>=6.23.1
18+
- pkgs/main::numpy==1.26.0 # force numpy MKL see NOTE
19+
- conda-forge::ipykernel>=6.29.0
2020
- conda-forge::libblas=*[build=*mkl] # force BLAS with MKL see NOTE
2121
- conda-forge::libcblas=*[build=*mkl] # force BLAS with MKL see NOTE
2222
- conda-forge::liblapack=*[build=*mkl] # force BLAS with MKL see NOTE
2323
- conda-forge::mkl==2021.4.* # force MKL version see NOTE
2424
- conda-forge::mkl-service==2.4.*
25-
- conda-forge::python==3.11.*
26-
- conda-forge::pymc>=5.9.0
25+
- conda-forge::python==3.12.*

0 commit comments

Comments
 (0)