From 1c0b3d2d1fff223f393748368952537a11cdf596 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Sat, 13 Jul 2024 13:39:12 -0400 Subject: [PATCH] apply isort Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- Makefile | 2 -- csp/__init__.py | 6 +++++- csp/adapters/db.py | 4 +++- csp/adapters/output_adapters/parquet.py | 8 +++++--- csp/adapters/output_adapters/parquet_utility_nodes.py | 3 ++- csp/adapters/parquet.py | 6 ++++-- csp/adapters/perspective.py | 5 ++++- csp/baselib.py | 5 +++-- csp/curve.py | 5 +++-- csp/impl/pandas.py | 3 ++- csp/impl/pandas_accessor.py | 5 +++-- csp/impl/pandas_ext_type.py | 9 +++++---- csp/impl/pandas_perspective.py | 5 +++-- csp/impl/struct.py | 3 ++- csp/impl/types/container_type_normalizer.py | 3 ++- csp/impl/types/instantiation_type_resolver.py | 3 ++- csp/impl/types/typing_utils.py | 3 ++- csp/impl/wiring/numba_utils/datetime_extension.py | 1 + csp/impl/wiring/numba_utils/numba_type_resolver.py | 3 ++- csp/impl/wiring/runtime.py | 3 ++- csp/math.py | 3 ++- csp/profiler.py | 3 ++- csp/random.py | 3 ++- csp/stats.py | 5 +++-- csp/tests/adapters/test_db.py | 5 +++-- csp/tests/adapters/test_kafka.py | 3 ++- csp/tests/adapters/test_numpy.py | 3 ++- csp/tests/adapters/test_parquet.py | 9 +++++---- csp/tests/adapters/test_status.py | 3 ++- csp/tests/adapters/test_websocket.py | 3 ++- csp/tests/impl/test_enum.py | 3 ++- csp/tests/impl/test_pandas.py | 3 ++- csp/tests/impl/test_pandas_accessor.py | 5 +++-- csp/tests/impl/test_pandas_ext_type.py | 5 +++-- csp/tests/impl/test_pandas_perspective.py | 5 +++-- csp/tests/impl/test_struct.py | 5 +++-- csp/tests/test_baselib.py | 3 ++- csp/tests/test_baskets.py | 3 ++- csp/tests/test_curve.py | 3 ++- csp/tests/test_dynamic.py | 3 ++- csp/tests/test_engine.py | 5 +++-- csp/tests/test_examples.py | 3 ++- csp/tests/test_history.py | 4 +++- csp/tests/test_math.py | 3 ++- csp/tests/test_profiler.py | 7 ++++--- csp/tests/test_random.py | 3 ++- csp/tests/test_stats.py | 7 ++++--- csp/tests/test_type_checking.py | 3 ++- csp/typing.py | 3 ++- csp/utils/csp_watch_profile.py | 3 ++- examples/02_intermediate/e3_numpy_stats.py | 3 ++- examples/05_cpp/1_cpp_node/setup.py | 1 + examples/05_cpp/2_cpp_node_with_struct/setup.py | 1 + examples/06_advanced/e2_pandas_extension.py | 5 +++-- setup.py | 1 + vcpkg | 2 +- 56 files changed, 139 insertions(+), 78 deletions(-) diff --git a/Makefile b/Makefile index d5d438710..0d4098638 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,6 @@ install: ## install library .PHONY: lint-py lint-cpp lint lints fix-py fix-cpp fix format check checks lint-py: - python -m isort --check csp/ examples/ setup.py python -m ruff check csp/ examples/ setup.py python -m ruff format --check csp/ examples/ setup.py @@ -57,7 +56,6 @@ lint: lint-py lint-docs ## run lints lints: lint fix-py: - python -m isort csp/ examples/ setup.py python -m ruff check --fix csp/ examples/ setup.py python -m ruff format csp/ examples/ setup.py diff --git a/csp/__init__.py b/csp/__init__.py index a223dc7aa..9b0d6b6c8 100644 --- a/csp/__init__.py +++ b/csp/__init__.py @@ -11,7 +11,11 @@ from csp.impl.mem_cache import csp_memoized, memoize from csp.impl.struct import Struct from csp.impl.types.common_definitions import OutputBasket, Outputs, OutputTypeError, PushMode -from csp.impl.types.tstype import AttachType as attach, DynamicBasket, SnapKeyType as snapkey, SnapType as snap, ts +from csp.impl.types.tstype import AttachType as attach +from csp.impl.types.tstype import DynamicBasket +from csp.impl.types.tstype import SnapKeyType as snapkey +from csp.impl.types.tstype import SnapType as snap +from csp.impl.types.tstype import ts from csp.impl.wiring import ( CspParseError, DelayedEdge, diff --git a/csp/adapters/db.py b/csp/adapters/db.py index d4529bc26..0dec3bbd9 100644 --- a/csp/adapters/db.py +++ b/csp/adapters/db.py @@ -8,8 +8,10 @@ except ImportError: from backports import zoneinfo +from importlib.metadata import PackageNotFoundError +from importlib.metadata import version as get_package_version + import pytz -from importlib.metadata import PackageNotFoundError, version as get_package_version from packaging import version from csp import PushMode, ts diff --git a/csp/adapters/output_adapters/parquet.py b/csp/adapters/output_adapters/parquet.py index 1d6f8a183..65368027f 100644 --- a/csp/adapters/output_adapters/parquet.py +++ b/csp/adapters/output_adapters/parquet.py @@ -1,9 +1,11 @@ -import numpy import os -from importlib.metadata import PackageNotFoundError, version as get_package_version -from packaging import version +from importlib.metadata import PackageNotFoundError +from importlib.metadata import version as get_package_version from typing import Callable, Dict, Optional, TypeVar +import numpy +from packaging import version + import csp from csp.impl.struct import Struct from csp.impl.types.container_type_normalizer import ContainerTypeNormalizer diff --git a/csp/adapters/output_adapters/parquet_utility_nodes.py b/csp/adapters/output_adapters/parquet_utility_nodes.py index 7d1028e2f..1a856d415 100644 --- a/csp/adapters/output_adapters/parquet_utility_nodes.py +++ b/csp/adapters/output_adapters/parquet_utility_nodes.py @@ -1,6 +1,7 @@ -import numpy import typing +import numpy + import csp T = typing.TypeVar("T") diff --git a/csp/adapters/parquet.py b/csp/adapters/parquet.py index e88fcfeaa..4fed8970c 100644 --- a/csp/adapters/parquet.py +++ b/csp/adapters/parquet.py @@ -1,11 +1,13 @@ import datetime import io +from importlib.metadata import PackageNotFoundError +from importlib.metadata import version as get_package_version +from typing import TypeVar + import numpy import pyarrow import pyarrow.parquet -from importlib.metadata import PackageNotFoundError, version as get_package_version from packaging import version -from typing import TypeVar import csp from csp.adapters.output_adapters.parquet import ParquetOutputConfig, ParquetWriter, resolve_array_shape_column_name diff --git a/csp/adapters/perspective.py b/csp/adapters/perspective.py index aaa17583c..cdff4ef5a 100644 --- a/csp/adapters/perspective.py +++ b/csp/adapters/perspective.py @@ -15,7 +15,10 @@ try: - from perspective import PerspectiveManager, Table as Table_, View as View_, __version__, set_threadpool_size + from perspective import PerspectiveManager + from perspective import Table as Table_ + from perspective import View as View_ + from perspective import __version__, set_threadpool_size MAJOR, MINOR, PATCH = map(int, __version__.split(".")) if (MAJOR, MINOR, PATCH) < (0, 6, 2): diff --git a/csp/baselib.py b/csp/baselib.py index 74e874b5e..1a628afe1 100644 --- a/csp/baselib.py +++ b/csp/baselib.py @@ -2,13 +2,14 @@ import contextlib import logging import math -import numpy as np -import pytz import queue import threading from datetime import datetime, timedelta from typing import Callable, Dict, List, Optional, TypeVar, Union +import numpy as np +import pytz + import csp from csp.impl.__cspimpl import _cspimpl from csp.impl.constants import UNSET diff --git a/csp/curve.py b/csp/curve.py index 32d4032ec..9237144fe 100644 --- a/csp/curve.py +++ b/csp/curve.py @@ -1,9 +1,10 @@ import copy -import numpy as np -import pytz from datetime import timedelta from typing import Union +import numpy as np +import pytz + from csp import null_ts from csp.impl.__cspimpl import _cspimpl from csp.impl.pulladapter import PullInputAdapter diff --git a/csp/impl/pandas.py b/csp/impl/pandas.py index c6c9f427c..00498e704 100644 --- a/csp/impl/pandas.py +++ b/csp/impl/pandas.py @@ -1,6 +1,7 @@ -import pandas from datetime import timedelta +import pandas + import csp from csp import ts diff --git a/csp/impl/pandas_accessor.py b/csp/impl/pandas_accessor.py index 3d7a0eb1b..0b9e1142f 100644 --- a/csp/impl/pandas_accessor.py +++ b/csp/impl/pandas_accessor.py @@ -1,9 +1,10 @@ +from datetime import datetime, timedelta +from typing import Dict, List, TypeVar, Union + import numpy as np import pandas as pd -from datetime import datetime, timedelta from pandas.api.extensions import register_dataframe_accessor, register_series_accessor from pandas.core.arrays import ExtensionArray -from typing import Dict, List, TypeVar, Union import csp from csp import ts diff --git a/csp/impl/pandas_ext_type.py b/csp/impl/pandas_ext_type.py index c4c681002..bd6b12c69 100644 --- a/csp/impl/pandas_ext_type.py +++ b/csp/impl/pandas_ext_type.py @@ -1,15 +1,16 @@ import copy import functools -import numpy as np import operator -import pandas as pd import re +from pydoc import locate +from typing import Any, List, Type, TypeVar, Union, cast + +import numpy as np +import pandas as pd from pandas.api.types import is_integer, is_list_like from pandas.core.arrays import ExtensionArray, ExtensionScalarOpsMixin, IntervalArray from pandas.core.dtypes.dtypes import PandasExtensionDtype, register_extension_dtype from pandas.core.indexers import check_array_indexer -from pydoc import locate -from typing import Any, List, Type, TypeVar, Union, cast import csp from csp.impl.types.tstype import TsType, isTsType, ts diff --git a/csp/impl/pandas_perspective.py b/csp/impl/pandas_perspective.py index 92b4f4e9d..769b639fe 100644 --- a/csp/impl/pandas_perspective.py +++ b/csp/impl/pandas_perspective.py @@ -1,8 +1,9 @@ +from datetime import datetime, timedelta +from typing import Optional + import pandas as pd import pytz -from datetime import datetime, timedelta from pandas.compat import set_function_name -from typing import Optional import csp import csp.impl.pandas_accessor # To ensure that the csp accessors are registered diff --git a/csp/impl/struct.py b/csp/impl/struct.py index 777cca8d4..db324d4f9 100644 --- a/csp/impl/struct.py +++ b/csp/impl/struct.py @@ -1,7 +1,8 @@ import io -import ruamel.yaml import typing from copy import deepcopy + +import ruamel.yaml from deprecated import deprecated import csp diff --git a/csp/impl/types/container_type_normalizer.py b/csp/impl/types/container_type_normalizer.py index ab7c94fd4..a8de77664 100644 --- a/csp/impl/types/container_type_normalizer.py +++ b/csp/impl/types/container_type_normalizer.py @@ -1,6 +1,7 @@ -import numpy import typing +import numpy + import csp.typing from csp.impl.types.typing_utils import CspTypingUtils, FastList diff --git a/csp/impl/types/instantiation_type_resolver.py b/csp/impl/types/instantiation_type_resolver.py index 3e1e06343..de3019499 100644 --- a/csp/impl/types/instantiation_type_resolver.py +++ b/csp/impl/types/instantiation_type_resolver.py @@ -1,9 +1,10 @@ import collections import inspect -import numpy import typing from abc import ABCMeta, abstractmethod +import numpy + import csp.typing from csp.impl.types import tstype from csp.impl.types.common_definitions import ArgKind, BasketKind, InputDef, OutputDef diff --git a/csp/impl/types/typing_utils.py b/csp/impl/types/typing_utils.py index 30d0ad834..57127866a 100644 --- a/csp/impl/types/typing_utils.py +++ b/csp/impl/types/typing_utils.py @@ -1,7 +1,8 @@ # utils for dealing with typing types -import numpy import typing +import numpy + import csp.typing T = typing.TypeVar("T") diff --git a/csp/impl/wiring/numba_utils/datetime_extension.py b/csp/impl/wiring/numba_utils/datetime_extension.py index b1668d534..739cd1b0b 100644 --- a/csp/impl/wiring/numba_utils/datetime_extension.py +++ b/csp/impl/wiring/numba_utils/datetime_extension.py @@ -7,6 +7,7 @@ """ import datetime + import numba from csp.impl.wiring.numba_utils.csp_cpp_numba_interface import C as csp_c diff --git a/csp/impl/wiring/numba_utils/numba_type_resolver.py b/csp/impl/wiring/numba_utils/numba_type_resolver.py index 290cf78e6..670642200 100644 --- a/csp/impl/wiring/numba_utils/numba_type_resolver.py +++ b/csp/impl/wiring/numba_utils/numba_type_resolver.py @@ -1,7 +1,8 @@ import datetime -import numba import typing +import numba + from csp.impl.types.typing_utils import CspTypingUtils from csp.impl.wiring.numba_utils import datetime_extension diff --git a/csp/impl/wiring/runtime.py b/csp/impl/wiring/runtime.py index e8d173057..a14388d71 100644 --- a/csp/impl/wiring/runtime.py +++ b/csp/impl/wiring/runtime.py @@ -1,9 +1,10 @@ -import pytz import threading import time from collections import deque from datetime import datetime, timedelta +import pytz + from csp.impl.__cspimpl import _cspimpl from csp.impl.error_handling import ExceptionContext from csp.impl.wiring.adapters import _graph_return_adapter diff --git a/csp/math.py b/csp/math.py index d1415d99c..d60b630ce 100644 --- a/csp/math.py +++ b/csp/math.py @@ -1,8 +1,9 @@ import math -import numpy as np from functools import lru_cache from typing import List, TypeVar, get_origin +import numpy as np + import csp from csp.impl.types.tstype import ts from csp.impl.wiring import node diff --git a/csp/profiler.py b/csp/profiler.py index 56f74825d..d6fd612ff 100644 --- a/csp/profiler.py +++ b/csp/profiler.py @@ -1,6 +1,5 @@ import base64 import gc -import numpy as np import pickle import sys import threading @@ -11,6 +10,8 @@ from io import BytesIO from typing import Dict, List +import numpy as np + import csp from csp.impl.genericpushadapter import GenericPushAdapter from csp.impl.struct import Struct diff --git a/csp/random.py b/csp/random.py index f5d749dff..e9411d86f 100644 --- a/csp/random.py +++ b/csp/random.py @@ -1,7 +1,8 @@ -import numpy as np from datetime import timedelta from typing import TypeVar +import numpy as np + import csp from csp import ts from csp.stats import numpy_to_list diff --git a/csp/stats.py b/csp/stats.py index d357970f3..1131fd33f 100644 --- a/csp/stats.py +++ b/csp/stats.py @@ -1,7 +1,8 @@ -import numpy as np from datetime import datetime, timedelta from typing import Any, List, Optional, TypeVar, Union +import numpy as np + import csp from csp import ts from csp.lib import _cspnpstatsimpl, _cspstatsimpl @@ -232,7 +233,7 @@ def _setup(x, interval, min_window, trigger, sampler, reset, weights=None, ignor if min_window is None: min_window = interval else: - if type(min_window) != type(interval): + if type(min_window) is not type(interval): raise TypeError("Interval and min_window must be of the same type") if sampler is None: diff --git a/csp/tests/adapters/test_db.py b/csp/tests/adapters/test_db.py index 87c247cf3..dd7fcd295 100644 --- a/csp/tests/adapters/test_db.py +++ b/csp/tests/adapters/test_db.py @@ -1,9 +1,10 @@ import os -import pytz -import sqlalchemy as db import unittest from datetime import date, datetime, time +import pytz +import sqlalchemy as db + import csp from csp.adapters.db import _SQLALCHEMY_2, DateTimeAccessor, DBReader, EngineStartTimeAccessor, TimestampAccessor diff --git a/csp/tests/adapters/test_kafka.py b/csp/tests/adapters/test_kafka.py index 36d67614c..06b9519e1 100644 --- a/csp/tests/adapters/test_kafka.py +++ b/csp/tests/adapters/test_kafka.py @@ -1,7 +1,8 @@ import os -import pytest from datetime import datetime, timedelta +import pytest + import csp from csp import ts from csp.adapters.kafka import ( diff --git a/csp/tests/adapters/test_numpy.py b/csp/tests/adapters/test_numpy.py index a12f5346d..ff9042b00 100644 --- a/csp/tests/adapters/test_numpy.py +++ b/csp/tests/adapters/test_numpy.py @@ -1,8 +1,9 @@ -import numpy as np import unittest from datetime import datetime, timedelta from typing import List +import numpy as np + import csp diff --git a/csp/tests/adapters/test_parquet.py b/csp/tests/adapters/test_parquet.py index 87590e30b..6d18b3e4a 100644 --- a/csp/tests/adapters/test_parquet.py +++ b/csp/tests/adapters/test_parquet.py @@ -1,14 +1,15 @@ import math -import numpy import os +import tempfile +import unittest +from datetime import datetime, timedelta + +import numpy import pandas import polars import pyarrow import pyarrow.parquet import pytz -import tempfile -import unittest -from datetime import datetime, timedelta import csp from csp.adapters.output_adapters.parquet import ParquetOutputConfig diff --git a/csp/tests/adapters/test_status.py b/csp/tests/adapters/test_status.py index 66cd41dd6..23c924df6 100644 --- a/csp/tests/adapters/test_status.py +++ b/csp/tests/adapters/test_status.py @@ -1,7 +1,8 @@ import os -import pytest from datetime import datetime, timedelta +import pytest + import csp from csp import ts from csp.adapters.kafka import DateTimeType, JSONTextMessageMapper, KafkaStatusMessageType diff --git a/csp/tests/adapters/test_websocket.py b/csp/tests/adapters/test_websocket.py index bd2c6b6ba..49dc1b221 100644 --- a/csp/tests/adapters/test_websocket.py +++ b/csp/tests/adapters/test_websocket.py @@ -1,9 +1,10 @@ import os -import pytz import threading import unittest from datetime import datetime, timedelta +import pytz + import csp from csp import ts diff --git a/csp/tests/impl/test_enum.py b/csp/tests/impl/test_enum.py index 427cf2365..cc17607c3 100644 --- a/csp/tests/impl/test_enum.py +++ b/csp/tests/impl/test_enum.py @@ -1,7 +1,8 @@ -import _pickle import unittest from datetime import datetime, timedelta +import _pickle + import csp from csp import ts diff --git a/csp/tests/impl/test_pandas.py b/csp/tests/impl/test_pandas.py index ae9d6e592..715a3f4a7 100644 --- a/csp/tests/impl/test_pandas.py +++ b/csp/tests/impl/test_pandas.py @@ -1,6 +1,7 @@ -import pandas as pd import unittest from datetime import datetime, timedelta + +import pandas as pd from numpy import NaN import csp diff --git a/csp/tests/impl/test_pandas_accessor.py b/csp/tests/impl/test_pandas_accessor.py index f42e64c45..696b49023 100644 --- a/csp/tests/impl/test_pandas_accessor.py +++ b/csp/tests/impl/test_pandas_accessor.py @@ -1,8 +1,9 @@ +import unittest +from datetime import date, datetime, timedelta + import numpy as np import pandas as pd import pytest -import unittest -from datetime import date, datetime, timedelta import csp import csp.impl.pandas_accessor diff --git a/csp/tests/impl/test_pandas_ext_type.py b/csp/tests/impl/test_pandas_ext_type.py index 453e67f46..f1d1d6f39 100644 --- a/csp/tests/impl/test_pandas_ext_type.py +++ b/csp/tests/impl/test_pandas_ext_type.py @@ -1,10 +1,11 @@ -import numpy as np import operator +from datetime import datetime + +import numpy as np import pandas as pd import pandas._testing as pd_test import pandas.tests.extension.base as base import pytest -from datetime import datetime from pandas import Series from pandas.tests.extension.conftest import * diff --git a/csp/tests/impl/test_pandas_perspective.py b/csp/tests/impl/test_pandas_perspective.py index 528ea8166..ed0e728d5 100644 --- a/csp/tests/impl/test_pandas_perspective.py +++ b/csp/tests/impl/test_pandas_perspective.py @@ -1,7 +1,8 @@ -import numpy as np -import pandas as pd import unittest from datetime import date, datetime, timedelta + +import numpy as np +import pandas as pd from packaging import version import csp diff --git a/csp/tests/impl/test_struct.py b/csp/tests/impl/test_struct.py index 0d20d4f6e..389c59831 100644 --- a/csp/tests/impl/test_struct.py +++ b/csp/tests/impl/test_struct.py @@ -1,13 +1,14 @@ import enum import json -import numpy as np import pickle -import pytz import typing import unittest from datetime import date, datetime, time, timedelta from typing import Dict, List, Set, Tuple +import numpy as np +import pytz + import csp from csp.impl.struct import define_nested_struct, define_struct, defineNestedStruct, defineStruct from csp.impl.types.typing_utils import FastList diff --git a/csp/tests/test_baselib.py b/csp/tests/test_baselib.py index 5ab6ba4e8..536931b5c 100644 --- a/csp/tests/test_baselib.py +++ b/csp/tests/test_baselib.py @@ -2,12 +2,13 @@ import itertools import logging import math -import numpy as np import unittest from datetime import date, datetime, timedelta, timezone from enum import Enum, auto from typing import List +import numpy as np + import csp from csp import ts from csp.baselib import _convert_ts_object_for_print diff --git a/csp/tests/test_baskets.py b/csp/tests/test_baskets.py index 22c95ef00..7fa8ef41b 100644 --- a/csp/tests/test_baskets.py +++ b/csp/tests/test_baskets.py @@ -1,4 +1,3 @@ -import numpy import random import time import unittest @@ -6,6 +5,8 @@ from datetime import datetime, timedelta from typing import Dict, List +import numpy + import csp import csp.impl from csp import ts diff --git a/csp/tests/test_curve.py b/csp/tests/test_curve.py index c0209ab13..3ce860240 100644 --- a/csp/tests/test_curve.py +++ b/csp/tests/test_curve.py @@ -1,7 +1,8 @@ -import numpy import unittest from datetime import datetime, timedelta +import numpy + import csp diff --git a/csp/tests/test_dynamic.py b/csp/tests/test_dynamic.py index 5b55f7823..d852d828a 100644 --- a/csp/tests/test_dynamic.py +++ b/csp/tests/test_dynamic.py @@ -1,5 +1,4 @@ import itertools -import numpy import random import string import time @@ -8,6 +7,8 @@ from datetime import datetime, timedelta from typing import Dict, List +import numpy + import csp from csp import ts diff --git a/csp/tests/test_engine.py b/csp/tests/test_engine.py index 5b5faf278..da675cdb5 100644 --- a/csp/tests/test_engine.py +++ b/csp/tests/test_engine.py @@ -1,9 +1,7 @@ import collections import gc -import numpy as np import os import pickle -import psutil import random import re import sys @@ -14,6 +12,9 @@ from datetime import datetime, timedelta from typing import Callable, Dict, List +import numpy as np +import psutil + import csp from csp import PushMode, ts from csp.impl.types.instantiation_type_resolver import ArgTypeMismatchError, TSArgTypeMismatchError diff --git a/csp/tests/test_examples.py b/csp/tests/test_examples.py index 2d2c03f6d..8dde99882 100644 --- a/csp/tests/test_examples.py +++ b/csp/tests/test_examples.py @@ -1,8 +1,9 @@ import importlib import os.path -import pytest import sys +import pytest + EXAMPLES_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "examples")) # make examples importable without keeping in source tree diff --git a/csp/tests/test_history.py b/csp/tests/test_history.py index 291da8bb5..da33fe53d 100644 --- a/csp/tests/test_history.py +++ b/csp/tests/test_history.py @@ -1,10 +1,12 @@ -import numpy as np import os import psutil import unittest from datetime import datetime, timedelta from typing import List +import numpy as np +import psutil + import csp from csp import ts diff --git a/csp/tests/test_math.py b/csp/tests/test_math.py index 2dcf0a283..f42572d5f 100644 --- a/csp/tests/test_math.py +++ b/csp/tests/test_math.py @@ -1,9 +1,10 @@ import math -import numpy as np import sys import unittest from datetime import datetime, timedelta +import numpy as np + import csp diff --git a/csp/tests/test_profiler.py b/csp/tests/test_profiler.py index 80ad1e871..f0a886d0e 100644 --- a/csp/tests/test_profiler.py +++ b/csp/tests/test_profiler.py @@ -1,7 +1,4 @@ -import numpy as np import os -import pandas as pd -import pytz import string import sys import tempfile @@ -11,6 +8,10 @@ from functools import reduce from typing import List +import numpy as np +import pandas as pd +import pytz + import csp import csp.stats as stats from csp import profiler, ts diff --git a/csp/tests/test_random.py b/csp/tests/test_random.py index 3a875ce1d..69d42e1a1 100644 --- a/csp/tests/test_random.py +++ b/csp/tests/test_random.py @@ -1,7 +1,8 @@ -import numpy as np import unittest from datetime import datetime, timedelta +import numpy as np + import csp from csp.random import brownian_motion, brownian_motion_1d, poisson_timer from csp.typing import Numpy1DArray, NumpyNDArray diff --git a/csp/tests/test_stats.py b/csp/tests/test_stats.py index 3e765dd75..bf2722ace 100644 --- a/csp/tests/test_stats.py +++ b/csp/tests/test_stats.py @@ -1,11 +1,12 @@ import math -import numpy as np -import numpy.testing -import pandas as pd import sys import unittest from datetime import datetime, timedelta +import numpy as np +import numpy.testing +import pandas as pd + import csp from csp.stats import _window_updates from csp.typing import Numpy1DArray, NumpyNDArray diff --git a/csp/tests/test_type_checking.py b/csp/tests/test_type_checking.py index 2bb638f9d..24ccc6103 100644 --- a/csp/tests/test_type_checking.py +++ b/csp/tests/test_type_checking.py @@ -1,9 +1,10 @@ -import numpy as np import pickle import typing import unittest from datetime import datetime, time, timedelta +import numpy as np + import csp import csp.impl.types.instantiation_type_resolver as type_resolver from csp import ts diff --git a/csp/typing.py b/csp/typing.py index a117cc0fe..1b92410ed 100644 --- a/csp/typing.py +++ b/csp/typing.py @@ -1,7 +1,8 @@ -import numpy import sys from typing import TypeVar +import numpy + T = TypeVar("T") if sys.version_info.major > 3 or sys.version_info.minor >= 7: diff --git a/csp/utils/csp_watch_profile.py b/csp/utils/csp_watch_profile.py index 22446ed16..679259ed2 100644 --- a/csp/utils/csp_watch_profile.py +++ b/csp/utils/csp_watch_profile.py @@ -1,8 +1,9 @@ import argparse -import requests import time from datetime import datetime +import requests + from csp.profiler import ProfilerInfo diff --git a/examples/02_intermediate/e3_numpy_stats.py b/examples/02_intermediate/e3_numpy_stats.py index 0debaf210..7f3e28877 100644 --- a/examples/02_intermediate/e3_numpy_stats.py +++ b/examples/02_intermediate/e3_numpy_stats.py @@ -1,6 +1,7 @@ -import numpy as np from datetime import datetime, timedelta +import numpy as np + import csp """ diff --git a/examples/05_cpp/1_cpp_node/setup.py b/examples/05_cpp/1_cpp_node/setup.py index 37696a368..3b178fe25 100644 --- a/examples/05_cpp/1_cpp_node/setup.py +++ b/examples/05_cpp/1_cpp_node/setup.py @@ -1,6 +1,7 @@ import os import os.path import sys + from skbuild import setup python_version = f"{sys.version_info.major}.{sys.version_info.minor}" diff --git a/examples/05_cpp/2_cpp_node_with_struct/setup.py b/examples/05_cpp/2_cpp_node_with_struct/setup.py index ace4a35c4..8975b5cdd 100644 --- a/examples/05_cpp/2_cpp_node_with_struct/setup.py +++ b/examples/05_cpp/2_cpp_node_with_struct/setup.py @@ -1,6 +1,7 @@ import os import os.path import sys + from skbuild import setup python_version = f"{sys.version_info.major}.{sys.version_info.minor}" diff --git a/examples/06_advanced/e2_pandas_extension.py b/examples/06_advanced/e2_pandas_extension.py index 29064c3cb..f7de9ddab 100644 --- a/examples/06_advanced/e2_pandas_extension.py +++ b/examples/06_advanced/e2_pandas_extension.py @@ -2,11 +2,12 @@ This example illustrates how csp edges can be used inside a pandas data frame via the pandas extension type mechanism. """ -import numpy as np -import pandas as pd import random from datetime import datetime, timedelta +import numpy as np +import pandas as pd + import csp import csp.impl.pandas_accessor # This registers the "csp" accessors on pd.Series and pd.DataFrame from csp.impl.pandas_ext_type import TsDtype diff --git a/setup.py b/setup.py index ea2a1fa68..0f6684de5 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,7 @@ import subprocess import sys from shutil import which + from skbuild import setup CSP_USE_VCPKG = os.environ.get("CSP_USE_VCPKG", "1").lower() in ("1", "on") diff --git a/vcpkg b/vcpkg index 1b5f73466..6af584dd5 160000 --- a/vcpkg +++ b/vcpkg @@ -1 +1 @@ -Subproject commit 1b5f7346612cd63910567df714d867f5b3fa8e3b +Subproject commit 6af584dd59aa5bdba75dae6781ec74614e03e5b9