-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Drop dependency on ampel-core * Bump version to 0.10.1a0 * ci: don't need mongo * ci: renovate with poetry
- Loading branch information
1 parent
c41cf16
commit 8c94957
Showing
6 changed files
with
211 additions
and
633 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,15 @@ | |
# Last Modified Date: 25.05.2021 | ||
# Last Modified By: valery brinnel <[email protected]> | ||
|
||
from collections.abc import Generator | ||
from collections.abc import Generator, Iterable | ||
|
||
from ampel.abstract.AbsT1RetroCombineUnit import AbsT1RetroCombineUnit | ||
from ampel.content.DataPoint import DataPoint | ||
from ampel.t1.T1SimpleRetroCombiner import T1SimpleRetroCombiner | ||
from ampel.struct.T1CombineResult import T1CombineResult | ||
from ampel.types import DataPointId | ||
|
||
|
||
class T1PhotoRetroCombiner(T1SimpleRetroCombiner): | ||
class T1PhotoRetroCombiner(AbsT1RetroCombineUnit): | ||
""" | ||
combine( | ||
[ | ||
|
@@ -29,6 +30,19 @@ class T1PhotoRetroCombiner(T1SimpleRetroCombiner): | |
] | ||
""" | ||
|
||
def combine(self, datapoints: Iterable[DataPoint]) -> list[T1CombineResult]: | ||
""" | ||
:param datapoints: dict instances representing datapoints | ||
""" | ||
|
||
chan = self.channel | ||
dps = [ | ||
dp for dp in datapoints | ||
if not("excl" in dp and chan in dp['excl']) | ||
] | ||
|
||
return [T1CombineResult(dps=el) for el in reversed(list(self.generate_retro_sequences(dps)))] | ||
|
||
def generate_retro_sequences(self, datapoints: list[DataPoint]) -> Generator[list[DataPointId], None, None]: | ||
while datapoints: | ||
yield [dp["id"] for dp in datapoints] | ||
|
Oops, something went wrong.