Add flake8-bugbear
This commit is contained in:
parent
d9d9464f44
commit
cb110267f0
3 changed files with 27 additions and 4 deletions
|
|
@ -124,13 +124,19 @@ def make_config(env: str = 'production') -> Config:
|
|||
# the warning is only emitted if the code is not run by pytest.
|
||||
# We see the bad configuration immediately as all "db" tests fail.
|
||||
if config.DATABASE_URI is None and not os.getenv('TESTING'):
|
||||
warnings.warn('Bad configuration: no DATABASE_URI set in the environment')
|
||||
warnings.warn(
|
||||
'Bad configuration: no DATABASE_URI set in the environment',
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
# Some functionalities require R and some packages installed.
|
||||
# To ensure isolation and reproducibility, the projects keeps the R dependencies
|
||||
# in a project-local folder that must be set in the environment.
|
||||
if config.R_LIBS_PATH is None and not os.getenv('TESTING'):
|
||||
warnings.warn('Bad configuration: no R_LIBS set in the environment')
|
||||
warnings.warn(
|
||||
'Bad configuration: no R_LIBS set in the environment',
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
return config
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ def tactical_heuristic( # noqa:C901
|
|||
|
||||
click.echo(
|
||||
'Parameters: '
|
||||
+ f'city="{city}", grid.side_length={side_length}, '
|
||||
+ f'city={city}, grid.side_length={side_length}, '
|
||||
+ f'time_step={time_step}, train_horizon={train_horizon}',
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ def predict(
|
|||
f"""
|
||||
as.data.frame(
|
||||
forecast(
|
||||
ets(data, model = "{model:s}"),
|
||||
ets(data, model = "{model:s}"), # noqa:B907
|
||||
h = {n_steps_ahead:d}
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue