Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

kangwonlee/python-homework-template-scipy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

90 Commits

Repository files navigation

Python Homework Template

Please work on : exercise.py

Purpose 목적:

Why do we want to do this assignment? What do we want to accomplish?

Description 설명:

  • Describe homework here

Instructions 지침:

  • How to do this homework
  • This repository is for a numerical analysis assignment writing one or more python functions in exercise.py.
  • classroom.yml file is at .github/workflows/ folder. .github folder is hidden on the Linux operating system but will be visible on the Github repository.
  • Please set environment variable vars.ECA_HW_??? in the classroom.yml in the repository settings (Settings > Secrets and Variables > Actions > Variables) to your grader image (e.g., ghcr.io/your-org/eca-pytest-???:latest).
  • Set your AI feedback natural language in classroom.yml.
  • All executable lines in the exercise.py file should belong to a function. Please do not include any other code outside of the function.

Function Arguments 함수 인자

Argument
인자
Data Type
자료형
Description
설명
`a` | `float` | coefficient<br>계수
`x` | `List[float]` | a vector<br>벡터

Function Return 함수 반환

Return Value
반환값
Data Type
자료형
Description
설명
 `y` | `List[float]` | product of the coefficient and the vector<br>계수와 벡터의 곱

Tips 팁:

  • please add some more hints here

Happy coding!

Grading Criteria 채점 기준

Criteria
기준
Points
배점
Is the code written according to Python syntax?
Python 문법대로 작성되었는가?
1
Does code respect style guidelines?
코드 스타일 권고사항을 준수하는가?
1
Is the code implemented as required?
코드가 요구사항을 만족하는가?
3

Instructor Setup

This template is designed for use with GitHub Classroom. Before distributing to students, configure the following in your GitHub organization or repository settings.

How the Two-Repo Pattern Works

Each assignment requires two repositories:

  1. Homework template (this repo) — student-facing, contains the assignment skeleton (exercise.py) and the classroom.yml workflow that pulls the grader image and runs tests on student pushes.
  2. Grader template (python-pytest-template) — instructor-facing, contains pytest test files and a Dockerfile. Its CI builds and publishes a grader Docker image to GHCR.

Required Secrets

Set these in Settings > Secrets and variables > Actions > Secrets at the organization level (recommended) or per repository.

CR_PAT (required)

A GitHub Personal Access Token used to pull the grader Docker image from GHCR.

  1. Go to GitHub > Settings (user) > Developer settings > Personal access tokens > Fine-grained tokens.
  2. Click Generate new token.
  3. Set the following permissions:
Permission Access Purpose
Packages Read Pull grader Docker images from GHCR
  1. Copy the token and save it as a repository or organization secret named CR_PAT.

If using GitHub Classroom, set CR_PAT as an organization secret so all student repos inherit it automatically.

LLM API Keys (at least one required)

The AI tutor step provides personalized feedback to students. At least one key must be set. The workflow validates this and fails early if none are configured.

Secret Name Service Where to Obtain
CLAUDE_API_KEY Anthropic Claude https://console.anthropic.com/
GOOGLE_API_KEY Google Gemini https://aistudio.google.com/
XAI_API_KEY xAI Grok https://console.x.ai/
NVIDIA_NIM_API_KEY NVIDIA NIM https://build.nvidia.com/
PERPLEXITY_API_KEY Perplexity https://perplexity.ai/settings/api

DEFAULT_MODEL (optional)

Specifies the preferred LLM model. If unset, the AI tutor defaults to Gemini or uses whichever single key is available.

Repository Variable

Set in Settings > Secrets and variables > Actions > Variables tab.

ECA_HW_???

Replace ??? with your assignment identifier (e.g., PYTHON_GRADER_301 for assignment 301). The value is the full GHCR image URL of the grader, e.g.:

ghcr.io/your-org/eca-pytest-???:latest

If this variable is not set, the workflow falls back to auto-constructing the URL as ghcr.io/{owner}/python-pytest-{assignment_num}:latest, where {assignment_num} is extracted from the repository name.

Customizing for a New Assignment

  1. Use this template to create a new repository (click Use this template on GitHub).
  2. Edit README.md — fill in the Purpose, Description, Instructions, Example Run, and Tips sections.
  3. Edit exercise.py — provide starter code or an empty skeleton for students.
  4. Update the grading criteria table if point allocations differ.
  5. Set INPUT_EXPLANATION-IN in classroom.yml to the desired feedback language (default: "English").
  6. Set the CR_PAT secret, at least one LLM API key, and the ECA_HW_??? variable.

From here is common to all assignments.

Submission 제출 방법

  1. Modify the contents of the exercise.py file to write your program.
    exercise.py 파일의 내용을 수정하여 프로그램을 작성합니다.
  2. Use the GitHub online editor to commit and push your changes. (See below for detailed instructions)
    GitHub 온라인 편집기를 사용하여 수정 사항을 커밋하고 푸시합니다. (자세한 사용법은 아래 참조)
  3. At the Actions tab of your Github repository, please check the result.
    깃헙 저장소의 Actions 탭에서 결과를 확인 바랍니다.

How to Use the GitHub Online Editor
Github 온라인 편집기 사용법

  • Press the . key while viewing the files in your repository on GitHub. This will launch a web version of VS Code.
    저장소의 [Code] 탭을 선택 후 . 키를 누르면 MS VS Code 의 Web version 이 시작됨
  • Make your changes to the exercise.py file.
    exercise.py 파일을 수정
  • To commit your changes, click on the branch icon on the left sidebar (the third icon after the magnifying glass).
    수정 사항을 commit 등록 하려면 왼쪽에서 줄 셋 아래 (확대경 다음) 세번째 가지치기 아이콘 선택
  • Click the "+" sign next to the filename to stage your changes.
    파일 이름의 오른쪽 + 기호 선택 (staging)
  • Write a brief description of your changes in the text box above.
    위 빈칸에 변경 사항 설명 입력
  • Click "Commit & Push."
    [커밋 및 푸시] 선택
  • Click "Back to Repository" on the branch icon to return to your repository.
    줄 셋 의 [리포지토리로 이동] 선택하여 저장소로 복귀

Writing Descriptive Git Commit Messages
커밋 메시지 작성 권고안

  • To help you develop a better coding habits, we encourage descriptive Git commit messages when committing changes to your repositroy.
    보다 바람직한 코딩 습관을 기르기 위해, 저장소에 변경 사항을 등록할 때 메시지에 보다 자세히 설명하는 것을 권합니다.
  • A good commit message clearly explains what you changed and why, making it easier for you to understand your work later.
    바람직한 커밋 메시지는 무엇을 변경했는지, 왜 변경했는지를 명확히 설명하여 나중에 수정 사항을 이해하기 쉽게 도와줄 것입니다.

Guidelines for Commit Messages
메시지 작성 지침

  • Describe the change more specifically, e.g., "Add factorial function to exercise.py" or "Fix bug in sum calculation".
    변경 사항을 보다 구체적으로 설명합니다. 예를 들어, "exercise.py에 팩토리얼 함수 추가" 또는 "합계 계산 버그 수정"과 같이 작성합니다.

  • Use Action Verbs: Start with words like "Add", "Fix", "Update", or "Refactor".
    영문의 경우, "Add", "Fix", "Update", "Refactor"와 같은 동사로 시작합니다.

  • Avoid Vague Messages: Messages like "update" or "fix" can be too general.
    "update", "fix"와 같은 메시지는 너무 일반적입니다.

  • Keep It Concise: Aim for 15-50 characters, but ensure clarity.
    15-50자 정도로 간결하게 작성하되, 명확성을 유지합니다.

  • Examples 예:

    • Good: "Add unit tests for sort function in exercise.py"
      바람직: "exercise.py의 정렬 함수에 대한 단위 테스트 추가"
    • Bad: "update", "fix 1", "changed file"
      바람직하지 않음: "update", "fix 1", "changed file"

Why It Matters 왜 중요한가

  • Clear commit messages improve collaboration, debugging, and code review in real-world projects.
    커밋 메시지가 명확하면 프로젝트 실무에서 공동 작업, 버그 수정, 코드 검토에서 도움을 얻을 수 있을 것입니다.

Resources 참고 자료

NOTICE REGARDING STUDENT SUBMISSIONS
제출 결과물에 대한 알림

  • Your submissions for this assignment may be used for various educational purposes. These purposes may include developing and improving educational tools, research, creating test cases, and training datasets.
    제출 결과물은 다양한 교육 목적으로 사용될 수 있을 밝혀둡니다. (교육 도구 개발 및 개선, 연구, 테스트 케이스 및 교육용 데이터셋 생성 등).

  • The submissions will be anonymized and used solely for educational or research purposes. No personally identifiable information will be shared.
    제출된 결과물은 익명화되어 교육 및 연구 목적으로만 사용되며, 개인 식별 정보는 공유되지 않을 것입니다.

  • If you do not wish to have your submission used for any of these purposes, please inform the instructor before the assignment deadline.
    위와 같은 목적으로 사용되기 원하지 않는 경우, 과제 마감일 전에 강사에게 알려주기 바랍니다.

Acknowledgments

  • The template for this assigment is registered as a part of #C-2025-016393 in the Korea Copyright Commission.

Until here is common to all assignments.

About

GitHub Classroom ssignment template for SciPy

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /