Skip to content

Commit

Permalink
Updates pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahbenizzy committed Nov 28, 2023
1 parent 7a5ce7c commit 768d0eb
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 23 deletions.
6 changes: 3 additions & 3 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 @@ -27,6 +27,6 @@ repos:
- 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
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
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
4 changes: 2 additions & 2 deletions scripts/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def foo_0(memory_size: int = 100_000_000) -> pd.DataFrame:


@parameterize(
**{f"foo_{i}": {"foo_i_minus_one": source(f"foo_{i-1}")} for i in range(1, NUM_ITERS)}
**{f"foo_{i}": {"foo_i_minus_one": source(f"foo_{i - 1}")} for i in range(1, NUM_ITERS)}
)
def foo_i(foo_i_minus_one: pd.DataFrame) -> pd.DataFrame:
global count
Expand All @@ -61,4 +61,4 @@ def foo_i(foo_i_minus_one: pd.DataFrame) -> pd.DataFrame:
if __name__ == "__main__":
mod = create_temporary_module(foo_i, foo_0)
dr = driver.Builder().with_modules(mod).build()
output = dr.execute([f"foo_{NUM_ITERS-1}"], inputs=dict(memory_size=100_000_000))
output = dr.execute([f"foo_{NUM_ITERS - 1}"], inputs=dict(memory_size=100_000_000))
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
3 changes: 1 addition & 2 deletions writeups/garbage_collection/memory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def foo_0(memory_size: int = 100_000_000) -> pd.DataFrame:


@parameterize(
**{f"foo_{i}": {"foo_i_minus_one": source(f"foo_{i-1}")} for i in range(1, NUM_ITERS)}
**{f"foo_{i}": {"foo_i_minus_one": source(f"foo_{i - 1}")} for i in range(1, NUM_ITERS)}
)
def foo_i(foo_i_minus_one: pd.DataFrame) -> pd.DataFrame:
global count
Expand All @@ -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 768d0eb

Please sign in to comment.