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
rwedge committed Nov 1, 2023
2 parents 82aeee9 + 14783cb commit 13a02f5
Show file tree
Hide file tree
Showing 35 changed files with 2,624 additions and 1,679 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@ Release Workflow
The process of releasing a new version involves several steps combining both ``git`` and
``bumpversion`` which, briefly:

1. Merge what is in ``master`` branch into ``stable`` branch.
1. Merge what is in ``main`` branch into ``stable`` branch.
2. Update the version in ``setup.cfg``, ``sdmetrics/__init__.py`` and
``HISTORY.md`` files.
3. Create a new git tag pointing at the corresponding commit in ``stable`` branch.
4. Merge the new commit from ``stable`` into ``master``.
4. Merge the new commit from ``stable`` into ``main``.
5. Update the version in ``setup.cfg`` and ``sdmetrics/__init__.py``
to open the next development iteration.

.. note:: Before starting the process, make sure that ``HISTORY.md`` has been updated with a new
entry that explains the changes that will be included in the new version.
Normally this is just a list of the Pull Requests that have been merged to master
Normally this is just a list of the Pull Requests that have been merged to main
since the last release.

Once this is done, run of the following commands:
Expand Down
27 changes: 27 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# History

## v0.12.0 - 2023-10-31

This release adds a new property, InterTable Trends. Several plots were moved from the reports module into the new visualizations module. The `metadata` parameter was removed for these plots, and the `plot_types` parameter was added. `plot_types` lets the user control which plot type is used. Several crashes have been resolved.

### New Features

* Provide meta information about the reports - Pull [#472](https://github.com/sdv-dev/SDMetrics/pull/472) by @frances-h
* Validate that the metadata is always a dict - Issue [#428](https://github.com/sdv-dev/SDMetrics/issues/428) by @R-Palazzo
* Expose reports module in top-level init - Pull [#459](https://github.com/sdv-dev/SDMetrics/pull/459) by @frances-h
* Add new get_column_pair_plot - Issue [#444](https://github.com/sdv-dev/SDMetrics/issues/444) by @pvk-developer
* Add InterTable Trends property - Issue [#451](https://github.com/sdv-dev/SDMetrics/issues/451) by @frances-h
* Add new get_column_plot - Issue [#443](https://github.com/sdv-dev/SDMetrics/issues/443) by @pvk-developer
* Add new get_cardinality_plot - Issue [#445](https://github.com/sdv-dev/SDMetrics/issues/445) by @frances-h
* Create visualizations module - Issue [#442](https://github.com/sdv-dev/SDMetrics/issues/442) by @frances-h, @pvk-developer

### Bugs Fixed

* Fix `NewRowSynthesis` on datetime columns without formats - Issue [#473](https://github.com/sdv-dev/SDMetrics/issues/473) by @fealho
* Intertable trends property crashes if a table has no statistical columns - Issue [#476](https://github.com/sdv-dev/SDMetrics/issues/476) by @lajohn4747
* Fix BoundaryAdherence NaN handling - Issue [#470](https://github.com/sdv-dev/SDMetrics/issues/470) by @frances-h
* The Intertable Trends visualization is mislabeled as 'Column Shapes' - Issue [#477](https://github.com/sdv-dev/SDMetrics/issues/477) by @lajohn4747
* ValueError when using get_cardinality_plot on some schemas - Issue [#447](https://github.com/sdv-dev/SDMetrics/issues/447) by @frances-h

### Internal

* Switch default branch from master to main - Issue [#420](https://github.com/sdv-dev/SDMetrics/issues/420) by @amontanez24

## v0.11.1 - 2023-09-14

This release makes multiple changes to better handle errors that get raised from the `DiagnosticReport`. The report should be able to run to completion now and have any errors that it encounters reported in a column on the details that can be observed from running `get_details`. It also resolves many warnings that were interrupting the printing of the report's results and progress.
Expand Down
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ make install

If you intend to modify the source code or contribute to the project you will need to
install it from the source using the `make install-develop` command. In this case, we
recommend you to branch from `master` first:
recommend you to branch from `main` first:

```bash
git clone [email protected]:sdv-dev/SDMetrics
cd SDMetrics
git checkout master
git checkout main
git checkout -b <your-branch-name>
make install-develp
```
Expand Down
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,22 @@ publish: dist publish-confirm ## package and upload a release
twine upload dist/*

.PHONY: bumpversion-release
bumpversion-release: ## Merge master to stable and bumpversion release
bumpversion-release: ## Merge main to stable and bumpversion release
git checkout stable || git checkout -b stable
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable"
bumpversion release
git push --tags origin stable

.PHONY: bumpversion-release-test
bumpversion-release-test: ## Merge master to stable and bumpversion release
bumpversion-release-test: ## Merge main to stable and bumpversion release
git checkout stable || git checkout -b stable
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable"
bumpversion release --no-tag
@echo git push --tags origin stable

.PHONY: bumpversion-patch
bumpversion-patch: ## Merge stable to master and bumpversion patch
git checkout master
bumpversion-patch: ## Merge stable to main and bumpversion patch
git checkout main
git merge stable
bumpversion --no-tag patch
git push
Expand All @@ -180,7 +180,7 @@ bumpversion-major: ## Bump the version the next major skipping the release

.PHONY: bumpversion-revert
bumpversion-revert: ## Undo a previous bumpversion-release
git checkout master
git checkout main
git branch -D stable

CLEAN_DIR := $(shell git status --short | grep -v ??)
Expand All @@ -193,10 +193,10 @@ ifneq ($(CLEAN_DIR),)
$(error There are uncommitted changes)
endif

.PHONY: check-master
check-master: ## Check if we are in master branch
ifneq ($(CURRENT_BRANCH),master)
$(error Please make the release from master branch\n)
.PHONY: check-main
check-main: ## Check if we are in main branch
ifneq ($(CURRENT_BRANCH),main)
$(error Please make the release from main branch\n)
endif

.PHONY: check-history
Expand All @@ -206,7 +206,7 @@ ifeq ($(CHANGELOG_LINES),0)
endif

.PHONY: check-release
check-release: check-clean check-master check-history ## Check if the release can be made
check-release: check-clean check-main check-history ## Check if the release can be made
@echo "A new release can be made"

.PHONY: release
Expand All @@ -216,10 +216,10 @@ release: check-release bumpversion-release publish bumpversion-patch
release-test: check-release bumpversion-release-test publish-test bumpversion-revert

.PHONY: release-candidate
release-candidate: check-master publish bumpversion-candidate
release-candidate: check-main publish bumpversion-candidate

.PHONY: release-candidate-test
release-candidate-test: check-clean check-master publish-test
release-candidate-test: check-clean check-main publish-test

.PHONY: release-minor
release-minor: check-release bumpversion-minor release
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
[![Development Status](https://img.shields.io/badge/Development%20Status-2%20--%20Pre--Alpha-yellow)](https://pypi.org/search/?c=Development+Status+%3A%3A+2+-+Pre-Alpha)
[![PyPI Shield](https://img.shields.io/pypi/v/sdmetrics.svg)](https://pypi.python.org/pypi/sdmetrics)
[![Downloads](https://pepy.tech/badge/sdmetrics)](https://pepy.tech/project/sdmetrics)
[![Tests](https://github.com/sdv-dev/SDMetrics/workflows/Run%20Tests/badge.svg)](https://github.com/sdv-dev/SDMetrics/actions?query=workflow%3A%22Run+Tests%22+branch%3Amaster)
[![Coverage Status](https://codecov.io/gh/sdv-dev/SDMetrics/branch/master/graph/badge.svg)](https://codecov.io/gh/sdv-dev/SDMetrics)
[![Tests](https://github.com/sdv-dev/SDMetrics/workflows/Run%20Tests/badge.svg)](https://github.com/sdv-dev/SDMetrics/actions?query=workflow%3A%22Run+Tests%22+branch%3Amain)
[![Coverage Status](https://codecov.io/gh/sdv-dev/SDMetrics/branch/main/graph/badge.svg)](https://codecov.io/gh/sdv-dev/SDMetrics)
[![Slack](https://img.shields.io/badge/Community-Slack-blue?style=plastic&logo=slack)](https://bit.ly/sdv-slack-invite)
[![Tutorial](https://img.shields.io/badge/Demo-Get%20started-orange?style=plastic&logo=googlecolab)](https://bit.ly/sdmetrics-demo)

<div align="left">
<br/>
<p align="center">
<a href="https://github.com/sdv-dev/SDV">
<img align="center" width=40% src="https://github.com/sdv-dev/SDV/blob/master/docs/images/SDMetrics-DataCebo.png"></img>
<img align="center" width=40% src="https://github.com/sdv-dev/SDV/blob/stable/docs/images/SDMetrics-DataCebo.png"></img>
</a>
</p>
</div>
Expand Down Expand Up @@ -121,7 +121,7 @@ To learn more about the reports and metrics, visit the [SDMetrics Documentation]


<div align="center">
<a href="https://datacebo.com"><img align="center" width=40% src="https://github.com/sdv-dev/SDV/blob/master/docs/images/DataCebo.png"></img></a>
<a href="https://datacebo.com"><img align="center" width=40% src="https://github.com/sdv-dev/SDV/blob/stable/docs/images/DataCebo.png"></img></a>
</div>
<br/>
<br/>
Expand Down
6 changes: 3 additions & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This document describes the steps required to perform a full release of **SDMetr
Before starting to prepare an **SDMetrics** release make sure of the following points:

1. All the changes that need to be included in the current release have been added to
the [sdv-dev/SDMetrics repository](https://github.com/sdv-dev/SDMetrics) `master`
the [sdv-dev/SDMetrics repository](https://github.com/sdv-dev/SDMetrics) `main`
branch.
2. All the issues related to code changes which were closed after the latest release
have been assigned to the current milestone, given a `bug` or `enhancement` tag
Expand All @@ -18,7 +18,7 @@ Before starting to prepare an **SDMetrics** release make sure of the following p
an issue and assign a developer, a tag and a milestone to it directly.
4. The Milestone that corresponds to the release does not have any issue that is still open.
If there is any, either close it (if possible), or deassign it from the Milestone.
5. The latest build for the `master` branch performed by the CI systems (Github Actions
5. The latest build for the `main` branch performed by the CI systems (Github Actions
and Travis) was successful. If the builds are more than a couple of days old, re-trigger
them and wait for them to finish successfully.

Expand Down Expand Up @@ -146,7 +146,7 @@ Thanks to @<CONTRIBUTOR-USER-NAMES...> for contributing to this release.

In case of doubt, loo at the previous release notes and try to follow a similar style.

Once this is done, commit the change directly to `master` with the message `Add release notes for
Once this is done, commit the change directly to `main` with the message `Add release notes for
vX.Y.Z`.

## Make the final release
Expand Down
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = '0.11.1' %}
{% set version = '0.12.0.dev1' %}

package:
name: "{{ name|lower }}"
Expand Down
5 changes: 3 additions & 2 deletions sdmetrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = 'MIT Data To AI Lab'
__email__ = '[email protected]'
__version__ = '0.11.1'
__version__ = '0.12.0.dev1'

import sys
import warnings as python_warnings
Expand All @@ -15,7 +15,7 @@
from pkg_resources import iter_entry_points

from sdmetrics import (
column_pairs, demos, goal, multi_table, single_column, single_table, timeseries)
column_pairs, demos, goal, multi_table, reports, single_column, single_table, timeseries)
from sdmetrics.demos import load_demo

__all__ = [
Expand All @@ -27,6 +27,7 @@
'single_column',
'single_table',
'timeseries',
'reports',
]


Expand Down
11 changes: 8 additions & 3 deletions sdmetrics/reports/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
"""Reports for sdmetrics."""
from sdmetrics.reports.utils import get_column_pair_plot, get_column_plot
from sdmetrics.reports.multi_table import DiagnosticReport as MultiTableDiagnosticReport
from sdmetrics.reports.multi_table import QualityReport as MultiTableQualityReport
from sdmetrics.reports.single_table import DiagnosticReport as SingleTableDiagnosticReport
from sdmetrics.reports.single_table import QualityReport as SingleTableQualityReport

__all__ = [
'get_column_pair_plot',
'get_column_plot',
'SingleTableQualityReport',
'SingleTableDiagnosticReport',
'MultiTableQualityReport',
'MultiTableDiagnosticReport',
]
35 changes: 32 additions & 3 deletions sdmetrics/reports/base_report.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
"""Single table base report."""
import pickle
import sys
import time
import warnings
from copy import deepcopy
from datetime import datetime
from importlib.metadata import version

import numpy as np
import pandas as pd
Expand All @@ -22,6 +26,11 @@ def __init__(self):
self.is_generated = False
self._properties = {}
self._results_handler = None
self.report_info = {
'report_type': self.__class__.__name__,
'generated_date': None,
'sdmetrics_version': version('sdmetrics')
}

def _validate_metadata_matches_data(self, real_data, synthetic_data, metadata):
"""Validate that the metadata matches the data.
Expand Down Expand Up @@ -55,9 +64,6 @@ def validate(self, real_data, synthetic_data, metadata):
metadata (dict):
The metadata of the table.
"""
if not isinstance(metadata, dict):
metadata = metadata.to_dict()

self._validate_metadata_matches_data(real_data, synthetic_data, metadata)

def _handle_results(self, verbose):
Expand Down Expand Up @@ -101,14 +107,31 @@ def generate(self, real_data, synthetic_data, metadata, verbose=True):
verbose (bool):
Whether or not to print report summary and progress.
"""
if not isinstance(metadata, dict):
raise TypeError('The provided metadata is not a dictionary.')

self.validate(real_data, synthetic_data, metadata)
self.convert_datetimes(real_data, synthetic_data, metadata)

self.report_info['generated_date'] = datetime.today().strftime('%Y-%m-%d')
if 'tables' in metadata:
self.report_info['num_tables'] = len(metadata['tables'])
self.report_info['num_rows_real_data'] = {
name: len(table) for name, table in real_data.items()
}
self.report_info['num_rows_synthetic_data'] = {
name: len(table) for name, table in synthetic_data.items()
}
else:
self.report_info['num_rows_real_data'] = len(real_data)
self.report_info['num_rows_synthetic_data'] = len(synthetic_data)

scores = []
progress_bar = None
if verbose:
sys.stdout.write('Generating report ...\n')

start_time = time.time()
for ind, (property_name, property_instance) in enumerate(self._properties.items()):
if verbose:
num_iterations = int(property_instance._get_num_iterations(metadata))
Expand All @@ -126,6 +149,8 @@ def generate(self, real_data, synthetic_data, metadata, verbose=True):

self._overall_score = np.nanmean(scores)
self.is_generated = True
end_time = time.time()
self.report_info['generation_time'] = end_time - start_time

self._handle_results(verbose)

Expand All @@ -143,6 +168,10 @@ def _check_property_name(self, property_name):
f" Valid property names are '{valid_property_names}'."
)

def get_info(self):
"""Get the information about the report."""
return deepcopy(self.report_info)

def _check_report_generated(self):
if not self.is_generated:
raise ValueError('The report has not been generated. Please call `generate` first.')
Expand Down
2 changes: 2 additions & 0 deletions sdmetrics/reports/multi_table/_properties/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from sdmetrics.reports.multi_table._properties.column_pair_trends import ColumnPairTrends
from sdmetrics.reports.multi_table._properties.column_shapes import ColumnShapes
from sdmetrics.reports.multi_table._properties.coverage import Coverage
from sdmetrics.reports.multi_table._properties.inter_table_trends import InterTableTrends
from sdmetrics.reports.multi_table._properties.synthesis import Synthesis

__all__ = [
Expand All @@ -15,5 +16,6 @@
'ColumnShapes',
'ColumnPairTrends',
'Coverage',
'InterTableTrends',
'Synthesis',
]
Loading

0 comments on commit 13a02f5

Please sign in to comment.