Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Contributing to Sweetviz

First off, thank you for considering contributing to Sweetviz! It's people like you that make Sweetviz such a great tool.

## Where do I go from here?

If you've noticed a bug or have a feature request, [make one](https://github.com/fbdesignpro/sweetviz/issues/new)! It's generally best if you get confirmation of your bug or approval for your feature request this way before starting to code.

### Fork & create a branch

If this is something you think you can fix, then [fork Sweetviz](https://github.com/fbdesignpro/sweetviz/fork) and create a branch with a descriptive name.

A good branch name would be (where issue #38 is the ticket you're working on):

```sh
git checkout -b 38-add-feature-x
```

### Get the code

```sh
git clone https://github.com/your-username/sweetviz.git
cd sweetviz
git remote add upstream https://github.com/fbdesignpro/sweetviz.git
```

### Create a virtual environment and install dependencies

```sh
python -m venv venv
source venv/bin/activate
pip install -e .[dev]
```

### Implement your fix or feature

At this point, you're ready to make your changes! Feel free to ask for help; everyone is a beginner at first :smile_cat:

### Make a pull request

At this point, you should switch back to your master branch and make sure it's up to date with Sweetviz's master branch:

```sh
git remote add upstream https://github.com/fbdesignpro/sweetviz.git
git checkout master
git pull upstream master
```

Then update your feature branch from your local copy of master, and push it!

```sh
git checkout 38-add-feature-x
git rebase master
git push --force-with-lease origin 38-add-feature-x
```

Finally, go to GitHub and [make a Pull Request](https://github.com/fbdesignpro/sweetviz/compare)

### Keeping your pull request up to date

If a maintainer asks you to "rebase" your PR, they're saying that a lot of code has changed, and that you need to update your branch so it's easier to merge.

To learn more about rebasing, check out [this guide](https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase).

Once you've rebased your branch, you'll have to force-push to GitHub.

```sh
git push --force-with-lease origin 38-add-feature-x
```

## How to get help

If you're running into problems, please don't hesitate to ask for help in the [issue tracker](https://github.com/fbdesignpro/sweetviz/issues) or in the [discussions](https://github.com/fbdesignpro/sweetviz/discussions).

## Releasing a new version

If you are a maintainer, here's how to release a new version:

1. Update the version number in `pyproject.toml`.
2. Create a new entry in `CHANGELOG.md`.
3. Commit the changes with a message like `Release 2.3.2`.
4. Tag the commit with the version number: `git tag -a v2.3.2 -m "Version 2.3.2"`.
5. Push the changes and the tag: `git push && git push --tags`.
6. Build the package: `python -m build`.
7. Publish the package to PyPI: `twine upload dist/*`.
309 changes: 51 additions & 258 deletions README.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion sweetviz/comet_ml_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ def end(self):
print("comet_ml.end(): error occurred during call to end().")
else:
print("comet_ml.end(): comet_ml is not installed or otherwise ready.")

1 change: 0 additions & 1 deletion sweetviz/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@
config.read_file(the_open)
the_open.close()
# config.read_file(open('sweetviz_defaults.ini'))

2 changes: 0 additions & 2 deletions sweetviz/from_profiling_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,3 @@ def is_path(series, counts) -> bool:
def is_date(series) -> bool:
is_date_value = pd.api.types.is_datetime64_dtype(series)
return is_date_value


1 change: 0 additions & 1 deletion sweetviz/graph_associations.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,3 @@ def corrplot(correlation_dataframe, dataframe_report, size_scale=100, marker='s'
size_scale=config["Associations"].getfloat("association_graph_size_scale"),
dataframe_report = dataframe_report
)

10 changes: 6 additions & 4 deletions sweetviz/graph_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ def __init__(self, which_graph: str, to_process: FeatureToProcess):

gap_percent = config["Graphs"].getfloat("summary_graph_categorical_gap")

warnings.filterwarnings('ignore', category=np.VisibleDeprecationWarning)
self.hist_specs = axs.hist(plot_data, weights = normalizing_weights, bins=self.num_bins, \
rwidth = (100.0 - gap_percent) / 100.0)
warnings.filterwarnings('once', category=np.VisibleDeprecationWarning)
try:
self.hist_specs = axs.hist(plot_data, weights=normalizing_weights, bins=self.num_bins, \
rwidth=(100.0 - gap_percent) / 100.0)
except np.VisibleDeprecationWarning as e:
# Handle the warning explicitly or log it for debugging
print(f"Warning encountered during histogram plotting: {e}")

bin_limits = self.hist_specs[1]
num_bins = len(bin_limits) - 1
Expand Down
2 changes: 1 addition & 1 deletion sweetviz/series_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def fill_out_missing_counts_in_other_series(my_counts:dict, other_counts:dict):
# to_fill_list = ["value_counts_with_nan", "value_counts_without_nan"]
to_fill_list = ["value_counts_without_nan"]
for to_fill in to_fill_list:
fill_using_strings = True if my_counts[to_fill].index.dtype.name in ('category', 'object') else False
fill_using_strings = True if my_counts[to_fill].index.dtype.name in ('category', 'object', 'bool') else False
for key, value in other_counts[to_fill].items():
if key not in my_counts[to_fill]:
# If categorical, must do this hack to add new value
Expand Down
2 changes: 0 additions & 2 deletions sweetviz/series_analyzer_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,3 @@ def analyze(to_process: FeatureToProcess, feature_dict: dict):
feature_dict["html_summary"] = sv_html.generate_html_summary_cat(feature_dict, compare_dict)

return


7 changes: 3 additions & 4 deletions sweetviz/sv_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ def compare_intra(source_df: pd.DataFrame,
target_feat: str = None,
feat_cfg: FeatureConfig = None,
pairwise_analysis: str = 'auto'):
if len(source_df) != len(condition_series):
if not source_df.index.equals(condition_series.index):
raise ValueError('compare_intra() expects source_df and '
'condition_series to be the same length')
'condition_series to have aligned indices')
if condition_series.dtypes != bool:
raise ValueError('compare_intra() requires condition_series '
'to be boolean length')

data_true = source_df[condition_series]
data_false = source_df[condition_series == False]
data_false = source_df[~condition_series]
if len(data_false) == 0:
raise ValueError('compare_intra(): FALSE dataset is empty, nothing to compare!')
if len(data_true) == 0:
Expand All @@ -47,4 +47,3 @@ def compare_intra(source_df: pd.DataFrame,
[data_false, names[1]],
pairwise_analysis, feat_cfg)
return report