Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release of v0.5.6 #552

Merged
merged 1 commit into from
Mar 24, 2023
Merged
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
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.5.6] - 2023-03-24

### Added

- Add the following functions to the `Explorer.Series` module: `log/1`, `log/2`
and `exp/1`. They compute the logarithm and exponential of a series.

### Fixed

- Allow `Explorer.Series.select/3` to receive series of size 1 for both the
`on_true` and `on_false` arguments.

- Fix the encoding of special float values that may return from some series
functions. This is going to encode the atoms for NaN and infinity values.

## [v0.5.5] - 2023-03-13

### Added
Expand Down Expand Up @@ -418,7 +433,8 @@ properly compare floats.

First release.

[Unreleased]: https://github.com/elixir-nx/explorer/compare/v0.5.5...HEAD
[Unreleased]: https://github.com/elixir-nx/explorer/compare/v0.5.6...HEAD
[v0.5.6]: https://github.com/elixir-nx/explorer/compare/v0.5.5...v0.5.6
[v0.5.5]: https://github.com/elixir-nx/explorer/compare/v0.5.4...v0.5.5
[v0.5.4]: https://github.com/elixir-nx/explorer/compare/v0.5.3...v0.5.4
[v0.5.3]: https://github.com/elixir-nx/explorer/compare/v0.5.2...v0.5.3
Expand Down
18 changes: 9 additions & 9 deletions lib/explorer/backend/series.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Explorer.Backend.Series do
@type df :: Explorer.DataFrame.t()
@type dtype :: Explorer.Series.dtype()
@type valid_types :: number() | boolean() | String.t() | Date.t() | Time.t() | NaiveDateTime.t()
@type special_float :: Explorer.Series.special_float()
@type non_finite :: Explorer.Series.non_finite()
@type option(type) :: type | nil

# Conversion
Expand Down Expand Up @@ -59,15 +59,15 @@ defmodule Explorer.Backend.Series do
# Aggregation

@callback count(s) :: number() | lazy_s()
@callback sum(s) :: number() | special_float() | lazy_s() | nil
@callback min(s) :: number() | special_float() | Date.t() | NaiveDateTime.t() | lazy_s() | nil
@callback max(s) :: number() | special_float() | Date.t() | NaiveDateTime.t() | lazy_s() | nil
@callback mean(s) :: float() | special_float() | lazy_s() | nil
@callback median(s) :: float() | special_float() | lazy_s() | nil
@callback variance(s) :: float() | special_float() | lazy_s() | nil
@callback standard_deviation(s) :: float() | special_float() | lazy_s() | nil
@callback sum(s) :: number() | non_finite() | lazy_s() | nil
@callback min(s) :: number() | non_finite() | Date.t() | NaiveDateTime.t() | lazy_s() | nil
@callback max(s) :: number() | non_finite() | Date.t() | NaiveDateTime.t() | lazy_s() | nil
@callback mean(s) :: float() | non_finite() | lazy_s() | nil
@callback median(s) :: float() | non_finite() | lazy_s() | nil
@callback variance(s) :: float() | non_finite() | lazy_s() | nil
@callback standard_deviation(s) :: float() | non_finite() | lazy_s() | nil
@callback quantile(s, float()) ::
number() | special_float() | Date.t() | NaiveDateTime.t() | lazy_s() | nil
number() | non_finite() | Date.t() | NaiveDateTime.t() | lazy_s() | nil
@callback nil_count(s) :: number() | lazy_s()

# Cumulative
Expand Down
16 changes: 8 additions & 8 deletions lib/explorer/series.ex
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ defmodule Explorer.Series do
@type t :: %Series{data: Explorer.Backend.Series.t(), dtype: dtype()}
@type lazy_t :: %Series{data: Explorer.Backend.LazySeries.t(), dtype: dtype()}

@type special_float :: :nan | :infinity | :neg_infinity
@type non_finite :: :nan | :infinity | :neg_infinity

@doc false
@enforce_keys [:data, :dtype]
Expand Down Expand Up @@ -1573,7 +1573,7 @@ defmodule Explorer.Series do
** (ArgumentError) Explorer.Series.sum/1 not implemented for dtype :date. Valid dtypes are [:integer, :float, :boolean]
"""
@doc type: :aggregation
@spec sum(series :: Series.t()) :: number() | special_float() | nil
@spec sum(series :: Series.t()) :: number() | non_finite() | nil
def sum(%Series{dtype: dtype} = series) when is_numeric_or_bool_dtype(dtype),
do: Shared.apply_impl(series, :sum)

Expand Down Expand Up @@ -1618,7 +1618,7 @@ defmodule Explorer.Series do
"""
@doc type: :aggregation
@spec min(series :: Series.t()) ::
number() | special_float() | Date.t() | Time.t() | NaiveDateTime.t() | nil
number() | non_finite() | Date.t() | Time.t() | NaiveDateTime.t() | nil
def min(%Series{dtype: dtype} = series) when is_numeric_or_date_dtype(dtype),
do: Shared.apply_impl(series, :min)

Expand Down Expand Up @@ -1664,7 +1664,7 @@ defmodule Explorer.Series do
"""
@doc type: :aggregation
@spec max(series :: Series.t()) ::
number() | special_float() | Date.t() | Time.t() | NaiveDateTime.t() | nil
number() | non_finite() | Date.t() | Time.t() | NaiveDateTime.t() | nil
def max(%Series{dtype: dtype} = series) when is_numeric_or_date_dtype(dtype),
do: Shared.apply_impl(series, :max)

Expand Down Expand Up @@ -1694,7 +1694,7 @@ defmodule Explorer.Series do
** (ArgumentError) Explorer.Series.mean/1 not implemented for dtype :date. Valid dtypes are [:integer, :float]
"""
@doc type: :aggregation
@spec mean(series :: Series.t()) :: float() | special_float() | nil
@spec mean(series :: Series.t()) :: float() | non_finite() | nil
def mean(%Series{dtype: dtype} = series) when is_numeric_dtype(dtype),
do: Shared.apply_impl(series, :mean)

Expand Down Expand Up @@ -1723,7 +1723,7 @@ defmodule Explorer.Series do
** (ArgumentError) Explorer.Series.median/1 not implemented for dtype :date. Valid dtypes are [:integer, :float]
"""
@doc type: :aggregation
@spec median(series :: Series.t()) :: float() | special_float() | nil
@spec median(series :: Series.t()) :: float() | non_finite() | nil
def median(%Series{dtype: dtype} = series) when is_numeric_dtype(dtype),
do: Shared.apply_impl(series, :median)

Expand Down Expand Up @@ -1752,7 +1752,7 @@ defmodule Explorer.Series do
** (ArgumentError) Explorer.Series.variance/1 not implemented for dtype :datetime. Valid dtypes are [:integer, :float]
"""
@doc type: :aggregation
@spec variance(series :: Series.t()) :: float() | special_float() | nil
@spec variance(series :: Series.t()) :: float() | non_finite() | nil
def variance(%Series{dtype: dtype} = series) when is_numeric_dtype(dtype),
do: Shared.apply_impl(series, :variance)

Expand Down Expand Up @@ -1781,7 +1781,7 @@ defmodule Explorer.Series do
** (ArgumentError) Explorer.Series.standard_deviation/1 not implemented for dtype :string. Valid dtypes are [:integer, :float]
"""
@doc type: :aggregation
@spec standard_deviation(series :: Series.t()) :: float() | special_float() | nil
@spec standard_deviation(series :: Series.t()) :: float() | non_finite() | nil
def standard_deviation(%Series{dtype: dtype} = series) when is_numeric_dtype(dtype),
do: Shared.apply_impl(series, :standard_deviation)

Expand Down