libinephany 0.13.2__tar.gz → 0.13.5__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 (68) hide show
  1. libinephany-0.13.5/CODE_VERSION.cfg +1 -0
  2. libinephany-0.13.5/LICENSE +180 -0
  3. {libinephany-0.13.2 → libinephany-0.13.5}/MANIFEST.in +1 -1
  4. {libinephany-0.13.2/libinephany.egg-info → libinephany-0.13.5}/PKG-INFO +25 -34
  5. {libinephany-0.13.2 → libinephany-0.13.5}/README.md +11 -28
  6. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/observers/global_observers.py +2 -1
  7. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/statistic_manager.py +8 -0
  8. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/statistic_trackers.py +8 -0
  9. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/configs/hyperparameter_configs.py +22 -0
  10. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/states/hyperparameter_states.py +21 -5
  11. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/constants.py +1 -0
  12. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/enums.py +2 -0
  13. {libinephany-0.13.2 → libinephany-0.13.5/libinephany.egg-info}/PKG-INFO +25 -34
  14. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany.egg-info/SOURCES.txt +0 -2
  15. {libinephany-0.13.2 → libinephany-0.13.5}/pyproject.toml +17 -4
  16. libinephany-0.13.2/CODE_VERSION.cfg +0 -1
  17. libinephany-0.13.2/LICENSE +0 -13
  18. libinephany-0.13.2/requirements.txt +0 -16
  19. libinephany-0.13.2/setup.py +0 -61
  20. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/__init__.py +0 -0
  21. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/aws/__init__.py +0 -0
  22. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/aws/s3_functions.py +0 -0
  23. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/__init__.py +0 -0
  24. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/observation_utils.py +0 -0
  25. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/observer_pipeline.py +0 -0
  26. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/observers/__init__.py +0 -0
  27. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/observers/base_observers.py +0 -0
  28. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/observers/local_observers.py +0 -0
  29. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/observers/observer_containers.py +0 -0
  30. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/pipeline_coordinator.py +0 -0
  31. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/post_processors/__init__.py +0 -0
  32. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/observations/post_processors/postprocessors.py +0 -0
  33. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/__init__.py +0 -0
  34. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/configs/__init__.py +0 -0
  35. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/configs/observer_config.py +0 -0
  36. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/configs/outer_model_config.py +0 -0
  37. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/schemas/__init__.py +0 -0
  38. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/schemas/agent_info.py +0 -0
  39. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/schemas/inner_task_profile.py +0 -0
  40. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/schemas/observation_models.py +0 -0
  41. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/schemas/request_schemas.py +0 -0
  42. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/schemas/response_schemas.py +0 -0
  43. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/schemas/tensor_statistics.py +0 -0
  44. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/pydantic_models/states/__init__.py +0 -0
  45. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/__init__.py +0 -0
  46. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/agent_utils.py +0 -0
  47. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/asyncio_worker.py +0 -0
  48. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/backend_statuses.py +0 -0
  49. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/directory_utils.py +0 -0
  50. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/dropout_utils.py +0 -0
  51. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/error_severities.py +0 -0
  52. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/exceptions.py +0 -0
  53. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/import_utils.py +0 -0
  54. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/optim_utils.py +0 -0
  55. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/random_seeds.py +0 -0
  56. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/samplers.py +0 -0
  57. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/standardizers.py +0 -0
  58. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/torch_distributed_utils.py +0 -0
  59. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/torch_utils.py +0 -0
  60. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/transforms.py +0 -0
  61. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/utils/typing.py +0 -0
  62. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/web_apps/__init__.py +0 -0
  63. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/web_apps/error_logger.py +0 -0
  64. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany/web_apps/web_app_utils.py +0 -0
  65. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany.egg-info/dependency_links.txt +0 -0
  66. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany.egg-info/requires.txt +3 -3
  67. {libinephany-0.13.2 → libinephany-0.13.5}/libinephany.egg-info/top_level.txt +0 -0
  68. {libinephany-0.13.2 → libinephany-0.13.5}/setup.cfg +0 -0
@@ -0,0 +1 @@
1
+ 0.13.5
@@ -0,0 +1,180 @@
1
+ Copyright 2025 Inephany Ltd
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+
5
+ Apache License
6
+ Version 2.0, January 2004
7
+ http://www.apache.org/licenses/
8
+
9
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
10
+
11
+ 1. Definitions.
12
+
13
+ "License" shall mean the terms and conditions for use, reproduction,
14
+ and distribution as defined by Sections 1 through 9 of this document.
15
+
16
+ "Licensor" shall mean the copyright owner or entity authorized by
17
+ the copyright owner that is granting the License.
18
+
19
+ "Legal Entity" shall mean the union of the acting entity and all
20
+ other entities that control, are controlled by, or are under common
21
+ control with that entity. For the purposes of this definition,
22
+ "control" means (i) the power, direct or indirect, to cause the
23
+ direction or management of such entity, whether by contract or
24
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
25
+ outstanding shares, or (iii) beneficial ownership of such entity.
26
+
27
+ "You" (or "Your") shall mean an individual or Legal Entity
28
+ exercising permissions granted by this License.
29
+
30
+ "Source" form shall mean the preferred form for making modifications,
31
+ including but not limited to software source code, documentation
32
+ source, and configuration files.
33
+
34
+ "Object" form shall mean any form resulting from mechanical
35
+ transformation or translation of a Source form, including but
36
+ not limited to compiled object code, generated documentation,
37
+ and conversions to other media types.
38
+
39
+ "Work" shall mean the work of authorship, whether in Source or
40
+ Object form, made available under the License, as indicated by a
41
+ copyright notice that is included in or attached to the work
42
+ (an example is provided in the Appendix below).
43
+
44
+ "Derivative Works" shall mean any work, whether in Source or Object
45
+ form, that is based on (or derived from) the Work and for which the
46
+ editorial revisions, annotations, elaborations, or other modifications
47
+ represent, as a whole, an original work of authorship. For the purposes
48
+ of this License, Derivative Works shall not include works that remain
49
+ separable from, or merely link (or bind by name) to the interfaces of,
50
+ the Work and Derivative Works thereof.
51
+
52
+ "Contribution" shall mean any work of authorship, including
53
+ the original version of the Work and any modifications or additions
54
+ to that Work or Derivative Works thereof, that is intentionally
55
+ submitted to Licensor for inclusion in the Work by the copyright owner
56
+ or by an individual or Legal Entity authorized to submit on behalf of
57
+ the copyright owner. For the purposes of this definition, "submitted"
58
+ means any form of electronic, verbal, or written communication sent
59
+ to the Licensor or its representatives, including but not limited to
60
+ communication on electronic mailing lists, source code control systems,
61
+ and issue tracking systems that are managed by, or on behalf of, the
62
+ Licensor for the purpose of discussing and improving the Work, but
63
+ excluding communication that is conspicuously marked or otherwise
64
+ designated in writing by the copyright owner as "Not a Contribution."
65
+
66
+ "Contributor" shall mean Licensor and any individual or Legal Entity
67
+ on behalf of whom a Contribution has been received by Licensor and
68
+ subsequently incorporated within the Work.
69
+
70
+ 2. Grant of Copyright License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ copyright license to reproduce, prepare Derivative Works of,
74
+ publicly display, publicly perform, sublicense, and distribute the
75
+ Work and such Derivative Works in Source or Object form.
76
+
77
+ 3. Grant of Patent License. Subject to the terms and conditions of
78
+ this License, each Contributor hereby grants to You a perpetual,
79
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
80
+ (except as stated in this section) patent license to make, have made,
81
+ use, offer to sell, sell, import, and otherwise transfer the Work,
82
+ where such license applies only to those patent claims licensable
83
+ by such Contributor that are necessarily infringed by their
84
+ Contribution(s) alone or by combination of their Contribution(s)
85
+ with the Work to which such Contribution(s) was submitted. If You
86
+ institute patent litigation against any entity (including a
87
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
88
+ or a Contribution incorporated within the Work constitutes direct
89
+ or contributory patent infringement, then any patent licenses
90
+ granted to You under this License for that Work shall terminate
91
+ as of the date such litigation is filed.
92
+
93
+ 4. Redistribution. You may reproduce and distribute copies of the
94
+ Work or Derivative Works thereof in any medium, with or without
95
+ modifications, and in Source or Object form, provided that You
96
+ meet the following conditions:
97
+
98
+ (a) You must give any other recipients of the Work or
99
+ Derivative Works a copy of this License; and
100
+
101
+ (b) You must cause any modified files to carry prominent notices
102
+ stating that You changed the files; and
103
+
104
+ (c) You must retain, in the Source form of any Derivative Works
105
+ that You distribute, all copyright, patent, trademark, and
106
+ attribution notices from the Source form of the Work,
107
+ excluding those notices that do not pertain to any part of
108
+ the Derivative Works; and
109
+
110
+ (d) If the Work includes a "NOTICE" text file as part of its
111
+ distribution, then any Derivative Works that You distribute must
112
+ include a readable copy of the attribution notices contained
113
+ within such NOTICE file, excluding those notices that do not
114
+ pertain to any part of the Derivative Works, in at least one
115
+ of the following places: within a NOTICE text file distributed
116
+ as part of the Derivative Works; within the Source form or
117
+ documentation, if provided along with the Derivative Works; or,
118
+ within a display generated by the Derivative Works, if and
119
+ wherever such third-party notices normally appear. The contents
120
+ of the NOTICE file are for informational purposes only and
121
+ do not modify the License. You may add Your own attribution
122
+ notices within Derivative Works that You distribute, alongside
123
+ or as an addendum to the NOTICE text from the Work, provided
124
+ that such additional attribution notices cannot be construed
125
+ as modifying the License.
126
+
127
+ You may add Your own copyright statement to Your modifications and
128
+ may provide additional or different license terms and conditions
129
+ for use, reproduction, or distribution of Your modifications, or
130
+ for any such Derivative Works as a whole, provided Your use,
131
+ reproduction, and distribution of the Work otherwise complies with
132
+ the conditions stated in this License.
133
+
134
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
135
+ any Contribution intentionally submitted for inclusion in the Work
136
+ by You to the Licensor shall be under the terms and conditions of
137
+ this License, without any additional terms or conditions.
138
+ Notwithstanding the above, nothing herein shall supersede or modify
139
+ the terms of any separate license agreement you may have executed
140
+ with Licensor regarding such Contributions.
141
+
142
+ 6. Trademarks. This License does not grant permission to use the trade
143
+ names, trademarks, service marks, or product names of the Licensor,
144
+ except as required for reasonable and customary use in describing the
145
+ origin of the Work and reproducing the content of the NOTICE file.
146
+
147
+ 7. Disclaimer of Warranty. Unless required by applicable law or
148
+ agreed to in writing, Licensor provides the Work (and each
149
+ Contributor provides its Contributions) on an "AS IS" BASIS,
150
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
151
+ implied, including, without limitation, any warranties or conditions
152
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
153
+ PARTICULAR PURPOSE. You are solely responsible for determining the
154
+ appropriateness of using or redistributing the Work and assume any
155
+ risks associated with Your exercise of permissions under this License.
156
+
157
+ 8. Limitation of Liability. In no event and under no legal theory,
158
+ whether in tort (including negligence), contract, or otherwise,
159
+ unless required by applicable law (such as deliberate and grossly
160
+ negligent acts) or agreed to in writing, shall any Contributor be
161
+ liable to You for damages, including any direct, indirect, special,
162
+ incidental, or consequential damages of any character arising as a
163
+ result of this License or out of the use or inability to use the
164
+ Work (including but not limited to damages for loss of goodwill,
165
+ work stoppage, computer failure or malfunction, or any and all
166
+ other commercial damages or losses), even if such Contributor
167
+ has been advised of the possibility of such damages.
168
+
169
+ 9. Accepting Warranty or Additional Liability. While redistributing
170
+ the Work or Derivative Works thereof, You may choose to offer,
171
+ and charge a fee for, acceptance of support, warranty, indemnity,
172
+ or other liability obligations and/or rights consistent with this
173
+ License. However, in accepting such obligations, You may act only
174
+ on Your own behalf and on Your sole responsibility, not on behalf
175
+ of any other Contributor, and only if You agree to indemnify,
176
+ defend, and hold each Contributor harmless for any liability
177
+ incurred by, or claims asserted against, such Contributor by reason
178
+ of your accepting any such warranty or additional liability.
179
+
180
+ END OF TERMS AND CONDITIONS
@@ -1,7 +1,7 @@
1
1
  include CODE_VERSION.cfg
2
- include requirements.txt
3
2
  include README.md
4
3
  include LICENSE
4
+ include pyproject.toml
5
5
  recursive-include libinephany *.py
6
6
  recursive-exclude * __pycache__
7
7
  recursive-exclude * *.py[co]
@@ -1,13 +1,19 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libinephany
3
- Version: 0.13.2
3
+ Version: 0.13.5
4
4
  Summary: Inephany library containing code commonly used by multiple subpackages.
5
- Requires-Python: >=3.6
5
+ Author-email: Inephany <info@inephany.com>
6
+ License: Apache 2.0
7
+ Keywords: libinephany,library,utilities
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Python: >=3.10
6
15
  Description-Content-Type: text/markdown
7
16
  License-File: LICENSE
8
- Requires-Dist: pytest<9.0.0,>=7.0.0
9
- Requires-Dist: pytest-mock<4.0.0,>=3.10.0
10
- Requires-Dist: pytest-asyncio<0.26.0,>=0.21.0
11
17
  Requires-Dist: pydantic<3.0.0,>=2.5.0
12
18
  Requires-Dist: loguru<0.8.0,>=0.7.0
13
19
  Requires-Dist: requests<3.0.0,>=2.28.0
@@ -22,6 +28,9 @@ Requires-Dist: pandas<3.0.0,>=2.0.0
22
28
  Requires-Dist: accelerate<2.0.0,>=0.20.0
23
29
  Requires-Dist: gymnasium<2.0.0,>=0.29.0
24
30
  Provides-Extra: dev
31
+ Requires-Dist: pytest<9.0.0,>=7.0.0; extra == "dev"
32
+ Requires-Dist: pytest-mock<4.0.0,>=3.10.0; extra == "dev"
33
+ Requires-Dist: pytest-asyncio<0.26.0,>=0.21.0; extra == "dev"
25
34
  Requires-Dist: bump-my-version==0.11.0; extra == "dev"
26
35
  Requires-Dist: black==24.4.2; extra == "dev"
27
36
  Requires-Dist: isort==5.9.3; extra == "dev"
@@ -31,7 +40,6 @@ Requires-Dist: mypy==1.13.0; extra == "dev"
31
40
  Requires-Dist: types-PyYAML==6.0.12.20240808; extra == "dev"
32
41
  Requires-Dist: typeguard==4.3.0; extra == "dev"
33
42
  Dynamic: license-file
34
- Dynamic: requires-python
35
43
 
36
44
  # Inephany Common Library
37
45
 
@@ -50,20 +58,19 @@ The Inephany Common Library (`libinephany`) is a core utility package that provi
50
58
 
51
59
  ### Prerequisites
52
60
 
53
- - Python 3.12+
61
+ - Python 3.10+
54
62
  - Make (for build automation)
55
63
 
56
64
  #### Ubuntu / Debian
57
65
  ```bash
58
66
  sudo add-apt-repository ppa:deadsnakes/ppa
59
67
  sudo apt update
60
- sudo apt install python3.12 make
68
+ sudo apt install python3.12
61
69
  ```
62
70
 
63
71
  #### MacOS with brew
64
72
  ```bash
65
73
  brew install python@3.12
66
- brew install make
67
74
  ```
68
75
 
69
76
  ### For Developers (Monorepo)
@@ -72,33 +79,17 @@ If you're working within the Inephany monorepo, the package is already available
72
79
 
73
80
  ### For Clients (Standalone Installation)
74
81
 
75
- Since `libinephany` is not yet published on PyPI, you'll need to build and install it manually from source. Follow these steps:
82
+ `libinephany` is available on PyPI and can be installed directly:
76
83
 
77
- 1. **Create a new virtual environment**
78
- ```bash
79
- python3.12 -m venv myenv
80
- ```
81
-
82
- 2. **Activate the virtual environment**
83
- ```bash
84
- source myenv/bin/activate
85
- ```
86
-
87
- 3. **Install Build Tools**
88
- ```bash
89
- python -m pip install --upgrade pip setuptools build wheel
90
- ```
84
+ ```bash
85
+ pip install libinephany
86
+ ```
91
87
 
92
- 4. **Change into the `libinephany` directory**
88
+ For development installations with additional dependencies:
93
89
 
94
- 5. **Build and install `libinephany`**
95
- ```bash
96
- python -m build
97
- pip install dist/libinephany-<version>-py3-none-any.whl
98
- ```
99
- Replace `<version>` with the actual version number of the built wheel.
100
-
101
- **Note**: Once `libinephany` is published to PyPI, you'll be able to install it with `pip install libinephany`.
90
+ ```bash
91
+ pip install libinephany[dev]
92
+ ```
102
93
 
103
94
  ## Key Components
104
95
 
@@ -279,4 +270,4 @@ When contributing to `libinephany`:
279
270
 
280
271
  ## License
281
272
 
282
- This package is part of the Inephany ecosystem and is subject to the same licensing terms as other Inephany packages.
273
+ This package is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
@@ -15,20 +15,19 @@ The Inephany Common Library (`libinephany`) is a core utility package that provi
15
15
 
16
16
  ### Prerequisites
17
17
 
18
- - Python 3.12+
18
+ - Python 3.10+
19
19
  - Make (for build automation)
20
20
 
21
21
  #### Ubuntu / Debian
22
22
  ```bash
23
23
  sudo add-apt-repository ppa:deadsnakes/ppa
24
24
  sudo apt update
25
- sudo apt install python3.12 make
25
+ sudo apt install python3.12
26
26
  ```
27
27
 
28
28
  #### MacOS with brew
29
29
  ```bash
30
30
  brew install python@3.12
31
- brew install make
32
31
  ```
33
32
 
34
33
  ### For Developers (Monorepo)
@@ -37,33 +36,17 @@ If you're working within the Inephany monorepo, the package is already available
37
36
 
38
37
  ### For Clients (Standalone Installation)
39
38
 
40
- Since `libinephany` is not yet published on PyPI, you'll need to build and install it manually from source. Follow these steps:
39
+ `libinephany` is available on PyPI and can be installed directly:
41
40
 
42
- 1. **Create a new virtual environment**
43
- ```bash
44
- python3.12 -m venv myenv
45
- ```
46
-
47
- 2. **Activate the virtual environment**
48
- ```bash
49
- source myenv/bin/activate
50
- ```
51
-
52
- 3. **Install Build Tools**
53
- ```bash
54
- python -m pip install --upgrade pip setuptools build wheel
55
- ```
41
+ ```bash
42
+ pip install libinephany
43
+ ```
56
44
 
57
- 4. **Change into the `libinephany` directory**
45
+ For development installations with additional dependencies:
58
46
 
59
- 5. **Build and install `libinephany`**
60
- ```bash
61
- python -m build
62
- pip install dist/libinephany-<version>-py3-none-any.whl
63
- ```
64
- Replace `<version>` with the actual version number of the built wheel.
65
-
66
- **Note**: Once `libinephany` is published to PyPI, you'll be able to install it with `pip install libinephany`.
47
+ ```bash
48
+ pip install libinephany[dev]
49
+ ```
67
50
 
68
51
  ## Key Components
69
52
 
@@ -244,4 +227,4 @@ When contributing to `libinephany`:
244
227
 
245
228
  ## License
246
229
 
247
- This package is part of the Inephany ecosystem and is subject to the same licensing terms as other Inephany packages.
230
+ This package is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
@@ -929,8 +929,9 @@ class ModelFamilyOneHot(GlobalObserver):
929
929
  """
930
930
 
931
931
  family_name = self.observer_config.nn_family_name
932
+ known_name = family_name in (family.value for family in ModelFamilies)
932
933
 
933
- if family_name in ModelFamilies:
934
+ if known_name:
934
935
  family_idx = ModelFamilies.get_index(family_name)
935
936
 
936
937
  else:
@@ -64,6 +64,14 @@ class StatisticManager:
64
64
  self.tensor_stats_downsample_percentage = tensor_stats_downsample_percentage
65
65
  self.statistic_sample_frequency = statistic_sample_frequency
66
66
 
67
+ @property
68
+ def requires_gradient_graphs(self) -> bool:
69
+ """
70
+ :return: Whether the manager requires gradient graphs to be retained.
71
+ """
72
+
73
+ return any(tracker.requires_gradient_graphs for tracker in self._trackers.values())
74
+
67
75
  @staticmethod
68
76
  def _nullify_gradients(model: nn.Module) -> None:
69
77
  """
@@ -438,6 +438,14 @@ class SecondOrderGradients(Statistic):
438
438
  self.compute_hessian_diagonal = compute_hessian_diagonal
439
439
  self.skip_statistics = skip_statistics
440
440
 
441
+ @property
442
+ def requires_gradient_graphs(self) -> bool:
443
+ """
444
+ :return: Whether the statistic requires gradient graphs to be retained.
445
+ """
446
+
447
+ return self.compute_hessian_diagonal
448
+
441
449
  def _get_storage_format(self) -> StatisticStorageTypes:
442
450
  """
443
451
  :return: Storage format this observation stores data in. Must be one of the enum attributes in the
@@ -262,6 +262,21 @@ class TokensHParamConfig(HParamConfig):
262
262
  sample_step: int = int(1e6)
263
263
 
264
264
 
265
+ class SamplesHParamConfig(HParamConfig):
266
+ max_hparam_value: float | int = 1e9
267
+ min_hparam_value: float | int = 1e4
268
+ hparam_dtype: type[float | int] = int
269
+ initial_value: int = int(1e5)
270
+ initial_delta: float = 0.0
271
+ scale: float = 1.0
272
+
273
+ sampler: str = "DiscreteRangeSampler"
274
+ sample_initial_values: bool = False
275
+ sample_lower_bound: int = int(1e4)
276
+ sample_upper_bound: int = int(1e7)
277
+ sample_step: int = int(1e4)
278
+
279
+
265
280
  class HParamConfigs(BaseModel):
266
281
 
267
282
  learning_rate_config: HParamConfig = LearningRateHParamConfig()
@@ -276,6 +291,7 @@ class HParamConfigs(BaseModel):
276
291
  batch_size_config: HParamConfig = BatchSizeHParamConfig()
277
292
  epochs_config: HParamConfig = EpochsHParamConfig()
278
293
  token_config: HParamConfig = TokensHParamConfig()
294
+ samples_config: HParamConfig = SamplesHParamConfig()
279
295
 
280
296
  def override(self, overrides: dict[str, dict[str, Any]] | None) -> None:
281
297
  """
@@ -337,6 +353,9 @@ class HParamConfigs(BaseModel):
337
353
  case AgentTypes.Tokens:
338
354
  self.token_config = hparam_config
339
355
 
356
+ case AgentTypes.Samples:
357
+ self.samples_config = hparam_config
358
+
340
359
  case _:
341
360
  raise ValueError(f"Unknown agent type: {agent_type.value}.")
342
361
 
@@ -383,5 +402,8 @@ class HParamConfigs(BaseModel):
383
402
  case AgentTypes.Tokens:
384
403
  return self.token_config
385
404
 
405
+ case AgentTypes.Samples:
406
+ return self.samples_config
407
+
386
408
  case _:
387
409
  raise ValueError(f"Unknown agent type: {agent_type.value}.")
@@ -21,6 +21,7 @@ from libinephany.utils.constants import (
21
21
  EPOCHS,
22
22
  GRAD_NORM_CLIP,
23
23
  LEARNING_RATE,
24
+ SAMPLES,
24
25
  SGD_MOMENTUM,
25
26
  TOKENS,
26
27
  WEIGHT_DECAY,
@@ -164,7 +165,7 @@ class Hyperparameter(BaseModel):
164
165
  @external_value.setter
165
166
  def external_value(self, new_external_value: float | int | None) -> None:
166
167
  """
167
- :param new_value: New external value to set the hyperparameter to.
168
+ :param new_external_value: New external value to set the hyperparameter to.
168
169
  """
169
170
 
170
171
  if new_external_value is None:
@@ -183,7 +184,7 @@ class Hyperparameter(BaseModel):
183
184
  @internal_value.setter
184
185
  def internal_value(self, new_internal_value: float | int | None) -> None:
185
186
  """
186
- :param new_value: New internal value to set the hyperparameter to.
187
+ :param new_internal_value: New internal value to set the hyperparameter to.
187
188
  """
188
189
 
189
190
  self.current_internal_value = new_internal_value
@@ -221,7 +222,7 @@ class Hyperparameter(BaseModel):
221
222
 
222
223
  def set_sampled_initial_value(self, initial_external_value: float | int | None) -> None:
223
224
  """
224
- :param sample_external_value: Sampled external value to set the hyperparameter to.
225
+ :param initial_external_value: Sampled external value to set the hyperparameter to.
225
226
  """
226
227
 
227
228
  if initial_external_value is None:
@@ -312,7 +313,8 @@ class HyperparameterContainer(BaseModel):
312
313
  self, sample_initial_external_values: dict[str, np.ndarray | float | int | None]
313
314
  ) -> None:
314
315
  """
315
- :param samples: Dictionary mapping hyperparameter names to newly sampled initial external values.
316
+ :param sample_initial_external_values: Dictionary mapping hyperparameter names to newly sampled initial
317
+ external values.
316
318
  """
317
319
 
318
320
  for hyperparameter_name, initial_external_value in sample_initial_external_values.items():
@@ -436,6 +438,7 @@ class GlobalHParams(HyperparameterContainer):
436
438
  batch_size: Hyperparameter
437
439
  epochs: Hyperparameter
438
440
  tokens: Hyperparameter
441
+ samples: Hyperparameter
439
442
 
440
443
  @classmethod
441
444
  def build(
@@ -489,6 +492,7 @@ class HyperparameterStates(BaseModel):
489
492
  global_hparams: GlobalHParams
490
493
  parameter_group_hparams: dict[str, ParameterGroupHParams] = {}
491
494
  initial_hyperparameter_internal_values: dict[str, float | int] = {}
495
+ initial_hyperparameter_external_values: dict[str, float | int] = {}
492
496
 
493
497
  batches_processed: int = 0
494
498
  tokens_processed: int = 0
@@ -513,7 +517,7 @@ class HyperparameterStates(BaseModel):
513
517
  if INITIAL_PREFIX in item:
514
518
  hyperparameter_name = item.replace(INITIAL_PREFIX, "")
515
519
 
516
- return self.initial_hyperparameter_internal_values[hyperparameter_name]
520
+ return self.initial_hyperparameter_external_values[hyperparameter_name]
517
521
 
518
522
  return super().__getattr__(item) # type: ignore
519
523
 
@@ -542,6 +546,15 @@ class HyperparameterStates(BaseModel):
542
546
 
543
547
  return self.global_hparams.tokens
544
548
 
549
+ @computed_field # type: ignore[misc]
550
+ @property
551
+ def samples(self) -> Hyperparameter:
552
+ """
553
+ :return: Samples hyperparameter.
554
+ """
555
+
556
+ return self.global_hparams.samples
557
+
545
558
  @property
546
559
  def max_tokens_to_process(self) -> int | None:
547
560
  """
@@ -602,6 +615,7 @@ class HyperparameterStates(BaseModel):
602
615
  hparam_samplers=hparam_samplers,
603
616
  global_hparams=global_hparams,
604
617
  initial_hyperparameter_internal_values=initial_hyperparameter_internal_values,
618
+ initial_hyperparameter_external_values=initial_hyperparameter_external_values,
605
619
  )
606
620
 
607
621
  inner_task_state.add_parameter_groups(parameter_group_names=parameter_group_names)
@@ -643,6 +657,7 @@ class HyperparameterStates(BaseModel):
643
657
  BATCH_SIZE: hparam_configs.batch_size_config,
644
658
  EPOCHS: hparam_configs.epochs_config,
645
659
  TOKENS: hparam_configs.token_config,
660
+ SAMPLES: hparam_configs.samples_config,
646
661
  }
647
662
 
648
663
  @staticmethod
@@ -774,6 +789,7 @@ class HyperparameterStates(BaseModel):
774
789
  hparam_configs=self.hparam_configs,
775
790
  )
776
791
 
792
+ self.initial_hyperparameter_external_values.update(external_value_samples) # type: ignore
777
793
  self.initial_hyperparameter_internal_values.update(internal_value_samples) # type: ignore
778
794
 
779
795
  def set_to_initial_values(self) -> None:
@@ -23,6 +23,7 @@ SGD_MOMENTUM = "sgd_momentum"
23
23
  BATCH_SIZE = "batch_size"
24
24
  EPOCHS = "epochs"
25
25
  TOKENS = "tokens"
26
+ SAMPLES = "samples"
26
27
 
27
28
  PARAMS = "params"
28
29
 
@@ -15,6 +15,7 @@ from libinephany.utils.constants import (
15
15
  EPOCHS,
16
16
  GRAD_NORM_CLIP,
17
17
  LEARNING_RATE,
18
+ SAMPLES,
18
19
  SGD_MOMENTUM,
19
20
  TOKENS,
20
21
  WEIGHT_DECAY,
@@ -73,6 +74,7 @@ class AgentTypes(EnumWithIndices):
73
74
  BatchSize = BATCH_SIZE
74
75
  Epochs = EPOCHS
75
76
  Tokens = TOKENS
77
+ Samples = SAMPLES
76
78
 
77
79
 
78
80
  class ModelFamilies(EnumWithIndices):
@@ -1,13 +1,19 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libinephany
3
- Version: 0.13.2
3
+ Version: 0.13.5
4
4
  Summary: Inephany library containing code commonly used by multiple subpackages.
5
- Requires-Python: >=3.6
5
+ Author-email: Inephany <info@inephany.com>
6
+ License: Apache 2.0
7
+ Keywords: libinephany,library,utilities
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Python: >=3.10
6
15
  Description-Content-Type: text/markdown
7
16
  License-File: LICENSE
8
- Requires-Dist: pytest<9.0.0,>=7.0.0
9
- Requires-Dist: pytest-mock<4.0.0,>=3.10.0
10
- Requires-Dist: pytest-asyncio<0.26.0,>=0.21.0
11
17
  Requires-Dist: pydantic<3.0.0,>=2.5.0
12
18
  Requires-Dist: loguru<0.8.0,>=0.7.0
13
19
  Requires-Dist: requests<3.0.0,>=2.28.0
@@ -22,6 +28,9 @@ Requires-Dist: pandas<3.0.0,>=2.0.0
22
28
  Requires-Dist: accelerate<2.0.0,>=0.20.0
23
29
  Requires-Dist: gymnasium<2.0.0,>=0.29.0
24
30
  Provides-Extra: dev
31
+ Requires-Dist: pytest<9.0.0,>=7.0.0; extra == "dev"
32
+ Requires-Dist: pytest-mock<4.0.0,>=3.10.0; extra == "dev"
33
+ Requires-Dist: pytest-asyncio<0.26.0,>=0.21.0; extra == "dev"
25
34
  Requires-Dist: bump-my-version==0.11.0; extra == "dev"
26
35
  Requires-Dist: black==24.4.2; extra == "dev"
27
36
  Requires-Dist: isort==5.9.3; extra == "dev"
@@ -31,7 +40,6 @@ Requires-Dist: mypy==1.13.0; extra == "dev"
31
40
  Requires-Dist: types-PyYAML==6.0.12.20240808; extra == "dev"
32
41
  Requires-Dist: typeguard==4.3.0; extra == "dev"
33
42
  Dynamic: license-file
34
- Dynamic: requires-python
35
43
 
36
44
  # Inephany Common Library
37
45
 
@@ -50,20 +58,19 @@ The Inephany Common Library (`libinephany`) is a core utility package that provi
50
58
 
51
59
  ### Prerequisites
52
60
 
53
- - Python 3.12+
61
+ - Python 3.10+
54
62
  - Make (for build automation)
55
63
 
56
64
  #### Ubuntu / Debian
57
65
  ```bash
58
66
  sudo add-apt-repository ppa:deadsnakes/ppa
59
67
  sudo apt update
60
- sudo apt install python3.12 make
68
+ sudo apt install python3.12
61
69
  ```
62
70
 
63
71
  #### MacOS with brew
64
72
  ```bash
65
73
  brew install python@3.12
66
- brew install make
67
74
  ```
68
75
 
69
76
  ### For Developers (Monorepo)
@@ -72,33 +79,17 @@ If you're working within the Inephany monorepo, the package is already available
72
79
 
73
80
  ### For Clients (Standalone Installation)
74
81
 
75
- Since `libinephany` is not yet published on PyPI, you'll need to build and install it manually from source. Follow these steps:
82
+ `libinephany` is available on PyPI and can be installed directly:
76
83
 
77
- 1. **Create a new virtual environment**
78
- ```bash
79
- python3.12 -m venv myenv
80
- ```
81
-
82
- 2. **Activate the virtual environment**
83
- ```bash
84
- source myenv/bin/activate
85
- ```
86
-
87
- 3. **Install Build Tools**
88
- ```bash
89
- python -m pip install --upgrade pip setuptools build wheel
90
- ```
84
+ ```bash
85
+ pip install libinephany
86
+ ```
91
87
 
92
- 4. **Change into the `libinephany` directory**
88
+ For development installations with additional dependencies:
93
89
 
94
- 5. **Build and install `libinephany`**
95
- ```bash
96
- python -m build
97
- pip install dist/libinephany-<version>-py3-none-any.whl
98
- ```
99
- Replace `<version>` with the actual version number of the built wheel.
100
-
101
- **Note**: Once `libinephany` is published to PyPI, you'll be able to install it with `pip install libinephany`.
90
+ ```bash
91
+ pip install libinephany[dev]
92
+ ```
102
93
 
103
94
  ## Key Components
104
95
 
@@ -279,4 +270,4 @@ When contributing to `libinephany`:
279
270
 
280
271
  ## License
281
272
 
282
- This package is part of the Inephany ecosystem and is subject to the same licensing terms as other Inephany packages.
273
+ This package is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
@@ -3,8 +3,6 @@ LICENSE
3
3
  MANIFEST.in
4
4
  README.md
5
5
  pyproject.toml
6
- requirements.txt
7
- setup.py
8
6
  libinephany/__init__.py
9
7
  libinephany.egg-info/PKG-INFO
10
8
  libinephany.egg-info/SOURCES.txt
@@ -7,11 +7,21 @@ name = "libinephany"
7
7
  dynamic = ["version"]
8
8
  description = "Inephany library containing code commonly used by multiple subpackages."
9
9
  readme = "README.md"
10
- requires-python = ">=3.6"
10
+ requires-python = ">=3.10"
11
+ authors = [
12
+ {name = "Inephany", email = "info@inephany.com"}
13
+ ]
14
+ license = {text = "Apache 2.0"}
15
+ keywords = ["libinephany", "library", "utilities"]
16
+ classifiers = [
17
+ "Development Status :: 4 - Beta",
18
+ "Intended Audience :: Developers",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ ]
11
24
  dependencies = [
12
- "pytest>=7.0.0,<9.0.0",
13
- "pytest-mock>=3.10.0,<4.0.0",
14
- "pytest-asyncio>=0.21.0,<0.26.0",
15
25
  "pydantic>=2.5.0,<3.0.0",
16
26
  "loguru>=0.7.0,<0.8.0",
17
27
  "requests>=2.28.0,<3.0.0",
@@ -29,6 +39,9 @@ dependencies = [
29
39
 
30
40
  [project.optional-dependencies]
31
41
  dev = [
42
+ "pytest>=7.0.0,<9.0.0",
43
+ "pytest-mock>=3.10.0,<4.0.0",
44
+ "pytest-asyncio>=0.21.0,<0.26.0",
32
45
  "bump-my-version==0.11.0",
33
46
  "black==24.4.2",
34
47
  "isort==5.9.3",
@@ -1 +0,0 @@
1
- 0.13.2
@@ -1,13 +0,0 @@
1
- Copyright (c) 2025 Inephany Ltd.
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- http://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
@@ -1,16 +0,0 @@
1
- pytest>=7.0.0,<9.0.0
2
- pytest-mock>=3.10.0,<4.0.0
3
- pytest-asyncio>=0.21.0,<0.26.0
4
- pydantic>=2.5.0,<3.0.0
5
- loguru>=0.7.0,<0.8.0
6
- requests>=2.28.0,<3.0.0
7
- numpy>=1.24.0,<2.0.0
8
- slack-sdk>=3.20.0,<4.0.0
9
- boto3>=1.26.0,<2.0.0
10
- fastapi>=0.100.0,<0.116.0
11
- aiohttp>=3.8.0,<4.0.0
12
- torch>=2.1.0,<2.8.0
13
- transformers>=4.30.0,<4.48.3
14
- pandas>=2.0.0,<3.0.0
15
- accelerate>=0.20.0,<2.0.0
16
- gymnasium>=0.29.0,<2.0.0
@@ -1,61 +0,0 @@
1
- # ======================================================================================================================
2
- #
3
- # IMPORTS
4
- #
5
- # ======================================================================================================================
6
-
7
- import os
8
- from typing import List
9
-
10
- from setuptools import find_packages, setup
11
-
12
- # ======================================================================================================================
13
-
14
-
15
- def get_path_to_this_files_parent_dir() -> str:
16
- return os.path.dirname(os.path.abspath(__file__))
17
-
18
-
19
- def get_path_to_requirements_txt_relative_to_this_file() -> str:
20
- return os.path.join(get_path_to_this_files_parent_dir(), "requirements.txt")
21
-
22
-
23
- def load_required_packages_from_requirements_txt() -> List[str]:
24
- with open(get_path_to_requirements_txt_relative_to_this_file(), "r") as file:
25
- return [ln.strip() for ln in file.readlines()]
26
-
27
-
28
- def get_version_number() -> str:
29
- version_file_path = os.path.join(get_path_to_this_files_parent_dir(), "CODE_VERSION.cfg")
30
- with open(version_file_path) as version_file:
31
- version = version_file.read().strip()
32
- return version
33
-
34
-
35
- setup(
36
- # =====
37
- # Setup
38
- # =====
39
- name="libinephany",
40
- version=get_version_number(),
41
- description="Inephany library containing code commonly used by multiple subpackages.",
42
- # =================================
43
- # Actual packages, data and scripts
44
- # =================================
45
- packages=find_packages(),
46
- package_dir={"libinephany": "libinephany"},
47
- install_requires=load_required_packages_from_requirements_txt(),
48
- extras_require={
49
- "dev": [
50
- "bump-my-version==0.11.0",
51
- "black==24.4.2",
52
- "isort==5.9.3",
53
- "flake8==7.1.0",
54
- "pre-commit==4.0.1",
55
- "mypy==1.13.0",
56
- "types-PyYAML==6.0.12.20240808",
57
- "typeguard==4.3.0",
58
- ]
59
- },
60
- python_requires=">=3.6",
61
- )
@@ -1,6 +1,3 @@
1
- pytest<9.0.0,>=7.0.0
2
- pytest-mock<4.0.0,>=3.10.0
3
- pytest-asyncio<0.26.0,>=0.21.0
4
1
  pydantic<3.0.0,>=2.5.0
5
2
  loguru<0.8.0,>=0.7.0
6
3
  requests<3.0.0,>=2.28.0
@@ -16,6 +13,9 @@ accelerate<2.0.0,>=0.20.0
16
13
  gymnasium<2.0.0,>=0.29.0
17
14
 
18
15
  [dev]
16
+ pytest<9.0.0,>=7.0.0
17
+ pytest-mock<4.0.0,>=3.10.0
18
+ pytest-asyncio<0.26.0,>=0.21.0
19
19
  bump-my-version==0.11.0
20
20
  black==24.4.2
21
21
  isort==5.9.3
File without changes