Skip to content

Commit 37e51ab

Browse files
authored
refactoring (#362), remove absolute imports
1 parent 9b34fc4 commit 37e51ab

30 files changed

+73
-81
lines changed

onnxmltools/convert/lightgbm/convert.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@
55
# --------------------------------------------------------------------------
66

77
from uuid import uuid4
8-
98
import lightgbm
10-
11-
from onnxmltools.convert.lightgbm._parse import WrappedBooster
129
from ...proto import onnx, get_opset_number_from_onnx
1310
from ..common._topology import convert_topology
14-
from ._parse import parse_lightgbm
11+
from ._parse import parse_lightgbm, WrappedBooster
1512

1613
# Invoke the registration of all our converters and shape calculators
1714
# from . import shape_calculators

onnxmltools/convert/sparkml/operator_converters/aft_survival_regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import collections
77

88
from onnx import onnx_pb as onnx_proto
9-
from onnxmltools.convert.common._apply_operation import apply_matmul, apply_exp, apply_add
9+
from ...common._apply_operation import apply_matmul, apply_exp, apply_add
1010
from ...common._registration import register_converter, register_shape_calculator
11-
from onnxmltools.convert.common.data_types import FloatTensorType
11+
from ...common.data_types import FloatTensorType
1212
from ...common.utils import check_input_and_output_numbers
1313

1414

onnxmltools/convert/sparkml/operator_converters/binarizer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
# license information.
55
# --------------------------------------------------------------------------
66
import copy
7-
8-
from onnxmltools.convert.common.data_types import Int64TensorType, FloatTensorType
9-
from onnxmltools.convert.common.utils import check_input_and_output_numbers, check_input_and_output_types
7+
from ...common.data_types import Int64TensorType, FloatTensorType
8+
from ...common.utils import check_input_and_output_numbers, check_input_and_output_types
109
from ...common._registration import register_converter, register_shape_calculator
1110

1211

onnxmltools/convert/sparkml/operator_converters/bucketed_random_projection_lsh.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
# license information.
55
# --------------------------------------------------------------------------
66
import numpy
7-
8-
from onnxmltools.convert.common._apply_operation import apply_floor, apply_div, apply_matmul
9-
from onnxmltools.convert.sparkml.operator_converters.tree_ensemble_common import save_read_sparkml_model_data
107
from onnx import onnx_pb as onnx_proto
8+
from ...common._apply_operation import apply_floor, apply_div, apply_matmul
119
from ...common._registration import register_converter, register_shape_calculator
1210
from ...common.data_types import FloatTensorType
1311
from ...common.utils import check_input_and_output_numbers, check_input_and_output_types
12+
from .tree_ensemble_common import save_read_sparkml_model_data
1413

1514
g_rand_vectors = None
1615

onnxmltools/convert/sparkml/operator_converters/bucketizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# --------------------------------------------------------------------------
66
import copy
77
from onnx import onnx_pb as onnx_proto
8-
from onnxmltools.convert.common.data_types import FloatTensorType
9-
from onnxmltools.convert.common.utils import check_input_and_output_numbers, check_input_and_output_types
8+
from ...common.data_types import FloatTensorType
9+
from ...common.utils import check_input_and_output_numbers, check_input_and_output_types
1010
from ...common._registration import register_converter, register_shape_calculator
1111

1212

onnxmltools/convert/sparkml/operator_converters/chi_sq_selector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import copy
77
from ...common._registration import register_converter, register_shape_calculator
88
from ...common.utils import check_input_and_output_numbers, check_input_and_output_types
9-
from onnxmltools.convert.common.data_types import *
9+
from ...common.data_types import *
1010

1111

1212
def convert_chi_sq_selector(scope, operator, container):

onnxmltools/convert/sparkml/operator_converters/dct.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
import numpy
1111

12-
from onnxmltools.convert.common.data_types import FloatTensorType
13-
from onnxmltools.convert.common.utils import check_input_and_output_numbers, check_input_and_output_types
14-
from onnxmltools.convert.common._apply_operation import apply_matmul, apply_mul
12+
from ...common.data_types import FloatTensorType
13+
from ...common.utils import check_input_and_output_numbers, check_input_and_output_types
14+
from ...common._apply_operation import apply_matmul, apply_mul
1515
from ...common._registration import register_converter, register_shape_calculator
1616

1717

onnxmltools/convert/sparkml/operator_converters/decision_tree_classifier.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
from onnxmltools.convert.common.data_types import Int64TensorType, FloatTensorType
7-
from onnxmltools.convert.common.tree_ensemble import get_default_tree_classifier_attribute_pairs, \
6+
from ...common.data_types import Int64TensorType, FloatTensorType
7+
from ...common.tree_ensemble import get_default_tree_classifier_attribute_pairs, \
88
add_tree_to_attribute_pairs
9-
from onnxmltools.convert.common.utils import check_input_and_output_numbers, check_input_and_output_types
10-
from onnxmltools.convert.sparkml.operator_converters.tree_ensemble_common import save_read_sparkml_model_data, \
11-
sparkml_tree_dataset_to_sklearn
9+
from ...common.utils import check_input_and_output_numbers, check_input_and_output_types
1210
from ...common._registration import register_converter, register_shape_calculator
11+
from .tree_ensemble_common import save_read_sparkml_model_data, \
12+
sparkml_tree_dataset_to_sklearn
1313

1414

1515
def convert_decision_tree_classifier(scope, operator, container):

onnxmltools/convert/sparkml/operator_converters/decision_tree_regressor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
from onnxmltools.convert.common.data_types import FloatTensorType
7-
from onnxmltools.convert.common.tree_ensemble import add_tree_to_attribute_pairs, \
6+
from ...common.data_types import FloatTensorType
7+
from ...common.tree_ensemble import add_tree_to_attribute_pairs, \
88
get_default_tree_regressor_attribute_pairs
9-
from onnxmltools.convert.common.utils import check_input_and_output_numbers
10-
from onnxmltools.convert.sparkml.operator_converters.decision_tree_classifier import save_read_sparkml_model_data
11-
from onnxmltools.convert.sparkml.operator_converters.tree_ensemble_common import sparkml_tree_dataset_to_sklearn
9+
from ...common.utils import check_input_and_output_numbers
10+
from ...sparkml.operator_converters.decision_tree_classifier import save_read_sparkml_model_data
11+
from ...sparkml.operator_converters.tree_ensemble_common import sparkml_tree_dataset_to_sklearn
1212
from ...common._registration import register_converter, register_shape_calculator
1313

1414

onnxmltools/convert/sparkml/operator_converters/element_wise_product.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# license information.
55
# --------------------------------------------------------------------------
66
from onnx import onnx_pb as onnx_proto
7-
from onnxmltools.convert.common.data_types import FloatTensorType
8-
from onnxmltools.convert.common.utils import check_input_and_output_numbers, check_input_and_output_types
9-
from onnxmltools.convert.common._apply_operation import apply_mul
7+
from ...common.data_types import FloatTensorType
8+
from ...common.utils import check_input_and_output_numbers, check_input_and_output_types
9+
from ...common._apply_operation import apply_mul
1010
from ...common._registration import register_converter, register_shape_calculator
1111

1212

0 commit comments

Comments
 (0)