Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: Write me a python program that plays the output of a .wav file on a Raspberry Pi Pico and add it to the /sweepai directory #51

Open
wants to merge 52 commits into
base: main
Choose a base branch
from

Conversation

sweep-ai[bot]
Copy link

@sweep-ai sweep-ai bot commented Jan 5, 2024

PR Feedback (click)

  • 👍 Sweep Did Well
  • 👎 Sweep Needs Improvement

Description

This pull request adds a new Python script, play_wav_pico.py, to the /sweepai directory. The script allows for playing the output of a .wav file on a Raspberry Pi Pico.

Summary

  • Added play_wav_pico.py to the /sweepai directory
  • The script uses the wave and machine modules
  • Defines a function play_wav(filename) that plays the .wav file specified by filename
  • The play_wav function reads the frames of the .wav file and sets the duty cycle of the PWM pin on the Raspberry Pi Pico accordingly
  • Added a main function that calls play_wav with a sample .wav file, audio.wav
  • The script is executed when the file is run directly

Fixes #50.


🎉 Latest improvements to Sweep:

  • We just released a dashboard to track Sweep's progress on your issue in real-time, showing every stage of the process – from search to planning and coding.
  • Sweep uses OpenAI's latest Assistant API to plan code changes and modify code! This is 3x faster and significantly more reliable as it allows Sweep to edit code and validate the changes in tight iterations, the same way as a human would.
  • Try using the GitHub issues extension to create Sweep issues directly from your editor! GitHub Issues and Pull Requests.

💡 To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

sweep-ai bot and others added 30 commits December 21, 2023 18:08
…_is_being_us

Sweep: Please identify where GitHub is being used as an Oauth 2.0 Application, and replace it with GitLab as the target. (✓ Sandbox Passed)
…_request_api

Sweep: identify where pyGitHub Pull Request API calls are being made, and replace them with the API spec from Python-GitLab for Merge Requests
…webhookevent

Sweep: Identify where GitHub issue webhook/event-listener is and replace it with a corresponding GitLab issue webhook/event-listener. (✓ Sandbox Passed)
…d_pr_endpoint

Sweep: update all issue related and PR endpoints from GitHub to GitLab (✓ Sandbox Passed)
…d_pull_reques

Sweep: help me update all issue and pull request endpoints as well as any endpoints used to scrape Repository code from GitHub to GitLab's API endpoint
[Sweep Rules] Fix type hinting in sweepai/pre_indexed_docs.py
bartbot and others added 22 commits December 24, 2023 01:21
Remove duplicate entries in DOCS_ENDPOINTS dictionary
…add_gitlab_ap

Sweep: update pre indexed docs to add GitLab API reference documentation for issues, webhooks, MRs, and pipelines
…20_library_to

Sweep: Add docs for python-gitlab 4.2.0 library to pre-indexed docs
Add Type Hints to sweepai/pre_indexed_docs.py
…y_to_point_to

Sweep: update SweepAI github-utils.py to point to their GitLab equivalents
Refactor repeated code in github_utils.py
Copy link
Author

sweep-ai bot commented Jan 5, 2024

Rollback Files For Sweep

  • Rollback changes to sweepai/play_wav_pico.py

Copy link
Author

sweep-ai bot commented Jan 5, 2024

Apply Sweep Rules to your PR?

  • Apply: We should use loguru for error logging. If the log is inside an exception, use logger.exception to add tracebacks, where logger is imported from loguru. Use f-strings for string formatting in logger calls.
  • Apply: There should be no debug log or print statements in production code.
  • Apply: All functions should have parameters and output annotated with type hints. Use list, tuple and dict instead of typing.List, typing.Tuple and typing.dict.
  • Apply: Leftover TODOs in the code should be handled.
  • Apply: All new business logic should have corresponding unit tests in the same directory. For example, sweepai/api_test.py tests sweepai/api.py. Use unittest and unittest.mock as required.
  • Apply: Any clearly inefficient or repeated code should be optimized or refactored.
  • Apply: Remove any comments before code that are obvious. For example # this prints hello world; print('hello world').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Sweep your software chores
Projects
None yet
1 participant