-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
GH-37232: [MATLAB] Add arrow.type.Time64Type
class and arrow.time64
construction function
#37287
Conversation
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 pull request!
+1 |
After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit a0ffa91. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them. |
### Rationale for this change Now that `arrow.type.Time64Type` class has been added to the MATLAB Interface (#37287), we can add the `arrow.array.Time64Array` class. ### What changes are included in this PR? 1. New `arrow.array.Time64Array` class. 2. New `arrow.type.traits.Time64Traits` class. 3. Enhanced `arrow.array(data)` to return a `arrow.array.Time64Array` instance if the input `data` is a MATLAB `duration` array. The MATLAB `duration` type represents length of time in fixed-length units. 4. Enhanced `arrow.type.traits.traits(id)` to return an `arrow.type.traits.Time64Traits` instance if `id` is an `arrow.type.ID.Time64` value or equal to the string `"duration".` 5. Updated the test utility `arrow.internal.test.tabular.createAllSupportedArrayTypes()` to include an `arrow.array.Time64Array` instance in its output. 6. Updated the test utility `arrow.internal.test.tabular.createTableWithSupportedTypes()` to include a `duration` variable on the returned `table`. 7. Updated the README.md to include `Time32Array` and `Time64Array`. **Example Usage** ```matlab % Create a duration array >> ms = milliseconds([100 150 1001]) ms = 1×3 duration array 0.1 sec 0.15 sec 1.001 sec % Create an arrow.type.Time64Array >> time = arrow.array(ms) time = [ 00:00:00.100000, 00:00:00.150000, 00:00:01.001000 ] % Create a duration array from an arrow.array.Time64Array >> data = duration(time) data = 3×1 duration array 0.1 sec 0.15 sec 1.001 sec ``` ### Are these changes tested? Yes. 1. Added a new test class `tTime64Array.m`. 2. Added a new test class `tTime64Traits.m` 3. Added new test cases to `tArray.m` and `ttraits.m` ### Are there any user-facing changes? Yes. Users can now create `arrow.array.Time64Array`s from MATLAB `duration`s * Closes: #37337 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
….time64` construction function (apache#37287) ### Rationale for this change To add support for `arrow.array.Time64Array`, we will need to add support for a `arrow.type.Time64Type` class and associated `arrow.time64` construction function to the MATLAB interface. ### What changes are included in this PR? 1. New `arrow.type.Time64Type` class. 2. New `arrow.time64` construction function that returns an `arrow.type.Time64Type` instance. **Example** ```matlab >> type = arrow.time64(TimeUnit="Nanosecond") type = Time64Type with properties: ID: Time64 TimeUnit: Nanosecond >> class(type) ans = 'arrow.type.Time64Type' ``` ### Are these changes tested? Yes. 1. Added a new test class `tTime64Type`. 2. Added new tests for `Time64` type ID enumeration to `tID`. ### Are there any user-facing changes? Yes. 1. `arrow.time64` construction function 3. `arrow.type.Time64Type` class ### Future Directions 1. apache#37229 2. apache#37230 3. Add `arrow.array.Time64Array` class * Closes: apache#37232 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
…37368) ### Rationale for this change Now that `arrow.type.Time64Type` class has been added to the MATLAB Interface (apache#37287), we can add the `arrow.array.Time64Array` class. ### What changes are included in this PR? 1. New `arrow.array.Time64Array` class. 2. New `arrow.type.traits.Time64Traits` class. 3. Enhanced `arrow.array(data)` to return a `arrow.array.Time64Array` instance if the input `data` is a MATLAB `duration` array. The MATLAB `duration` type represents length of time in fixed-length units. 4. Enhanced `arrow.type.traits.traits(id)` to return an `arrow.type.traits.Time64Traits` instance if `id` is an `arrow.type.ID.Time64` value or equal to the string `"duration".` 5. Updated the test utility `arrow.internal.test.tabular.createAllSupportedArrayTypes()` to include an `arrow.array.Time64Array` instance in its output. 6. Updated the test utility `arrow.internal.test.tabular.createTableWithSupportedTypes()` to include a `duration` variable on the returned `table`. 7. Updated the README.md to include `Time32Array` and `Time64Array`. **Example Usage** ```matlab % Create a duration array >> ms = milliseconds([100 150 1001]) ms = 1×3 duration array 0.1 sec 0.15 sec 1.001 sec % Create an arrow.type.Time64Array >> time = arrow.array(ms) time = [ 00:00:00.100000, 00:00:00.150000, 00:00:01.001000 ] % Create a duration array from an arrow.array.Time64Array >> data = duration(time) data = 3×1 duration array 0.1 sec 0.15 sec 1.001 sec ``` ### Are these changes tested? Yes. 1. Added a new test class `tTime64Array.m`. 2. Added a new test class `tTime64Traits.m` 3. Added new test cases to `tArray.m` and `ttraits.m` ### Are there any user-facing changes? Yes. Users can now create `arrow.array.Time64Array`s from MATLAB `duration`s * Closes: apache#37337 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
Rationale for this change
To add support for
arrow.array.Time64Array
, we will need to add support for aarrow.type.Time64Type
class and associatedarrow.time64
construction function to the MATLAB interface.What changes are included in this PR?
arrow.type.Time64Type
class.arrow.time64
construction function that returns anarrow.type.Time64Type
instance.Example
Are these changes tested?
Yes.
tTime64Type
.Time64
type ID enumeration totID
.Are there any user-facing changes?
Yes.
arrow.time64
construction functionarrow.type.Time64Type
classFuture Directions
arrow.type.Date32Type
class andarrow.date32
construction function #37229arrow.type.Date64Type
class andarrow.date64
construction function #37230arrow.array.Time64Array
classarrow.type.Time64Type
class andarrow.time64
construction function #37232