-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
add a couple new things #19
Conversation
(this is now fixed; the tests are run for multiple time zones (LA and Berlin, currently) and check against different expected values where needed.) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19 +/- ##
=======================================
Coverage ? 92.67%
=======================================
Files ? 22
Lines ? 1118
Branches ? 0
=======================================
Hits ? 1036
Misses ? 82
Partials ? 0
Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool additions, I can see them becoming useful across a lot of different apps and Spezi components!
It would be amazing if we can extend the current DocC MD file with a few sections for these new additions to properly sort and classify the elements. Apart from this PR looks great and I am happy to see it merged 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the large addition @lukaskollmer, sorry I wasn't able to review the PR earlier, looks great, thank you! 🚀
# query property wrappers, HealthChart, other refactoring ## ♻️ Current situation & Problem The HealthKit module currently only provides access to HealthKit data via long-running anchor queries that deliver information about new/deleted objects to the app's Standard. It does not provide any facilities for querying for past samples, or accessing health data from SwiftUI. This PR attempts to address these issues. Furthermore, the HealthKit module is lacking an API allowing spezi users to integrate custom HealthKit permission requests into the module's permission handling (i.e., you currently can only request HealthKit access for some specific sample type by actively defining a long-running observer for that sample type). Furthermore, this PR attempts to implement a `HealthChart` view, which can display various types of queried HealthKit data as a chart. resolves #8 requires StanfordSpezi/SpeziFoundation#19 requires StanfordBDHG/XCTestExtensions#28 ## ⚙️ Release Notes - Added `HealthKitQuery` property wrapper - Added `HealthKitStatisticsQuery` property wrapper - Added `HealthKitCharacteristicQuery` property wrapper - Added `HealthChart` view - Extended `HealthKit` configuration API to allow users to specify sample types the system should request read and/or write access to - Removed `CollectSamples`. The same functionality can be achieved using a `for` loop creating individual `CollectSample` instances. ## 📚 Documentation All added new and changed existing APIs are documented. The DocC structure was reworked and some key aspects of SpeziHealthKit now have dedicated article/extension pages. ## ✅ Testing The new and changed APIs are tested using both "normal" unit tests and UI tests. Existing tests were kept and adapted where possible ## 📝 Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
add a couple new things
♻️ Current situation & Problem
This PR adds several new types and functions to the SpeziFoundations package:
OrderedArray
, which allows for efficient collection operations in situations where you are working with sorted (immutable) data. This is intended primarily for the SpeziHealthKit module, but since it might also be useful for other modules i decided to add it in here.RangeReplaceableCollection
types (e.g., Array), andSet
. Intended to be used by other packages, e.g. when building upArray
orSet
-based configurations. Will be used in SpeziHealthKit for that purpose.Calendar
type, for working withDate
s; e.g., computation of date ranges, relative offsets, DST handling.NSException
exceptions. Required for proper error handling when working with some Objective-C APIs that don't use the inoutNSError**
pattern and therefore aren't imported as throwing into Swift. (This is the case with some HealthKit APIs.)⚙️ Release Notes
OrderedArray
RangeReplaceableCollectionBuilder
,ArrayBuilder
, andSetBuilder
Calendar
extensions forDate
operationscatchingNSException
function📚 Documentation
All new code is fully documented, as checked for by SwiftLint.
✅ Testing
All new code is tested.
📝 Code of Conduct & Contributing Guidelines
By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines: