dss-extensions / dss-extensions/AltDSS-Python

Batches from Python generator objects

Open
#13 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
19
Forks
2
PR merge metrics
No merged PRs in 30d

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.