Skip to content

Commit 6c842ce

Browse files
committed
make release-tag: Merge branch 'main' into stable
2 parents a0a718b + c75f075 commit 6c842ce

File tree

9 files changed

+373
-45
lines changed

9 files changed

+373
-45
lines changed

HISTORY.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# History
22

3+
## v1.18.0 - 2025-08-14
4+
5+
### New Features
6+
7+
* Add a fallback distribution in `GaussianNormalizer` in case the given distribution fails - Issue [#945](https://github.com/sdv-dev/RDT/issues/945) by @fealho
8+
9+
### Maintenance
10+
11+
* Update release documentation based on recent release - Issue [#1016](https://github.com/sdv-dev/RDT/issues/1016) by @rwedge
12+
313
## v1.17.1 - 2025-06-26
414

515
### Bugs Fixed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,9 @@ release-candidate: check-main publish bumpversion-candidate git-push
239239

240240
.PHONY: release-candidate-test
241241
release-candidate-test: check-clean check-main publish-test
242+
243+
.PHONY: release-minor
244+
release-minor: check-release bumpversion-minor release
245+
246+
.PHONY: release-major
247+
release-major: check-release bumpversion-major release

RELEASE.md

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,21 @@ The process of releasing a new version involves several steps:
66

77
2. [Linting and tests](#linting-and-tests)
88

9-
3. [Documentation](#documentation)
9+
3. [Make a release candidate](#make-a-release-candidate)
1010

11-
4. [Make a release candidate](#make-a-release-candidate)
11+
4. [Integration with SDV](#integration-with-sdv)
1212

13-
5. [Integration with SDV](#integration-with-sdv)
13+
5. [Milestone](#milestone)
1414

15-
6. [Milestone](#milestone)
15+
6. [Update HISTORY](#update-history)
1616

17-
7. [Update HISTORY](#update-history)
18-
19-
8. [Check the release](#check-the-release)
17+
7. [Check the release](#check-the-release)
2018

2119
8. [Update stable branch and bump version](#update-stable-branch-and-bump-version)
2220

23-
10. [Create the Release on GitHub](#create-the-release-on-github)
21+
9. [Create the Release on GitHub](#create-the-release-on-github)
2422

25-
11. [Close milestone and create new milestone](#close-milestone-and-create-new-milestone)
23+
10. [Close milestone and create new milestone](#close-milestone-and-create-new-milestone)
2624

2725
## Install RDT from source
2826

@@ -33,7 +31,6 @@ git clone https://github.com/sdv-dev/RDT.git
3331
cd RDT
3432
git checkout main
3533
make install-develop
36-
make install-readme
3734
```
3835

3936
## Linting and tests
@@ -58,22 +55,6 @@ All checks passed!
5855

5956
The execution has finished with no errors, 0 test skipped and 166 warnings.
6057

61-
## Documentation
62-
63-
The documentation must be up to date and generated with:
64-
65-
```bash
66-
make view-docs
67-
```
68-
69-
Read the documentation to ensure all the changes are reflected in the documentation.
70-
71-
Alternatively, you can simply generate the documentation using the command:
72-
73-
```bash
74-
make docs
75-
```
76-
7758
## Make a release candidate
7859

7960
1. On the RDT GitHub page, navigate to the [Actions][actions] tab.
@@ -159,6 +140,7 @@ Put the pull request up for review and get 2 approvals to merge into `main`.
159140
## Check the release
160141
Once HISTORY.md has been updated on `main`, check if the release can be made:
161142

143+
162144
```bash
163145
make check-release
164146
```
@@ -167,27 +149,25 @@ make check-release
167149
The `stable` branch needs to be updated with the changes from `main` and the version needs to be bumped.
168150
Depending on the type of release, run one of the following:
169151

170-
* `make release`: This will release a patch, which is the most common type of release. Use this when the changes are bugfixes or enhancements that do not modify the existing user API. Changes that modify the user API to add new features but that do not modify the usage of the previous features can also be released as a patch.
171-
* `make release-minor`: This will release the next minor version. Use this if the changes modify the existing user API in any way, even if it is backwards compatible. Minor backwards incompatible changes can also be released as minor versions while the library is still in beta state. After the major version 1 has been released, minor version can only be used to add backwards compatible API changes.
172-
* `make release-major`: This will release the next major version. Use this to if the changes modify the user API in a backwards incompatible way after the major version 1 has been released.
152+
* `make release`: This will release the version that has already been bumped (patch, minor, or major). By default, this is typically a patch release. Use this when the changes are bugfixes or enhancements that do not modify the existing user API. Changes that modify the user API to add new features but that do not modify the usage of the previous features can also be released as a patch.
153+
* `make release-minor`: This will bump and release the next minor version. Use this if the changes modify the existing user API in any way, even if it is backwards compatible. Minor backwards incompatible changes can also be released as minor versions while the library is still in beta state. After the major version v1.0.0 has been released, minor version can only be used to add backwards compatible API changes.
154+
* `make release-major`: This will bump and release the next major version. Use this if the changes modify the user API in a backwards incompatible way after the major version v1.0.0 has been released.
173155

174156
Running one of these will **push commits directly** to `main`.
175-
At the end, you should see the 2 commits on `main` on (from oldest to newest):
157+
At the end, you should see the 3 commits on `main` (from oldest to newest):
176158
- `make release-tag: Merge branch 'main' into stable`
177159
- `Bump version: X.Y.Z.devN → X.Y.Z`
160+
- `Bump version: X.Y.Z -> X.Y.A.dev0`
178161

179162
## Create the Release on GitHub
180163

181164
After the update to HISTORY.md is merged into `main` and the version is bumped, it is time to [create the release GitHub](https://github.com/sdv-dev/RDT/releases/new).
182165
- Create a new tag with the version number with a v prefix (e.g. v0.3.1)
183-
- The target should be the `main` branch
166+
- The target should be the `stable` branch
184167
- Release title is the same as the tag (e.g. v0.3.1)
185168
- This is not a pre-release (`Set as a pre-release` should be unchecked)
186169

187-
Click `Publish release`, which will kickoff the release workflow and automatically upload the package to public PyPI.
188-
189-
The release workflow will create a pull request and auto-merge it into `main` that bumps to the next development release. You should see 1 commit on main on:
190-
- `Bump version: X.Y.Z → X.Y.Z.dev0`
170+
Click `Publish release`, which will kickoff the release workflow and automatically upload the package to [public PyPI](https://pypi.org/project/rdt/).
191171

192172
## Close milestone and create new milestone
193173

latest_requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Faker==37.4.0
1+
Faker==37.5.3
22
copulas==0.12.3
3-
numpy==2.3.1
4-
pandas==2.3.0
5-
scikit-learn==1.7.0
6-
scipy==1.16.0
3+
numpy==2.3.2
4+
pandas==2.3.1
5+
scikit-learn==1.7.1
6+
scipy==1.16.1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ collect_ignore = ['pyproject.toml']
144144
exclude_lines = ['NotImplementedError()']
145145

146146
[tool.bumpversion]
147-
current_version = "1.17.1"
147+
current_version = "1.18.0.dev0"
148148
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
149149
serialize = [
150150
'{major}.{minor}.{patch}.{release}{candidate}',

rdt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
__author__ = 'DataCebo, Inc.'
66
__email__ = '[email protected]'
7-
__version__ = '1.17.1'
7+
__version__ = '1.18.0.dev0'
88

99

1010
import sys

rdt/transformers/numerical.py

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Transformers for numerical data."""
22

33
import copy
4+
import logging
45
import warnings
56
from importlib import import_module
67

@@ -13,6 +14,8 @@
1314
from rdt.transformers.null import NullTransformer
1415
from rdt.transformers.utils import learn_rounding_digits, logit, sigmoid
1516

17+
LOGGER = logging.getLogger(__name__)
18+
1619
EPSILON = np.finfo(np.float32).eps
1720
INTEGER_BOUNDS = {
1821
'Int8': (-(2**7), 2**7 - 1),
@@ -300,6 +303,8 @@ class GaussianNormalizer(FloatFormatter):
300303
"""
301304

302305
_univariate = None
306+
_fallback_distribution = 'norm'
307+
_learned_distribution_name = None
303308
_DEPRECATED_DISTRIBUTIONS_MAPPING = {
304309
'gaussian': 'norm',
305310
'student_t': 't',
@@ -359,8 +364,15 @@ def __init__(
359364
)
360365
distribution = self._DEPRECATED_DISTRIBUTIONS_MAPPING[distribution]
361366

367+
self._learned_distribution_name = distribution
362368
distribution = self._distributions[distribution]
363369

370+
else:
371+
distribution_name_map = {v: k for k, v in self._distributions.items()}
372+
self._learned_distribution_name = distribution_name_map.get(
373+
distribution if isinstance(distribution, type) else type(distribution), 'unknown'
374+
)
375+
364376
self._distribution = distribution
365377

366378
def _get_univariate(self):
@@ -390,7 +402,16 @@ def _fit(self, data):
390402

391403
with warnings.catch_warnings():
392404
warnings.simplefilter('ignore')
393-
self._univariate.fit(data)
405+
try:
406+
self._univariate.fit(data)
407+
except Exception:
408+
LOGGER.info(
409+
f"Unable to fit the distribution '{self._learned_distribution_name}'. "
410+
f"Falling back to '{self._fallback_distribution}'."
411+
)
412+
self._learned_distribution_name = self._fallback_distribution
413+
self._univariate = self._distributions[self._fallback_distribution]()
414+
self._univariate.fit(data)
394415

395416
def _copula_transform(self, data):
396417
cdf = self._univariate.cdf(data)
@@ -434,6 +455,24 @@ def _reverse_transform(self, data):
434455

435456
return super()._reverse_transform(data)
436457

458+
@property
459+
def learned_distribution(self):
460+
"""Get the learned distribution name and parameters.
461+
462+
Returns:
463+
dict:
464+
A dictionary containing the distribution name and parameters.
465+
"""
466+
if self._univariate is None:
467+
raise ValueError('The transformer has not been fitted yet.')
468+
469+
parameters = {}
470+
if hasattr(self._univariate, 'to_dict') and self._univariate.to_dict is not None:
471+
parameters = self._univariate.to_dict()
472+
parameters.pop('type')
473+
474+
return {'distribution': self._learned_distribution_name, 'parameters': parameters}
475+
437476

438477
class ClusterBasedNormalizer(FloatFormatter):
439478
"""Transformer for numerical data using a Bayesian Gaussian Mixture Model.

static_code_analysis.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Run started:2025-06-26 21:09:47.571406
1+
Run started:2025-08-14 20:37:52.987737
22

33
Test results:
44
No issues identified.
55

66
Code scanned:
7-
Total lines of code: 6290
7+
Total lines of code: 6323
88
Total lines skipped (#nosec): 0
99
Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0
1010

0 commit comments

Comments
 (0)