diff --git a/src/otc/__init__.py b/src/otc/__init__.py index dedab9af..bae05242 100644 --- a/src/otc/__init__.py +++ b/src/otc/__init__.py @@ -1,4 +1,3 @@ """Support for custom code.""" - __version__ = "0.0.1" diff --git a/src/otc/data/dataloader.py b/src/otc/data/dataloader.py index bb5d5c3f..4290d5f7 100644 --- a/src/otc/data/dataloader.py +++ b/src/otc/data/dataloader.py @@ -3,6 +3,7 @@ Adapted from here: https://discuss.pytorch.org/t/dataloader-much-slower-than-manual-batching/27014/6 """ + from __future__ import annotations from typing import Any diff --git a/src/otc/data/make_dataset.py b/src/otc/data/make_dataset.py index 28444173..acb29916 100644 --- a/src/otc/data/make_dataset.py +++ b/src/otc/data/make_dataset.py @@ -2,6 +2,7 @@ See `notebooks/` for further details. """ + import logging import logging.config from pathlib import Path diff --git a/src/otc/metrics/metrics.py b/src/otc/metrics/metrics.py index ce0bad72..3d3e826c 100644 --- a/src/otc/metrics/metrics.py +++ b/src/otc/metrics/metrics.py @@ -2,6 +2,7 @@ See: https://hagstromer.org/2020/11/23/overestimated-effective-spreads/ for explanation. """ + from __future__ import annotations from typing import Literal diff --git a/src/otc/models/activation.py b/src/otc/models/activation.py index 3b4167fc..962f1ef1 100644 --- a/src/otc/models/activation.py +++ b/src/otc/models/activation.py @@ -3,6 +3,7 @@ Adapted from: https://github.com/Yura52/rtdl/blob/main/rtdl/functional.py """ + import torch import torch.nn.functional as F # noqa: N812 from torch import nn diff --git a/src/otc/models/fttransformer.py b/src/otc/models/fttransformer.py index 73bc6208..627e5cca 100644 --- a/src/otc/models/fttransformer.py +++ b/src/otc/models/fttransformer.py @@ -3,6 +3,7 @@ Adapted from: https://github.com/Yura52/rtdl/ """ + from __future__ import annotations import enum diff --git a/src/otc/models/selftraining.py b/src/otc/models/selftraining.py index d50e5fd5..fc78a396 100644 --- a/src/otc/models/selftraining.py +++ b/src/otc/models/selftraining.py @@ -2,6 +2,7 @@ Based on sklearn implementation. """ + from __future__ import annotations import warnings diff --git a/src/otc/models/train_model.py b/src/otc/models/train_model.py index 4ac8d6c2..ee9fba3f 100644 --- a/src/otc/models/train_model.py +++ b/src/otc/models/train_model.py @@ -3,6 +3,7 @@ Currently classical rules and gradient boosted trees are supported. """ + import logging import logging.config import pickle diff --git a/src/otc/models/transformer_classifier.py b/src/otc/models/transformer_classifier.py index 3aea6ea8..8fbbbc39 100644 --- a/src/otc/models/transformer_classifier.py +++ b/src/otc/models/transformer_classifier.py @@ -2,6 +2,7 @@ Can be used as a consistent interface for evaluation and tuning. """ + from __future__ import annotations import gc diff --git a/src/otc/optim/early_stopping.py b/src/otc/optim/early_stopping.py index 3aab4ddf..5fac2418 100644 --- a/src/otc/optim/early_stopping.py +++ b/src/otc/optim/early_stopping.py @@ -3,7 +3,6 @@ Adapted from here: https://bit.ly/3tTnyLU. """ - import logging import logging.config import math diff --git a/src/otc/optim/scheduler.py b/src/otc/optim/scheduler.py index 436d5005..bff8f7cb 100644 --- a/src/otc/optim/scheduler.py +++ b/src/otc/optim/scheduler.py @@ -1,4 +1,5 @@ """Learnin rate scheduler with linear warmup phase and cosine decay.""" + from typing import List import numpy as np diff --git a/src/otc/utils/check_formalia.py b/src/otc/utils/check_formalia.py index 82e79573..6bf92aef 100644 --- a/src/otc/utils/check_formalia.py +++ b/src/otc/utils/check_formalia.py @@ -2,6 +2,7 @@ TODO: add more tests. """ + import os import re from pathlib import Path diff --git a/src/otc/utils/check_url.py b/src/otc/utils/check_url.py index 24cf485e..1dc3706e 100644 --- a/src/otc/utils/check_url.py +++ b/src/otc/utils/check_url.py @@ -2,6 +2,7 @@ Looks into .bib and .tex files. """ + import os import re from pathlib import Path diff --git a/tests/test_dataset.py b/tests/test_dataset.py index 7c135702..4207d225 100644 --- a/tests/test_dataset.py +++ b/tests/test_dataset.py @@ -4,7 +4,6 @@ categorical data. """ - import numpy as np import pandas as pd import pytest diff --git a/tests/test_objective.py b/tests/test_objective.py index 1eb32137..19b74c1b 100644 --- a/tests/test_objective.py +++ b/tests/test_objective.py @@ -1,4 +1,5 @@ """Tests for Objectives.""" + import datetime as dt from pathlib import Path from unittest.mock import patch