From 90611f8d7d22650c18756f42dc9b31f2a0963363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20M=C3=BCller?= Date: Thu, 2 Feb 2023 11:14:07 +0100 Subject: [PATCH] stick to black 2023 style --- .gitlab-ci.yml | 2 +- src/finam/adapters/time.py | 2 -- src/finam/modules/writers.py | 2 +- src/finam/sdk/component.py | 1 - src/finam/tools/date_helper.py | 7 +++++-- tests/adapters/test_base.py | 1 - tests/core/test_sdk.py | 1 - 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f81e367..d70a847e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,7 @@ stages: check: stage: test before_script: - - pip3 install black 'pylint<3' 'isort[colors]<6' + - pip3 install 'black>=23,<24' 'pylint<3' 'isort[colors]<6' script: - pip3 install --editable . - black --check --diff --color . diff --git a/src/finam/adapters/time.py b/src/finam/adapters/time.py index f5128bb3..b3066356 100644 --- a/src/finam/adapters/time.py +++ b/src/finam/adapters/time.py @@ -393,7 +393,6 @@ class LinearTime(TimeCachingAdapter): """ def _interpolate(self, time): - if len(self.data) == 1: return self.data[0][1] @@ -456,7 +455,6 @@ def __init__(self, step=0.5): self.step = step def _interpolate(self, time): - if len(self.data) == 1: return self.data[0][1] diff --git a/src/finam/modules/writers.py b/src/finam/modules/writers.py index 1dcbe875..b22b051f 100644 --- a/src/finam/modules/writers.py +++ b/src/finam/modules/writers.py @@ -136,7 +136,7 @@ def _update(self): def _update_rows(self, values): with ErrorLogger(self.logger): - for (value, name) in zip(values, self._input_names): + for value, name in zip(values, self._input_names): dtools.assert_type(self, name, value.item(), [int, float]) self._rows.append([self.time.isoformat()] + values) diff --git a/src/finam/sdk/component.py b/src/finam/sdk/component.py index b5d17989..baf3610d 100644 --- a/src/finam/sdk/component.py +++ b/src/finam/sdk/component.py @@ -2,7 +2,6 @@ Abstract base implementations for components with and without time step. """ import collections -import datetime import logging from abc import ABC from datetime import datetime diff --git a/src/finam/tools/date_helper.py b/src/finam/tools/date_helper.py index 639235c8..87461d31 100644 --- a/src/finam/tools/date_helper.py +++ b/src/finam/tools/date_helper.py @@ -10,8 +10,11 @@ def is_timedelta(value): - """Tests if a value is an instance of - :class:`timedelta ` or :class:`relativedelta `.""" + """ + Tests if a value is an instance of + :class:`timedelta ` or + :class:`relativedelta `. + """ if isinstance(value, timedelta): return True diff --git a/tests/adapters/test_base.py b/tests/adapters/test_base.py index fbfa0537..4f081252 100644 --- a/tests/adapters/test_base.py +++ b/tests/adapters/test_base.py @@ -111,7 +111,6 @@ def test_grid_to_value_sum(self): class TestValueToGrid(unittest.TestCase): def setUp(self): - self.source = CallbackGenerator( callbacks={ "Value": ( diff --git a/tests/core/test_sdk.py b/tests/core/test_sdk.py index 51bfb9e0..de354862 100644 --- a/tests/core/test_sdk.py +++ b/tests/core/test_sdk.py @@ -409,7 +409,6 @@ def test_memory_limit(self): info = Info(time=t, grid=fm.UniformGrid((100, 100))) with tempfile.TemporaryDirectory() as td: - out = Output(name="Output") out.memory_limit = 0 out.memory_location = td