libinephany 0.16.0__tar.gz → 0.16.1__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 (65) hide show
  1. libinephany-0.16.1/CODE_VERSION.cfg +1 -0
  2. {libinephany-0.16.0/libinephany.egg-info → libinephany-0.16.1}/PKG-INFO +1 -1
  3. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/observation_utils.py +14 -3
  4. {libinephany-0.16.0 → libinephany-0.16.1/libinephany.egg-info}/PKG-INFO +1 -1
  5. libinephany-0.16.0/CODE_VERSION.cfg +0 -1
  6. {libinephany-0.16.0 → libinephany-0.16.1}/LICENSE +0 -0
  7. {libinephany-0.16.0 → libinephany-0.16.1}/MANIFEST.in +0 -0
  8. {libinephany-0.16.0 → libinephany-0.16.1}/README.md +0 -0
  9. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/__init__.py +0 -0
  10. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/aws/__init__.py +0 -0
  11. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/aws/s3_functions.py +0 -0
  12. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/__init__.py +0 -0
  13. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/observer_pipeline.py +0 -0
  14. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/observers/__init__.py +0 -0
  15. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/observers/base_observers.py +0 -0
  16. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/observers/global_observers.py +0 -0
  17. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/observers/local_observers.py +0 -0
  18. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/observers/observer_containers.py +0 -0
  19. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/pipeline_coordinator.py +0 -0
  20. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/post_processors/__init__.py +0 -0
  21. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/post_processors/postprocessors.py +0 -0
  22. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/statistic_manager.py +0 -0
  23. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/observations/statistic_trackers.py +0 -0
  24. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/__init__.py +0 -0
  25. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/configs/__init__.py +0 -0
  26. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/configs/hyperparameter_configs.py +0 -0
  27. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/configs/observer_config.py +0 -0
  28. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/configs/outer_model_config.py +0 -0
  29. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/schemas/__init__.py +0 -0
  30. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/schemas/agent_info.py +0 -0
  31. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/schemas/inner_task_profile.py +0 -0
  32. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/schemas/observation_models.py +0 -0
  33. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/schemas/request_schemas.py +0 -0
  34. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/schemas/response_schemas.py +0 -0
  35. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/schemas/tensor_statistics.py +0 -0
  36. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/states/__init__.py +0 -0
  37. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/pydantic_models/states/hyperparameter_states.py +0 -0
  38. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/__init__.py +0 -0
  39. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/agent_utils.py +0 -0
  40. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/asyncio_worker.py +0 -0
  41. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/backend_statuses.py +0 -0
  42. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/constants.py +0 -0
  43. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/directory_utils.py +0 -0
  44. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/dropout_utils.py +0 -0
  45. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/enums.py +0 -0
  46. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/error_severities.py +0 -0
  47. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/exceptions.py +0 -0
  48. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/import_utils.py +0 -0
  49. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/optim_utils.py +0 -0
  50. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/random_seeds.py +0 -0
  51. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/samplers.py +0 -0
  52. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/standardizers.py +0 -0
  53. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/torch_distributed_utils.py +0 -0
  54. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/torch_utils.py +0 -0
  55. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/transforms.py +0 -0
  56. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/utils/typing.py +0 -0
  57. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/web_apps/__init__.py +0 -0
  58. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/web_apps/error_logger.py +0 -0
  59. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany/web_apps/web_app_utils.py +0 -0
  60. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany.egg-info/SOURCES.txt +0 -0
  61. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany.egg-info/dependency_links.txt +0 -0
  62. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany.egg-info/requires.txt +0 -0
  63. {libinephany-0.16.0 → libinephany-0.16.1}/libinephany.egg-info/top_level.txt +0 -0
  64. {libinephany-0.16.0 → libinephany-0.16.1}/pyproject.toml +0 -0
  65. {libinephany-0.16.0 → libinephany-0.16.1}/setup.cfg +0 -0
@@ -0,0 +1 @@
1
+ 0.16.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libinephany
3
- Version: 0.16.0
3
+ Version: 0.16.1
4
4
  Summary: Inephany library containing code commonly used by multiple subpackages.
5
5
  Author-email: Inephany <info@inephany.com>
6
6
  License: Apache 2.0
@@ -4,6 +4,7 @@
4
4
  #
5
5
  # ======================================================================================================================
6
6
 
7
+ import math
7
8
  from enum import Enum
8
9
  from itertools import chain
9
10
  from typing import Any, Callable
@@ -54,15 +55,25 @@ class StatisticStorageTypes(Enum):
54
55
  # ======================================================================================================================
55
56
 
56
57
 
57
- def get_exponential_weighted_average(values: list[float]) -> float:
58
+ def get_exponential_weighted_average(values: list[int | float]) -> float:
58
59
  """
59
60
  :param values: List of values to average via EWA.
60
61
  :return: EWA of the given values.
61
62
  """
62
63
 
63
- exp_weighted_average = pd.Series(values).ewm(alpha=0.1).mean().iloc[-1]
64
- assert isinstance(exp_weighted_average, float)
64
+ # Check for NaN and infinite values in input
65
+ valid_values = [float(val) for val in values if not math.isnan(float(val)) and not math.isinf(float(val))]
66
+
67
+ if not valid_values:
68
+ raise ValueError("Cannot compute exponential weighted average on empty list")
65
69
 
70
+ if len(valid_values) == 1:
71
+ return valid_values[0]
72
+
73
+ exp_weighted_average = pd.Series(valid_values).ewm(alpha=0.1).mean().iloc[-1]
74
+ assert isinstance(exp_weighted_average, float)
75
+ assert not math.isnan(exp_weighted_average)
76
+ assert not math.isinf(exp_weighted_average)
66
77
  return exp_weighted_average
67
78
 
68
79
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libinephany
3
- Version: 0.16.0
3
+ Version: 0.16.1
4
4
  Summary: Inephany library containing code commonly used by multiple subpackages.
5
5
  Author-email: Inephany <info@inephany.com>
6
6
  License: Apache 2.0
@@ -1 +0,0 @@
1
- 0.16.0
File without changes
File without changes
File without changes
File without changes