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

Enhance functionalities #7

Merged
merged 30 commits into from
Dec 22, 2024
Merged

Enhance functionalities #7

merged 30 commits into from
Dec 22, 2024

Conversation

kaliv0
Copy link
Owner

@kaliv0 kaliv0 commented Dec 22, 2024

@sourcery-ai review

Summary by Sourcery

Add support for creating finite ordered streams using a condition predicate, creating streams from ranges and range objects, reading and writing plain text files, handling None values when creating streams, discarding falsy values during filter mapping, adding close handlers to streams, enumerating stream elements, calculating averages, retrieving the first or last element of a stream, and appending to plain text files. Improve documentation and add leetcode examples.

New Features:

  • Add from_range() to create streams from ranges and range objects.
  • Add support for plain text files in FileStream.
  • Add of_nullable() to handle None values when creating streams.
  • Add discard_falsy parameter to filter_map() to discard falsy values.
  • Add on_close() to add close handlers to streams.
  • Add enumerate() to get stream elements with their indices.
  • Add average() to calculate the average of stream elements.
  • Add take_first() and take_last() to retrieve the first or last element of a stream.
  • Add support for appending to plain text files in FileStream.

Tests:

  • Add tests for new features and examples.

kaliv0 added 30 commits December 9, 2024 21:38
@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 98.81890% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pyrio/decorators/dispatcher.py 92.30% 2 Missing ⚠️
pyrio/streams/file_stream.py 98.75% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
unittests 98.39% <98.81%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pyrio/decorators/__init__.py 100.00% <100.00%> (ø)
pyrio/decorators/handler.py 96.00% <100.00%> (ø)
pyrio/decorators/mapper.py 100.00% <100.00%> (ø)
pyrio/exceptions/__init__.py 100.00% <100.00%> (ø)
pyrio/exceptions/exception.py 100.00% <100.00%> (ø)
pyrio/iterators/__init__.py 100.00% <100.00%> (ø)
pyrio/iterators/itertools_mixin.py 99.32% <100.00%> (ø)
pyrio/iterators/stream_generator.py 100.00% <100.00%> (ø)
pyrio/streams/__init__.py 100.00% <100.00%> (ø)
pyrio/streams/base_stream.py 98.25% <100.00%> (+0.14%) ⬆️
... and 6 more

@kaliv0 kaliv0 marked this pull request as draft December 22, 2024 11:20
@kaliv0 kaliv0 marked this pull request as ready for review December 22, 2024 11:20
@kaliv0 kaliv0 merged commit a9812ea into main Dec 22, 2024
2 checks passed
@kaliv0 kaliv0 deleted the enhance-functionalities branch December 22, 2024 11:21
Copy link
Contributor

sourcery-ai bot commented Dec 22, 2024

🧙 Sourcery is reviewing your pull request!


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

kaliv0 added a commit that referenced this pull request Dec 22, 2024
kaliv0 added a commit that referenced this pull request Dec 22, 2024
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.

2 participants