-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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-35550: [MATLAB] Add public toMATLAB
method to arrow.array.Array
for converting to MATLAB types
#35551
Conversation
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format?
or
In the case of PARQUET issues on JIRA the title also supports:
See also: |
toMATLAB
method to arrow.array.Array
for converting to MATLAB types
…oxy ToMatlab to toMATLAB. Co-authored-by: Sarah Gilmore <sgilmore@mathworks.com>
Co-authored-by: Kevin Gurney <kgurney@mathworks.com>
REGISTER_METHOD(Array, ToString); | ||
REGISTER_METHOD(Array, ToMatlab); | ||
REGISTER_METHOD(Array, toMATLAB); |
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.
I'm not familiar with MATLAB API but is it natural that ToString
uses T
and toMATLAB
uses t
?
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.
Hi @kou, That's a mistake on our part. ToString
should be toString
. Typically, we use lower camel case for MATLAB method names. Thanks for catching this!
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.
- Changed
ToString()
totoString()
. - Also renamed the c++ method
Length()
tolength()
. However, since thisLength
is a property on the MATLABarrow.array.Array
class, I left the property name alone. In MATLAB, property names are typically upper camel case.
Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2. Rename Length() c++ method to length()
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.
+1
Benchmark runs are scheduled for baseline = 505a2e4 and contender = 88339cd. 88339cd is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
['Python', 'R'] benchmarks have high level of regressions. |
Rationale for this change
In order to allow clients to write generic code for different concrete
arrow.array.Array
subclasses in MATLAB, it would be helpful to have one generictoMATLAB
method.toMATLAB
would convert thearrow.array.Array
into a corresponding MATLAB type.For example,
arrow.array.Float64Array
would be converted to a MATLABdouble
array.What changes are included in this PR?
toMATLAB
method to thearrow.array.Array
superclass.Example of using
toMATLAB
on anarrow.array.Float64Array
:Are these changes tested?
toMATLAB
totFloat32Array.m
andtFloat64Array.m
.Future Directions
toMATLAB
tests to the shared test utility class (i.e. [MATLAB] Create shared test class utility for numeric arrays. #35537).Notes
toMATLAB
method toarrow.array.Array
for converting to MATLAB types #35550