Skip to content

Commit a83a17a

Browse files
committed
[MINOR] Python set log4j
1 parent 23bcd6d commit a83a17a

6 files changed

Lines changed: 165 additions & 1 deletion

File tree

.github/workflows/python.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,15 @@ jobs:
112112
export SYSTEMDS_ROOT=$(pwd)
113113
export PATH=$SYSTEMDS_ROOT/bin:$PATH
114114
export SYSDS_QUIET=1
115+
export LOG4JPROP=$SYSTEMDS_ROOT/src/test/resources/log4j.properties
115116
cd src/main/python
116117
unittest-parallel -t . -s tests
117118
# python -m unittest discover -s tests -p 'test_*.py'
118119
echo "Exit Status: " $?
119120
120121
- name: Run all python tests no environment
121122
run: |
123+
export LOG4JPROP=$(pwd)/src/test/resources/log4j.properties
122124
cd src/main/python
123125
unittest-parallel -t . -s tests
124126
# python -m unittest discover -s tests -p 'test_*.py'

src/main/python/systemds/operator/algorithm/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,11 @@
9090
from .builtin.img_posterize import img_posterize
9191
from .builtin.img_posterize_linearized import img_posterize_linearized
9292
from .builtin.img_rotate import img_rotate
93+
from .builtin.img_rotate_linearized import img_rotate_linearized
9394
from .builtin.img_sample_pairing import img_sample_pairing
95+
from .builtin.img_sample_pairing_linearized import img_sample_pairing_linearized
9496
from .builtin.img_shear import img_shear
97+
from .builtin.img_shear_linearized import img_shear_linearized
9598
from .builtin.img_transform import img_transform
9699
from .builtin.img_transform_linearized import img_transform_linearized
97100
from .builtin.img_translate import img_translate
@@ -263,8 +266,11 @@
263266
'img_posterize',
264267
'img_posterize_linearized',
265268
'img_rotate',
269+
'img_rotate_linearized',
266270
'img_sample_pairing',
271+
'img_sample_pairing_linearized',
267272
'img_shear',
273+
'img_shear_linearized',
268274
'img_transform',
269275
'img_transform_linearized',
270276
'img_translate',

src/main/python/systemds/operator/algorithm/builtin/auc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
def auc(Y: Matrix,
3333
P: Matrix):
3434
"""
35-
This builting function computes the area under the ROC curve (AUC)
35+
This builtin function computes the area under the ROC curve (AUC)
3636
for binary classifiers.
3737
3838
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# -------------------------------------------------------------
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
#
20+
# -------------------------------------------------------------
21+
22+
# Autogenerated By : src/main/python/generator/generator.py
23+
# Autogenerated From : scripts/builtin/img_rotate_linearized.dml
24+
25+
from typing import Dict, Iterable
26+
27+
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
28+
from systemds.script_building.dag import OutputType
29+
from systemds.utils.consts import VALID_INPUT_TYPES
30+
31+
32+
def img_rotate_linearized(img_in: Matrix,
33+
radians: float,
34+
fill_value: float,
35+
s_cols: int,
36+
s_rows: int):
37+
"""
38+
The Linearized Image Rotate function rotates the linearized input images counter-clockwise around the center.
39+
Uses nearest neighbor sampling.
40+
41+
42+
43+
:param img_in: Linearized input images as 2D matrix with top left corner at [1, 1]
44+
:param radians: The value by which to rotate in radian.
45+
:param fill_value: The background color revealed by the rotation
46+
:return: Output images in linearized form as 2D matrix with top left corner at [1, 1]
47+
"""
48+
49+
params_dict = {'img_in': img_in, 'radians': radians, 'fill_value': fill_value, 's_cols': s_cols, 's_rows': s_rows}
50+
return Matrix(img_in.sds_context,
51+
'img_rotate_linearized',
52+
named_input_nodes=params_dict)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# -------------------------------------------------------------
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
#
20+
# -------------------------------------------------------------
21+
22+
# Autogenerated By : src/main/python/generator/generator.py
23+
# Autogenerated From : scripts/builtin/img_sample_pairing_linearized.dml
24+
25+
from typing import Dict, Iterable
26+
27+
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
28+
from systemds.script_building.dag import OutputType
29+
from systemds.utils.consts import VALID_INPUT_TYPES
30+
31+
32+
def img_sample_pairing_linearized(img_in1: Matrix,
33+
img_in2: Matrix,
34+
weight: float):
35+
"""
36+
The image sample pairing function blends two images together.
37+
38+
39+
40+
:param img_in1: input matrix/image (every row is a linearized image)
41+
:param img_in2: Second input image (one image represented as a single row linearized matrix)
42+
:param weight: The weight given to the second image.
43+
0 means only img_in1, 1 means only img_in2 will be visible
44+
:return: Output image
45+
"""
46+
47+
params_dict = {'img_in1': img_in1, 'img_in2': img_in2, 'weight': weight}
48+
return Matrix(img_in1.sds_context,
49+
'img_sample_pairing_linearized',
50+
named_input_nodes=params_dict)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# -------------------------------------------------------------
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
#
20+
# -------------------------------------------------------------
21+
22+
# Autogenerated By : src/main/python/generator/generator.py
23+
# Autogenerated From : scripts/builtin/img_shear_linearized.dml
24+
25+
from typing import Dict, Iterable
26+
27+
from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn, Scalar
28+
from systemds.script_building.dag import OutputType
29+
from systemds.utils.consts import VALID_INPUT_TYPES
30+
31+
32+
def img_shear_linearized(img_in: Matrix,
33+
shear_x: float,
34+
shear_y: float,
35+
fill_value: float,
36+
s_cols: int,
37+
s_rows: int):
38+
"""
39+
This function applies a shearing transformation to linearized images.
40+
Uses nearest neighbor sampling.
41+
42+
43+
44+
:param img_in: Linearized input images as 2D matrix with top left corner at [1, 1]
45+
:param shear_x: Shearing factor for horizontal shearing
46+
:param shear_y: Shearing factor for vertical shearing
47+
:param fill_value: The background color revealed by the shearing
48+
:return: Output images in linearized form as 2D matrix with top left corner at [1, 1]
49+
"""
50+
51+
params_dict = {'img_in': img_in, 'shear_x': shear_x, 'shear_y': shear_y, 'fill_value': fill_value, 's_cols': s_cols, 's_rows': s_rows}
52+
return Matrix(img_in.sds_context,
53+
'img_shear_linearized',
54+
named_input_nodes=params_dict)

0 commit comments

Comments
 (0)