valediction 1.0.3__tar.gz → 1.1.0__tar.gz

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.
Files changed (38) hide show
  1. {valediction-1.0.3 → valediction-1.1.0}/PKG-INFO +1 -1
  2. {valediction-1.0.3 → valediction-1.1.0}/pyproject.toml +1 -1
  3. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/convenience.py +7 -12
  4. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/datasets/datasets.py +5 -5
  5. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/validation/validation.py +1 -1
  6. {valediction-1.0.3 → valediction-1.1.0}/.gitignore +0 -0
  7. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/__init__.py +0 -0
  8. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/data_types/__init__.py +0 -0
  9. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/data_types/data_type_helpers.py +0 -0
  10. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/data_types/data_types.py +0 -0
  11. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/data_types/type_inference.py +0 -0
  12. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/datasets/__init__.py +0 -0
  13. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/datasets/datasets_helpers.py +0 -0
  14. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/demo/DEMO - Data Dictionary.xlsx +0 -0
  15. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/demo/DEMOGRAPHICS.csv +0 -0
  16. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/demo/DIAGNOSES.csv +0 -0
  17. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/demo/LAB_TESTS.csv +0 -0
  18. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/demo/VITALS.csv +0 -0
  19. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/demo/__init__.py +0 -0
  20. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/demo/demo_dictionary.py +0 -0
  21. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/dictionary/__init__.py +0 -0
  22. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/dictionary/exporting.py +0 -0
  23. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/dictionary/exporting_helpers.py +0 -0
  24. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/dictionary/generation.py +0 -0
  25. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/dictionary/helpers.py +0 -0
  26. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/dictionary/importing.py +0 -0
  27. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/dictionary/integrity.py +0 -0
  28. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/dictionary/model.py +0 -0
  29. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/dictionary/template/PROJECT - Data Dictionary.xltx +0 -0
  30. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/exceptions.py +0 -0
  31. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/integrity.py +0 -0
  32. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/io/__init__.py +0 -0
  33. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/io/csv_readers.py +0 -0
  34. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/progress.py +0 -0
  35. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/support.py +0 -0
  36. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/validation/__init__.py +0 -0
  37. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/validation/helpers.py +0 -0
  38. {valediction-1.0.3 → valediction-1.1.0}/src/valediction/validation/issues.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: valediction
3
- Version: 1.0.3
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,6 +1,6 @@
1
1
  [project]
2
2
  name = "valediction"
3
- version = "1.0.3"
3
+ version = "1.1.0"
4
4
  description = "Valediction is a convenience data validation package that allows generation, import, and constraint enforcement of user-defined data dictionaries against datasets."
5
5
  authors = [{ name = "Cai Davis", email = "Cai.Davis@uhs.nhs.uk" }]
6
6
  requires-python = ">=3.11,<4.0"
@@ -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
- data: str | Path | dict[str, DataFrame] | Dictionary,
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
- dictionary = (
35
- dictionary
36
- if isinstance(dictionary, Dictionary)
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
- data.import_data()
38
+ _dataset.import_data()
44
39
 
45
- data.validate(
40
+ _dataset.validate(
46
41
  chunk_size=chunk_size,
47
42
  feedback=feedback,
48
43
  )
49
44
 
50
- return data
45
+ return _dataset
@@ -135,16 +135,16 @@ class DatasetItem:
135
135
  # Validation
136
136
  def validate(
137
137
  self,
138
- chunk_size: int = None,
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 = None,
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)
@@ -62,7 +62,7 @@ class Validator:
62
62
  dataset_item: DatasetItemLike,
63
63
  table_dictionary: Table,
64
64
  feedback: bool = True,
65
- chunk_size: int = 10_000_000,
65
+ chunk_size: int | None = 10_000_000,
66
66
  _padding: int = 0,
67
67
  ):
68
68
  # User Variables
File without changes