Skip to content

Commit 958f51f

Browse files
authored
python3.11 compatibility; is_tll to mtd_kde (#39)
* python3.11 compatibility; is_tll to mtd_kde modify fstring for python3.11 compatibility; is_tll to mtd_kde for more KDE to come.
1 parent bd656a4 commit 958f51f

File tree

16 files changed

+192
-131
lines changed

16 files changed

+192
-131
lines changed

.github/workflows/publish-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- name: Checkout code
1818
uses: actions/checkout@v4
1919

20-
- name: Set up Python 3.12
20+
- name: Set up Python 3.11
2121
uses: actions/setup-python@v5
2222
with:
23-
python-version: 3.12
23+
python-version: 3.11
2424

2525
- name: Cache pip
2626
uses: actions/cache@v4

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: [ubuntu-latest, windows-latest, macos-latest]
21-
python-version: ["3.12", "3.13"]
21+
python-version: ["3.11", "3.12", "3.13"]
2222
steps:
2323
- name: Checkout code
2424
uses: actions/checkout@v4

.github/workflows/static.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
- name: Checkout code
2929
uses: actions/checkout@v4
3030

31-
- name: Set up Python 3.12
31+
- name: Set up Python 3.11
3232
uses: actions/setup-python@v5
3333
with:
34-
python-version: "3.12"
34+
python-version: "3.11"
3535

3636
- name: Cache pip
3737
uses: actions/cache@v4

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ pip install torchvinecopulib torch
3838

3939
```bash
4040
# inside project root folder
41-
pip install ./dist/torchvinecopulib-1.0.4-py3-none-any.whl
41+
pip install ./dist/torchvinecopulib-1.1.0-py3-none-any.whl
4242
# or
43-
pip install ./dist/torchvinecopulib-1.0.4.tar.gz
43+
pip install ./dist/torchvinecopulib-1.1.0.tar.gz
4444
```
4545

4646
### (Recommended) [uv](https://docs.astral.sh/uv/getting-started/) for Dependency Management and Packaging
@@ -61,7 +61,7 @@ uv sync --extra cu126 -U
6161
fastkde = "*"
6262
numpy = "*"
6363
pyvinecopulib = "*"
64-
python = ">=3.12"
64+
python = ">=3.11"
6565
scipy = "*"
6666
# optional to facilitate customization
6767
torch = [

examples/0_bicop.ipynb

Lines changed: 37 additions & 13 deletions
Large diffs are not rendered by default.

examples/1_vinecop.ipynb

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

examples/3_bicop_tll.ipynb

Lines changed: 41 additions & 17 deletions
Large diffs are not rendered by default.

examples/4_mnist.ipynb

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@
530530
").to(DEVICE)\n",
531531
"vine_tvc.fit(\n",
532532
" obs=representations_subset,\n",
533-
" is_tll=True,\n",
533+
" mtd_kde='tll',\n",
534534
")\n",
535535
"# sns.histplot(\n",
536536
"# x=vine_tvc.log_pdf(representations_subset).cpu().numpy().reshape(-1),\n",
@@ -711,7 +711,7 @@
711711
" obs=u_cls_tensor,\n",
712712
" matrix=tvc_mat,\n",
713713
" is_dissmann=False,\n",
714-
" is_tll=True,\n",
714+
" mtd_kde='tll',\n",
715715
" )\n",
716716
"\n",
717717
" # 4. Store the fitted model\n",
@@ -762,7 +762,7 @@
762762
},
763763
{
764764
"cell_type": "code",
765-
"execution_count": 30,
765+
"execution_count": null,
766766
"id": "c3b24468",
767767
"metadata": {},
768768
"outputs": [
@@ -781,14 +781,8 @@
781781
")\n",
782782
"\n",
783783
"\n",
784-
"bicop_tvc = tvc.BiCop(\n",
785-
" num_step_grid=30,\n",
786-
").to(DEVICE)\n",
787-
"\n",
788-
"bicop_tvc.fit(\n",
789-
" obs=u_cls_tensor[:, :2],\n",
790-
" is_tll=True,\n",
791-
")\n",
784+
"bicop_tvc = tvc.BiCop(num_step_grid=30).to(DEVICE)\n",
785+
"bicop_tvc.fit(obs=u_cls_tensor[:, :2], mtd_kde=\"tll\")\n",
792786
"print(bicop_pvc.loglik(), bicop_tvc.log_pdf(obs=u_cls_tensor[:, :2]).sum())"
793787
]
794788
},

examples/pred_intvl/vine_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def train_vine(Z_train, Y_train, seed=42, device="cpu"):
1616
obs=ZY_train,
1717
first_tree_vertex=first_tree_vertex,
1818
mtd_bidep="ferreira_tail_dep_coeff",
19-
is_tll=True,
19+
mtd_kde="tll",
2020
mtd_tll="quadratic",
2121
seed=seed,
2222
)

examples/vcae_mnist/vcae_mnist/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def learn_vine(self, n_samples=5000):
210210
).to(DEVICE)
211211
vine_tvc.fit(
212212
obs=representations_subset,
213-
is_tll=True,
213+
mtd_kde="tll",
214214
)
215215
self.set_vine(vine_tvc)
216216
self.use_vine = True

0 commit comments

Comments
 (0)