Giter VIP home page Giter VIP logo

advent23's Introduction

advent23

Collaboration on Advent of Code 2023.

Each day, a new challenge is released over at Advent of Code. If a template doesn't exist for a particular question, create one in src/advent23. If you are the first one to get the right answer for a given day, update ANSWERS in tests/advent23_tests/answers.py and commit the changes. One of us must solve the full problem and update ANSWERS in order for tests to activate for everyone.

Follow one-time setup if you don't have Git/Python/etc. installed.

Setup

Clone this repository by running the command below, and open it in VSCode. Alternatively, you can do this directly in VSCode.

git clone 'https://github.com/blakeNaccarato/advent23.git' '<destination-directory>'

When you first open the cloned directory in VSCode, you will be prompted to install recommended extensions. You should be able to get by without installing them, but they are generally useful extensions for Python development.

Next, either run the setup task (Tasks: Run Task in the command palette, then run setup: Setup project) or run ./setup.ps1 in the terminal. You will be prompted with, We noticed a new environment has been created. Do you want to select it for the workspace folder. Select Yes to this prompt.

One-time setup

These requirements should only need to be installed once on a given machine. Also, make sure you set up a GitHub account.

  • Git: Git allows for version control of your code and is required for versioning your code with GitHub, and using this template.
  • VSCode: This template focuses on custom configuration and extensions in VSCode to speed up the development process.
  • Cross-platform PowerShell: PowerShell is no longer Windows-only. Automations in this template are written for PowerShell, and should run on any platform.
  • Python: Install Python from the link rather than the Windows Store! This gives you the Python launcher, invoked with py, facilitates multiple Python versions being installed, and is required for this repository.

Features requiring certain accounts

These accounts may need to be linked to your GitHub account in order to use some of the features in the recommended extensions for this repository.

  • Sourcery: Sourcery does a great job of teaching valuable Python lessons as you code. It will suggest alternative wording for given code patterns, gently guiding you towards more "Pythonic" code.
  • GitLens: Installed along with recommended extensions. You may be prompted to create an account, which you can just link to your GitHub account if desired. This extension is indispensable for managing git-versioned projects.

advent23's People

Contributors

asennain avatar blakenaccarato avatar bradleynacc avatar

Watchers

 avatar

advent23's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • Update dependency ipython to v8.18.1

Detected dependencies

git-submodules
.gitmodules
  • submodules/template main@ccfb08cafacaa6df6bbc5b918e3ad28449e031cb
  • submodules/typings main@adb654ee0eb44438739db20be1d9db994ba434d6
github-actions
.github/workflows/changerelease.yml
.github/workflows/codeql.yml
.github/workflows/main.yml
.github/workflows/minimum.yml
.github/workflows/sphinx.yml
pip_requirements
.tools/requirements/requirements_both.txt
  • boilercore ==0.0.4
  • pytest-aoc ==1.23.3
.tools/requirements/requirements_ci.txt
.tools/requirements/requirements_core.txt
.tools/requirements/requirements_dev.txt
  • ipython ==8.17.2
.tools/requirements/requirements_docs.txt
pre-commit
.pre-commit-config.yaml

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

Update documentation from user feedback

  • Have a "Solve day one" article front-and-center, with the below troublesome details linked in, but not necessarily front-and-center
  • When installing recommended extensions, it is not necessary to install the "other" recommended extensions
  • Give a tour of Sourcery refactoring based on their onboarding materials, specifically differentiate between the refactoring features and the AI features, Opt-in is not required, disable Sourcery Code Lens in settings (consider hard-coding this)
  • When setting up .gitconfig on Windows 11 by default, it saves as .txt. Need to enable developer options to turn on file extensions. Cover privacy options l
  • Magic terminal activation may not happen before tasks.json task execution. Consider user settings.json experimental flags, recommend user pwsh profile modification, and possibly task rewriting
  • Manual breakpointing in notebooks is powerful but confusing. Detail just enough about test harness to convey the point
  • Detail the usage of magic notebook objects inp and chk, how these are hijacked for tests, and why you can't just Path("<...>.txt").read_text().
  • Detail checkpointing and how one user's solution can help another user solve via a focused test in advent23_tests.parametrize_compare.
  • Detail the blasphemous mixture of notebooks next to package modules, why this actually makes sense, and how this isn't a "package" in the traditional sense (not meant to be pip installed from PyPI, meant for refactoring and test/logic isolation, etc.)
  • Detail the "basic anatomy" of the repo, leaving details out for deeper write-up later
  • Detail interactions with Ruff and Pyright, especially the meaning of warnings/highlights and their severity
  • Detail the necessary evil of dealing with a flaky Problems pane
  • When suppressing Sourcery, make sure you do it locally

Allow direct comparison to checkpointed templates

Get attempted checks for a notebook like in Attempt.checks, but also return the nodes of the right-hand-side of assignments. Now get source code snippets given the original source and replace the RHS in code with values from the chk namespace obtained from executing the notebook.

Remove all lines not starting with chk in code cells after the first.

Produce template notebooks in this fashion.

Refactor common test/notebook logic and update input getter

  • Move input handling from advent23_tests to advent23 as e.g. get_input (consider name similarities)
  • Source advent23_tests.Case.inp and advent23.get_inp from it
  • Update get_inp to allow custom user inputs, e.g. yours or other user input
def get_inp(day: int, user: str = ""): ...

Support `$$` in `Stringer`

The while result != ... will misbehave because $$ turns to $, so a bare substitution will be necessary on the LHS, e.g. while Template(result). substitute() !=, or something similar. May need safe_substitute` or something like that.

Consider that $$ may enter back into the result pattern at any time, therefore this cannot be handled prior to the loop.

An is_valid() check or straight up $$ in ... may also work.

Inspect user checks cheaply

Don't run notebooks to discover checks, instead analyze the code nodes using nbformat and ast for keys of chk. Also, determine whether checks can be skipped if they are hardcoded (e.g. not set to a variable name).

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.