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

Implement function timezone() #1386

Merged
merged 46 commits into from
Jul 15, 2024

Conversation

realHannes
Copy link
Collaborator

@realHannes realHannes commented Jun 30, 2024

  • This function returns a literal of type xsd:DayTimeDuration.
  • This commit also efficiently implements literals of type xsd:DayTimeDuration in general. They are stored inside the same class that also stores Date values, so they are folded directly into the ValueID.

realHannes and others added 30 commits April 25, 2024 19:07
Co-authored-by: Johannes Kalmbach <joka921@users.noreply.github.com>
Co-authored-by: Johannes Kalmbach <joka921@users.noreply.github.com>
Co-authored-by: Johannes Kalmbach <joka921@users.noreply.github.com>
Co-authored-by: Johannes Kalmbach <joka921@users.noreply.github.com>
Co-authored-by: Johannes Kalmbach <joka921@users.noreply.github.com>
Co-authored-by: Johannes Kalmbach <joka921@users.noreply.github.com>
Copy link

codecov bot commented Jun 30, 2024

Codecov Report

Attention: Patch coverage is 97.72210% with 10 lines in your changes missing coverage. Please review.

Project coverage is 89.12%. Comparing base (14d6e1c) to head (52fecaa).

Files Patch % Lines
src/util/DateYearDuration.cpp 96.13% 4 Missing and 4 partials ⚠️
src/util/DateYearDuration.h 97.36% 0 Missing and 1 partial ⚠️
src/util/Duration.h 98.38% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1386      +/-   ##
==========================================
+ Coverage   89.06%   89.12%   +0.06%     
==========================================
  Files         328      332       +4     
  Lines       29294    29494     +200     
  Branches     3262     3291      +29     
==========================================
+ Hits        26090    26287     +197     
- Misses       2054     2056       +2     
- Partials     1150     1151       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

A first round of reviews.
I think we should fully integrate the
xs:dayTimeDuration
into the IDs.

src/util/Date.h Outdated Show resolved Hide resolved
src/util/Date.h Outdated Show resolved Hide resolved
src/util/Date.h Outdated Show resolved Hide resolved
Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

This already looks very mature.
I have made a thorough pass over everything, most things are small
(typos, documentation, readability).
Thank you very much.

src/util/DateYearDuration.cpp Outdated Show resolved Hide resolved
src/util/Duration.h Outdated Show resolved Hide resolved
src/util/Duration.h Outdated Show resolved Hide resolved
src/util/Duration.h Show resolved Hide resolved
src/util/Duration.h Outdated Show resolved Hide resolved
test/DateYearDurationTest.cpp Outdated Show resolved Hide resolved
}

//______________________________________________________________________________
DayTimeDuration::DurationValue toAndFromMilliseconds(int days, int hours,
Copy link
Member

Choose a reason for hiding this comment

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

What is the use case of this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

W.r.t. large duration values, which are mostly internally normalized by conversion to milliseconds, it is quite complicated to test directly over the xsd:dayTimeduration strings, because the (input) duration string is different compared to the input string in terms of values. Thus i decided (while coding the setValues() and getValues()) to test this procedure explicitely.

test/DateYearDurationTest.cpp Outdated Show resolved Hide resolved
test/DateYearDurationTest.cpp Outdated Show resolved Hide resolved
test/DateYearDurationTest.cpp Outdated Show resolved Hide resolved
src/util/Duration.h Outdated Show resolved Hide resolved
src/util/Duration.h Outdated Show resolved Hide resolved
realHannes and others added 2 commits July 15, 2024 14:00
Co-authored-by: Johannes Kalmbach <joka921@users.noreply.github.com>
Co-authored-by: Johannes Kalmbach <joka921@users.noreply.github.com>
Copy link

sonarcloud bot commented Jul 15, 2024

@joka921 joka921 changed the title implemented expression timezone() Implement function timezone() Jul 15, 2024
@joka921 joka921 merged commit 67145fa into ad-freiburg:master Jul 15, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants