purem 2.0.3__py3-none-any.whl → 2.1.1__py3-none-any.whl
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.
- purem/core.py +16 -11
- purem/env_config.py +1 -1
- purem/logger.py +6 -0
- {purem-2.0.3.dist-info → purem-2.1.1.dist-info}/METADATA +12 -29
- purem-2.1.1.dist-info/RECORD +12 -0
- {purem-2.0.3.dist-info → purem-2.1.1.dist-info}/WHEEL +1 -1
- purem-2.0.3.dist-info/RECORD +0 -12
- {purem-2.0.3.dist-info → purem-2.1.1.dist-info}/licenses/LICENSE +0 -0
- {purem-2.0.3.dist-info → purem-2.1.1.dist-info}/top_level.txt +0 -0
purem/core.py
CHANGED
@@ -201,25 +201,31 @@ class Purem:
|
|
201
201
|
|
202
202
|
def _download_and_extract_binary(self):
|
203
203
|
req = urllib.request.Request(
|
204
|
-
self._download_binary_url,
|
204
|
+
self._download_binary_url,
|
205
|
+
headers={"User-Agent": "Mozilla/5.0"}
|
205
206
|
)
|
206
207
|
|
207
|
-
|
208
|
-
with
|
209
|
-
|
210
|
-
|
211
|
-
with open(self._binary_archive_path_tmp, "rb") as f:
|
212
|
-
zip_utf = base64.b64decode(f.read())
|
208
|
+
try:
|
209
|
+
with urllib.request.urlopen(req, context=self._ctx) as response:
|
210
|
+
with open(self._binary_archive_path_tmp, "wb") as out_file:
|
211
|
+
shutil.copyfileobj(response, out_file)
|
213
212
|
|
214
|
-
|
215
|
-
|
213
|
+
shutil.move(self._binary_archive_path_tmp, self._binary_archive_path)
|
214
|
+
except Exception as e:
|
215
|
+
raise RuntimeError(
|
216
|
+
self._log.info(
|
217
|
+
f"The Purem archive appears to be corrupted or incomplete.\nDetails: {e}"
|
218
|
+
"Please ensure the package downloaded fully and is unmodified.\n"
|
219
|
+
"Need help? Contact support@worktif.com – we'll assist right away.\n"
|
220
|
+
)
|
221
|
+
)
|
216
222
|
|
217
223
|
try:
|
218
224
|
with zipfile.ZipFile(self._binary_archive_path, "r") as zip_ref:
|
219
225
|
zip_ref.extractall(
|
220
226
|
self._file_structure.dirs.project_root_binary_dir_path
|
221
227
|
)
|
222
|
-
self._log.
|
228
|
+
self._log.info_new_line(
|
223
229
|
f"Purem binary extracted to: {self._file_structure.dirs.binary_dir_path}"
|
224
230
|
)
|
225
231
|
except zipfile.BadZipFile as e:
|
@@ -232,4 +238,3 @@ class Purem:
|
|
232
238
|
)
|
233
239
|
|
234
240
|
self._binary_archive_path.unlink()
|
235
|
-
self._binary_archive_path_tmp.unlink()
|
purem/env_config.py
CHANGED
@@ -38,7 +38,7 @@ class EnvConfig(BaseModel):
|
|
38
38
|
PUREM_CONFIG_URL: Optional[str] = Field(
|
39
39
|
..., description="Purem Instance Binary Config URL."
|
40
40
|
)
|
41
|
-
PUREM_VERBOSE: bool = Field(default="
|
41
|
+
PUREM_VERBOSE: bool = Field(default="none", description="Verbose Purem Mode.")
|
42
42
|
DEBUG: bool = Field(default=False, description="Debug Mode.")
|
43
43
|
|
44
44
|
|
purem/logger.py
CHANGED
@@ -25,6 +25,12 @@ class Logger:
|
|
25
25
|
else:
|
26
26
|
return f"[purem]: {self._default_info_message}\n"
|
27
27
|
|
28
|
+
def info_new_line(self, message: str) -> str:
|
29
|
+
if self._env.PUREM_VERBOSE is True:
|
30
|
+
return f"\n[purem]: {message}\n"
|
31
|
+
else:
|
32
|
+
return f"\n[purem]: {self._default_info_message}\n"
|
33
|
+
|
28
34
|
def printr(self, message: str) -> str or None:
|
29
35
|
if self._env.PUREM_VERBOSE is True:
|
30
36
|
print(self.info(message))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: purem
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.1.1
|
4
4
|
Summary: High-performance mapping function for mixed-type arrays
|
5
5
|
Author-email: Raman Marozau <raman@worktif.com>
|
6
6
|
License-Expression: BUSL-1.1
|
@@ -55,7 +55,7 @@ Key Features
|
|
55
55
|
------------
|
56
56
|
|
57
57
|
Purem is a blazing-fast AI math engine that turns your Python formulas into native-speed vectorized execution.
|
58
|
-
Achieve up to
|
58
|
+
Achieve up to 429× faster performance on CPU/GPU/TPU – no rewrites, no dependencies, just speed.
|
59
59
|
Designed for ML researchers, scientific computing, and production-grade workloads that can’t afford to wait.
|
60
60
|
|
61
61
|
---
|
@@ -81,39 +81,20 @@ Setup takes less than a minute – we’re ready when you are: https://worktif.c
|
|
81
81
|
|
82
82
|
purem.configure(license_key='your-license-key') # Auto-downloads and configures backend
|
83
83
|
|
84
|
-
Alternatively, if you already have the backend ``.so`` file::
|
85
|
-
|
86
|
-
from purem import purem
|
87
|
-
|
88
|
-
purem.softmax([...]) # Initialized from local ./lib/libpurem.so
|
89
|
-
|
90
|
-
---
|
91
|
-
|
92
|
-
📁 Local Library Structure
|
93
|
-
---------------------------
|
94
|
-
|
95
|
-
If the backend ``.so`` is already downloaded manually, place it here::
|
96
|
-
|
97
|
-
your_project/
|
98
|
-
├── main.py
|
99
|
-
├── lib/
|
100
|
-
│ └── libpurem.so
|
101
|
-
|
102
84
|
---
|
103
85
|
|
104
86
|
🔐 License-Based Activation
|
105
87
|
----------------------------
|
106
88
|
|
107
|
-
|
89
|
+
The system will download the licensed native Purem engine:
|
108
90
|
|
109
91
|
1. Call ``purem.configure(license_key='<your-license-key>')``
|
110
|
-
2. The system will download the
|
92
|
+
2. The system will download the native Purem engine
|
111
93
|
3. All functions will become available instantly after initialization
|
112
94
|
|
113
95
|
Without a valid license key:
|
114
96
|
|
115
|
-
- No
|
116
|
-
- The library won't work unless you provide the ``.so`` manually
|
97
|
+
- No native Purem engine will be downloaded
|
117
98
|
|
118
99
|
---
|
119
100
|
|
@@ -124,6 +105,9 @@ After initialization, you can call::
|
|
124
105
|
|
125
106
|
from purem import purem
|
126
107
|
|
108
|
+
# Transforms a list of numbers into a probability distribution.
|
109
|
+
# Each output value is between 0 and 1, and all outputs sum to 1.
|
110
|
+
# Commonly used in classification tasks to interpret scores as probabilities.
|
127
111
|
purem.softmax([...])
|
128
112
|
...
|
129
113
|
|
@@ -134,10 +118,9 @@ Full function list: https://worktif.com/docs/basic-usage
|
|
134
118
|
📦 Packaging Notes
|
135
119
|
-------------------
|
136
120
|
|
137
|
-
This package does **not** bundle the
|
121
|
+
This package does **not** bundle the native Purem engine. You are required to:
|
138
122
|
|
139
123
|
- Use a license key to download it dynamically
|
140
|
-
- Alternatively, place it manually into ``./lib/`` folder before calling ``init()``
|
141
124
|
|
142
125
|
---
|
143
126
|
|
@@ -155,11 +138,10 @@ Visit the Benchmark Tutorial: https://worktif.com/#benchmarks
|
|
155
138
|
📧 Distribution and Licensing
|
156
139
|
------------------------------
|
157
140
|
|
158
|
-
|
159
|
-
All users must
|
141
|
+
The native Purem engine is distributed exclusively through license-based activation.
|
142
|
+
All users must:
|
160
143
|
|
161
144
|
- Use their license key to install
|
162
|
-
- Or receive ``.so`` file from verified sources
|
163
145
|
|
164
146
|
For access, contact us or visit: https://worktif.com/documents/terms-of-service
|
165
147
|
|
@@ -170,6 +152,7 @@ For access, contact us or visit: https://worktif.com/documents/terms-of-service
|
|
170
152
|
|
171
153
|
.. code-block:: python
|
172
154
|
|
155
|
+
# Import required modules
|
173
156
|
import numpy as np
|
174
157
|
from purem import purem
|
175
158
|
|
@@ -0,0 +1,12 @@
|
|
1
|
+
purem/__init__.py,sha256=-npGtjgo4iHpJHW1DabIA7aUXPDGzgDw8jClOVAg35I,142
|
2
|
+
purem/core.py,sha256=53S0D8TfzVl0TTm1Elf_zQRYFyTbZ3VlhdrpnVVNxEs,10036
|
3
|
+
purem/env_config.py,sha256=eWW1bqnDbo-nVYg-m4txk2PBoDmHm4Ch6-OkkoNOFFQ,2671
|
4
|
+
purem/file_structure.py,sha256=8PRP9uk6PApOHwKF5Pfyg7CbZfgqTVwzV4NrYLJkTjY,3341
|
5
|
+
purem/loader.py,sha256=F-4dFzBtmxnB8r4Y620WJhJ6-yAiBjmvZYCi8Z1ykkU,1274
|
6
|
+
purem/logger.py,sha256=bs7jtx1cHmyuM6Irdcq60gTMURCai2pi5MIUB3TQcSQ,1243
|
7
|
+
purem/utils.py,sha256=Kv0DPvt8SpSfKp4ar03ZP26Aj60dxW5Gf8B9FKKUrDc,927
|
8
|
+
purem-2.1.1.dist-info/licenses/LICENSE,sha256=btmdQkvGxH-SryIGO_D4TpIzD7dZ8Y6z9M33WxCb1rI,1633
|
9
|
+
purem-2.1.1.dist-info/METADATA,sha256=6t71IwxFo6vTWeUDC6Do421rAJnqXXoeknX6HVL0LPQ,5116
|
10
|
+
purem-2.1.1.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
|
11
|
+
purem-2.1.1.dist-info/top_level.txt,sha256=EjS75KEpZUEKSV2TFGW6w5aLqY9nUyO6Gq2ATz-KeZM,6
|
12
|
+
purem-2.1.1.dist-info/RECORD,,
|
purem-2.0.3.dist-info/RECORD
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
purem/__init__.py,sha256=-npGtjgo4iHpJHW1DabIA7aUXPDGzgDw8jClOVAg35I,142
|
2
|
-
purem/core.py,sha256=pT_FWD6GHtRs2kWOMfHrGjrIdHAF85kqTl3OBiv_2ng,9761
|
3
|
-
purem/env_config.py,sha256=J5J_zSRzPYUCSUPZGd8m6dz6AmShgG9e0s7ll0BZL4Q,2668
|
4
|
-
purem/file_structure.py,sha256=8PRP9uk6PApOHwKF5Pfyg7CbZfgqTVwzV4NrYLJkTjY,3341
|
5
|
-
purem/loader.py,sha256=F-4dFzBtmxnB8r4Y620WJhJ6-yAiBjmvZYCi8Z1ykkU,1274
|
6
|
-
purem/logger.py,sha256=muhL_QsqKgo-ElSee7SDwwFopGgbPQf6xXB7IlTuC5k,1025
|
7
|
-
purem/utils.py,sha256=Kv0DPvt8SpSfKp4ar03ZP26Aj60dxW5Gf8B9FKKUrDc,927
|
8
|
-
purem-2.0.3.dist-info/licenses/LICENSE,sha256=btmdQkvGxH-SryIGO_D4TpIzD7dZ8Y6z9M33WxCb1rI,1633
|
9
|
-
purem-2.0.3.dist-info/METADATA,sha256=ZHjSCMOEHuN5KKZR2vleLwa2KIHp8TNgrOYrboM905I,5424
|
10
|
-
purem-2.0.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
11
|
-
purem-2.0.3.dist-info/top_level.txt,sha256=EjS75KEpZUEKSV2TFGW6w5aLqY9nUyO6Gq2ATz-KeZM,6
|
12
|
-
purem-2.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|