wimglenn / advent-of-code-data

Get your Advent of Code data with a single import statement
MIT License
515 stars 54 forks source link

Get unexpected response coerced int64 printed from submit #127

Closed DanielPerezJensen closed 11 months ago

DanielPerezJensen commented 11 months ago

Hi, I have been using submit function from this package for this years version of Advent of Code.

When I submit the second day using a normal call to the function, I get an unexpected response.

submit(solution, part="b", day=2, year=2023)

>>> coerced int64 value 86036 for 2023/02

I have thus far only seen this for the second day, part b. For the other day, and parts I get no such response. It doesn't break functionality, but may be unintended?

wimglenn commented 11 months ago

submit should only get called with a str or an int, other types may or may not work correctly, hence the warning message.

This is the expected behavior, it just means you're submitting a strange type (in your case it's submitting the result of an np.prod call, which was a numpy.int64 and not a stdlib int).

AOCD is telling you that the type got coerced automatically, so you might want to convert it yourself in your solution code. Since we can only post strings as answers to the server, you should generally only call submit with a str. However, numeric answers are so common that aocd also allows calling submit with an int.