Skip to content

Commit

Permalink
make release-tag: Merge branch 'main' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
amontanez24 committed May 9, 2024
2 parents f1c6354 + dc79d97 commit a14c15b
Show file tree
Hide file tree
Showing 66 changed files with 2,501 additions and 2,235 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ jobs:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, windows-latest]
include:
- os: macos-latest
python-version: '3.8'
- os: macos-latest
python-version: '3.12'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/minimum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ jobs:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, windows-latest]
include:
- os: macos-latest
python-version: '3.8'
- os: macos-latest
python-version: '3.12'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ jobs:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, windows-latest]
include:
- os: macos-latest
python-version: '3.8'
- os: macos-latest
python-version: '3.12'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
17 changes: 17 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# History

## 1.12.1 - 2024-05-09

This release handles a pandas warning that was showing up in the `UniformEncoder`.

### Bugs Fixed

* Fix pandas FutureWarning in UniformEncoder - Issue [#819](https://github.com/sdv-dev/RDT/issues/819) by @R-Palazzo

### Maintenance

* Switch to using ruff for Python linting and code formatting - Issue [#765](https://github.com/sdv-dev/RDT/issues/765) by @gsheni
* Only run unit and integration tests on oldest and latest python versions for macos - Issue [#812](https://github.com/sdv-dev/RDT/issues/812) by @R-Palazzo

### Internal

* Refactoring code for Enterprise issue #529 - PR[#815](https://github.com/sdv-dev/RDT/pull/815) by @amontanez24

## 1.12.0 - 2024-04-19

This release adds a new parameter to the `RegexGenerator` called `generation_order`. This parameter lets users change if they want the generated values for the regex to come out in alphanumeric or scrambled order. Additionally, warnings that were disrupting the progress bar are handled.
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,13 @@ install-develop: clean-build clean-pyc ## install the package in editable mode a
# LINT TARGETS

.PHONY: lint
lint: ## check style with flake8 and isort
lint: ## Run all code style checks
invoke lint

.PHONY: fix-lint
fix-lint: ## fix lint issues using autoflake, autopep8, and isort
find rdt tests -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
autopep8 --in-place --recursive --aggressive rdt tests
isort --apply --atomic rdt tests
fix-lint: ## fix lint issues using ruff
ruff check --fix .
ruff format .


# TEST TARGETS
Expand Down
2 changes: 1 addition & 1 deletion latest_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Faker==24.11.0
Faker==25.0.1
copulas==0.11.0
numpy==1.26.4
pandas==2.2.2
Expand Down
90 changes: 55 additions & 35 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ license = { text = 'BSL-1.1' }
requires-python = '>=3.8,<3.13'
readme = 'README.md'
dependencies = [
"numpy>=1.20.0;python_version<'3.10'",
"numpy>=1.21.0;python_version<'3.10'",
"numpy>=1.23.3;python_version>='3.10' and python_version<'3.12'",
"numpy>=1.26.0;python_version>='3.12'",
"pandas>=1.1.3;python_version<'3.10'",
"pandas>=1.3.4;python_version>='3.10' and python_version<'3.11'",
"pandas>=1.4.0;python_version<'3.11'",
"pandas>=1.5.0;python_version>='3.11' and python_version<'3.12'",
"pandas>=2.1.1;python_version>='3.12'",
"scipy>=1.5.4;python_version<'3.10'",
"scipy>=1.7.3;python_version<'3.10'",
"scipy>=1.9.2;python_version>='3.10' and python_version<'3.12'",
"scipy>=1.12.0;python_version>='3.12'",
"scikit-learn>=0.24;python_version<'3.10'",
"scikit-learn>=1.0.2;python_version<'3.10'",
"scikit-learn>=1.1.0;python_version>='3.10' and python_version<'3.11'",
"scikit-learn>=1.1.3;python_version>='3.11' and python_version<'3.12'",
"scikit-learn>=1.3.1;python_version>='3.12'",
Expand Down Expand Up @@ -71,35 +70,7 @@ dev = [
'watchdog>=1.0.1,<5',

# style check
'pycodestyle>=2.7.0,<2.12',
'pyflakes>=2.3.0,<3.3',
'flake8>=3.7.7,<8',
'flake8-absolute-import>=1.0,<2',
'flake8-builtins>=1.5.3,<3',
'flake8-comprehensions>=3.6.1,<4',
'flake8-debugger>=4.0.0,<5',
'flake8-docstrings>=1.5.0,<2',
'flake8-eradicate>=1.1.0,<2',
'flake8-fixme>=1.1.1,<1.2',
'flake8-mock>=0.3,<1',
'flake8-multiline-containers>=0.0.18,<0.1',
'flake8-mutable>=1.2.0,<1.3',
'flake8-expression-complexity>=0.0.9,<0.1',
'flake8-print>=4.0.0,<4.1',
'flake8-pytest-style>=2.0.0,<3',
'flake8-quotes>=3.3.0,<4',
'flake8-sfs>=0.0.3,<2',
'flake8-variables-names>=0.0.4,<0.1',
'dlint>=0.11.0,<1',
'isort>=5.13.2,<6',
'pandas-vet>=0.2.3,<2024',
'pep8-naming>=0.12.1,<1',
'pydocstyle>=6.1.1,<7',
'pylint>=2.5.3,<4',

# fix style issues
'autoflake>=1.1,<3',
'autopep8>=1.4.3,<3',
'ruff>=0.3.2,<1',

# distribute on PyPI
'twine>=1.10.0,<6',
Expand Down Expand Up @@ -166,7 +137,7 @@ collect_ignore = ['pyproject.toml']
exclude_lines = ['NotImplementedError()']

[tool.bumpversion]
current_version = "1.12.0"
current_version = "1.12.1.dev2"
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
serialize = [
'{major}.{minor}.{patch}.{release}{candidate}',
Expand Down Expand Up @@ -201,3 +172,52 @@ replace = "__version__ = '{new_version}'"
[build-system]
requires = ['setuptools', 'wheel']
build-backend = 'setuptools.build_meta'

[tool.ruff]
preview = true
line-length = 100
indent-width = 4
src = ["rdt"]
target-version = "py312"
exclude = [
"docs",
".tox",
".git",
"__pycache__",
".ipynb_checkpoints"
]

[tool.ruff.lint]
select = [
# Pyflakes
"F",
# Pycodestyle
"E",
"W",
# isort
"I001"
]
ignore = [
"E501",
"D107", # Missing docstring in __init__
"D417", # Missing argument descriptions in the docstring, this is a bug from pydocstyle: https://github.com/PyCQA/pydocstyle/issues/449
]

[tool.ruff.format]
quote-style = "single"
indent-style = "space"
preview = true
docstring-code-format = true
docstring-code-line-length = "dynamic"

[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["X", "C", "X_padded", "Y", "Y_padded"]

[tool.ruff.lint.isort]
known-first-party = ["rdt"]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "E402", "F403", "F405", "E501", "I001"]

[tool.ruff.lint.pydocstyle]
convention = "google"
56 changes: 30 additions & 26 deletions rdt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

"""Top-level package for RDT."""


__author__ = 'DataCebo, Inc.'
__email__ = '[email protected]'
__version__ = '1.12.0'
__version__ = '1.12.1.dev2'


import sys
Expand All @@ -20,10 +19,7 @@
from rdt import transformers
from rdt.hyper_transformer import HyperTransformer

__all__ = [
'HyperTransformer',
'transformers'
]
__all__ = ['HyperTransformer', 'transformers']

RANDOM_SEED = 42

Expand All @@ -42,9 +38,10 @@ def get_demo(num_rows=5):
pd.DataFrame
"""
# Hard code first five rows
login_dates = pd.Series([
'2021-06-26', '2021-02-10', 'NAT', '2020-09-26', '2020-12-22'
], dtype='datetime64[ns]')
login_dates = pd.Series(
['2021-06-26', '2021-02-10', 'NAT', '2020-09-26', '2020-12-22'],
dtype='datetime64[ns]',
)
email_optin = pd.Series([False, False, False, True, np.nan], dtype='object')
credit_card = ['VISA', 'VISA', 'AMEX', np.nan, 'DISCOVER']
age = [29, 18, 21, 45, 32]
Expand All @@ -55,7 +52,7 @@ def get_demo(num_rows=5):
'email_optin': email_optin,
'credit_card': credit_card,
'age': age,
'dollars_spent': dollars_spent
'dollars_spent': dollars_spent,
})

if num_rows <= 5:
Expand All @@ -67,14 +64,18 @@ def get_demo(num_rows=5):
try:
num_rows -= 5

login_dates = np.array([
np.datetime64('2000-01-01') + np.timedelta64(np.random.randint(0, 10000), 'D')
for _ in range(num_rows)
], dtype='datetime64[ns]')
login_dates = np.array(
[
np.datetime64('2000-01-01') + np.timedelta64(np.random.randint(0, 10000), 'D')
for _ in range(num_rows)
],
dtype='datetime64[ns]',
)
login_dates[np.random.random(size=num_rows) > 0.8] = np.datetime64('NaT')

email_optin = pd.Series([True, False, np.nan], dtype='object').sample(
num_rows, replace=True)
num_rows, replace=True
)
credit_card = np.random.choice(['VISA', 'AMEX', np.nan, 'DISCOVER'], size=num_rows)
age = np.random.randint(18, 100, size=num_rows)

Expand All @@ -84,16 +85,19 @@ def get_demo(num_rows=5):
finally:
np.random.set_state(random_state)

return pd.concat([
data,
pd.DataFrame({
'last_login': login_dates,
'email_optin': email_optin,
'credit_card': credit_card,
'age': age,
'dollars_spent': dollars_spent
})
], ignore_index=True)
return pd.concat(
[
data,
pd.DataFrame({
'last_login': login_dates,
'email_optin': email_optin,
'credit_card': credit_card,
'age': age,
'dollars_spent': dollars_spent,
}),
],
ignore_index=True,
)


def _get_addon_target(addon_path_name):
Expand Down Expand Up @@ -159,7 +163,7 @@ def _find_addons():
try:
addon = entry_point.load()
except Exception: # pylint: disable=broad-exception-caught
msg = f'Failed to load "{entry_point.name}" from "{entry_point.version}".'
msg = f'Failed to load "{entry_point.name}" from "{entry_point.value}".'
warnings.warn(msg)
continue

Expand Down
Loading

0 comments on commit a14c15b

Please sign in to comment.