flops-utils
This package/library contains common pieces of code for the FLOps project.
User Facing Features
flops-utils provides FLOPs users with guiding abstract template classes for implementing their ML models and "proxy/place-holder" components to satisfy linters.
When FLOps users want to structure their ML code to match the structural requirements of FLOps they should do the following:
# data_manager.py
from flops_utils.ml_repo_building_blocks import load_dataset
from flops_utils.ml_repo_templates import DataManagerTemplate
class DataManager(DataManagerTemplate):
def __init__(self):
... = self._prepare_data()
def _prepare_data(self, partition_id=1) -> Any:
dataset = load_dataset()
...
return ...
def get_data(self) -> Tuple[Any, Any]:
return ...
# model_manager.py
import warnings
from typing import Any, Tuple
import numpy as np
from data_manager import DataManager
from flops_utils.ml_repo_templates import ModelManagerTemplate
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import log_loss
class ModelManager(ModelManagerTemplate):
def __init__(self):
self.model = ...
self._set_init_params()
def _set_init_params(self) -> None:
...
def set_model_data(self) -> None:
... = DataManager().get_data()
def get_model(self) -> Any:
return self.model
def get_model_parameters(self) -> Any:
params = ...
return params
def set_model_parameters(self, parameters) -> None:
...
def fit_model(self) -> int:
return len(self.x_train)
def evaluate_model(self) -> Tuple[Any, Any, int]:
loss = ...
accuracy = ...
return loss, accuracy, len(self.x_test)
A tangible example implementation is available here.
Internal FLOps Commonalities
- Logger
- Types
- MQTT Topics
- Handlers
- Notifications (Project Observer & FLOps Manager)
- Environment Variables
- Auxiliary Constructs
- Running Shell Commands
- Measuring Execution Time Frames
Installation Alternatives
One can also include and use these utilities by doing the following:
pip install --no-cache-dir git+https://github.com/oakestra/addon-FLOps.git@main#subdirectory=utils_library
Metadata
Release files for flops-utils 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| flops_utils-0.6.3.tar.gz | 6.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flops_utils-0.6.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.0 kB
Release files / flops_utils-0.6.3.tar.gz
| Download URL | flops_utils-0.6.3.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
545182b2994f4305def33fc2ee1e188493dceb4f0db8378efa9fccf1a8f8cd0c
|
|
BLAKE2b-256 checksum How to use checksums |
0b65f9df95a64719643be1221a1ec80abad3f75ad158ec938b1bd303616459d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|
Release files / flops_utils-0.6.3-py3-none-any.whl
| Download URL | flops_utils-0.6.3-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
399168bde810a00c15d223d0a73761868d7c5610e8c3d9cb64aafdb7af521378
|
|
BLAKE2b-256 checksum How to use checksums |
7a0acd1b2060046e5360016626834cad0441a23d557f1774bdc8f5969d18354a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|
Security for flops-utils 0.6.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.