Skip to content

Commit 0990b5b

Browse files
feat: add privacy level enum [SD-781] (#25)
* 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
1 parent 0245844 commit 0990b5b

File tree

6 files changed

+53
-0
lines changed

6 files changed

+53
-0
lines changed

src/datascience/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.0

src/datascience/setup.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from pathlib import Path
2+
from setuptools import setup, find_packages
3+
4+
here = Path(__file__).parent.resolve()
5+
root = here.parent.parent.resolve()
6+
7+
long_description = (root / 'README.md').read_text(encoding='utf-8')
8+
version = (root / 'VERSION').read_text().rstrip("\n")
9+
10+
setup(name='ydata-datascience',
11+
version=version,
12+
description='Data science functionalities for all python packages at YData',
13+
long_description=long_description,
14+
long_description_content_type='text/markdown',
15+
author='YData',
16+
author_email='[email protected]',
17+
classifiers=[
18+
'Intended Audience :: Developers',
19+
'Programming Language :: Python :: 3 :: Only',
20+
'Topic :: Software Development :: Libraries :: Python Modules'
21+
],
22+
url='https://github.com/ydataai/python-core',
23+
packages=find_packages(exclude=['ydata', 'tests']),
24+
include_package_data=True,
25+
options={"bdist_wheel": {"universal": True}})

src/datascience/ydata/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

src/datascience/ydata/datascience/__init__.py

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from .privacy import PrivacyLevel
2+
3+
4+
__all__ = [
5+
"PrivacyLevel"
6+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from enum import Enum, auto
2+
3+
4+
class PrivacyLevel(Enum):
5+
"""Privacy level exposed to the end-user."""
6+
HIGH_FIDELITY = auto()
7+
"""High fidelity"""
8+
HIGH_PRIVACY = auto()
9+
"""High privacy"""
10+
BALANCED_PRIVACY_FIDELITY = auto()
11+
"""Balanced privacy/fidelity"""
12+
13+
def __str__(self):
14+
if self.value == self.HIGH_FIDELITY.value:
15+
return "High Fidelity"
16+
if self.value == self.HIGH_PRIVACY.value:
17+
return "High Privacy"
18+
if self.value == self.BALANCED_PRIVACY_FIDELITY.value:
19+
return "Balanced Privacy/Fidelity"
20+
return "N/D"

0 commit comments

Comments
 (0)