Git Product home page Git Product logo

Comments (13)

FriedrichFroebel avatar FriedrichFroebel commented on August 14, 2024 1

Please provide a complete example (while omitting your credentials) and a complete traceback. Nevertheless, this seems to be a known issue which we cannot do much about as far as I am aware (see #182).

from pycaching.

FriedrichFroebel avatar FriedrichFroebel commented on August 14, 2024 1

Not completely correct, it returns a generator of Cache objects and uses advanced_search internally:

>>> import pycaching
>>> gc = pycaching.login(..., ...)
>>> gc.search(point=pycaching.Point(48, 12), limit=100)
<generator object Geocaching.advanced_search at 0x7f02c1f45bd0>
>>> list(gc.search(point=pycaching.Point(48, 12), limit=10))
[<pycaching.cache.Cache object at 0x7f02c2efece0>, <pycaching.cache.Cache object at 0x7f02c20abb20>, <pycaching.cache.Cache object at 0x7f02c20abfd0>, <pycaching.cache.Cache object at 0x7f02c1d02f80>, <pycaching.cache.Cache object at 0x7f02c1d02d70>, <pycaching.cache.Cache object at 0x7f02c1d02ef0>, <pycaching.cache.Cache object at 0x7f02c1d02ce0>, <pycaching.cache.Cache object at 0x7f02c1d03040>, <pycaching.cache.Cache object at 0x7f02c1d02dd0>, <pycaching.cache.Cache object at 0x7f02c1d02c80>]

from pycaching.

DarkOutcast6 avatar DarkOutcast6 commented on August 14, 2024

It is the same error as #182. If this indeed cannot be fixed, is there a workaround, such as a different search function to use instead of this one?

from pycaching.

FriedrichFroebel avatar FriedrichFroebel commented on August 14, 2024

No: While there are three other search functions (see the API docs), they all internally rely on the same base method advanced_search as does the regular search method.

from pycaching.

BelKed avatar BelKed commented on August 14, 2024

The problem you mentioned was fixed about half a year ago in #206.
If you want to use the fixed version of pycaching, you can install it with the following command:

pip install https://github.com/tomasbedrich/pycaching/archive/master.zip

from pycaching.

tomasbedrich avatar tomasbedrich commented on August 14, 2024
pip install https://github.com/tomasbedrich/pycaching/archive/master.zip

Isn’t it released?

from pycaching.

BelKed avatar BelKed commented on August 14, 2024

No, the latest version is 1.5 years old.

from pycaching.

tomasbedrich avatar tomasbedrich commented on August 14, 2024

Shame on me. Released now.

from pycaching.

DarkOutcast6 avatar DarkOutcast6 commented on August 14, 2024

Great! Got it working! Thanks for pushing the new release!

One final problem; the documentation states that the user can input 6 arguments into the geocaching.search() function, but I get a code error displaying TypeError: Geocaching.search() takes from 2 to 3 positional arguments but 8 were given when a attempt to put more then 2 arguments. Here is the code: geocaching.search(pycaching.Point.from_string(user_input),100,pycaching.geocaching.SortOrder.distance,False,100,pycaching.Point.from_string(user_input),None)

image()

from pycaching.

FriedrichFroebel avatar FriedrichFroebel commented on August 14, 2024

There is a * in-between, id est everything besides point and limit needs to use keywords. Additionally, you have seven parameters instead of six ones.

from pycaching.

DarkOutcast6 avatar DarkOutcast6 commented on August 14, 2024

I can't find anywhere in the documentation that described how I am supposed to get the cache objects that advanced_search() returns. How do I do this?

from pycaching.

FriedrichFroebel avatar FriedrichFroebel commented on August 14, 2024

What exactly is your issue with the returned objects? advanced_search will return you Cache objects directly, while there might be None entries in-between if there have been too many requests - this should be rather clear from reading the type hints which are shown in your above screenshot as well. (Depending on your limit, you might run into an infinite loop and thus the search never terminates unless you stop iterating, but your above example uses a limit of 100 which should not have this issue.)

from pycaching.

DarkOutcast6 avatar DarkOutcast6 commented on August 14, 2024

When using the search() function, it returns a advanced_search() object. Should this be happening? If so, how do I access the caches from the advanced_search() function?

from pycaching.

Related Issues (20)

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.