haystack-ml-stack 0.4.10__tar.gz → 0.4.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/PKG-INFO +1 -1
  2. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/pyproject.toml +1 -1
  3. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/_serializers.py +16 -2
  4. haystack_ml_stack-0.4.12/src/haystack_ml_stack/_version.py +1 -0
  5. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/dynamo.py +7 -12
  6. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/utils.py +0 -1
  7. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack.egg-info/PKG-INFO +1 -1
  8. haystack_ml_stack-0.4.10/src/haystack_ml_stack/_version.py +0 -1
  9. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/README.md +0 -0
  10. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/setup.cfg +0 -0
  11. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/__init__.py +0 -0
  12. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/_kafka.py +0 -0
  13. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/app.py +0 -0
  14. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/cache.py +0 -0
  15. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/exceptions.py +0 -0
  16. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/generated/__init__.py +0 -0
  17. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/generated/v1/__init__.py +0 -0
  18. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/generated/v1/features_pb2.py +0 -0
  19. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/generated/v1/features_pb2.pyi +0 -0
  20. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/model_store.py +0 -0
  21. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack/settings.py +0 -0
  22. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack.egg-info/SOURCES.txt +0 -0
  23. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack.egg-info/dependency_links.txt +0 -0
  24. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack.egg-info/requires.txt +0 -0
  25. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/src/haystack_ml_stack.egg-info/top_level.txt +0 -0
  26. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/tests/test_serializers.py +0 -0
  27. {haystack_ml_stack-0.4.10 → haystack_ml_stack-0.4.12}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haystack-ml-stack
3
- Version: 0.4.10
3
+ Version: 0.4.12
4
4
  Summary: Functions related to Haystack ML
5
5
  Author-email: Oscar Vega <oscar@haystack.tv>
6
6
  License: MIT
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "haystack-ml-stack"
8
- version = "0.4.10"
8
+ version = "0.4.12"
9
9
  description = "Functions related to Haystack ML"
10
10
  readme = "README.md"
11
11
  authors = [{ name = "Oscar Vega", email = "oscar@haystack.tv" }]
@@ -249,7 +249,9 @@ class GlobalPlaylistStatsSerializerV1(SimpleSerializer):
249
249
  category_msg.watched_count = int(stats["watched_count"])
250
250
  category_msg.not_watched_count = int(stats["not_watched_count"])
251
251
  category_msg.capped_watched_secs = float(stats["capped_watched_secs"])
252
- category_msg.capped_not_watched_secs = float(stats["capped_not_watched_secs"])
252
+ category_msg.capped_not_watched_secs = float(
253
+ stats["capped_not_watched_secs"]
254
+ )
253
255
  category_msg.watched_secs = float(stats["watched_secs"])
254
256
  category_msg.not_watched_secs = float(stats["not_watched_secs"])
255
257
  return root_msg
@@ -275,7 +277,9 @@ class UserPlaylistStatsSerializerV1(SimpleSerializer):
275
277
  category_msg.active_days = int(stats["active_days"])
276
278
  category_msg.total_watched = float(stats["total_watched"])
277
279
  category_msg.capped_total_watched = float(stats["capped_total_watched"])
278
- category_msg.capped_total_log_watched = float(stats.get("capped_total_log_watched", 0.0))
280
+ category_msg.capped_total_log_watched = float(
281
+ stats.get("capped_total_log_watched", 0.0)
282
+ )
279
283
  category_msg.first_active_date = str(stats.get("first_active_date", ""))
280
284
  return root_msg
281
285
 
@@ -344,6 +348,11 @@ stream_pwatched_v1_features: list[FeatureRegistryId] = [
344
348
  FeatureRegistryId(
345
349
  entity_type="STREAM", feature_id="PWATCHED#24H#MOBILE", version="v1"
346
350
  ),
351
+ FeatureRegistryId(entity_type="STREAM", feature_id="PWATCHED#6H", version="v1"),
352
+ FeatureRegistryId(entity_type="STREAM", feature_id="PWATCHED#6H#TV", version="v1"),
353
+ FeatureRegistryId(
354
+ entity_type="STREAM", feature_id="PWATCHED#6H#MOBILE", version="v1"
355
+ ),
347
356
  ]
348
357
 
349
358
  stream_pselect_v0_features: list[FeatureRegistryId] = [
@@ -360,6 +369,11 @@ stream_pselect_v1_features: list[FeatureRegistryId] = [
360
369
  entity_type="STREAM", feature_id="PSELECT#24H#MOBILE", version="v1"
361
370
  ),
362
371
  FeatureRegistryId(entity_type="STREAM", feature_id="PSELECT#24H#TV", version="v1"),
372
+ FeatureRegistryId(entity_type="STREAM", feature_id="PSELECT#6H", version="v1"),
373
+ FeatureRegistryId(entity_type="STREAM", feature_id="PSELECT#6H#TV", version="v1"),
374
+ FeatureRegistryId(
375
+ entity_type="STREAM", feature_id="PSELECT#6H#MOBILE", version="v1"
376
+ ),
363
377
  ]
364
378
 
365
379
  stream_similarity_v0_features: list[FeatureRegistryId] = [
@@ -0,0 +1 @@
1
+ __version__ = "0.4.12"
@@ -495,13 +495,6 @@ def _process_channels(
495
495
  "USER_" + k.replace("#", "_"): v for k, v in user.items() if k in user_features
496
496
  }
497
497
 
498
- all_channels = set()
499
- if playlist_stats_global:
500
- for stat in playlist_stats_global.values():
501
- all_channels.update(stat.data.keys())
502
-
503
- all_channels = all_channels | set(DEFAULT_CHANNELS)
504
-
505
498
  # My headlines and local news will stay on top so not part of the candidates
506
499
  # watch history and liked videos are always part of the bottom also
507
500
  # The group labels are also ignored, not real channels for UI
@@ -512,13 +505,15 @@ def _process_channels(
512
505
  channel_eligibility = channel_features.get("eligibility", {})
513
506
  channel_feature_predicates = channel_features.get("features", {})
514
507
 
508
+ # Eligibility rules
509
+ for name in channel_eligibility:
510
+ if not channel_eligibility[name]:
511
+ ignore_channels.add(name)
512
+
515
513
  inserted_channel_names = set()
516
514
  if channel_candidates is not None:
517
515
  preferred = set(user.get("preferredChannels", []) or [])
518
516
  for ch in channel_candidates.data:
519
- # Eligibility rules
520
- if not channel_eligibility.get(ch.name, True):
521
- ignore_channels.add(ch.name)
522
517
  # Feature predicate rules for special channels
523
518
  if ch.required_features and not all(channel_feature_predicates.get(f, False) for f in ch.required_features):
524
519
  ignore_channels.add(ch.name)
@@ -543,13 +538,13 @@ def _process_channels(
543
538
  )
544
539
  inserted_channel_names.add(ch.name)
545
540
 
546
- for name in all_channels:
541
+ for name in DEFAULT_CHANNELS:
547
542
  if name not in ignore_channels and name not in inserted_channel_names:
548
543
  channels.append(
549
544
  {
550
545
  "name": name,
551
546
  "category_group": "",
552
- "start_date": int(datetime.datetime.now().timestamp()),
547
+ "start_date": int(datetime.datetime(2020, 1, 1).timestamp()),
553
548
  }
554
549
  )
555
550
 
@@ -680,7 +680,6 @@ def _validate_pwatched_entry_context(entry_contexts: list[str]):
680
680
 
681
681
 
682
682
  DEFAULT_CHANNELS = [
683
- "local news",
684
683
  "science & technology",
685
684
  "business & finance",
686
685
  "entertainment news",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haystack-ml-stack
3
- Version: 0.4.10
3
+ Version: 0.4.12
4
4
  Summary: Functions related to Haystack ML
5
5
  Author-email: Oscar Vega <oscar@haystack.tv>
6
6
  License: MIT
@@ -1 +0,0 @@
1
- __version__ = "0.4.10"