-
Notifications
You must be signed in to change notification settings - Fork 8
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 new character type #391
Conversation
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
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.
We need to remove stray print()
calls, commented code, and unused imports.
Co-authored-by: Joshua A. Anderson <[email protected]>
Co-authored-by: Joshua A. Anderson <[email protected]>
Co-authored-by: Joshua A. Anderson <[email protected]>
Co-authored-by: Joshua A. Anderson <[email protected]>
Co-authored-by: Joshua A. Anderson <[email protected]>
Co-authored-by: Joshua A. Anderson <[email protected]>
Great catches - apologies for the omissions! |
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!
9d76190
to
6f37b8f
Compare
c01c078
to
3e2ae05
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I tested the original motivation for this feature. In the import pandas
df = pandas.DataFrame(logged_data_dict)
print()
print(df)
|
Description
These changes make the Python API more approachable by adding support for reading and writing strings to GSD data chunks. My changes add a new character data type on the C side, and modify the python api to automatically decode strings for the user. The new changes are accompanied by a new test, which fully covers the expected use cases.
Motivation and Context
Currently, strings are implicitly encoded as uint8 data, but it is up to the user to figure out how to decode that data upon reading. The Python API is intended to be approachable, allowing users to, for example, create a pandas dataframe from a GSD log in one line. However, this oneliner will break if the log contains varying textual information, because pandas requires uniform dimensions in each column. These changes make it so users don't have to convert decimal unicode to text on their own, allowing the one-line example to work.
This PR resolves #375.
How Has This Been Tested?
I have modified
test_fl.py
, adding a new test specifically for the string dtype (test_string_dtype
). The new test covers bothfl
andpygsd
.Checklist:
doc/credits.rst
) in the pull request source branch.CHANGELOG.rst
.