New Resampler interface design and discussion
@pnuu ci sta già lavorando.
Dal 28/9/2021.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
I'm beginning more serious work on Pyresample 2.0 in #379 and I'm running into some issues with the interface as I saw it after looking at the legacy nearest neighbor resampler and how it was used. Here's the general structure of a Resampler subclass:
class MyResampler(Resampler):
def __init__(self, src_geom, dst_geom, cache=None):
...
def precompute(self, **kwargs):
...
def compute(self, data, **kwargs):
return new_data
def resample(self, data, **kwargs):
self.precompute(**kwargs)
return self.compute(data, **kwargs)
The idea is that users will use create_resampler like this:
resampler = create_resampler(src_geom, dst_geom, resampler="nearest", cache=some_cache)
resampler.precompute(...) # optional to pre-seed any cache
new_data = resampler.resample(data, **kwargs)
The issues and questions I'm running into:
- Should custom keyword arguments go in
__init__or in theprecompute? For example, the nearest neighbor resampler currently allows you to customize number of neighbors, radius of influence, and epsilon. Originally I liked the idea of all resamplers having the same__init__interface. It was nice and clean and leaves the work up to 2 methods (precompute/compute). If settings like these are passed to precompute/compute and not__init__then it lets a single resampler instance be used for all combinations of these parameters BUT it also means that the user has to specify these parameters to the methods every time they call them. - What, if anything, should
precomputereturn? Currently these classes are returning acache_idthat has to be passed tocomputeso it can get the proper item from the cache and use it. I think this ID can just be generated multiple times (assuming it is quick) and doesn't have to be returned. And if the cache id isn't returned, then shouldprecomputereturn anything at all? No probably?
Thoughts? We might need a video call for this.
- Lingua principale
- Python
- Stelle
- 388
- Fork
- 103
- Merge medio
- 7g 4h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna 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 pytroll/pyresample
-
Geometry `__eq__` and `__hash__` violate Python's hash/equality contractForse di nuovo libera @pnuu l’ha presa 48 giorni fa e non c’è nessuna pull request aperta. Apertabug Priority-Medium
pytroll/pyresample#745 · 1 commento · 3 assegnatari ·
-
Improve resampler x/y coordinate metadataForse di nuovo libera @djhoese l’ha presa 66 giorni fa e non c’è nessuna pull request aperta. Apertabug
pytroll/pyresample#739 · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
pytroll/pyresample#698 · 1 commento ·
-
`AreaDefinition.get_area_slices` doesn't work for cropped geostationary areas like SEVIRI RSSAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
pytroll/pyresample#694 · 5 commenti ·
-
gradient_search comb effectForse di nuovo libera @mraspaud l’ha presa 387 giorni fa e non c’è nessuna pull request aperta. Aperta
pytroll/pyresample#682 · 7 commenti · 1 assegnatario ·
Tutte le issue di pytroll/pyresample
Issue simili
-
Project submission:Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
slavakurilyak/awesome-ai-agents#845 ·
I maintainer di solito rispondono entro 1 giorno
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directoryForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertadifficulty:2 enhancement good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
MakazhanAlpamys/Soup#2178 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
scverse/rapids-singlecell#854 ·
I maintainer di solito rispondono entro 1 giorno
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGLForse già presa @ninglinLiu l’ha presa oggi. Apertaarea:frontend backend:slang bug direction:input
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 13 giorni