maxframe 1.0.0rc2__cp37-cp37m-win32.whl → 1.0.0rc3__cp37-cp37m-win32.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.cp37-win32.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.cp37-win32.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.cp37-win32.pyd +0 -0
- maxframe/protocol.py +1 -15
- maxframe/remote/core.py +4 -8
- maxframe/serialization/__init__.py +1 -0
- maxframe/serialization/core.cp37-win32.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.0rc2.dist-info → maxframe-1.0.0rc3.dist-info}/METADATA +2 -75
- {maxframe-1.0.0rc2.dist-info → maxframe-1.0.0rc3.dist-info}/RECORD +101 -91
- 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/{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}/WHEEL +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)
|
|
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
|