dtypeflow 1.0.0__tar.gz → 1.2.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.
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/LICENSE +21 -21
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/PKG-INFO +84 -69
- dtypeflow-1.2.0/README.md +83 -0
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/pyproject.toml +1 -1
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/pyproject.toml.orig +1 -1
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/__init__.py +5 -5
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/__init__.py +1 -1
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/candidate/__init__.py +40 -40
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/candidate/base.py +37 -37
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/candidate/factory.py +258 -258
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/candidate/primitive.py +79 -79
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dataset.py +58 -46
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/__init__.py +70 -70
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/base.py +14 -14
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/hierachy.md +51 -51
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/nested/__init__.py +5 -5
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/nested/dictionary.py +14 -14
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/primitive/__init__.py +39 -39
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/primitive/base.py +6 -6
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/primitive/boolean.py +20 -20
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/primitive/float.py +40 -40
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/primitive/integer/__init__.py +31 -31
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/primitive/integer/base.py +17 -17
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/primitive/integer/signed.py +37 -37
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/primitive/integer/unsigned.py +37 -37
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/dtype/primitive/string.py +14 -14
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/override/__init__.py +41 -41
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/override/base.py +22 -22
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/override/primitive.py +158 -158
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/profile/__init__.py +39 -39
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/profile/base.py +50 -50
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/profile/primitive.py +166 -166
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/profiler.py +170 -169
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/schema.py +44 -33
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/core/table.py +29 -29
- dtypeflow-1.2.0/src/dtypeflow/tui/__init__.py +9 -0
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/tui/app.py +839 -747
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/tui/app.tcss +261 -220
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/tui/compatibility.py +38 -38
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/tui/dto.py +44 -44
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/tui/service.py +215 -213
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/utils.py +16 -5
- dtypeflow-1.0.0/README.md +0 -68
- dtypeflow-1.0.0/src/dtypeflow/tui/__init__.py +0 -17
- {dtypeflow-1.0.0 → dtypeflow-1.2.0}/src/dtypeflow/py.typed +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Pedro José Mora Gallegos
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pedro José Mora Gallegos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dtypeflow
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Terminal UI to infer CSV column dtypes and convert CSV to Parquet, locally.
|
|
5
5
|
Keywords: csv,parquet,dtype,tui,textual,arrow
|
|
6
6
|
Author: Pedro José Mora Gallegos
|
|
@@ -23,71 +23,86 @@ Project-URL: Repository, https://github.com/pedrojosemoragallegos/dtypeflow
|
|
|
23
23
|
Project-URL: Issues, https://github.com/pedrojosemoragallegos/dtypeflow/issues
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
25
|
|
|
26
|
-
# dtypeflow
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
##
|
|
92
|
-
|
|
93
|
-
[
|
|
26
|
+
# dtypeflow
|
|
27
|
+
|
|
28
|
+
[](https://pypi.org/project/dtypeflow/)
|
|
29
|
+
[](https://pypi.org/project/dtypeflow/)
|
|
30
|
+
[](https://pepy.tech/project/dtypeflow)
|
|
31
|
+
[](https://pypi.org/project/dtypeflow/)
|
|
32
|
+
|
|
33
|
+
`dtypeflow` is a terminal UI to convert a CSV file to Parquet.
|
|
34
|
+
|
|
35
|
+
Point it at a CSV file, and for each column it infers the tightest-fitting
|
|
36
|
+
dtype (`Boolean`, unsigned/signed integers `UInt8`…`UInt64`/`Int8`…`Int64`,
|
|
37
|
+
floats `Float16`/`Float32`/`Float64`, `String`, or `Dictionary`), shows the
|
|
38
|
+
observed statistics, and lets you review or override the choice before
|
|
39
|
+
writing the result to Parquet — all locally, no data leaves your machine.
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
uv tool install dtypeflow
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Or with `pipx`:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pipx install dtypeflow
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or with `pip`:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install dtypeflow
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
dtypeflow
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The workflow has three steps:
|
|
66
|
+
|
|
67
|
+
1. **Pick a file** — enter or browse for a CSV path and choose the delimiter
|
|
68
|
+
(Comma by default; Auto detects it from the first 64 KiB).
|
|
69
|
+
2. **Configure types** — for each column, review the recommended dtype, its
|
|
70
|
+
stats (unique values, samples, range/precision/scale), and pick from
|
|
71
|
+
compatible alternatives grouped by safety (Safe / Too small / Discouraged).
|
|
72
|
+
3. **Export** — write the configured dataset to a Parquet file.
|
|
73
|
+
|
|
74
|
+
### Screenshots
|
|
75
|
+
|
|
76
|
+
Alternatives for a column are grouped by how safe they are to apply:
|
|
77
|
+
|
|
78
|
+
<table>
|
|
79
|
+
<tr>
|
|
80
|
+
<td align="center"><b>Safe</b></td>
|
|
81
|
+
<td align="center"><b>Too small</b></td>
|
|
82
|
+
<td align="center"><b>Discouraged</b></td>
|
|
83
|
+
</tr>
|
|
84
|
+
<tr>
|
|
85
|
+
<td><img src="screenshots/26_warehouse_stock_safe.svg" alt="Safe dtype options for warehouse_stock" width="280"></td>
|
|
86
|
+
<td><img src="screenshots/26_warehouse_stock_too_small.svg" alt="Too small dtype options for warehouse_stock" width="280"></td>
|
|
87
|
+
<td><img src="screenshots/26_warehouse_stock_discouraged.svg" alt="Discouraged dtype options for warehouse_stock" width="280"></td>
|
|
88
|
+
</tr>
|
|
89
|
+
</table>
|
|
90
|
+
|
|
91
|
+
## Development
|
|
92
|
+
|
|
93
|
+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
uv sync
|
|
97
|
+
uv run dtypeflow
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Lint:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
uv run --with ruff ruff check src/
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# dtypeflow
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/dtypeflow/)
|
|
4
|
+
[](https://pypi.org/project/dtypeflow/)
|
|
5
|
+
[](https://pepy.tech/project/dtypeflow)
|
|
6
|
+
[](https://pypi.org/project/dtypeflow/)
|
|
7
|
+
|
|
8
|
+
`dtypeflow` is a terminal UI to convert a CSV file to Parquet.
|
|
9
|
+
|
|
10
|
+
Point it at a CSV file, and for each column it infers the tightest-fitting
|
|
11
|
+
dtype (`Boolean`, unsigned/signed integers `UInt8`…`UInt64`/`Int8`…`Int64`,
|
|
12
|
+
floats `Float16`/`Float32`/`Float64`, `String`, or `Dictionary`), shows the
|
|
13
|
+
observed statistics, and lets you review or override the choice before
|
|
14
|
+
writing the result to Parquet — all locally, no data leaves your machine.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
uv tool install dtypeflow
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or with `pipx`:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pipx install dtypeflow
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or with `pip`:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install dtypeflow
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
dtypeflow
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The workflow has three steps:
|
|
41
|
+
|
|
42
|
+
1. **Pick a file** — enter or browse for a CSV path and choose the delimiter
|
|
43
|
+
(Comma by default; Auto detects it from the first 64 KiB).
|
|
44
|
+
2. **Configure types** — for each column, review the recommended dtype, its
|
|
45
|
+
stats (unique values, samples, range/precision/scale), and pick from
|
|
46
|
+
compatible alternatives grouped by safety (Safe / Too small / Discouraged).
|
|
47
|
+
3. **Export** — write the configured dataset to a Parquet file.
|
|
48
|
+
|
|
49
|
+
### Screenshots
|
|
50
|
+
|
|
51
|
+
Alternatives for a column are grouped by how safe they are to apply:
|
|
52
|
+
|
|
53
|
+
<table>
|
|
54
|
+
<tr>
|
|
55
|
+
<td align="center"><b>Safe</b></td>
|
|
56
|
+
<td align="center"><b>Too small</b></td>
|
|
57
|
+
<td align="center"><b>Discouraged</b></td>
|
|
58
|
+
</tr>
|
|
59
|
+
<tr>
|
|
60
|
+
<td><img src="screenshots/26_warehouse_stock_safe.svg" alt="Safe dtype options for warehouse_stock" width="280"></td>
|
|
61
|
+
<td><img src="screenshots/26_warehouse_stock_too_small.svg" alt="Too small dtype options for warehouse_stock" width="280"></td>
|
|
62
|
+
<td><img src="screenshots/26_warehouse_stock_discouraged.svg" alt="Discouraged dtype options for warehouse_stock" width="280"></td>
|
|
63
|
+
</tr>
|
|
64
|
+
</table>
|
|
65
|
+
|
|
66
|
+
## Development
|
|
67
|
+
|
|
68
|
+
This project uses [uv](https://docs.astral.sh/uv/) for dependency management.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
uv sync
|
|
72
|
+
uv run dtypeflow
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Lint:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
uv run --with ruff ruff check src/
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
[MIT](LICENSE)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from dtypeflow.core.profiler import profile
|
|
4
|
-
|
|
5
|
-
__all__: list[str] = ["profile"]
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dtypeflow.core.profiler import profile
|
|
4
|
+
|
|
5
|
+
__all__: list[str] = ["profile"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
1
|
+
from __future__ import annotations
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from .base import Candidate, Compatibility
|
|
4
|
-
from .factory import candidate_factory
|
|
5
|
-
from .primitive import (
|
|
6
|
-
Boolean as BooleanCandidate,
|
|
7
|
-
Dictionary as DictionaryCandidate,
|
|
8
|
-
Float16 as Float16Candidate,
|
|
9
|
-
Float32 as Float32Candidate,
|
|
10
|
-
Float64 as Float64Candidate,
|
|
11
|
-
Int8 as Int8Candidate,
|
|
12
|
-
Int16 as Int16Candidate,
|
|
13
|
-
Int32 as Int32Candidate,
|
|
14
|
-
Int64 as Int64Candidate,
|
|
15
|
-
String as StringCandidate,
|
|
16
|
-
UInt8 as UInt8Candidate,
|
|
17
|
-
UInt16 as UInt16Candidate,
|
|
18
|
-
UInt32 as UInt32Candidate,
|
|
19
|
-
UInt64 as UInt64Candidate,
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
__all__: list[str] = [
|
|
23
|
-
"BooleanCandidate",
|
|
24
|
-
"Candidate",
|
|
25
|
-
"Compatibility",
|
|
26
|
-
"DictionaryCandidate",
|
|
27
|
-
"Float16Candidate",
|
|
28
|
-
"Float32Candidate",
|
|
29
|
-
"Float64Candidate",
|
|
30
|
-
"Int8Candidate",
|
|
31
|
-
"Int16Candidate",
|
|
32
|
-
"Int32Candidate",
|
|
33
|
-
"Int64Candidate",
|
|
34
|
-
"StringCandidate",
|
|
35
|
-
"UInt8Candidate",
|
|
36
|
-
"UInt16Candidate",
|
|
37
|
-
"UInt32Candidate",
|
|
38
|
-
"UInt64Candidate",
|
|
39
|
-
"candidate_factory",
|
|
40
|
-
]
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from .base import Candidate, Compatibility
|
|
4
|
+
from .factory import candidate_factory
|
|
5
|
+
from .primitive import (
|
|
6
|
+
Boolean as BooleanCandidate,
|
|
7
|
+
Dictionary as DictionaryCandidate,
|
|
8
|
+
Float16 as Float16Candidate,
|
|
9
|
+
Float32 as Float32Candidate,
|
|
10
|
+
Float64 as Float64Candidate,
|
|
11
|
+
Int8 as Int8Candidate,
|
|
12
|
+
Int16 as Int16Candidate,
|
|
13
|
+
Int32 as Int32Candidate,
|
|
14
|
+
Int64 as Int64Candidate,
|
|
15
|
+
String as StringCandidate,
|
|
16
|
+
UInt8 as UInt8Candidate,
|
|
17
|
+
UInt16 as UInt16Candidate,
|
|
18
|
+
UInt32 as UInt32Candidate,
|
|
19
|
+
UInt64 as UInt64Candidate,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
__all__: list[str] = [
|
|
23
|
+
"BooleanCandidate",
|
|
24
|
+
"Candidate",
|
|
25
|
+
"Compatibility",
|
|
26
|
+
"DictionaryCandidate",
|
|
27
|
+
"Float16Candidate",
|
|
28
|
+
"Float32Candidate",
|
|
29
|
+
"Float64Candidate",
|
|
30
|
+
"Int8Candidate",
|
|
31
|
+
"Int16Candidate",
|
|
32
|
+
"Int32Candidate",
|
|
33
|
+
"Int64Candidate",
|
|
34
|
+
"StringCandidate",
|
|
35
|
+
"UInt8Candidate",
|
|
36
|
+
"UInt16Candidate",
|
|
37
|
+
"UInt32Candidate",
|
|
38
|
+
"UInt64Candidate",
|
|
39
|
+
"candidate_factory",
|
|
40
|
+
]
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from abc import ABC
|
|
4
|
-
from enum import Enum, auto
|
|
5
|
-
from typing import TYPE_CHECKING, ClassVar
|
|
6
|
-
|
|
7
|
-
if TYPE_CHECKING:
|
|
8
|
-
from dtypeflow.core.dtype import Dtype
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class Compatibility(Enum):
|
|
12
|
-
FULL_RANGE_FIT = auto()
|
|
13
|
-
VALUES_PRESERVED = auto()
|
|
14
|
-
VALUES_NO_FIT = auto()
|
|
15
|
-
RANGE_NO_FIT = auto()
|
|
16
|
-
UNEVALUATED_NO_FIT = auto()
|
|
17
|
-
NOT_NUMERIC = auto()
|
|
18
|
-
OBSERVED_ONLY_FIT = auto()
|
|
19
|
-
DECIMAL_TRUNCATION = auto()
|
|
20
|
-
PRECISION_REDUCTION = auto()
|
|
21
|
-
BOOLEAN_MAPPING = auto()
|
|
22
|
-
DICTIONARY_ENCODING = auto()
|
|
23
|
-
DICTIONARY_INEFFICIENT = auto()
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class Candidate(ABC):
|
|
27
|
-
DTYPE: ClassVar[type[Dtype]]
|
|
28
|
-
|
|
29
|
-
def __init__(self, compatibility: Compatibility, /) -> None:
|
|
30
|
-
self._compatibility: Compatibility = compatibility
|
|
31
|
-
|
|
32
|
-
@property
|
|
33
|
-
def compatibility(self) -> Compatibility:
|
|
34
|
-
return self._compatibility
|
|
35
|
-
|
|
36
|
-
def __repr__(self) -> str:
|
|
37
|
-
return f"{type(self).__name__}(compatibility={self._compatibility.name})"
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import ABC
|
|
4
|
+
from enum import Enum, auto
|
|
5
|
+
from typing import TYPE_CHECKING, ClassVar
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from dtypeflow.core.dtype import Dtype
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Compatibility(Enum):
|
|
12
|
+
FULL_RANGE_FIT = auto()
|
|
13
|
+
VALUES_PRESERVED = auto()
|
|
14
|
+
VALUES_NO_FIT = auto()
|
|
15
|
+
RANGE_NO_FIT = auto()
|
|
16
|
+
UNEVALUATED_NO_FIT = auto()
|
|
17
|
+
NOT_NUMERIC = auto()
|
|
18
|
+
OBSERVED_ONLY_FIT = auto()
|
|
19
|
+
DECIMAL_TRUNCATION = auto()
|
|
20
|
+
PRECISION_REDUCTION = auto()
|
|
21
|
+
BOOLEAN_MAPPING = auto()
|
|
22
|
+
DICTIONARY_ENCODING = auto()
|
|
23
|
+
DICTIONARY_INEFFICIENT = auto()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Candidate(ABC):
|
|
27
|
+
DTYPE: ClassVar[type[Dtype]]
|
|
28
|
+
|
|
29
|
+
def __init__(self, compatibility: Compatibility, /) -> None:
|
|
30
|
+
self._compatibility: Compatibility = compatibility
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def compatibility(self) -> Compatibility:
|
|
34
|
+
return self._compatibility
|
|
35
|
+
|
|
36
|
+
def __repr__(self) -> str:
|
|
37
|
+
return f"{type(self).__name__}(compatibility={self._compatibility.name})"
|