Add Resampler registry with assigned names
@pnuu ya está trabajando en esto.
Desde el 20/5/2021.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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".
- Lenguaje dominante
- Python
- Estrellas
- 388
- Forks
- 102
- Merge medio
- 5 d 17 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pytroll/pyresample
-
Geometry `__eq__` and `__hash__` violate Python's hash/equality contractQuizá libre de nuevo @pnuu la tomó hace 45 días y no hay ningún pull request abierto. Abiertobug Priority-Medium
pytroll/pyresample#745 · 1 comentario · 3 asignados ·
-
Improve resampler x/y coordinate metadataQuizá libre de nuevo @djhoese la tomó hace 64 días y no hay ningún pull request abierto. Abiertobug
pytroll/pyresample#739 · 1 asignado ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
pytroll/pyresample#698 · 1 comentario ·
-
`AreaDefinition.get_area_slices` doesn't work for cropped geostationary areas like SEVIRI RSSAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
pytroll/pyresample#694 · 5 comentarios ·
-
gradient_search comb effectQuizá libre de nuevo @mraspaud la tomó hace 384 días y no hay ningún pull request abierto. Abierto
pytroll/pyresample#682 · 7 comentarios · 1 asignado ·
Todos los issues de pytroll/pyresample
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
zach-blumenfeld/aip#13 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
nathanmarlor/foxess_modbus#1287 ·
Los mantenedores suelen responder en 4 días
-
bug good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
OpenLakeForge/openlakeforge#498 ·
Los mantenedores suelen responder en 1 día
-
good first issue hacktoberfest help wanted python
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
Exact onnxruntime==1.27.0 core pin makes Pipecat-based apps uninstallable from the dashboardAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
pollen-robotics/reachy_mini#1493 ·
Los mantenedores suelen responder en 1 día