Skip to content

Commit

Permalink
prepare for v0.2.0, src-based layout
Browse files Browse the repository at this point in the history
This commit:
- Moves to a src-based layout for easier config
- ... this also removes one useless import layer by merging __init__.py and distance.py into a single file module distance_explainer.py.
- Bumps version to 0.2.0
- Updates setup.cfg a bit (superfluous dependency, new Python version)
  • Loading branch information
egpbos committed Feb 8, 2024
1 parent 8b88129 commit e66394d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[bumpversion]
current_version = 0.1.0
current_version = 0..0

[comment]
comment = The contents of this file cannot be merged with that of setup.cfg until https://github.com/c4urself/bump2version/issues/185 is resolved

[bumpversion:file:distance_explainer/__init__.py]
[bumpversion:file:src/distance_explainer.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors:

date-released: 2023-10-19
doi: 10.5281/zenodo.10018768.
version: "0.1.0"
version: "0.2.0"
repository-code: "[email protected]:dianna-ai/distance_explainer"
keywords:
- XAI
Expand Down
8 changes: 0 additions & 8 deletions distance_explainer/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# built documents.
#
# The short X.Y version.
version = "0.1.0"
version = "0.2.0"
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
16 changes: 2 additions & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
description = XAI method to explain distances in embedded spaces
keywords =
XAI
Expand All @@ -26,29 +27,19 @@ name = distance_explainer
project_urls =
Bug Tracker = [email protected]:dianna-ai/distance_explainer/issues
url = [email protected]:dianna-ai/distance_explainer
version = 0.1.0
version = 0.2.0

[options]
zip_safe = False
python_requires = >=3.8
include_package_data = True
packages = find:
install_requires =
dianna>=1.2
numpy
pytest
setuptools
tqdm
dianna
scikit-learn
pyyaml
dataclass_wizard

[options.data_files]
# This section requires setuptools>=40.6.0
# It remains empty for now
# Check if MANIFEST.in works for your purposes

[options.extras_require]
dev =
build
Expand All @@ -65,6 +56,3 @@ dev =
publishing =
twine
wheel

[options.packages.find]
include = distance_explainer, distance_explainer.*
9 changes: 9 additions & 0 deletions distance_explainer/distance.py → src/distance_explainer.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
"""Documentation about distance_explainer."""

import numpy as np
import dianna.utils
from dianna.utils.maskers import generate_masks_for_images
from sklearn.metrics import pairwise_distances
from tqdm import tqdm
import logging

logging.getLogger(__name__).addHandler(logging.NullHandler())

__author__ = "Christiaan Meijer"
__email__ = "[email protected]"
__version__ = "0.2.0"


class DistanceExplainer:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Callable
import numpy as np
import pytest
from distance_explainer.distance import DistanceExplainer
from distance_explainer import DistanceExplainer
from tests.config import get_default_config

DUMMY_EMBEDDING_DIMENSIONALITY = 10
Expand Down

0 comments on commit e66394d

Please sign in to comment.