Skip to content

feat: add ical_value property to vUTCOffset (#876) - #2013

Open
GabrielGervasio wants to merge 11 commits into
PyCalendar:mainfrom
GabrielGervasio:feature/876-vUTCOffset-ical-value
Open

GabrielGervasio wants to merge 11 commits into
PyCalendar:mainfrom
GabrielGervasio:feature/876-vUTCOffset-ical-value

Conversation

@GabrielGervasio

Copy link
Copy Markdown
Contributor

Linked issue

Description

This pull request implements the ical_value property for the vUTCOffset class as part of the polymorphism effort in #876:

  • Added @property def ical_value(self) -> timedelta to vUTCOffset in src/icalendar/prop/dt/utc_offset.py (according to :rfc:5545#section-3.3.14).
  • Added unit tests in src/icalendar/tests/prop/test_unit.py testing positive and negative timedelta offsets.
  • Added news fragment news/876.feature.

AI use disclosure

AI was used only as a reference and learning tool to better understand the existing codebase functions, test suites, and project guidelines. The implementation and tests were reviewed and verified locally.

Checklist

  • I added a change log entry, following the instructions in all subsections under Change log requirements.
  • I followed icalendar's Artificial intelligence policy and disclosed my Responsible AI use in my commit messages, if applicable.
  • I added or updated tests, if applicable.
  • I ran and ensured all tests pass locally by following Run tests.
  • I added or edited documentation as necessary, both as docstrings to be rendered in the API documentation and narrative documentation, following the Style guide.

Additional information

None.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the pull request, @GabrielGervasio! A maintainer will review it shortly.

@niccokunzmann niccokunzmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Just two docs comments and then I would like to merge it.

Comment thread news/876.feature Resolved
Comment thread src/icalendar/prop/dt/utc_offset.py Resolved
@GabrielGervasio

Copy link
Copy Markdown
Contributor Author

Hi @niccokunzmann, I have addressed all the review suggestions and fixed the news fragment filename for Towncrier. Could you please take another look when you have a moment? Thanks!

@SemTiOne SemTiOne left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code LGTM. Just the changelog.

Comment thread news/news/876.feature.1
@@ -0,0 +1 @@
Created the :attr:`vUTCOffset.ical_value <icalendar.prop.dt.utc_offset.vUTCOffset.ical_value>` property. @GabrielGervasio

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The correct location should be news/876.feature.1, not news/news/876.feature.1.

Suggested change
Created the :attr:`vUTCOffset.ical_value <icalendar.prop.dt.utc_offset.vUTCOffset.ical_value>` property. @GabrielGervasio
Added :attr:`~icalendar.prop.dt.utc_offset.vUTCOffset.ical_value`, which returns the UTC offset as a :class:`~datetime.timedelta`. AI was used as a reference for understanding the existing code and tests. :user:`GabrielGervasio`

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants