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

Support file I/O for string columns in SolutionArray #900

Merged
merged 5 commits into from
Aug 9, 2020

Conversation

ischoegl
Copy link
Member

@ischoegl ischoegl commented Jul 10, 2020

Changes proposed in this pull request

  • Enable CSV import of string columns
  • Enable HDF export/import of string columns
  • Add phase_of_matter to SolutionArray

If applicable, fill in the issue number this pull request is fixing

Fixes #896

Checklist

  • There is a clear use-case for this code change
  • The commit message has a short title & references relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • The pull request is ready for review

Implementation based on a suggestion by Bryan W. Weber <bryan.w.weber@gmail.com>
@ischoegl ischoegl marked this pull request as draft July 10, 2020 20:44
@ischoegl ischoegl marked this pull request as ready for review July 10, 2020 21:55
@ischoegl ischoegl changed the title Implement support for string columns in SolutionArray Support file I/O for string columns in SolutionArray Jul 10, 2020
@codecov
Copy link

codecov bot commented Jul 10, 2020

Codecov Report

Merging #900 into main will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #900   +/-   ##
=======================================
  Coverage   71.17%   71.18%           
=======================================
  Files         376      376           
  Lines       46190    46201   +11     
=======================================
+ Hits        32877    32888   +11     
  Misses      13313    13313           
Impacted Files Coverage Δ
test/general/test_containers.cpp 99.57% <0.00%> (-0.43%) ⬇️
src/base/AnyMap.cpp 83.99% <0.00%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 773523a...e4e7f3d. Read the comment docs.

@ischoegl ischoegl force-pushed the fix-solutionarray-str-columns branch 2 times, most recently from b669247 to 11677fd Compare July 11, 2020 18:19
@ischoegl ischoegl force-pushed the fix-solutionarray-str-columns branch from 11677fd to a0a19c1 Compare July 14, 2020 14:42
@ischoegl
Copy link
Member Author

ischoegl commented Aug 3, 2020

@bryanwweber ... enabling strings wasn’t difficult after all. However, any comments (or better ideas) on the numpy version if/else condition here? (Alternative would be a less specific try/except)

It’s pretty quiet these days otherwise: I hope that the work on beta is coming along.

Copy link
Member

@bryanwweber bryanwweber left a comment

Choose a reason for hiding this comment

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

Thanks @ischoegl. In 6edb133 we set the minimum NumPy version to 1.12, since that's required for #838 to work properly. Ubuntu 18.04 provides 1.13.x in the system packages, and we didn't want to break compatibility with that version, so that's how I picked 1.12. Anyhow, I left a comment below about the version comparison.
Too many other things going on right now, with the semester approaching. It is my goal to get 2.5.0 out before the semester (i.e., before August 31) but... you know 😄

interfaces/cython/cantera/composite.py Outdated Show resolved Hide resolved
interfaces/cython/cantera/composite.py Outdated Show resolved Hide resolved
interfaces/cython/cantera/composite.py Outdated Show resolved Hide resolved
interfaces/cython/cantera/composite.py Outdated Show resolved Hide resolved
interfaces/cython/cantera/test/test_thermo.py Outdated Show resolved Hide resolved
interfaces/cython/cantera/composite.py Outdated Show resolved Hide resolved
interfaces/cython/cantera/composite.py Outdated Show resolved Hide resolved
@ischoegl
Copy link
Member Author

ischoegl commented Aug 4, 2020

@bryanwweber ... thanks for the review: your recommendations were useful as always and were easily addressed. I'm happy about the suggestion for np.lib.NumpyVersion, as I didn't like the distutils dependency (which I however still preferred to a try ... except structure).

Definitely looking forward to the release of 2.5.0 - I appreciate your and @speth's efforts on getting this out! I won't teach combustion again until next spring though 😜

PS: failing tests are fixed by #905

@ischoegl ischoegl force-pushed the fix-solutionarray-str-columns branch 2 times, most recently from e20368f to 2fb21e9 Compare August 7, 2020 01:02
@ischoegl
Copy link
Member Author

ischoegl commented Aug 7, 2020

@bryanwweber ... thanks again for your feedback - the comment is now added; I believe everything is taken care of at this point.

The length of strings assigned by built-in SolutionArray methods is
limited to 50 characters.
@ischoegl ischoegl force-pushed the fix-solutionarray-str-columns branch from 2fb21e9 to e4e7f3d Compare August 7, 2020 01:41
Copy link
Member

@bryanwweber bryanwweber left a comment

Choose a reason for hiding this comment

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

Thanks @ischoegl!

@bryanwweber bryanwweber merged commit 29f6b94 into Cantera:main Aug 9, 2020
@ischoegl
Copy link
Member Author

ischoegl commented Aug 9, 2020

Thanks @bryanwweber!

@ischoegl ischoegl deleted the fix-solutionarray-str-columns branch September 3, 2020 03:19
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.

What to do about str columns in SolutionArray
2 participants