EntilZha / PyFunctional

Python library for creating data pipelines with chain functional programming
http://pyfunctional.pedro.ai
MIT License
2.41k stars 132 forks source link

Add method called `chain` to merge given iterators, then new the seq #181

Closed ponytailer closed 1 year ago

ponytailer commented 1 year ago

@EntilZha

EntilZha commented 1 year ago

Is there a reason to call it of over the more obvious name of chain?

ponytailer commented 1 year ago

Is there a reason to call it of over the more obvious name of chain?

Haha,the same as java stream naming

EntilZha commented 1 year ago

Makes sense, although in the context of python I'd prefer chain, particularly given its basically doing what itertools.chain does :).

I'd also make the docstring a bit more clear, something like: "Chain the two iterators together into a new seq"

With those changes, I'd accept the PR, thanks!

ponytailer commented 1 year ago

Makes sense, although in the context of python I'd prefer chain, particularly given its basically doing what itertools.chain does :).

I'd also make the docstring a bit more clear, something like: "Chain the two iterators together into a new seq"

With those changes, I'd accept the PR, thanks!

I rename the function.

ponytailer commented 1 year ago

@artemisart Thanks for your review.

EntilZha commented 1 year ago

LMK when you're done making changes and I can do another pre-merge review :)

ponytailer commented 1 year ago

LMK when you're done making changes and I can do another pre-merge review :)

I think it's done. Maybe should update the black ?

(pyfunctional-py3.10) ➜  ~/github/PyFunctional git:(master) black --version
black, 23.3.0 (compiled: no)
Python (CPython) 3.10.9

(pyfunctional-py3.10) ➜  ~/github/PyFunctional git:(master) black functional --check
All done! ✨ 🍰 ✨
13 files would be left unchanged.
(pyfunctional-py3.10) ➜  ~/github/PyFunctional git:(master) gt
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 :tada:

Comparison is base (e5eb3d3) 98.08% compared to head (bd3878a) 98.09%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #181 +/- ## ========================================== + Coverage 98.08% 98.09% +0.01% ========================================== Files 12 12 Lines 2344 2365 +21 ========================================== + Hits 2299 2320 +21 Misses 45 45 ``` | [Impacted Files](https://app.codecov.io/gh/EntilZha/PyFunctional/pull/181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Pedro+Rodriguez) | Coverage Δ | | |---|---|---| | [functional/streams.py](https://app.codecov.io/gh/EntilZha/PyFunctional/pull/181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Pedro+Rodriguez#diff-ZnVuY3Rpb25hbC9zdHJlYW1zLnB5) | `97.16% <100.00%> (+0.23%)` | :arrow_up: | | [functional/test/test\_functional.py](https://app.codecov.io/gh/EntilZha/PyFunctional/pull/181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Pedro+Rodriguez#diff-ZnVuY3Rpb25hbC90ZXN0L3Rlc3RfZnVuY3Rpb25hbC5weQ==) | `99.02% <100.00%> (ø)` | | | [functional/test/test\_streams.py](https://app.codecov.io/gh/EntilZha/PyFunctional/pull/181?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Pedro+Rodriguez#diff-ZnVuY3Rpb25hbC90ZXN0L3Rlc3Rfc3RyZWFtcy5weQ==) | `93.96% <100.00%> (+0.20%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.