maxframe 1.0.0rc2__cp310-cp310-win_amd64.whl → 1.0.0rc3__cp310-cp310-win_amd64.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.
Potentially problematic release.
This version of maxframe might be problematic. Click here for more details.
- maxframe/_utils.cp310-win_amd64.pyd +0 -0
- maxframe/codegen.py +3 -2
- maxframe/config/config.py +16 -9
- maxframe/config/validators.py +42 -12
- maxframe/conftest.py +13 -2
- maxframe/core/__init__.py +2 -13
- maxframe/core/entity/__init__.py +0 -4
- maxframe/core/entity/objects.py +45 -2
- maxframe/core/entity/output_types.py +0 -3
- maxframe/core/entity/tests/test_objects.py +43 -0
- maxframe/core/entity/tileables.py +5 -78
- maxframe/core/graph/__init__.py +2 -2
- maxframe/core/graph/builder/__init__.py +0 -1
- maxframe/core/graph/builder/base.py +5 -4
- maxframe/core/graph/builder/tileable.py +4 -4
- maxframe/core/graph/builder/utils.py +4 -8
- maxframe/core/graph/core.cp310-win_amd64.pyd +0 -0
- maxframe/core/graph/entity.py +9 -33
- maxframe/core/operator/__init__.py +2 -9
- maxframe/core/operator/base.py +3 -5
- maxframe/core/operator/objects.py +0 -9
- maxframe/core/operator/utils.py +55 -0
- maxframe/dataframe/datasource/read_odps_query.py +1 -1
- maxframe/dataframe/datasource/read_odps_table.py +1 -1
- maxframe/dataframe/datastore/to_odps.py +1 -1
- maxframe/dataframe/operators.py +1 -17
- maxframe/dataframe/reduction/core.py +2 -2
- maxframe/io/objects/__init__.py +24 -0
- maxframe/io/objects/core.py +140 -0
- maxframe/io/objects/tensor.py +76 -0
- maxframe/io/objects/tests/__init__.py +13 -0
- maxframe/io/objects/tests/test_object_io.py +97 -0
- maxframe/{odpsio → io/odpsio}/__init__.py +2 -0
- maxframe/{odpsio → io/odpsio}/arrow.py +4 -4
- maxframe/{odpsio → io/odpsio}/schema.py +5 -5
- maxframe/{odpsio → io/odpsio}/tableio.py +10 -4
- maxframe/io/odpsio/tests/__init__.py +13 -0
- maxframe/{odpsio → io/odpsio}/tests/test_schema.py +3 -3
- maxframe/{odpsio → io/odpsio}/tests/test_tableio.py +3 -3
- maxframe/{odpsio → io/odpsio}/tests/test_volumeio.py +4 -6
- maxframe/io/odpsio/volumeio.py +57 -0
- maxframe/learn/contrib/xgboost/classifier.py +26 -2
- maxframe/learn/contrib/xgboost/core.py +87 -2
- maxframe/learn/contrib/xgboost/dmatrix.py +1 -4
- maxframe/learn/contrib/xgboost/predict.py +19 -5
- maxframe/learn/contrib/xgboost/regressor.py +3 -10
- maxframe/learn/contrib/xgboost/train.py +25 -15
- maxframe/{core/operator/fuse.py → learn/core.py} +7 -10
- maxframe/lib/mmh3.cp310-win_amd64.pyd +0 -0
- maxframe/protocol.py +1 -15
- maxframe/remote/core.py +4 -8
- maxframe/serialization/__init__.py +1 -0
- maxframe/serialization/core.cp310-win_amd64.pyd +0 -0
- maxframe/tensor/__init__.py +10 -2
- maxframe/tensor/arithmetic/isclose.py +1 -0
- maxframe/tensor/arithmetic/tests/test_arithmetic.py +21 -17
- maxframe/tensor/core.py +5 -136
- maxframe/tensor/datasource/array.py +3 -0
- maxframe/tensor/datasource/full.py +1 -1
- maxframe/tensor/datasource/tests/test_datasource.py +1 -1
- maxframe/tensor/indexing/flatnonzero.py +1 -1
- maxframe/tensor/merge/__init__.py +2 -0
- maxframe/tensor/merge/concatenate.py +98 -0
- maxframe/tensor/merge/tests/test_merge.py +30 -1
- maxframe/tensor/merge/vstack.py +70 -0
- maxframe/tensor/{base → misc}/__init__.py +2 -0
- maxframe/tensor/{base → misc}/atleast_1d.py +0 -2
- maxframe/tensor/misc/atleast_2d.py +70 -0
- maxframe/tensor/misc/atleast_3d.py +85 -0
- maxframe/tensor/misc/tests/__init__.py +13 -0
- maxframe/tensor/{base → misc}/transpose.py +22 -18
- maxframe/tensor/operators.py +1 -7
- maxframe/tensor/random/core.py +1 -1
- maxframe/tensor/reduction/count_nonzero.py +1 -0
- maxframe/tensor/reduction/mean.py +1 -0
- maxframe/tensor/reduction/nanmean.py +1 -0
- maxframe/tensor/reduction/nanvar.py +2 -0
- maxframe/tensor/reduction/tests/test_reduction.py +12 -1
- maxframe/tensor/reduction/var.py +2 -0
- maxframe/tensor/utils.py +2 -22
- maxframe/typing_.py +4 -1
- maxframe/udf.py +8 -9
- maxframe/utils.py +15 -61
- maxframe-1.0.0rc3.dist-info/METADATA +104 -0
- {maxframe-1.0.0rc2.dist-info → maxframe-1.0.0rc3.dist-info}/RECORD +101 -91
- {maxframe-1.0.0rc2.dist-info → maxframe-1.0.0rc3.dist-info}/WHEEL +1 -1
- maxframe_client/fetcher.py +23 -42
- maxframe_client/session/graph.py +8 -2
- maxframe_client/session/odps.py +54 -18
- maxframe_client/tests/test_fetcher.py +1 -1
- maxframe_client/tests/test_session.py +14 -2
- maxframe/core/entity/chunks.py +0 -68
- maxframe/core/entity/fuse.py +0 -73
- maxframe/core/graph/builder/chunk.py +0 -430
- maxframe/odpsio/volumeio.py +0 -95
- maxframe-1.0.0rc2.dist-info/METADATA +0 -177
- /maxframe/{odpsio → core/entity}/tests/__init__.py +0 -0
- /maxframe/{tensor/base/tests → io}/__init__.py +0 -0
- /maxframe/{odpsio → io/odpsio}/tests/test_arrow.py +0 -0
- /maxframe/tensor/{base → misc}/astype.py +0 -0
- /maxframe/tensor/{base → misc}/broadcast_to.py +0 -0
- /maxframe/tensor/{base → misc}/ravel.py +0 -0
- /maxframe/tensor/{base/tests/test_base.py → misc/tests/test_misc.py} +0 -0
- /maxframe/tensor/{base → misc}/unique.py +0 -0
- /maxframe/tensor/{base → misc}/where.py +0 -0
- {maxframe-1.0.0rc2.dist-info → maxframe-1.0.0rc3.dist-info}/top_level.txt +0 -0
maxframe/odpsio/volumeio.py
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# Copyright 1999-2024 Alibaba Group Holding Ltd.
|
|
2
|
-
#
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
#
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
#
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
from typing import List, Optional
|
|
16
|
-
|
|
17
|
-
from odps import ODPS
|
|
18
|
-
from odps.models import ExternalVolume, PartedVolume
|
|
19
|
-
from odps.tunnel.volumetunnel import VolumeTunnel
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class ODPSVolumeReader:
|
|
23
|
-
def __init__(self, odps_entry: ODPS, volume_name: str, volume_dir: str):
|
|
24
|
-
self._odps_entry = odps_entry
|
|
25
|
-
self._volume = odps_entry.get_volume(volume_name)
|
|
26
|
-
self._volume_dir = volume_dir
|
|
27
|
-
|
|
28
|
-
def list_files(self) -> List[str]:
|
|
29
|
-
def _get_file_name(vol_file):
|
|
30
|
-
if hasattr(vol_file, "name"):
|
|
31
|
-
return vol_file.name
|
|
32
|
-
return vol_file.path.rsplit("/", 1)[-1]
|
|
33
|
-
|
|
34
|
-
return [
|
|
35
|
-
_get_file_name(f)
|
|
36
|
-
for f in self._odps_entry.list_volume_files(
|
|
37
|
-
f"/{self._volume.name}/{self._volume_dir}"
|
|
38
|
-
)
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
def read_file(self, file_name: str) -> bytes:
|
|
42
|
-
if isinstance(self._volume, PartedVolume):
|
|
43
|
-
vol_tunnel = VolumeTunnel(self._odps_entry)
|
|
44
|
-
session = vol_tunnel.create_download_session(
|
|
45
|
-
self._volume, self._volume_dir, file_name
|
|
46
|
-
)
|
|
47
|
-
with session.open() as reader:
|
|
48
|
-
return reader.read()
|
|
49
|
-
elif isinstance(self._volume, ExternalVolume):
|
|
50
|
-
with self._volume.open_reader(self._volume_dir + "/" + file_name) as reader:
|
|
51
|
-
return reader.read()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class ODPSVolumeWriter:
|
|
55
|
-
def __init__(self, odps_entry: ODPS, volume_name: str, volume_dir: str):
|
|
56
|
-
self._odps_entry = odps_entry
|
|
57
|
-
self._volume = odps_entry.get_volume(volume_name)
|
|
58
|
-
self._volume_dir = volume_dir
|
|
59
|
-
self._session_cache = None
|
|
60
|
-
|
|
61
|
-
def create_write_session(self) -> Optional[str]:
|
|
62
|
-
if not isinstance(self._volume, PartedVolume):
|
|
63
|
-
return None
|
|
64
|
-
vol_tunnel = VolumeTunnel(self._odps_entry)
|
|
65
|
-
session = self._session_cache = vol_tunnel.create_upload_session(
|
|
66
|
-
self._volume, self._volume_dir
|
|
67
|
-
)
|
|
68
|
-
return session.id
|
|
69
|
-
|
|
70
|
-
def _get_existing_upload_session(self, write_session_id: Optional[str]):
|
|
71
|
-
if self._session_cache is not None and (
|
|
72
|
-
write_session_id is None or write_session_id == self._session_cache.id
|
|
73
|
-
):
|
|
74
|
-
return self._session_cache
|
|
75
|
-
vol_tunnel = VolumeTunnel(self._odps_entry)
|
|
76
|
-
return vol_tunnel.create_upload_session(
|
|
77
|
-
self._volume, self._volume_dir, write_session_id
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
def write_file(
|
|
81
|
-
self, file_name: str, data: bytes, write_session_id: Optional[str] = None
|
|
82
|
-
):
|
|
83
|
-
if isinstance(self._volume, PartedVolume):
|
|
84
|
-
session = self._get_existing_upload_session(write_session_id)
|
|
85
|
-
with session.open(file_name) as writer:
|
|
86
|
-
writer.write(data)
|
|
87
|
-
elif isinstance(self._volume, ExternalVolume):
|
|
88
|
-
with self._volume.open_writer(self._volume_dir + "/" + file_name) as writer:
|
|
89
|
-
writer.write(data)
|
|
90
|
-
|
|
91
|
-
def commit(self, files: List[str], write_session_id: Optional[str] = None):
|
|
92
|
-
if not isinstance(self._volume, PartedVolume):
|
|
93
|
-
return None
|
|
94
|
-
session = self._get_existing_upload_session(write_session_id)
|
|
95
|
-
session.commit(files)
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: maxframe
|
|
3
|
-
Version: 1.0.0rc2
|
|
4
|
-
Summary: MaxFrame operator-based data analyze framework
|
|
5
|
-
Requires-Dist: numpy <2.0.0,>=1.19.0
|
|
6
|
-
Requires-Dist: pandas >=1.0.0
|
|
7
|
-
Requires-Dist: pyodps >=0.11.6.1
|
|
8
|
-
Requires-Dist: scipy >=1.0
|
|
9
|
-
Requires-Dist: pyarrow >=1.0.0
|
|
10
|
-
Requires-Dist: msgpack >=1.0.0
|
|
11
|
-
Requires-Dist: traitlets >=5.0
|
|
12
|
-
Requires-Dist: cloudpickle >=1.5.0
|
|
13
|
-
Requires-Dist: pyyaml >=5.1
|
|
14
|
-
Requires-Dist: tornado >=6.0
|
|
15
|
-
Requires-Dist: defusedxml >=0.5.0
|
|
16
|
-
Requires-Dist: tqdm >=4.1.0
|
|
17
|
-
Requires-Dist: importlib-metadata >=1.4
|
|
18
|
-
Requires-Dist: pickle5 ; python_version < "3.8"
|
|
19
|
-
Provides-Extra: dev
|
|
20
|
-
Requires-Dist: black >=22.3.0 ; extra == 'dev'
|
|
21
|
-
Requires-Dist: flake8 >=5.0.4 ; extra == 'dev'
|
|
22
|
-
Requires-Dist: pre-commit >=2.15.0 ; extra == 'dev'
|
|
23
|
-
Requires-Dist: graphviz >=0.20.1 ; extra == 'dev'
|
|
24
|
-
Provides-Extra: test
|
|
25
|
-
Requires-Dist: mock ; extra == 'test'
|
|
26
|
-
Requires-Dist: pytest >=7.3.1 ; extra == 'test'
|
|
27
|
-
Requires-Dist: pytest-cov >=4.1.0 ; extra == 'test'
|
|
28
|
-
Requires-Dist: pytest-asyncio >=0.21.0 ; extra == 'test'
|
|
29
|
-
Requires-Dist: pytest-timeout >=2.1.0 ; extra == 'test'
|
|
30
|
-
Requires-Dist: matplotlib >=2.0.0 ; extra == 'test'
|
|
31
|
-
|
|
32
|
-
MaxCompute MaxFrame Client
|
|
33
|
-
==========================
|
|
34
|
-
|
|
35
|
-
MaxFrame is a computational framework created by Alibaba Cloud to
|
|
36
|
-
provide a way for Python developers to parallelize their code with
|
|
37
|
-
MaxCompute. It creates a runnable computation graph locally, submits it
|
|
38
|
-
to MaxCompute to execute and obtains results from MaxCompute.
|
|
39
|
-
|
|
40
|
-
MaxFrame client is the client of MaxFrame. Currently it provides a
|
|
41
|
-
DataFrame-based SDK with compatible APIs for pandas. In future, other
|
|
42
|
-
common Python libraries like numpy and scikit-learn will be added as
|
|
43
|
-
well. Python 3.7 is recommended for MaxFrame client to enable all
|
|
44
|
-
functionalities while supports for higher Python versions are on the
|
|
45
|
-
way.
|
|
46
|
-
|
|
47
|
-
Installation
|
|
48
|
-
------------
|
|
49
|
-
|
|
50
|
-
You may install MaxFrame client through PIP:
|
|
51
|
-
|
|
52
|
-
.. code:: bash
|
|
53
|
-
|
|
54
|
-
pip install maxframe
|
|
55
|
-
|
|
56
|
-
Latest beta version can be installed with ``--pre`` argument:
|
|
57
|
-
|
|
58
|
-
.. code:: bash
|
|
59
|
-
|
|
60
|
-
pip install --pre maxframe
|
|
61
|
-
|
|
62
|
-
You can also install MaxFrame client from source code:
|
|
63
|
-
|
|
64
|
-
.. code:: bash
|
|
65
|
-
|
|
66
|
-
pip install git+https://github.com/aliyun/alibabacloud-odps-maxframe-client.git
|
|
67
|
-
|
|
68
|
-
Getting started
|
|
69
|
-
---------------
|
|
70
|
-
|
|
71
|
-
We show a simple code example of MaxFrame client which read data from a
|
|
72
|
-
MaxCompute table, performs some simple data transform and writes back
|
|
73
|
-
into MaxCompute.
|
|
74
|
-
|
|
75
|
-
.. code:: python
|
|
76
|
-
|
|
77
|
-
import maxframe.dataframe as md
|
|
78
|
-
import os
|
|
79
|
-
from maxframe import new_session
|
|
80
|
-
from odps import ODPS
|
|
81
|
-
|
|
82
|
-
o = ODPS(
|
|
83
|
-
os.getenv('ALIBABA_CLOUD_ACCESS_KEY_ID'),
|
|
84
|
-
os.getenv('ALIBABA_CLOUD_ACCESS_KEY_SECRET'),
|
|
85
|
-
project='your-default-project',
|
|
86
|
-
endpoint='your-end-point',
|
|
87
|
-
)
|
|
88
|
-
session = new_session(o)
|
|
89
|
-
|
|
90
|
-
df = md.read_odps_table("source_table")
|
|
91
|
-
df["A"] = "prefix_" + df["A"]
|
|
92
|
-
md.to_odps_table(df, "prefix_source_table")
|
|
93
|
-
|
|
94
|
-
Documentation
|
|
95
|
-
-------------
|
|
96
|
-
|
|
97
|
-
Detailed documentations can be found
|
|
98
|
-
`here <https://maxframe.readthedocs.io>`__.
|
|
99
|
-
|
|
100
|
-
License
|
|
101
|
-
-------
|
|
102
|
-
|
|
103
|
-
Licensed under the `Apache License
|
|
104
|
-
2.0 <https://www.apache.org/licenses/LICENSE-2.0.html>`__.
|
|
105
|
-
MaxCompute MaxFrame Client
|
|
106
|
-
==========================
|
|
107
|
-
|
|
108
|
-
MaxFrame is a computational framework created by Alibaba Cloud to
|
|
109
|
-
provide a way for Python developers to parallelize their code with
|
|
110
|
-
MaxCompute. It creates a runnable computation graph locally, submits it
|
|
111
|
-
to MaxCompute to execute and obtains results from MaxCompute.
|
|
112
|
-
|
|
113
|
-
MaxFrame client is the client of MaxFrame. Currently it provides a
|
|
114
|
-
DataFrame-based SDK with compatible APIs for pandas. In future, other
|
|
115
|
-
common Python libraries like numpy and scikit-learn will be added as
|
|
116
|
-
well. Python 3.7 is recommended for MaxFrame client to enable all
|
|
117
|
-
functionalities while supports for higher Python versions are on the
|
|
118
|
-
way.
|
|
119
|
-
|
|
120
|
-
Installation
|
|
121
|
-
------------
|
|
122
|
-
|
|
123
|
-
You may install MaxFrame client through PIP:
|
|
124
|
-
|
|
125
|
-
.. code:: bash
|
|
126
|
-
|
|
127
|
-
pip install maxframe
|
|
128
|
-
|
|
129
|
-
Latest beta version can be installed with ``--pre`` argument:
|
|
130
|
-
|
|
131
|
-
.. code:: bash
|
|
132
|
-
|
|
133
|
-
pip install --pre maxframe
|
|
134
|
-
|
|
135
|
-
You can also install MaxFrame client from source code:
|
|
136
|
-
|
|
137
|
-
.. code:: bash
|
|
138
|
-
|
|
139
|
-
pip install git+https://github.com/aliyun/alibabacloud-odps-maxframe-client.git
|
|
140
|
-
|
|
141
|
-
Getting started
|
|
142
|
-
---------------
|
|
143
|
-
|
|
144
|
-
We show a simple code example of MaxFrame client which read data from a
|
|
145
|
-
MaxCompute table, performs some simple data transform and writes back
|
|
146
|
-
into MaxCompute.
|
|
147
|
-
|
|
148
|
-
.. code:: python
|
|
149
|
-
|
|
150
|
-
import maxframe.dataframe as md
|
|
151
|
-
import os
|
|
152
|
-
from maxframe import new_session
|
|
153
|
-
from odps import ODPS
|
|
154
|
-
|
|
155
|
-
o = ODPS(
|
|
156
|
-
os.getenv('ALIBABA_CLOUD_ACCESS_KEY_ID'),
|
|
157
|
-
os.getenv('ALIBABA_CLOUD_ACCESS_KEY_SECRET'),
|
|
158
|
-
project='your-default-project',
|
|
159
|
-
endpoint='your-end-point',
|
|
160
|
-
)
|
|
161
|
-
session = new_session(o)
|
|
162
|
-
|
|
163
|
-
df = md.read_odps_table("source_table")
|
|
164
|
-
df["A"] = "prefix_" + df["A"]
|
|
165
|
-
md.to_odps_table(df, "prefix_source_table")
|
|
166
|
-
|
|
167
|
-
Documentation
|
|
168
|
-
-------------
|
|
169
|
-
|
|
170
|
-
Detailed documentations can be found
|
|
171
|
-
`here <https://maxframe.readthedocs.io>`__.
|
|
172
|
-
|
|
173
|
-
License
|
|
174
|
-
-------
|
|
175
|
-
|
|
176
|
-
Licensed under the `Apache License
|
|
177
|
-
2.0 <https://www.apache.org/licenses/LICENSE-2.0.html>`__.
|
|
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
|