Add Resampler registry with assigned names
@pnuu ci sta già lavorando.
Dal 20/5/2021.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Context
The assigned developers (among others) have been meeting during the Spring 2021 PCW to discuss a Pyresample 2.0. This issue discusses one of the changes that we think should be implemented on our road to version 2.0. Most features for version 2.0 will be backwards compatible and will not require a deprecation cycle.
For related issues, see the other issues in the v2.0 milestone (see sidebar).
Proposal
To make it easier for users to refer to resampler classes we should refer to them by name and allow users to request them by name. See #357 for how they should be loaded. For registering the Resampler classes we need a registry to store them and a way to register the classes in that registry.
The registry will likely just be a global dictionary in a pyresample module with access given to it by the create_resampler method for reading and register_resampler (see below) for writing to it.
Registration 1: Runtime
from pyresample import register_resampler
register_resampler('some_name', some_class)
Registration 2: On import
This would likely be used by internal resamplers as well as any package that wants on-import registering of their resamplers.
from pyresample.resamplers import BaseResampler
from pyresample import register_resampler
@register_resampler('some_name')
class MyResamplerClass(BaseResampler):
...
Registration 3: Entry Points
Setuptools (setup.py) allow for entry points to be defined. This way when a package is installed that defines these entry points, pyresample will automatically pick up on them without the user needing to explicitly import the package.
setuptools.setup(
...,
entry_points={
"pyresample.resamplers": ["some_name=mypkg.some_module:MyResamplerClass"],
},
)
This can also be done in setup.cfg as an alternative:
[options.entry_points]
pyresample.resamplers =
some_name = mypkg.some_module:MyResamplerClass
As long as create_resampler is written to check for the entry points then this should all "just work".
- Lingua principale
- Python
- Stelle
- 388
- Fork
- 102
- Merge medio
- 5g 17h
- PR unite (30g)
- 5
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 44 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 63 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 383 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
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
selimfirat/pysad#379 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
open-webui/open-webui#32805 ·
I maintainer di solito rispondono entro 1 giorno
-
fix: [bug description] HTML CVE metric table shows only the last CVE for each productForse già presa @Chris-wh233 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
ossf/cve-bin-tool#5976 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
gke-labs/kube-agents#3615 ·
I maintainer di solito rispondono entro 1 giorno
-
deferred
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno