Skip to content

Commit

Permalink
Merge pull request pycaret#4030 from celestinoxp/update_callable_imports
Browse files Browse the repository at this point in the history
[MNT] Update Callable import from typing to collections.abc
  • Loading branch information
Yard1 authored Aug 1, 2024
2 parents 85efec6 + fe5ea78 commit 614bf41
Show file tree
Hide file tree
Showing 18 changed files with 130 additions and 27 deletions.
9 changes: 8 additions & 1 deletion pycaret/anomaly/functional.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import logging
import os
from typing import Any, BinaryIO, Callable, Dict, List, Optional, Union
from collections.abc import Callable
from typing import Any, BinaryIO, Dict, List, Optional, Union

import pandas as pd
from joblib.memory import Memory
Expand Down
9 changes: 8 additions & 1 deletion pycaret/classification/functional.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import logging
import os
from typing import Any, BinaryIO, Callable, Dict, List, Optional, Union
from collections.abc import Callable
from typing import Any, BinaryIO, Dict, List, Optional, Union

import pandas as pd
from joblib.memory import Memory
Expand Down
9 changes: 8 additions & 1 deletion pycaret/classification/oop.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import datetime
import gc
import logging
import re
import time
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from collections.abc import Callable
from typing import Any, Dict, List, Optional, Tuple, Union
from unittest.mock import patch

import numpy as np # type: ignore
Expand Down
9 changes: 8 additions & 1 deletion pycaret/clustering/functional.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import logging
import os
from typing import Any, BinaryIO, Callable, Dict, List, Optional, Union
from collections.abc import Callable
from typing import Any, BinaryIO, Dict, List, Optional, Union

import pandas as pd
from joblib.memory import Memory
Expand Down
4 changes: 4 additions & 0 deletions pycaret/containers/metrics/base_metric.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Copyright (C) 2019-2024 PyCaret

# Module: containers.metrics.base_metric
# Author: Antoni Baum (Yard1) <antoni.baum@protonmail.com>
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


from typing import Any, Dict, Optional, Union

from sklearn.metrics import make_scorer # type: ignore
Expand Down
3 changes: 3 additions & 0 deletions pycaret/containers/metrics/clustering.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Copyright (C) 2019-2024 PyCaret

# Module: containers.metrics.clustering
# Author: Antoni Baum (Yard1) <antoni.baum@protonmail.com>
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT

# The purpose of this module is to serve as a central repository of clustering metrics. The `clustering` module will
Expand Down
6 changes: 5 additions & 1 deletion pycaret/internal/logging.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Copyright (C) 2019-2024 PyCaret

# Module: internal.logging
# Author: Antoni Baum (Yard1) <antoni.baum@protonmail.com>
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT

import logging
import os
import traceback
import warnings
from collections.abc import Callable
from contextlib import redirect_stderr, redirect_stdout
from typing import Callable, Optional, Union
from typing import Optional, Union

try:
from wurlitzer import pipes
Expand Down
8 changes: 7 additions & 1 deletion pycaret/internal/metrics.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import traceback
import warnings
from typing import Callable
from collections.abc import Callable

import numpy as np
from sklearn.exceptions import FitFailedWarning
Expand Down
9 changes: 8 additions & 1 deletion pycaret/internal/patches/sklearn.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
from typing import Any, Callable
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


from collections.abc import Callable
from typing import Any
from unittest.mock import patch

import numpy as np
Expand Down
9 changes: 8 additions & 1 deletion pycaret/internal/pycaret_experiment/pycaret_experiment.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import inspect
import os
import warnings
from collections import defaultdict
from typing import Any, BinaryIO, Callable, Dict, Optional, Union
from collections.abc import Callable
from typing import Any, BinaryIO, Dict, Optional, Union

import cloudpickle
import pandas as pd
Expand Down
9 changes: 8 additions & 1 deletion pycaret/internal/pycaret_experiment/supervised_experiment.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import datetime
import gc
import os
import time
import traceback
import warnings
from abc import abstractmethod
from collections.abc import Callable
from copy import copy, deepcopy
from functools import partial
from typing import Any, BinaryIO, Callable, Dict, List, Optional, Set, Tuple, Union
from typing import Any, BinaryIO, Dict, List, Optional, Set, Tuple, Union
from unittest.mock import patch

import matplotlib.pyplot as plt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import datetime
import gc
import logging
import time
import traceback
from typing import Any, Callable, Dict, List, Optional, Union
from collections.abc import Callable
from typing import Any, Dict, List, Optional, Union

import numpy as np # type: ignore
import pandas as pd
Expand Down
8 changes: 7 additions & 1 deletion pycaret/parallel/fugue_backend.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT

import random
from collections.abc import Callable
from math import ceil
from threading import RLock
from typing import Any, Callable, Dict, List, Optional, Union
from typing import Any, Dict, List, Optional, Union

import cloudpickle
import pandas as pd
Expand Down
9 changes: 8 additions & 1 deletion pycaret/regression/functional.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import logging
import os
from typing import Any, BinaryIO, Callable, Dict, List, Optional, Union
from collections.abc import Callable
from typing import Any, BinaryIO, Dict, List, Optional, Union

import pandas as pd
from joblib.memory import Memory
Expand Down
9 changes: 8 additions & 1 deletion pycaret/regression/oop.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import logging
import re
import time
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from collections.abc import Callable
from typing import Any, Dict, List, Optional, Tuple, Union

import numpy as np # type: ignore
import pandas as pd
Expand Down
19 changes: 8 additions & 11 deletions pycaret/time_series/forecasting/functional.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


"""Functional API for Time Series Forecasting Experiment
"""

import logging
import os
from typing import (
TYPE_CHECKING,
Any,
BinaryIO,
Callable,
Dict,
List,
Optional,
Tuple,
Union,
)
from collections.abc import Callable
from typing import TYPE_CHECKING, Any, BinaryIO, Dict, List, Optional, Tuple, Union

import numpy as np
import pandas as pd
Expand Down
9 changes: 8 additions & 1 deletion pycaret/time_series/forecasting/oop.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import datetime
import gc
import logging
Expand All @@ -6,8 +12,9 @@
import traceback
import warnings
from collections import defaultdict
from collections.abc import Callable
from copy import deepcopy
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from typing import Any, Dict, List, Optional, Tuple, Union

import numpy as np
import pandas as pd
Expand Down
10 changes: 8 additions & 2 deletions pycaret/utils/generic.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Copyright (C) 2019-2024 PyCaret
# Author: Moez Ali (moez.ali@queensu.ca)
# Contributors (https://github.com/pycaret/pycaret/graphs/contributors)
# License: MIT


import functools
import inspect
import traceback
import warnings
from collections.abc import Mapping
from collections.abc import Callable, Mapping
from copy import deepcopy
from enum import Enum, auto
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Set, Tuple, Union
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple, Union

import numpy as np
import pandas as pd
Expand Down

0 comments on commit 614bf41

Please sign in to comment.