vluzko / manifoldpy

Python tools for working with Manifold Markets
MIT License
32 stars 12 forks source link

NUMBER isn't a known market outcome type #159

Open cosmojg opened 5 months ago

cosmojg commented 5 months ago

After running the following snippet:

from manifoldpy import api
markets = api.get_all_markets()

I get the following output:

...
Fetched 118000 markets.
Fetched 119000 markets.
Fetched 119325 markets.
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File ~/micromamba/envs/cosmosis/lib/python3.12/site-packages/manifoldpy/api.py:279, in Market.from_json(json)
    278 try:
--> 279     cls = MARKET_TYPES_MAP[json["outcomeType"]]
    280 except KeyError:

KeyError: 'NUMBER'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
Cell In[4], line 1
----> 1 markets = api.get_all_markets()

File ~/micromamba/envs/cosmosis/lib/python3.12/site-packages/manifoldpy/api.py:786, in get_all_markets(after, limit)
    776 def get_all_markets(after: int = 0, limit: int = sys.maxsize) -> List[Market]:
    777     """Get all markets.
    778     Unlike get_markets, this will get all available markets, without a limit
    779     on the number fetched.
   (...)
    784         limit: The maximum number of markets to retrieve.
    785     """
--> 786     return [Market.from_json(x) for x in _get_all_markets(after=after, limit=limit)]

File ~/micromamba/envs/cosmosis/lib/python3.12/site-packages/manifoldpy/api.py:282, in Market.from_json(json)
    280 except KeyError:
    281     market_id = json["id"]
--> 282     raise ValueError(
    283         f'{json["outcomeType"]} isn\'t a known market outcome type. Submit a bug report for market ID {market_id}.'
    284     )
    285 return weak_structure(json, cls)

ValueError: NUMBER isn't a known market outcome type. Submit a bug report for market ID u87n1nThvUHM0GckVlHV.
vluzko commented 4 months ago

Okay, they've added a new market type. I'll have this fixed shortly.

Pipeliner commented 1 month ago

@vluzko hi! have you fixed this?

jg-you commented 1 month ago

Nope, gave up halfway because there's issues with multiple choice historical probabilities to fix as well

On Sun, Jul 28, 2024, 4:53 PM Vadim Evard @.***> wrote:

@vluzko https://github.com/vluzko hi! have you fixed this?

— Reply to this email directly, view it on GitHub https://github.com/vluzko/manifoldpy/issues/159#issuecomment-2254640852, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABU2VS7JZXXGR4OQULL7E7DZOVK37AVCNFSM6AAAAABF63YB4OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGY2DAOBVGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>