dss-extensions / dss-extensions/AltDSS-Python
Batches from Python generator objects
- Langage dominant
- Python
- Étoiles
- 19
- Forks
- 2
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Generating batches from Python generator objects would allow users to use complex and custom filtering in Python to create a high-performance batch object as a result.
This couples well with the new `iterate()` method, which reuses Python-side objects. This currently doesn't work without the copy:
```
from copy import copy
# Python generator object
selected_load_objs = (copy(load) for load in altdss.Load.iterate() if predicate_function(load))
selected_load_batch = altdss.Load.batch(objs=selected_load_objs)
```
The idea is to allow using the temporary iterator objects directly, since they are lightweight.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par lire l’implémentation de `Load.batch()` et la méthode associée `iterate()`. Reproduisez l’exemple à l’aide d’un générateur d’objets itérateurs temporaires, puis déterminez comment le batching gère actuellement ces objets. La tâche est terminée lorsque `altdss.Load.batch(objs=selected_load_objs)` fonctionne sans `copy()` tout en préservant le comportement léger attendu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- backend
- Type d'issue
- Fonctionnalité
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100