Code Monkey home page Code Monkey logo

advent-of-code-ocr's Introduction

๐Ÿ‘‹ Hey! I'm Ben.

Thanks for taking the time to check out my profile!

I'm an open-source developer, high school student, and huge fan of Python and HTML.

I love to code, write on Medium, and help others. I'm also a staff member at Python Discord, one of the largest Python communities on the planet.

If you like what you see here on my GitHub profile, check out my newsletter, blog, Twitter account, or Medium profile.

โค๏ธ To support my projects financially, check out my GitHub Sponsors profile!

advent-of-code-ocr's People

Contributors

bsoyka avatar deepsource-autofix[bot] avatar gahjelle avatar renovate-bot avatar

Stargazers

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

Watchers

 avatar  avatar

advent-of-code-ocr's Issues

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

This repository currently has no open or pending branches.


  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Add a function to accept NumPy arrays and nested iterables

I think it would be nice to use advent_of_code_ocr directly from numpy.

I had set as goal to stay as much as possible with numpy.ndarrays and to use advent_of_code_ocr as it is now, i would need to convert to string, just so that it would internally convert back to numpy.ndarray.

I already broke up the API in my fork https://github.com/pseyfert/advent-of-code-ocr/commits/numpy if you're interested i can open an MR (i made a few unrelated implementation changes which we maybe want to remove from my branch before merging.)

Remove NumPy as dependency?

Hi @bsoyka

Thanks for making this! It worked perfectly also for Day 13, 2021 ๐Ÿ‘
I had some issues with installing the library since NumPy has been pinned to a version that's not compatible with Python 3.10 in the version available on PyPI.

I looked at the code and noticed that it doesn't rely significantly on NumPy so that it's possible to make it work quite effectively only using the standard library. For instance, by doing something like:

    input_text = input_text.replace(fill_pixel, "#").replace(empty_pixel, ".")
    array = input_text.split("\n")

    rows, cols = len(array), len(array[0])
    if any(len(row) != cols for row in array):
        raise ValueError("all rows should have the same number of columns")
    if rows != 6:
        raise ValueError("incorrect number of rows (expected 6)")

    indices = [slice(start, start + 4) for start in range(0, cols, 5)]
    result = [
        ALPHABET_6["\n".join(row[index] for row in array)] for index in indices
    ]

    return "".join(result)

Would you be interested in me adding a PR that removes NumPy as a dependency, making the library easier to use?

Best,
Geir Arne

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.