valediction 1.0.3__py3-none-any.whl → 1.1.0__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.
- valediction/convenience.py +7 -12
- valediction/datasets/datasets.py +5 -5
- valediction/validation/validation.py +1 -1
- {valediction-1.0.3.dist-info → valediction-1.1.0.dist-info}/METADATA +1 -1
- {valediction-1.0.3.dist-info → valediction-1.1.0.dist-info}/RECORD +6 -6
- {valediction-1.0.3.dist-info → valediction-1.1.0.dist-info}/WHEEL +0 -0
valediction/convenience.py
CHANGED
|
@@ -3,12 +3,11 @@ from pathlib import Path
|
|
|
3
3
|
from pandas import DataFrame
|
|
4
4
|
|
|
5
5
|
from valediction.datasets.datasets import Dataset
|
|
6
|
-
from valediction.dictionary.importing import import_dictionary
|
|
7
6
|
from valediction.dictionary.model import Dictionary
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
def validate(
|
|
11
|
-
|
|
10
|
+
dataset: str | Path | dict[str, DataFrame],
|
|
12
11
|
dictionary: Dictionary | str | Path,
|
|
13
12
|
*,
|
|
14
13
|
import_data: bool = False,
|
|
@@ -31,20 +30,16 @@ def validate(
|
|
|
31
30
|
Returns:
|
|
32
31
|
Dataset: dataset, with or without Issues
|
|
33
32
|
"""
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
else import_dictionary(dictionary)
|
|
38
|
-
)
|
|
39
|
-
data: Dataset = Dataset.create_from(data)
|
|
40
|
-
data.import_dictionary(dictionary)
|
|
33
|
+
|
|
34
|
+
_dataset: Dataset = Dataset.create_from(dataset)
|
|
35
|
+
_dataset.import_dictionary(dictionary)
|
|
41
36
|
|
|
42
37
|
if import_data:
|
|
43
|
-
|
|
38
|
+
_dataset.import_data()
|
|
44
39
|
|
|
45
|
-
|
|
40
|
+
_dataset.validate(
|
|
46
41
|
chunk_size=chunk_size,
|
|
47
42
|
feedback=feedback,
|
|
48
43
|
)
|
|
49
44
|
|
|
50
|
-
return
|
|
45
|
+
return _dataset
|
valediction/datasets/datasets.py
CHANGED
|
@@ -135,16 +135,16 @@ class DatasetItem:
|
|
|
135
135
|
# Validation
|
|
136
136
|
def validate(
|
|
137
137
|
self,
|
|
138
|
-
chunk_size: int =
|
|
138
|
+
chunk_size: int | None = 10_000_000,
|
|
139
139
|
feedback: bool = True,
|
|
140
|
-
):
|
|
140
|
+
) -> None:
|
|
141
141
|
"""
|
|
142
142
|
Summary:
|
|
143
143
|
Validates the dataset item against the dictionary.
|
|
144
144
|
Warns if there are issues with the integrity of the data.
|
|
145
145
|
|
|
146
146
|
Arguments:
|
|
147
|
-
chunk_size (int): Size of chunks for validating data to optimise RAM usage,
|
|
147
|
+
chunk_size (int | None): Size of chunks for validating data to optimise RAM usage,
|
|
148
148
|
if reading from CSV (default: 10_000_000)
|
|
149
149
|
feedback (bool): Provide user feedback on progress (default: True)
|
|
150
150
|
|
|
@@ -710,7 +710,7 @@ class Dataset(list[DatasetItem]):
|
|
|
710
710
|
# Validation
|
|
711
711
|
def validate(
|
|
712
712
|
self,
|
|
713
|
-
chunk_size: int =
|
|
713
|
+
chunk_size: int | None = 10_000_000,
|
|
714
714
|
feedback: bool = True,
|
|
715
715
|
) -> None:
|
|
716
716
|
"""
|
|
@@ -751,7 +751,7 @@ class Dataset(list[DatasetItem]):
|
|
|
751
751
|
if feedback:
|
|
752
752
|
print("\n", end="")
|
|
753
753
|
|
|
754
|
-
def __reattach_issues(self):
|
|
754
|
+
def __reattach_issues(self) -> None:
|
|
755
755
|
self.issues = Issues()
|
|
756
756
|
for item in self:
|
|
757
757
|
self.issues.extend(item.issues)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: valediction
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Valediction is a convenience data validation package that allows generation, import, and constraint enforcement of user-defined data dictionaries against datasets.
|
|
5
5
|
Author-email: Cai Davis <Cai.Davis@uhs.nhs.uk>
|
|
6
6
|
Requires-Python: <4.0,>=3.11
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
valediction/__init__.py,sha256=HJy57qHyaeENZ0xGf5-jkkal-P92n242UU6vIqtsnaw,511
|
|
2
|
-
valediction/convenience.py,sha256=
|
|
2
|
+
valediction/convenience.py,sha256=gDSNcI_T9VKO3Lk1Van4YQCt6hp_fqPyJnUJD8QNP_o,1438
|
|
3
3
|
valediction/exceptions.py,sha256=OtAq_ShVCZeoNx0hWCzJVlVdl3Gm55l72IP1KrKUMR0,748
|
|
4
4
|
valediction/integrity.py,sha256=_4kTywJFSoQIkQ3tFbxMJH1---N8ML9SY0C7j2ZXA-c,3352
|
|
5
5
|
valediction/progress.py,sha256=fXld7BRhp8kk7xPCG50PbRPXvF8RV7Br2hENHuOUlbo,5974
|
|
@@ -9,7 +9,7 @@ valediction/data_types/data_type_helpers.py,sha256=iqcpSPBoFZybkTMHBmxrlv56ZRg8P
|
|
|
9
9
|
valediction/data_types/data_types.py,sha256=MJv_io_hvbLo0G0N38kwj71goXlAo0isPFyS3TU05II,1605
|
|
10
10
|
valediction/data_types/type_inference.py,sha256=11SGYgpvfAfwrDwyOewVIwvfA6pQtDo6i94_xfebYM8,19952
|
|
11
11
|
valediction/datasets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
valediction/datasets/datasets.py,sha256=
|
|
12
|
+
valediction/datasets/datasets.py,sha256=uDDzmLLAWbzKwXhT_RtLaVH-2f_QEhxAFxNFDotTLdY,30069
|
|
13
13
|
valediction/datasets/datasets_helpers.py,sha256=AdB3ws5MYFpiXTmHXmSsdm2wZVwDXkXDOtYLvSYhs4I,1159
|
|
14
14
|
valediction/demo/DEMO - Data Dictionary.xlsx,sha256=wj1JG8dHgdALVwV0zSSYnyWMomMTzrHxGFRm491wM_A,45308
|
|
15
15
|
valediction/demo/DEMOGRAPHICS.csv,sha256=ochj8tiHdRByvK2YbZTw5UR3UxbjYxA2xVbA1BfUlbU,3437
|
|
@@ -32,7 +32,7 @@ valediction/io/csv_readers.py,sha256=6MAOZFZexvNwqiZz-8Er8Me8L4n9NVjLIj6oZOxzZ64
|
|
|
32
32
|
valediction/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
valediction/validation/helpers.py,sha256=qSs_rlJzZ29TPO0pHHFFg9XqVdl1XRxu048NWDl78I0,10180
|
|
34
34
|
valediction/validation/issues.py,sha256=bvHawjehs_e_2xQGoSvPdOt4t8dfASES3KBKHO3zFZo,9122
|
|
35
|
-
valediction/validation/validation.py,sha256=
|
|
36
|
-
valediction-1.0.
|
|
37
|
-
valediction-1.0.
|
|
38
|
-
valediction-1.0.
|
|
35
|
+
valediction/validation/validation.py,sha256=ahYhWlY6wjwL7blYOfNhNIoRCyXCWnNrYn10G0AQGjU,21555
|
|
36
|
+
valediction-1.1.0.dist-info/METADATA,sha256=tg9HnCfKQhYplzno5mOrw_hSICZZL3FyXPhNedYglOE,612
|
|
37
|
+
valediction-1.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
38
|
+
valediction-1.1.0.dist-info/RECORD,,
|
|
File without changes
|