Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#124)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 31, 2024
1 parent 73e9476 commit bfdbf9b
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
args: ["--line-length", "100"]
Expand Down
1 change: 1 addition & 0 deletions example/1_ctgan_example.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Example for CTGAN
"""

from sdgx.data_connectors.csv_connector import CsvConnector
from sdgx.models.ml.single_table.ctgan import CTGANSynthesizerModel
from sdgx.synthesizer import Synthesizer
Expand Down
3 changes: 1 addition & 2 deletions example/extension/dummycache/dummycache/dummycache.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from sdgx.cachers.base import Cacher


class MyOwnCache(Cacher):
...
class MyOwnCache(Cacher): ...


from sdgx.cachers.extension import hookimpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from sdgx.data_connectors.base import DataConnector


class MyOwnDataConnector(DataConnector):
...
class MyOwnDataConnector(DataConnector): ...


from sdgx.data_connectors.extension import hookimpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from sdgx.data_processors.base import DataProcessor


class MyOwnDataProcessor(DataProcessor):
...
class MyOwnDataProcessor(DataProcessor): ...


from sdgx.data_processors.extension import hookimpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from sdgx.data_exporters.base import DataExporter


class MyOwnExporter(DataExporter):
...
class MyOwnExporter(DataExporter): ...


from sdgx.data_exporters.extension import hookimpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from sdgx.data_models.inspectors.extension import hookimpl


class MyOwnInspector(Inspector):
...
class MyOwnInspector(Inspector): ...


@hookimpl
Expand Down
3 changes: 1 addition & 2 deletions example/extension/dummymodel/dummymodel/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from sdgx.models.base import SynthesizerModel


class MyOwnModel(SynthesizerModel):
...
class MyOwnModel(SynthesizerModel): ...


from sdgx.models.extension import hookimpl
Expand Down
1 change: 1 addition & 0 deletions sdgx/models/components/optimize/sdv_ctgan/data_sampler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DataSampler module."""

from __future__ import annotations

import numpy as np
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DataTransformer module."""

from __future__ import annotations

from collections import namedtuple
Expand Down
11 changes: 7 additions & 4 deletions sdgx/models/components/sdv_copulas/bivariate/clayton.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,14 @@ def cumulative_distribution(self, X):

else:
cdfs = [
np.power(
np.power(U[i], -self.theta) + np.power(V[i], -self.theta) - 1, -1.0 / self.theta
(
np.power(
np.power(U[i], -self.theta) + np.power(V[i], -self.theta) - 1,
-1.0 / self.theta,
)
if (U[i] > 0 and V[i] > 0)
else 0
)
if (U[i] > 0 and V[i] > 0)
else 0
for i in range(len(U))
]

Expand Down
1 change: 1 addition & 0 deletions sdgx/models/components/sdv_rdt/transformers/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""BaseTransformer module."""

import abc
import inspect

Expand Down
1 change: 1 addition & 0 deletions sdgx/models/components/sdv_rdt/transformers/datetime.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Transformer for datetime data."""

import numpy as np
import pandas as pd
from pandas.api.types import is_datetime64_dtype
Expand Down
1 change: 1 addition & 0 deletions sdgx/models/components/sdv_rdt/transformers/numerical.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Transformers for numerical data."""

import copy
import sys
import warnings
Expand Down
1 change: 1 addition & 0 deletions sdgx/models/components/sdv_rdt/transformers/text.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Transformers for text data."""

import warnings

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions sdgx/models/statistics/single_table/copula.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Wrappers around copulas models.
需要修改: fit接口以适应性能优化措施
"""

import logging
import warnings
from copy import deepcopy
Expand Down
10 changes: 6 additions & 4 deletions sdgx/synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ def __init__(
data_processors = []
self.data_processors_manager = DataProcessorManager()
self.data_processors = [
d
if isinstance(d, DataProcessor)
else self.data_processors_manager.init_data_processor(
d, **(data_processors_kwargs or {})
(
d
if isinstance(d, DataProcessor)
else self.data_processors_manager.init_data_processor(
d, **(data_processors_kwargs or {})
)
)
for d in data_processors
]
Expand Down

0 comments on commit bfdbf9b

Please sign in to comment.