Skip to content

Commit 77b328d

Browse files
authored
fix changed & data cache & update Azure triggers (#39)
* update Azure triggers * fix render * update cli * long lines * data cache * fix unique * cleaning
1 parent f893291 commit 77b328d

File tree

8 files changed

+41
-21
lines changed

8 files changed

+41
-21
lines changed

.actions/helpers.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ class HelperCLI:
128128
".datasets",
129129
".github",
130130
"docs",
131+
"requirements",
131132
DIR_NOTEBOOKS,
132133
)
133134
META_FILE_REGEX = ".meta.{yaml,yml}"
@@ -158,8 +159,8 @@ def augment_script(fpath: str):
158159

159160
first_empty = min([i for i, ln in enumerate(py_file) if not ln.startswith("#")])
160161
header = TEMPLATE_HEADER % meta
161-
requests = default_requirements() + meta["requirements"]
162-
setup = TEMPLATE_SETUP % dict(requirements=" ".join(requests))
162+
requires = set(default_requirements() + meta["requirements"])
163+
setup = TEMPLATE_SETUP % dict(requirements=" ".join(requires))
163164
py_file[first_empty] = header + setup
164165
py_file.append(TEMPLATE_FOOTER)
165166

@@ -212,9 +213,7 @@ def group_folders(
212213
"""
213214
with open(fpath_gitdiff, "r") as fp:
214215
changed = [ln.strip() for ln in fp.readlines()]
215-
216-
# unique folders
217-
dirs = set([os.path.dirname(ln) for ln in changed])
216+
dirs = [os.path.dirname(ln) for ln in changed]
218217
# not empty paths
219218
dirs = [ln for ln in dirs if ln]
220219

@@ -225,6 +224,8 @@ def group_folders(
225224
# get only different
226225
dirs += list(set.union(*dir_sets) - set.intersection(*dir_sets))
227226

227+
# unique folders
228+
dirs = set(dirs)
228229
# drop folder with skip folder
229230
dirs = [pd for pd in dirs if not any(nd in HelperCLI.SKIP_DIRS for nd in pd.split(os.path.sep))]
230231
# valid folder has meta
@@ -256,7 +257,7 @@ def parse_requirements(dir_path: str):
256257

257258
req = meta.get('requirements', [])
258259
fname = os.path.join(dir_path, HelperCLI.REQUIREMENTS_FILE)
259-
print(f"Requirements: {fname}")
260+
print(f"File for requirements: {fname}")
260261
with open(fname, "w") as fp:
261262
fp.write(os.linesep.join(req))
262263

@@ -273,7 +274,7 @@ def parse_requirements(dir_path: str):
273274
cmd_args.append(f"--{pip_key} {arg}")
274275

275276
fname = os.path.join(dir_path, HelperCLI.PIP_ARGS_FILE)
276-
print(f"PIP arguments: {fname}")
277+
print(f"File for PIP arguments: {fname}")
277278
with open(fname, "w") as fp:
278279
fp.write(" ".join(cmd_args))
279280

.actions/ipynb-render.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ python .actions/helpers.py parse-requirements $1
1717
pip install --quiet --requirement requirements.txt --upgrade-strategy only-if-needed
1818
cat "$1/requirements.txt"
1919
pip_args=$(cat "$1/pip_arguments.txt")
20-
printf "pip arguments: $pip_args"
21-
pip install --requirement "$1/requirements.txt"$pip_args
20+
printf "pip arguments:\n $pip_args\n\n"
21+
pip install --requirement "$1/requirements.txt" $pip_args
2222

2323
printf "available: $ACCELERATOR\n"
2424
accel=$(python .actions/helpers.py valid-accelerator $1 2>&1)

.actions/ipynb-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ source "$1/venv/bin/activate"
1818
pip --version
1919
pip install --quiet --requirement requirements.txt --upgrade-strategy only-if-needed
2020
pip_args=$(cat "$1/pip_arguments.txt")
21-
printf "pip arguments: $pip_args\n"
21+
printf "pip arguments:\n $pip_args\n\n"
2222
pip install --requirement "$1/requirements.txt" $pip_args
2323
pip list
2424

.azure-pipelines/ipynb-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
trigger:
2+
batch: true
23
branches:
3-
include:
4-
- main
4+
include: [ main ]
55
pr: none
66
#stages:
77
#- stage: testing

.azure-pipelines/ipynb-tests.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
trigger: none
22
pr:
3-
- main
4-
5-
#stages:
6-
#- stage: testing
3+
branches:
4+
include: [ main ]
5+
autoCancel: true
6+
drafts: true
77

88
jobs:
99

@@ -59,7 +59,15 @@ jobs:
5959
echo "##vso[task.setvariable variable=folders;isOutput=true]$COUNT"
6060
name: changed
6161
62+
- task: Cache@2
63+
inputs:
64+
key: data | .actions/data-download.sh
65+
restoreKeys: data
66+
path: $(PATH_DATASETS)
67+
cacheHitVar: DATA_RESTORED
68+
6269
- script: bash .actions/data-download.sh $(PATH_DATASETS)
70+
condition: ne(variables.DATA_RESTORED, 'true')
6371
displayName: 'Pull datasets'
6472

6573
- bash: |

.github/workflows/ci_testing.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,16 @@ jobs:
4141
pip list
4242
shell: bash
4343

44+
- name: Cache Data
45+
id: cache-data
46+
uses: actions/cache@v2
47+
with:
48+
path: $PATH_DATASETS
49+
key: ${{ runner.os }}-datasets-${{ hashFiles('.actions/data-download.sh') }}
50+
restore-keys: ${{ runner.os }}-datasets-
51+
4452
- name: Download Data
53+
if: steps.cache-data.outputs.cache-hit != 'true'
4554
run: bash .actions/data-download.sh $PATH_DATASETS
4655

4756
- name: Process folders

course_UvA-DL/graph-neural-networks/.meta.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ updated: 2021-06-07
55
license: CC
66
description: |
77
In this tutorial, we will discuss the application of neural networks on graphs.
8-
Graph Neural Networks (GNNs) have recently gained increasing popularity in both applications and research, including domains such as social networks, knowledge graphs, recommender systems, and bioinformatics.
9-
While the theory and math behind GNNs might first seem complicated, the implementation of those models is quite simple and helps in understanding the methodology.
10-
Therefore, we will discuss the implementation of basic network layers of a GNN, namely graph convolutions, and attention layers.
8+
Graph Neural Networks (GNNs) have recently gained increasing popularity in both applications and research,
9+
including domains such as social networks, knowledge graphs, recommender systems, and bioinformatics.
10+
While the theory and math behind GNNs might first seem complicated,
11+
the implementation of those models is quite simple and helps in understanding the methodology.
12+
Therefore, we will discuss the implementation of basic network layers of a GNN,
13+
namely graph convolutions, and attention layers.
1114
Finally, we will apply a GNN on semi-supervised node classification and molecule categorization.
1215
This notebook is part of a lecture series on Deep Learning at the University of Amsterdam.
1316
The full list of tutorials can be found at https://uvadlc-notebooks.rtfd.io.
@@ -17,7 +20,6 @@ requirements:
1720
- torch-cluster
1821
- torch-spline-conv
1922
- torch-geometric
20-
- pytorch-lightning
2123
pip__find-link:
2224
# - https://pytorch-geometric.com/whl/torch-1.8.0+cu101.html
2325
- https://pytorch-geometric.com/whl/torch-%(TORCH_MAJOR_DOT_MINOR)s.0+%(DEVICE)s.html

requirements/default.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pytorch-lightning>=1.3
22
torchmetrics>=0.3
3-
torch>=1.7
3+
torch>=1.6, <1.9

0 commit comments

Comments
 (0)