menddata 0.1.0__tar.gz → 0.1.1__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 (24) hide show
  1. {menddata-0.1.0 → menddata-0.1.1}/MendData/__init__.py +1 -1
  2. {menddata-0.1.0 → menddata-0.1.1}/MendData/fixers.py +21 -1
  3. {menddata-0.1.0 → menddata-0.1.1}/PKG-INFO +4 -131
  4. {menddata-0.1.0 → menddata-0.1.1}/README.md +3 -130
  5. {menddata-0.1.0 → menddata-0.1.1}/menddata.egg-info/PKG-INFO +4 -131
  6. {menddata-0.1.0 → menddata-0.1.1}/setup.py +1 -1
  7. {menddata-0.1.0 → menddata-0.1.1}/tests/test_fixers.py +1 -1
  8. {menddata-0.1.0 → menddata-0.1.1}/LICENSE +0 -0
  9. {menddata-0.1.0 → menddata-0.1.1}/MendData/audit.py +0 -0
  10. {menddata-0.1.0 → menddata-0.1.1}/MendData/detectors.py +0 -0
  11. {menddata-0.1.0 → menddata-0.1.1}/MendData/issue.py +0 -0
  12. {menddata-0.1.0 → menddata-0.1.1}/MendData/scoring.py +0 -0
  13. {menddata-0.1.0 → menddata-0.1.1}/MendData/session.py +0 -0
  14. {menddata-0.1.0 → menddata-0.1.1}/MendData/utils.py +0 -0
  15. {menddata-0.1.0 → menddata-0.1.1}/menddata.egg-info/SOURCES.txt +0 -0
  16. {menddata-0.1.0 → menddata-0.1.1}/menddata.egg-info/dependency_links.txt +0 -0
  17. {menddata-0.1.0 → menddata-0.1.1}/menddata.egg-info/requires.txt +0 -0
  18. {menddata-0.1.0 → menddata-0.1.1}/menddata.egg-info/top_level.txt +0 -0
  19. {menddata-0.1.0 → menddata-0.1.1}/setup.cfg +0 -0
  20. {menddata-0.1.0 → menddata-0.1.1}/tests/test_audit.py +0 -0
  21. {menddata-0.1.0 → menddata-0.1.1}/tests/test_detectors.py +0 -0
  22. {menddata-0.1.0 → menddata-0.1.1}/tests/test_issue.py +0 -0
  23. {menddata-0.1.0 → menddata-0.1.1}/tests/test_scoring.py +0 -0
  24. {menddata-0.1.0 → menddata-0.1.1}/tests/test_session.py +0 -0
@@ -50,7 +50,7 @@ from typing import TYPE_CHECKING
50
50
  # Package metadata. Keep __version__ and __license__ in sync with setup.py
51
51
  # and the LICENSE file. TestPyPI/PyPI reject re-uploads of the same version,
52
52
  # so bump __version__ before every new upload.
53
- __version__ = "0.1.0"
53
+ __version__ = "0.1.1"
54
54
  __author__ = (
55
55
  "Group 4 (DS2C): Ana Lynica B. Ferolino, Angeline B. Coniendo, "
56
56
  "Joner D. Jusol, Janel P. Obrador"
@@ -1,4 +1,24 @@
1
- """Data-cleaning fixer classes for MendData."""
1
+ """Data-cleaning fixer classes for MendData.
2
+
3
+ This module provides the fixer hierarchy used by ``CleaningSession`` to
4
+ resolve data quality issues detected in a ``pandas.DataFrame`` without
5
+ mutating the original data.
6
+
7
+ Classes:
8
+ BaseFixer: Abstract base class defining the fixer contract
9
+ (``can_fix``, ``fix``, and ``explain``).
10
+ ImputeFixer: Fills missing values (``Issue.MISSING``) using ``'mean'``,
11
+ ``'median'``, or ``'mode'`` (falling back to ``'mode'`` for
12
+ non-numeric columns).
13
+ DropFixer: Removes rows containing missing values (``Issue.MISSING``)
14
+ or duplicate records (``Issue.DUPLICATE``).
15
+ ClipFixer: Clamps numeric values (``Issue.OUTLIER``) to detector-supplied
16
+ ``lower`` and ``upper`` bounds.
17
+
18
+ All fixers validate inputs before transforming data, return a new
19
+ ``DataFrame`` copy on ``fix()``, and produce a single present-tense
20
+ sentence via ``explain()`` for the audit log.
21
+ """
2
22
 
3
23
  from abc import ABC, abstractmethod
4
24
  from typing import Any
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: menddata
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A beginner-friendly data cleaning library for pandas: scan, fix, score and explain every change in plain English.
5
5
  Home-page: https://github.com/yninika/MendData
6
6
  Author: Group 4 (DS2C): Ferolino, Coniendo, Jusol, Obrador
@@ -129,133 +129,10 @@ print(QualityScorer().breakdown(df)) # completeness, uniqueness, v
129
129
  | `AuditLog` | Append-only, exportable history |
130
130
  | `CleaningSession` | Main entry point; owns the detectors, fixers, scorer and log |
131
131
 
132
- ```mermaid
133
- classDiagram
134
- direction TB
135
-
136
- class Issue {
137
- +MISSING$
138
- +DUPLICATE$
139
- +OUTLIER$
140
- +KINDS$
141
- -_column
142
- -_kind
143
- -_count
144
- -_severity
145
- -_details
146
- +column
147
- +kind
148
- +count
149
- +severity
150
- +details
151
- +describe() str
152
- +__repr__() str
153
- +__str__() str
154
- +__eq__(other) bool
155
- +__hash__() int
156
- +__lt__(other) bool
157
- }
158
-
159
- class BaseDetector {
160
- <<abstract>>
161
- -_min_severity
162
- +min_severity
163
- +detect(data)* list
164
- }
165
- class MissingValueDetector {
166
- +detect(data) list
167
- }
168
- class DuplicateDetector {
169
- -_subset
170
- +subset
171
- +detect(data) list
172
- }
173
- class OutlierDetector {
174
- -_method
175
- -_threshold
176
- +method
177
- +threshold
178
- +detect(data) list
179
- }
180
-
181
- class BaseFixer {
182
- <<abstract>>
183
- +HANDLES$
184
- -_strategy
185
- +strategy
186
- +can_fix(issue) bool
187
- +fix(data, issue)* DataFrame
188
- +explain(issue)* str
189
- }
190
- class ImputeFixer {
191
- +fix(data, issue) DataFrame
192
- +explain(issue) str
193
- }
194
- class DropFixer {
195
- +fix(data, issue) DataFrame
196
- +explain(issue) str
197
- }
198
- class ClipFixer {
199
- +fix(data, issue) DataFrame
200
- +explain(issue) str
201
- }
202
-
203
- class QualityScorer {
204
- -_weights
205
- +weights
206
- +breakdown(data) dict
207
- +score(data) float
208
- +compare(before, after) dict
209
- }
210
-
211
- class AuditLog {
212
- -_entries
213
- +entries
214
- +record(step, reason, affected) None
215
- +export(path) str
216
- +__len__() int
217
- }
218
-
219
- class CleaningSession {
220
- -_data
221
- -_original
222
- -_history
223
- -_issues
224
- -_detectors
225
- -_fixers
226
- -_scorer
227
- -_log
228
- -_max_history
229
- +data
230
- +issues
231
- +scan() list
232
- +fix(issue, fixer) DataFrame
233
- +fix_all(fixers) DataFrame
234
- +score() dict
235
- +report() str
236
- +undo() DataFrame
237
- +reset() DataFrame
238
- +__repr__() str
239
- }
240
-
241
- BaseDetector <|-- MissingValueDetector
242
- BaseDetector <|-- DuplicateDetector
243
- BaseDetector <|-- OutlierDetector
244
- BaseFixer <|-- ImputeFixer
245
- BaseFixer <|-- DropFixer
246
- BaseFixer <|-- ClipFixer
247
-
248
- CleaningSession "1" *-- "1..*" BaseDetector : scans with
249
- CleaningSession "1" *-- "1..*" BaseFixer : fixes with
250
- CleaningSession "1" *-- "1" QualityScorer : scores with
251
- CleaningSession "1" *-- "1" AuditLog : records to
252
- CleaningSession "1" o-- "0..*" Issue : holds
253
- BaseDetector ..> Issue : creates
254
- BaseFixer ..> Issue : resolves
255
- ```
132
+ ![MendData UML class diagram](https://raw.githubusercontent.com/yninika/MendData/main/docs/UML_class_diagram.png)
256
133
 
257
- The UML class diagram is in [`docs/UML_class_diagram.mmd`](docs/UML_class_diagram.mmd)
258
- (Mermaid). A full walkthrough is in [`demo.ipynb`](demo.ipynb).
134
+ The [Mermaid source](https://github.com/yninika/MendData/blob/main/docs/UML_class_diagram.mmd)
135
+ is also available. A full walkthrough is in [`demo.ipynb`](demo.ipynb).
259
136
 
260
137
  ## Project layout
261
138
 
@@ -288,8 +165,4 @@ pytest
288
165
  ## License
289
166
 
290
167
  MIT. See [`LICENSE`](LICENSE).
291
- classDiagram
292
- direction TB
293
-
294
-
295
168
 
@@ -96,133 +96,10 @@ print(QualityScorer().breakdown(df)) # completeness, uniqueness, v
96
96
  | `AuditLog` | Append-only, exportable history |
97
97
  | `CleaningSession` | Main entry point; owns the detectors, fixers, scorer and log |
98
98
 
99
- ```mermaid
100
- classDiagram
101
- direction TB
102
-
103
- class Issue {
104
- +MISSING$
105
- +DUPLICATE$
106
- +OUTLIER$
107
- +KINDS$
108
- -_column
109
- -_kind
110
- -_count
111
- -_severity
112
- -_details
113
- +column
114
- +kind
115
- +count
116
- +severity
117
- +details
118
- +describe() str
119
- +__repr__() str
120
- +__str__() str
121
- +__eq__(other) bool
122
- +__hash__() int
123
- +__lt__(other) bool
124
- }
125
-
126
- class BaseDetector {
127
- <<abstract>>
128
- -_min_severity
129
- +min_severity
130
- +detect(data)* list
131
- }
132
- class MissingValueDetector {
133
- +detect(data) list
134
- }
135
- class DuplicateDetector {
136
- -_subset
137
- +subset
138
- +detect(data) list
139
- }
140
- class OutlierDetector {
141
- -_method
142
- -_threshold
143
- +method
144
- +threshold
145
- +detect(data) list
146
- }
147
-
148
- class BaseFixer {
149
- <<abstract>>
150
- +HANDLES$
151
- -_strategy
152
- +strategy
153
- +can_fix(issue) bool
154
- +fix(data, issue)* DataFrame
155
- +explain(issue)* str
156
- }
157
- class ImputeFixer {
158
- +fix(data, issue) DataFrame
159
- +explain(issue) str
160
- }
161
- class DropFixer {
162
- +fix(data, issue) DataFrame
163
- +explain(issue) str
164
- }
165
- class ClipFixer {
166
- +fix(data, issue) DataFrame
167
- +explain(issue) str
168
- }
169
-
170
- class QualityScorer {
171
- -_weights
172
- +weights
173
- +breakdown(data) dict
174
- +score(data) float
175
- +compare(before, after) dict
176
- }
177
-
178
- class AuditLog {
179
- -_entries
180
- +entries
181
- +record(step, reason, affected) None
182
- +export(path) str
183
- +__len__() int
184
- }
185
-
186
- class CleaningSession {
187
- -_data
188
- -_original
189
- -_history
190
- -_issues
191
- -_detectors
192
- -_fixers
193
- -_scorer
194
- -_log
195
- -_max_history
196
- +data
197
- +issues
198
- +scan() list
199
- +fix(issue, fixer) DataFrame
200
- +fix_all(fixers) DataFrame
201
- +score() dict
202
- +report() str
203
- +undo() DataFrame
204
- +reset() DataFrame
205
- +__repr__() str
206
- }
207
-
208
- BaseDetector <|-- MissingValueDetector
209
- BaseDetector <|-- DuplicateDetector
210
- BaseDetector <|-- OutlierDetector
211
- BaseFixer <|-- ImputeFixer
212
- BaseFixer <|-- DropFixer
213
- BaseFixer <|-- ClipFixer
214
-
215
- CleaningSession "1" *-- "1..*" BaseDetector : scans with
216
- CleaningSession "1" *-- "1..*" BaseFixer : fixes with
217
- CleaningSession "1" *-- "1" QualityScorer : scores with
218
- CleaningSession "1" *-- "1" AuditLog : records to
219
- CleaningSession "1" o-- "0..*" Issue : holds
220
- BaseDetector ..> Issue : creates
221
- BaseFixer ..> Issue : resolves
222
- ```
99
+ ![MendData UML class diagram](https://raw.githubusercontent.com/yninika/MendData/main/docs/UML_class_diagram.png)
223
100
 
224
- The UML class diagram is in [`docs/UML_class_diagram.mmd`](docs/UML_class_diagram.mmd)
225
- (Mermaid). A full walkthrough is in [`demo.ipynb`](demo.ipynb).
101
+ The [Mermaid source](https://github.com/yninika/MendData/blob/main/docs/UML_class_diagram.mmd)
102
+ is also available. A full walkthrough is in [`demo.ipynb`](demo.ipynb).
226
103
 
227
104
  ## Project layout
228
105
 
@@ -255,8 +132,4 @@ pytest
255
132
  ## License
256
133
 
257
134
  MIT. See [`LICENSE`](LICENSE).
258
- classDiagram
259
- direction TB
260
-
261
-
262
135
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: menddata
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: A beginner-friendly data cleaning library for pandas: scan, fix, score and explain every change in plain English.
5
5
  Home-page: https://github.com/yninika/MendData
6
6
  Author: Group 4 (DS2C): Ferolino, Coniendo, Jusol, Obrador
@@ -129,133 +129,10 @@ print(QualityScorer().breakdown(df)) # completeness, uniqueness, v
129
129
  | `AuditLog` | Append-only, exportable history |
130
130
  | `CleaningSession` | Main entry point; owns the detectors, fixers, scorer and log |
131
131
 
132
- ```mermaid
133
- classDiagram
134
- direction TB
135
-
136
- class Issue {
137
- +MISSING$
138
- +DUPLICATE$
139
- +OUTLIER$
140
- +KINDS$
141
- -_column
142
- -_kind
143
- -_count
144
- -_severity
145
- -_details
146
- +column
147
- +kind
148
- +count
149
- +severity
150
- +details
151
- +describe() str
152
- +__repr__() str
153
- +__str__() str
154
- +__eq__(other) bool
155
- +__hash__() int
156
- +__lt__(other) bool
157
- }
158
-
159
- class BaseDetector {
160
- <<abstract>>
161
- -_min_severity
162
- +min_severity
163
- +detect(data)* list
164
- }
165
- class MissingValueDetector {
166
- +detect(data) list
167
- }
168
- class DuplicateDetector {
169
- -_subset
170
- +subset
171
- +detect(data) list
172
- }
173
- class OutlierDetector {
174
- -_method
175
- -_threshold
176
- +method
177
- +threshold
178
- +detect(data) list
179
- }
180
-
181
- class BaseFixer {
182
- <<abstract>>
183
- +HANDLES$
184
- -_strategy
185
- +strategy
186
- +can_fix(issue) bool
187
- +fix(data, issue)* DataFrame
188
- +explain(issue)* str
189
- }
190
- class ImputeFixer {
191
- +fix(data, issue) DataFrame
192
- +explain(issue) str
193
- }
194
- class DropFixer {
195
- +fix(data, issue) DataFrame
196
- +explain(issue) str
197
- }
198
- class ClipFixer {
199
- +fix(data, issue) DataFrame
200
- +explain(issue) str
201
- }
202
-
203
- class QualityScorer {
204
- -_weights
205
- +weights
206
- +breakdown(data) dict
207
- +score(data) float
208
- +compare(before, after) dict
209
- }
210
-
211
- class AuditLog {
212
- -_entries
213
- +entries
214
- +record(step, reason, affected) None
215
- +export(path) str
216
- +__len__() int
217
- }
218
-
219
- class CleaningSession {
220
- -_data
221
- -_original
222
- -_history
223
- -_issues
224
- -_detectors
225
- -_fixers
226
- -_scorer
227
- -_log
228
- -_max_history
229
- +data
230
- +issues
231
- +scan() list
232
- +fix(issue, fixer) DataFrame
233
- +fix_all(fixers) DataFrame
234
- +score() dict
235
- +report() str
236
- +undo() DataFrame
237
- +reset() DataFrame
238
- +__repr__() str
239
- }
240
-
241
- BaseDetector <|-- MissingValueDetector
242
- BaseDetector <|-- DuplicateDetector
243
- BaseDetector <|-- OutlierDetector
244
- BaseFixer <|-- ImputeFixer
245
- BaseFixer <|-- DropFixer
246
- BaseFixer <|-- ClipFixer
247
-
248
- CleaningSession "1" *-- "1..*" BaseDetector : scans with
249
- CleaningSession "1" *-- "1..*" BaseFixer : fixes with
250
- CleaningSession "1" *-- "1" QualityScorer : scores with
251
- CleaningSession "1" *-- "1" AuditLog : records to
252
- CleaningSession "1" o-- "0..*" Issue : holds
253
- BaseDetector ..> Issue : creates
254
- BaseFixer ..> Issue : resolves
255
- ```
132
+ ![MendData UML class diagram](https://raw.githubusercontent.com/yninika/MendData/main/docs/UML_class_diagram.png)
256
133
 
257
- The UML class diagram is in [`docs/UML_class_diagram.mmd`](docs/UML_class_diagram.mmd)
258
- (Mermaid). A full walkthrough is in [`demo.ipynb`](demo.ipynb).
134
+ The [Mermaid source](https://github.com/yninika/MendData/blob/main/docs/UML_class_diagram.mmd)
135
+ is also available. A full walkthrough is in [`demo.ipynb`](demo.ipynb).
259
136
 
260
137
  ## Project layout
261
138
 
@@ -288,8 +165,4 @@ pytest
288
165
  ## License
289
166
 
290
167
  MIT. See [`LICENSE`](LICENSE).
291
- classDiagram
292
- direction TB
293
-
294
-
295
168
 
@@ -6,7 +6,7 @@ from setuptools import find_packages, setup
6
6
 
7
7
  # Keep the version in sync with MendData/__init__.py. TestPyPI and PyPI reject
8
8
  # re-uploads of the same version, so bump it before every new upload.
9
- VERSION = "0.1.0"
9
+ VERSION = "0.1.1"
10
10
 
11
11
  README = Path(__file__).parent / "README.md"
12
12
  LONG_DESCRIPTION = README.read_text(encoding="utf-8") if README.exists() else ""
@@ -11,7 +11,7 @@ Issues are built the way the detectors will build them (a ``column``, a
11
11
  ``count``, and the ``details`` the fixer reads). The last tests check that the
12
12
  fixers work inside a real ``CleaningSession``.
13
13
 
14
- Run from the repository root with: python -m pytest
14
+ Run from the repository root with: python -m pytest.
15
15
  """
16
16
 
17
17
  import numpy as np
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes