Skip to content

Commit

Permalink
Updates pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahbenizzy committed Nov 28, 2023
1 parent d17f1ed commit 8f7b144
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 31 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

repos:
- repo: https://github.com/ambv/black
rev: 22.3.0
rev: 23.11.0
hooks:
- id: black
args: [--line-length=100]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
# ensures files are either empty or end with a blank line
Expand All @@ -21,12 +21,12 @@ repos:
# valid python file
- id: check-ast
# isort python package import sorting
- repo: https://github.com/pre-commit/mirrors-isort
rev: 'v5.10.1'
- repo: https://github.com/pycqa/isort
rev: '5.12.0'
hooks:
- id: isort
args: ["--profile", "black", --line-length=100]
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 6.1.0
hooks:
- id: flake8
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from tqdm import tqdm
import litellm


from hamilton.function_modifiers import config


Expand Down Expand Up @@ -182,7 +181,6 @@ def summarized_text(
if __name__ == "__main__":
# run as a script to test Hamilton's execution
import __init__ as text_summarization

from hamilton import base, driver

dr = driver.Driver(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# Code to create an imaging showing on DAG workflow.
# run as a script to test Hamilton's execution
import __init__ as MODULE_NAME

from hamilton import base, driver

dr = driver.Driver(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def spend_zero_mean_unit_variance(spend_zero_mean: pd.Series, spend_std_dev: flo
if __name__ == "__main__":
# run as a script to test Hamilton's execution
import __init__ as hello_world

from hamilton import base, driver

dr = driver.Driver(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ def inference_plot(

if __name__ == "__main__":
import __init__ as nixtla_mlforecast

from hamilton import driver

dr = driver.Builder().with_modules(nixtla_mlforecast).build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ def inference_plot(
if __name__ == "__main__":
# run as a script to test Hamilton's execution
import __init__ as nixtla_statsforecast

from hamilton import driver

dr = driver.Driver(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from tenacity import retry, stop_after_attempt, wait_random_exponential
from tqdm import tqdm


from hamilton.function_modifiers import config


Expand Down Expand Up @@ -180,7 +179,6 @@ def summarized_text(
if __name__ == "__main__":
# run as a script to test Hamilton's execution
import __init__ as text_summarization

from hamilton import base, driver

dr = driver.Driver(
Expand Down
15 changes: 10 additions & 5 deletions contrib/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
max-line-length = 100
exclude = build/,.git/,venv/
ignore =
E203, # whitespace before ':' \
E402, # module level import not at top of file \
E501, # line too long \
W503, # line break before binary operator \
W605 # invalid escape sequence
# whitespace before ':'
E203,
# module level import not at top of file
E402,
# line too long
E501,
# line break before binary operator
W503,
# invalid escape sequence
W605
1 change: 0 additions & 1 deletion examples/data_quality/pandera/run_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from hamilton.plugins import h_ray

if __name__ == "__main__":

logging.basicConfig(stream=sys.stdout)
logger = logging.getLogger(__name__)
# Setup a local cluster.
Expand Down
1 change: 0 additions & 1 deletion examples/data_quality/simple/run_ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from hamilton.plugins import h_ray

if __name__ == "__main__":

logging.basicConfig(stream=sys.stdout)
logger = logging.getLogger(__name__)
# Setup a local cluster.
Expand Down
1 change: 0 additions & 1 deletion examples/decoupling_io/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@

@dataclasses.dataclass
class SklearnPlotSaver(DataSaver):

path: Union[str, PathLike]
# kwargs
dpi: float = 200
Expand Down
1 change: 0 additions & 1 deletion examples/model_examples/time-series/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def reduce_mem_usage(df: pd.DataFrame, name: str, verbose=True):
for col in df.columns:
col_type = df[col].dtypes
if col_type in numerics:

c_min = df[col].min()
c_max = df[col].max()
if str(col_type)[:3] == "int":
Expand Down
1 change: 0 additions & 1 deletion hamilton/dataflows/template/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# Code to create an imaging showing on DAG workflow.
# run as a script to test Hamilton's execution
import __init__ as MODULE_NAME

from hamilton import base, driver

dr = driver.Driver(
Expand Down
2 changes: 1 addition & 1 deletion hamilton/experimental/h_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def new_fn(fn=callabl, **fn_kwargs):
task_dict = {key: process_value(value) for key, value in fn_kwargs.items()}
fn_kwargs = await await_dict_of_tasks(task_dict)
if inspect.iscoroutinefunction(fn):
return await (fn(**fn_kwargs))
return await fn(**fn_kwargs)
return fn(**fn_kwargs)

coroutine = new_fn(**kwargs)
Expand Down
1 change: 0 additions & 1 deletion hamilton/plugins/sklearn_plot_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@

@dataclasses.dataclass
class SklearnPlotSaver(DataSaver):

path: Union[str, PathLike]
# kwargs
dpi: float = 200
Expand Down
15 changes: 10 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
max-line-length = 100
exclude = build/,.git/,venv/
ignore =
E203, # whitespace before ':' \
E402, # module level import not at top of file \
E501, # line too long \
W503, # line break before binary operator \
W605 # invalid escape sequence
# whitespace before ':'
E203,
# module level import not at top of file
E402,
# line too long
E501,
# line break before binary operator
W503,
# invalid escape sequence
W605
1 change: 0 additions & 1 deletion writeups/garbage_collection/memory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def foo_i(foo_i_minus_one: pd.DataFrame) -> pd.DataFrame:


if __name__ == "__main__":

import os

import psutil
Expand Down

0 comments on commit 8f7b144

Please sign in to comment.