FileSource is usable without a backend

Aperta
#131 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
8/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

This is design work, not a first task: the issue leaves open which package holds the FileSource protocol, Selector and file(), and how to build a file model from a resolved identity and local path. Start by reading the FileSource protocol in ess.apps.files and FileRef in ess.spec, then the testing.FakeFiles implementation. Done means an agreed design and an ADR 0007 decision, not a patch.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

FileSource (ess.apps.files) is in ess.apps because the backend is its only user today, not because it needs the backend. Its protocol (resolve, path, metadata, list, watch) depends only on FileRef from ess.spec, Selector, and pathlib.

A notebook or script that uses specs and bindings without a backend should be able to use a file source directly: run numbers in a local folder, files downloaded with Scitacean, SciCat with /ess/data, or watch for new runs. The same object is then what it passes to local(files=...):

files = ...                                   # a file source: a folder, Scitacean, SciCat
ref = files.resolve(file(run=60339))
params = IofQParams(sample=Sample.local(files.path(ref)), ...)
outputs = iofq.compute(params)

client = local(proposal='p1', files=files, bind=[iofq])

What the backend adds on top stays in the backend: resolving files at submission, so the record holds their identity; the access check against metadata['proposal']; and each client's view, client.files.

Open:

  • Which package holds the protocol, Selector, and file(): ess.spec or another one (ADR 0007). Implementations (folder, Scitacean, SciCat) need dependencies only some users install.
  • Sample.local(path) names the file path:<path>, so in the example above the params lose that the file is run 60339. Use without a backend needs a way to make a file model from a resolved identity and its local path.
  • The only implementation today is testing.FakeFiles.
Lingua principale
Python
Stelle
0
Fork
1
Merge medio
15h 40m
PR unite (30g)
59

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di scipp/essapps

Tutte le issue di scipp/essapps

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.