Skip to content

feat(StringList): implement str_len#159

Merged
tushushu merged 2 commits into
Rust-Data-Science:mainfrom
yingmanwumen:feat_str_len
Apr 19, 2022
Merged

feat(StringList): implement str_len#159
tushushu merged 2 commits into
Rust-Data-Science:mainfrom
yingmanwumen:feat_str_len

Conversation

@yingmanwumen
Copy link
Copy Markdown
Contributor

#131
The method behaves like:

>>> import ulist as ul
>>> strs = ul.from_seq(["hello", "world!"], dtype='string')
>>> strs.str_len()
UltraFastList([5, 6])

But I don't know how to add a test case for this implementation.
First PR for ulist ^_^

@tushushu
Copy link
Copy Markdown
Collaborator

tushushu commented Apr 18, 2022

#131 The method behaves like:

>>> import ulist as ul
>>> strs = ul.from_seq(["hello", "world!"], dtype='string')
>>> strs.str_len()
UltraFastList([5, 6])

But I don't know how to add a test case for this implementation. First PR for ulist ^_^

Hey, @yingmanwumen. Thanks for the PR.
We use pytest to test the new functions and methods. For this PR, the test cases are put in ulist/tests/test_string.py. After adding your test cases, please run cd /you_path/../tests/ and pytest test_string.py locally. The PR can also trigger the Github action to run the unit tests in the cloud automatically.

@tushushu tushushu self-requested a review April 18, 2022 13:34
@tushushu tushushu linked an issue Apr 18, 2022 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@tushushu tushushu left a comment

Choose a reason for hiding this comment

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

All looks good except the docstring, and please add some tests cases for this method. I mentioned that in another comment.

Comment thread ulist/python/ulist/core.py Outdated
return UltraFastList(self._values.starts_with(elem))

def str_len(self) -> "UltraFastList":
"""Return a list on the length of strings"""
Copy link
Copy Markdown
Collaborator

@tushushu tushushu Apr 18, 2022

Choose a reason for hiding this comment

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

Maybe """Return each element's string length of self.""" would be better:)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

^_^ OK, I'll modify it latter. I am not at expressing something in English and I am trying to practice. Thanks, have a good day~

Copy link
Copy Markdown
Collaborator

@tushushu tushushu left a comment

Choose a reason for hiding this comment

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

@yingmanwumen All look good, thanks for submitting this PR.

@tushushu tushushu merged commit e7f5b39 into Rust-Data-Science:main Apr 19, 2022
@yingmanwumen yingmanwumen deleted the feat_str_len branch April 19, 2022 14:27
@tushushu tushushu modified the milestones: ulist 0.11.0, ulist 0.10.0 May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement str_len method for StringList

2 participants