Skip to content

Commit

Permalink
feat: add privacy level enum [SD-781] (#25)
Browse files Browse the repository at this point in the history
* feat: add privacy level enum

* fix: lint error

* feat: move privacy level enum

* feat: add documentation

* feat: move privacy level enum to new data science package
  • Loading branch information
ricardodcpereira authored Mar 27, 2023
1 parent 0245844 commit 0990b5b
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/datascience/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.0
25 changes: 25 additions & 0 deletions src/datascience/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from pathlib import Path
from setuptools import setup, find_packages

here = Path(__file__).parent.resolve()
root = here.parent.parent.resolve()

long_description = (root / 'README.md').read_text(encoding='utf-8')
version = (root / 'VERSION').read_text().rstrip("\n")

setup(name='ydata-datascience',
version=version,
description='Data science functionalities for all python packages at YData',
long_description=long_description,
long_description_content_type='text/markdown',
author='YData',
author_email='[email protected]',
classifiers=[
'Intended Audience :: Developers',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development :: Libraries :: Python Modules'
],
url='https://github.com/ydataai/python-core',
packages=find_packages(exclude=['ydata', 'tests']),
include_package_data=True,
options={"bdist_wheel": {"universal": True}})
1 change: 1 addition & 0 deletions src/datascience/ydata/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Empty file.
6 changes: 6 additions & 0 deletions src/datascience/ydata/datascience/common/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from .privacy import PrivacyLevel


__all__ = [
"PrivacyLevel"
]
20 changes: 20 additions & 0 deletions src/datascience/ydata/datascience/common/privacy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from enum import Enum, auto


class PrivacyLevel(Enum):
"""Privacy level exposed to the end-user."""
HIGH_FIDELITY = auto()
"""High fidelity"""
HIGH_PRIVACY = auto()
"""High privacy"""
BALANCED_PRIVACY_FIDELITY = auto()
"""Balanced privacy/fidelity"""

def __str__(self):
if self.value == self.HIGH_FIDELITY.value:
return "High Fidelity"
if self.value == self.HIGH_PRIVACY.value:
return "High Privacy"
if self.value == self.BALANCED_PRIVACY_FIDELITY.value:
return "Balanced Privacy/Fidelity"
return "N/D"

0 comments on commit 0990b5b

Please sign in to comment.