Skip to content

Commit

Permalink
flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brifordwylie committed Jan 16, 2024
1 parent 1ebcf4e commit 5623b08
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py39, py310 flake8
envlist = py39, py310, flake8

[testenv]
setenv =
Expand All @@ -20,14 +20,14 @@ commands =
flake8 zat/ setup.py

[testenv:codecov]
passenv = CI TRAVIS TRAVIS_*
passenv = CI,TRAVIS,TRAVIS_*
deps =
codecov
commands =
codecov

[testenv:coveralls]
passenv = CI TRAVIS TRAVIS_*
passenv = CI,TRAVIS,TRAVIS_*
deps =
coveralls
usedevelop = true
Expand Down
12 changes: 6 additions & 6 deletions zat/dataframe_to_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,22 +246,22 @@ def test():
print('FIT-TRANSFORM')
norm_matrix = to_matrix_norm.fit_transform(test_df)
print(norm_matrix)
assert(norm_matrix[:, 0].min() == 0)
assert(norm_matrix[:, 0].max() == 1)
assert (norm_matrix[:, 0].min() == 0)
assert (norm_matrix[:, 0].max() == 1)

# Make sure normalize 'does the right thing' when doing transform
print('TRANSFORM')
norm_matrix2 = to_matrix_norm.transform(test_df2)
assert(norm_matrix2[:, 0].min() == 0)
assert(norm_matrix2[:, 0].max() == 2) # Normalization is based on FIT range
assert (norm_matrix2[:, 0].min() == 0)
assert (norm_matrix2[:, 0].max() == 2) # Normalization is based on FIT range

# Test div by zero in normalize
test_df3 = test_df2.copy()
test_df3['D'] = [1, 1, 1, 1]
print('FIT-TRANSFORM')
norm_matrix3 = to_matrix_norm.fit_transform(test_df3)
assert(norm_matrix3[:, 0].min() == 1)
assert(norm_matrix3[:, 0].max() == 1)
assert (norm_matrix3[:, 0].min() == 1)
assert (norm_matrix3[:, 0].max() == 1)

# Test serialization
temp = NamedTemporaryFile(delete=False)
Expand Down
2 changes: 0 additions & 2 deletions zat/log_to_sparkdf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""LogToSparkDF: Converts a Zeek log to a Spark DataFrame"""

import sys

# Third Party
try:
from pyspark.sql.types import StructType, StringType, IntegerType, FloatType, LongType, DoubleType
Expand Down

0 comments on commit 5623b08

Please sign in to comment.