Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e387867
add deadline
github-classroom[bot] Nov 22, 2025
79cc7f0
pushing notebook
giocopp Dec 2, 2025
49dba4a
add set up via upload
elenaivadreyer Dec 2, 2025
7638aed
add config files
elenaivadreyer Dec 2, 2025
fe45e97
adapt links
elenaivadreyer Dec 2, 2025
32ce835
update workflow rendering html
elenaivadreyer Dec 2, 2025
65af1a8
add exploration file
giocopp Dec 2, 2025
3ebdae7
exploration of approaches
giocopp Dec 2, 2025
6b12808
fix notebook
giocopp Dec 2, 2025
1ab6f34
advancing exploration
giocopp Dec 3, 2025
97d79a3
Update exploration.ipynb
giocopp Dec 3, 2025
912e6a3
edits to pre-commit file
elenaivadreyer Dec 5, 2025
ecd8266
Merge pull request #4 from hertie-data-science-lab/elena-setup
elenaivadreyer Dec 5, 2025
7789acb
Auto-render notebook to HTML [skip ci]
github-actions[bot] Dec 5, 2025
98c881a
add files
giocopp Dec 6, 2025
2e0768b
edit exploration
giocopp Dec 8, 2025
5f3ce08
Move exploration.ipynb into notebooks/
giocopp Dec 8, 2025
1f2aa1d
basic architecture FSL
giocopp Dec 9, 2025
2f99397
upload notebooks
giocopp Dec 9, 2025
f11636f
update try_few_shot
giocopp Dec 9, 2025
ad71ebc
Update try_few_shot.ipynb
giocopp Dec 9, 2025
f39e932
Update try_few_shot.ipynb
giocopp Dec 9, 2025
7c25ebd
Delete notebooks/exploration.ipynb
giocopp Dec 9, 2025
899532d
move notebooks in /notebooks
giocopp Dec 9, 2025
c130095
Add memo and introduction
nicolasreichardt Dec 9, 2025
a95b14b
Add references and missing sections
nicolasreichardt Dec 9, 2025
02fddfc
Add references
nicolasreichardt Dec 9, 2025
f3d61be
Add requirements.txt
nicolasreichardt Dec 9, 2025
491ebb1
Add geosplit data preprocessing
nicolasreichardt Dec 9, 2025
9c03e77
Add pretrained backbone
nicolasreichardt Dec 9, 2025
a84f42d
Add evaluations and discussion ideas
nicolasreichardt Dec 9, 2025
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
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG VARIANT="3.11-bookworm"
# INFO, full list of python devcontainers available:
# https://mcr.microsoft.com/v2/vscode/devcontainers/python/tags/list
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}

ENV PATH="/home/vscode/.local/bin:${PATH}"
54 changes: 54 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"VARIANT": "3.11-bookworm"
}
},
"customizations": {
"vscode": {
"settings": {
"python.defaultInterpreterPath": "/workspaces/tutorial-group-1/.venv/bin/python",
"python.terminal.activateEnvironment": true,
"python.testing.pytestArgs": [
"tests"
],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestPath": "/workspaces/tutorial-group-1/.venv/bin/pytest"
},
"extensions": [
"bierner.markdown-mermaid",
"charliermarsh.ruff",
"EditorConfig.EditorConfig",
"github.vscode-github-actions",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.vscode-jupyter-slideshow",
"ms-vsliveshare.vsliveshare",
"ryanluker.vscode-coverage-gutters"
]
}
},
"forwardPorts": [
8888
],
"portsAttributes": {
"8888": {
"label": "Jupyter Notebook"
}
},
"updateContentCommand": "git config --global --add safe.directory /workspaces/tutorial-group-1; make create_venv; echo 'NOTE: PyTorch is NOT installed by default. To install PyTorch (CPU-only), run: source .venv/bin/activate && make install-torch'",
"postCreateCommand": "echo 'source /workspaces/tutorial-group-1/.venv/bin/activate' >> ~/.bashrc; echo 'echo -e \"\\n⚠️ IMPORTANT: PyTorch is not installed by default due to size constraints.\"' >> ~/.bashrc; echo 'echo \"To install PyTorch (CPU-only ~730MB), run:\"' >> ~/.bashrc; echo 'echo \" source .venv/bin/activate && make install-torch\"' >> ~/.bashrc",
"remoteUser": "root",
"features": {
"git": "latest",
"github-cli": "latest"
}
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Linting
on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
lint:
name: Linting (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ['3.11']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install -e .[dev]
# Install PyTorch CPU-only version for CI
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
- name: Linting with pre-commit
run: pre-commit run --all-files
57 changes: 57 additions & 0 deletions .github/workflows/render-notebook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Render Notebook to HTML

on:
push:
branches:
- main
paths:
- 'notebooks/tutorial_few_shot_learning.ipynb'
pull_request:
branches:
- main
paths:
- 'notebooks/tutorial_few_shot_learning.ipynb'
workflow_dispatch:

permissions:
contents: write

jobs:
render:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install nbconvert jupyter

- name: Convert notebook to HTML
run: |
jupyter nbconvert \
--to html \
notebooks/tutorial_few_shot_learning.ipynb \
--output tutorial_few_shot_learning.html \
--output-dir docs/

# Only commit on push to main, NOT on PRs
- name: Commit rendered HTML
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs/tutorial_few_shot_learning.html
if ! git diff --staged --quiet; then
git commit -m "Auto-render notebook to HTML [skip ci]"
git push
else
echo "No changes to commit"
fi
156 changes: 156 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
data/

.DS_Store
65 changes: 65 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# pre-commit: A framework for managing and maintaining multi-language pre-commit hooks
# after configuration is complete, do these steps:
# pre-commit install
# pre-commit run --all-files
# to skip pre-commmit-config when git-committing in terminal, add this: "--no-verify" option.

ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"
autofix_commit_msg: "style: pre-commit fixes"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
stages: [manual]
- id: check-case-conflict
stages: [manual]
- id: check-merge-conflict
stages: [manual]
- id: check-symlinks
stages: [manual]
- id: mixed-line-ending
stages: [manual]
- id: name-tests-test
stages: [manual]
args: [--pytest-test-first]
# pygrep-hooks: a collection of fast, cheap, regex based pre-commit hooks
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-no-log-warn
stages: [manual]
- id: python-no-eval
stages: [manual]
exclude: ^src/few_shot_utils/(train|evaluate)\.py$
- id: rst-directive-colons
stages: [manual]
- id: rst-inline-touching-normal
stages: [manual]
# check-manifest: This makes sense only if you have MANIFEST.in (TODO:review)
- repo: https://github.com/mgedmin/check-manifest
rev: "0.47"
hooks:
- id: check-manifest
stages: [manual]
# pip audit to check for known pip vulnerabilities, supports pyproject.toml
- repo: https://github.com/pypa/pip-audit
rev: v2.7.1
hooks:
- id: pip-audit
stages: [manual]
#Ruff linter and formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
# Recommended to run linter first of automatic fixes are enabled (as some linting fixes might require reformatting)
- id: ruff
#Automatic linting fixes
types_or: [ python, pyi, jupyter ]
args: [ --fix ]
stages: [manual]
- id: ruff-format
types_or: [ python, pyi, jupyter ]
stages: [manual]
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"files.trimTrailingWhitespace": true,
"git.autofetch": true,
"[jsonc]": {"editor.defaultFormatter": "vscode.json-language-features"},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": false
},
"[jupyter]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
Loading