Giter Club home page Giter Club logo

iteration_utilities's People

Contributors

fcollonval avatar matsjoyce avatar mseifert04 avatar sollyucko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

iteration_utilities's Issues

PyPI source missing test helper modules

The source tarball available on PyPI includes the test_*.py files, but not conftest.py, helper_cls.py or helper_funcs.py. This means the tests cannot be run from this tarball.

Additional parameter for first

Two optional parameters if pred is used:

  • check_for_False (instead of True). Could be named truthy or falsy.
  • return_predicate (instead of the item return the pred(item).

remove take

With getitem and getitem it's pretty useless now. However it's used in a lot of tests.

Split up functions with behaviors dependent on the presence of keyword arguments for efficiency

This would avoid unnecessary branching (checking for the presence of the argument) and allow for better optimization, especially if only positional arguments are allowed. Some examples are consume and count_items. I propose to split these into separate functions: consume to advance and consume, and count_items to count_items, count_items + filter, and count_items + filter_eq.

Assert statements in C don't abort

assert(times > 0); did not throw an Exception when times=0 was passed to grouper.

Noticed in #34

This may need to be reworked in the other C functions that use assert.

flatten drop empty lists instead of keeping them as null

Hi thanks for the library
I was counting on the index of the list so the code could behave correctly, lastly I used pandas but hope no one face the same bug again
the function drop empty lists instead of keeping them as null which change the index
image

Merge enhancement: Check last position first in bisect

As possible performance boost one could check the last position first in the bisect-helper function.

Why this may be faster:

  • The last item in current is the next one to be yielded. The bisect is called every time the next item of the iterable from which the yielded item came from is to be inserted in current.
  • If the iterables are somewhat consecutive the next item may be (with high probability) the next item to be yielded again.
  • If there are few iterables the normal bisect and the altered bisect will behave quite similar.
  • If there are lots of iterables doing one more comparison before starting the bisection will not slow it down unnecessary.

These assumptions are somewhat debatable, I haven't tested it!

Coverage for traverse

Some of the traverse methods aren't called and thus missing in the coverage. Maybe this can be added by gc.collect or such-like

Delocate macos wheels

A remined of what to do:

pip install delocate
delocate-listdeps path_to_wheel
delocate-wheel -w target_dir path_to_wheel

Not sure if necessary, but better safe than sorry.

Add support to release linux aarch64 wheels

Problem

On aarch64, pip install iteration_utilities builds the wheels from source code and then installs it. It requires the user to have a development environment installed on their system. Also, it takes more time to build the wheels than downloading and extracting the wheels from PyPI.

Resolution

On aarch64, pip install iteration_utilities should download the wheels from PyPI.

@MSeifert04, Please let me know your interest in releasing aarch64 wheels. I can help with this.

Python 3.11 or 3.10 support, and alternatives

Edit

I modified this issue title to request support for Python 3.11 as well as (or instead of) 3.10. I also identify a workaround and an alternative package to iteration_utilities below.

I understand that life gets in the way and projects can easily get pushed to the back-burner and eventually off the stove and into unmaintained status ๐Ÿ˜…. In fact, your package still works fine as long as users have proper build tools installed. This is usually the case for users on Unix-like machines.

Workaround for Windows users

This can be a tall order for Windows users, who don't have build tools out of the box and must install them. Install Visual Build Tools 2022 (tick the box for C++ build tools and perform the ~7GB install), reboot, and you will be able to successfully pip install iteration-utilities. This will also fix issues with packages which depend on iteration_utilities.

Alternatives

There are a few ways to replace your dependency on iteration_utilities if you wish to generalize your app to be easy to install for Windows and Unix-like users alike:

Original comment

Hello. Thank you for the latest bump to support Python 3.9. Are there plans to support Python 3.10 as well? At least one package (copier-org/copier) would benefit from this support.

Could not install with pip

Hi! First of all, thank you for your library.

I tried to install it using the pip command (pip install iteration-utilities), however I had no success. The result can be found below.

I am new to Python, so I don't know exactly if this is something to do with the library or not, but it seems to be a library problem ("note: This is an issue with the package mentioned above, not pip."). Maybe this feedback can be useful for improvements.

ร— Running setup.py install for iteration-utilities did not run successfully.
  โ”‚ exit code: 1
  โ•ฐโ”€> [17 lines of output]
      running install
      C:\Users\Me\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\iteration_utilities
      copying src\iteration_utilities\_additional_recipes.py -> build\lib.win-amd64-cpython-310\iteration_utilities
      copying src\iteration_utilities\_classes.py -> build\lib.win-amd64-cpython-310\iteration_utilities
      copying src\iteration_utilities\_convenience.py -> build\lib.win-amd64-cpython-310\iteration_utilities
      copying src\iteration_utilities\_recipes.py -> build\lib.win-amd64-cpython-310\iteration_utilities
      copying src\iteration_utilities\_utils.py -> build\lib.win-amd64-cpython-310\iteration_utilities
      copying src\iteration_utilities\__init__.py -> build\lib.win-amd64-cpython-310\iteration_utilities
      running build_ext
      building 'iteration_utilities._iteration_utilities' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

ร— Encountered error while trying to install package.
โ•ฐโ”€> iteration-utilities

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

By the way, I'm using Python 3.10.5 on Windows.

Occasional StackOverflow in recursive_pickle (PyPy)

=================================== FAILURES ===================================
____________________________ test_recursive_pickle _____________________________

    def test_recursive_pickle():
    
        with AllowPickle():
            f = partial(capture)
            f.__setstate__((f, (), {}, {}))
            try:
                for proto in range(pickle.HIGHEST_PROTOCOL + 1):
                    with pytest.raises(RecursionError):
>                       pickle.dumps(f, proto)

tests/test_partial.py:87: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:1573: in _dumps
    _Pickler(f, protocol, fix_imports=fix_imports).dump(obj)
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:408: in dump
    self.save(obj)
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:520: in save
    self.save_reduce(obj=obj, *rv)
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:603: in save_reduce
    save(args)
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:475: in save
    f(self, obj) # Call unbound method with explicit self
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:729: in save_tuple
    save(element)
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:520: in save
    self.save_reduce(obj=obj, *rv)
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:603: in save_reduce
    save(args)
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:475: in save
    f(self, obj) # Call unbound method with explicit self
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:729: in save_tuple
    save(element)
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:520: in save
[...]
/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:729: in save_tuple
    save(element)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pickle._Pickler object at 0x0000000107794598>
obj = iteration_utilities.partial(<function capture at 0x00000001058bbe20>)
save_persistent_id = True

    def save(self, obj, save_persistent_id=True):
        self.framer.commit_frame()
    
        # Check for persistent id (defined by a subclass)
        pid = self.persistent_id(obj)
        if pid is not None and save_persistent_id:
            self.save_pers(pid)
            return
    
        # Check the memo
        x = self.memo.get(id(obj))
        if x is not None:
            self.write(self.get(x[0]))
            return
    
        # Check the type dispatch table
        t = type(obj)
        f = self.dispatch.get(t)
        if f is not None:
            f(self, obj) # Call unbound method with explicit self
            return
    
        # Check private dispatch table if any, or else copyreg.dispatch_table
        reduce = getattr(self, 'dispatch_table', dispatch_table).get(t)
        if reduce is not None:
            rv = reduce(obj)
        else:
            # Check for a class with a custom metaclass; treat as regular class
            try:
                issc = issubclass(t, type)
            except TypeError: # t is not a class (old Boost; see SF #502085)
                issc = False
            if issc:
                self.save_global(obj)
                return
    
            # Check for a __reduce_ex__ method, fall back to __reduce__
>           reduce = getattr(obj, "__reduce_ex__", None)
E           SystemError: <StackOverflow object at 0x103ccbf60>

/Users/runner/hostedtoolcache/PyPy/3.5.3/x64/lib-python/3/pickle.py:493: SystemError

DEPRECATION on setup.py

pip reports the following warning on install.

DEPRECATION: iteration-utilities is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559

Cannot find reference "duplicates" in __init__.py

In my script I wrote from iteration_utilities import duplicatess in PyCharm (2019.1.4 Community) and see next error message ("Cannot find reference "duplicates" in init.py")
But code works fine.

All I want to know is it pure PyCharm bug or it can be somehow fixed in code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.