Skip to content

Commit

Permalink
Merge tag '3.34.0' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
lanzagar committed Dec 5, 2022
2 parents 1d35646 + c484414 commit 4583669
Show file tree
Hide file tree
Showing 140 changed files with 2,738 additions and 1,499 deletions.
14 changes: 14 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2

build:
os: ubuntu-20.04
tools:
python: "3.10"

sphinx:
# Path to the shared conf.py file.
configuration: doc/conf.py

python:
install:
- requirements: requirements-readthedocs.txt
25 changes: 23 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ Change Log
[next] - TBA
------------

[3.34.0] - 2022-12-05
--------------------
##### Enhancements
* Faster normalization ([#6202](../../pull/6202))
* io.UrlReader: Add support for google drive share urls ([#6201](../../pull/6201))
* Table: Add methods get_column and set_column ([#6058](../../pull/6058))
* owfeatureconstructor: raise settings version
* owfeaturecontructor: move meta to the end of namedtuple
* Aggregate Columns: Add additional options for selection ([#6056](../../pull/6056))

##### Bugfixes
* conda-recipe: Remove explicit host numpy pinning ([#6235](../../pull/6235))
* Data Sampler: Fix crash when requesting an empty sample ([#6208](../../pull/6208))
* Remove pyqt5 install magic ([#6153](../../pull/6153))
* stats: Handle empty array ([#6221](../../pull/6221))
* Preprocess: Fix reporting for remove sparse and impute ([#6212](../../pull/6212))
* Weighted mean computation in Orange.statistics.util.stats ([#6204](../../pull/6204))
* owfeatureconstructor: raise settings version
* owfeaturecontructor: move meta to the end of namedtuple


[3.33.0] - 2022-09-30
--------------------
Expand Down Expand Up @@ -1708,8 +1728,9 @@ Change Log
* Initial version based on Python 1.5.2 and Qt 2.3


[next]: https://github.com/biolab/orange3/compare/3.33.0...HEAD
[3.32.0]: https://github.com/biolab/orange3/compare/3.32.0...3.33.0
[next]: https://github.com/biolab/orange3/compare/3.34.0...HEAD
[3.34.0]: https://github.com/biolab/orange3/compare/3.33.0...3.34.0
[3.33.0]: https://github.com/biolab/orange3/compare/3.32.0...3.33.0
[3.32.0]: https://github.com/biolab/orange3/compare/3.31.1...3.32.0
[3.31.1]: https://github.com/biolab/orange3/compare/3.31.0...3.31.1
[3.31.0]: https://github.com/biolab/orange3/compare/3.30.2...3.31.0
Expand Down
23 changes: 3 additions & 20 deletions Orange/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,9 @@ def fit_storage(self, data):
return self.fit(X, Y, W)

def __call__(self, data, progress_callback=None):

for cls in type(self).mro():
if 'incompatibility_reason' in cls.__dict__:
incompatibility_reason = \
self.incompatibility_reason(data.domain) # pylint: disable=assignment-from-none
if incompatibility_reason is not None:
raise ValueError(incompatibility_reason)
break
if 'check_learner_adequacy' in cls.__dict__:
warnings.warn(
"check_learner_adequacy is deprecated and will be removed "
"in upcoming releases. Learners should instead implement "
"the incompatibility_reason method.",
OrangeDeprecationWarning)
if not self.check_learner_adequacy(data.domain):
raise ValueError(self.learner_adequacy_err_msg)
break
reason = self.incompatibility_reason(data.domain)
if reason is not None:
raise ValueError(reason)

origdomain = data.domain

Expand Down Expand Up @@ -192,9 +178,6 @@ def active_preprocessors(self):
self.preprocessors is not type(self).preprocessors):
yield from type(self).preprocessors

def check_learner_adequacy(self, _):
return True

# pylint: disable=no-self-use
def incompatibility_reason(self, _: Domain) -> Optional[str]:
"""Return None if a learner can fit domain or string explaining why it can not."""
Expand Down
2 changes: 1 addition & 1 deletion Orange/data/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def match(var):
sourceindex = source.index(sourcevar)
if var.is_discrete and var is not sourcevar:
mapping = var.get_mapper_from(sourcevar)
return lambda table: mapping(table.get_column_view(sourceindex)[0])
return lambda table: mapping(table.get_column(sourceindex))
return source.index(var)
return var.compute_value # , which may also be None

Expand Down
14 changes: 13 additions & 1 deletion Orange/data/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ def __init__(self, negate=False):
def __call__(self, data):
return

def __eq__(self, other):
return type(self) is type(other) and self.negate == other.negate

def __hash__(self):
return hash(self.negate)


class IsDefined(Filter):
"""
Expand All @@ -53,7 +59,7 @@ class IsDefined(Filter):

def __init__(self, columns=None, negate=False):
super().__init__(negate)
self.columns = columns
self.columns = tuple(columns) if columns is not None else None

def __call__(self, data):
if isinstance(data, Instance):
Expand All @@ -70,6 +76,12 @@ def __call__(self, data):
r = np.logical_not(r)
return data[r]

def __eq__(self, other):
return super().__eq__(other) and self.columns == other.columns

def __hash__(self):
return hash((super().__hash__(), hash(self.columns)))


class HasClass(Filter):
"""
Expand Down
13 changes: 13 additions & 0 deletions Orange/data/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ def _resolve_redirects(self, url):
def _trim(cls, url):
URL_TRIMMERS = (
cls._trim_googlesheet,
cls._trim_googledrive,
cls._trim_dropbox,
)
for trim in URL_TRIMMERS:
Expand Down Expand Up @@ -488,6 +489,18 @@ def _trim_googlesheet(url):
url += '&gid=' + sheet
return url

@staticmethod
def _trim_googledrive(url):
parts = urlsplit(url)
if not parts.netloc.endswith("drive.google.com"):
raise ValueError
match = re.match(r'/file/d/(?P<id>[^/]+).*', parts.path)
if not match:
raise ValueError
id_ = match.group("id")
parts = parts._replace(path=f"uc?export=download&id={id_}", query=None)
return urlunsplit(parts)

@staticmethod
def _trim_dropbox(url):
parts = urlsplit(url)
Expand Down
2 changes: 2 additions & 0 deletions Orange/data/sql/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@


class IsDefinedSql(filter.IsDefined):
InheritEq = True

def to_sql(self):
sql = " AND ".join([
'%s IS NOT NULL' % column
Expand Down
2 changes: 1 addition & 1 deletion Orange/data/sql/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def has_weights(self):
return False

def _compute_basic_stats(self, columns=None,
include_metas=False, compute_var=False):
include_metas=False, compute_variance=False):
if self.approx_len() > LARGE_TABLE:
self = self.sample_time(DEFAULT_SAMPLE_TIME)

Expand Down

0 comments on commit 4583669

Please sign in to comment.