Skip to content

Add option day_number_in_year to DateFlagsTransform #552

Merged
merged 9 commits into from
Feb 22, 2022

Conversation

Mr-Geekman
Copy link
Contributor

@Mr-Geekman Mr-Geekman commented Feb 21, 2022

IMPORTANT: Please do not create a Pull Request without creating an issue first.

Before submitting (must do checklist)

  • Did you read the contribution guide?
  • Did you update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you update the CHANGELOG?

Type of Change

  • Examples / docs / tutorials / contributors update
  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Proposed Changes

Look #546.

Related Issue

#546.

Closing issues

Closes #546.

@Mr-Geekman Mr-Geekman added the enhancement New feature or request label Feb 21, 2022
@Mr-Geekman Mr-Geekman self-assigned this Feb 21, 2022
@@ -228,11 +239,25 @@ def _get_day_number_in_month(timestamp_series: pd.Series) -> np.ndarray:
"""Generate an array with the number of the day in the month."""
return timestamp_series.apply(lambda x: x.day).values

@staticmethod
def _get_day_number_in_year(timestamp_series: pd.Series) -> np.ndarray:
"""Generate an array with the number of the day in a year, lear year numeration, starts with 1."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""Generate an array with the number of the day in a year, lear year numeration, starts with 1."""
"""Generate an array with the numbers of the days in a year, leap year numeration, starts with 1."""

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get the right variant from the constructor docstring

@@ -34,6 +35,8 @@ def __init__(
if True, add column with weekday info to feature dataframe in transform
day_number_in_month:
if True, add column with day info to feature dataframe in transform
day_number_in_year:
if True, add column with number of day in a year, leap year numeration, starts with 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May you rewrite it to make it clear

@alex-hse-repository
Copy link
Collaborator

May you also remove "regressor_" prefix in out_colum generation logic

@codecov-commenter
Copy link

codecov-commenter commented Feb 21, 2022

Codecov Report

Merging #552 (06b7e35) into master (9824f3f) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #552      +/-   ##
==========================================
+ Coverage   87.25%   87.28%   +0.02%     
==========================================
  Files         118      118              
  Lines        5681     5692      +11     
==========================================
+ Hits         4957     4968      +11     
  Misses        724      724              
Impacted Files Coverage Δ
etna/transforms/timestamp/date_flags.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9824f3f...06b7e35. Read the comment docs.

Copy link
Collaborator

@alex-hse-repository alex-hse-repository left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alex-hse-repository alex-hse-repository merged commit 1e1b6e3 into master Feb 22, 2022
@iKintosh iKintosh deleted the issue-546 branch March 22, 2022 08:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option day_number_in_year to DateFlagsTransform
3 participants