How can we share useful functions between demonstration notebooks when I want them to be self contained?
@DavidT3 ci sta già lavorando.
Dal 13/5/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Usually if I wanted to share functions between notebooks I'd make some common.py file and add it to the system path e.g. (ripped from one of my research notebook repos):
import pandas as pd
pd.set_option('display.max_columns', 500)
import numpy as np
from astropy.units import Quantity
from astropy.cosmology import LambdaCDM
import os
# This adds the directory above to the path, allowing me to import the common functions that I've written in
# common.py - this just saves me repeating boring code and makes sure its all consistent
import sys
sys.path.insert(0, '..')
from common import xcs_cosmo, lx_norm, m_norm
import xga
from xga.relations.fit import scaling_relation_lira
However, I specifically diverged from how the Fornax notebooks work (and I think how IRSA does it) and don't use files to declare functions, instead they are defined in a collapsed section of the notebook.
Great, other than when we want multiple notebooks to have the same functions - then we have to maintain them in multiple places.
I don't have a good solution for this yet, other than post-processing the notebooks with a github action to replace any declarations of a commonly-named function when it changes in some centralized file where it is maintained?
- Lingua principale
- Python
- Stelle
- 6
- Fork
- 3
- Merge medio
- 23h 20m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di heasarc/heasarc-tutorials
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
heasarc/heasarc-tutorials#317 ·
-
Villanova workshop - Write workshop overview in the index fileForse di nuovo libera @abasuzych l’ha presa 34 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
heasarc/heasarc-tutorials#307 · 1 assegnatario ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
heasarc/heasarc-tutorials#308 ·
-
Villanova workshop - Add expansion measurement worksheetForse di nuovo libera @DavidT3 l’ha presa 60 giorni fa e non c’è nessuna pull request aperta. Apertadoc-content enhancement
heasarc/heasarc-tutorials#303 · 1 assegnatario ·
-
Villanova workshop - Add GIF worksheetForse di nuovo libera @DavidT3 l’ha presa 60 giorni fa e non c’è nessuna pull request aperta. Aperta
heasarc/heasarc-tutorials#302 · 1 assegnatario ·
Tutte le issue di heasarc/heasarc-tutorials
Issue simili
-
flaky: test_fire_returns_thread_per_http_entry_on_head waits 5 s per dispatch worker on busy shardsApertastatus/accepted type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
microsoft/apm#5309 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug vector-store
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
EverMind-AI/Raven#1413 ·
I maintainer di solito rispondono entro 1 giorno
-
Tests: parallel pyinstallcheck runs oversubscribe the machine through nested TBB and BLAS poolsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
ACCESS-NRI/containerised-environments-infra#143 ·
I maintainer di solito rispondono entro 2 giorni